@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,269 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { user, isAuthenticated, isAdmin, signOut, refreshSession } = useAuth();
|
|
3
|
+
const { count: unreadCount, connect: connectNotifications, disconnect: disconnectNotifications } = useNotifications();
|
|
4
|
+
const { hubs, learning, video, docs, contests, admin, federation } = useFeatures();
|
|
5
|
+
const { enabledTypeMeta } = useContentTypes();
|
|
6
|
+
const runtimeConfig = useRuntimeConfig();
|
|
7
|
+
const siteName = computed(() => (runtimeConfig.public.siteName as string) || 'CommonPub');
|
|
8
|
+
|
|
9
|
+
useHead({
|
|
10
|
+
link: [
|
|
11
|
+
{ rel: 'alternate', type: 'application/rss+xml', title: `${siteName.value} RSS`, href: '/feed.xml' },
|
|
12
|
+
],
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const userMenuOpen = ref(false);
|
|
16
|
+
const mobileMenuOpen = ref(false);
|
|
17
|
+
|
|
18
|
+
// Cmd+K / Ctrl+K → search
|
|
19
|
+
function handleGlobalKeydown(e: KeyboardEvent): void {
|
|
20
|
+
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
navigateTo('/search');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Close menus on click outside
|
|
27
|
+
function handleClickOutside(e: MouseEvent): void {
|
|
28
|
+
const target = e.target as HTMLElement;
|
|
29
|
+
if (!target.closest('.cpub-user-menu-wrapper')) userMenuOpen.value = false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
onMounted(async () => {
|
|
33
|
+
// Refresh session to detect expiry (SSR hydration may have stale auth state)
|
|
34
|
+
await refreshSession();
|
|
35
|
+
if (isAuthenticated.value) {
|
|
36
|
+
connectNotifications();
|
|
37
|
+
}
|
|
38
|
+
document.addEventListener('keydown', handleGlobalKeydown);
|
|
39
|
+
document.addEventListener('click', handleClickOutside);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
onUnmounted(() => {
|
|
43
|
+
disconnectNotifications();
|
|
44
|
+
document.removeEventListener('keydown', handleGlobalKeydown);
|
|
45
|
+
document.removeEventListener('click', handleClickOutside);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
function handleSignOut(): void {
|
|
49
|
+
userMenuOpen.value = false;
|
|
50
|
+
signOut();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const userInitial = computed(() => {
|
|
54
|
+
return (user.value?.name || user.value?.username || 'U').charAt(0).toUpperCase();
|
|
55
|
+
});
|
|
56
|
+
const userImage = computed(() => user.value?.image || null);
|
|
57
|
+
|
|
58
|
+
const userUsername = computed(() => user.value?.username ?? '');
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<div class="cpub-layout">
|
|
63
|
+
<!-- ═══ TOP NAV ═══ -->
|
|
64
|
+
<header class="cpub-topbar">
|
|
65
|
+
<NuxtLink to="/" class="cpub-topbar-logo">
|
|
66
|
+
<SiteLogo />
|
|
67
|
+
</NuxtLink>
|
|
68
|
+
|
|
69
|
+
<nav class="cpub-topbar-nav" aria-label="Main navigation">
|
|
70
|
+
<NuxtLink to="/" class="cpub-nav-link"><i class="fa-solid fa-house"></i> Home</NuxtLink>
|
|
71
|
+
<NuxtLink v-if="hubs" to="/hubs" class="cpub-nav-link"><i class="fa-solid fa-users"></i> Hubs</NuxtLink>
|
|
72
|
+
<NuxtLink v-if="learning" to="/learn" class="cpub-nav-link"><i class="fa-solid fa-graduation-cap"></i> Learn</NuxtLink>
|
|
73
|
+
<NuxtLink v-if="video" to="/videos" class="cpub-nav-link"><i class="fa-solid fa-video"></i> Videos</NuxtLink>
|
|
74
|
+
<NuxtLink v-if="docs" to="/docs" class="cpub-nav-link"><i class="fa-solid fa-book"></i> Docs</NuxtLink>
|
|
75
|
+
<NuxtLink v-if="contests" to="/contests" class="cpub-nav-link"><i class="fa-solid fa-trophy"></i> Contests</NuxtLink>
|
|
76
|
+
<NuxtLink v-if="federation" to="/federation" class="cpub-nav-link"><i class="fa-solid fa-globe"></i> Fediverse</NuxtLink>
|
|
77
|
+
<NuxtLink v-if="isAdmin && admin" to="/admin" class="cpub-nav-link"><i class="fa-solid fa-shield-halved"></i> Admin</NuxtLink>
|
|
78
|
+
</nav>
|
|
79
|
+
|
|
80
|
+
<div class="cpub-topbar-spacer" />
|
|
81
|
+
|
|
82
|
+
<div class="cpub-topbar-actions">
|
|
83
|
+
<NuxtLink to="/search" class="cpub-search-btn" aria-label="Search">
|
|
84
|
+
<i class="fa-solid fa-magnifying-glass"></i>
|
|
85
|
+
<span class="cpub-search-text">Search...</span>
|
|
86
|
+
<span class="cpub-kbd">⌈K</span>
|
|
87
|
+
</NuxtLink>
|
|
88
|
+
|
|
89
|
+
<template v-if="isAuthenticated">
|
|
90
|
+
<NuxtLink to="/messages" class="cpub-icon-btn" title="Messages" aria-label="Messages">
|
|
91
|
+
<i class="fa-solid fa-envelope"></i>
|
|
92
|
+
</NuxtLink>
|
|
93
|
+
<NuxtLink to="/notifications" class="cpub-icon-btn" title="Notifications" aria-label="Notifications">
|
|
94
|
+
<i class="fa-solid fa-bell"></i>
|
|
95
|
+
<span v-if="unreadCount > 0" class="cpub-notif-dot" />
|
|
96
|
+
</NuxtLink>
|
|
97
|
+
<NuxtLink to="/create" class="cpub-btn-new" aria-label="Create new content">
|
|
98
|
+
<i class="fa-solid fa-plus"></i> <span class="cpub-new-text">New</span>
|
|
99
|
+
</NuxtLink>
|
|
100
|
+
<div class="cpub-user-menu-wrapper">
|
|
101
|
+
<button class="cpub-avatar-btn" aria-label="User menu" :aria-expanded="userMenuOpen" @click.stop="userMenuOpen = !userMenuOpen">
|
|
102
|
+
<span class="cpub-user-avatar">
|
|
103
|
+
<img v-if="userImage" :src="userImage" :alt="user?.name || user?.username" class="cpub-user-avatar-img" />
|
|
104
|
+
<span v-else>{{ userInitial }}</span>
|
|
105
|
+
</span>
|
|
106
|
+
</button>
|
|
107
|
+
<div v-if="userMenuOpen" class="cpub-user-dropdown" role="menu">
|
|
108
|
+
<NuxtLink :to="`/u/${userUsername}`" class="cpub-dropdown-item" role="menuitem" @click="userMenuOpen = false"><i class="fa-solid fa-user"></i> Profile</NuxtLink>
|
|
109
|
+
<NuxtLink to="/dashboard" class="cpub-dropdown-item" role="menuitem" @click="userMenuOpen = false"><i class="fa-solid fa-gauge"></i> Dashboard</NuxtLink>
|
|
110
|
+
<NuxtLink to="/settings" class="cpub-dropdown-item" role="menuitem" @click="userMenuOpen = false"><i class="fa-solid fa-gear"></i> Settings</NuxtLink>
|
|
111
|
+
<div class="cpub-dropdown-divider" />
|
|
112
|
+
<button class="cpub-dropdown-item" role="menuitem" @click="handleSignOut"><i class="fa-solid fa-right-from-bracket"></i> Sign out</button>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</template>
|
|
116
|
+
<NuxtLink v-else to="/auth/login" class="cpub-btn-new">Log in</NuxtLink>
|
|
117
|
+
|
|
118
|
+
<button class="cpub-mobile-toggle" aria-label="Toggle menu" @click="mobileMenuOpen = !mobileMenuOpen">
|
|
119
|
+
<i :class="mobileMenuOpen ? 'fa-solid fa-xmark' : 'fa-solid fa-bars'"></i>
|
|
120
|
+
</button>
|
|
121
|
+
</div>
|
|
122
|
+
</header>
|
|
123
|
+
|
|
124
|
+
<!-- Mobile menu -->
|
|
125
|
+
<div v-if="mobileMenuOpen" class="cpub-mobile-menu" @click.self="mobileMenuOpen = false">
|
|
126
|
+
<nav class="cpub-mobile-nav" aria-label="Mobile navigation">
|
|
127
|
+
<NuxtLink to="/" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-house"></i> Home</NuxtLink>
|
|
128
|
+
<NuxtLink v-if="hubs" to="/hubs" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-users"></i> Hubs</NuxtLink>
|
|
129
|
+
<NuxtLink v-if="learning" to="/learn" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-graduation-cap"></i> Learn</NuxtLink>
|
|
130
|
+
<NuxtLink v-if="video" to="/videos" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-video"></i> Videos</NuxtLink>
|
|
131
|
+
<NuxtLink v-if="docs" to="/docs" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-book"></i> Docs</NuxtLink>
|
|
132
|
+
<NuxtLink v-if="contests" to="/contests" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-trophy"></i> Contests</NuxtLink>
|
|
133
|
+
<NuxtLink v-if="federation" to="/federation" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-globe"></i> Fediverse</NuxtLink>
|
|
134
|
+
<NuxtLink v-if="isAdmin && admin" to="/admin" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-shield-halved"></i> Admin</NuxtLink>
|
|
135
|
+
<NuxtLink to="/search" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-magnifying-glass"></i> Search</NuxtLink>
|
|
136
|
+
<template v-if="isAuthenticated">
|
|
137
|
+
<div class="cpub-mobile-divider" />
|
|
138
|
+
<NuxtLink to="/create" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-plus"></i> Create</NuxtLink>
|
|
139
|
+
<NuxtLink to="/dashboard" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-gauge"></i> Dashboard</NuxtLink>
|
|
140
|
+
<NuxtLink to="/messages" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-envelope"></i> Messages</NuxtLink>
|
|
141
|
+
<NuxtLink to="/notifications" class="cpub-mobile-link" @click="mobileMenuOpen = false"><i class="fa-solid fa-bell"></i> Notifications</NuxtLink>
|
|
142
|
+
</template>
|
|
143
|
+
</nav>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<!-- ═══ MAIN ═══ -->
|
|
147
|
+
<main id="main-content">
|
|
148
|
+
<slot />
|
|
149
|
+
</main>
|
|
150
|
+
|
|
151
|
+
<!-- Toast notifications -->
|
|
152
|
+
<AppToast />
|
|
153
|
+
|
|
154
|
+
<!-- ═══ FOOTER ═══ -->
|
|
155
|
+
<footer class="cpub-footer">
|
|
156
|
+
<div class="cpub-footer-inner">
|
|
157
|
+
<div class="cpub-footer-brand">
|
|
158
|
+
<span class="cpub-footer-logo"><SiteLogo /></span>
|
|
159
|
+
<p class="cpub-footer-tagline">Powered by {{ siteName }}.</p>
|
|
160
|
+
<div class="cpub-footer-social">
|
|
161
|
+
<a href="https://github.com/commonpub" target="_blank" rel="noopener" class="cpub-footer-social-link" aria-label="GitHub"><i class="fa-brands fa-github"></i></a>
|
|
162
|
+
<a href="https://discord.gg/uncPaJ5SwV" target="_blank" rel="noopener" class="cpub-footer-social-link" aria-label="Discord"><i class="fa-brands fa-discord"></i></a>
|
|
163
|
+
<a href="/feed.xml" class="cpub-footer-social-link" aria-label="RSS"><i class="fa-solid fa-rss"></i></a>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
<nav class="cpub-footer-col" aria-label="Content links">
|
|
167
|
+
<h4 class="cpub-footer-col-title">Content</h4>
|
|
168
|
+
<NuxtLink v-for="ct in enabledTypeMeta" :key="ct.type" :to="ct.route" class="cpub-footer-link">{{ ct.plural }}</NuxtLink>
|
|
169
|
+
</nav>
|
|
170
|
+
<nav class="cpub-footer-col" aria-label="Community links">
|
|
171
|
+
<h4 class="cpub-footer-col-title">Community</h4>
|
|
172
|
+
<NuxtLink v-if="hubs" to="/hubs" class="cpub-footer-link">Hubs</NuxtLink>
|
|
173
|
+
<NuxtLink v-if="contests" to="/contests" class="cpub-footer-link">Contests</NuxtLink>
|
|
174
|
+
<NuxtLink v-if="learning" to="/learn" class="cpub-footer-link">Learning Paths</NuxtLink>
|
|
175
|
+
<NuxtLink v-if="video" to="/videos" class="cpub-footer-link">Videos</NuxtLink>
|
|
176
|
+
<NuxtLink to="/search" class="cpub-footer-link">Explore</NuxtLink>
|
|
177
|
+
</nav>
|
|
178
|
+
<nav class="cpub-footer-col" aria-label="Platform links">
|
|
179
|
+
<h4 class="cpub-footer-col-title">Platform</h4>
|
|
180
|
+
<NuxtLink to="/about" class="cpub-footer-link">About</NuxtLink>
|
|
181
|
+
<NuxtLink v-if="docs" to="/docs" class="cpub-footer-link">Docs</NuxtLink>
|
|
182
|
+
<a href="/feed.xml" class="cpub-footer-link">RSS Feed</a>
|
|
183
|
+
<a href="/sitemap.xml" class="cpub-footer-link">Sitemap</a>
|
|
184
|
+
</nav>
|
|
185
|
+
</div>
|
|
186
|
+
<div class="cpub-footer-bottom">
|
|
187
|
+
<span>© {{ new Date().getFullYear() }} {{ siteName }}. Open source under MIT.</span>
|
|
188
|
+
</div>
|
|
189
|
+
</footer>
|
|
190
|
+
</div>
|
|
191
|
+
</template>
|
|
192
|
+
|
|
193
|
+
<style scoped>
|
|
194
|
+
.cpub-layout { min-height: 100vh; display: flex; flex-direction: column; }
|
|
195
|
+
|
|
196
|
+
/* ═══ TOPBAR ═══ */
|
|
197
|
+
.cpub-topbar {
|
|
198
|
+
position: fixed; top: 0; left: 0; right: 0; height: 48px;
|
|
199
|
+
background: var(--surface); border-bottom: var(--border-width-default) solid var(--border);
|
|
200
|
+
display: flex; align-items: center; padding: 0 20px; gap: 0; z-index: 100;
|
|
201
|
+
}
|
|
202
|
+
.cpub-topbar-logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; color: var(--text); }
|
|
203
|
+
|
|
204
|
+
.cpub-topbar-nav { display: flex; align-items: center; gap: 2px; margin-left: 24px; }
|
|
205
|
+
.cpub-nav-link { font-size: 12px; color: var(--text-dim); padding: 5px 12px; border: var(--border-width-default) solid transparent; background: none; text-decoration: none; transition: color 0.15s, background 0.15s; display: flex; align-items: center; gap: 6px; }
|
|
206
|
+
.cpub-nav-link i { font-size: 10px; }
|
|
207
|
+
.cpub-nav-link:hover { color: var(--text); background: var(--surface2); }
|
|
208
|
+
.cpub-nav-link.router-link-active { color: var(--text); background: var(--surface2); border-color: var(--border); }
|
|
209
|
+
|
|
210
|
+
.cpub-topbar-spacer { flex: 1; }
|
|
211
|
+
.cpub-topbar-actions { display: flex; align-items: center; gap: 6px; }
|
|
212
|
+
|
|
213
|
+
.cpub-search-btn { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface2); border: var(--border-width-default) solid var(--border2); color: var(--text-dim); font-size: 12px; min-width: 180px; text-decoration: none; transition: border-color 0.15s; }
|
|
214
|
+
.cpub-search-btn:hover { border-color: var(--accent-border); color: var(--text); }
|
|
215
|
+
.cpub-search-btn i { font-size: 11px; }
|
|
216
|
+
.cpub-kbd { margin-left: auto; font-size: 10px; font-family: var(--font-mono); padding: 2px 6px; background: var(--surface3); border: var(--border-width-default) solid var(--border2); color: var(--text-faint); }
|
|
217
|
+
|
|
218
|
+
.cpub-icon-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: transparent; border: var(--border-width-default) solid transparent; color: var(--text-dim); font-size: 13px; position: relative; transition: all 0.15s; text-decoration: none; }
|
|
219
|
+
.cpub-icon-btn:hover { background: var(--surface2); border-color: var(--border); color: var(--text); }
|
|
220
|
+
.cpub-notif-dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); border: 1.5px solid var(--surface); }
|
|
221
|
+
|
|
222
|
+
.cpub-btn-new { display: flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--accent); border: var(--border-width-default) solid var(--border); color: var(--color-text-inverse); font-size: 12px; font-weight: 600; transition: all 0.15s; box-shadow: var(--shadow-sm); text-decoration: none; cursor: pointer; }
|
|
223
|
+
.cpub-btn-new:hover { box-shadow: var(--shadow-md); transform: translate(-1px, -1px); }
|
|
224
|
+
|
|
225
|
+
.cpub-avatar-btn { background: none; border: none; padding: 0; cursor: pointer; }
|
|
226
|
+
.cpub-user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--purple-bg); border: var(--border-width-default) solid var(--purple); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--purple); font-family: var(--font-mono); overflow: hidden; }
|
|
227
|
+
.cpub-user-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
|
|
228
|
+
.cpub-user-menu-wrapper { position: relative; }
|
|
229
|
+
.cpub-user-dropdown { position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px; background: var(--surface); border: var(--border-width-default) solid var(--border); box-shadow: var(--shadow-md); z-index: 200; display: flex; flex-direction: column; padding: 4px 0; }
|
|
230
|
+
.cpub-dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 12px; color: var(--text-dim); text-decoration: none; background: none; border: none; cursor: pointer; font-family: inherit; width: 100%; text-align: left; transition: all 0.15s; }
|
|
231
|
+
.cpub-dropdown-item:hover { background: var(--surface2); color: var(--text); }
|
|
232
|
+
.cpub-dropdown-item i { width: 14px; text-align: center; font-size: 11px; }
|
|
233
|
+
.cpub-dropdown-divider { height: 2px; background: var(--border2); margin: 4px 12px; }
|
|
234
|
+
|
|
235
|
+
.cpub-mobile-toggle { display: none; width: 32px; height: 32px; background: none; border: var(--border-width-default) solid transparent; color: var(--text-dim); font-size: 16px; cursor: pointer; align-items: center; justify-content: center; }
|
|
236
|
+
.cpub-mobile-menu { display: none; position: fixed; inset: 0; top: 48px; z-index: 99; background: var(--color-surface-overlay-light); }
|
|
237
|
+
.cpub-mobile-nav { background: var(--surface); border-bottom: var(--border-width-default) solid var(--border); padding: 8px 0; display: flex; flex-direction: column; box-shadow: var(--shadow-md); }
|
|
238
|
+
.cpub-mobile-link { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 13px; color: var(--text-dim); text-decoration: none; transition: background 0.1s; }
|
|
239
|
+
.cpub-mobile-link:hover { background: var(--surface2); color: var(--text); }
|
|
240
|
+
.cpub-mobile-link i { width: 16px; text-align: center; font-size: 12px; }
|
|
241
|
+
.cpub-mobile-divider { height: 2px; background: var(--border2); margin: 4px 16px; }
|
|
242
|
+
|
|
243
|
+
#main-content { margin-top: 48px; flex: 1; }
|
|
244
|
+
|
|
245
|
+
/* ═══ FOOTER ═══ */
|
|
246
|
+
.cpub-footer { background: var(--surface); border-top: var(--border-width-default) solid var(--border); margin-top: auto; }
|
|
247
|
+
.cpub-footer-inner { max-width: 1200px; margin: 0 auto; padding: 40px 32px 32px; display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
|
|
248
|
+
.cpub-footer-brand { display: flex; flex-direction: column; gap: 8px; }
|
|
249
|
+
.cpub-footer-logo { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--text); }
|
|
250
|
+
.cpub-footer-tagline { font-size: 12px; color: var(--text-dim); }
|
|
251
|
+
.cpub-footer-social { display: flex; gap: 8px; margin-top: 8px; }
|
|
252
|
+
.cpub-footer-social-link { width: 28px; height: 28px; background: var(--surface2); border: var(--border-width-default) solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 12px; text-decoration: none; transition: all 0.12s; }
|
|
253
|
+
.cpub-footer-social-link:hover { background: var(--accent); color: var(--color-text-inverse); border-color: var(--accent); }
|
|
254
|
+
.cpub-footer-col { display: flex; flex-direction: column; gap: 6px; }
|
|
255
|
+
.cpub-footer-col-title { font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); margin-bottom: 4px; }
|
|
256
|
+
.cpub-footer-link { font-size: 12px; color: var(--text-dim); text-decoration: none; transition: color 0.12s; }
|
|
257
|
+
.cpub-footer-link:hover { color: var(--text); }
|
|
258
|
+
.cpub-footer-bottom { max-width: 1200px; margin: 0 auto; padding: 16px 32px; border-top: var(--border-width-default) solid var(--border); font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); }
|
|
259
|
+
|
|
260
|
+
@media (max-width: 768px) {
|
|
261
|
+
.cpub-topbar-nav { display: none; }
|
|
262
|
+
.cpub-search-btn { min-width: auto; padding: 6px 8px; }
|
|
263
|
+
.cpub-search-text, .cpub-kbd, .cpub-new-text { display: none; }
|
|
264
|
+
.cpub-mobile-toggle { display: flex; }
|
|
265
|
+
.cpub-mobile-menu { display: block; }
|
|
266
|
+
.cpub-footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
|
|
267
|
+
}
|
|
268
|
+
@media (max-width: 480px) { .cpub-footer-inner { grid-template-columns: 1fr; } }
|
|
269
|
+
</style>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const route = useRoute();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="cpub-editor-layout">
|
|
7
|
+
<header class="cpub-editor-topbar">
|
|
8
|
+
<NuxtLink to="/" class="cpub-editor-logo" aria-label="Home">
|
|
9
|
+
<span class="cpub-editor-logo-accent">[</span>cpub<span class="cpub-editor-logo-accent">]</span>
|
|
10
|
+
</NuxtLink>
|
|
11
|
+
|
|
12
|
+
<button class="cpub-editor-back" aria-label="Go back" @click="$router.back()">
|
|
13
|
+
←
|
|
14
|
+
</button>
|
|
15
|
+
|
|
16
|
+
<div class="cpub-editor-topbar-divider" aria-hidden="true" />
|
|
17
|
+
|
|
18
|
+
<div class="cpub-editor-topbar-title-wrap">
|
|
19
|
+
<slot name="title" />
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="cpub-editor-topbar-spacer" />
|
|
23
|
+
|
|
24
|
+
<slot name="mode-tabs" />
|
|
25
|
+
|
|
26
|
+
<div class="cpub-editor-topbar-actions">
|
|
27
|
+
<slot name="actions" />
|
|
28
|
+
</div>
|
|
29
|
+
</header>
|
|
30
|
+
|
|
31
|
+
<div class="cpub-editor-shell">
|
|
32
|
+
<slot />
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<style scoped>
|
|
38
|
+
.cpub-editor-layout {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
height: 100vh;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.cpub-editor-topbar {
|
|
46
|
+
height: 48px;
|
|
47
|
+
background: var(--surface);
|
|
48
|
+
border-bottom: var(--border-width-default) solid var(--border);
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
padding: 0 var(--space-4);
|
|
52
|
+
gap: 0;
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
z-index: var(--z-sticky);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.cpub-editor-logo {
|
|
58
|
+
font-family: var(--font-mono);
|
|
59
|
+
font-size: var(--text-xs);
|
|
60
|
+
font-weight: var(--font-weight-bold);
|
|
61
|
+
color: var(--text-dim);
|
|
62
|
+
letter-spacing: 0.06em;
|
|
63
|
+
text-decoration: none;
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.cpub-editor-logo-accent {
|
|
68
|
+
color: var(--accent);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.cpub-editor-back {
|
|
72
|
+
width: 30px;
|
|
73
|
+
height: 30px;
|
|
74
|
+
background: none;
|
|
75
|
+
border: var(--border-width-default) solid transparent;
|
|
76
|
+
color: var(--text-dim);
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
font-size: var(--text-xs);
|
|
82
|
+
margin-left: var(--space-2);
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.cpub-editor-back:hover {
|
|
87
|
+
background: var(--surface2);
|
|
88
|
+
border-color: var(--border2);
|
|
89
|
+
color: var(--text);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.cpub-editor-back:focus-visible {
|
|
93
|
+
outline: 2px solid var(--accent);
|
|
94
|
+
outline-offset: 1px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.cpub-editor-topbar-divider {
|
|
98
|
+
width: 2px;
|
|
99
|
+
height: 22px;
|
|
100
|
+
background: var(--border);
|
|
101
|
+
margin: 0 var(--space-3);
|
|
102
|
+
flex-shrink: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.cpub-editor-topbar-title-wrap {
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
gap: var(--space-2);
|
|
109
|
+
flex: 1;
|
|
110
|
+
min-width: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.cpub-editor-topbar-spacer {
|
|
114
|
+
flex: 1;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.cpub-editor-topbar-actions {
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: var(--space-2);
|
|
121
|
+
flex-shrink: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.cpub-editor-shell {
|
|
125
|
+
display: flex;
|
|
126
|
+
flex: 1;
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
}
|
|
129
|
+
</style>
|
package/nuxt.config.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { resolve, dirname } from 'node:path';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
|
|
7
|
+
// Resolve theme CSS: use bundled ./theme/ (npm published) or monorepo path (dev)
|
|
8
|
+
const themeDir = existsSync(resolve(__dirname, 'theme'))
|
|
9
|
+
? resolve(__dirname, 'theme')
|
|
10
|
+
: resolve(__dirname, '../../packages/ui/theme');
|
|
11
|
+
const uiTheme = (file: string) => resolve(themeDir, file);
|
|
12
|
+
|
|
13
|
+
export default defineNuxtConfig({
|
|
14
|
+
compatibilityDate: '2024-11-01',
|
|
15
|
+
app: {
|
|
16
|
+
head: {
|
|
17
|
+
link: [
|
|
18
|
+
{
|
|
19
|
+
rel: 'stylesheet',
|
|
20
|
+
href: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css',
|
|
21
|
+
crossorigin: 'anonymous',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
css: [
|
|
27
|
+
uiTheme('base.css'),
|
|
28
|
+
uiTheme('dark.css'),
|
|
29
|
+
uiTheme('components.css'),
|
|
30
|
+
uiTheme('prose.css'),
|
|
31
|
+
uiTheme('layouts.css'),
|
|
32
|
+
uiTheme('forms.css'),
|
|
33
|
+
uiTheme('editor-panels.css'),
|
|
34
|
+
],
|
|
35
|
+
runtimeConfig: {
|
|
36
|
+
databaseUrl: '',
|
|
37
|
+
authSecret: 'dev-secret-change-me',
|
|
38
|
+
emailAdapter: 'console',
|
|
39
|
+
smtpHost: '',
|
|
40
|
+
smtpPort: '587',
|
|
41
|
+
smtpUser: '',
|
|
42
|
+
smtpPass: '',
|
|
43
|
+
smtpFrom: '',
|
|
44
|
+
resendApiKey: '',
|
|
45
|
+
resendFrom: '',
|
|
46
|
+
s3Bucket: '',
|
|
47
|
+
s3Region: 'us-east-1',
|
|
48
|
+
s3Endpoint: '',
|
|
49
|
+
s3AccessKey: '',
|
|
50
|
+
s3SecretKey: '',
|
|
51
|
+
s3PublicUrl: '',
|
|
52
|
+
uploadDir: './uploads',
|
|
53
|
+
public: {
|
|
54
|
+
siteUrl: 'http://localhost:3000',
|
|
55
|
+
domain: 'localhost:3000',
|
|
56
|
+
siteName: 'CommonPub',
|
|
57
|
+
siteDescription: 'A CommonPub instance',
|
|
58
|
+
features: {
|
|
59
|
+
content: true,
|
|
60
|
+
social: true,
|
|
61
|
+
hubs: true,
|
|
62
|
+
docs: true,
|
|
63
|
+
video: true,
|
|
64
|
+
contests: false,
|
|
65
|
+
learning: true,
|
|
66
|
+
explainers: true,
|
|
67
|
+
federation: false,
|
|
68
|
+
federateHubs: false,
|
|
69
|
+
admin: false,
|
|
70
|
+
},
|
|
71
|
+
contentTypes: 'project,article,blog,explainer',
|
|
72
|
+
contestCreation: 'admin',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
routeRules: {
|
|
76
|
+
...(process.env.NUXT_PUBLIC_FEATURES_DOCS !== 'false' && {
|
|
77
|
+
'/docs/**': { prerender: true },
|
|
78
|
+
}),
|
|
79
|
+
},
|
|
80
|
+
nitro: {
|
|
81
|
+
preset: 'node-server',
|
|
82
|
+
},
|
|
83
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@commonpub/layer",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./nuxt.config.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"app.vue",
|
|
8
|
+
"error.vue",
|
|
9
|
+
"nuxt.config.ts",
|
|
10
|
+
"components",
|
|
11
|
+
"composables",
|
|
12
|
+
"layouts",
|
|
13
|
+
"middleware",
|
|
14
|
+
"pages",
|
|
15
|
+
"plugins",
|
|
16
|
+
"server",
|
|
17
|
+
"theme",
|
|
18
|
+
"types"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@aws-sdk/client-s3": "^3.1010.0",
|
|
25
|
+
"@tiptap/core": "^2.11.0",
|
|
26
|
+
"@tiptap/extension-bold": "^2.11.0",
|
|
27
|
+
"@tiptap/extension-bullet-list": "^2.11.0",
|
|
28
|
+
"@tiptap/extension-code": "^2.11.0",
|
|
29
|
+
"@tiptap/extension-document": "^2.11.0",
|
|
30
|
+
"@tiptap/extension-history": "^2.11.0",
|
|
31
|
+
"@tiptap/extension-italic": "^2.11.0",
|
|
32
|
+
"@tiptap/extension-link": "^2.11.0",
|
|
33
|
+
"@tiptap/extension-list-item": "^2.11.0",
|
|
34
|
+
"@tiptap/extension-ordered-list": "^2.11.0",
|
|
35
|
+
"@tiptap/extension-paragraph": "^2.11.0",
|
|
36
|
+
"@tiptap/extension-placeholder": "^2.11.0",
|
|
37
|
+
"@tiptap/extension-strike": "^2.11.0",
|
|
38
|
+
"@tiptap/extension-text": "^2.11.0",
|
|
39
|
+
"drizzle-orm": "^0.45.1",
|
|
40
|
+
"highlight.js": "^11.11.1",
|
|
41
|
+
"isomorphic-dompurify": "^3.3.0",
|
|
42
|
+
"pg": "^8.13.0",
|
|
43
|
+
"sharp": "^0.34.5",
|
|
44
|
+
"shiki": "^4.0.2",
|
|
45
|
+
"vue": "^3.4.0",
|
|
46
|
+
"vue-router": "^4.3.0",
|
|
47
|
+
"zod": "^4.3.6",
|
|
48
|
+
"@commonpub/auth": "0.5.0",
|
|
49
|
+
"@commonpub/config": "0.7.0",
|
|
50
|
+
"@commonpub/docs": "0.5.0",
|
|
51
|
+
"@commonpub/editor": "0.5.0",
|
|
52
|
+
"@commonpub/learning": "0.5.0",
|
|
53
|
+
"@commonpub/protocol": "0.9.3",
|
|
54
|
+
"@commonpub/schema": "0.8.6",
|
|
55
|
+
"@commonpub/ui": "0.7.1",
|
|
56
|
+
"@commonpub/server": "2.6.0"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {}
|
|
59
|
+
}
|