@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,239 @@
1
+ <script setup lang="ts">
2
+ interface Option {
3
+ text: string;
4
+ correct: boolean;
5
+ }
6
+
7
+ const props = defineProps<{ content: Record<string, unknown> }>();
8
+ const emit = defineEmits<{ answered: [correct: boolean] }>();
9
+
10
+ const question = computed(() => (props.content.question as string) || '');
11
+ const options = computed<Option[]>(() => {
12
+ const raw = props.content.options;
13
+ if (!Array.isArray(raw)) return [];
14
+ return raw as Option[];
15
+ });
16
+
17
+ const selectedIndex = ref<number | null>(null);
18
+ const answered = ref(false);
19
+
20
+ const isCorrect = computed(() => {
21
+ if (selectedIndex.value === null) return false;
22
+ return options.value[selectedIndex.value]?.correct ?? false;
23
+ });
24
+
25
+ function selectOption(idx: number): void {
26
+ if (answered.value) return;
27
+ selectedIndex.value = idx;
28
+ answered.value = true;
29
+ emit('answered', isCorrect.value);
30
+ }
31
+
32
+ const optionKeys = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];
33
+
34
+ function optionClass(idx: number): string {
35
+ if (!answered.value) return '';
36
+ if (idx === selectedIndex.value && isCorrect.value) return 'selected-correct answered';
37
+ if (idx === selectedIndex.value && !isCorrect.value) return 'selected-wrong answered';
38
+ if (options.value[idx]?.correct) return 'reveal-correct answered';
39
+ return 'answered';
40
+ }
41
+ </script>
42
+
43
+ <template>
44
+ <div class="cpub-block-quiz">
45
+ <div class="cpub-quiz-header">
46
+ <span class="cpub-quiz-badge">QUIZ</span>
47
+ <span class="cpub-quiz-title-text">Knowledge Check</span>
48
+ </div>
49
+
50
+ <div class="cpub-quiz-body">
51
+ <div class="cpub-quiz-question">{{ question }}</div>
52
+
53
+ <div class="cpub-quiz-options" role="radiogroup" :aria-label="question">
54
+ <button
55
+ v-for="(opt, i) in options"
56
+ :key="i"
57
+ class="cpub-quiz-option"
58
+ :class="optionClass(i)"
59
+ role="radio"
60
+ :aria-checked="selectedIndex === i"
61
+ :aria-disabled="answered"
62
+ @click="selectOption(i)"
63
+ >
64
+ <span class="cpub-quiz-option-key">{{ optionKeys[i] || i + 1 }}</span>
65
+ <span class="cpub-quiz-option-text">{{ opt.text }}</span>
66
+ <span class="cpub-quiz-option-indicator">
67
+ <template v-if="answered && i === selectedIndex && isCorrect">
68
+ <i class="fa-solid fa-check"></i>
69
+ </template>
70
+ <template v-else-if="answered && i === selectedIndex && !isCorrect">
71
+ <i class="fa-solid fa-xmark"></i>
72
+ </template>
73
+ <template v-else-if="answered && opt.correct">
74
+ <i class="fa-solid fa-check"></i>
75
+ </template>
76
+ </span>
77
+ </button>
78
+ </div>
79
+
80
+ <div v-if="answered" class="cpub-quiz-feedback" :class="isCorrect ? 'correct' : 'wrong'">
81
+ <i :class="isCorrect ? 'fa-solid fa-circle-check' : 'fa-solid fa-circle-xmark'"></i>
82
+ <span>{{ isCorrect ? 'Correct!' : 'Not quite — the correct answer is highlighted above.' }}</span>
83
+ </div>
84
+ </div>
85
+ </div>
86
+ </template>
87
+
88
+ <style scoped>
89
+ .cpub-block-quiz {
90
+ background: var(--surface);
91
+ border: var(--border-width-default) solid var(--border);
92
+ margin: 28px 0;
93
+ box-shadow: var(--shadow-md);
94
+ }
95
+
96
+ .cpub-quiz-header {
97
+ display: flex;
98
+ align-items: center;
99
+ gap: 8px;
100
+ padding: 12px 16px;
101
+ border-bottom: var(--border-width-default) solid var(--border);
102
+ }
103
+
104
+ .cpub-quiz-badge {
105
+ font-family: var(--font-mono);
106
+ font-size: 9px;
107
+ letter-spacing: 0.08em;
108
+ color: var(--yellow);
109
+ background: var(--yellow-bg);
110
+ border: var(--border-width-default) solid var(--yellow-border);
111
+ padding: 3px 8px;
112
+ }
113
+
114
+ .cpub-quiz-title-text {
115
+ font-size: 13px;
116
+ font-weight: 700;
117
+ color: var(--text);
118
+ }
119
+
120
+ .cpub-quiz-body { padding: 16px 20px; }
121
+
122
+ .cpub-quiz-question {
123
+ font-size: 15px;
124
+ font-weight: 600;
125
+ color: var(--text);
126
+ line-height: 1.5;
127
+ margin-bottom: 16px;
128
+ }
129
+
130
+ .cpub-quiz-options {
131
+ display: flex;
132
+ flex-direction: column;
133
+ gap: 8px;
134
+ }
135
+
136
+ .cpub-quiz-option {
137
+ display: flex;
138
+ align-items: flex-start;
139
+ gap: 10px;
140
+ padding: 12px 14px;
141
+ background: var(--surface);
142
+ border: var(--border-width-default) solid var(--border);
143
+ cursor: pointer;
144
+ transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
145
+ user-select: none;
146
+ text-align: left;
147
+ width: 100%;
148
+ font-family: inherit;
149
+ font-size: inherit;
150
+ }
151
+
152
+ .cpub-quiz-option:hover:not(.answered) {
153
+ background: var(--surface2);
154
+ box-shadow: var(--shadow-sm);
155
+ }
156
+
157
+ .cpub-quiz-option.selected-correct {
158
+ background: var(--green-bg);
159
+ border-color: var(--green);
160
+ cursor: default;
161
+ }
162
+
163
+ .cpub-quiz-option.selected-wrong {
164
+ background: var(--red-bg);
165
+ border-color: var(--red);
166
+ cursor: default;
167
+ }
168
+
169
+ .cpub-quiz-option.reveal-correct {
170
+ background: var(--green-bg);
171
+ border-color: var(--green-border);
172
+ cursor: default;
173
+ }
174
+
175
+ .cpub-quiz-option.answered { cursor: default; box-shadow: none; }
176
+
177
+ .cpub-quiz-option-key {
178
+ font-family: var(--font-mono);
179
+ font-size: 11px;
180
+ font-weight: 700;
181
+ color: var(--text-faint);
182
+ width: 18px;
183
+ flex-shrink: 0;
184
+ margin-top: 1px;
185
+ }
186
+
187
+ .cpub-quiz-option.selected-correct .cpub-quiz-option-key { color: var(--green); }
188
+ .cpub-quiz-option.selected-wrong .cpub-quiz-option-key { color: var(--red); }
189
+ .cpub-quiz-option.reveal-correct .cpub-quiz-option-key { color: var(--green); }
190
+
191
+ .cpub-quiz-option-text {
192
+ font-size: 13px;
193
+ line-height: 1.5;
194
+ color: var(--text-dim);
195
+ flex: 1;
196
+ }
197
+
198
+ .cpub-quiz-option.selected-correct .cpub-quiz-option-text { color: var(--green); }
199
+ .cpub-quiz-option.selected-wrong .cpub-quiz-option-text { color: var(--red); }
200
+
201
+ .cpub-quiz-option-indicator {
202
+ font-size: 12px;
203
+ margin-top: 2px;
204
+ opacity: 0;
205
+ transition: opacity 0.15s;
206
+ flex-shrink: 0;
207
+ }
208
+
209
+ .cpub-quiz-option.selected-correct .cpub-quiz-option-indicator,
210
+ .cpub-quiz-option.selected-wrong .cpub-quiz-option-indicator,
211
+ .cpub-quiz-option.reveal-correct .cpub-quiz-option-indicator {
212
+ opacity: 1;
213
+ }
214
+
215
+ .cpub-quiz-option.selected-correct .cpub-quiz-option-indicator { color: var(--green); }
216
+ .cpub-quiz-option.selected-wrong .cpub-quiz-option-indicator { color: var(--red); }
217
+ .cpub-quiz-option.reveal-correct .cpub-quiz-option-indicator { color: var(--green); }
218
+
219
+ .cpub-quiz-feedback {
220
+ margin-top: 14px;
221
+ padding: 10px 12px;
222
+ font-size: 12px;
223
+ display: flex;
224
+ align-items: center;
225
+ gap: 8px;
226
+ }
227
+
228
+ .cpub-quiz-feedback.correct {
229
+ background: var(--green-bg);
230
+ border: var(--border-width-default) solid var(--green-border);
231
+ color: var(--green);
232
+ }
233
+
234
+ .cpub-quiz-feedback.wrong {
235
+ background: var(--red-bg);
236
+ border: var(--border-width-default) solid var(--red-border);
237
+ color: var(--red);
238
+ }
239
+ </style>
@@ -0,0 +1,41 @@
1
+ <script setup lang="ts">
2
+ import { sanitizeBlockHtml } from '../../composables/useSanitize';
3
+
4
+ const props = defineProps<{ content: Record<string, unknown> }>();
5
+
6
+ const html = computed(() => sanitizeBlockHtml((props.content.html as string) || (props.content.text as string) || ''));
7
+ const attribution = computed(() => (props.content.attribution as string) || '');
8
+ </script>
9
+
10
+ <template>
11
+ <blockquote class="cpub-block-quote">
12
+ <div class="cpub-quote-text" v-html="html" />
13
+ <footer v-if="attribution" class="cpub-quote-attr">— {{ attribution }}</footer>
14
+ </blockquote>
15
+ </template>
16
+
17
+ <style scoped>
18
+ .cpub-block-quote {
19
+ border-left: 4px solid var(--accent);
20
+ padding: 14px 20px;
21
+ margin: 24px 0;
22
+ background: var(--surface);
23
+ }
24
+
25
+ .cpub-quote-text {
26
+ font-size: 15px;
27
+ font-style: italic;
28
+ line-height: 1.65;
29
+ color: var(--text-dim);
30
+ }
31
+
32
+ .cpub-quote-text :deep(p) { margin: 0; }
33
+
34
+ .cpub-quote-attr {
35
+ margin-top: 10px;
36
+ font-size: 12px;
37
+ font-family: var(--font-mono);
38
+ color: var(--text-faint);
39
+ font-style: normal;
40
+ }
41
+ </style>
@@ -0,0 +1,58 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{ content: Record<string, unknown> }>();
3
+
4
+ const tag = computed(() => (props.content.tag as string) || '');
5
+ const title = computed(() => (props.content.title as string) || '');
6
+ const body = computed(() => (props.content.body as string) || '');
7
+ </script>
8
+
9
+ <template>
10
+ <div class="cpub-block-section-header">
11
+ <div v-if="tag" class="cpub-bsh-tag">{{ tag }}</div>
12
+ <h1 v-if="title" class="cpub-bsh-title">{{ title }}</h1>
13
+ <p v-if="body" class="cpub-bsh-body">{{ body }}</p>
14
+ </div>
15
+ </template>
16
+
17
+ <style scoped>
18
+ .cpub-block-section-header {
19
+ padding: 8px 0 16px;
20
+ }
21
+
22
+ .cpub-bsh-tag {
23
+ font-family: var(--font-mono);
24
+ font-size: 10px;
25
+ font-weight: 700;
26
+ letter-spacing: 0.12em;
27
+ text-transform: uppercase;
28
+ color: var(--accent);
29
+ margin-bottom: 14px;
30
+ display: flex;
31
+ align-items: center;
32
+ gap: 6px;
33
+ }
34
+
35
+ .cpub-bsh-tag::before {
36
+ content: '';
37
+ display: inline-block;
38
+ width: 12px;
39
+ height: 2px;
40
+ background: var(--accent);
41
+ }
42
+
43
+ .cpub-bsh-title {
44
+ font-size: 30px;
45
+ font-weight: 700;
46
+ color: var(--text);
47
+ line-height: 1.25;
48
+ margin-bottom: 12px;
49
+ letter-spacing: -0.02em;
50
+ }
51
+
52
+ .cpub-bsh-body {
53
+ font-size: 15px;
54
+ color: var(--text-dim);
55
+ line-height: 1.75;
56
+ max-width: 560px;
57
+ }
58
+ </style>
@@ -0,0 +1,236 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{ content: Record<string, unknown> }>();
3
+
4
+ const label = computed(() => (props.content.label as string) || 'Adjust Value');
5
+ const min = computed(() => (props.content.min as number) ?? 0);
6
+ const max = computed(() => (props.content.max as number) ?? 100);
7
+ const step = computed(() => (props.content.step as number) ?? 1);
8
+ const unit = computed(() => (props.content.unit as string) || '');
9
+ const defaultValue = computed(() => (props.content.defaultValue as number) ?? Math.round((min.value + max.value) / 2));
10
+
11
+ interface FeedbackRange {
12
+ min: number;
13
+ max: number;
14
+ state: string;
15
+ message: string;
16
+ }
17
+
18
+ const feedbackRanges = computed<FeedbackRange[]>(() => {
19
+ const raw = props.content.feedback;
20
+ if (!Array.isArray(raw)) return [];
21
+ return raw as FeedbackRange[];
22
+ });
23
+
24
+ const value = ref(defaultValue.value);
25
+
26
+ const fillPct = computed(() => {
27
+ return ((value.value - min.value) / (max.value - min.value)) * 100;
28
+ });
29
+
30
+ const currentFeedback = computed(() => {
31
+ return feedbackRanges.value.find(
32
+ (r) => value.value >= r.min && value.value <= r.max,
33
+ );
34
+ });
35
+
36
+ const feedbackState = computed(() => currentFeedback.value?.state || '');
37
+
38
+ const stateIcons: Record<string, string> = {
39
+ slow: 'fa-solid fa-gauge-simple',
40
+ ok: 'fa-solid fa-circle-check',
41
+ high: 'fa-solid fa-triangle-exclamation',
42
+ low: 'fa-solid fa-gauge-simple',
43
+ good: 'fa-solid fa-circle-check',
44
+ danger: 'fa-solid fa-triangle-exclamation',
45
+ };
46
+ </script>
47
+
48
+ <template>
49
+ <div class="cpub-block-slider">
50
+ <div class="cpub-card-header">
51
+ <div class="cpub-card-header-icon"><i class="fa-solid fa-sliders"></i></div>
52
+ <div class="cpub-card-header-label">
53
+ {{ label }}
54
+ <span>Interactive</span>
55
+ </div>
56
+ </div>
57
+
58
+ <div class="cpub-slider-value-display">{{ value }}{{ unit }}</div>
59
+
60
+ <div class="cpub-slider-track-wrap">
61
+ <div class="cpub-slider-fill-track" :style="{ width: fillPct + '%' }"></div>
62
+ <input
63
+ v-model.number="value"
64
+ type="range"
65
+ class="cpub-slider-input"
66
+ :min="min"
67
+ :max="max"
68
+ :step="step"
69
+ :aria-label="label"
70
+ />
71
+ </div>
72
+
73
+ <div class="cpub-slider-range-labels">
74
+ <span>{{ min }}{{ unit }}</span>
75
+ <span>{{ max }}{{ unit }}</span>
76
+ </div>
77
+
78
+ <div
79
+ v-if="currentFeedback"
80
+ class="cpub-slider-output"
81
+ :class="`state-${feedbackState}`"
82
+ >
83
+ <i :class="stateIcons[feedbackState] || 'fa-solid fa-circle-info'"></i>
84
+ <span class="cpub-slider-output-text">{{ currentFeedback.message }}</span>
85
+ </div>
86
+ </div>
87
+ </template>
88
+
89
+ <style scoped>
90
+ .cpub-block-slider {
91
+ background: var(--surface);
92
+ border: var(--border-width-default) solid var(--border);
93
+ border-left: 4px solid var(--accent);
94
+ padding: 22px 24px;
95
+ margin: 28px 0;
96
+ box-shadow: var(--shadow-md);
97
+ }
98
+
99
+ .cpub-card-header {
100
+ display: flex;
101
+ align-items: center;
102
+ gap: 10px;
103
+ margin-bottom: 16px;
104
+ }
105
+
106
+ .cpub-card-header-icon {
107
+ width: 30px;
108
+ height: 30px;
109
+ display: flex;
110
+ align-items: center;
111
+ justify-content: center;
112
+ background: var(--accent-bg);
113
+ border: var(--border-width-default) solid var(--accent-border);
114
+ color: var(--accent);
115
+ font-size: 13px;
116
+ flex-shrink: 0;
117
+ }
118
+
119
+ .cpub-card-header-label {
120
+ font-size: 13px;
121
+ font-weight: 700;
122
+ color: var(--text);
123
+ }
124
+
125
+ .cpub-card-header-label span {
126
+ font-family: var(--font-mono);
127
+ font-size: 12px;
128
+ color: var(--text-dim);
129
+ margin-left: 4px;
130
+ }
131
+
132
+ .cpub-slider-value-display {
133
+ font-family: var(--font-mono);
134
+ font-size: 24px;
135
+ font-weight: 700;
136
+ color: var(--accent);
137
+ margin-bottom: 14px;
138
+ letter-spacing: 0.04em;
139
+ }
140
+
141
+ .cpub-slider-track-wrap {
142
+ position: relative;
143
+ margin-bottom: 10px;
144
+ }
145
+
146
+ .cpub-slider-fill-track {
147
+ position: absolute;
148
+ top: 50%;
149
+ left: 0;
150
+ height: 6px;
151
+ background: var(--accent);
152
+ transform: translateY(-50%);
153
+ pointer-events: none;
154
+ transition: width 0.05s;
155
+ }
156
+
157
+ .cpub-slider-input {
158
+ -webkit-appearance: none;
159
+ appearance: none;
160
+ width: 100%;
161
+ height: 6px;
162
+ background: var(--surface3);
163
+ border: var(--border-width-default) solid var(--border);
164
+ outline: none;
165
+ cursor: pointer;
166
+ position: relative;
167
+ z-index: 1;
168
+ }
169
+
170
+ .cpub-slider-input::-webkit-slider-thumb {
171
+ -webkit-appearance: none;
172
+ appearance: none;
173
+ width: 18px;
174
+ height: 18px;
175
+ background: var(--accent);
176
+ border: var(--border-width-default) solid var(--border);
177
+ cursor: pointer;
178
+ box-shadow: var(--shadow-sm);
179
+ }
180
+
181
+ .cpub-slider-input::-moz-range-thumb {
182
+ width: 18px;
183
+ height: 18px;
184
+ background: var(--accent);
185
+ border: var(--border-width-default) solid var(--border);
186
+ cursor: pointer;
187
+ box-shadow: var(--shadow-sm);
188
+ }
189
+
190
+ .cpub-slider-range-labels {
191
+ display: flex;
192
+ justify-content: space-between;
193
+ margin-top: 8px;
194
+ }
195
+
196
+ .cpub-slider-range-labels span {
197
+ font-family: var(--font-mono);
198
+ font-size: 10px;
199
+ color: var(--text-faint);
200
+ }
201
+
202
+ .cpub-slider-output {
203
+ margin-top: 16px;
204
+ padding: 12px 14px;
205
+ font-size: 13px;
206
+ display: flex;
207
+ align-items: center;
208
+ gap: 8px;
209
+ transition: all 0.2s;
210
+ min-height: 42px;
211
+ }
212
+
213
+ .cpub-slider-output.state-slow,
214
+ .cpub-slider-output.state-low {
215
+ background: var(--yellow-bg);
216
+ border: var(--border-width-default) solid var(--yellow-border);
217
+ color: var(--yellow);
218
+ }
219
+
220
+ .cpub-slider-output.state-ok,
221
+ .cpub-slider-output.state-good {
222
+ background: var(--green-bg);
223
+ border: var(--border-width-default) solid var(--green-border);
224
+ color: var(--green);
225
+ }
226
+
227
+ .cpub-slider-output.state-high,
228
+ .cpub-slider-output.state-danger {
229
+ background: var(--red-bg);
230
+ border: var(--border-width-default) solid var(--red-border);
231
+ color: var(--red);
232
+ }
233
+
234
+ .cpub-slider-output i { font-size: 13px; flex-shrink: 0; }
235
+ .cpub-slider-output-text { line-height: 1.4; }
236
+ </style>
@@ -0,0 +1,41 @@
1
+ <script setup lang="ts">
2
+ import { sanitizeBlockHtml } from '../../composables/useSanitize';
3
+
4
+ const props = defineProps<{ content: Record<string, unknown> }>();
5
+ const html = computed(() => sanitizeBlockHtml((props.content.html as string) || ''));
6
+ </script>
7
+
8
+ <template>
9
+ <div class="cpub-block-text" v-html="html" />
10
+ </template>
11
+
12
+ <style scoped>
13
+ .cpub-block-text {
14
+ font-size: 15px;
15
+ line-height: 1.75;
16
+ color: var(--text-dim);
17
+ }
18
+
19
+ .cpub-block-text :deep(p) { margin-bottom: 14px; }
20
+ .cpub-block-text :deep(p:last-child) { margin-bottom: 0; }
21
+ .cpub-block-text :deep(strong) { color: var(--text); font-weight: 600; }
22
+ .cpub-block-text :deep(em) { font-style: italic; }
23
+ .cpub-block-text :deep(a) { color: var(--accent); text-decoration: none; }
24
+ .cpub-block-text :deep(a:hover) { text-decoration: underline; }
25
+ .cpub-block-text :deep(code) {
26
+ font-family: var(--font-mono);
27
+ font-size: 13px;
28
+ color: var(--teal);
29
+ background: var(--surface2);
30
+ border: var(--border-width-default) solid var(--border);
31
+ padding: 1px 6px;
32
+ }
33
+ .cpub-block-text :deep(ul),
34
+ .cpub-block-text :deep(ol) {
35
+ margin: 0 0 14px 20px;
36
+ display: flex;
37
+ flex-direction: column;
38
+ gap: 6px;
39
+ }
40
+ .cpub-block-text :deep(li) { color: var(--text-dim); }
41
+ </style>
@@ -0,0 +1,87 @@
1
+ <script setup lang="ts">
2
+ interface Tool {
3
+ name: string;
4
+ url?: string;
5
+ required?: boolean;
6
+ notes?: string;
7
+ }
8
+
9
+ const props = defineProps<{ content: Record<string, unknown> }>();
10
+
11
+ const tools = computed<Tool[]>(() => {
12
+ const raw = props.content.tools;
13
+ if (!Array.isArray(raw)) return [];
14
+ return raw as Tool[];
15
+ });
16
+ </script>
17
+
18
+ <template>
19
+ <div v-if="tools.length > 0" class="cpub-block-tools">
20
+ <div class="cpub-tools-header">
21
+ <i class="fa-solid fa-wrench cpub-tools-icon"></i>
22
+ <span class="cpub-tools-title">Tools Required</span>
23
+ <span class="cpub-tools-count">{{ tools.length }}</span>
24
+ </div>
25
+ <div class="cpub-tools-list">
26
+ <div v-for="(tool, i) in tools" :key="i" class="cpub-tool-item">
27
+ <i class="fa-solid fa-wrench cpub-tool-bullet"></i>
28
+ <span class="cpub-tool-name">
29
+ <a v-if="tool.url" :href="tool.url" target="_blank" rel="noopener">{{ tool.name }}</a>
30
+ <template v-else>{{ tool.name }}</template>
31
+ </span>
32
+ <span v-if="tool.notes" class="cpub-tool-notes">{{ tool.notes }}</span>
33
+ <span v-if="tool.required === false" class="cpub-tool-optional">optional</span>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </template>
38
+
39
+ <style scoped>
40
+ .cpub-block-tools {
41
+ border: var(--border-width-default) solid var(--border);
42
+ margin: 20px 0;
43
+ overflow: hidden;
44
+ box-shadow: var(--shadow-md);
45
+ }
46
+
47
+ .cpub-tools-header {
48
+ display: flex;
49
+ align-items: center;
50
+ gap: 8px;
51
+ padding: 10px 14px;
52
+ background: var(--surface2);
53
+ border-bottom: var(--border-width-default) solid var(--border);
54
+ }
55
+
56
+ .cpub-tools-icon { font-size: 12px; color: var(--accent); }
57
+ .cpub-tools-title { font-size: 12px; font-weight: 600; color: var(--text); flex: 1; }
58
+ .cpub-tools-count { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
59
+
60
+ .cpub-tools-list { padding: 8px 14px; }
61
+
62
+ .cpub-tool-item {
63
+ display: flex;
64
+ align-items: center;
65
+ gap: 8px;
66
+ padding: 8px 0;
67
+ border-bottom: var(--border-width-default) solid var(--border2);
68
+ font-size: 13px;
69
+ }
70
+
71
+ .cpub-tool-item:last-child { border-bottom: none; }
72
+
73
+ .cpub-tool-bullet { font-size: 10px; color: var(--text-faint); flex-shrink: 0; }
74
+ .cpub-tool-name { font-weight: 500; color: var(--text); }
75
+ .cpub-tool-name a { color: var(--accent); text-decoration: none; }
76
+ .cpub-tool-name a:hover { text-decoration: underline; }
77
+ .cpub-tool-notes { font-size: 11px; color: var(--text-faint); margin-left: auto; }
78
+
79
+ .cpub-tool-optional {
80
+ font-family: var(--font-mono);
81
+ font-size: 9px;
82
+ color: var(--text-faint);
83
+ border: var(--border-width-default) solid var(--border2);
84
+ padding: 1px 5px;
85
+ text-transform: uppercase;
86
+ }
87
+ </style>