@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,199 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HubPostViewModel } from '../../types/hub';
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
posts: HubPostViewModel[];
|
|
6
|
+
interactive?: boolean;
|
|
7
|
+
likedPostIds?: Set<string>;
|
|
8
|
+
}>();
|
|
9
|
+
|
|
10
|
+
const emit = defineEmits<{ 'post-vote': [postId: string] }>();
|
|
11
|
+
|
|
12
|
+
const feedFilter = ref('all');
|
|
13
|
+
|
|
14
|
+
const feedFilters = [
|
|
15
|
+
{ value: 'all', label: 'All Posts' },
|
|
16
|
+
{ value: 'question', label: 'Questions' },
|
|
17
|
+
{ value: 'discussion', label: 'Discussions' },
|
|
18
|
+
{ value: 'showcase', label: 'Showcase' },
|
|
19
|
+
{ value: 'announcement', label: 'Announcements' },
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const filteredPosts = computed(() => {
|
|
23
|
+
if (feedFilter.value === 'all') return props.posts;
|
|
24
|
+
return props.posts.filter((p) => p.type === feedFilter.value);
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<!-- Pinned announcements -->
|
|
30
|
+
<AnnouncementBand
|
|
31
|
+
v-for="post in filteredPosts.filter(p => p.isPinned && p.type === 'announcement')"
|
|
32
|
+
:key="`ann-${post.id}`"
|
|
33
|
+
:title="post.content?.slice(0, 80) || 'Announcement'"
|
|
34
|
+
:body="post.content || ''"
|
|
35
|
+
:author="post.author.name"
|
|
36
|
+
:created-at="new Date(post.createdAt)"
|
|
37
|
+
:pinned="true"
|
|
38
|
+
style="margin-bottom: 12px"
|
|
39
|
+
/>
|
|
40
|
+
|
|
41
|
+
<!-- Compose slot (page provides compose bar for local, nothing for federated) -->
|
|
42
|
+
<slot name="compose" />
|
|
43
|
+
|
|
44
|
+
<!-- Feed filter -->
|
|
45
|
+
<div class="cpub-tag-row" style="margin-bottom: 14px">
|
|
46
|
+
<FilterChip
|
|
47
|
+
v-for="f in feedFilters"
|
|
48
|
+
:key="f.value"
|
|
49
|
+
:label="f.label"
|
|
50
|
+
:active="feedFilter === f.value"
|
|
51
|
+
@toggle="feedFilter = f.value"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<!-- Feed posts -->
|
|
56
|
+
<div v-if="filteredPosts.length" class="cpub-feed-list">
|
|
57
|
+
<template v-for="post in filteredPosts" :key="post.id">
|
|
58
|
+
<!-- Share posts -->
|
|
59
|
+
<NuxtLink v-if="post.sharedContent?.slug && !post.sharedContent?.url" :to="`/${post.sharedContent.type}/${post.sharedContent.slug}`" class="cpub-share-card">
|
|
60
|
+
<div class="cpub-share-card-context">
|
|
61
|
+
<i class="fa-solid fa-share-nodes"></i>
|
|
62
|
+
{{ post.author.name }} shared a {{ post.sharedContent.type }}
|
|
63
|
+
· {{ new Date(post.createdAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric' }) }}
|
|
64
|
+
</div>
|
|
65
|
+
<div class="cpub-share-card-embed">
|
|
66
|
+
<div v-if="post.sharedContent.coverImageUrl" class="cpub-share-card-thumb">
|
|
67
|
+
<img :src="post.sharedContent.coverImageUrl" :alt="post.sharedContent.title" />
|
|
68
|
+
</div>
|
|
69
|
+
<div v-else class="cpub-share-card-thumb cpub-share-card-thumb-fallback">
|
|
70
|
+
<i :class="post.sharedContent.type === 'project' ? 'fa-solid fa-microchip' : 'fa-solid fa-file-lines'"></i>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="cpub-share-card-body">
|
|
73
|
+
<span class="cpub-share-card-type">{{ post.sharedContent.type }}</span>
|
|
74
|
+
<h3 class="cpub-share-card-title">{{ post.sharedContent.title }}</h3>
|
|
75
|
+
<p v-if="post.sharedContent.description" class="cpub-share-card-desc">{{ post.sharedContent.description }}</p>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</NuxtLink>
|
|
79
|
+
<a v-else-if="post.sharedContent?.url" :href="post.sharedContent.url" target="_blank" rel="noopener noreferrer" class="cpub-share-card">
|
|
80
|
+
<div class="cpub-share-card-context">
|
|
81
|
+
<i class="fa-solid fa-share-nodes"></i>
|
|
82
|
+
{{ post.author.name }} shared a {{ post.sharedContent.type }}
|
|
83
|
+
<span v-if="post.sharedContent.url" class="cpub-share-card-origin">
|
|
84
|
+
<i class="fa-solid fa-globe"></i> {{ post.sharedContent.url.replace(/^https?:\/\//, '').split('/')[0] }}
|
|
85
|
+
</span>
|
|
86
|
+
· {{ new Date(post.createdAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric' }) }}
|
|
87
|
+
</div>
|
|
88
|
+
<div class="cpub-share-card-embed">
|
|
89
|
+
<div v-if="post.sharedContent.coverImageUrl" class="cpub-share-card-thumb">
|
|
90
|
+
<img :src="post.sharedContent.coverImageUrl" :alt="post.sharedContent.title" />
|
|
91
|
+
</div>
|
|
92
|
+
<div v-else class="cpub-share-card-thumb cpub-share-card-thumb-fallback">
|
|
93
|
+
<i :class="post.sharedContent.type === 'project' ? 'fa-solid fa-microchip' : 'fa-solid fa-file-lines'"></i>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="cpub-share-card-body">
|
|
96
|
+
<span class="cpub-share-card-type">{{ post.sharedContent.type }}</span>
|
|
97
|
+
<h3 class="cpub-share-card-title">{{ post.sharedContent.title }}</h3>
|
|
98
|
+
<p v-if="post.sharedContent.description" class="cpub-share-card-desc">{{ post.sharedContent.description }}</p>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</a>
|
|
102
|
+
|
|
103
|
+
<!-- Regular posts — linked or static -->
|
|
104
|
+
<template v-else>
|
|
105
|
+
<NuxtLink v-if="post.linkTo" :to="post.linkTo" class="cpub-feed-link">
|
|
106
|
+
<FeedItem
|
|
107
|
+
:type="(post.type as 'discussion' | 'question' | 'showcase' | 'announcement') || 'discussion'"
|
|
108
|
+
:title="post.content?.slice(0, 80) || ''"
|
|
109
|
+
:author="post.author.name"
|
|
110
|
+
:author-avatar="post.author.avatarUrl ?? undefined"
|
|
111
|
+
:author-handle="post.author.handle ?? undefined"
|
|
112
|
+
:body="post.content || ''"
|
|
113
|
+
:created-at="new Date(post.createdAt)"
|
|
114
|
+
:reply-count="post.replyCount"
|
|
115
|
+
:vote-count="post.likeCount"
|
|
116
|
+
:pinned="post.isPinned"
|
|
117
|
+
:locked="post.isLocked"
|
|
118
|
+
:interactive="interactive"
|
|
119
|
+
:voted="likedPostIds?.has(post.id)"
|
|
120
|
+
@vote="emit('post-vote', post.id)"
|
|
121
|
+
/>
|
|
122
|
+
</NuxtLink>
|
|
123
|
+
<div v-else>
|
|
124
|
+
<FeedItem
|
|
125
|
+
:type="(post.type as 'discussion' | 'question' | 'showcase' | 'announcement') || 'discussion'"
|
|
126
|
+
:title="post.content?.slice(0, 80) || ''"
|
|
127
|
+
:author="post.author.name"
|
|
128
|
+
:author-avatar="post.author.avatarUrl ?? undefined"
|
|
129
|
+
:author-handle="post.author.handle ?? undefined"
|
|
130
|
+
:body="post.content || ''"
|
|
131
|
+
:created-at="new Date(post.createdAt)"
|
|
132
|
+
:reply-count="post.replyCount"
|
|
133
|
+
:vote-count="post.likeCount"
|
|
134
|
+
:pinned="post.isPinned"
|
|
135
|
+
:locked="post.isLocked"
|
|
136
|
+
:interactive="interactive"
|
|
137
|
+
:voted="likedPostIds?.has(post.id)"
|
|
138
|
+
@vote="emit('post-vote', post.id)"
|
|
139
|
+
/>
|
|
140
|
+
</div>
|
|
141
|
+
</template>
|
|
142
|
+
</template>
|
|
143
|
+
</div>
|
|
144
|
+
<div v-else class="cpub-empty-state">
|
|
145
|
+
<div class="cpub-empty-state-icon"><i class="fa-solid fa-message"></i></div>
|
|
146
|
+
<p class="cpub-empty-state-title">No posts yet</p>
|
|
147
|
+
<p class="cpub-empty-state-desc">Be the first to start a discussion!</p>
|
|
148
|
+
</div>
|
|
149
|
+
</template>
|
|
150
|
+
|
|
151
|
+
<style scoped>
|
|
152
|
+
.cpub-feed-list { display: flex; flex-direction: column; gap: 12px; }
|
|
153
|
+
.cpub-feed-link { text-decoration: none; color: inherit; display: block; }
|
|
154
|
+
|
|
155
|
+
/* Share card */
|
|
156
|
+
.cpub-share-card { display: block; text-decoration: none; color: inherit; }
|
|
157
|
+
.cpub-share-card-context {
|
|
158
|
+
font-size: 11px; color: var(--text-faint); padding: 0 0 6px;
|
|
159
|
+
display: flex; align-items: center; gap: 5px;
|
|
160
|
+
}
|
|
161
|
+
.cpub-share-card-context i { font-size: 10px; }
|
|
162
|
+
.cpub-share-card-origin {
|
|
163
|
+
display: inline-flex; align-items: center; gap: 3px;
|
|
164
|
+
color: var(--accent); font-size: 10px;
|
|
165
|
+
}
|
|
166
|
+
.cpub-share-card-origin i { font-size: 9px; }
|
|
167
|
+
.cpub-share-card-embed {
|
|
168
|
+
display: flex; gap: 0;
|
|
169
|
+
background: var(--surface); border: var(--border-width-default) solid var(--border);
|
|
170
|
+
overflow: hidden; transition: border-color 0.15s;
|
|
171
|
+
}
|
|
172
|
+
.cpub-share-card:hover .cpub-share-card-embed { border-color: var(--accent-border); }
|
|
173
|
+
.cpub-share-card-thumb {
|
|
174
|
+
width: 120px; min-height: 80px; flex-shrink: 0; overflow: hidden;
|
|
175
|
+
background: var(--surface2);
|
|
176
|
+
}
|
|
177
|
+
.cpub-share-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
178
|
+
.cpub-share-card-thumb-fallback {
|
|
179
|
+
display: flex; align-items: center; justify-content: center;
|
|
180
|
+
color: var(--text-faint); font-size: 24px;
|
|
181
|
+
}
|
|
182
|
+
.cpub-share-card-body { flex: 1; min-width: 0; padding: 10px 14px; }
|
|
183
|
+
.cpub-share-card-type {
|
|
184
|
+
font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;
|
|
185
|
+
letter-spacing: 0.06em; color: var(--accent); font-weight: 600;
|
|
186
|
+
}
|
|
187
|
+
.cpub-share-card-title {
|
|
188
|
+
font-size: 14px; font-weight: 600; color: var(--text); margin-top: 2px;
|
|
189
|
+
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
|
|
190
|
+
}
|
|
191
|
+
.cpub-share-card-desc {
|
|
192
|
+
font-size: 12px; color: var(--text-dim); margin-top: 4px;
|
|
193
|
+
display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@media (max-width: 640px) {
|
|
197
|
+
.cpub-share-card-thumb { width: 80px; }
|
|
198
|
+
}
|
|
199
|
+
</style>
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HubViewModel } from '../../types/hub';
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
hub: HubViewModel
|
|
6
|
+
galleryTotal?: number
|
|
7
|
+
}>();
|
|
8
|
+
|
|
9
|
+
const hubType = computed(() => props.hub.hubType ?? 'community');
|
|
10
|
+
const isProductHub = computed(() => hubType.value === 'product');
|
|
11
|
+
const isCompanyHub = computed(() => hubType.value === 'company');
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="cpub-hub-hero">
|
|
16
|
+
<!-- Banner overlay slot (e.g., origin banner for federated hubs) -->
|
|
17
|
+
<slot name="banner-overlay" />
|
|
18
|
+
|
|
19
|
+
<div class="cpub-hub-banner" :style="hub.bannerUrl ? { backgroundImage: `url(${hub.bannerUrl})`, backgroundSize: 'cover', backgroundPosition: 'center' } : {}">
|
|
20
|
+
<template v-if="!hub.bannerUrl">
|
|
21
|
+
<div class="cpub-hub-banner-pattern"></div>
|
|
22
|
+
<div class="cpub-hub-banner-dots"></div>
|
|
23
|
+
</template>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="cpub-hub-meta-bar">
|
|
26
|
+
<div class="cpub-hub-meta-inner">
|
|
27
|
+
<div class="cpub-hub-icon">
|
|
28
|
+
<img v-if="hub.iconUrl" :src="hub.iconUrl" :alt="hub.name ?? ''" />
|
|
29
|
+
<i v-else :class="isCompanyHub ? 'fa-solid fa-building' : isProductHub ? 'fa-solid fa-microchip' : 'fa-solid fa-users'" />
|
|
30
|
+
</div>
|
|
31
|
+
<div class="cpub-hub-info">
|
|
32
|
+
<div class="cpub-hub-top-row">
|
|
33
|
+
<div>
|
|
34
|
+
<h1 class="cpub-hub-name">{{ hub.name }}</h1>
|
|
35
|
+
<p v-if="hub.description" class="cpub-hub-desc">{{ hub.description }}</p>
|
|
36
|
+
<div class="cpub-hub-stats">
|
|
37
|
+
<span class="cpub-hub-stat"><i class="fa-solid fa-users"></i> <span class="cpub-hub-stat-val">{{ hub.memberCount ?? 0 }}</span> Members</span>
|
|
38
|
+
<span class="cpub-hub-stat"><i class="fa-solid fa-message"></i> <span class="cpub-hub-stat-val">{{ hub.postCount ?? 0 }}</span> Posts</span>
|
|
39
|
+
<span v-if="galleryTotal" class="cpub-hub-stat"><i class="fa-solid fa-folder-open"></i> <span class="cpub-hub-stat-val">{{ galleryTotal }}</span> Projects</span>
|
|
40
|
+
<span v-if="hub.foundedLabel" class="cpub-hub-stat"><i class="fa-solid fa-calendar"></i> Founded <span class="cpub-hub-stat-val">{{ hub.foundedLabel }}</span></span>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="cpub-hub-actions">
|
|
43
|
+
<slot name="actions" />
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="cpub-hub-badges">
|
|
47
|
+
<slot name="badges" />
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<div v-if="hub.categories?.length" class="cpub-hub-tags">
|
|
51
|
+
<div class="cpub-tag-row">
|
|
52
|
+
<span v-for="cat in hub.categories" :key="cat" class="cpub-tag">{{ cat }}</span>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<style scoped>
|
|
62
|
+
.cpub-hub-hero { position: relative; overflow: hidden; }
|
|
63
|
+
|
|
64
|
+
.cpub-hub-banner {
|
|
65
|
+
height: 180px;
|
|
66
|
+
background: linear-gradient(135deg, var(--accent) 0%, #006b6b 50%, var(--accent-border) 100%);
|
|
67
|
+
position: relative;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
border-bottom: 1px solid var(--border);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.cpub-hub-banner-pattern {
|
|
73
|
+
position: absolute;
|
|
74
|
+
inset: 0;
|
|
75
|
+
background-image:
|
|
76
|
+
linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
|
|
77
|
+
linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
|
|
78
|
+
background-size: 40px 40px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.cpub-hub-banner-dots {
|
|
82
|
+
position: absolute;
|
|
83
|
+
inset: 0;
|
|
84
|
+
background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
|
|
85
|
+
background-size: 24px 24px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.cpub-hub-meta-bar {
|
|
89
|
+
background: var(--surface);
|
|
90
|
+
border-bottom: 1px solid var(--border);
|
|
91
|
+
padding: 20px 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.cpub-hub-meta-inner {
|
|
95
|
+
max-width: 1200px;
|
|
96
|
+
margin: 0 auto;
|
|
97
|
+
padding: 0 32px;
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: flex-start;
|
|
100
|
+
gap: 16px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.cpub-hub-icon {
|
|
104
|
+
width: 72px;
|
|
105
|
+
height: 72px;
|
|
106
|
+
background: var(--surface);
|
|
107
|
+
border: 3px solid var(--surface);
|
|
108
|
+
border-radius: 16px;
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
font-size: 28px;
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
margin-top: -36px;
|
|
115
|
+
position: relative;
|
|
116
|
+
z-index: 1;
|
|
117
|
+
box-shadow: var(--shadow-md);
|
|
118
|
+
color: var(--accent);
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
}
|
|
121
|
+
.cpub-hub-icon img { width: 100%; height: 100%; object-fit: cover; }
|
|
122
|
+
|
|
123
|
+
.cpub-hub-info { flex: 1; min-width: 0; }
|
|
124
|
+
|
|
125
|
+
.cpub-hub-top-row {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: flex-start;
|
|
128
|
+
justify-content: space-between;
|
|
129
|
+
gap: 16px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.cpub-hub-name {
|
|
133
|
+
font-family: var(--font-display);
|
|
134
|
+
font-size: 1.5rem;
|
|
135
|
+
font-weight: 800;
|
|
136
|
+
letter-spacing: -0.02em;
|
|
137
|
+
margin-bottom: 4px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.cpub-hub-desc {
|
|
141
|
+
font-size: 12px;
|
|
142
|
+
color: var(--text-dim);
|
|
143
|
+
line-height: 1.5;
|
|
144
|
+
max-width: 600px;
|
|
145
|
+
margin-bottom: 10px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.cpub-hub-stats {
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
gap: 20px;
|
|
152
|
+
font-size: 0.8125rem;
|
|
153
|
+
color: var(--text-dim);
|
|
154
|
+
margin-bottom: 12px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.cpub-hub-stat { display: flex; align-items: center; gap: 5px; }
|
|
158
|
+
.cpub-hub-stat-val { color: var(--text); font-weight: 600; }
|
|
159
|
+
|
|
160
|
+
.cpub-hub-actions { display: flex; align-items: center; gap: 8px; }
|
|
161
|
+
|
|
162
|
+
.cpub-hub-badges {
|
|
163
|
+
flex-shrink: 0;
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
gap: 6px;
|
|
167
|
+
margin-top: 4px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.cpub-hub-tags { margin-top: 10px; }
|
|
171
|
+
|
|
172
|
+
@media (max-width: 1024px) {
|
|
173
|
+
.cpub-hub-top-row { flex-direction: column; }
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@media (max-width: 640px) {
|
|
177
|
+
.cpub-hub-banner { height: 120px; }
|
|
178
|
+
.cpub-hub-meta-inner { flex-direction: column; padding: 0 16px; }
|
|
179
|
+
.cpub-hub-icon { margin-top: -24px; width: 56px; height: 56px; font-size: 22px; }
|
|
180
|
+
.cpub-hub-name { font-size: 1.25rem; }
|
|
181
|
+
.cpub-hub-stats { flex-wrap: wrap; gap: 10px 16px; font-size: 0.75rem; }
|
|
182
|
+
.cpub-hub-actions { flex-wrap: wrap; }
|
|
183
|
+
.cpub-hub-badges { flex-wrap: wrap; }
|
|
184
|
+
}
|
|
185
|
+
</style>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HubTabDef } from '../../types/hub';
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
tabs: HubTabDef[]
|
|
6
|
+
}>();
|
|
7
|
+
|
|
8
|
+
const activeTab = defineModel<string>('activeTab', { required: true });
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="cpub-hub-page">
|
|
13
|
+
<slot name="hero" />
|
|
14
|
+
|
|
15
|
+
<!-- Tabs -->
|
|
16
|
+
<div class="cpub-hub-tabs">
|
|
17
|
+
<div class="cpub-tabs-inner">
|
|
18
|
+
<button
|
|
19
|
+
v-for="tab in tabs"
|
|
20
|
+
:key="tab.value"
|
|
21
|
+
class="cpub-tab-btn"
|
|
22
|
+
:class="{ active: activeTab === tab.value }"
|
|
23
|
+
@click="activeTab = tab.value"
|
|
24
|
+
>
|
|
25
|
+
<i :class="tab.icon" style="font-size: 10px"></i>
|
|
26
|
+
{{ tab.label }}
|
|
27
|
+
</button>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<!-- Main Content -->
|
|
32
|
+
<div class="cpub-hub-main">
|
|
33
|
+
<div class="cpub-hub-layout">
|
|
34
|
+
<main>
|
|
35
|
+
<slot />
|
|
36
|
+
</main>
|
|
37
|
+
<aside>
|
|
38
|
+
<slot name="sidebar" />
|
|
39
|
+
</aside>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<style scoped>
|
|
46
|
+
.cpub-hub-tabs {
|
|
47
|
+
background: var(--surface);
|
|
48
|
+
border-bottom: 1px solid var(--border);
|
|
49
|
+
position: sticky;
|
|
50
|
+
top: 48px;
|
|
51
|
+
z-index: 90;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.cpub-tabs-inner {
|
|
55
|
+
max-width: 1200px;
|
|
56
|
+
margin: 0 auto;
|
|
57
|
+
padding: 0 32px;
|
|
58
|
+
display: flex;
|
|
59
|
+
gap: 4px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.cpub-tab-btn {
|
|
63
|
+
font-size: 0.8125rem;
|
|
64
|
+
color: var(--text-dim);
|
|
65
|
+
padding: 12px 16px;
|
|
66
|
+
border: none;
|
|
67
|
+
background: none;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
border-bottom: var(--border-width-default) solid transparent;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 6px;
|
|
73
|
+
position: relative;
|
|
74
|
+
top: 1px;
|
|
75
|
+
transition: color 0.15s;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.cpub-tab-btn:hover { color: var(--text); }
|
|
79
|
+
.cpub-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent-border); font-weight: 600; }
|
|
80
|
+
|
|
81
|
+
.cpub-hub-main {
|
|
82
|
+
max-width: 1200px;
|
|
83
|
+
margin: 0 auto;
|
|
84
|
+
padding: 24px 32px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.cpub-hub-layout {
|
|
88
|
+
display: grid;
|
|
89
|
+
grid-template-columns: 1fr 300px;
|
|
90
|
+
gap: 24px;
|
|
91
|
+
align-items: start;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@media (max-width: 1024px) {
|
|
95
|
+
.cpub-hub-layout { grid-template-columns: 1fr; }
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (max-width: 640px) {
|
|
99
|
+
.cpub-hub-main { padding: 16px; }
|
|
100
|
+
.cpub-tabs-inner { padding: 0 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
|
|
101
|
+
.cpub-tab-btn { white-space: nowrap; flex-shrink: 0; }
|
|
102
|
+
}
|
|
103
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HubMemberViewModel } from '../../types/hub';
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
members: HubMemberViewModel[]
|
|
6
|
+
}>();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div v-if="members?.length" class="cpub-members-grid">
|
|
11
|
+
<MemberCard
|
|
12
|
+
v-for="member in members"
|
|
13
|
+
:key="member.username"
|
|
14
|
+
:username="member.username"
|
|
15
|
+
:display-name="member.name"
|
|
16
|
+
:role="(member.role as 'owner' | 'moderator' | 'member') || 'member'"
|
|
17
|
+
:joined-at="new Date(member.joinedAt)"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
<div v-else class="cpub-empty-state">
|
|
21
|
+
<div class="cpub-empty-state-icon"><i class="fa-solid fa-users"></i></div>
|
|
22
|
+
<p class="cpub-empty-state-title">No members yet</p>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<style scoped>
|
|
27
|
+
.cpub-members-grid {
|
|
28
|
+
display: grid;
|
|
29
|
+
grid-template-columns: repeat(4, 1fr);
|
|
30
|
+
gap: 12px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (max-width: 1024px) {
|
|
34
|
+
.cpub-members-grid { grid-template-columns: repeat(2, 1fr); }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media (max-width: 400px) {
|
|
38
|
+
.cpub-members-grid { grid-template-columns: 1fr; }
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
products: { items: Array<{ id: string; name: string; description: string | null; imageUrl: string | null; category: string | null; status: string }>; total: number } | null;
|
|
4
|
+
}>();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div v-if="products?.items?.length" class="cpub-products-grid">
|
|
9
|
+
<div v-for="product in products.items" :key="product.id" class="cpub-product-card">
|
|
10
|
+
<div class="cpub-product-card-icon">
|
|
11
|
+
<img v-if="product.imageUrl" :src="product.imageUrl" :alt="product.name" />
|
|
12
|
+
<i v-else class="fa-solid fa-microchip"></i>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="cpub-product-card-body">
|
|
15
|
+
<h4 class="cpub-product-card-name">{{ product.name }}</h4>
|
|
16
|
+
<p class="cpub-product-card-desc">{{ product.description }}</p>
|
|
17
|
+
<div class="cpub-product-card-meta">
|
|
18
|
+
<span v-if="product.category" class="cpub-tag">{{ product.category }}</span>
|
|
19
|
+
<span v-if="product.status === 'discontinued'" class="cpub-tag cpub-tag-red">Discontinued</span>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div v-else class="cpub-empty-state">
|
|
25
|
+
<div class="cpub-empty-state-icon"><i class="fa-solid fa-microchip"></i></div>
|
|
26
|
+
<p class="cpub-empty-state-title">No products listed yet</p>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<style scoped>
|
|
31
|
+
.cpub-products-grid {
|
|
32
|
+
display: grid;
|
|
33
|
+
grid-template-columns: repeat(2, 1fr);
|
|
34
|
+
gap: 16px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.cpub-product-card {
|
|
38
|
+
background: var(--surface);
|
|
39
|
+
border: 1px solid var(--border);
|
|
40
|
+
border-radius: 12px;
|
|
41
|
+
padding: 16px;
|
|
42
|
+
display: flex;
|
|
43
|
+
gap: 14px;
|
|
44
|
+
align-items: flex-start;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
transition: box-shadow 0.15s, transform 0.15s;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.cpub-product-card:hover {
|
|
50
|
+
transform: translateY(-1px);
|
|
51
|
+
box-shadow: var(--shadow-md);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.cpub-product-card-icon {
|
|
55
|
+
width: 48px;
|
|
56
|
+
height: 48px;
|
|
57
|
+
background: var(--surface2);
|
|
58
|
+
border: 1px solid var(--border);
|
|
59
|
+
border-radius: 10px;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
font-size: 20px;
|
|
64
|
+
color: var(--text-faint);
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
}
|
|
67
|
+
.cpub-product-card-icon img { width: 100%; height: 100%; object-fit: cover; }
|
|
68
|
+
|
|
69
|
+
.cpub-product-card-body { flex: 1; min-width: 0; }
|
|
70
|
+
|
|
71
|
+
.cpub-product-card-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
|
|
72
|
+
|
|
73
|
+
.cpub-product-card-desc {
|
|
74
|
+
font-size: 11px;
|
|
75
|
+
color: var(--text-dim);
|
|
76
|
+
line-height: 1.5;
|
|
77
|
+
margin-bottom: 8px;
|
|
78
|
+
display: -webkit-box;
|
|
79
|
+
-webkit-line-clamp: 2;
|
|
80
|
+
-webkit-box-orient: vertical;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.cpub-product-card-meta { display: flex; gap: 6px; flex-wrap: wrap; }
|
|
85
|
+
|
|
86
|
+
@media (max-width: 1024px) {
|
|
87
|
+
.cpub-products-grid { grid-template-columns: 1fr; }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@media (max-width: 640px) {
|
|
91
|
+
.cpub-products-grid { grid-template-columns: 1fr; }
|
|
92
|
+
}
|
|
93
|
+
</style>
|