@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,688 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ContentViewData } from '../../composables/useEngagement';
|
|
3
|
+
import type { BlockTuple } from '@commonpub/editor';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
content: ContentViewData;
|
|
7
|
+
federatedId?: string;
|
|
8
|
+
}>();
|
|
9
|
+
|
|
10
|
+
const blocks = computed<BlockTuple[]>(() => {
|
|
11
|
+
const raw = props.content?.content;
|
|
12
|
+
if (!Array.isArray(raw)) return [];
|
|
13
|
+
return raw as BlockTuple[];
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// Derive sections from sectionHeader blocks, falling back to H2 headings
|
|
17
|
+
const sections = computed(() => {
|
|
18
|
+
const result: Array<{ title: string; tag: string; body: string; blockIndex: number }> = [];
|
|
19
|
+
|
|
20
|
+
// First try sectionHeader blocks
|
|
21
|
+
for (let i = 0; i < blocks.value.length; i++) {
|
|
22
|
+
const [type, data] = blocks.value[i]!;
|
|
23
|
+
if (type === 'sectionHeader') {
|
|
24
|
+
result.push({
|
|
25
|
+
title: (data.title as string) || 'Untitled',
|
|
26
|
+
tag: (data.tag as string) || '',
|
|
27
|
+
body: (data.body as string) || '',
|
|
28
|
+
blockIndex: i,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Fallback to H2 headings if no sectionHeader blocks
|
|
34
|
+
if (result.length === 0) {
|
|
35
|
+
for (let i = 0; i < blocks.value.length; i++) {
|
|
36
|
+
const [type, data] = blocks.value[i]!;
|
|
37
|
+
if (type === 'heading' && ((data.level as number) ?? 2) <= 2) {
|
|
38
|
+
result.push({
|
|
39
|
+
title: (data.text as string) || 'Untitled',
|
|
40
|
+
tag: `§ ${String(result.length + 1).padStart(2, '0')}`,
|
|
41
|
+
body: '',
|
|
42
|
+
blockIndex: i,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Final fallback: treat entire content as one section
|
|
49
|
+
// blockIndex -1 so that sectionRanges start = -1 + 1 = 0 (don't skip first block)
|
|
50
|
+
if (result.length === 0 && blocks.value.length > 0) {
|
|
51
|
+
result.push({
|
|
52
|
+
title: props.content.title || 'Content',
|
|
53
|
+
tag: '§ 01',
|
|
54
|
+
body: props.content.description || '',
|
|
55
|
+
blockIndex: -1,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return result;
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// Compute block ranges per section (blocks between section headers)
|
|
63
|
+
const sectionRanges = computed(() => {
|
|
64
|
+
const ranges: Array<{ start: number; end: number }> = [];
|
|
65
|
+
for (let i = 0; i < sections.value.length; i++) {
|
|
66
|
+
// Start after the sectionHeader block itself
|
|
67
|
+
const start = sections.value[i]!.blockIndex + 1;
|
|
68
|
+
const nextSec = sections.value[i + 1];
|
|
69
|
+
const end = nextSec?.blockIndex ?? blocks.value.length;
|
|
70
|
+
ranges.push({ start, end });
|
|
71
|
+
}
|
|
72
|
+
if (ranges.length === 0 && blocks.value.length > 0) {
|
|
73
|
+
ranges.push({ start: 0, end: blocks.value.length });
|
|
74
|
+
}
|
|
75
|
+
return ranges;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const activeSection = ref(0);
|
|
79
|
+
const completedSections = ref<Set<number>>(new Set());
|
|
80
|
+
const contentId = computed(() => props.content?.id);
|
|
81
|
+
const contentType = computed(() => props.content?.type ?? 'explainer');
|
|
82
|
+
const fedId = computed(() => props.federatedId);
|
|
83
|
+
const { bookmarked, toggleBookmark, share } = useEngagement({ contentId, contentType, federatedContentId: fedId });
|
|
84
|
+
|
|
85
|
+
const { user } = useAuth();
|
|
86
|
+
const isOwner = computed(() => user.value?.id === props.content?.author?.id);
|
|
87
|
+
|
|
88
|
+
const runtimeConfig = useRuntimeConfig();
|
|
89
|
+
useJsonLd({
|
|
90
|
+
type: 'article',
|
|
91
|
+
title: props.content.title,
|
|
92
|
+
description: props.content.seoDescription ?? props.content.description ?? '',
|
|
93
|
+
url: `${runtimeConfig.public.siteUrl}/explainer/${props.content.slug}`,
|
|
94
|
+
imageUrl: props.content.coverImageUrl ?? undefined,
|
|
95
|
+
authorName: props.content.author?.displayName ?? props.content.author?.username ?? '',
|
|
96
|
+
authorUrl: `${runtimeConfig.public.siteUrl}/u/${props.content.author?.username}`,
|
|
97
|
+
publishedAt: props.content.publishedAt ?? props.content.createdAt,
|
|
98
|
+
updatedAt: props.content.updatedAt,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const totalSections = computed(() => sections.value.length);
|
|
102
|
+
const progressPct = computed(() => ((activeSection.value + 1) / totalSections.value) * 100);
|
|
103
|
+
|
|
104
|
+
function goToSection(idx: number): void {
|
|
105
|
+
if (idx >= 0 && idx < totalSections.value && idx !== activeSection.value) {
|
|
106
|
+
if (activeSection.value < idx) {
|
|
107
|
+
completedSections.value.add(activeSection.value);
|
|
108
|
+
}
|
|
109
|
+
activeSection.value = idx;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function prevSection(): void {
|
|
114
|
+
if (activeSection.value > 0) activeSection.value--;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function nextSection(): void {
|
|
118
|
+
completedSections.value.add(activeSection.value);
|
|
119
|
+
if (activeSection.value < totalSections.value - 1) activeSection.value++;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Checkpoint state
|
|
123
|
+
const checkpointVisible = ref(false);
|
|
124
|
+
|
|
125
|
+
watch(activeSection, () => {
|
|
126
|
+
checkpointVisible.value = false;
|
|
127
|
+
// Scroll section viewport to top on section change
|
|
128
|
+
const viewport = document.querySelector('.cpub-section-viewport');
|
|
129
|
+
if (viewport) viewport.scrollTop = 0;
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// Current section data
|
|
133
|
+
const currentSection = computed(() => sections.value[activeSection.value]);
|
|
134
|
+
const currentRange = computed(() => sectionRanges.value[activeSection.value]);
|
|
135
|
+
|
|
136
|
+
// Keyboard navigation
|
|
137
|
+
function onKeydown(e: KeyboardEvent): void {
|
|
138
|
+
if (e.key === 'ArrowLeft') { prevSection(); e.preventDefault(); }
|
|
139
|
+
if (e.key === 'ArrowRight') { nextSection(); e.preventDefault(); }
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
onMounted(() => { document.addEventListener('keydown', onKeydown); });
|
|
143
|
+
onUnmounted(() => { document.removeEventListener('keydown', onKeydown); });
|
|
144
|
+
</script>
|
|
145
|
+
|
|
146
|
+
<template>
|
|
147
|
+
<div class="cpub-explainer-view">
|
|
148
|
+
<!-- PROGRESS BAR -->
|
|
149
|
+
<div class="cpub-progress-line">
|
|
150
|
+
<div class="cpub-progress-line-fill" :style="{ width: progressPct + '%' }"></div>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<!-- CUSTOM TOPBAR -->
|
|
154
|
+
<header class="cpub-explainer-topbar">
|
|
155
|
+
<div class="cpub-explainer-badge">EXPLAINER</div>
|
|
156
|
+
<span class="cpub-topbar-title">{{ content.title }}</span>
|
|
157
|
+
<div class="cpub-topbar-spacer"></div>
|
|
158
|
+
<span class="cpub-progress-text">Section {{ activeSection + 1 }} of {{ totalSections }}</span>
|
|
159
|
+
<div class="cpub-topbar-divider"></div>
|
|
160
|
+
<div class="cpub-nav-btn-group">
|
|
161
|
+
<button class="cpub-icon-btn" :disabled="activeSection === 0" title="Previous section" @click="prevSection">
|
|
162
|
+
<i class="fa-solid fa-arrow-left"></i>
|
|
163
|
+
</button>
|
|
164
|
+
<button class="cpub-icon-btn" :disabled="activeSection === totalSections - 1" title="Next section" @click="nextSection">
|
|
165
|
+
<i class="fa-solid fa-arrow-right"></i>
|
|
166
|
+
</button>
|
|
167
|
+
</div>
|
|
168
|
+
<div class="cpub-topbar-divider"></div>
|
|
169
|
+
<button class="cpub-icon-btn" :class="{ active: bookmarked }" title="Bookmark" @click="toggleBookmark">
|
|
170
|
+
<i :class="bookmarked ? 'fa-solid fa-bookmark' : 'fa-regular fa-bookmark'"></i>
|
|
171
|
+
</button>
|
|
172
|
+
<button class="cpub-icon-btn" title="Share" @click="share">
|
|
173
|
+
<i class="fa-solid fa-arrow-up-from-bracket"></i>
|
|
174
|
+
</button>
|
|
175
|
+
<NuxtLink
|
|
176
|
+
v-if="isOwner"
|
|
177
|
+
:to="`/${content.type}/${content.slug}/edit`"
|
|
178
|
+
class="cpub-icon-btn cpub-edit-link"
|
|
179
|
+
title="Edit explainer"
|
|
180
|
+
aria-label="Edit explainer"
|
|
181
|
+
>
|
|
182
|
+
<i class="fa-solid fa-pen"></i>
|
|
183
|
+
</NuxtLink>
|
|
184
|
+
</header>
|
|
185
|
+
|
|
186
|
+
<!-- MAIN LAYOUT -->
|
|
187
|
+
<div class="cpub-explainer-layout">
|
|
188
|
+
<!-- SIDEBAR TOC -->
|
|
189
|
+
<nav class="cpub-explainer-sidebar">
|
|
190
|
+
<div class="cpub-toc-header">Contents</div>
|
|
191
|
+
<ul class="cpub-toc-list">
|
|
192
|
+
<li
|
|
193
|
+
v-for="(section, i) in sections"
|
|
194
|
+
:key="i"
|
|
195
|
+
class="cpub-toc-item"
|
|
196
|
+
:class="{ completed: completedSections.has(i), active: activeSection === i }"
|
|
197
|
+
>
|
|
198
|
+
<a @click="goToSection(i)">
|
|
199
|
+
<span class="cpub-toc-icon">
|
|
200
|
+
<i v-if="completedSections.has(i)" class="fa-solid fa-check"></i>
|
|
201
|
+
<i v-else-if="activeSection === i" class="fa-solid fa-arrow-right"></i>
|
|
202
|
+
</span>
|
|
203
|
+
<span class="cpub-toc-num">{{ String(i + 1).padStart(2, '0') }}</span>
|
|
204
|
+
<span class="cpub-toc-label">{{ section.title }}</span>
|
|
205
|
+
</a>
|
|
206
|
+
</li>
|
|
207
|
+
</ul>
|
|
208
|
+
|
|
209
|
+
<!-- Author info -->
|
|
210
|
+
<div v-if="content.author" class="cpub-sidebar-author">
|
|
211
|
+
<NuxtLink :to="`/u/${content.author.username}`" class="cpub-sidebar-author-avatar">
|
|
212
|
+
<img v-if="content.author.avatarUrl" :src="content.author.avatarUrl" :alt="content.author.displayName || content.author.username" />
|
|
213
|
+
<span v-else class="cpub-sidebar-author-initials">{{ (content.author.displayName || content.author.username).charAt(0).toUpperCase() }}</span>
|
|
214
|
+
</NuxtLink>
|
|
215
|
+
<div class="cpub-sidebar-author-info">
|
|
216
|
+
<NuxtLink :to="`/u/${content.author.username}`" class="cpub-sidebar-author-name">
|
|
217
|
+
{{ content.author.displayName || content.author.username }}
|
|
218
|
+
</NuxtLink>
|
|
219
|
+
<time class="cpub-sidebar-author-date" :datetime="new Date(content.publishedAt || content.createdAt).toISOString()">
|
|
220
|
+
{{ new Date(content.publishedAt || content.createdAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }) }}
|
|
221
|
+
</time>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</nav>
|
|
225
|
+
|
|
226
|
+
<!-- MAIN CONTENT — one section at a time -->
|
|
227
|
+
<main class="cpub-explainer-main">
|
|
228
|
+
<div class="cpub-section-viewport">
|
|
229
|
+
<div class="cpub-content-wrap" :key="activeSection">
|
|
230
|
+
<!-- Section Header (from sectionHeader block data) -->
|
|
231
|
+
<div v-if="currentSection?.tag" class="cpub-section-tag">{{ currentSection.tag }}</div>
|
|
232
|
+
<h1 class="cpub-section-title">{{ currentSection?.title || content.title }}</h1>
|
|
233
|
+
|
|
234
|
+
<!-- Author byline (mobile only — desktop shows in sidebar) -->
|
|
235
|
+
<div v-if="activeSection === 0 && content.author" class="cpub-mobile-author">
|
|
236
|
+
<NuxtLink :to="`/u/${content.author.username}`" class="cpub-mobile-author-link">
|
|
237
|
+
{{ content.author.displayName || content.author.username }}
|
|
238
|
+
</NuxtLink>
|
|
239
|
+
<span class="cpub-mobile-author-sep">·</span>
|
|
240
|
+
<time :datetime="new Date(content.publishedAt || content.createdAt).toISOString()">
|
|
241
|
+
{{ new Date(content.publishedAt || content.createdAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }) }}
|
|
242
|
+
</time>
|
|
243
|
+
</div>
|
|
244
|
+
|
|
245
|
+
<p v-if="currentSection?.body" class="cpub-section-intro">{{ currentSection.body }}</p>
|
|
246
|
+
|
|
247
|
+
<!-- Section body blocks -->
|
|
248
|
+
<div class="cpub-body-text">
|
|
249
|
+
<template v-if="currentRange && currentRange.start < currentRange.end">
|
|
250
|
+
<BlocksBlockContentRenderer
|
|
251
|
+
:blocks="blocks"
|
|
252
|
+
:start-index="currentRange.start"
|
|
253
|
+
:end-index="currentRange.end"
|
|
254
|
+
@quiz-answered="(_idx: number, correct: boolean) => { if (correct) { completedSections.add(activeSection); checkpointVisible = true; } }"
|
|
255
|
+
@checkpoint-reached="() => { completedSections.add(activeSection); checkpointVisible = true; }"
|
|
256
|
+
/>
|
|
257
|
+
</template>
|
|
258
|
+
<p v-else class="cpub-empty-section">This section has no content blocks yet.</p>
|
|
259
|
+
</div>
|
|
260
|
+
|
|
261
|
+
<!-- CHECKPOINT -->
|
|
262
|
+
<div class="cpub-checkpoint" :class="{ visible: checkpointVisible }">
|
|
263
|
+
<i class="fa-solid fa-circle-check"></i>
|
|
264
|
+
<span class="cpub-checkpoint-text">Section {{ activeSection + 1 }} complete</span>
|
|
265
|
+
<span class="cpub-checkpoint-sub">+1 section · {{ totalSections - activeSection - 1 }} remaining</span>
|
|
266
|
+
</div>
|
|
267
|
+
|
|
268
|
+
<!-- SECTION NAV FOOTER -->
|
|
269
|
+
<div class="cpub-section-nav">
|
|
270
|
+
<button v-if="activeSection > 0" class="cpub-prev-btn" @click="prevSection">
|
|
271
|
+
<i class="fa-solid fa-arrow-left"></i>
|
|
272
|
+
{{ sections[activeSection - 1]?.title }}
|
|
273
|
+
</button>
|
|
274
|
+
<div v-else></div>
|
|
275
|
+
|
|
276
|
+
<div class="cpub-progress-dots">
|
|
277
|
+
<div
|
|
278
|
+
v-for="(_, i) in totalSections"
|
|
279
|
+
:key="i"
|
|
280
|
+
class="cpub-dot"
|
|
281
|
+
:class="{ done: completedSections.has(i), active: i === activeSection }"
|
|
282
|
+
@click="goToSection(i)"
|
|
283
|
+
></div>
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
<button v-if="activeSection < totalSections - 1" class="cpub-next-btn" @click="nextSection">
|
|
287
|
+
Next: {{ sections[activeSection + 1]?.title }}
|
|
288
|
+
<i class="fa-solid fa-arrow-right"></i>
|
|
289
|
+
</button>
|
|
290
|
+
<div v-else></div>
|
|
291
|
+
</div>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
</main>
|
|
295
|
+
</div>
|
|
296
|
+
</div>
|
|
297
|
+
</template>
|
|
298
|
+
|
|
299
|
+
<style scoped>
|
|
300
|
+
/* ── PROGRESS BAR ── */
|
|
301
|
+
.cpub-progress-line {
|
|
302
|
+
position: fixed;
|
|
303
|
+
top: 0; left: 0; right: 0;
|
|
304
|
+
height: 3px;
|
|
305
|
+
background: var(--surface3);
|
|
306
|
+
z-index: 200;
|
|
307
|
+
}
|
|
308
|
+
.cpub-progress-line-fill {
|
|
309
|
+
height: 100%;
|
|
310
|
+
background: var(--accent);
|
|
311
|
+
transition: width 0.4s ease;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* ── CUSTOM TOPBAR ── */
|
|
315
|
+
.cpub-explainer-topbar {
|
|
316
|
+
position: fixed;
|
|
317
|
+
top: 3px; left: 0; right: 0;
|
|
318
|
+
height: 48px;
|
|
319
|
+
background: var(--surface);
|
|
320
|
+
border-bottom: 1px solid var(--border);
|
|
321
|
+
display: flex;
|
|
322
|
+
align-items: center;
|
|
323
|
+
gap: 10px;
|
|
324
|
+
padding: 0 16px;
|
|
325
|
+
z-index: 100;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.cpub-explainer-badge {
|
|
329
|
+
font-family: var(--font-mono);
|
|
330
|
+
font-size: 10px;
|
|
331
|
+
font-weight: 600;
|
|
332
|
+
letter-spacing: 0.08em;
|
|
333
|
+
color: var(--accent);
|
|
334
|
+
background: var(--accent-bg);
|
|
335
|
+
border: var(--border-width-default) solid var(--accent-border);
|
|
336
|
+
padding: 3px 8px;
|
|
337
|
+
white-space: nowrap;
|
|
338
|
+
flex-shrink: 0;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.cpub-topbar-title {
|
|
342
|
+
font-size: 13px;
|
|
343
|
+
font-weight: 600;
|
|
344
|
+
color: var(--text);
|
|
345
|
+
white-space: nowrap;
|
|
346
|
+
overflow: hidden;
|
|
347
|
+
text-overflow: ellipsis;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.cpub-topbar-spacer { flex: 1; }
|
|
351
|
+
|
|
352
|
+
.cpub-progress-text {
|
|
353
|
+
font-family: var(--font-mono);
|
|
354
|
+
font-size: 11px;
|
|
355
|
+
color: var(--text-dim);
|
|
356
|
+
white-space: nowrap;
|
|
357
|
+
flex-shrink: 0;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.cpub-topbar-divider {
|
|
361
|
+
width: 2px;
|
|
362
|
+
height: 20px;
|
|
363
|
+
background: var(--border);
|
|
364
|
+
flex-shrink: 0;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.cpub-icon-btn {
|
|
368
|
+
width: 30px;
|
|
369
|
+
height: 30px;
|
|
370
|
+
display: flex;
|
|
371
|
+
align-items: center;
|
|
372
|
+
justify-content: center;
|
|
373
|
+
background: var(--surface);
|
|
374
|
+
border: 1px solid var(--border);
|
|
375
|
+
color: var(--text-dim);
|
|
376
|
+
cursor: pointer;
|
|
377
|
+
font-size: 12px;
|
|
378
|
+
transition: background 0.1s, color 0.1s, box-shadow 0.1s;
|
|
379
|
+
flex-shrink: 0;
|
|
380
|
+
}
|
|
381
|
+
.cpub-icon-btn:hover:not(:disabled) { background: var(--surface2); color: var(--text); box-shadow: var(--shadow-sm); }
|
|
382
|
+
.cpub-icon-btn:active:not(:disabled) { box-shadow: none; transform: translate(1px, 1px); }
|
|
383
|
+
.cpub-icon-btn.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
|
|
384
|
+
.cpub-icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
|
|
385
|
+
.cpub-nav-btn-group { display: flex; gap: 4px; flex-shrink: 0; }
|
|
386
|
+
|
|
387
|
+
/* ── LAYOUT ── */
|
|
388
|
+
.cpub-explainer-layout {
|
|
389
|
+
display: flex;
|
|
390
|
+
margin-top: 51px;
|
|
391
|
+
height: calc(100vh - 51px);
|
|
392
|
+
overflow: hidden;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/* ── SIDEBAR ── */
|
|
396
|
+
.cpub-explainer-sidebar {
|
|
397
|
+
width: 200px;
|
|
398
|
+
flex-shrink: 0;
|
|
399
|
+
background: var(--surface);
|
|
400
|
+
border-right: 1px solid var(--border);
|
|
401
|
+
display: flex;
|
|
402
|
+
flex-direction: column;
|
|
403
|
+
overflow-y: auto;
|
|
404
|
+
}
|
|
405
|
+
.cpub-toc-header {
|
|
406
|
+
padding: 14px 14px 10px;
|
|
407
|
+
font-family: var(--font-mono);
|
|
408
|
+
font-size: 9px;
|
|
409
|
+
letter-spacing: 0.12em;
|
|
410
|
+
color: var(--text-faint);
|
|
411
|
+
text-transform: uppercase;
|
|
412
|
+
border-bottom: 1px solid var(--border);
|
|
413
|
+
}
|
|
414
|
+
.cpub-toc-list { list-style: none; padding: 6px 0; }
|
|
415
|
+
.cpub-toc-item a {
|
|
416
|
+
display: flex;
|
|
417
|
+
align-items: center;
|
|
418
|
+
gap: 8px;
|
|
419
|
+
padding: 8px 14px;
|
|
420
|
+
text-decoration: none;
|
|
421
|
+
color: var(--text-dim);
|
|
422
|
+
font-size: 12px;
|
|
423
|
+
line-height: 1.4;
|
|
424
|
+
border-left: 3px solid transparent;
|
|
425
|
+
transition: background 0.1s, color 0.1s, border-color 0.1s;
|
|
426
|
+
cursor: pointer;
|
|
427
|
+
}
|
|
428
|
+
.cpub-toc-item a:hover { background: var(--surface2); color: var(--text); }
|
|
429
|
+
.cpub-toc-item.active a { background: var(--accent-bg); border-left-color: var(--accent); color: var(--accent); font-weight: 500; }
|
|
430
|
+
.cpub-toc-item.completed a { color: var(--text-dim); }
|
|
431
|
+
.cpub-toc-icon { width: 14px; font-size: 10px; flex-shrink: 0; text-align: center; }
|
|
432
|
+
.cpub-toc-item.completed .cpub-toc-icon { color: var(--green); }
|
|
433
|
+
.cpub-toc-item.active .cpub-toc-icon { color: var(--accent); }
|
|
434
|
+
.cpub-toc-num { font-family: var(--font-mono); font-size: 9px; color: var(--text-faint); flex-shrink: 0; }
|
|
435
|
+
.cpub-toc-item.active .cpub-toc-num { color: var(--accent-border); }
|
|
436
|
+
.cpub-toc-item.completed .cpub-toc-num { color: var(--green-border); }
|
|
437
|
+
.cpub-toc-label { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
438
|
+
|
|
439
|
+
/* ── SIDEBAR AUTHOR ── */
|
|
440
|
+
.cpub-sidebar-author {
|
|
441
|
+
display: flex;
|
|
442
|
+
align-items: center;
|
|
443
|
+
gap: 8px;
|
|
444
|
+
padding: 12px 14px;
|
|
445
|
+
border-top: 1px solid var(--border);
|
|
446
|
+
margin-top: auto;
|
|
447
|
+
}
|
|
448
|
+
.cpub-sidebar-author-avatar {
|
|
449
|
+
width: 24px;
|
|
450
|
+
height: 24px;
|
|
451
|
+
border-radius: var(--radius-full);
|
|
452
|
+
background: var(--surface3);
|
|
453
|
+
border: 1px solid var(--border);
|
|
454
|
+
display: flex;
|
|
455
|
+
align-items: center;
|
|
456
|
+
justify-content: center;
|
|
457
|
+
overflow: hidden;
|
|
458
|
+
flex-shrink: 0;
|
|
459
|
+
text-decoration: none;
|
|
460
|
+
}
|
|
461
|
+
.cpub-sidebar-author-avatar img {
|
|
462
|
+
width: 100%;
|
|
463
|
+
height: 100%;
|
|
464
|
+
object-fit: cover;
|
|
465
|
+
}
|
|
466
|
+
.cpub-sidebar-author-initials {
|
|
467
|
+
font-family: var(--font-mono);
|
|
468
|
+
font-size: 9px;
|
|
469
|
+
font-weight: 600;
|
|
470
|
+
color: var(--text-dim);
|
|
471
|
+
}
|
|
472
|
+
.cpub-sidebar-author-info {
|
|
473
|
+
display: flex;
|
|
474
|
+
flex-direction: column;
|
|
475
|
+
min-width: 0;
|
|
476
|
+
}
|
|
477
|
+
.cpub-sidebar-author-name {
|
|
478
|
+
font-size: 11px;
|
|
479
|
+
font-weight: 500;
|
|
480
|
+
color: var(--text);
|
|
481
|
+
text-decoration: none;
|
|
482
|
+
white-space: nowrap;
|
|
483
|
+
overflow: hidden;
|
|
484
|
+
text-overflow: ellipsis;
|
|
485
|
+
}
|
|
486
|
+
.cpub-sidebar-author-name:hover { color: var(--accent); }
|
|
487
|
+
.cpub-sidebar-author-date {
|
|
488
|
+
font-size: 10px;
|
|
489
|
+
color: var(--text-faint);
|
|
490
|
+
font-family: var(--font-mono);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/* ── EDIT LINK ── */
|
|
494
|
+
.cpub-edit-link {
|
|
495
|
+
text-decoration: none;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/* ── MOBILE AUTHOR (hidden on desktop, shown when sidebar hidden) ── */
|
|
499
|
+
.cpub-mobile-author {
|
|
500
|
+
display: none;
|
|
501
|
+
align-items: center;
|
|
502
|
+
gap: 6px;
|
|
503
|
+
font-size: 12px;
|
|
504
|
+
color: var(--text-faint);
|
|
505
|
+
margin-bottom: 20px;
|
|
506
|
+
}
|
|
507
|
+
.cpub-mobile-author-link {
|
|
508
|
+
color: var(--text-dim);
|
|
509
|
+
text-decoration: none;
|
|
510
|
+
font-weight: 500;
|
|
511
|
+
}
|
|
512
|
+
.cpub-mobile-author-link:hover { color: var(--accent); }
|
|
513
|
+
.cpub-mobile-author-sep { color: var(--text-faint); }
|
|
514
|
+
.cpub-mobile-author time { font-family: var(--font-mono); font-size: 11px; }
|
|
515
|
+
|
|
516
|
+
/* ── MAIN CONTENT ── */
|
|
517
|
+
.cpub-explainer-main {
|
|
518
|
+
flex: 1;
|
|
519
|
+
overflow: hidden;
|
|
520
|
+
background: var(--bg);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/* Section viewport — fills available space, scrolls within */
|
|
524
|
+
.cpub-section-viewport {
|
|
525
|
+
height: 100%;
|
|
526
|
+
overflow-y: auto;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.cpub-content-wrap {
|
|
530
|
+
max-width: 720px;
|
|
531
|
+
margin: 0 auto;
|
|
532
|
+
padding: 44px 36px 80px;
|
|
533
|
+
min-height: calc(100vh - 51px - 80px);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/* ── SECTION TAG ── */
|
|
537
|
+
.cpub-section-tag {
|
|
538
|
+
font-family: var(--font-mono);
|
|
539
|
+
font-size: 10px;
|
|
540
|
+
letter-spacing: 0.12em;
|
|
541
|
+
color: var(--text-faint);
|
|
542
|
+
margin-bottom: 14px;
|
|
543
|
+
display: flex;
|
|
544
|
+
align-items: center;
|
|
545
|
+
gap: 6px;
|
|
546
|
+
}
|
|
547
|
+
.cpub-section-tag::before {
|
|
548
|
+
content: '';
|
|
549
|
+
display: inline-block;
|
|
550
|
+
width: 24px;
|
|
551
|
+
height: 2px;
|
|
552
|
+
background: var(--border);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/* ── SECTION TITLE ── */
|
|
556
|
+
.cpub-section-title {
|
|
557
|
+
font-size: 30px;
|
|
558
|
+
font-weight: 700;
|
|
559
|
+
color: var(--text);
|
|
560
|
+
line-height: 1.25;
|
|
561
|
+
margin-bottom: 24px;
|
|
562
|
+
letter-spacing: -0.02em;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
.cpub-section-intro {
|
|
566
|
+
font-size: 15px;
|
|
567
|
+
color: var(--text-dim);
|
|
568
|
+
line-height: 1.75;
|
|
569
|
+
margin-bottom: 24px;
|
|
570
|
+
max-width: 560px;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/* ── BODY TEXT ── */
|
|
574
|
+
.cpub-body-text {
|
|
575
|
+
font-size: 15px;
|
|
576
|
+
line-height: 1.75;
|
|
577
|
+
color: var(--text);
|
|
578
|
+
margin-bottom: 20px;
|
|
579
|
+
}
|
|
580
|
+
.cpub-body-text :deep(p) { margin-bottom: 14px; }
|
|
581
|
+
.cpub-body-text :deep(strong) { color: var(--text); font-weight: 700; }
|
|
582
|
+
.cpub-body-text :deep(em) { color: var(--accent); font-style: normal; font-weight: 500; }
|
|
583
|
+
.cpub-body-text :deep(code) {
|
|
584
|
+
font-family: var(--font-mono);
|
|
585
|
+
font-size: 13px;
|
|
586
|
+
background: var(--surface2);
|
|
587
|
+
border: 1px solid var(--border);
|
|
588
|
+
padding: 1px 6px;
|
|
589
|
+
color: var(--accent);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.cpub-empty-section {
|
|
593
|
+
color: var(--text-faint);
|
|
594
|
+
font-style: italic;
|
|
595
|
+
padding: var(--space-10) 0;
|
|
596
|
+
text-align: center;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/* ── CHECKPOINT ── */
|
|
600
|
+
.cpub-checkpoint {
|
|
601
|
+
display: flex;
|
|
602
|
+
align-items: center;
|
|
603
|
+
gap: 10px;
|
|
604
|
+
padding: 12px 16px;
|
|
605
|
+
background: var(--green-bg);
|
|
606
|
+
border: var(--border-width-default) solid var(--green);
|
|
607
|
+
margin-top: 24px;
|
|
608
|
+
font-size: 13px;
|
|
609
|
+
color: var(--green);
|
|
610
|
+
opacity: 0;
|
|
611
|
+
transform: translateY(8px);
|
|
612
|
+
transition: opacity 0.4s ease, transform 0.4s ease;
|
|
613
|
+
}
|
|
614
|
+
.cpub-checkpoint.visible { opacity: 1; transform: translateY(0); }
|
|
615
|
+
.cpub-checkpoint i { font-size: 14px; }
|
|
616
|
+
.cpub-checkpoint-text { font-weight: 600; }
|
|
617
|
+
.cpub-checkpoint-sub {
|
|
618
|
+
margin-left: auto;
|
|
619
|
+
font-size: 11px;
|
|
620
|
+
font-family: var(--font-mono);
|
|
621
|
+
color: var(--green-border);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/* ── SECTION NAV FOOTER ── */
|
|
625
|
+
.cpub-section-nav {
|
|
626
|
+
display: flex;
|
|
627
|
+
align-items: center;
|
|
628
|
+
justify-content: space-between;
|
|
629
|
+
margin-top: 48px;
|
|
630
|
+
padding-top: 24px;
|
|
631
|
+
border-top: 1px solid var(--border);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.cpub-progress-dots { display: flex; align-items: center; gap: 5px; }
|
|
635
|
+
.cpub-dot {
|
|
636
|
+
width: 7px;
|
|
637
|
+
height: 7px;
|
|
638
|
+
border-radius: 50%;
|
|
639
|
+
background: var(--border2);
|
|
640
|
+
transition: background 0.15s, transform 0.15s;
|
|
641
|
+
cursor: pointer;
|
|
642
|
+
}
|
|
643
|
+
.cpub-dot.done { background: var(--green); }
|
|
644
|
+
.cpub-dot.active { background: var(--accent); transform: scale(1.3); }
|
|
645
|
+
.cpub-dot:hover { transform: scale(1.4); }
|
|
646
|
+
|
|
647
|
+
.cpub-next-btn {
|
|
648
|
+
display: flex;
|
|
649
|
+
align-items: center;
|
|
650
|
+
gap: 8px;
|
|
651
|
+
padding: 10px 18px;
|
|
652
|
+
background: var(--accent);
|
|
653
|
+
border: 1px solid var(--border);
|
|
654
|
+
color: var(--color-text-inverse);
|
|
655
|
+
font-size: 13px;
|
|
656
|
+
font-weight: 600;
|
|
657
|
+
cursor: pointer;
|
|
658
|
+
box-shadow: var(--shadow-sm);
|
|
659
|
+
transition: box-shadow 0.1s, transform 0.1s;
|
|
660
|
+
}
|
|
661
|
+
.cpub-next-btn:hover { box-shadow: var(--shadow-sm); transform: translate(1px, 1px); }
|
|
662
|
+
.cpub-next-btn i { font-size: 12px; }
|
|
663
|
+
|
|
664
|
+
.cpub-prev-btn {
|
|
665
|
+
display: flex;
|
|
666
|
+
align-items: center;
|
|
667
|
+
gap: 8px;
|
|
668
|
+
padding: 10px 18px;
|
|
669
|
+
background: var(--surface);
|
|
670
|
+
border: 1px solid var(--border);
|
|
671
|
+
color: var(--text);
|
|
672
|
+
font-size: 13px;
|
|
673
|
+
font-weight: 500;
|
|
674
|
+
cursor: pointer;
|
|
675
|
+
transition: box-shadow 0.1s;
|
|
676
|
+
}
|
|
677
|
+
.cpub-prev-btn:hover { box-shadow: var(--shadow-sm); }
|
|
678
|
+
.cpub-prev-btn i { font-size: 12px; }
|
|
679
|
+
|
|
680
|
+
/* ── RESPONSIVE ── */
|
|
681
|
+
@media (max-width: 768px) {
|
|
682
|
+
.cpub-explainer-sidebar { display: none; }
|
|
683
|
+
.cpub-mobile-author { display: flex; }
|
|
684
|
+
.cpub-content-wrap { padding: 24px 16px 48px; }
|
|
685
|
+
.cpub-section-nav { flex-direction: column; gap: 16px; }
|
|
686
|
+
.cpub-section-title { font-size: 24px; }
|
|
687
|
+
}
|
|
688
|
+
</style>
|