@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,73 @@
|
|
|
1
|
+
/** Composable for real-time notification count via SSE */
|
|
2
|
+
export function useNotifications() {
|
|
3
|
+
const count = useState<number>('notification-count', () => 0);
|
|
4
|
+
const connected = useState<boolean>('notification-connected', () => false);
|
|
5
|
+
|
|
6
|
+
let eventSource: EventSource | null = null;
|
|
7
|
+
let retryDelay = 5000;
|
|
8
|
+
let retryTimer: ReturnType<typeof setTimeout> | null = null;
|
|
9
|
+
const MAX_RETRY_DELAY = 60_000;
|
|
10
|
+
|
|
11
|
+
function connect(): void {
|
|
12
|
+
if (import.meta.server || eventSource) return;
|
|
13
|
+
|
|
14
|
+
eventSource = new EventSource('/api/notifications/stream');
|
|
15
|
+
connected.value = true;
|
|
16
|
+
|
|
17
|
+
eventSource.onopen = () => {
|
|
18
|
+
retryDelay = 5000; // Reset backoff on successful connection
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
eventSource.onmessage = (event) => {
|
|
22
|
+
try {
|
|
23
|
+
const data = JSON.parse(event.data) as { type: string; count?: number };
|
|
24
|
+
if (data.type === 'count' && typeof data.count === 'number') {
|
|
25
|
+
count.value = data.count;
|
|
26
|
+
}
|
|
27
|
+
} catch {
|
|
28
|
+
// Ignore malformed messages
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
eventSource.onerror = () => {
|
|
33
|
+
connected.value = false;
|
|
34
|
+
// EventSource readyState 2 = CLOSED (server rejected, e.g. 401)
|
|
35
|
+
const wasClosed = eventSource?.readyState === 2;
|
|
36
|
+
eventSource?.close();
|
|
37
|
+
eventSource = null;
|
|
38
|
+
// If the connection was fully closed (auth error, 401, etc.), don't retry
|
|
39
|
+
if (wasClosed) return;
|
|
40
|
+
// Exponential backoff: 5s → 10s → 20s → 40s → 60s cap
|
|
41
|
+
retryTimer = setTimeout(connect, retryDelay);
|
|
42
|
+
retryDelay = Math.min(retryDelay * 2, MAX_RETRY_DELAY);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function disconnect(): void {
|
|
47
|
+
if (retryTimer) {
|
|
48
|
+
clearTimeout(retryTimer);
|
|
49
|
+
retryTimer = null;
|
|
50
|
+
}
|
|
51
|
+
eventSource?.close();
|
|
52
|
+
eventSource = null;
|
|
53
|
+
connected.value = false;
|
|
54
|
+
retryDelay = 5000;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function decrement(): void {
|
|
58
|
+
if (count.value > 0) count.value--;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function reset(): void {
|
|
62
|
+
count.value = 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
count: readonly(count),
|
|
67
|
+
connected: readonly(connected),
|
|
68
|
+
connect,
|
|
69
|
+
disconnect,
|
|
70
|
+
decrement,
|
|
71
|
+
reset,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Publish validation composable — checks required fields before publishing content.
|
|
3
|
+
* Returns an array of human-readable error strings. Empty array = ready to publish.
|
|
4
|
+
*/
|
|
5
|
+
import type { BlockTuple } from '@commonpub/editor';
|
|
6
|
+
|
|
7
|
+
export interface PublishValidationOptions {
|
|
8
|
+
title: Ref<string>;
|
|
9
|
+
metadata: Ref<Record<string, unknown>>;
|
|
10
|
+
getBlockTuples: () => BlockTuple[];
|
|
11
|
+
/** Override which fields are required. Defaults to title, description, cover, tags, content. */
|
|
12
|
+
requiredFields?: Array<'title' | 'description' | 'coverImageUrl' | 'tags' | 'content'>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface PublishValidationReturn {
|
|
16
|
+
errors: Ref<string[]>;
|
|
17
|
+
showErrors: Ref<boolean>;
|
|
18
|
+
/** Run validation and return errors. Also updates errors ref. */
|
|
19
|
+
validate: () => string[];
|
|
20
|
+
/** Dismiss the error modal */
|
|
21
|
+
dismiss: () => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const DEFAULT_REQUIRED: Array<'title' | 'description' | 'coverImageUrl' | 'tags' | 'content'> = [
|
|
25
|
+
'title', 'description', 'coverImageUrl', 'tags', 'content',
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
export function usePublishValidation(opts: PublishValidationOptions): PublishValidationReturn {
|
|
29
|
+
const errors = ref<string[]>([]);
|
|
30
|
+
const showErrors = ref(false);
|
|
31
|
+
const required = opts.requiredFields ?? DEFAULT_REQUIRED;
|
|
32
|
+
|
|
33
|
+
function validate(): string[] {
|
|
34
|
+
const errs: string[] = [];
|
|
35
|
+
|
|
36
|
+
if (required.includes('title') && !opts.title.value.trim()) {
|
|
37
|
+
errs.push('Title is required');
|
|
38
|
+
}
|
|
39
|
+
if (required.includes('description') && !(opts.metadata.value.description as string)?.trim()) {
|
|
40
|
+
errs.push('Description is required');
|
|
41
|
+
}
|
|
42
|
+
if (required.includes('coverImageUrl') && !(opts.metadata.value.coverImageUrl as string)?.trim()) {
|
|
43
|
+
errs.push('Cover image is required');
|
|
44
|
+
}
|
|
45
|
+
if (required.includes('tags')) {
|
|
46
|
+
const tags = opts.metadata.value.tags as string[];
|
|
47
|
+
if (!tags || tags.length === 0) {
|
|
48
|
+
errs.push('At least one tag is required');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (required.includes('content') && opts.getBlockTuples().length === 0) {
|
|
52
|
+
errs.push('Content is empty — add at least one block');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
errors.value = errs;
|
|
56
|
+
if (errs.length > 0) showErrors.value = true;
|
|
57
|
+
return errs;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function dismiss(): void {
|
|
61
|
+
showErrors.value = false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return { errors, showErrors, validate, dismiss };
|
|
65
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// HTML sanitization for v-html bindings — defense-in-depth against stored XSS.
|
|
2
|
+
// Uses DOMPurify (via isomorphic-dompurify for SSR compatibility).
|
|
3
|
+
import DOMPurify from 'isomorphic-dompurify';
|
|
4
|
+
|
|
5
|
+
// Allow the subset of HTML that TipTap produces for block content
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- DOMPurify.Config is not directly exported
|
|
7
|
+
const PURIFY_CONFIG: any = {
|
|
8
|
+
ALLOWED_TAGS: [
|
|
9
|
+
'p', 'br', 'strong', 'em', 'u', 's', 'code', 'pre',
|
|
10
|
+
'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
|
|
11
|
+
'ul', 'ol', 'li',
|
|
12
|
+
'a', 'img',
|
|
13
|
+
'blockquote', 'figure', 'figcaption',
|
|
14
|
+
'span', 'div', 'sub', 'sup', 'mark',
|
|
15
|
+
'table', 'thead', 'tbody', 'tr', 'th', 'td',
|
|
16
|
+
'hr',
|
|
17
|
+
],
|
|
18
|
+
ALLOWED_ATTR: [
|
|
19
|
+
'href', 'src', 'alt', 'title', 'class', 'id', 'target', 'rel',
|
|
20
|
+
'style', 'width', 'height', 'loading',
|
|
21
|
+
'colspan', 'rowspan',
|
|
22
|
+
],
|
|
23
|
+
ALLOW_DATA_ATTR: false,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** Sanitize HTML for safe rendering via v-html */
|
|
27
|
+
export function sanitizeBlockHtml(html: string): string {
|
|
28
|
+
return DOMPurify.sanitize(html, PURIFY_CONFIG) as unknown as string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Composable wrapper for template use */
|
|
32
|
+
export function useSanitize(): { sanitize: (html: string) => string } {
|
|
33
|
+
return { sanitize: sanitizeBlockHtml };
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { applyThemeToElement, isValidThemeId } from '@commonpub/ui';
|
|
2
|
+
|
|
3
|
+
const STORAGE_KEY = 'cpub-theme';
|
|
4
|
+
|
|
5
|
+
export function useTheme(): {
|
|
6
|
+
themeId: Ref<string>;
|
|
7
|
+
setTheme: (id: string) => void;
|
|
8
|
+
} {
|
|
9
|
+
// Use useState so SSR and client agree on 'base' initially
|
|
10
|
+
const themeId = useState('cpub-theme', () => 'base');
|
|
11
|
+
|
|
12
|
+
// On client mount, read persisted theme and apply if different
|
|
13
|
+
if (import.meta.client) {
|
|
14
|
+
onMounted(() => {
|
|
15
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
16
|
+
if (stored && isValidThemeId(stored) && stored !== themeId.value) {
|
|
17
|
+
themeId.value = stored;
|
|
18
|
+
applyThemeToElement(document.documentElement, stored);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function setTheme(id: string): void {
|
|
24
|
+
if (isValidThemeId(id)) {
|
|
25
|
+
themeId.value = id;
|
|
26
|
+
if (import.meta.client) {
|
|
27
|
+
applyThemeToElement(document.documentElement, id);
|
|
28
|
+
localStorage.setItem(STORAGE_KEY, id);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return { themeId, setTheme };
|
|
34
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Simple toast notification composable
|
|
2
|
+
|
|
3
|
+
export interface Toast {
|
|
4
|
+
id: number;
|
|
5
|
+
message: string;
|
|
6
|
+
type: 'success' | 'error' | 'info';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let nextId = 0;
|
|
10
|
+
|
|
11
|
+
export function useToast() {
|
|
12
|
+
const toasts = useState<Toast[]>('toasts', () => []);
|
|
13
|
+
|
|
14
|
+
function show(message: string, type: Toast['type'] = 'info', duration = 3000): void {
|
|
15
|
+
const id = nextId++;
|
|
16
|
+
toasts.value.push({ id, message, type });
|
|
17
|
+
if (duration > 0) {
|
|
18
|
+
setTimeout(() => dismiss(id), duration);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function success(message: string): void {
|
|
23
|
+
show(message, 'success');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function error(message: string): void {
|
|
27
|
+
show(message, 'error', 5000);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function dismiss(id: number): void {
|
|
31
|
+
toasts.value = toasts.value.filter((t) => t.id !== id);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return { toasts: readonly(toasts), show, success, error, dismiss };
|
|
35
|
+
}
|
package/error.vue
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{
|
|
3
|
+
error: {
|
|
4
|
+
statusCode: number;
|
|
5
|
+
statusMessage?: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
};
|
|
8
|
+
}>();
|
|
9
|
+
|
|
10
|
+
useSeoMeta({ title: `${props.error.statusCode} — CommonPub` });
|
|
11
|
+
|
|
12
|
+
const isNotFound = computed(() => props.error.statusCode === 404);
|
|
13
|
+
|
|
14
|
+
function handleBack(): void {
|
|
15
|
+
clearError({ redirect: '/' });
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div class="cpub-error-page">
|
|
21
|
+
<div class="cpub-error-grid" />
|
|
22
|
+
<div class="cpub-error-inner">
|
|
23
|
+
<div class="cpub-error-code">{{ error.statusCode }}</div>
|
|
24
|
+
<h1 class="cpub-error-title">
|
|
25
|
+
{{ isNotFound ? 'Page not found' : 'Something went wrong' }}
|
|
26
|
+
</h1>
|
|
27
|
+
<p class="cpub-error-desc">
|
|
28
|
+
{{ isNotFound ? "The page you're looking for doesn't exist or has been moved." : (error.statusMessage || error.message || 'An unexpected error occurred.') }}
|
|
29
|
+
</p>
|
|
30
|
+
<div class="cpub-error-actions">
|
|
31
|
+
<button class="cpub-error-btn cpub-error-btn-primary" @click="handleBack">
|
|
32
|
+
<i class="fa-solid fa-house"></i> Go Home
|
|
33
|
+
</button>
|
|
34
|
+
<NuxtLink to="/search" class="cpub-error-btn">
|
|
35
|
+
<i class="fa-solid fa-magnifying-glass"></i> Search
|
|
36
|
+
</NuxtLink>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<style scoped>
|
|
43
|
+
.cpub-error-page {
|
|
44
|
+
min-height: 100vh;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
background: var(--bg, #fafaf9);
|
|
49
|
+
position: relative;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.cpub-error-grid {
|
|
54
|
+
position: absolute; inset: 0;
|
|
55
|
+
background-image:
|
|
56
|
+
linear-gradient(var(--border2, #d4d4d0) 1px, transparent 1px),
|
|
57
|
+
linear-gradient(90deg, var(--border2, #d4d4d0) 1px, transparent 1px);
|
|
58
|
+
background-size: 40px 40px;
|
|
59
|
+
opacity: 0.15;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.cpub-error-inner {
|
|
63
|
+
position: relative; z-index: 1;
|
|
64
|
+
text-align: center;
|
|
65
|
+
padding: 32px;
|
|
66
|
+
max-width: 480px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.cpub-error-code {
|
|
70
|
+
font-family: var(--font-mono, 'JetBrains Mono', monospace);
|
|
71
|
+
font-size: 80px;
|
|
72
|
+
font-weight: 700;
|
|
73
|
+
color: var(--accent, #5b9cf6);
|
|
74
|
+
line-height: 1;
|
|
75
|
+
margin-bottom: 12px;
|
|
76
|
+
letter-spacing: -0.04em;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.cpub-error-title {
|
|
80
|
+
font-size: 20px;
|
|
81
|
+
font-weight: 700;
|
|
82
|
+
color: var(--text, #1a1a1a);
|
|
83
|
+
margin-bottom: 10px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.cpub-error-desc {
|
|
87
|
+
font-size: 13px;
|
|
88
|
+
color: var(--text-dim, #6b6b66);
|
|
89
|
+
line-height: 1.6;
|
|
90
|
+
margin-bottom: 28px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.cpub-error-actions {
|
|
94
|
+
display: flex;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
gap: 10px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.cpub-error-btn {
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
gap: 6px;
|
|
103
|
+
padding: 8px 18px;
|
|
104
|
+
font-size: 12px;
|
|
105
|
+
font-weight: 500;
|
|
106
|
+
border: var(--border-width-default) solid var(--border, #1a1a1a);
|
|
107
|
+
background: var(--surface, #fff);
|
|
108
|
+
color: var(--text, #1a1a1a);
|
|
109
|
+
text-decoration: none;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
transition: all 0.15s;
|
|
112
|
+
font-family: inherit;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.cpub-error-btn:hover {
|
|
116
|
+
box-shadow: var(--shadow-sm);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.cpub-error-btn-primary {
|
|
120
|
+
background: var(--accent, #5b9cf6);
|
|
121
|
+
color: #fff;
|
|
122
|
+
box-shadow: var(--shadow-md);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.cpub-error-btn-primary:hover {
|
|
126
|
+
box-shadow: var(--shadow-lg);
|
|
127
|
+
transform: translate(-1px, -1px);
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { isAdmin } = useAuth();
|
|
3
|
+
const { admin: adminEnabled } = useFeatures();
|
|
4
|
+
const runtimeConfig = useRuntimeConfig();
|
|
5
|
+
const siteName = computed(() => (runtimeConfig.public.siteName as string) || 'CommonPub');
|
|
6
|
+
const sidebarOpen = ref(false);
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div v-if="!adminEnabled" class="admin-denied">
|
|
11
|
+
<h1>Not Available</h1>
|
|
12
|
+
<p>The admin panel is not enabled on this instance.</p>
|
|
13
|
+
</div>
|
|
14
|
+
<div v-else class="admin-layout">
|
|
15
|
+
<header class="admin-topbar">
|
|
16
|
+
<div class="admin-topbar-inner">
|
|
17
|
+
<button class="admin-menu-btn" aria-label="Toggle sidebar" @click="sidebarOpen = !sidebarOpen">
|
|
18
|
+
<i :class="sidebarOpen ? 'fa-solid fa-xmark' : 'fa-solid fa-bars'"></i>
|
|
19
|
+
</button>
|
|
20
|
+
<NuxtLink to="/" class="admin-brand">{{ siteName }}</NuxtLink>
|
|
21
|
+
<span class="admin-badge">Admin</span>
|
|
22
|
+
<NuxtLink to="/" class="admin-back"><i class="fa-solid fa-arrow-left"></i> Back to site</NuxtLink>
|
|
23
|
+
</div>
|
|
24
|
+
</header>
|
|
25
|
+
|
|
26
|
+
<div class="admin-body">
|
|
27
|
+
<aside class="admin-sidebar" :class="{ open: sidebarOpen }" aria-label="Admin navigation">
|
|
28
|
+
<nav class="admin-nav">
|
|
29
|
+
<NuxtLink to="/admin" class="admin-nav-link" @click="sidebarOpen = false"><i class="fa-solid fa-gauge"></i> Dashboard</NuxtLink>
|
|
30
|
+
<NuxtLink to="/admin/users" class="admin-nav-link" @click="sidebarOpen = false"><i class="fa-solid fa-users"></i> Users</NuxtLink>
|
|
31
|
+
<NuxtLink to="/admin/content" class="admin-nav-link" @click="sidebarOpen = false"><i class="fa-solid fa-newspaper"></i> Content</NuxtLink>
|
|
32
|
+
<NuxtLink to="/admin/reports" class="admin-nav-link" @click="sidebarOpen = false"><i class="fa-solid fa-flag"></i> Reports</NuxtLink>
|
|
33
|
+
<NuxtLink to="/admin/audit" class="admin-nav-link" @click="sidebarOpen = false"><i class="fa-solid fa-clipboard-list"></i> Audit Log</NuxtLink>
|
|
34
|
+
<NuxtLink to="/admin/federation" class="admin-nav-link" @click="sidebarOpen = false"><i class="fa-solid fa-globe"></i> Federation</NuxtLink>
|
|
35
|
+
<NuxtLink to="/admin/settings" class="admin-nav-link" @click="sidebarOpen = false"><i class="fa-solid fa-gear"></i> Settings</NuxtLink>
|
|
36
|
+
</nav>
|
|
37
|
+
</aside>
|
|
38
|
+
|
|
39
|
+
<main class="admin-main">
|
|
40
|
+
<div v-if="isAdmin">
|
|
41
|
+
<slot />
|
|
42
|
+
</div>
|
|
43
|
+
<div v-else class="admin-denied">
|
|
44
|
+
<h1>Access Denied</h1>
|
|
45
|
+
<p>You need admin privileges to access this area.</p>
|
|
46
|
+
</div>
|
|
47
|
+
</main>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<style scoped>
|
|
53
|
+
.admin-layout {
|
|
54
|
+
min-height: 100vh;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
background: var(--bg);
|
|
58
|
+
color: var(--text);
|
|
59
|
+
font-family: var(--font-sans);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.admin-topbar {
|
|
63
|
+
height: var(--nav-height);
|
|
64
|
+
border-bottom: var(--border-width-default) solid var(--border);
|
|
65
|
+
background: var(--surface);
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
padding: 0 var(--space-4);
|
|
69
|
+
position: sticky;
|
|
70
|
+
top: 0;
|
|
71
|
+
z-index: 50;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.admin-topbar-inner {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
width: 100%;
|
|
78
|
+
gap: var(--space-3);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.admin-menu-btn {
|
|
82
|
+
display: none;
|
|
83
|
+
width: 36px;
|
|
84
|
+
height: 36px;
|
|
85
|
+
background: none;
|
|
86
|
+
border: var(--border-width-default) solid var(--border);
|
|
87
|
+
color: var(--text-dim);
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.admin-brand {
|
|
95
|
+
font-weight: var(--font-weight-bold);
|
|
96
|
+
font-size: var(--text-lg);
|
|
97
|
+
color: var(--text);
|
|
98
|
+
text-decoration: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.admin-badge {
|
|
102
|
+
padding: var(--space-1) var(--space-2);
|
|
103
|
+
background: var(--accent);
|
|
104
|
+
color: var(--color-on-primary);
|
|
105
|
+
font-size: var(--text-xs);
|
|
106
|
+
font-weight: var(--font-weight-bold);
|
|
107
|
+
text-transform: uppercase;
|
|
108
|
+
letter-spacing: var(--tracking-wide);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.admin-back {
|
|
112
|
+
margin-left: auto;
|
|
113
|
+
color: var(--text-dim);
|
|
114
|
+
text-decoration: none;
|
|
115
|
+
font-size: var(--text-sm);
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
gap: 6px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.admin-back:hover {
|
|
122
|
+
color: var(--accent);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.admin-body {
|
|
126
|
+
display: flex;
|
|
127
|
+
flex: 1;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.admin-sidebar {
|
|
131
|
+
width: 200px;
|
|
132
|
+
border-right: var(--border-width-default) solid var(--border);
|
|
133
|
+
background: var(--surface);
|
|
134
|
+
padding: var(--space-4) var(--space-2);
|
|
135
|
+
flex-shrink: 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.admin-nav {
|
|
139
|
+
display: flex;
|
|
140
|
+
flex-direction: column;
|
|
141
|
+
gap: 2px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.admin-nav-link {
|
|
145
|
+
color: var(--text-dim);
|
|
146
|
+
text-decoration: none;
|
|
147
|
+
font-size: var(--text-sm);
|
|
148
|
+
padding: var(--space-2) var(--space-3);
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
gap: 10px;
|
|
152
|
+
transition: color 0.12s, background 0.12s;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.admin-nav-link i {
|
|
156
|
+
width: 16px;
|
|
157
|
+
text-align: center;
|
|
158
|
+
font-size: 12px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.admin-nav-link:hover {
|
|
162
|
+
color: var(--text);
|
|
163
|
+
background: var(--surface2);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.admin-nav-link.router-link-exact-active {
|
|
167
|
+
color: var(--accent);
|
|
168
|
+
background: var(--accent-bg);
|
|
169
|
+
font-weight: 600;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.admin-nav-link:focus-visible {
|
|
173
|
+
outline: 2px solid var(--accent);
|
|
174
|
+
outline-offset: -2px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.admin-main {
|
|
178
|
+
flex: 1;
|
|
179
|
+
padding: var(--space-6);
|
|
180
|
+
min-width: 0;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.admin-denied {
|
|
184
|
+
text-align: center;
|
|
185
|
+
padding: var(--space-10) 0;
|
|
186
|
+
color: var(--text-dim);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.admin-denied h1 {
|
|
190
|
+
font-size: var(--text-xl);
|
|
191
|
+
margin-bottom: var(--space-2);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@media (max-width: 768px) {
|
|
195
|
+
.admin-menu-btn { display: flex; }
|
|
196
|
+
.admin-sidebar {
|
|
197
|
+
position: fixed;
|
|
198
|
+
top: var(--nav-height);
|
|
199
|
+
left: 0;
|
|
200
|
+
bottom: 0;
|
|
201
|
+
z-index: 40;
|
|
202
|
+
transform: translateX(-100%);
|
|
203
|
+
transition: transform 0.2s ease;
|
|
204
|
+
box-shadow: none;
|
|
205
|
+
width: 220px;
|
|
206
|
+
}
|
|
207
|
+
.admin-sidebar.open {
|
|
208
|
+
transform: translateX(0);
|
|
209
|
+
box-shadow: var(--shadow-lg);
|
|
210
|
+
}
|
|
211
|
+
.admin-main { padding: var(--space-4); }
|
|
212
|
+
}
|
|
213
|
+
</style>
|
package/layouts/auth.vue
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// Auth layout — minimal centered layout for login/register
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="auth-layout">
|
|
7
|
+
<main class="auth-content">
|
|
8
|
+
<NuxtLink to="/" class="auth-brand" aria-label="Return to homepage">
|
|
9
|
+
<SiteLogo />
|
|
10
|
+
</NuxtLink>
|
|
11
|
+
<div class="auth-card">
|
|
12
|
+
<slot />
|
|
13
|
+
</div>
|
|
14
|
+
</main>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<style scoped>
|
|
19
|
+
.auth-layout {
|
|
20
|
+
min-height: 100vh;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
background: var(--bg);
|
|
25
|
+
color: var(--text);
|
|
26
|
+
font-family: var(--font-sans);
|
|
27
|
+
padding: var(--space-4);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.auth-content {
|
|
31
|
+
width: 100%;
|
|
32
|
+
max-width: 400px;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: var(--space-6);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.auth-brand {
|
|
40
|
+
font-family: var(--font-mono);
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
font-size: 18px;
|
|
43
|
+
color: var(--text);
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: 2px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.auth-bracket {
|
|
51
|
+
color: var(--accent);
|
|
52
|
+
font-size: 20px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.auth-card {
|
|
56
|
+
width: 100%;
|
|
57
|
+
background: var(--surface);
|
|
58
|
+
border: var(--border-width-default) solid var(--border);
|
|
59
|
+
border-radius: var(--radius);
|
|
60
|
+
box-shadow: var(--shadow-md);
|
|
61
|
+
padding: var(--space-6);
|
|
62
|
+
}
|
|
63
|
+
</style>
|