@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,438 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { sanitizeHtml } from '@commonpub/docs';
|
|
3
|
+
import type { Serialized, LearningPathDetail } from '@commonpub/server';
|
|
4
|
+
|
|
5
|
+
interface LessonResponse {
|
|
6
|
+
lesson: {
|
|
7
|
+
id: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
title: string;
|
|
10
|
+
type: string;
|
|
11
|
+
content: unknown;
|
|
12
|
+
duration: number | null;
|
|
13
|
+
contentItemId: string | null;
|
|
14
|
+
};
|
|
15
|
+
module: { id: string; title: string };
|
|
16
|
+
pathId: string;
|
|
17
|
+
linkedContent?: { id: string; title: string; slug: string; type: string; content: unknown };
|
|
18
|
+
renderedHtml: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const route = useRoute();
|
|
22
|
+
const slug = computed(() => route.params.slug as string);
|
|
23
|
+
const lessonSlug = computed(() => route.params.lessonSlug as string);
|
|
24
|
+
|
|
25
|
+
const { data: lessonData, pending: lessonPending, error: lessonError, refresh: refreshLesson } = useLazyFetch<LessonResponse>(() => `/api/learn/${slug.value}/${lessonSlug.value}`);
|
|
26
|
+
const { data: path } = useLazyFetch<Serialized<LearningPathDetail>>(() => `/api/learn/${slug.value}`);
|
|
27
|
+
|
|
28
|
+
const lesson = computed(() => lessonData.value?.lesson);
|
|
29
|
+
const lessonModule = computed(() => lessonData.value?.module);
|
|
30
|
+
|
|
31
|
+
useSeoMeta({
|
|
32
|
+
title: () => lesson.value ? `${lesson.value.title} — ${useSiteName()}` : `Lesson — ${useSiteName()}`,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const { isAuthenticated, user } = useAuth();
|
|
36
|
+
const toast = useToast();
|
|
37
|
+
const completing = ref(false);
|
|
38
|
+
const completed = ref(false);
|
|
39
|
+
|
|
40
|
+
async function markComplete(): Promise<void> {
|
|
41
|
+
completing.value = true;
|
|
42
|
+
try {
|
|
43
|
+
await $fetch(`/api/learn/${slug.value}/${lessonSlug.value}/complete`, { method: 'POST' });
|
|
44
|
+
completed.value = true;
|
|
45
|
+
toast.success('Lesson completed!');
|
|
46
|
+
} catch {
|
|
47
|
+
toast.error('Failed to mark as complete');
|
|
48
|
+
} finally {
|
|
49
|
+
completing.value = false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Build flat lesson list for prev/next navigation
|
|
54
|
+
interface FlatLesson {
|
|
55
|
+
slug: string;
|
|
56
|
+
title: string;
|
|
57
|
+
type: string;
|
|
58
|
+
moduleTitle: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const flatLessons = computed<FlatLesson[]>(() => {
|
|
62
|
+
if (!path.value?.modules) return [];
|
|
63
|
+
const result: FlatLesson[] = [];
|
|
64
|
+
for (const mod of path.value.modules) {
|
|
65
|
+
for (const l of (mod.lessons ?? [])) {
|
|
66
|
+
result.push({ slug: l.slug, title: l.title, type: l.type, moduleTitle: mod.title });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const currentIndex = computed(() => flatLessons.value.findIndex(l => l.slug === lessonSlug.value));
|
|
73
|
+
const prevLesson = computed(() => currentIndex.value > 0 ? flatLessons.value[currentIndex.value - 1] : null);
|
|
74
|
+
const nextLesson = computed(() => currentIndex.value < flatLessons.value.length - 1 ? flatLessons.value[currentIndex.value + 1] : null);
|
|
75
|
+
const totalLessons = computed(() => flatLessons.value.length);
|
|
76
|
+
const progressPct = computed(() => totalLessons.value > 0 ? Math.round(((currentIndex.value + 1) / totalLessons.value) * 100) : 0);
|
|
77
|
+
|
|
78
|
+
// Use server-rendered HTML from the API response
|
|
79
|
+
const renderedHtml = computed(() => lessonData.value?.renderedHtml ?? '');
|
|
80
|
+
|
|
81
|
+
// Video URL
|
|
82
|
+
const videoUrl = computed(() => {
|
|
83
|
+
const content = lesson.value?.content as Record<string, unknown> | null;
|
|
84
|
+
if (!content) return '';
|
|
85
|
+
const url = (content.videoUrl as string) ?? '';
|
|
86
|
+
const ytMatch = url.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&\s]+)/);
|
|
87
|
+
if (ytMatch) return `https://www.youtube.com/embed/${ytMatch[1]}`;
|
|
88
|
+
const vimeoMatch = url.match(/vimeo\.com\/(\d+)/);
|
|
89
|
+
if (vimeoMatch) return `https://player.vimeo.com/video/${vimeoMatch[1]}`;
|
|
90
|
+
return url;
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Quiz data
|
|
94
|
+
interface QuizQuestion {
|
|
95
|
+
question: string;
|
|
96
|
+
options: string[];
|
|
97
|
+
correctIndex: number;
|
|
98
|
+
explanation: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const quizQuestions = computed<QuizQuestion[]>(() => {
|
|
102
|
+
const content = lesson.value?.content as Record<string, unknown> | null;
|
|
103
|
+
if (!content || !Array.isArray(content.questions)) return [];
|
|
104
|
+
return content.questions as QuizQuestion[];
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const quizAnswers = ref<Record<number, number>>({});
|
|
108
|
+
const quizSubmitted = ref<Record<number, boolean>>({});
|
|
109
|
+
|
|
110
|
+
function submitQuizAnswer(qIndex: number, optionIndex: number): void {
|
|
111
|
+
if (quizSubmitted.value[qIndex]) return;
|
|
112
|
+
quizAnswers.value[qIndex] = optionIndex;
|
|
113
|
+
quizSubmitted.value[qIndex] = true;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function isQuizComplete(): boolean {
|
|
117
|
+
return quizQuestions.value.length > 0 && quizQuestions.value.every((_, i) => quizSubmitted.value[i]);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const quizScore = computed(() => {
|
|
121
|
+
if (!isQuizComplete()) return null;
|
|
122
|
+
let correct = 0;
|
|
123
|
+
for (let i = 0; i < quizQuestions.value.length; i++) {
|
|
124
|
+
if (quizAnswers.value[i] === quizQuestions.value[i]!.correctIndex) correct++;
|
|
125
|
+
}
|
|
126
|
+
return { correct, total: quizQuestions.value.length };
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// Lesson type icon
|
|
130
|
+
function getLessonTypeIcon(type: string): string {
|
|
131
|
+
switch (type) {
|
|
132
|
+
case 'video': return 'fa-solid fa-play';
|
|
133
|
+
case 'quiz': return 'fa-solid fa-circle-question';
|
|
134
|
+
case 'project': return 'fa-solid fa-microchip';
|
|
135
|
+
case 'explainer': return 'fa-solid fa-lightbulb';
|
|
136
|
+
default: return 'fa-solid fa-file-lines';
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Sidebar collapsed on mobile
|
|
141
|
+
const sidebarOpen = ref(false);
|
|
142
|
+
|
|
143
|
+
// Is path owner
|
|
144
|
+
const isOwner = computed(() => user.value?.id === path.value?.author?.id);
|
|
145
|
+
</script>
|
|
146
|
+
|
|
147
|
+
<template>
|
|
148
|
+
<div v-if="lessonPending" class="cpub-loading">Loading lesson...</div>
|
|
149
|
+
<div v-else-if="lessonError" class="cpub-fetch-error">
|
|
150
|
+
<div class="cpub-fetch-error-icon"><i class="fa-solid fa-triangle-exclamation"></i></div>
|
|
151
|
+
<div class="cpub-fetch-error-msg">Failed to load lesson.</div>
|
|
152
|
+
<button class="cpub-btn cpub-btn-sm" @click="refreshLesson()">Retry</button>
|
|
153
|
+
</div>
|
|
154
|
+
<div class="lesson-page" v-else-if="lesson">
|
|
155
|
+
<!-- Progress bar at top -->
|
|
156
|
+
<div class="lesson-progress-bar">
|
|
157
|
+
<div class="lesson-progress-fill" :style="{ width: progressPct + '%' }"></div>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<div class="lesson-layout">
|
|
161
|
+
<!-- SIDEBAR: Curriculum -->
|
|
162
|
+
<aside class="lesson-sidebar" :class="{ open: sidebarOpen }">
|
|
163
|
+
<div class="lesson-sidebar-header">
|
|
164
|
+
<NuxtLink :to="`/learn/${slug}`" class="lesson-sidebar-title">
|
|
165
|
+
<i class="fa-solid fa-graduation-cap"></i>
|
|
166
|
+
{{ path?.title ?? 'Learning Path' }}
|
|
167
|
+
</NuxtLink>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
<div class="lesson-sidebar-progress">
|
|
171
|
+
<span class="lesson-sidebar-progress-text">{{ currentIndex + 1 }} / {{ totalLessons }} lessons</span>
|
|
172
|
+
<div class="lesson-sidebar-progress-bar">
|
|
173
|
+
<div class="lesson-sidebar-progress-fill" :style="{ width: progressPct + '%' }"></div>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<nav class="lesson-curriculum">
|
|
178
|
+
<template v-for="mod in (path?.modules ?? [])" :key="mod.id">
|
|
179
|
+
<div class="lesson-mod-title">{{ mod.title }}</div>
|
|
180
|
+
<NuxtLink
|
|
181
|
+
v-for="l in (mod.lessons ?? [])"
|
|
182
|
+
:key="l.id"
|
|
183
|
+
:to="`/learn/${slug}/${l.slug}`"
|
|
184
|
+
class="lesson-nav-item"
|
|
185
|
+
:class="{ active: l.slug === lessonSlug }"
|
|
186
|
+
@click="sidebarOpen = false"
|
|
187
|
+
>
|
|
188
|
+
<span class="lesson-nav-icon">
|
|
189
|
+
<i :class="getLessonTypeIcon(l.type)"></i>
|
|
190
|
+
</span>
|
|
191
|
+
<span class="lesson-nav-text">{{ l.title }}</span>
|
|
192
|
+
<span v-if="l.duration" class="lesson-nav-duration">{{ l.duration }}m</span>
|
|
193
|
+
</NuxtLink>
|
|
194
|
+
</template>
|
|
195
|
+
</nav>
|
|
196
|
+
</aside>
|
|
197
|
+
|
|
198
|
+
<!-- MAIN CONTENT -->
|
|
199
|
+
<main class="lesson-main">
|
|
200
|
+
<!-- Mobile sidebar toggle -->
|
|
201
|
+
<button class="lesson-mobile-toggle" @click="sidebarOpen = !sidebarOpen">
|
|
202
|
+
<i class="fa-solid fa-bars"></i> Curriculum
|
|
203
|
+
</button>
|
|
204
|
+
|
|
205
|
+
<!-- Lesson header -->
|
|
206
|
+
<header class="lesson-header">
|
|
207
|
+
<div class="lesson-meta-row">
|
|
208
|
+
<span class="lesson-type-badge" :data-type="lesson.type">
|
|
209
|
+
<i :class="getLessonTypeIcon(lesson.type)"></i> {{ lesson.type }}
|
|
210
|
+
</span>
|
|
211
|
+
<span v-if="lessonModule" class="lesson-module-name">{{ lessonModule.title }}</span>
|
|
212
|
+
<span v-if="lesson.duration" class="lesson-duration"><i class="fa-regular fa-clock"></i> {{ lesson.duration }} min</span>
|
|
213
|
+
</div>
|
|
214
|
+
<h1 class="lesson-title">{{ lesson.title }}</h1>
|
|
215
|
+
<NuxtLink v-if="isOwner" :to="`/learn/${slug}/${lessonSlug}/edit`" class="lesson-edit-link">
|
|
216
|
+
<i class="fa-solid fa-pen"></i> Edit
|
|
217
|
+
</NuxtLink>
|
|
218
|
+
</header>
|
|
219
|
+
|
|
220
|
+
<!-- VIDEO lesson -->
|
|
221
|
+
<div v-if="lesson.type === 'video' && videoUrl" class="lesson-video">
|
|
222
|
+
<iframe :src="videoUrl" frameborder="0" allowfullscreen class="lesson-video-iframe" />
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<!-- ARTICLE / TEXT content -->
|
|
226
|
+
<div v-if="renderedHtml" class="lesson-content cpub-prose" v-html="sanitizeHtml(renderedHtml)" />
|
|
227
|
+
|
|
228
|
+
<!-- View original link for linked content -->
|
|
229
|
+
<div v-if="lessonData?.linkedContent" class="lesson-linked-source">
|
|
230
|
+
<NuxtLink :to="`/${lessonData.linkedContent.type}/${lessonData.linkedContent.slug}`" class="lesson-linked-source-link">
|
|
231
|
+
<i class="fa-solid fa-arrow-up-right-from-square"></i> View original {{ lessonData.linkedContent.type }}
|
|
232
|
+
</NuxtLink>
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
<!-- QUIZ lesson -->
|
|
236
|
+
<div v-if="lesson.type === 'quiz' && quizQuestions.length" class="lesson-quiz">
|
|
237
|
+
<div v-for="(q, qi) in quizQuestions" :key="qi" class="quiz-card">
|
|
238
|
+
<div class="quiz-header">
|
|
239
|
+
<span class="quiz-badge">QUESTION {{ qi + 1 }}</span>
|
|
240
|
+
</div>
|
|
241
|
+
<div class="quiz-question">{{ q.question }}</div>
|
|
242
|
+
<div class="quiz-options">
|
|
243
|
+
<button
|
|
244
|
+
v-for="(opt, oi) in q.options"
|
|
245
|
+
:key="oi"
|
|
246
|
+
class="quiz-option"
|
|
247
|
+
:class="{
|
|
248
|
+
'selected-correct': quizSubmitted[qi] && oi === q.correctIndex,
|
|
249
|
+
'selected-wrong': quizSubmitted[qi] && quizAnswers[qi] === oi && oi !== q.correctIndex,
|
|
250
|
+
answered: quizSubmitted[qi],
|
|
251
|
+
}"
|
|
252
|
+
:disabled="!!quizSubmitted[qi]"
|
|
253
|
+
@click="submitQuizAnswer(qi, oi)"
|
|
254
|
+
>
|
|
255
|
+
<span class="quiz-option-key">{{ String.fromCharCode(65 + oi) }}</span>
|
|
256
|
+
<span class="quiz-option-text">{{ opt }}</span>
|
|
257
|
+
<span v-if="quizSubmitted[qi] && oi === q.correctIndex" class="quiz-option-indicator"><i class="fa-solid fa-check"></i></span>
|
|
258
|
+
<span v-if="quizSubmitted[qi] && quizAnswers[qi] === oi && oi !== q.correctIndex" class="quiz-option-indicator"><i class="fa-solid fa-xmark"></i></span>
|
|
259
|
+
</button>
|
|
260
|
+
</div>
|
|
261
|
+
<div v-if="quizSubmitted[qi] && q.explanation" class="quiz-explanation">
|
|
262
|
+
<i class="fa-solid fa-lightbulb"></i> {{ q.explanation }}
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
|
|
266
|
+
<div v-if="quizScore" class="quiz-score">
|
|
267
|
+
<div class="quiz-score-value">{{ quizScore.correct }} / {{ quizScore.total }}</div>
|
|
268
|
+
<div class="quiz-score-label">correct answers</div>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
|
|
272
|
+
<!-- Empty state -->
|
|
273
|
+
<div v-if="!renderedHtml && !videoUrl && !quizQuestions.length" class="lesson-empty">
|
|
274
|
+
<i class="fa-solid fa-book-open" style="font-size: 24px; color: var(--text-faint);"></i>
|
|
275
|
+
<p>This lesson has no content yet.</p>
|
|
276
|
+
<NuxtLink v-if="isOwner" :to="`/learn/${slug}/${lessonSlug}/edit`" class="cpub-btn cpub-btn-primary" style="margin-top: 8px;">
|
|
277
|
+
Add Content
|
|
278
|
+
</NuxtLink>
|
|
279
|
+
</div>
|
|
280
|
+
|
|
281
|
+
<!-- Footer: Mark Complete + Prev/Next -->
|
|
282
|
+
<footer class="lesson-footer">
|
|
283
|
+
<div v-if="isAuthenticated" class="lesson-complete-row">
|
|
284
|
+
<button v-if="!completed" class="lesson-complete-btn" @click="markComplete" :disabled="completing">
|
|
285
|
+
<i class="fa-solid fa-check-circle"></i> {{ completing ? 'Marking...' : 'Mark as Complete' }}
|
|
286
|
+
</button>
|
|
287
|
+
<div v-else class="lesson-completed-badge">
|
|
288
|
+
<i class="fa-solid fa-check-circle"></i> Completed
|
|
289
|
+
</div>
|
|
290
|
+
</div>
|
|
291
|
+
|
|
292
|
+
<div class="lesson-nav-footer">
|
|
293
|
+
<NuxtLink v-if="prevLesson" :to="`/learn/${slug}/${prevLesson.slug}`" class="lesson-nav-btn lesson-nav-prev">
|
|
294
|
+
<span class="lesson-nav-btn-label"><i class="fa-solid fa-arrow-left"></i> Previous</span>
|
|
295
|
+
<span class="lesson-nav-btn-title">{{ prevLesson.title }}</span>
|
|
296
|
+
</NuxtLink>
|
|
297
|
+
<div v-else></div>
|
|
298
|
+
|
|
299
|
+
<NuxtLink v-if="nextLesson" :to="`/learn/${slug}/${nextLesson.slug}`" class="lesson-nav-btn lesson-nav-next">
|
|
300
|
+
<span class="lesson-nav-btn-label">Next <i class="fa-solid fa-arrow-right"></i></span>
|
|
301
|
+
<span class="lesson-nav-btn-title">{{ nextLesson.title }}</span>
|
|
302
|
+
</NuxtLink>
|
|
303
|
+
<NuxtLink v-else :to="`/learn/${slug}`" class="lesson-nav-btn lesson-nav-next">
|
|
304
|
+
<span class="lesson-nav-btn-label">Back to Path <i class="fa-solid fa-arrow-right"></i></span>
|
|
305
|
+
<span class="lesson-nav-btn-title">{{ path?.title ?? 'Learning Path' }}</span>
|
|
306
|
+
</NuxtLink>
|
|
307
|
+
</div>
|
|
308
|
+
</footer>
|
|
309
|
+
</main>
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
<div v-else class="lesson-not-found"><h1>Lesson not found</h1></div>
|
|
313
|
+
</template>
|
|
314
|
+
|
|
315
|
+
<style scoped>
|
|
316
|
+
/* Progress bar */
|
|
317
|
+
.lesson-progress-bar { position: fixed; top: 48px; left: 0; right: 0; height: 3px; background: var(--surface3); z-index: 100; }
|
|
318
|
+
.lesson-progress-fill { height: 100%; background: var(--accent); transition: width 0.3s ease; }
|
|
319
|
+
|
|
320
|
+
/* Layout */
|
|
321
|
+
.lesson-page { min-height: calc(100vh - 48px); }
|
|
322
|
+
.lesson-layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 51px); }
|
|
323
|
+
|
|
324
|
+
/* Sidebar */
|
|
325
|
+
.lesson-sidebar {
|
|
326
|
+
background: var(--surface);
|
|
327
|
+
border-right: var(--border-width-default) solid var(--border);
|
|
328
|
+
overflow-y: auto;
|
|
329
|
+
height: calc(100vh - 51px);
|
|
330
|
+
position: sticky;
|
|
331
|
+
top: 51px;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.lesson-sidebar-header { padding: 14px 16px; border-bottom: var(--border-width-default) solid var(--border); }
|
|
335
|
+
.lesson-sidebar-title { font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
|
|
336
|
+
.lesson-sidebar-title:hover { color: var(--accent); }
|
|
337
|
+
.lesson-sidebar-title i { font-size: 12px; color: var(--accent); }
|
|
338
|
+
|
|
339
|
+
.lesson-sidebar-progress { padding: 12px 16px; border-bottom: var(--border-width-default) solid var(--border2); }
|
|
340
|
+
.lesson-sidebar-progress-text { font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); display: block; margin-bottom: 6px; }
|
|
341
|
+
.lesson-sidebar-progress-bar { height: 4px; background: var(--surface3); border: var(--border-width-default) solid var(--border2); }
|
|
342
|
+
.lesson-sidebar-progress-fill { height: 100%; background: var(--accent); transition: width 0.3s; }
|
|
343
|
+
|
|
344
|
+
.lesson-curriculum { padding: 8px 0; }
|
|
345
|
+
.lesson-mod-title { font-size: 10px; font-weight: 700; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); padding: 10px 16px 4px; }
|
|
346
|
+
.lesson-nav-item { display: flex; align-items: center; gap: 8px; padding: 7px 16px; font-size: 12px; color: var(--text-dim); text-decoration: none; border-left: 3px solid transparent; }
|
|
347
|
+
.lesson-nav-item:hover { background: var(--surface2); color: var(--text); }
|
|
348
|
+
.lesson-nav-item.active { background: var(--accent-bg); border-left-color: var(--accent); color: var(--accent); font-weight: 500; }
|
|
349
|
+
.lesson-nav-icon { font-size: 10px; width: 16px; text-align: center; flex-shrink: 0; }
|
|
350
|
+
.lesson-nav-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
351
|
+
.lesson-nav-duration { font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); flex-shrink: 0; }
|
|
352
|
+
|
|
353
|
+
/* Main */
|
|
354
|
+
.lesson-main { padding: 32px 48px 64px; max-width: 800px; }
|
|
355
|
+
|
|
356
|
+
.lesson-mobile-toggle { display: none; margin-bottom: 16px; padding: 6px 12px; font-size: 12px; border: var(--border-width-default) solid var(--border); background: var(--surface); color: var(--text-dim); cursor: pointer; }
|
|
357
|
+
|
|
358
|
+
.lesson-header { margin-bottom: 24px; }
|
|
359
|
+
.lesson-meta-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
|
|
360
|
+
.lesson-type-badge { font-size: 10px; font-family: var(--font-mono); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 8px; border: var(--border-width-default) solid var(--accent-border); color: var(--accent); background: var(--accent-bg); display: inline-flex; align-items: center; gap: 4px; }
|
|
361
|
+
.lesson-module-name { font-size: 11px; font-family: var(--font-mono); color: var(--text-faint); }
|
|
362
|
+
.lesson-duration { font-size: 11px; font-family: var(--font-mono); color: var(--text-faint); display: flex; align-items: center; gap: 4px; }
|
|
363
|
+
.lesson-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
|
|
364
|
+
.lesson-edit-link { font-size: 11px; color: var(--text-faint); text-decoration: none; border: var(--border-width-default) solid var(--border2); padding: 2px 8px; display: inline-block; margin-top: 8px; }
|
|
365
|
+
.lesson-edit-link:hover { color: var(--accent); border-color: var(--accent); }
|
|
366
|
+
|
|
367
|
+
/* Video */
|
|
368
|
+
.lesson-video { margin-bottom: 24px; border: var(--border-width-default) solid var(--border); box-shadow: var(--shadow-md); }
|
|
369
|
+
.lesson-video-iframe { width: 100%; aspect-ratio: 16/9; display: block; }
|
|
370
|
+
|
|
371
|
+
/* Content */
|
|
372
|
+
.lesson-content { font-size: 15px; line-height: 1.75; margin-bottom: 24px; }
|
|
373
|
+
.lesson-content :deep(h2) { font-size: 20px; font-weight: 700; margin-top: 32px; margin-bottom: 12px; color: var(--text); }
|
|
374
|
+
.lesson-content :deep(h3) { font-size: 16px; font-weight: 700; margin-top: 24px; margin-bottom: 8px; color: var(--text); }
|
|
375
|
+
.lesson-content :deep(p) { margin-bottom: 14px; color: var(--text-dim); }
|
|
376
|
+
.lesson-content :deep(a) { color: var(--accent); }
|
|
377
|
+
.lesson-content :deep(code) { font-family: var(--font-mono); font-size: 13px; background: var(--surface2); padding: 2px 5px; border: var(--border-width-default) solid var(--border2); color: var(--accent); }
|
|
378
|
+
.lesson-content :deep(pre) { padding: 16px; background: var(--surface2); border: var(--border-width-default) solid var(--border); overflow-x: auto; margin: 16px 0; }
|
|
379
|
+
.lesson-content :deep(pre code) { background: none; border: none; padding: 0; }
|
|
380
|
+
|
|
381
|
+
/* Quiz */
|
|
382
|
+
.lesson-quiz { margin-bottom: 24px; }
|
|
383
|
+
.quiz-card { border: var(--border-width-default) solid var(--border); padding: 20px; margin-bottom: 16px; background: var(--surface); box-shadow: var(--shadow-md); }
|
|
384
|
+
.quiz-header { margin-bottom: 12px; }
|
|
385
|
+
.quiz-badge { font-size: 9px; font-family: var(--font-mono); letter-spacing: 0.08em; color: var(--yellow); background: var(--yellow-bg); border: var(--border-width-default) solid var(--yellow-border); padding: 3px 8px; }
|
|
386
|
+
.quiz-question { font-size: 16px; font-weight: 600; margin-bottom: 16px; line-height: 1.5; }
|
|
387
|
+
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
|
|
388
|
+
.quiz-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--surface); border: var(--border-width-default) solid var(--border); cursor: pointer; text-align: left; font-family: inherit; font-size: 13px; }
|
|
389
|
+
.quiz-option:hover:not(.answered) { background: var(--surface2); box-shadow: var(--shadow-sm); }
|
|
390
|
+
.quiz-option.selected-correct { background: var(--green-bg); border-color: var(--green); cursor: default; }
|
|
391
|
+
.quiz-option.selected-wrong { background: var(--red-bg); border-color: var(--red); cursor: default; }
|
|
392
|
+
.quiz-option.answered { cursor: default; }
|
|
393
|
+
.quiz-option-key { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--text-faint); width: 18px; flex-shrink: 0; }
|
|
394
|
+
.quiz-option.selected-correct .quiz-option-key { color: var(--green); }
|
|
395
|
+
.quiz-option.selected-wrong .quiz-option-key { color: var(--red); }
|
|
396
|
+
.quiz-option-text { flex: 1; color: var(--text-dim); line-height: 1.5; }
|
|
397
|
+
.quiz-option-indicator { font-size: 12px; flex-shrink: 0; }
|
|
398
|
+
.quiz-option.selected-correct .quiz-option-indicator { color: var(--green); }
|
|
399
|
+
.quiz-option.selected-wrong .quiz-option-indicator { color: var(--red); }
|
|
400
|
+
.quiz-explanation { margin-top: 12px; padding: 10px 14px; background: var(--accent-bg); border: var(--border-width-default) solid var(--accent-border); color: var(--accent); font-size: 13px; display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
|
|
401
|
+
.quiz-score { text-align: center; padding: 20px; border: var(--border-width-default) solid var(--green); background: var(--green-bg); }
|
|
402
|
+
.quiz-score-value { font-size: 28px; font-weight: 700; font-family: var(--font-mono); color: var(--green); }
|
|
403
|
+
.quiz-score-label { font-size: 11px; font-family: var(--font-mono); color: var(--green); text-transform: uppercase; letter-spacing: 0.08em; }
|
|
404
|
+
|
|
405
|
+
/* Empty state */
|
|
406
|
+
.lesson-empty { color: var(--text-faint); font-size: 13px; text-align: center; padding: 48px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
|
|
407
|
+
|
|
408
|
+
/* Footer */
|
|
409
|
+
.lesson-footer { margin-top: 40px; padding-top: 24px; border-top: var(--border-width-default) solid var(--border); }
|
|
410
|
+
.lesson-complete-row { margin-bottom: 20px; }
|
|
411
|
+
.lesson-complete-btn { padding: 10px 20px; background: var(--accent); color: var(--color-text-inverse); border: var(--border-width-default) solid var(--border); font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--shadow-md); }
|
|
412
|
+
.lesson-complete-btn:hover { box-shadow: var(--shadow-sm); transform: translate(1px, 1px); }
|
|
413
|
+
.lesson-complete-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
414
|
+
.lesson-completed-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 14px; font-weight: 600; }
|
|
415
|
+
|
|
416
|
+
.lesson-nav-footer { display: flex; justify-content: space-between; gap: 16px; }
|
|
417
|
+
.lesson-nav-btn { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border: var(--border-width-default) solid var(--border); background: var(--surface); text-decoration: none; max-width: 48%; box-shadow: var(--shadow-md); transition: box-shadow 0.15s, transform 0.15s; }
|
|
418
|
+
.lesson-nav-btn:hover { box-shadow: var(--shadow-sm); transform: translate(1px, 1px); }
|
|
419
|
+
.lesson-nav-prev { align-items: flex-start; }
|
|
420
|
+
.lesson-nav-next { align-items: flex-end; margin-left: auto; }
|
|
421
|
+
.lesson-nav-btn-label { font-size: 10px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); display: flex; align-items: center; gap: 4px; }
|
|
422
|
+
.lesson-nav-btn-title { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
423
|
+
|
|
424
|
+
.lesson-not-found { text-align: center; padding: 64px 0; color: var(--text-dim); }
|
|
425
|
+
|
|
426
|
+
/* Responsive */
|
|
427
|
+
@media (max-width: 768px) {
|
|
428
|
+
.lesson-layout { grid-template-columns: 1fr; }
|
|
429
|
+
.lesson-sidebar { position: fixed; left: -280px; top: 51px; width: 280px; height: calc(100vh - 51px); z-index: 90; transition: left 0.2s ease; }
|
|
430
|
+
.lesson-sidebar.open { left: 0; box-shadow: var(--shadow-md); }
|
|
431
|
+
.lesson-mobile-toggle { display: flex; align-items: center; gap: 6px; }
|
|
432
|
+
.lesson-main { padding: 20px 16px 64px; }
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.lesson-linked-source { margin-top: 24px; padding-top: 16px; border-top: var(--border-width-default) solid var(--border); }
|
|
436
|
+
.lesson-linked-source-link { font-size: 11px; font-family: var(--font-mono); color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
|
|
437
|
+
.lesson-linked-source-link:hover { text-decoration: underline; }
|
|
438
|
+
</style>
|