@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,330 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface CommentAuthor {
|
|
3
|
+
id: string;
|
|
4
|
+
username: string;
|
|
5
|
+
displayName: string | null;
|
|
6
|
+
avatarUrl: string | null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface Comment {
|
|
10
|
+
id: string;
|
|
11
|
+
content: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
author: CommentAuthor | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
targetType: string;
|
|
18
|
+
targetId: string;
|
|
19
|
+
/** When set, comments federate as replies to the remote content */
|
|
20
|
+
federatedContentId?: string;
|
|
21
|
+
}>();
|
|
22
|
+
|
|
23
|
+
const { user } = useAuth();
|
|
24
|
+
|
|
25
|
+
const isFederated = computed(() => !!props.federatedContentId);
|
|
26
|
+
const commentLimit = 20;
|
|
27
|
+
|
|
28
|
+
const queryParams = computed(() => ({
|
|
29
|
+
targetType: props.targetType,
|
|
30
|
+
targetId: props.targetId,
|
|
31
|
+
limit: commentLimit,
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
// Skip comment fetch for federated content — local comments table has no record for remote IDs
|
|
35
|
+
const { data: comments, refresh } = await useFetch<Comment[]>('/api/social/comments', {
|
|
36
|
+
query: queryParams,
|
|
37
|
+
lazy: true,
|
|
38
|
+
immediate: !props.federatedContentId,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const allCommentsLoaded = ref(false);
|
|
42
|
+
const hasMore = computed(() => !allCommentsLoaded.value && (comments.value?.length ?? 0) >= commentLimit);
|
|
43
|
+
const loadingMore = ref(false);
|
|
44
|
+
|
|
45
|
+
async function loadMoreComments(): Promise<void> {
|
|
46
|
+
loadingMore.value = true;
|
|
47
|
+
try {
|
|
48
|
+
const more = await $fetch<Comment[]>('/api/social/comments', {
|
|
49
|
+
query: {
|
|
50
|
+
targetType: props.targetType,
|
|
51
|
+
targetId: props.targetId,
|
|
52
|
+
limit: commentLimit,
|
|
53
|
+
offset: comments.value?.length ?? 0,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
if (more?.length && comments.value) {
|
|
57
|
+
comments.value.push(...more);
|
|
58
|
+
}
|
|
59
|
+
if (!more?.length || more.length < commentLimit) {
|
|
60
|
+
allCommentsLoaded.value = true;
|
|
61
|
+
}
|
|
62
|
+
} finally {
|
|
63
|
+
loadingMore.value = false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const newComment = ref('');
|
|
68
|
+
const submitting = ref(false);
|
|
69
|
+
|
|
70
|
+
async function submitComment(): Promise<void> {
|
|
71
|
+
if (!newComment.value.trim()) return;
|
|
72
|
+
submitting.value = true;
|
|
73
|
+
try {
|
|
74
|
+
if (props.federatedContentId) {
|
|
75
|
+
// Federate reply to remote content
|
|
76
|
+
await $fetch('/api/federation/reply', {
|
|
77
|
+
method: 'POST',
|
|
78
|
+
body: {
|
|
79
|
+
federatedContentId: props.federatedContentId,
|
|
80
|
+
content: newComment.value,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
} else {
|
|
84
|
+
await $fetch('/api/social/comments', {
|
|
85
|
+
method: 'POST',
|
|
86
|
+
body: {
|
|
87
|
+
targetType: props.targetType,
|
|
88
|
+
targetId: props.targetId,
|
|
89
|
+
content: newComment.value,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
newComment.value = '';
|
|
94
|
+
if (!props.federatedContentId) {
|
|
95
|
+
await refresh();
|
|
96
|
+
}
|
|
97
|
+
} finally {
|
|
98
|
+
submitting.value = false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async function deleteComment(id: string): Promise<void> {
|
|
103
|
+
await $fetch(`/api/social/comments/${id}`, { method: 'DELETE' });
|
|
104
|
+
await refresh();
|
|
105
|
+
}
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<template>
|
|
109
|
+
<section class="cpub-comments" aria-label="Comments">
|
|
110
|
+
<h3 class="cpub-comments-title">
|
|
111
|
+
Comments
|
|
112
|
+
<span v-if="comments?.length" class="cpub-comments-count">{{ comments.length }}</span>
|
|
113
|
+
</h3>
|
|
114
|
+
|
|
115
|
+
<!-- Federation notice -->
|
|
116
|
+
<p v-if="isFederated" class="cpub-comment-fed-notice">
|
|
117
|
+
<i class="fa-solid fa-globe"></i> Replies to this content are sent to the original instance.
|
|
118
|
+
</p>
|
|
119
|
+
|
|
120
|
+
<!-- New comment form -->
|
|
121
|
+
<div v-if="user" class="cpub-comment-form">
|
|
122
|
+
<textarea
|
|
123
|
+
v-model="newComment"
|
|
124
|
+
class="cpub-textarea"
|
|
125
|
+
:placeholder="isFederated ? 'Write a reply (will be sent to the original instance)...' : 'Write a comment...'"
|
|
126
|
+
rows="3"
|
|
127
|
+
aria-label="Write a comment"
|
|
128
|
+
></textarea>
|
|
129
|
+
<button
|
|
130
|
+
class="cpub-btn cpub-btn-primary cpub-btn-sm"
|
|
131
|
+
:disabled="!newComment.trim() || submitting"
|
|
132
|
+
@click="submitComment"
|
|
133
|
+
>
|
|
134
|
+
{{ submitting ? 'Posting...' : isFederated ? 'Send Reply' : 'Post Comment' }}
|
|
135
|
+
</button>
|
|
136
|
+
</div>
|
|
137
|
+
<p v-else class="cpub-comment-login">
|
|
138
|
+
<NuxtLink to="/auth/login" class="cpub-link">Log in</NuxtLink> to comment.
|
|
139
|
+
</p>
|
|
140
|
+
|
|
141
|
+
<!-- Comments list -->
|
|
142
|
+
<div class="cpub-comment-list">
|
|
143
|
+
<div v-for="comment in (comments || [])" :key="comment.id" class="cpub-comment">
|
|
144
|
+
<div class="cpub-comment-avatar">
|
|
145
|
+
<img v-if="comment.author?.avatarUrl" :src="comment.author.avatarUrl" :alt="comment.author?.displayName || comment.author?.username" class="cpub-comment-avatar-img" />
|
|
146
|
+
<span v-else>{{ (comment.author?.displayName || comment.author?.username || 'U').charAt(0).toUpperCase() }}</span>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="cpub-comment-body">
|
|
149
|
+
<div class="cpub-comment-header">
|
|
150
|
+
<NuxtLink :to="`/u/${comment.author?.username}`" class="cpub-comment-author">
|
|
151
|
+
{{ comment.author?.displayName || comment.author?.username }}
|
|
152
|
+
</NuxtLink>
|
|
153
|
+
<time class="cpub-comment-time">
|
|
154
|
+
{{ new Date(comment.createdAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric' }) }}
|
|
155
|
+
</time>
|
|
156
|
+
</div>
|
|
157
|
+
<p class="cpub-comment-text">{{ comment.content }}</p>
|
|
158
|
+
<button
|
|
159
|
+
v-if="user?.id === comment.author?.id"
|
|
160
|
+
class="cpub-comment-delete"
|
|
161
|
+
@click="deleteComment(comment.id)"
|
|
162
|
+
aria-label="Delete comment"
|
|
163
|
+
>
|
|
164
|
+
Delete
|
|
165
|
+
</button>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
<p v-if="!comments?.length" class="cpub-comments-empty">No comments yet. Be the first!</p>
|
|
169
|
+
<div v-if="hasMore" class="cpub-comments-more">
|
|
170
|
+
<button class="cpub-btn cpub-btn-sm" :disabled="loadingMore" @click="loadMoreComments">
|
|
171
|
+
{{ loadingMore ? 'Loading...' : 'Load more comments' }}
|
|
172
|
+
</button>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
</section>
|
|
176
|
+
</template>
|
|
177
|
+
|
|
178
|
+
<style scoped>
|
|
179
|
+
.cpub-comments {
|
|
180
|
+
margin-top: var(--space-8);
|
|
181
|
+
padding-top: var(--space-6);
|
|
182
|
+
border-top: var(--border-width-default) solid var(--border);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.cpub-comments-title {
|
|
186
|
+
font-size: 14px;
|
|
187
|
+
font-weight: 600;
|
|
188
|
+
margin-bottom: var(--space-4);
|
|
189
|
+
display: flex;
|
|
190
|
+
align-items: center;
|
|
191
|
+
gap: 8px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.cpub-comments-count {
|
|
195
|
+
font-family: var(--font-mono);
|
|
196
|
+
font-size: 10px;
|
|
197
|
+
color: var(--text-faint);
|
|
198
|
+
background: var(--surface2);
|
|
199
|
+
padding: 1px 6px;
|
|
200
|
+
border: 1px solid var(--border2);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.cpub-comment-form {
|
|
204
|
+
margin-bottom: var(--space-6);
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
gap: var(--space-2);
|
|
208
|
+
align-items: flex-end;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.cpub-comment-form .cpub-textarea {
|
|
212
|
+
width: 100%;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.cpub-comment-fed-notice {
|
|
216
|
+
font-size: 12px;
|
|
217
|
+
color: var(--text-dim);
|
|
218
|
+
display: flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
gap: 6px;
|
|
221
|
+
margin-bottom: 12px;
|
|
222
|
+
padding: 8px 12px;
|
|
223
|
+
background: var(--accent-bg);
|
|
224
|
+
border: 1px solid var(--accent-border);
|
|
225
|
+
border-radius: 8px;
|
|
226
|
+
}
|
|
227
|
+
.cpub-comment-fed-notice i { color: var(--accent); font-size: 11px; }
|
|
228
|
+
|
|
229
|
+
.cpub-comment-login {
|
|
230
|
+
font-size: 13px;
|
|
231
|
+
color: var(--text-dim);
|
|
232
|
+
margin-bottom: var(--space-6);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.cpub-comment-list {
|
|
236
|
+
display: flex;
|
|
237
|
+
flex-direction: column;
|
|
238
|
+
gap: var(--space-4);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.cpub-comment {
|
|
242
|
+
display: flex;
|
|
243
|
+
gap: 10px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.cpub-comment-avatar {
|
|
247
|
+
width: 28px;
|
|
248
|
+
height: 28px;
|
|
249
|
+
border-radius: 50%;
|
|
250
|
+
background: var(--surface3);
|
|
251
|
+
border: var(--border-width-default) solid var(--border);
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
justify-content: center;
|
|
255
|
+
font-family: var(--font-mono);
|
|
256
|
+
font-size: 10px;
|
|
257
|
+
font-weight: 600;
|
|
258
|
+
color: var(--text-dim);
|
|
259
|
+
flex-shrink: 0;
|
|
260
|
+
overflow: hidden;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.cpub-comment-avatar-img {
|
|
264
|
+
width: 100%;
|
|
265
|
+
height: 100%;
|
|
266
|
+
object-fit: cover;
|
|
267
|
+
border-radius: inherit;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.cpub-comment-body {
|
|
271
|
+
flex: 1;
|
|
272
|
+
min-width: 0;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.cpub-comment-header {
|
|
276
|
+
display: flex;
|
|
277
|
+
align-items: center;
|
|
278
|
+
gap: 8px;
|
|
279
|
+
margin-bottom: 4px;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.cpub-comment-author {
|
|
283
|
+
font-size: 12px;
|
|
284
|
+
font-weight: 600;
|
|
285
|
+
color: var(--text);
|
|
286
|
+
text-decoration: none;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.cpub-comment-author:hover {
|
|
290
|
+
color: var(--accent);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.cpub-comment-time {
|
|
294
|
+
font-size: 10px;
|
|
295
|
+
color: var(--text-faint);
|
|
296
|
+
font-family: var(--font-mono);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.cpub-comment-text {
|
|
300
|
+
font-size: 13px;
|
|
301
|
+
color: var(--text-dim);
|
|
302
|
+
line-height: 1.6;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.cpub-comment-delete {
|
|
306
|
+
font-size: 10px;
|
|
307
|
+
color: var(--text-faint);
|
|
308
|
+
background: none;
|
|
309
|
+
border: none;
|
|
310
|
+
cursor: pointer;
|
|
311
|
+
margin-top: 4px;
|
|
312
|
+
padding: 0;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.cpub-comment-delete:hover {
|
|
316
|
+
color: var(--red);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.cpub-comments-empty {
|
|
320
|
+
color: var(--text-faint);
|
|
321
|
+
font-size: 13px;
|
|
322
|
+
text-align: center;
|
|
323
|
+
padding: var(--space-6) 0;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.cpub-comments-more {
|
|
327
|
+
text-align: center;
|
|
328
|
+
padding: var(--space-4) 0;
|
|
329
|
+
}
|
|
330
|
+
</style>
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Serialized, ContentListItem } from '@commonpub/server';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ContentCard — the primary card used across homepage, search, profile, hubs.
|
|
6
|
+
* Matches the project card from mockup 01-homepage:
|
|
7
|
+
* - Cover image or icon placeholder with grid pattern
|
|
8
|
+
* - Type + featured badges on thumbnail
|
|
9
|
+
* - Difficulty dots (for projects)
|
|
10
|
+
* - Title, description (2-line clamp)
|
|
11
|
+
* - Author avatar + name + date row
|
|
12
|
+
* - Stats: hearts, views, comments
|
|
13
|
+
*/
|
|
14
|
+
const props = defineProps<{
|
|
15
|
+
item: Serialized<ContentListItem> & { isFeatured?: boolean };
|
|
16
|
+
}>();
|
|
17
|
+
|
|
18
|
+
const cover = computed(() => {
|
|
19
|
+
const url = props.item.coverImageUrl;
|
|
20
|
+
if (!url) return null;
|
|
21
|
+
// Proxy remote images through our server for faster loading + caching
|
|
22
|
+
const config = useRuntimeConfig();
|
|
23
|
+
const siteDomain = (config.public?.domain as string) || '';
|
|
24
|
+
try {
|
|
25
|
+
const imgHost = new URL(url).hostname;
|
|
26
|
+
if (siteDomain && !url.includes(siteDomain)) {
|
|
27
|
+
return `/api/image-proxy?url=${encodeURIComponent(url)}&w=600`;
|
|
28
|
+
}
|
|
29
|
+
} catch { /* invalid URL, use as-is */ }
|
|
30
|
+
return url;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const thumbIcons: Record<string, { icon: string; color: string }> = {
|
|
34
|
+
project: { icon: 'fa-solid fa-microchip', color: 'var(--accent)' },
|
|
35
|
+
article: { icon: 'fa-solid fa-file-lines', color: 'var(--teal)' },
|
|
36
|
+
blog: { icon: 'fa-solid fa-pen-nib', color: 'var(--pink)' },
|
|
37
|
+
explainer: { icon: 'fa-solid fa-lightbulb', color: 'var(--yellow)' },
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const diffDots = computed(() => {
|
|
41
|
+
const d = props.item.difficulty;
|
|
42
|
+
if (!d) return 0;
|
|
43
|
+
if (d === 'beginner') return 1;
|
|
44
|
+
if (d === 'intermediate') return 2;
|
|
45
|
+
return 3;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const isFederated = computed(() => props.item.source === 'federated');
|
|
49
|
+
|
|
50
|
+
const cardLink = computed(() => {
|
|
51
|
+
if (isFederated.value && props.item.federatedContentId) {
|
|
52
|
+
return `/mirror/${props.item.federatedContentId}`;
|
|
53
|
+
}
|
|
54
|
+
return `/${props.item.type}/${props.item.slug}`;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const authorInitial = computed(() => {
|
|
58
|
+
const name = props.item.author?.displayName || props.item.author?.username || '?';
|
|
59
|
+
return name.charAt(0).toUpperCase();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const dateStr = computed(() => {
|
|
63
|
+
const d = props.item.publishedAt || props.item.createdAt;
|
|
64
|
+
return new Date(d).toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
function formatCount(n: number | undefined): string {
|
|
68
|
+
if (!n) return '0';
|
|
69
|
+
if (n >= 1000) return `${(n / 1000).toFixed(1)}k`;
|
|
70
|
+
return String(n);
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<template>
|
|
75
|
+
<article class="cpub-cc">
|
|
76
|
+
<NuxtLink :to="cardLink" class="cpub-cc-link">
|
|
77
|
+
<!-- Thumbnail -->
|
|
78
|
+
<div class="cpub-cc-thumb">
|
|
79
|
+
<img v-if="cover" :src="cover" :alt="item.title" class="cpub-cc-cover" loading="lazy" />
|
|
80
|
+
<template v-else>
|
|
81
|
+
<div class="cpub-cc-grid-bg" />
|
|
82
|
+
<i :class="[thumbIcons[item.type]?.icon || 'fa-solid fa-file']" class="cpub-cc-icon" :style="{ color: thumbIcons[item.type]?.color || 'var(--accent)' }" />
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<!-- Badges overlay -->
|
|
86
|
+
<div class="cpub-cc-badges">
|
|
87
|
+
<span v-if="item.isFeatured" class="cpub-cc-badge cpub-cc-badge--featured">
|
|
88
|
+
<i class="fa-solid fa-star"></i> Featured
|
|
89
|
+
</span>
|
|
90
|
+
<span v-if="isFederated && item.sourceDomain" class="cpub-cc-badge cpub-cc-badge--federated">
|
|
91
|
+
<i class="fa-solid fa-globe" /> {{ item.sourceDomain }}
|
|
92
|
+
</span>
|
|
93
|
+
<ContentTypeBadge :type="item.type" />
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<!-- Difficulty dots (projects only) -->
|
|
97
|
+
<div v-if="diffDots > 0" class="cpub-cc-diff">
|
|
98
|
+
<span v-for="i in 3" :key="i" class="cpub-cc-dot" :class="{ filled: i <= diffDots }" />
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<!-- Body -->
|
|
103
|
+
<div class="cpub-cc-body">
|
|
104
|
+
<h3 class="cpub-cc-title">{{ item.title }}</h3>
|
|
105
|
+
<p v-if="item.description" class="cpub-cc-desc">{{ item.description }}</p>
|
|
106
|
+
|
|
107
|
+
<!-- Footer: author + stats -->
|
|
108
|
+
<div class="cpub-cc-footer">
|
|
109
|
+
<div v-if="item.author" class="cpub-cc-author">
|
|
110
|
+
<img v-if="item.author.avatarUrl" :src="item.author.avatarUrl" :alt="item.author.displayName || item.author.username" class="cpub-cc-av cpub-cc-av--img" />
|
|
111
|
+
<span v-else class="cpub-cc-av">{{ authorInitial }}</span>
|
|
112
|
+
<span class="cpub-cc-aname">{{ item.author.displayName || item.author.username }}</span>
|
|
113
|
+
<span class="cpub-cc-sep">·</span>
|
|
114
|
+
<time class="cpub-cc-date">{{ dateStr }}</time>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="cpub-cc-stats">
|
|
117
|
+
<span class="cpub-cc-stat"><i class="fa-solid fa-heart"></i> {{ formatCount(item.likeCount) }}</span>
|
|
118
|
+
<span class="cpub-cc-stat"><i class="fa-solid fa-eye"></i> {{ formatCount(item.viewCount) }}</span>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</NuxtLink>
|
|
123
|
+
</article>
|
|
124
|
+
</template>
|
|
125
|
+
|
|
126
|
+
<style scoped>
|
|
127
|
+
.cpub-cc {
|
|
128
|
+
background: var(--surface);
|
|
129
|
+
border: var(--border-width-default) solid var(--border);
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
transition: transform 0.15s, box-shadow 0.15s;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.cpub-cc:hover {
|
|
135
|
+
transform: translate(-2px, -2px);
|
|
136
|
+
box-shadow: var(--shadow-md);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.cpub-cc-link {
|
|
140
|
+
text-decoration: none;
|
|
141
|
+
color: inherit;
|
|
142
|
+
display: block;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Thumbnail */
|
|
146
|
+
.cpub-cc-thumb {
|
|
147
|
+
position: relative;
|
|
148
|
+
aspect-ratio: 4 / 3;
|
|
149
|
+
background: var(--surface2);
|
|
150
|
+
border-bottom: var(--border-width-default) solid var(--border);
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
justify-content: center;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.cpub-cc-cover {
|
|
158
|
+
width: 100%;
|
|
159
|
+
height: 100%;
|
|
160
|
+
object-fit: cover;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.cpub-cc-grid-bg {
|
|
164
|
+
position: absolute;
|
|
165
|
+
inset: 0;
|
|
166
|
+
background-image:
|
|
167
|
+
linear-gradient(var(--border2) 1px, transparent 1px),
|
|
168
|
+
linear-gradient(90deg, var(--border2) 1px, transparent 1px);
|
|
169
|
+
background-size: 20px 20px;
|
|
170
|
+
opacity: 0.25;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.cpub-cc-icon {
|
|
174
|
+
position: relative;
|
|
175
|
+
z-index: 1;
|
|
176
|
+
font-size: 36px;
|
|
177
|
+
opacity: 0.2;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* Badges */
|
|
181
|
+
.cpub-cc-badges {
|
|
182
|
+
position: absolute;
|
|
183
|
+
top: 8px;
|
|
184
|
+
left: 8px;
|
|
185
|
+
display: flex;
|
|
186
|
+
gap: 4px;
|
|
187
|
+
z-index: 2;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.cpub-cc-badge {
|
|
191
|
+
font-family: var(--font-mono);
|
|
192
|
+
font-size: 9px;
|
|
193
|
+
font-weight: 700;
|
|
194
|
+
letter-spacing: 0.06em;
|
|
195
|
+
text-transform: uppercase;
|
|
196
|
+
padding: 2px 7px;
|
|
197
|
+
display: flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
gap: 4px;
|
|
200
|
+
background: var(--color-badge-overlay, rgba(0, 0, 0, 0.75));
|
|
201
|
+
color: #fff;
|
|
202
|
+
backdrop-filter: blur(4px);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.cpub-cc-badge--featured {
|
|
206
|
+
color: var(--yellow);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.cpub-cc-badge--federated {
|
|
210
|
+
color: var(--teal);
|
|
211
|
+
}
|
|
212
|
+
.cpub-cc-badge--federated i {
|
|
213
|
+
font-size: 8px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* Difficulty dots */
|
|
217
|
+
.cpub-cc-diff {
|
|
218
|
+
position: absolute;
|
|
219
|
+
bottom: 8px;
|
|
220
|
+
right: 8px;
|
|
221
|
+
display: flex;
|
|
222
|
+
gap: 3px;
|
|
223
|
+
z-index: 2;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.cpub-cc-dot {
|
|
227
|
+
width: 8px;
|
|
228
|
+
height: 8px;
|
|
229
|
+
border: var(--border-width-default) solid var(--surface);
|
|
230
|
+
background: transparent;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.cpub-cc-dot.filled {
|
|
234
|
+
background: var(--accent);
|
|
235
|
+
border-color: var(--accent);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* Body */
|
|
239
|
+
.cpub-cc-body {
|
|
240
|
+
padding: 12px 14px 10px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.cpub-cc-title {
|
|
244
|
+
font-size: 13px;
|
|
245
|
+
font-weight: 600;
|
|
246
|
+
line-height: 1.35;
|
|
247
|
+
margin-bottom: 4px;
|
|
248
|
+
color: var(--text);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.cpub-cc:hover .cpub-cc-title {
|
|
252
|
+
color: var(--accent);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.cpub-cc-desc {
|
|
256
|
+
font-size: 11px;
|
|
257
|
+
color: var(--text-dim);
|
|
258
|
+
line-height: 1.5;
|
|
259
|
+
margin-bottom: 8px;
|
|
260
|
+
display: -webkit-box;
|
|
261
|
+
-webkit-line-clamp: 2;
|
|
262
|
+
-webkit-box-orient: vertical;
|
|
263
|
+
overflow: hidden;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* Footer */
|
|
267
|
+
.cpub-cc-footer {
|
|
268
|
+
display: flex;
|
|
269
|
+
align-items: center;
|
|
270
|
+
justify-content: space-between;
|
|
271
|
+
gap: 8px;
|
|
272
|
+
padding-top: 8px;
|
|
273
|
+
border-top: var(--border-width-default) solid var(--border2);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.cpub-cc-author {
|
|
277
|
+
display: flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
gap: 5px;
|
|
280
|
+
font-size: 11px;
|
|
281
|
+
color: var(--text-faint);
|
|
282
|
+
min-width: 0;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.cpub-cc-av {
|
|
286
|
+
width: 18px;
|
|
287
|
+
height: 18px;
|
|
288
|
+
background: var(--accent-bg);
|
|
289
|
+
border: var(--border-width-default) solid var(--accent-border);
|
|
290
|
+
color: var(--accent);
|
|
291
|
+
font-size: 8px;
|
|
292
|
+
font-weight: 700;
|
|
293
|
+
font-family: var(--font-mono);
|
|
294
|
+
display: flex;
|
|
295
|
+
align-items: center;
|
|
296
|
+
justify-content: center;
|
|
297
|
+
flex-shrink: 0;
|
|
298
|
+
border-radius: 50%;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.cpub-cc-av--img {
|
|
302
|
+
object-fit: cover;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.cpub-cc-aname {
|
|
306
|
+
color: var(--text-dim);
|
|
307
|
+
white-space: nowrap;
|
|
308
|
+
overflow: hidden;
|
|
309
|
+
text-overflow: ellipsis;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.cpub-cc-sep {
|
|
313
|
+
color: var(--border2);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.cpub-cc-date {
|
|
317
|
+
white-space: nowrap;
|
|
318
|
+
font-family: var(--font-mono);
|
|
319
|
+
font-size: 10px;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.cpub-cc-stats {
|
|
323
|
+
display: flex;
|
|
324
|
+
gap: 10px;
|
|
325
|
+
flex-shrink: 0;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.cpub-cc-stat {
|
|
329
|
+
display: flex;
|
|
330
|
+
align-items: center;
|
|
331
|
+
gap: 3px;
|
|
332
|
+
font-family: var(--font-mono);
|
|
333
|
+
font-size: 10px;
|
|
334
|
+
color: var(--text-faint);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.cpub-cc-stat i {
|
|
338
|
+
font-size: 9px;
|
|
339
|
+
}
|
|
340
|
+
</style>
|