@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,837 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const route = useRoute();
|
|
3
|
+
const username = route.params.username as string;
|
|
4
|
+
|
|
5
|
+
useSeoMeta({
|
|
6
|
+
title: `${username} — ${useSiteName()}`,
|
|
7
|
+
ogTitle: `${username} — ${useSiteName()}`,
|
|
8
|
+
ogImage: '/og-default.png',
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const { explainers: explainersEnabled, learning: learningEnabled, federation: federationEnabled } = useFeatures();
|
|
12
|
+
const runtimeConfig = useRuntimeConfig();
|
|
13
|
+
const instanceDomain = computed(() => {
|
|
14
|
+
const siteUrl = runtimeConfig.public?.siteUrl as string | undefined;
|
|
15
|
+
if (siteUrl) {
|
|
16
|
+
try { return new URL(siteUrl).hostname; } catch { /* fall through */ }
|
|
17
|
+
}
|
|
18
|
+
return '';
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
import type { Serialized, UserProfile, ContentListItem, PaginatedResponse } from '@commonpub/server';
|
|
22
|
+
|
|
23
|
+
const { data: profile, pending: profilePending, error: profileError, refresh: refreshProfile } = useLazyFetch<Serialized<UserProfile>>(`/api/users/${username}`);
|
|
24
|
+
const { data: content } = useLazyFetch<PaginatedResponse<Serialized<ContentListItem>>>(`/api/users/${username}/content`);
|
|
25
|
+
const { data: learningData } = useLazyFetch(`/api/users/${username}/learning`, {
|
|
26
|
+
immediate: learningEnabled.value,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const activeTab = ref('projects');
|
|
30
|
+
|
|
31
|
+
const tabDefs = computed(() => {
|
|
32
|
+
const tabs = [
|
|
33
|
+
{ value: 'projects', label: 'Projects', icon: 'fa-solid fa-folder-open' },
|
|
34
|
+
{ value: 'articles', label: 'Articles', icon: 'fa-solid fa-newspaper' },
|
|
35
|
+
];
|
|
36
|
+
if (explainersEnabled.value) {
|
|
37
|
+
tabs.push({ value: 'explainers', label: 'Explainers', icon: 'fa-solid fa-book-open' });
|
|
38
|
+
}
|
|
39
|
+
if (learningEnabled.value) {
|
|
40
|
+
tabs.push({ value: 'learning', label: 'Learning', icon: 'fa-solid fa-graduation-cap' });
|
|
41
|
+
}
|
|
42
|
+
tabs.push({ value: 'about', label: 'About', icon: 'fa-solid fa-id-card' });
|
|
43
|
+
return tabs;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const profileStats = computed(() => {
|
|
47
|
+
if (!profile.value) return [];
|
|
48
|
+
const p = profile.value;
|
|
49
|
+
return [
|
|
50
|
+
{ value: p.stats?.projects ?? 0, label: 'Projects' },
|
|
51
|
+
{ value: p.followerCount ?? p.stats?.followers ?? 0, label: 'Followers' },
|
|
52
|
+
{ value: p.followingCount ?? p.stats?.following ?? 0, label: 'Following' },
|
|
53
|
+
{ value: p.stats?.articles ?? 0, label: 'Articles' },
|
|
54
|
+
{ value: p.viewCount ?? 0, label: 'Total Views' },
|
|
55
|
+
{ value: p.likeCount ?? 0, label: 'Likes' },
|
|
56
|
+
];
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const filteredContent = computed(() => {
|
|
60
|
+
if (!content.value?.items) return [];
|
|
61
|
+
const typeMap: Record<string, string[]> = {
|
|
62
|
+
projects: ['project'],
|
|
63
|
+
articles: ['article', 'blog'],
|
|
64
|
+
explainers: ['explainer'],
|
|
65
|
+
videos: ['video'],
|
|
66
|
+
about: ['project'], // About tab sidebar shows featured projects
|
|
67
|
+
};
|
|
68
|
+
const types = typeMap[activeTab.value];
|
|
69
|
+
if (!types) return [];
|
|
70
|
+
return content.value.items.filter((i) => types.includes(i.type));
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const p = computed(() => profile.value);
|
|
74
|
+
|
|
75
|
+
const { isAuthenticated, user } = useAuth();
|
|
76
|
+
const toast = useToast();
|
|
77
|
+
const isOwnProfile = computed(() => user.value?.username === username);
|
|
78
|
+
const following = ref(false);
|
|
79
|
+
const followLoading = ref(false);
|
|
80
|
+
|
|
81
|
+
// Initialize follow state from API response
|
|
82
|
+
watch(() => profile.value, (profileData) => {
|
|
83
|
+
if (profileData && typeof (profileData as Record<string, unknown>).isFollowing === 'boolean') {
|
|
84
|
+
following.value = (profileData as Record<string, unknown>).isFollowing as boolean;
|
|
85
|
+
}
|
|
86
|
+
}, { immediate: true });
|
|
87
|
+
|
|
88
|
+
async function toggleFollow(): Promise<void> {
|
|
89
|
+
if (!isAuthenticated.value) {
|
|
90
|
+
await navigateTo(`/auth/login?redirect=/u/${username}`);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
followLoading.value = true;
|
|
94
|
+
try {
|
|
95
|
+
if (following.value) {
|
|
96
|
+
await $fetch(`/api/users/${username}/follow`, { method: 'DELETE' });
|
|
97
|
+
following.value = false;
|
|
98
|
+
toast.success('Unfollowed');
|
|
99
|
+
} else {
|
|
100
|
+
await $fetch(`/api/users/${username}/follow`, { method: 'POST' });
|
|
101
|
+
following.value = true;
|
|
102
|
+
toast.success('Following!');
|
|
103
|
+
}
|
|
104
|
+
} catch {
|
|
105
|
+
toast.error('Failed to update follow');
|
|
106
|
+
} finally {
|
|
107
|
+
followLoading.value = false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function handleMessage(): Promise<void> {
|
|
112
|
+
if (!isAuthenticated.value) {
|
|
113
|
+
await navigateTo(`/auth/login?redirect=/u/${username}`);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (!profile.value) return;
|
|
117
|
+
try {
|
|
118
|
+
const conv = await $fetch<{ id: string }>('/api/messages', {
|
|
119
|
+
method: 'POST',
|
|
120
|
+
body: { participants: [profile.value.id] },
|
|
121
|
+
});
|
|
122
|
+
await navigateTo(`/messages/${conv.id}`);
|
|
123
|
+
} catch {
|
|
124
|
+
toast.error('Failed to start conversation');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function handleShare(): Promise<void> {
|
|
129
|
+
const url = `${window.location.origin}/u/${username}`;
|
|
130
|
+
if (navigator.share) {
|
|
131
|
+
await navigator.share({ title: p.value?.displayName || username, url }).catch(() => {});
|
|
132
|
+
} else {
|
|
133
|
+
await navigator.clipboard.writeText(url);
|
|
134
|
+
toast.success('Link copied to clipboard');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const showMenu = ref(false);
|
|
139
|
+
function toggleMenu(): void {
|
|
140
|
+
showMenu.value = !showMenu.value;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function handleReport(): Promise<void> {
|
|
144
|
+
showMenu.value = false;
|
|
145
|
+
if (!isAuthenticated.value) {
|
|
146
|
+
await navigateTo(`/auth/login?redirect=/u/${username}`);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (!profile.value) return;
|
|
150
|
+
try {
|
|
151
|
+
await $fetch(`/api/content/${profile.value.id}/report`, {
|
|
152
|
+
method: 'POST',
|
|
153
|
+
body: { targetType: 'user', targetId: profile.value.id, reason: 'other' },
|
|
154
|
+
});
|
|
155
|
+
toast.success('Report submitted');
|
|
156
|
+
} catch {
|
|
157
|
+
toast.error('Failed to submit report');
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
</script>
|
|
161
|
+
|
|
162
|
+
<template>
|
|
163
|
+
<div v-if="profilePending" class="cpub-loading">Loading profile...</div>
|
|
164
|
+
<div v-else-if="profileError" class="cpub-fetch-error">
|
|
165
|
+
<div class="cpub-fetch-error-icon"><i class="fa-solid fa-triangle-exclamation"></i></div>
|
|
166
|
+
<div class="cpub-fetch-error-msg">Failed to load user profile.</div>
|
|
167
|
+
<button class="cpub-btn cpub-btn-sm" @click="refreshProfile()">Retry</button>
|
|
168
|
+
</div>
|
|
169
|
+
<div v-else-if="p" class="cpub-profile">
|
|
170
|
+
<!-- Hero -->
|
|
171
|
+
<section class="cpub-profile-hero">
|
|
172
|
+
<!-- Banner -->
|
|
173
|
+
<div class="cpub-profile-banner">
|
|
174
|
+
<img v-if="p.bannerUrl" :src="p.bannerUrl" :alt="`${p.displayName || p.username} banner`" class="cpub-profile-banner-img" />
|
|
175
|
+
<div v-else class="cpub-profile-banner-grid" />
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<div class="cpub-profile-hero-inner">
|
|
179
|
+
<div class="cpub-profile-hero-top">
|
|
180
|
+
<div class="cpub-profile-avatar-wrap">
|
|
181
|
+
<div class="cpub-profile-avatar">
|
|
182
|
+
<img v-if="p.avatarUrl" :src="p.avatarUrl" :alt="p.displayName || p.username" class="cpub-profile-avatar-img" />
|
|
183
|
+
<span v-else>{{ (p.displayName || p.username || 'U').charAt(0).toUpperCase() }}</span>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
<div class="cpub-profile-hero-info">
|
|
187
|
+
<h1 class="cpub-profile-name">{{ p.displayName || p.username }}</h1>
|
|
188
|
+
<div class="cpub-profile-handle">@{{ p.username }}<span v-if="federationEnabled && instanceDomain" class="cpub-fedi-addr" title="Fediverse address">@{{ instanceDomain }}</span></div>
|
|
189
|
+
<p v-if="p.headline" class="cpub-profile-headline">{{ p.headline }}</p>
|
|
190
|
+
<p v-if="p.bio" class="cpub-profile-bio">{{ p.bio }}</p>
|
|
191
|
+
<div class="cpub-profile-meta">
|
|
192
|
+
<span v-if="p.location" class="cpub-profile-meta-item">
|
|
193
|
+
<i class="fa-solid fa-location-dot"></i> {{ p.location }}
|
|
194
|
+
</span>
|
|
195
|
+
<span v-if="p.website" class="cpub-profile-meta-item">
|
|
196
|
+
<i class="fa-solid fa-globe"></i>
|
|
197
|
+
<a :href="p.website" target="_blank" rel="noopener">{{ p.website.replace(/^https?:\/\//, '') }}</a>
|
|
198
|
+
</span>
|
|
199
|
+
<span class="cpub-profile-meta-item">
|
|
200
|
+
<i class="fa-solid fa-calendar"></i> Joined {{ new Date(p.createdAt).toLocaleDateString('en-US', { month: 'short', year: 'numeric' }) }}
|
|
201
|
+
</span>
|
|
202
|
+
</div>
|
|
203
|
+
<div v-if="p.skills?.length" class="cpub-tag-row" style="margin-bottom: 14px">
|
|
204
|
+
<span v-for="skill in p.skills" :key="skill" class="cpub-tag">{{ skill }}</span>
|
|
205
|
+
</div>
|
|
206
|
+
<div style="display: flex; align-items: center; gap: 16px">
|
|
207
|
+
<div v-if="!isOwnProfile" class="cpub-profile-actions">
|
|
208
|
+
<button
|
|
209
|
+
:class="['cpub-btn', following ? '' : 'cpub-btn-primary']"
|
|
210
|
+
:disabled="followLoading"
|
|
211
|
+
@click="toggleFollow"
|
|
212
|
+
>
|
|
213
|
+
<i :class="following ? 'fa-solid fa-user-check' : 'fa-solid fa-user-plus'"></i>
|
|
214
|
+
{{ following ? 'Following' : 'Follow' }}
|
|
215
|
+
</button>
|
|
216
|
+
<button class="cpub-btn" @click="handleMessage"><i class="fa-solid fa-envelope"></i> Message</button>
|
|
217
|
+
<button class="cpub-btn cpub-btn-sm" aria-label="Share profile" @click="handleShare"><i class="fa-solid fa-share-nodes"></i></button>
|
|
218
|
+
<div style="position: relative; display: inline-block;">
|
|
219
|
+
<button class="cpub-btn cpub-btn-sm" aria-label="More options" @click="toggleMenu"><i class="fa-solid fa-ellipsis"></i></button>
|
|
220
|
+
<div v-if="showMenu" class="cpub-dropdown" @click="showMenu = false">
|
|
221
|
+
<button class="cpub-dropdown-item" @click="handleReport"><i class="fa-solid fa-flag"></i> Report</button>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
<div v-else class="cpub-profile-actions">
|
|
226
|
+
<NuxtLink to="/settings/profile" class="cpub-btn"><i class="fa-solid fa-pen"></i> Edit Profile</NuxtLink>
|
|
227
|
+
</div>
|
|
228
|
+
<div v-if="p.socialLinks" class="cpub-profile-social">
|
|
229
|
+
<a v-if="p.socialLinks.github" :href="p.socialLinks.github" class="cpub-social-btn" target="_blank" rel="noopener" aria-label="GitHub"><i class="fa-brands fa-github"></i></a>
|
|
230
|
+
<a v-if="p.socialLinks.twitter" :href="p.socialLinks.twitter" class="cpub-social-btn" target="_blank" rel="noopener" aria-label="Twitter"><i class="fa-brands fa-x-twitter"></i></a>
|
|
231
|
+
<a v-if="p.socialLinks.linkedin" :href="p.socialLinks.linkedin" class="cpub-social-btn" target="_blank" rel="noopener" aria-label="LinkedIn"><i class="fa-brands fa-linkedin-in"></i></a>
|
|
232
|
+
<a v-if="p.socialLinks.youtube" :href="p.socialLinks.youtube" class="cpub-social-btn" target="_blank" rel="noopener" aria-label="YouTube"><i class="fa-brands fa-youtube"></i></a>
|
|
233
|
+
<a v-if="p.socialLinks.mastodon" :href="p.socialLinks.mastodon" class="cpub-social-btn" target="_blank" rel="noopener" aria-label="Mastodon"><i class="fa-brands fa-mastodon"></i></a>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
<!-- Stats -->
|
|
239
|
+
<StatBar :stats="profileStats" />
|
|
240
|
+
</div>
|
|
241
|
+
</section>
|
|
242
|
+
|
|
243
|
+
<!-- Tabs -->
|
|
244
|
+
<div class="cpub-profile-tabs">
|
|
245
|
+
<div class="cpub-profile-tabs-inner">
|
|
246
|
+
<button
|
|
247
|
+
v-for="tab in tabDefs"
|
|
248
|
+
:key="tab.value"
|
|
249
|
+
class="cpub-tab-btn"
|
|
250
|
+
:class="{ active: activeTab === tab.value }"
|
|
251
|
+
@click="activeTab = tab.value"
|
|
252
|
+
>
|
|
253
|
+
<i :class="tab.icon" style="font-size: 10px"></i>
|
|
254
|
+
{{ tab.label }}
|
|
255
|
+
</button>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
<!-- Content -->
|
|
260
|
+
<div class="cpub-profile-main">
|
|
261
|
+
<!-- Projects / Articles / Explainers / Videos tabs -->
|
|
262
|
+
<template v-if="['projects', 'articles', 'explainers'].includes(activeTab)">
|
|
263
|
+
<!-- Section header -->
|
|
264
|
+
<div class="cpub-sec-head">
|
|
265
|
+
<h2>
|
|
266
|
+
<i :class="tabDefs.find(t => t.value === activeTab)?.icon" style="color: var(--accent); margin-right: 6px"></i>
|
|
267
|
+
{{ tabDefs.find(t => t.value === activeTab)?.label }}
|
|
268
|
+
</h2>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<div v-if="filteredContent.length" class="cpub-grid-3">
|
|
272
|
+
<ContentCard v-for="item in filteredContent" :key="item.id" :item="item" />
|
|
273
|
+
</div>
|
|
274
|
+
<div v-else class="cpub-empty-state">
|
|
275
|
+
<p class="cpub-empty-state-title">No {{ activeTab }} yet</p>
|
|
276
|
+
</div>
|
|
277
|
+
</template>
|
|
278
|
+
|
|
279
|
+
<!-- Learning tab — Certificates + In-progress paths -->
|
|
280
|
+
<template v-if="learningEnabled && activeTab === 'learning'">
|
|
281
|
+
<!-- Certificates -->
|
|
282
|
+
<template v-if="learningData?.certificates?.length">
|
|
283
|
+
<div class="cpub-sec-head">
|
|
284
|
+
<h2><i class="fa-solid fa-medal" style="color: var(--yellow); margin-right: 6px"></i>Certificates</h2>
|
|
285
|
+
</div>
|
|
286
|
+
<div class="cpub-cert-list">
|
|
287
|
+
<NuxtLink
|
|
288
|
+
v-for="cert in learningData.certificates"
|
|
289
|
+
:key="cert.id"
|
|
290
|
+
:to="`/cert/${cert.verificationCode}`"
|
|
291
|
+
class="cpub-cert-card-profile"
|
|
292
|
+
>
|
|
293
|
+
<div class="cpub-cert-card-badge"><i class="fa-solid fa-award"></i></div>
|
|
294
|
+
<div class="cpub-cert-card-info">
|
|
295
|
+
<div class="cpub-cert-card-path">{{ cert.path.title }}</div>
|
|
296
|
+
<div class="cpub-cert-card-date">Completed {{ new Date(cert.issuedAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }) }}</div>
|
|
297
|
+
</div>
|
|
298
|
+
<div class="cpub-cert-card-code">{{ cert.verificationCode }}</div>
|
|
299
|
+
</NuxtLink>
|
|
300
|
+
</div>
|
|
301
|
+
</template>
|
|
302
|
+
|
|
303
|
+
<!-- In-progress enrollments -->
|
|
304
|
+
<template v-if="learningData?.enrollments?.length">
|
|
305
|
+
<div class="cpub-sec-head" style="margin-top: 24px">
|
|
306
|
+
<h2><i class="fa-solid fa-graduation-cap" style="color: var(--accent); margin-right: 6px"></i>In Progress</h2>
|
|
307
|
+
</div>
|
|
308
|
+
<div class="cpub-enrollment-list">
|
|
309
|
+
<NuxtLink
|
|
310
|
+
v-for="enr in learningData.enrollments"
|
|
311
|
+
:key="enr.id"
|
|
312
|
+
:to="`/learn/${enr.path.slug}`"
|
|
313
|
+
class="cpub-enrollment-card"
|
|
314
|
+
>
|
|
315
|
+
<div class="cpub-enrollment-icon"><i class="fa-solid fa-route"></i></div>
|
|
316
|
+
<div class="cpub-enrollment-info">
|
|
317
|
+
<div class="cpub-enrollment-title">{{ enr.path.title }}</div>
|
|
318
|
+
<div class="cpub-enrollment-progress-row">
|
|
319
|
+
<div class="cpub-enrollment-bar">
|
|
320
|
+
<div class="cpub-enrollment-fill" :style="{ width: (enr.progress ?? 0) + '%' }"></div>
|
|
321
|
+
</div>
|
|
322
|
+
<span class="cpub-enrollment-pct">{{ Math.round(parseFloat(enr.progress)) }}%</span>
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
</NuxtLink>
|
|
326
|
+
</div>
|
|
327
|
+
</template>
|
|
328
|
+
|
|
329
|
+
<div v-if="!learningData?.certificates?.length && !learningData?.enrollments?.length" class="cpub-learning-empty">
|
|
330
|
+
<div class="cpub-empty-icon"><i class="fa-solid fa-graduation-cap"></i></div>
|
|
331
|
+
<p class="cpub-empty-state-title">No learning activity yet</p>
|
|
332
|
+
<p class="cpub-empty-state-sub">Enroll in learning paths to start tracking progress.</p>
|
|
333
|
+
</div>
|
|
334
|
+
</template>
|
|
335
|
+
|
|
336
|
+
<!-- About tab — Bio + Skills with sidebar -->
|
|
337
|
+
<template v-if="activeTab === 'about'">
|
|
338
|
+
<div class="cpub-about-grid">
|
|
339
|
+
<div>
|
|
340
|
+
<!-- Bio -->
|
|
341
|
+
<div v-if="p.bio" style="margin-bottom: 32px">
|
|
342
|
+
<div class="cpub-sec-head">
|
|
343
|
+
<h2><i class="fa-solid fa-user" style="color: var(--accent); margin-right: 6px"></i>About</h2>
|
|
344
|
+
</div>
|
|
345
|
+
<p style="font-size: 14px; color: var(--text-dim); line-height: 1.7; max-width: 600px;">{{ p.bio }}</p>
|
|
346
|
+
</div>
|
|
347
|
+
|
|
348
|
+
<!-- Info -->
|
|
349
|
+
<div style="margin-bottom: 32px">
|
|
350
|
+
<div class="cpub-sec-head">
|
|
351
|
+
<h2><i class="fa-solid fa-circle-info" style="color: var(--teal); margin-right: 6px"></i>Details</h2>
|
|
352
|
+
</div>
|
|
353
|
+
<div class="cpub-about-details">
|
|
354
|
+
<div v-if="p.location" class="cpub-about-detail"><i class="fa-solid fa-location-dot"></i> {{ p.location }}</div>
|
|
355
|
+
<div v-if="p.website" class="cpub-about-detail"><i class="fa-solid fa-globe"></i> <a :href="p.website" target="_blank" rel="noopener">{{ p.website.replace(/^https?:\/\//, '') }}</a></div>
|
|
356
|
+
<div v-if="p.pronouns" class="cpub-about-detail"><i class="fa-solid fa-comment"></i> {{ p.pronouns }}</div>
|
|
357
|
+
<div class="cpub-about-detail"><i class="fa-solid fa-calendar"></i> Joined {{ new Date(p.createdAt).toLocaleDateString('en-US', { month: 'long', year: 'numeric' }) }}</div>
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
360
|
+
|
|
361
|
+
<!-- Skills -->
|
|
362
|
+
<div class="cpub-skills-section">
|
|
363
|
+
<div class="cpub-sec-head">
|
|
364
|
+
<h2><i class="fa-solid fa-microchip" style="color: var(--teal); margin-right: 6px"></i>Skills</h2>
|
|
365
|
+
</div>
|
|
366
|
+
<div v-if="p.skills?.length" class="cpub-tag-row" style="flex-wrap: wrap; gap: 6px;">
|
|
367
|
+
<span v-for="skill in p.skills" :key="skill" class="cpub-tag">{{ skill }}</span>
|
|
368
|
+
</div>
|
|
369
|
+
<div v-else class="cpub-empty-state">
|
|
370
|
+
<p class="cpub-empty-state-title">No skills listed yet</p>
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
|
|
375
|
+
<!-- Sidebar -->
|
|
376
|
+
<div class="cpub-about-sidebar">
|
|
377
|
+
<!-- Activity Heatmap -->
|
|
378
|
+
<div class="cpub-sb-card">
|
|
379
|
+
<div class="cpub-sb-title">Activity</div>
|
|
380
|
+
<HeatmapGrid :weeks="20" />
|
|
381
|
+
</div>
|
|
382
|
+
|
|
383
|
+
<!-- Featured Projects -->
|
|
384
|
+
<div class="cpub-sb-card">
|
|
385
|
+
<div class="cpub-sb-title">Featured Projects</div>
|
|
386
|
+
<div v-for="item in filteredContent.slice(0, 3)" :key="item.id" class="cpub-mini-project">
|
|
387
|
+
<div class="cpub-mini-thumb"><i class="fa-solid fa-microchip"></i></div>
|
|
388
|
+
<div>
|
|
389
|
+
<div class="cpub-mini-title">{{ item.title }}</div>
|
|
390
|
+
<div class="cpub-mini-meta">{{ item.viewCount ?? 0 }} views</div>
|
|
391
|
+
</div>
|
|
392
|
+
</div>
|
|
393
|
+
</div>
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
</template>
|
|
397
|
+
</div>
|
|
398
|
+
</div>
|
|
399
|
+
|
|
400
|
+
<div v-else class="cpub-empty-state">
|
|
401
|
+
<p class="cpub-empty-state-title">User not found</p>
|
|
402
|
+
</div>
|
|
403
|
+
</template>
|
|
404
|
+
|
|
405
|
+
<style scoped>
|
|
406
|
+
/* Profile Banner */
|
|
407
|
+
.cpub-profile-banner {
|
|
408
|
+
height: 180px;
|
|
409
|
+
background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 50%, var(--teal) 100%);
|
|
410
|
+
position: relative;
|
|
411
|
+
overflow: hidden;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.cpub-profile-banner-img {
|
|
415
|
+
width: 100%;
|
|
416
|
+
height: 100%;
|
|
417
|
+
object-fit: cover;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.cpub-profile-banner-grid {
|
|
421
|
+
position: absolute;
|
|
422
|
+
inset: 0;
|
|
423
|
+
background-image:
|
|
424
|
+
linear-gradient(var(--border2) 1px, transparent 1px),
|
|
425
|
+
linear-gradient(90deg, var(--border2) 1px, transparent 1px);
|
|
426
|
+
background-size: 40px 40px;
|
|
427
|
+
opacity: 0.3;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/* Profile Hero */
|
|
431
|
+
.cpub-profile-hero {
|
|
432
|
+
background: var(--surface2);
|
|
433
|
+
border-bottom: var(--border-width-default) solid var(--border);
|
|
434
|
+
padding: 0;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.cpub-profile-hero-inner {
|
|
438
|
+
max-width: 1080px;
|
|
439
|
+
margin: 0 auto;
|
|
440
|
+
padding: 0 32px;
|
|
441
|
+
margin-top: -48px;
|
|
442
|
+
position: relative;
|
|
443
|
+
z-index: 1;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.cpub-profile-hero-top {
|
|
447
|
+
display: flex;
|
|
448
|
+
align-items: flex-start;
|
|
449
|
+
gap: 24px;
|
|
450
|
+
margin-bottom: 24px;
|
|
451
|
+
padding-top: 16px;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.cpub-profile-avatar-wrap {
|
|
455
|
+
position: relative;
|
|
456
|
+
flex-shrink: 0;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.cpub-profile-avatar {
|
|
460
|
+
width: 120px;
|
|
461
|
+
height: 120px;
|
|
462
|
+
border-radius: 50%;
|
|
463
|
+
background: var(--surface);
|
|
464
|
+
border: 4px solid var(--surface);
|
|
465
|
+
box-shadow: 0 0 0 2px var(--border);
|
|
466
|
+
display: flex;
|
|
467
|
+
align-items: center;
|
|
468
|
+
justify-content: center;
|
|
469
|
+
font-size: 40px;
|
|
470
|
+
font-weight: 700;
|
|
471
|
+
color: var(--accent);
|
|
472
|
+
font-family: var(--font-mono);
|
|
473
|
+
overflow: hidden;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.cpub-profile-avatar-img {
|
|
477
|
+
width: 100%;
|
|
478
|
+
height: 100%;
|
|
479
|
+
object-fit: cover;
|
|
480
|
+
border-radius: 50%;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.cpub-profile-hero-info {
|
|
484
|
+
flex: 1;
|
|
485
|
+
min-width: 0;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.cpub-profile-name {
|
|
489
|
+
font-size: 22px;
|
|
490
|
+
font-weight: 700;
|
|
491
|
+
letter-spacing: -0.02em;
|
|
492
|
+
margin-bottom: 2px;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.cpub-profile-handle {
|
|
496
|
+
font-size: 13px;
|
|
497
|
+
color: var(--text-dim);
|
|
498
|
+
font-family: var(--font-mono);
|
|
499
|
+
margin-bottom: 6px;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.cpub-fedi-addr {
|
|
503
|
+
color: var(--text-faint);
|
|
504
|
+
font-size: 0.75rem;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.cpub-profile-headline {
|
|
508
|
+
font-size: 14px;
|
|
509
|
+
font-weight: 500;
|
|
510
|
+
color: var(--text);
|
|
511
|
+
margin-bottom: 10px;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.cpub-profile-bio {
|
|
515
|
+
font-size: 12px;
|
|
516
|
+
color: var(--text-dim);
|
|
517
|
+
line-height: 1.6;
|
|
518
|
+
max-width: 560px;
|
|
519
|
+
margin-bottom: 12px;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.cpub-profile-meta {
|
|
523
|
+
display: flex;
|
|
524
|
+
align-items: center;
|
|
525
|
+
gap: 16px;
|
|
526
|
+
font-size: 11px;
|
|
527
|
+
color: var(--text-dim);
|
|
528
|
+
margin-bottom: 12px;
|
|
529
|
+
font-family: var(--font-mono);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.cpub-profile-meta-item {
|
|
533
|
+
display: flex;
|
|
534
|
+
align-items: center;
|
|
535
|
+
gap: 5px;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.cpub-profile-meta-item a {
|
|
539
|
+
color: var(--accent);
|
|
540
|
+
text-decoration: none;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.cpub-profile-meta-item a:hover {
|
|
544
|
+
text-decoration: underline;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.cpub-profile-actions {
|
|
548
|
+
display: flex;
|
|
549
|
+
align-items: center;
|
|
550
|
+
gap: 8px;
|
|
551
|
+
margin-bottom: 20px;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
.cpub-profile-social {
|
|
555
|
+
display: flex;
|
|
556
|
+
align-items: center;
|
|
557
|
+
gap: 6px;
|
|
558
|
+
margin-left: 8px;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.cpub-social-btn {
|
|
562
|
+
width: 28px;
|
|
563
|
+
height: 28px;
|
|
564
|
+
background: var(--surface);
|
|
565
|
+
border: var(--border-width-default) solid var(--border);
|
|
566
|
+
color: var(--text-dim);
|
|
567
|
+
display: flex;
|
|
568
|
+
align-items: center;
|
|
569
|
+
justify-content: center;
|
|
570
|
+
font-size: 12px;
|
|
571
|
+
text-decoration: none;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.cpub-social-btn:hover {
|
|
575
|
+
background: var(--surface2);
|
|
576
|
+
color: var(--text);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/* Profile Stats */
|
|
580
|
+
.cpub-profile-stats {
|
|
581
|
+
display: flex;
|
|
582
|
+
gap: 0;
|
|
583
|
+
border-top: var(--border-width-default) solid var(--border);
|
|
584
|
+
margin-top: 16px;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.cpub-profile-stat {
|
|
588
|
+
flex: 1;
|
|
589
|
+
padding: 14px 20px;
|
|
590
|
+
border-right: var(--border-width-default) solid var(--border);
|
|
591
|
+
cursor: pointer;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.cpub-profile-stat:last-child {
|
|
595
|
+
border-right: none;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.cpub-profile-stat:hover {
|
|
599
|
+
background: var(--surface2);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
.cpub-profile-stat-val {
|
|
603
|
+
font-size: 18px;
|
|
604
|
+
font-weight: 700;
|
|
605
|
+
color: var(--text);
|
|
606
|
+
font-family: var(--font-mono);
|
|
607
|
+
margin-bottom: 2px;
|
|
608
|
+
display: block;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.cpub-profile-stat-label {
|
|
612
|
+
font-size: 10px;
|
|
613
|
+
color: var(--text-faint);
|
|
614
|
+
text-transform: uppercase;
|
|
615
|
+
letter-spacing: 0.1em;
|
|
616
|
+
font-family: var(--font-mono);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/* Profile Tabs */
|
|
620
|
+
.cpub-profile-tabs {
|
|
621
|
+
background: var(--surface);
|
|
622
|
+
border-bottom: var(--border-width-default) solid var(--border);
|
|
623
|
+
position: sticky;
|
|
624
|
+
top: 48px;
|
|
625
|
+
z-index: 90;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.cpub-profile-tabs-inner {
|
|
629
|
+
max-width: 1080px;
|
|
630
|
+
margin: 0 auto;
|
|
631
|
+
padding: 0 32px;
|
|
632
|
+
display: flex;
|
|
633
|
+
gap: 2px;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.cpub-tab-btn {
|
|
637
|
+
font-size: 12px;
|
|
638
|
+
color: var(--text-dim);
|
|
639
|
+
padding: 10px 14px;
|
|
640
|
+
border: none;
|
|
641
|
+
background: none;
|
|
642
|
+
cursor: pointer;
|
|
643
|
+
border-bottom: 3px solid transparent;
|
|
644
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
645
|
+
display: flex;
|
|
646
|
+
align-items: center;
|
|
647
|
+
gap: 6px;
|
|
648
|
+
position: relative;
|
|
649
|
+
top: 2px;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.cpub-tab-btn:hover { color: var(--text); }
|
|
653
|
+
|
|
654
|
+
.cpub-tab-btn.active {
|
|
655
|
+
color: var(--text);
|
|
656
|
+
border-bottom-color: var(--accent);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/* Main Content */
|
|
660
|
+
.cpub-profile-main {
|
|
661
|
+
max-width: 1080px;
|
|
662
|
+
margin: 0 auto;
|
|
663
|
+
padding: 32px;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/* About details */
|
|
667
|
+
.cpub-about-details {
|
|
668
|
+
display: flex;
|
|
669
|
+
flex-direction: column;
|
|
670
|
+
gap: 10px;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.cpub-about-detail {
|
|
674
|
+
font-size: 13px;
|
|
675
|
+
color: var(--text-dim);
|
|
676
|
+
display: flex;
|
|
677
|
+
align-items: center;
|
|
678
|
+
gap: 8px;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.cpub-about-detail i {
|
|
682
|
+
width: 16px;
|
|
683
|
+
text-align: center;
|
|
684
|
+
color: var(--text-faint);
|
|
685
|
+
font-size: 12px;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.cpub-about-detail a {
|
|
689
|
+
color: var(--accent);
|
|
690
|
+
text-decoration: none;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.cpub-about-detail a:hover {
|
|
694
|
+
text-decoration: underline;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/* Skills */
|
|
698
|
+
.cpub-skills-group {
|
|
699
|
+
margin-bottom: 16px;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.cpub-skills-group-label {
|
|
703
|
+
font-size: 10px;
|
|
704
|
+
font-weight: 600;
|
|
705
|
+
text-transform: uppercase;
|
|
706
|
+
letter-spacing: 0.1em;
|
|
707
|
+
color: var(--text-faint);
|
|
708
|
+
font-family: var(--font-mono);
|
|
709
|
+
margin-bottom: 8px;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/* About grid */
|
|
713
|
+
.cpub-about-grid {
|
|
714
|
+
display: grid;
|
|
715
|
+
grid-template-columns: 1fr 280px;
|
|
716
|
+
gap: 32px;
|
|
717
|
+
align-items: start;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
.cpub-mini-project {
|
|
722
|
+
display: flex;
|
|
723
|
+
gap: 10px;
|
|
724
|
+
margin-bottom: 10px;
|
|
725
|
+
padding-bottom: 10px;
|
|
726
|
+
border-bottom: var(--border-width-default) solid var(--border2);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.cpub-mini-project:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
|
|
730
|
+
|
|
731
|
+
.cpub-mini-thumb {
|
|
732
|
+
width: 44px;
|
|
733
|
+
height: 36px;
|
|
734
|
+
background: var(--surface2);
|
|
735
|
+
flex-shrink: 0;
|
|
736
|
+
display: flex;
|
|
737
|
+
align-items: center;
|
|
738
|
+
justify-content: center;
|
|
739
|
+
font-size: 14px;
|
|
740
|
+
border: var(--border-width-default) solid var(--border);
|
|
741
|
+
color: var(--accent);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.cpub-learning-empty { text-align: center; padding: 48px 0; }
|
|
745
|
+
.cpub-empty-icon { font-size: 32px; color: var(--text-faint); margin-bottom: 12px; }
|
|
746
|
+
.cpub-empty-state-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
|
|
747
|
+
|
|
748
|
+
/* Certificates list */
|
|
749
|
+
.cpub-cert-list { display: flex; flex-direction: column; gap: 8px; }
|
|
750
|
+
.cpub-cert-card-profile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: var(--border-width-default) solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow-md); transition: box-shadow 0.15s, transform 0.15s; }
|
|
751
|
+
.cpub-cert-card-profile:hover { box-shadow: var(--shadow-sm); transform: translate(1px, 1px); }
|
|
752
|
+
.cpub-cert-card-badge { width: 40px; height: 40px; border-radius: 50%; border: var(--border-width-default) solid var(--yellow); background: var(--yellow-bg); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--yellow); flex-shrink: 0; }
|
|
753
|
+
.cpub-cert-card-info { flex: 1; }
|
|
754
|
+
.cpub-cert-card-path { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
|
|
755
|
+
.cpub-cert-card-date { font-size: 11px; font-family: var(--font-mono); color: var(--text-faint); }
|
|
756
|
+
.cpub-cert-card-code { font-size: 10px; font-family: var(--font-mono); color: var(--accent); background: var(--accent-bg); padding: 2px 8px; border: var(--border-width-default) solid var(--accent-border); flex-shrink: 0; }
|
|
757
|
+
|
|
758
|
+
/* Enrollment list */
|
|
759
|
+
.cpub-enrollment-list { display: flex; flex-direction: column; gap: 8px; }
|
|
760
|
+
.cpub-enrollment-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: var(--border-width-default) solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow-md); transition: box-shadow 0.15s, transform 0.15s; }
|
|
761
|
+
.cpub-enrollment-card:hover { box-shadow: var(--shadow-sm); transform: translate(1px, 1px); }
|
|
762
|
+
.cpub-enrollment-icon { width: 40px; height: 40px; border: var(--border-width-default) solid var(--border); background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--accent); flex-shrink: 0; }
|
|
763
|
+
.cpub-enrollment-info { flex: 1; }
|
|
764
|
+
.cpub-enrollment-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
|
|
765
|
+
.cpub-enrollment-progress-row { display: flex; align-items: center; gap: 8px; }
|
|
766
|
+
.cpub-enrollment-bar { flex: 1; height: 4px; background: var(--surface3); border: var(--border-width-default) solid var(--border2); }
|
|
767
|
+
.cpub-enrollment-fill { height: 100%; background: var(--accent); }
|
|
768
|
+
.cpub-enrollment-pct { font-size: 11px; font-family: var(--font-mono); color: var(--accent); flex-shrink: 0; }
|
|
769
|
+
|
|
770
|
+
.cpub-mini-title { font-size: 11px; font-weight: 500; margin-bottom: 2px; line-height: 1.3; }
|
|
771
|
+
.cpub-mini-meta { font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); }
|
|
772
|
+
|
|
773
|
+
/* Grid */
|
|
774
|
+
.cpub-grid-3 {
|
|
775
|
+
display: grid;
|
|
776
|
+
grid-template-columns: repeat(3, 1fr);
|
|
777
|
+
gap: 16px;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.cpub-dropdown {
|
|
781
|
+
position: absolute;
|
|
782
|
+
top: calc(100% + 4px);
|
|
783
|
+
right: 0;
|
|
784
|
+
background: var(--surface);
|
|
785
|
+
border: var(--border-width-default) solid var(--border);
|
|
786
|
+
box-shadow: var(--shadow-md);
|
|
787
|
+
z-index: 100;
|
|
788
|
+
min-width: 140px;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
.cpub-dropdown-item {
|
|
792
|
+
display: flex;
|
|
793
|
+
align-items: center;
|
|
794
|
+
gap: 8px;
|
|
795
|
+
width: 100%;
|
|
796
|
+
padding: 8px 12px;
|
|
797
|
+
background: none;
|
|
798
|
+
border: none;
|
|
799
|
+
color: var(--text-dim);
|
|
800
|
+
font-size: 12px;
|
|
801
|
+
cursor: pointer;
|
|
802
|
+
text-align: left;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.cpub-dropdown-item:hover {
|
|
806
|
+
background: var(--surface2);
|
|
807
|
+
color: var(--text);
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
@media (max-width: 768px) {
|
|
811
|
+
.cpub-profile-hero-top {
|
|
812
|
+
flex-direction: column;
|
|
813
|
+
align-items: center;
|
|
814
|
+
text-align: center;
|
|
815
|
+
}
|
|
816
|
+
.cpub-profile-meta {
|
|
817
|
+
justify-content: center;
|
|
818
|
+
flex-wrap: wrap;
|
|
819
|
+
}
|
|
820
|
+
.cpub-profile-actions {
|
|
821
|
+
justify-content: center;
|
|
822
|
+
}
|
|
823
|
+
.cpub-profile-stats {
|
|
824
|
+
flex-wrap: wrap;
|
|
825
|
+
}
|
|
826
|
+
.cpub-profile-stat {
|
|
827
|
+
min-width: 50%;
|
|
828
|
+
border-bottom: var(--border-width-default) solid var(--border);
|
|
829
|
+
}
|
|
830
|
+
.cpub-about-grid {
|
|
831
|
+
grid-template-columns: 1fr;
|
|
832
|
+
}
|
|
833
|
+
.cpub-grid-3 {
|
|
834
|
+
grid-template-columns: 1fr;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
</style>
|