@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.
- package/LICENSE +661 -0
- package/app.vue +7 -0
- package/components/AnnouncementBand.vue +117 -0
- package/components/AppToast.vue +108 -0
- package/components/AuthorCard.vue +119 -0
- package/components/AuthorRow.vue +81 -0
- package/components/CommentSection.vue +330 -0
- package/components/ContentCard.vue +340 -0
- package/components/ContentPicker.vue +240 -0
- package/components/ContentStarterForm.vue +214 -0
- package/components/ContentTypeBadge.vue +46 -0
- package/components/CountdownTimer.vue +68 -0
- package/components/CpubEditor.vue +87 -0
- package/components/DiscussionItem.vue +191 -0
- package/components/EditorPropertiesPanel.vue +393 -0
- package/components/EngagementBar.vue +131 -0
- package/components/FederatedContentCard.vue +291 -0
- package/components/FeedItem.vue +283 -0
- package/components/FilterChip.vue +21 -0
- package/components/HeatmapGrid.vue +92 -0
- package/components/ImageUpload.vue +219 -0
- package/components/MemberCard.vue +163 -0
- package/components/MessageThread.vue +120 -0
- package/components/NotificationItem.vue +103 -0
- package/components/ProgressTracker.vue +41 -0
- package/components/PublishErrorsModal.vue +116 -0
- package/components/RemoteActorCard.vue +206 -0
- package/components/RemoteUserSearch.vue +117 -0
- package/components/SearchFilters.vue +188 -0
- package/components/SearchSidebar.vue +181 -0
- package/components/SectionHeader.vue +17 -0
- package/components/ShareToHubModal.vue +189 -0
- package/components/SiteLogo.vue +21 -0
- package/components/SkillBar.vue +57 -0
- package/components/SortSelect.vue +30 -0
- package/components/StatBar.vue +14 -0
- package/components/TOCNav.vue +69 -0
- package/components/TimelineItem.vue +82 -0
- package/components/VideoCard.vue +106 -0
- package/components/blocks/BlockBuildStepView.vue +92 -0
- package/components/blocks/BlockCalloutView.vue +82 -0
- package/components/blocks/BlockCheckpointView.vue +50 -0
- package/components/blocks/BlockCodeView.vue +212 -0
- package/components/blocks/BlockContentRenderer.vue +143 -0
- package/components/blocks/BlockDividerView.vue +11 -0
- package/components/blocks/BlockDownloadsView.vue +126 -0
- package/components/blocks/BlockEmbedView.vue +61 -0
- package/components/blocks/BlockGalleryView.vue +57 -0
- package/components/blocks/BlockHeadingView.vue +29 -0
- package/components/blocks/BlockImageView.vue +34 -0
- package/components/blocks/BlockMarkdownView.vue +118 -0
- package/components/blocks/BlockMathView.vue +45 -0
- package/components/blocks/BlockPartsListView.vue +104 -0
- package/components/blocks/BlockQuizView.vue +239 -0
- package/components/blocks/BlockQuoteView.vue +41 -0
- package/components/blocks/BlockSectionHeaderView.vue +58 -0
- package/components/blocks/BlockSliderView.vue +236 -0
- package/components/blocks/BlockTextView.vue +41 -0
- package/components/blocks/BlockToolListView.vue +87 -0
- package/components/blocks/BlockVideoView.vue +89 -0
- package/components/editors/ArticleEditor.vue +545 -0
- package/components/editors/BlockCanvas.vue +487 -0
- package/components/editors/BlockInsertZone.vue +84 -0
- package/components/editors/BlockPicker.vue +285 -0
- package/components/editors/BlockWrapper.vue +192 -0
- package/components/editors/BlogEditor.vue +567 -0
- package/components/editors/EditorBlocks.vue +248 -0
- package/components/editors/EditorSection.vue +81 -0
- package/components/editors/EditorShell.vue +168 -0
- package/components/editors/EditorTagInput.vue +114 -0
- package/components/editors/EditorVisibility.vue +110 -0
- package/components/editors/ExplainerEditor.vue +503 -0
- package/components/editors/MarkdownImportDialog.vue +249 -0
- package/components/editors/ProjectEditor.vue +446 -0
- package/components/editors/blocks/BuildStepBlock.vue +102 -0
- package/components/editors/blocks/CalloutBlock.vue +122 -0
- package/components/editors/blocks/CheckpointBlock.vue +27 -0
- package/components/editors/blocks/CodeBlock.vue +177 -0
- package/components/editors/blocks/DividerBlock.vue +22 -0
- package/components/editors/blocks/DownloadsBlock.vue +41 -0
- package/components/editors/blocks/EmbedBlock.vue +20 -0
- package/components/editors/blocks/GalleryBlock.vue +236 -0
- package/components/editors/blocks/HeadingBlock.vue +96 -0
- package/components/editors/blocks/ImageBlock.vue +271 -0
- package/components/editors/blocks/MarkdownBlock.vue +258 -0
- package/components/editors/blocks/MathBlock.vue +37 -0
- package/components/editors/blocks/PartsListBlock.vue +358 -0
- package/components/editors/blocks/QuizBlock.vue +47 -0
- package/components/editors/blocks/QuoteBlock.vue +101 -0
- package/components/editors/blocks/SectionHeaderBlock.vue +130 -0
- package/components/editors/blocks/SliderBlock.vue +318 -0
- package/components/editors/blocks/TextBlock.vue +201 -0
- package/components/editors/blocks/ToolListBlock.vue +70 -0
- package/components/editors/blocks/VideoBlock.vue +22 -0
- package/components/hub/HubDiscussions.vue +47 -0
- package/components/hub/HubFeed.vue +199 -0
- package/components/hub/HubHero.vue +185 -0
- package/components/hub/HubLayout.vue +103 -0
- package/components/hub/HubMembers.vue +40 -0
- package/components/hub/HubProducts.vue +93 -0
- package/components/hub/HubProjects.vue +207 -0
- package/components/hub/HubSidebar.vue +12 -0
- package/components/hub/HubSidebarCard.vue +35 -0
- package/components/views/ArticleView.vue +771 -0
- package/components/views/BlogView.vue +667 -0
- package/components/views/ExplainerView.vue +688 -0
- package/components/views/ProjectView.vue +1500 -0
- package/composables/useApiError.ts +39 -0
- package/composables/useAuth.ts +87 -0
- package/composables/useBlockEditor.ts +187 -0
- package/composables/useContentSave.ts +253 -0
- package/composables/useContentTypes.ts +37 -0
- package/composables/useEngagement.ts +196 -0
- package/composables/useFeatures.ts +33 -0
- package/composables/useFederation.ts +72 -0
- package/composables/useJsonLd.ts +183 -0
- package/composables/useMarkdownImport.ts +77 -0
- package/composables/useMirrorContent.ts +105 -0
- package/composables/useNotifications.ts +73 -0
- package/composables/usePublishValidation.ts +65 -0
- package/composables/useSanitize.ts +34 -0
- package/composables/useSiteName.ts +4 -0
- package/composables/useTheme.ts +34 -0
- package/composables/useToast.ts +35 -0
- package/error.vue +129 -0
- package/layouts/admin.vue +213 -0
- package/layouts/auth.vue +63 -0
- package/layouts/default.vue +269 -0
- package/layouts/editor.vue +129 -0
- package/middleware/auth.ts +6 -0
- package/nuxt.config.ts +83 -0
- package/package.json +59 -0
- package/pages/[type]/[slug]/edit.vue +676 -0
- package/pages/[type]/[slug]/index.vue +313 -0
- package/pages/[type]/index.vue +118 -0
- package/pages/about.vue +100 -0
- package/pages/admin/audit.vue +66 -0
- package/pages/admin/content.vue +116 -0
- package/pages/admin/federation.vue +446 -0
- package/pages/admin/index.vue +62 -0
- package/pages/admin/reports.vue +88 -0
- package/pages/admin/settings.vue +167 -0
- package/pages/admin/users.vue +145 -0
- package/pages/auth/forgot-password.vue +103 -0
- package/pages/auth/login.vue +216 -0
- package/pages/auth/oauth/authorize.vue +178 -0
- package/pages/auth/register.vue +246 -0
- package/pages/auth/reset-password.vue +124 -0
- package/pages/auth/verify-email.vue +80 -0
- package/pages/cert/[code].vue +154 -0
- package/pages/contests/[slug]/edit.vue +153 -0
- package/pages/contests/[slug]/index.vue +556 -0
- package/pages/contests/[slug]/judge.vue +160 -0
- package/pages/contests/create.vue +192 -0
- package/pages/contests/index.vue +69 -0
- package/pages/create.vue +219 -0
- package/pages/dashboard.vue +521 -0
- package/pages/docs/[siteSlug]/[...pagePath].vue +704 -0
- package/pages/docs/[siteSlug]/edit.vue +480 -0
- package/pages/docs/[siteSlug]/index.vue +380 -0
- package/pages/docs/create.vue +60 -0
- package/pages/docs/index.vue +181 -0
- package/pages/explore.vue +422 -0
- package/pages/federated-hubs/[id]/index.vue +385 -0
- package/pages/federated-hubs/[id]/posts/[postId].vue +309 -0
- package/pages/federation/index.vue +157 -0
- package/pages/federation/search.vue +43 -0
- package/pages/federation/users/[handle].vue +221 -0
- package/pages/feed.vue +135 -0
- package/pages/hubs/[slug]/index.vue +513 -0
- package/pages/hubs/[slug]/members.vue +134 -0
- package/pages/hubs/[slug]/posts/[postId].vue +352 -0
- package/pages/hubs/[slug]/settings.vue +254 -0
- package/pages/hubs/create.vue +201 -0
- package/pages/hubs/index.vue +207 -0
- package/pages/index.vue +1005 -0
- package/pages/learn/[slug]/[lessonSlug]/edit.vue +413 -0
- package/pages/learn/[slug]/[lessonSlug]/index.vue +438 -0
- package/pages/learn/[slug]/edit.vue +414 -0
- package/pages/learn/[slug]/index.vue +341 -0
- package/pages/learn/create.vue +71 -0
- package/pages/learn/index.vue +360 -0
- package/pages/messages/[conversationId].vue +113 -0
- package/pages/messages/index.vue +303 -0
- package/pages/mirror/[id].vue +115 -0
- package/pages/notifications.vue +91 -0
- package/pages/products/[slug].vue +128 -0
- package/pages/products/index.vue +122 -0
- package/pages/search.vue +692 -0
- package/pages/settings/account.vue +170 -0
- package/pages/settings/appearance.vue +80 -0
- package/pages/settings/index.vue +81 -0
- package/pages/settings/notifications.vue +68 -0
- package/pages/settings/profile.vue +838 -0
- package/pages/tags/[slug].vue +111 -0
- package/pages/tags/index.vue +73 -0
- package/pages/u/[username]/followers.vue +86 -0
- package/pages/u/[username]/following.vue +94 -0
- package/pages/u/[username]/index.vue +837 -0
- package/pages/videos/[id].vue +212 -0
- package/pages/videos/index.vue +327 -0
- package/pages/videos/submit.vue +112 -0
- package/plugins/auth.ts +23 -0
- package/server/api/admin/audit.get.ts +17 -0
- package/server/api/admin/content/[id].delete.ts +15 -0
- package/server/api/admin/content/[id].patch.ts +37 -0
- package/server/api/admin/federation/activity.get.ts +31 -0
- package/server/api/admin/federation/clients.get.ts +9 -0
- package/server/api/admin/federation/clients.post.ts +16 -0
- package/server/api/admin/federation/hub-mirrors/index.get.ts +10 -0
- package/server/api/admin/federation/hub-mirrors/index.post.ts +42 -0
- package/server/api/admin/federation/mirrors/[id]/backfill.post.ts +39 -0
- package/server/api/admin/federation/mirrors/[id].delete.ts +11 -0
- package/server/api/admin/federation/mirrors/[id].get.ts +15 -0
- package/server/api/admin/federation/mirrors/[id].put.ts +22 -0
- package/server/api/admin/federation/mirrors/index.get.ts +9 -0
- package/server/api/admin/federation/mirrors/index.post.ts +30 -0
- package/server/api/admin/federation/pending.get.ts +22 -0
- package/server/api/admin/federation/refederate.post.ts +92 -0
- package/server/api/admin/federation/repair-types.post.ts +57 -0
- package/server/api/admin/federation/retry.post.ts +41 -0
- package/server/api/admin/federation/stats.get.ts +26 -0
- package/server/api/admin/reports/[id]/resolve.post.ts +12 -0
- package/server/api/admin/reports.get.ts +17 -0
- package/server/api/admin/settings.get.ts +22 -0
- package/server/api/admin/settings.put.ts +11 -0
- package/server/api/admin/stats.get.ts +9 -0
- package/server/api/admin/users/[id]/role.put.ts +12 -0
- package/server/api/admin/users/[id]/status.put.ts +12 -0
- package/server/api/admin/users/[id].delete.ts +10 -0
- package/server/api/admin/users.get.ts +18 -0
- package/server/api/auth/federated/callback.get.ts +67 -0
- package/server/api/auth/federated/login.post.ts +60 -0
- package/server/api/auth/oauth2/authorize.get.ts +30 -0
- package/server/api/auth/oauth2/authorize.post.ts +51 -0
- package/server/api/auth/oauth2/register.post.ts +41 -0
- package/server/api/auth/oauth2/token.post.ts +48 -0
- package/server/api/cert/[code].get.ts +13 -0
- package/server/api/content/[id]/build.post.ts +9 -0
- package/server/api/content/[id]/fork.post.ts +10 -0
- package/server/api/content/[id]/index.delete.ts +18 -0
- package/server/api/content/[id]/index.get.ts +15 -0
- package/server/api/content/[id]/index.put.ts +23 -0
- package/server/api/content/[id]/products/[productId].delete.ts +28 -0
- package/server/api/content/[id]/products-sync.post.ts +29 -0
- package/server/api/content/[id]/products.get.ts +9 -0
- package/server/api/content/[id]/products.post.ts +31 -0
- package/server/api/content/[id]/publish.post.ts +17 -0
- package/server/api/content/[id]/report.post.ts +17 -0
- package/server/api/content/[id]/versions.get.ts +9 -0
- package/server/api/content/[id]/view.post.ts +34 -0
- package/server/api/content/index.get.ts +23 -0
- package/server/api/content/index.post.ts +11 -0
- package/server/api/contests/[slug]/entries.get.ts +18 -0
- package/server/api/contests/[slug]/entries.post.ts +23 -0
- package/server/api/contests/[slug]/index.delete.ts +21 -0
- package/server/api/contests/[slug]/index.get.ts +11 -0
- package/server/api/contests/[slug]/index.put.ts +15 -0
- package/server/api/contests/[slug]/judge.post.ts +12 -0
- package/server/api/contests/[slug]/transition.post.ts +24 -0
- package/server/api/contests/index.get.ts +10 -0
- package/server/api/contests/index.post.ts +28 -0
- package/server/api/docs/[siteSlug]/index.delete.ts +14 -0
- package/server/api/docs/[siteSlug]/index.get.ts +17 -0
- package/server/api/docs/[siteSlug]/index.put.ts +20 -0
- package/server/api/docs/[siteSlug]/nav.get.ts +26 -0
- package/server/api/docs/[siteSlug]/pages/[pageId].delete.ts +14 -0
- package/server/api/docs/[siteSlug]/pages/[pageId].get.ts +31 -0
- package/server/api/docs/[siteSlug]/pages/[pageId].put.ts +15 -0
- package/server/api/docs/[siteSlug]/pages/index.get.ts +34 -0
- package/server/api/docs/[siteSlug]/pages/index.post.ts +28 -0
- package/server/api/docs/[siteSlug]/pages/reorder.post.ts +26 -0
- package/server/api/docs/[siteSlug]/search.get.ts +20 -0
- package/server/api/docs/[siteSlug]/versions.post.ts +11 -0
- package/server/api/docs/index.get.ts +6 -0
- package/server/api/docs/index.post.ts +10 -0
- package/server/api/federated-hubs/[id]/posts/[postId].get.ts +16 -0
- package/server/api/federated-hubs/[id]/posts.get.ts +15 -0
- package/server/api/federated-hubs/[id].get.ts +16 -0
- package/server/api/federation/boost.post.ts +21 -0
- package/server/api/federation/content/[id].get.ts +15 -0
- package/server/api/federation/follow.post.ts +16 -0
- package/server/api/federation/health.get.ts +56 -0
- package/server/api/federation/hub-follow.post.ts +27 -0
- package/server/api/federation/hub-post-like.post.ts +115 -0
- package/server/api/federation/hub-post-likes.get.ts +24 -0
- package/server/api/federation/hub-post-reply.post.ts +42 -0
- package/server/api/federation/hub-post.post.ts +33 -0
- package/server/api/federation/like.post.ts +21 -0
- package/server/api/federation/remote-actor.get.ts +22 -0
- package/server/api/federation/reply.post.ts +22 -0
- package/server/api/federation/search.post.ts +17 -0
- package/server/api/federation/timeline.get.ts +22 -0
- package/server/api/federation/unfollow.post.ts +17 -0
- package/server/api/files/[id].delete.ts +35 -0
- package/server/api/files/mine.get.ts +31 -0
- package/server/api/files/upload-from-url.post.ts +68 -0
- package/server/api/files/upload.post.ts +105 -0
- package/server/api/health.get.ts +4 -0
- package/server/api/hubs/[slug]/bans/[userId].delete.ts +13 -0
- package/server/api/hubs/[slug]/bans.get.ts +20 -0
- package/server/api/hubs/[slug]/bans.post.ts +23 -0
- package/server/api/hubs/[slug]/feed.xml.get.ts +60 -0
- package/server/api/hubs/[slug]/gallery.get.ts +21 -0
- package/server/api/hubs/[slug]/index.delete.ts +18 -0
- package/server/api/hubs/[slug]/index.get.ts +14 -0
- package/server/api/hubs/[slug]/index.put.ts +22 -0
- package/server/api/hubs/[slug]/invites.get.ts +20 -0
- package/server/api/hubs/[slug]/invites.post.ts +27 -0
- package/server/api/hubs/[slug]/join.post.ts +17 -0
- package/server/api/hubs/[slug]/leave.post.ts +13 -0
- package/server/api/hubs/[slug]/members/[userId].delete.ts +13 -0
- package/server/api/hubs/[slug]/members/[userId].put.ts +16 -0
- package/server/api/hubs/[slug]/members.get.ts +20 -0
- package/server/api/hubs/[slug]/posts/[postId]/like.post.ts +21 -0
- package/server/api/hubs/[slug]/posts/[postId]/lock.post.ts +17 -0
- package/server/api/hubs/[slug]/posts/[postId]/pin.post.ts +17 -0
- package/server/api/hubs/[slug]/posts/[postId]/replies.get.ts +16 -0
- package/server/api/hubs/[slug]/posts/[postId]/replies.post.ts +21 -0
- package/server/api/hubs/[slug]/posts/[postId].delete.ts +23 -0
- package/server/api/hubs/[slug]/posts/[postId].get.ts +16 -0
- package/server/api/hubs/[slug]/posts/index.get.ts +16 -0
- package/server/api/hubs/[slug]/posts/index.post.ts +36 -0
- package/server/api/hubs/[slug]/products.get.ts +26 -0
- package/server/api/hubs/[slug]/products.post.ts +18 -0
- package/server/api/hubs/[slug]/share.post.ts +39 -0
- package/server/api/hubs/index.get.ts +15 -0
- package/server/api/hubs/index.post.ts +11 -0
- package/server/api/image-proxy.get.ts +91 -0
- package/server/api/learn/[slug]/[lessonSlug]/complete.post.ts +13 -0
- package/server/api/learn/[slug]/[lessonSlug]/index.get.ts +68 -0
- package/server/api/learn/[slug]/enroll.post.ts +12 -0
- package/server/api/learn/[slug]/index.delete.ts +12 -0
- package/server/api/learn/[slug]/index.get.ts +14 -0
- package/server/api/learn/[slug]/index.put.ts +19 -0
- package/server/api/learn/[slug]/lessons/[lessonId].delete.ts +14 -0
- package/server/api/learn/[slug]/lessons/[lessonId].put.ts +24 -0
- package/server/api/learn/[slug]/lessons.post.ts +10 -0
- package/server/api/learn/[slug]/modules/[moduleId].delete.ts +14 -0
- package/server/api/learn/[slug]/modules/[moduleId].put.ts +15 -0
- package/server/api/learn/[slug]/modules.post.ts +14 -0
- package/server/api/learn/[slug]/publish.post.ts +13 -0
- package/server/api/learn/[slug]/unenroll.post.ts +12 -0
- package/server/api/learn/certificates.get.ts +9 -0
- package/server/api/learn/enrollments.get.ts +9 -0
- package/server/api/learn/index.get.ts +17 -0
- package/server/api/learn/index.post.ts +11 -0
- package/server/api/me.get.ts +13 -0
- package/server/api/messages/[conversationId]/info.get.ts +43 -0
- package/server/api/messages/[conversationId]/stream.get.ts +73 -0
- package/server/api/messages/[conversationId].get.ts +13 -0
- package/server/api/messages/[conversationId].post.ts +12 -0
- package/server/api/messages/index.get.ts +39 -0
- package/server/api/messages/index.post.ts +58 -0
- package/server/api/notifications/[id].delete.ts +11 -0
- package/server/api/notifications/count.get.ts +10 -0
- package/server/api/notifications/index.get.ts +24 -0
- package/server/api/notifications/read.post.ts +15 -0
- package/server/api/notifications/stream.get.ts +59 -0
- package/server/api/openapi.get.ts +5 -0
- package/server/api/products/[id].delete.ts +15 -0
- package/server/api/products/[id].put.ts +18 -0
- package/server/api/products/[slug]/content.get.ts +21 -0
- package/server/api/products/[slug].get.ts +16 -0
- package/server/api/products/index.get.ts +28 -0
- package/server/api/profile.get.ts +15 -0
- package/server/api/profile.put.ts +24 -0
- package/server/api/resolve-identity.post.ts +34 -0
- package/server/api/search/index.get.ts +24 -0
- package/server/api/search/trending.get.ts +22 -0
- package/server/api/social/bookmark.get.ts +16 -0
- package/server/api/social/bookmark.post.ts +15 -0
- package/server/api/social/bookmarks.get.ts +16 -0
- package/server/api/social/comments/[id].delete.ts +13 -0
- package/server/api/social/comments.get.ts +18 -0
- package/server/api/social/comments.post.ts +11 -0
- package/server/api/social/like.get.ts +17 -0
- package/server/api/social/like.post.ts +35 -0
- package/server/api/stats.get.ts +8 -0
- package/server/api/user/hubs.get.ts +22 -0
- package/server/api/users/[username]/content.get.ts +21 -0
- package/server/api/users/[username]/feed.xml.get.ts +65 -0
- package/server/api/users/[username]/follow.delete.ts +15 -0
- package/server/api/users/[username]/follow.post.ts +15 -0
- package/server/api/users/[username]/followers.get.ts +22 -0
- package/server/api/users/[username]/following.get.ts +22 -0
- package/server/api/users/[username]/learning.get.ts +18 -0
- package/server/api/users/[username].get.ts +25 -0
- package/server/api/users/index.get.ts +78 -0
- package/server/api/videos/[id].get.ts +18 -0
- package/server/api/videos/categories/[id].delete.ts +15 -0
- package/server/api/videos/categories/[id].put.ts +17 -0
- package/server/api/videos/categories.get.ts +7 -0
- package/server/api/videos/categories.post.ts +11 -0
- package/server/api/videos/index.get.ts +20 -0
- package/server/api/videos/index.post.ts +11 -0
- package/server/middleware/auth.ts +180 -0
- package/server/middleware/features.ts +31 -0
- package/server/middleware/security.ts +54 -0
- package/server/plugins/auto-admin.ts +69 -0
- package/server/plugins/federation-delivery.ts +74 -0
- package/server/routes/.well-known/nodeinfo.ts +15 -0
- package/server/routes/.well-known/webfinger.ts +86 -0
- package/server/routes/actor/followers.ts +34 -0
- package/server/routes/actor/following.ts +34 -0
- package/server/routes/actor/outbox.ts +31 -0
- package/server/routes/actor.ts +30 -0
- package/server/routes/feed.xml.ts +59 -0
- package/server/routes/hubs/[slug]/followers.ts +39 -0
- package/server/routes/hubs/[slug]/inbox.ts +35 -0
- package/server/routes/hubs/[slug]/outbox.ts +43 -0
- package/server/routes/hubs/[slug]/posts/[postId].ts +63 -0
- package/server/routes/hubs/[slug].ts +29 -0
- package/server/routes/inbox.ts +34 -0
- package/server/routes/nodeinfo/2.1.ts +27 -0
- package/server/routes/robots.txt.ts +19 -0
- package/server/routes/sitemap.xml.ts +105 -0
- package/server/routes/users/[username]/followers.ts +33 -0
- package/server/routes/users/[username]/following.ts +33 -0
- package/server/routes/users/[username]/inbox.ts +34 -0
- package/server/routes/users/[username]/outbox.ts +35 -0
- package/server/routes/users/[username].ts +62 -0
- package/server/utils/auth.ts +36 -0
- package/server/utils/db.ts +34 -0
- package/server/utils/errors.ts +24 -0
- package/server/utils/inbox.ts +122 -0
- package/server/utils/validate.ts +82 -0
- package/theme/base.css +283 -0
- package/theme/components.css +322 -0
- package/theme/dark.css +87 -0
- package/theme/editor-panels.css +63 -0
- package/theme/forms.css +216 -0
- package/theme/generics.css +68 -0
- package/theme/layouts.css +415 -0
- package/theme/prose.css +342 -0
- package/types/hub.ts +61 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{
|
|
3
|
+
targetType: string;
|
|
4
|
+
targetId: string;
|
|
5
|
+
targetTitle?: string;
|
|
6
|
+
likeCount: number;
|
|
7
|
+
commentCount: number;
|
|
8
|
+
isLiked?: boolean;
|
|
9
|
+
isBookmarked?: boolean;
|
|
10
|
+
}>();
|
|
11
|
+
|
|
12
|
+
const emit = defineEmits<{
|
|
13
|
+
like: [];
|
|
14
|
+
bookmark: [];
|
|
15
|
+
share: [];
|
|
16
|
+
comment: [];
|
|
17
|
+
}>();
|
|
18
|
+
|
|
19
|
+
const contentId = computed(() => props.targetId);
|
|
20
|
+
const contentType = computed(() => props.targetType);
|
|
21
|
+
const { liked, bookmarked, likeCount, toggleLike, toggleBookmark, share, setInitialState } = useEngagement({ contentId, contentType });
|
|
22
|
+
const { isAuthenticated } = useAuth();
|
|
23
|
+
const showHubModal = ref(false);
|
|
24
|
+
|
|
25
|
+
// Sync initial state from props
|
|
26
|
+
watch(() => [props.isLiked, props.isBookmarked, props.likeCount] as const, ([l, b, c]) => {
|
|
27
|
+
setInitialState(l ?? false, b ?? false, c);
|
|
28
|
+
}, { immediate: true });
|
|
29
|
+
|
|
30
|
+
async function handleLike(): Promise<void> {
|
|
31
|
+
await toggleLike();
|
|
32
|
+
emit('like');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function handleBookmark(): Promise<void> {
|
|
36
|
+
await toggleBookmark();
|
|
37
|
+
emit('bookmark');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async function handleShare(): Promise<void> {
|
|
41
|
+
await share();
|
|
42
|
+
emit('share');
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<div class="cpub-engagement" role="toolbar" aria-label="Content actions">
|
|
48
|
+
<button
|
|
49
|
+
class="cpub-engage-btn"
|
|
50
|
+
:class="{ 'cpub-engage-active': liked }"
|
|
51
|
+
:aria-pressed="liked"
|
|
52
|
+
aria-label="Like"
|
|
53
|
+
@click="handleLike"
|
|
54
|
+
>
|
|
55
|
+
<i :class="liked ? 'fa-solid fa-heart' : 'fa-regular fa-heart'"></i>
|
|
56
|
+
<span>{{ likeCount }}</span>
|
|
57
|
+
</button>
|
|
58
|
+
|
|
59
|
+
<button class="cpub-engage-btn" aria-label="Comments" @click="$emit('comment')">
|
|
60
|
+
<i class="fa-regular fa-comment"></i>
|
|
61
|
+
<span>{{ commentCount }}</span>
|
|
62
|
+
</button>
|
|
63
|
+
|
|
64
|
+
<button
|
|
65
|
+
class="cpub-engage-btn"
|
|
66
|
+
:class="{ 'cpub-engage-active': bookmarked }"
|
|
67
|
+
:aria-pressed="bookmarked"
|
|
68
|
+
aria-label="Bookmark"
|
|
69
|
+
@click="handleBookmark"
|
|
70
|
+
>
|
|
71
|
+
<i :class="bookmarked ? 'fa-solid fa-bookmark' : 'fa-regular fa-bookmark'"></i>
|
|
72
|
+
</button>
|
|
73
|
+
|
|
74
|
+
<button v-if="isAuthenticated" class="cpub-engage-btn" aria-label="Share to Hub" @click="showHubModal = true">
|
|
75
|
+
<i class="fa-solid fa-users"></i>
|
|
76
|
+
<span>Hub</span>
|
|
77
|
+
</button>
|
|
78
|
+
|
|
79
|
+
<button class="cpub-engage-btn" aria-label="Share" @click="handleShare">
|
|
80
|
+
<i class="fa-solid fa-share-nodes"></i>
|
|
81
|
+
</button>
|
|
82
|
+
|
|
83
|
+
<ShareToHubModal
|
|
84
|
+
v-if="showHubModal"
|
|
85
|
+
:content-id="targetId"
|
|
86
|
+
:content-title="targetTitle || 'this content'"
|
|
87
|
+
@close="showHubModal = false"
|
|
88
|
+
@shared="showHubModal = false"
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
92
|
+
|
|
93
|
+
<style scoped>
|
|
94
|
+
.cpub-engagement {
|
|
95
|
+
display: flex;
|
|
96
|
+
gap: var(--space-1);
|
|
97
|
+
padding: var(--space-3) 0;
|
|
98
|
+
border-top: var(--border-width-default) solid var(--border);
|
|
99
|
+
border-bottom: var(--border-width-default) solid var(--border);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.cpub-engage-btn {
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
gap: var(--space-2);
|
|
106
|
+
padding: var(--space-2) var(--space-3);
|
|
107
|
+
background: none;
|
|
108
|
+
border: var(--border-width-default) solid transparent;
|
|
109
|
+
font-family: var(--font-sans);
|
|
110
|
+
font-size: var(--text-sm);
|
|
111
|
+
color: var(--text-dim);
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
transition: all 0.15s;
|
|
114
|
+
min-height: 44px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.cpub-engage-btn:hover {
|
|
118
|
+
background: var(--surface2);
|
|
119
|
+
border-color: var(--border2);
|
|
120
|
+
color: var(--text);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.cpub-engage-active {
|
|
124
|
+
color: var(--accent);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.cpub-engage-btn:focus-visible {
|
|
128
|
+
outline: 2px solid var(--accent);
|
|
129
|
+
outline-offset: 1px;
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { FederatedContentItem } from '@commonpub/server';
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
content: FederatedContentItem;
|
|
6
|
+
}>();
|
|
7
|
+
|
|
8
|
+
const emit = defineEmits<{
|
|
9
|
+
like: [id: string];
|
|
10
|
+
boost: [id: string];
|
|
11
|
+
}>();
|
|
12
|
+
|
|
13
|
+
const proxiedCover = computed(() => {
|
|
14
|
+
const url = props.content.coverImageUrl;
|
|
15
|
+
if (!url) return null;
|
|
16
|
+
return `/api/image-proxy?url=${encodeURIComponent(url)}&w=600`;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const actorHandle = computed(() => {
|
|
20
|
+
if (!props.content.actor) return 'Unknown';
|
|
21
|
+
const u = props.content.actor.preferredUsername ?? 'unknown';
|
|
22
|
+
return `@${u}@${props.content.actor.instanceDomain}`;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const actorName = computed(() =>
|
|
26
|
+
props.content.actor?.displayName ?? props.content.actor?.preferredUsername ?? 'Unknown',
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const typeLabel = computed(() => {
|
|
30
|
+
if (props.content.cpubType) return props.content.cpubType;
|
|
31
|
+
return props.content.apType === 'Note' ? 'post' : 'article';
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const timeAgo = computed(() => {
|
|
35
|
+
const date = props.content.publishedAt ?? props.content.receivedAt;
|
|
36
|
+
const d = new Date(date);
|
|
37
|
+
const now = Date.now();
|
|
38
|
+
const diff = now - d.getTime();
|
|
39
|
+
const mins = Math.floor(diff / 60000);
|
|
40
|
+
if (mins < 60) return `${mins}m`;
|
|
41
|
+
const hrs = Math.floor(mins / 60);
|
|
42
|
+
if (hrs < 24) return `${hrs}h`;
|
|
43
|
+
const days = Math.floor(hrs / 24);
|
|
44
|
+
return `${days}d`;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
/** Strip HTML for safe text display */
|
|
48
|
+
function stripHtml(html: string): string {
|
|
49
|
+
return html.replace(/<[^>]*>/g, '');
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<article class="cpub-fed-card">
|
|
55
|
+
<div class="cpub-fed-card__header">
|
|
56
|
+
<img
|
|
57
|
+
v-if="content.actor?.avatarUrl"
|
|
58
|
+
:src="content.actor.avatarUrl"
|
|
59
|
+
:alt="`${actorName} avatar`"
|
|
60
|
+
class="cpub-fed-card__avatar"
|
|
61
|
+
loading="lazy"
|
|
62
|
+
/>
|
|
63
|
+
<div v-else class="cpub-fed-card__avatar cpub-fed-card__avatar--placeholder">
|
|
64
|
+
{{ actorName[0]?.toUpperCase() ?? '?' }}
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div class="cpub-fed-card__meta">
|
|
68
|
+
<NuxtLink
|
|
69
|
+
v-if="content.actor"
|
|
70
|
+
:to="`/federation/users/${content.actor.preferredUsername}@${content.actor.instanceDomain}`"
|
|
71
|
+
class="cpub-fed-card__author cpub-fed-card__author-link"
|
|
72
|
+
>{{ actorName }}</NuxtLink>
|
|
73
|
+
<span v-else class="cpub-fed-card__author">{{ actorName }}</span>
|
|
74
|
+
<span class="cpub-fed-card__handle">{{ actorHandle }}</span>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<span class="cpub-fed-card__time">{{ timeAgo }}</span>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div class="cpub-fed-card__badges">
|
|
81
|
+
<span class="cpub-fed-card__type-badge">{{ typeLabel }}</span>
|
|
82
|
+
<span class="cpub-fed-card__origin-badge">{{ content.originDomain }}</span>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div v-if="content.coverImageUrl" class="cpub-fed-card__cover">
|
|
86
|
+
<img :src="proxiedCover ?? content.coverImageUrl" :alt="content.title ?? 'Cover'" loading="lazy" />
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<h3 v-if="content.title" class="cpub-fed-card__title">
|
|
90
|
+
<a v-if="content.url" :href="content.url" target="_blank" rel="noopener">
|
|
91
|
+
{{ content.title }}
|
|
92
|
+
</a>
|
|
93
|
+
<span v-else>{{ content.title }}</span>
|
|
94
|
+
</h3>
|
|
95
|
+
|
|
96
|
+
<p v-if="content.summary" class="cpub-fed-card__summary">
|
|
97
|
+
{{ stripHtml(content.summary) }}
|
|
98
|
+
</p>
|
|
99
|
+
|
|
100
|
+
<div v-if="content.tags.length > 0" class="cpub-fed-card__tags">
|
|
101
|
+
<span v-for="tag in content.tags.slice(0, 5)" :key="tag.name" class="cpub-fed-card__tag">
|
|
102
|
+
{{ tag.name }}
|
|
103
|
+
</span>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<div class="cpub-fed-card__actions">
|
|
107
|
+
<button
|
|
108
|
+
class="cpub-fed-card__action"
|
|
109
|
+
:aria-label="`Like this ${typeLabel}`"
|
|
110
|
+
@click="emit('like', content.id)"
|
|
111
|
+
>
|
|
112
|
+
{{ content.localLikeCount > 0 ? content.localLikeCount : '' }} Like
|
|
113
|
+
</button>
|
|
114
|
+
<button
|
|
115
|
+
class="cpub-fed-card__action"
|
|
116
|
+
:aria-label="`Boost this ${typeLabel}`"
|
|
117
|
+
@click="emit('boost', content.id)"
|
|
118
|
+
>
|
|
119
|
+
Boost
|
|
120
|
+
</button>
|
|
121
|
+
<a
|
|
122
|
+
v-if="content.url"
|
|
123
|
+
:href="content.url"
|
|
124
|
+
target="_blank"
|
|
125
|
+
rel="noopener"
|
|
126
|
+
class="cpub-fed-card__action"
|
|
127
|
+
>
|
|
128
|
+
View Original
|
|
129
|
+
</a>
|
|
130
|
+
</div>
|
|
131
|
+
</article>
|
|
132
|
+
</template>
|
|
133
|
+
|
|
134
|
+
<style scoped>
|
|
135
|
+
.cpub-fed-card {
|
|
136
|
+
border: var(--border-width-default) solid var(--border);
|
|
137
|
+
padding: var(--space-4);
|
|
138
|
+
background: var(--surface-1);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.cpub-fed-card__header {
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: var(--space-2);
|
|
145
|
+
margin-bottom: var(--space-3);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.cpub-fed-card__avatar {
|
|
149
|
+
width: 36px;
|
|
150
|
+
height: 36px;
|
|
151
|
+
border-radius: 0;
|
|
152
|
+
object-fit: cover;
|
|
153
|
+
border: var(--border-width-default) solid var(--border);
|
|
154
|
+
flex-shrink: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.cpub-fed-card__avatar--placeholder {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
background: var(--surface-2);
|
|
162
|
+
color: var(--text-2);
|
|
163
|
+
font-weight: 700;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.cpub-fed-card__meta {
|
|
167
|
+
flex: 1;
|
|
168
|
+
min-width: 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.cpub-fed-card__author {
|
|
172
|
+
font-weight: 700;
|
|
173
|
+
color: var(--text-1);
|
|
174
|
+
}
|
|
175
|
+
.cpub-fed-card__author-link {
|
|
176
|
+
text-decoration: none;
|
|
177
|
+
color: var(--text-1);
|
|
178
|
+
}
|
|
179
|
+
.cpub-fed-card__author-link:hover {
|
|
180
|
+
color: var(--accent);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.cpub-fed-card__handle {
|
|
184
|
+
font-size: var(--font-size-sm);
|
|
185
|
+
color: var(--text-2);
|
|
186
|
+
font-family: var(--font-mono);
|
|
187
|
+
margin-left: var(--space-1);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.cpub-fed-card__time {
|
|
191
|
+
font-size: var(--font-size-sm);
|
|
192
|
+
color: var(--text-2);
|
|
193
|
+
font-family: var(--font-mono);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.cpub-fed-card__badges {
|
|
197
|
+
display: flex;
|
|
198
|
+
gap: var(--space-2);
|
|
199
|
+
margin-bottom: var(--space-3);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.cpub-fed-card__type-badge,
|
|
203
|
+
.cpub-fed-card__origin-badge {
|
|
204
|
+
font-size: var(--font-size-xs);
|
|
205
|
+
font-family: var(--font-mono);
|
|
206
|
+
text-transform: uppercase;
|
|
207
|
+
letter-spacing: 0.05em;
|
|
208
|
+
padding: 0.1em 0.4em;
|
|
209
|
+
border: var(--border-width-default) solid var(--border);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.cpub-fed-card__type-badge {
|
|
213
|
+
color: var(--accent);
|
|
214
|
+
border-color: var(--accent);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.cpub-fed-card__origin-badge {
|
|
218
|
+
color: var(--text-2);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.cpub-fed-card__cover {
|
|
222
|
+
margin-bottom: var(--space-3);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.cpub-fed-card__cover img {
|
|
226
|
+
width: 100%;
|
|
227
|
+
aspect-ratio: 16/9;
|
|
228
|
+
object-fit: cover;
|
|
229
|
+
border: var(--border-width-default) solid var(--border);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.cpub-fed-card__title {
|
|
233
|
+
font-size: var(--font-size-lg);
|
|
234
|
+
margin-bottom: var(--space-2);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.cpub-fed-card__title a {
|
|
238
|
+
color: var(--text-1);
|
|
239
|
+
text-decoration: none;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.cpub-fed-card__title a:hover {
|
|
243
|
+
text-decoration: underline;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.cpub-fed-card__summary {
|
|
247
|
+
color: var(--text-2);
|
|
248
|
+
font-size: var(--font-size-sm);
|
|
249
|
+
line-height: 1.5;
|
|
250
|
+
margin-bottom: var(--space-3);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.cpub-fed-card__tags {
|
|
254
|
+
display: flex;
|
|
255
|
+
flex-wrap: wrap;
|
|
256
|
+
gap: var(--space-1);
|
|
257
|
+
margin-bottom: var(--space-3);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.cpub-fed-card__tag {
|
|
261
|
+
font-size: var(--font-size-xs);
|
|
262
|
+
font-family: var(--font-mono);
|
|
263
|
+
color: var(--text-2);
|
|
264
|
+
padding: 0.1em 0.3em;
|
|
265
|
+
border: var(--border-width-default) solid var(--border);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.cpub-fed-card__actions {
|
|
269
|
+
display: flex;
|
|
270
|
+
gap: var(--space-3);
|
|
271
|
+
border-top: var(--border-width-default) solid var(--border);
|
|
272
|
+
padding-top: var(--space-3);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.cpub-fed-card__action {
|
|
276
|
+
font-family: var(--font-mono);
|
|
277
|
+
font-size: var(--font-size-sm);
|
|
278
|
+
text-transform: uppercase;
|
|
279
|
+
letter-spacing: 0.05em;
|
|
280
|
+
color: var(--text-2);
|
|
281
|
+
background: none;
|
|
282
|
+
border: none;
|
|
283
|
+
cursor: pointer;
|
|
284
|
+
padding: 0;
|
|
285
|
+
text-decoration: none;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.cpub-fed-card__action:hover {
|
|
289
|
+
color: var(--accent);
|
|
290
|
+
}
|
|
291
|
+
</style>
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{
|
|
3
|
+
type: 'discussion' | 'question' | 'showcase' | 'announcement';
|
|
4
|
+
title: string;
|
|
5
|
+
author: string;
|
|
6
|
+
authorAvatar?: string;
|
|
7
|
+
authorHandle?: string;
|
|
8
|
+
body: string;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
replyCount: number;
|
|
11
|
+
voteCount: number;
|
|
12
|
+
pinned?: boolean;
|
|
13
|
+
locked?: boolean;
|
|
14
|
+
interactive?: boolean;
|
|
15
|
+
voted?: boolean;
|
|
16
|
+
}>();
|
|
17
|
+
|
|
18
|
+
const emit = defineEmits<{ vote: [] }>();
|
|
19
|
+
|
|
20
|
+
const typeBadgeClass = computed((): string => {
|
|
21
|
+
const map: Record<string, string> = {
|
|
22
|
+
discussion: 'cpub-feed-badge-accent',
|
|
23
|
+
question: 'cpub-feed-badge-yellow',
|
|
24
|
+
showcase: 'cpub-feed-badge-purple',
|
|
25
|
+
announcement: 'cpub-feed-badge-red',
|
|
26
|
+
};
|
|
27
|
+
return map[props.type] || 'cpub-feed-badge-accent';
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const formattedDate = computed((): string => {
|
|
31
|
+
return new Date(props.createdAt).toLocaleDateString('en-US', {
|
|
32
|
+
month: 'short',
|
|
33
|
+
day: 'numeric',
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<article
|
|
40
|
+
:class="['cpub-feed-item', { 'cpub-feed-item-pinned': pinned }]"
|
|
41
|
+
:data-feed-type="type"
|
|
42
|
+
>
|
|
43
|
+
<div v-if="pinned" class="cpub-feed-pin" aria-label="Pinned post">
|
|
44
|
+
<i class="fa-solid fa-thumbtack"></i>
|
|
45
|
+
<span>Pinned</span>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div class="cpub-feed-item-body">
|
|
49
|
+
<div class="cpub-feed-item-header">
|
|
50
|
+
<span :class="['cpub-feed-badge', typeBadgeClass]">{{ type }}</span>
|
|
51
|
+
<span v-if="locked" class="cpub-feed-lock" aria-label="Locked">
|
|
52
|
+
<i class="fa-solid fa-lock"></i>
|
|
53
|
+
</span>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<h3 class="cpub-feed-item-title">{{ title }}</h3>
|
|
57
|
+
|
|
58
|
+
<p class="cpub-feed-item-preview">{{ body }}</p>
|
|
59
|
+
|
|
60
|
+
<div class="cpub-feed-item-meta">
|
|
61
|
+
<div class="cpub-feed-item-author">
|
|
62
|
+
<div v-if="authorAvatar" class="cpub-feed-avatar">
|
|
63
|
+
<img :src="authorAvatar" :alt="author" />
|
|
64
|
+
</div>
|
|
65
|
+
<div v-else class="cpub-feed-avatar cpub-feed-avatar-placeholder">
|
|
66
|
+
{{ author.charAt(0).toUpperCase() }}
|
|
67
|
+
</div>
|
|
68
|
+
<span class="cpub-feed-author-name">{{ author }}</span>
|
|
69
|
+
<span v-if="authorHandle" class="cpub-feed-handle">{{ authorHandle }}</span>
|
|
70
|
+
<span class="cpub-feed-sep" aria-hidden="true">·</span>
|
|
71
|
+
<time class="cpub-feed-time">{{ formattedDate }}</time>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div class="cpub-feed-item-stats">
|
|
75
|
+
<button v-if="interactive" class="cpub-feed-stat cpub-feed-stat-btn" :class="{ 'cpub-feed-stat-voted': voted }" aria-label="Vote" @click.prevent.stop="emit('vote')">
|
|
76
|
+
<i class="fa-solid fa-arrow-up"></i> {{ voteCount }}
|
|
77
|
+
</button>
|
|
78
|
+
<span v-else class="cpub-feed-stat" aria-label="Votes">
|
|
79
|
+
<i class="fa-solid fa-arrow-up"></i> {{ voteCount }}
|
|
80
|
+
</span>
|
|
81
|
+
<span class="cpub-feed-stat" aria-label="Replies">
|
|
82
|
+
<i class="fa-solid fa-comment"></i> {{ replyCount }}
|
|
83
|
+
</span>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</article>
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<style scoped>
|
|
91
|
+
.cpub-feed-item {
|
|
92
|
+
background: var(--surface);
|
|
93
|
+
border: var(--border-width-default) solid var(--border);
|
|
94
|
+
transition: transform var(--transition-fast), box-shadow var(--transition-fast);
|
|
95
|
+
position: relative;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.cpub-feed-item:hover {
|
|
99
|
+
transform: translate(-2px, -2px);
|
|
100
|
+
box-shadow: var(--shadow-md);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.cpub-feed-item-pinned {
|
|
104
|
+
border-color: var(--accent-border);
|
|
105
|
+
background: var(--accent-bg);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.cpub-feed-pin {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
gap: var(--space-2);
|
|
112
|
+
padding: var(--space-2) var(--space-4);
|
|
113
|
+
font-family: var(--font-mono);
|
|
114
|
+
font-size: var(--text-label);
|
|
115
|
+
text-transform: uppercase;
|
|
116
|
+
letter-spacing: var(--tracking-widest);
|
|
117
|
+
color: var(--accent);
|
|
118
|
+
border-bottom: var(--border-width-default) solid var(--accent-border);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.cpub-feed-item-body {
|
|
122
|
+
padding: var(--space-4);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.cpub-feed-item-header {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: var(--space-2);
|
|
129
|
+
margin-bottom: var(--space-2);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.cpub-feed-badge {
|
|
133
|
+
display: inline-block;
|
|
134
|
+
padding: 2px 8px;
|
|
135
|
+
font-family: var(--font-mono);
|
|
136
|
+
font-size: var(--text-label);
|
|
137
|
+
font-weight: var(--font-weight-semibold);
|
|
138
|
+
text-transform: uppercase;
|
|
139
|
+
letter-spacing: var(--tracking-wide);
|
|
140
|
+
border: var(--border-width-default) solid;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.cpub-feed-badge-accent {
|
|
144
|
+
color: var(--accent);
|
|
145
|
+
background: var(--accent-bg);
|
|
146
|
+
border-color: var(--accent-border);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.cpub-feed-badge-yellow {
|
|
150
|
+
color: var(--yellow);
|
|
151
|
+
background: var(--yellow-bg);
|
|
152
|
+
border-color: var(--yellow-border);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.cpub-feed-badge-purple {
|
|
156
|
+
color: var(--purple);
|
|
157
|
+
background: var(--purple-bg);
|
|
158
|
+
border-color: var(--purple-border);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.cpub-feed-badge-red {
|
|
162
|
+
color: var(--red);
|
|
163
|
+
background: var(--red-bg);
|
|
164
|
+
border-color: var(--red-border);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.cpub-feed-lock {
|
|
168
|
+
color: var(--text-faint);
|
|
169
|
+
font-size: var(--text-xs);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.cpub-feed-item-title {
|
|
173
|
+
font-size: var(--text-md);
|
|
174
|
+
font-weight: var(--font-weight-semibold);
|
|
175
|
+
color: var(--text);
|
|
176
|
+
margin-bottom: var(--space-2);
|
|
177
|
+
line-height: var(--leading-tight);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.cpub-feed-item-preview {
|
|
181
|
+
font-size: var(--text-sm);
|
|
182
|
+
color: var(--text-dim);
|
|
183
|
+
line-height: var(--leading-relaxed);
|
|
184
|
+
margin-bottom: var(--space-3);
|
|
185
|
+
display: -webkit-box;
|
|
186
|
+
-webkit-line-clamp: 2;
|
|
187
|
+
-webkit-box-orient: vertical;
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.cpub-feed-item-meta {
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
justify-content: space-between;
|
|
195
|
+
flex-wrap: wrap;
|
|
196
|
+
gap: var(--space-2);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.cpub-feed-item-author {
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
gap: var(--space-2);
|
|
203
|
+
font-size: var(--text-xs);
|
|
204
|
+
color: var(--text-faint);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.cpub-feed-avatar {
|
|
208
|
+
width: 20px;
|
|
209
|
+
height: 20px;
|
|
210
|
+
border-radius: var(--radius-full);
|
|
211
|
+
overflow: hidden;
|
|
212
|
+
flex-shrink: 0;
|
|
213
|
+
border: var(--border-width-default) solid var(--border2);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.cpub-feed-avatar img {
|
|
217
|
+
width: 100%;
|
|
218
|
+
height: 100%;
|
|
219
|
+
object-fit: cover;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.cpub-feed-avatar-placeholder {
|
|
223
|
+
display: flex;
|
|
224
|
+
align-items: center;
|
|
225
|
+
justify-content: center;
|
|
226
|
+
background: var(--surface2);
|
|
227
|
+
font-family: var(--font-mono);
|
|
228
|
+
font-size: 10px;
|
|
229
|
+
font-weight: var(--font-weight-bold);
|
|
230
|
+
color: var(--text-dim);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.cpub-feed-author-name {
|
|
234
|
+
font-weight: var(--font-weight-medium);
|
|
235
|
+
color: var(--text-dim);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.cpub-feed-handle {
|
|
239
|
+
font-size: var(--text-xs);
|
|
240
|
+
color: var(--text-faint);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.cpub-feed-sep {
|
|
244
|
+
color: var(--text-faint);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.cpub-feed-time {
|
|
248
|
+
color: var(--text-faint);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.cpub-feed-item-stats {
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
gap: var(--space-3);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.cpub-feed-stat {
|
|
258
|
+
display: flex;
|
|
259
|
+
align-items: center;
|
|
260
|
+
gap: 4px;
|
|
261
|
+
font-size: var(--text-xs);
|
|
262
|
+
color: var(--text-faint);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.cpub-feed-stat-btn {
|
|
266
|
+
background: none;
|
|
267
|
+
border: 1px solid transparent;
|
|
268
|
+
cursor: pointer;
|
|
269
|
+
padding: 2px 8px;
|
|
270
|
+
border-radius: 4px;
|
|
271
|
+
font-family: inherit;
|
|
272
|
+
transition: all 0.12s;
|
|
273
|
+
}
|
|
274
|
+
.cpub-feed-stat-btn:hover {
|
|
275
|
+
color: var(--accent);
|
|
276
|
+
background: var(--accent-bg);
|
|
277
|
+
border-color: var(--accent-border);
|
|
278
|
+
}
|
|
279
|
+
.cpub-feed-stat-voted {
|
|
280
|
+
color: var(--accent);
|
|
281
|
+
border-color: var(--accent-border);
|
|
282
|
+
}
|
|
283
|
+
</style>
|