@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,676 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Component } from 'vue';
|
|
3
|
+
definePageMeta({ layout: false, middleware: 'auth' });
|
|
4
|
+
|
|
5
|
+
const route = useRoute();
|
|
6
|
+
const contentType = computed(() => route.params.type as string);
|
|
7
|
+
const slug = computed(() => route.params.slug as string);
|
|
8
|
+
const isNew = ref(slug.value === 'new');
|
|
9
|
+
const showStarterForm = ref(isNew.value);
|
|
10
|
+
const starterSaving = ref(false);
|
|
11
|
+
|
|
12
|
+
useSeoMeta({
|
|
13
|
+
title: () => isNew.value ? `New ${contentType.value} — ${useSiteName()}` : `Edit — ${useSiteName()}`,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const title = ref('');
|
|
17
|
+
const hubFromQuery = (route.query.hub as string) || '';
|
|
18
|
+
const metadata = ref<Record<string, unknown>>({
|
|
19
|
+
description: '',
|
|
20
|
+
slug: '',
|
|
21
|
+
tags: [],
|
|
22
|
+
visibility: 'public',
|
|
23
|
+
coverImageUrl: '',
|
|
24
|
+
...(hubFromQuery ? { hubSlug: hubFromQuery } : {}),
|
|
25
|
+
});
|
|
26
|
+
const isDirty = ref(false);
|
|
27
|
+
const { extract: extractError } = useApiError();
|
|
28
|
+
const mode = ref<'write' | 'preview' | 'code'>('write');
|
|
29
|
+
const contentId = ref<string | null>(null);
|
|
30
|
+
|
|
31
|
+
// --- Block editor ---
|
|
32
|
+
const blockEditor = useBlockEditor();
|
|
33
|
+
|
|
34
|
+
// --- Content save composable ---
|
|
35
|
+
const {
|
|
36
|
+
saving,
|
|
37
|
+
error,
|
|
38
|
+
autoSaveStatus,
|
|
39
|
+
silentSave,
|
|
40
|
+
handlePublish: doPublish,
|
|
41
|
+
buildSaveBody,
|
|
42
|
+
cancelAutoSave,
|
|
43
|
+
initAutoSave,
|
|
44
|
+
cleanup,
|
|
45
|
+
} = useContentSave({
|
|
46
|
+
contentType,
|
|
47
|
+
title,
|
|
48
|
+
metadata,
|
|
49
|
+
isNew,
|
|
50
|
+
contentId,
|
|
51
|
+
isDirty,
|
|
52
|
+
getBlockTuples: () => blockEditor.toBlockTuples(),
|
|
53
|
+
extractError,
|
|
54
|
+
onAfterSave: syncBOM,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// --- Publish validation ---
|
|
58
|
+
const { errors: publishErrors, showErrors: showPublishErrors, validate, dismiss: dismissPublishErrors } = usePublishValidation({
|
|
59
|
+
title,
|
|
60
|
+
metadata,
|
|
61
|
+
getBlockTuples: () => blockEditor.toBlockTuples(),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// --- Specialized editor component map ---
|
|
65
|
+
const editorMap: Record<string, Component> = {
|
|
66
|
+
article: resolveComponent('EditorsArticleEditor') as Component,
|
|
67
|
+
blog: resolveComponent('EditorsBlogEditor') as Component,
|
|
68
|
+
explainer: resolveComponent('EditorsExplainerEditor') as Component,
|
|
69
|
+
project: resolveComponent('EditorsProjectEditor') as Component,
|
|
70
|
+
};
|
|
71
|
+
const editorComponent = computed<Component | null>(() => editorMap[contentType.value] ?? null);
|
|
72
|
+
const hasSpecializedEditor = computed(() => editorComponent.value !== null);
|
|
73
|
+
|
|
74
|
+
// --- Load existing content ---
|
|
75
|
+
const requestHeaders = import.meta.server ? useRequestHeaders(['cookie']) : {};
|
|
76
|
+
if (!isNew.value) {
|
|
77
|
+
const { data } = await useFetch(() => `/api/content/${slug.value}`, { headers: requestHeaders });
|
|
78
|
+
if (data.value) {
|
|
79
|
+
const d = data.value as Record<string, unknown>;
|
|
80
|
+
contentId.value = d.id as string;
|
|
81
|
+
title.value = d.title as string;
|
|
82
|
+
if (Array.isArray(d.content)) {
|
|
83
|
+
blockEditor.fromBlockTuples(d.content as [string, Record<string, unknown>][]);
|
|
84
|
+
}
|
|
85
|
+
metadata.value = {
|
|
86
|
+
description: (d.description as string) || '',
|
|
87
|
+
slug: (d.slug as string) || '',
|
|
88
|
+
tags: d.tags ? (d.tags as { name: string }[]).map((t) => t.name) : [],
|
|
89
|
+
visibility: (d.visibility as string) || 'public',
|
|
90
|
+
coverImageUrl: (d.coverImageUrl as string) || '',
|
|
91
|
+
seoDescription: (d.seoDescription as string) || '',
|
|
92
|
+
difficulty: (d.difficulty as string) || '',
|
|
93
|
+
buildTime: (d.buildTime as string) || '',
|
|
94
|
+
estimatedCost: (d.estimatedCost as string) || '',
|
|
95
|
+
estimatedMinutes: (d.estimatedMinutes as number) || undefined,
|
|
96
|
+
licenseType: (d.licenseType as string) || '',
|
|
97
|
+
series: (d.series as string) || '',
|
|
98
|
+
category: (d.category as string) || '',
|
|
99
|
+
subtitle: (d.subtitle as string) || '',
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// --- Auto-generate slug from title ---
|
|
105
|
+
const slugManuallyEdited = ref(false);
|
|
106
|
+
function slugify(text: string): string {
|
|
107
|
+
return text.toLowerCase().replace(/[^\w\s-]/g, '').replace(/\s+/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '').slice(0, 128);
|
|
108
|
+
}
|
|
109
|
+
watch(title, (newTitle) => {
|
|
110
|
+
if (!slugManuallyEdited.value && isNew.value) {
|
|
111
|
+
metadata.value = { ...metadata.value, slug: slugify(newTitle) };
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// --- Dirty tracking + autosave ---
|
|
116
|
+
watch(() => blockEditor.blocks.value, () => { isDirty.value = true; }, { deep: true });
|
|
117
|
+
initAutoSave([() => blockEditor.blocks.value, title, metadata]);
|
|
118
|
+
|
|
119
|
+
function handleMetadataUpdate(newMetadata: Record<string, unknown>): void {
|
|
120
|
+
if (newMetadata.title !== undefined && typeof newMetadata.title === 'string') {
|
|
121
|
+
title.value = newMetadata.title;
|
|
122
|
+
delete newMetadata.title;
|
|
123
|
+
}
|
|
124
|
+
metadata.value = newMetadata;
|
|
125
|
+
isDirty.value = true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// --- BOM sync ---
|
|
129
|
+
async function syncBOM(id: string): Promise<void> {
|
|
130
|
+
const blocks = blockEditor.toBlockTuples();
|
|
131
|
+
const productItems: Array<{ productId: string; quantity: number; notes?: string }> = [];
|
|
132
|
+
for (const [type, content] of blocks) {
|
|
133
|
+
if (type === 'partsList' && Array.isArray(content.parts)) {
|
|
134
|
+
for (const part of content.parts as Array<{ productId?: string; qty?: number; notes?: string }>) {
|
|
135
|
+
if (part.productId) {
|
|
136
|
+
productItems.push({ productId: part.productId, quantity: part.qty ?? 1, notes: part.notes });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (productItems.length > 0 || contentType.value === 'project') {
|
|
142
|
+
await $fetch(`/api/content/${id}/products-sync`, { method: 'POST', body: { items: productItems } }).catch(() => {});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// --- Starter form submit ---
|
|
147
|
+
async function handleStarterSubmit(): Promise<void> {
|
|
148
|
+
if (!title.value.trim()) { error.value = 'Title is required'; return; }
|
|
149
|
+
starterSaving.value = true;
|
|
150
|
+
error.value = '';
|
|
151
|
+
try {
|
|
152
|
+
const body = buildSaveBody();
|
|
153
|
+
const result = await $fetch<{ id: string; slug: string }>('/api/content', { method: 'POST', body });
|
|
154
|
+
contentId.value = result.id;
|
|
155
|
+
isNew.value = false;
|
|
156
|
+
isDirty.value = false;
|
|
157
|
+
showStarterForm.value = false;
|
|
158
|
+
history.replaceState({}, '', `/${contentType.value}/${result.slug}/edit`);
|
|
159
|
+
} catch (err: unknown) {
|
|
160
|
+
error.value = extractError(err);
|
|
161
|
+
} finally {
|
|
162
|
+
starterSaving.value = false;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// --- Publish with validation ---
|
|
167
|
+
async function handlePublish(): Promise<void> {
|
|
168
|
+
await doPublish(validate);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// --- Preview mode ---
|
|
172
|
+
function enterPreview(): void {
|
|
173
|
+
mode.value = 'preview';
|
|
174
|
+
if (isDirty.value && title.value && !saving.value && !isNew.value && contentId.value) {
|
|
175
|
+
cancelAutoSave();
|
|
176
|
+
silentSave();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// --- Keyboard shortcuts ---
|
|
181
|
+
function onKeydown(event: KeyboardEvent): void {
|
|
182
|
+
if ((event.metaKey || event.ctrlKey) && event.key === 's') {
|
|
183
|
+
event.preventDefault();
|
|
184
|
+
cancelAutoSave();
|
|
185
|
+
silentSave();
|
|
186
|
+
}
|
|
187
|
+
if (event.key === 'Escape' && mode.value === 'preview' && contentType.value === 'explainer') {
|
|
188
|
+
mode.value = 'write';
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
onMounted(() => { document.addEventListener('keydown', onKeydown); });
|
|
193
|
+
onUnmounted(() => { document.removeEventListener('keydown', onKeydown); cleanup(); });
|
|
194
|
+
|
|
195
|
+
// --- Warn before unload ---
|
|
196
|
+
function onBeforeUnload(event: BeforeUnloadEvent): void {
|
|
197
|
+
if (isDirty.value) event.preventDefault();
|
|
198
|
+
}
|
|
199
|
+
if (import.meta.client) {
|
|
200
|
+
onMounted(() => { window.addEventListener('beforeunload', onBeforeUnload); });
|
|
201
|
+
onUnmounted(() => { window.removeEventListener('beforeunload', onBeforeUnload); });
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// --- Markdown import ---
|
|
205
|
+
const showImportDialog = ref(false);
|
|
206
|
+
const { importing, importMarkdown } = useMarkdownImport(blockEditor);
|
|
207
|
+
|
|
208
|
+
async function handleMarkdownImport(md: string, importMode: 'append' | 'replace'): Promise<void> {
|
|
209
|
+
await importMarkdown(md, importMode);
|
|
210
|
+
isDirty.value = true;
|
|
211
|
+
}
|
|
212
|
+
</script>
|
|
213
|
+
|
|
214
|
+
<template>
|
|
215
|
+
<!-- Starter form for new content -->
|
|
216
|
+
<ContentStarterForm
|
|
217
|
+
v-if="showStarterForm"
|
|
218
|
+
:content-type="contentType"
|
|
219
|
+
:title="title"
|
|
220
|
+
:metadata="metadata"
|
|
221
|
+
:saving="starterSaving"
|
|
222
|
+
:error="error"
|
|
223
|
+
@update:title="title = $event"
|
|
224
|
+
@update:metadata="metadata = $event"
|
|
225
|
+
@submit="handleStarterSubmit"
|
|
226
|
+
/>
|
|
227
|
+
|
|
228
|
+
<!-- Main editor -->
|
|
229
|
+
<div v-else class="cpub-editor-layout">
|
|
230
|
+
<PublishErrorsModal :errors="publishErrors" :show="showPublishErrors" @dismiss="dismissPublishErrors" />
|
|
231
|
+
<EditorsMarkdownImportDialog :show="showImportDialog" @close="showImportDialog = false" @import="handleMarkdownImport" />
|
|
232
|
+
<!-- Top bar -->
|
|
233
|
+
<header class="cpub-editor-topbar">
|
|
234
|
+
<NuxtLink to="/" class="cpub-editor-logo" aria-label="Home">
|
|
235
|
+
<span class="cpub-logo-accent">[</span>cpub<span class="cpub-logo-accent">]</span>
|
|
236
|
+
</NuxtLink>
|
|
237
|
+
<button class="cpub-editor-back" aria-label="Go back" @click="$router.back()">
|
|
238
|
+
<i class="fa-solid fa-arrow-left"></i>
|
|
239
|
+
</button>
|
|
240
|
+
<div class="cpub-topbar-divider" aria-hidden="true" />
|
|
241
|
+
<div class="cpub-topbar-title-wrap">
|
|
242
|
+
<input
|
|
243
|
+
v-model="title"
|
|
244
|
+
type="text"
|
|
245
|
+
class="cpub-topbar-title-input"
|
|
246
|
+
:placeholder="`Untitled ${contentType}...`"
|
|
247
|
+
aria-label="Content title"
|
|
248
|
+
/>
|
|
249
|
+
<span v-if="isDirty" class="cpub-unsaved-dot" title="Unsaved changes" />
|
|
250
|
+
<span v-if="autoSaveStatus === 'saving'" class="cpub-autosave-status">
|
|
251
|
+
<i class="fa-solid fa-circle-notch fa-spin"></i> Saving...
|
|
252
|
+
</span>
|
|
253
|
+
<span v-else-if="autoSaveStatus === 'saved'" class="cpub-autosave-status cpub-autosave-status--saved">
|
|
254
|
+
<i class="fa-solid fa-check"></i> Saved
|
|
255
|
+
</span>
|
|
256
|
+
<span v-else-if="autoSaveStatus === 'error'" class="cpub-autosave-status cpub-autosave-status--error">
|
|
257
|
+
<i class="fa-solid fa-exclamation-triangle"></i> Save failed
|
|
258
|
+
</span>
|
|
259
|
+
</div>
|
|
260
|
+
<div class="cpub-mode-tabs">
|
|
261
|
+
<button :class="['cpub-mode-tab', { active: mode === 'write' }]" @click="mode = 'write'">Write</button>
|
|
262
|
+
<button :class="['cpub-mode-tab', { active: mode === 'preview' }]" @click="enterPreview">Preview</button>
|
|
263
|
+
<button :class="['cpub-mode-tab', { active: mode === 'code' }]" @click="mode = 'code'">Code</button>
|
|
264
|
+
</div>
|
|
265
|
+
<div class="cpub-topbar-spacer" />
|
|
266
|
+
<div class="cpub-topbar-actions">
|
|
267
|
+
<button class="cpub-topbar-btn cpub-topbar-btn-import" :disabled="importing" @click="showImportDialog = true" title="Import Markdown">
|
|
268
|
+
<i class="fa-brands fa-markdown"></i> <span class="cpub-import-label">Import</span>
|
|
269
|
+
</button>
|
|
270
|
+
<button class="cpub-topbar-btn" :disabled="saving || !title" @click="silentSave">
|
|
271
|
+
{{ saving ? 'Saving...' : 'Save Draft' }}
|
|
272
|
+
</button>
|
|
273
|
+
<button class="cpub-topbar-btn cpub-topbar-btn-primary" :disabled="saving || !title" @click="handlePublish">
|
|
274
|
+
Publish
|
|
275
|
+
</button>
|
|
276
|
+
</div>
|
|
277
|
+
</header>
|
|
278
|
+
|
|
279
|
+
<div v-if="error" class="cpub-editor-error" role="alert">{{ error }}</div>
|
|
280
|
+
|
|
281
|
+
<!-- Write mode with specialized editor -->
|
|
282
|
+
<template v-if="mode === 'write' && hasSpecializedEditor">
|
|
283
|
+
<component
|
|
284
|
+
:is="editorComponent"
|
|
285
|
+
:block-editor="blockEditor"
|
|
286
|
+
:metadata="{ ...metadata, title: title }"
|
|
287
|
+
@update:metadata="handleMetadataUpdate"
|
|
288
|
+
/>
|
|
289
|
+
</template>
|
|
290
|
+
|
|
291
|
+
<!-- Write mode — fallback generic editor -->
|
|
292
|
+
<div v-else-if="mode === 'write'" class="cpub-editor-shell">
|
|
293
|
+
<div class="cpub-editor-canvas">
|
|
294
|
+
<EditorsBlockCanvas :block-editor="blockEditor" :block-types="[]" />
|
|
295
|
+
</div>
|
|
296
|
+
</div>
|
|
297
|
+
|
|
298
|
+
<!-- Preview mode: Generic (explainer also matches here as a hidden placeholder; actual preview is in the Teleport overlay below) -->
|
|
299
|
+
<div v-else-if="mode === 'preview'" class="cpub-editor-shell" :class="{ 'cpub-hidden': contentType === 'explainer' }">
|
|
300
|
+
<div class="cpub-preview-canvas">
|
|
301
|
+
<h1 class="cpub-preview-title">{{ title || 'Untitled' }}</h1>
|
|
302
|
+
<p v-if="metadata.description" class="cpub-preview-desc">{{ metadata.description }}</p>
|
|
303
|
+
<div class="cpub-preview-blocks">
|
|
304
|
+
<BlocksBlockContentRenderer :blocks="blockEditor.toBlockTuples()" />
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
<!-- Code mode -->
|
|
310
|
+
<div v-else class="cpub-editor-shell">
|
|
311
|
+
<div class="cpub-code-canvas">
|
|
312
|
+
<pre class="cpub-code-view">{{ JSON.stringify(blockEditor.toBlockTuples(), null, 2) }}</pre>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
<!-- Explainer preview: full-screen overlay (outside v-if chain, uses Teleport) -->
|
|
317
|
+
<Teleport to="body">
|
|
318
|
+
<div v-if="mode === 'preview' && contentType === 'explainer'" class="cpub-explainer-preview-overlay">
|
|
319
|
+
<button class="cpub-preview-close-btn" @click="mode = 'write'" aria-label="Close preview">
|
|
320
|
+
<i class="fa-solid fa-xmark"></i>
|
|
321
|
+
<span>Back to Editor</span>
|
|
322
|
+
</button>
|
|
323
|
+
<ViewsExplainerView
|
|
324
|
+
:content="{
|
|
325
|
+
id: contentId || 'preview',
|
|
326
|
+
type: 'explainer',
|
|
327
|
+
title: title || 'Untitled',
|
|
328
|
+
slug: (metadata.slug as string) || 'preview',
|
|
329
|
+
subtitle: null,
|
|
330
|
+
description: (metadata.description as string) || null,
|
|
331
|
+
content: blockEditor.toBlockTuples(),
|
|
332
|
+
coverImageUrl: (metadata.coverImageUrl as string) || null,
|
|
333
|
+
category: null,
|
|
334
|
+
difficulty: (metadata.difficulty as string) || null,
|
|
335
|
+
buildTime: null,
|
|
336
|
+
estimatedCost: null,
|
|
337
|
+
status: 'draft',
|
|
338
|
+
visibility: (metadata.visibility as string) || 'public',
|
|
339
|
+
isFeatured: false,
|
|
340
|
+
seoDescription: null,
|
|
341
|
+
previewToken: null,
|
|
342
|
+
parts: null,
|
|
343
|
+
sections: null,
|
|
344
|
+
viewCount: 0,
|
|
345
|
+
likeCount: 0,
|
|
346
|
+
commentCount: 0,
|
|
347
|
+
forkCount: 0,
|
|
348
|
+
publishedAt: null,
|
|
349
|
+
createdAt: new Date().toISOString(),
|
|
350
|
+
updatedAt: new Date().toISOString(),
|
|
351
|
+
licenseType: null,
|
|
352
|
+
series: null,
|
|
353
|
+
estimatedMinutes: null,
|
|
354
|
+
tags: [],
|
|
355
|
+
author: { id: '', username: '', displayName: null, avatarUrl: null },
|
|
356
|
+
}"
|
|
357
|
+
/>
|
|
358
|
+
</div>
|
|
359
|
+
</Teleport>
|
|
360
|
+
</div>
|
|
361
|
+
</template>
|
|
362
|
+
|
|
363
|
+
<style scoped>
|
|
364
|
+
.cpub-editor-layout {
|
|
365
|
+
display: flex;
|
|
366
|
+
flex-direction: column;
|
|
367
|
+
height: 100vh;
|
|
368
|
+
overflow: hidden;
|
|
369
|
+
background: var(--bg);
|
|
370
|
+
color: var(--text);
|
|
371
|
+
font-family: var(--font-sans);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.cpub-editor-topbar {
|
|
375
|
+
height: 48px;
|
|
376
|
+
background: var(--surface);
|
|
377
|
+
border-bottom: var(--border-width-default) solid var(--border);
|
|
378
|
+
display: flex;
|
|
379
|
+
align-items: center;
|
|
380
|
+
padding: 0 16px;
|
|
381
|
+
gap: 0;
|
|
382
|
+
flex-shrink: 0;
|
|
383
|
+
z-index: 100;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.cpub-editor-logo {
|
|
387
|
+
font-family: var(--font-mono);
|
|
388
|
+
font-size: 12px;
|
|
389
|
+
font-weight: 700;
|
|
390
|
+
color: var(--text-dim);
|
|
391
|
+
letter-spacing: 0.06em;
|
|
392
|
+
text-decoration: none;
|
|
393
|
+
flex-shrink: 0;
|
|
394
|
+
}
|
|
395
|
+
.cpub-logo-accent { color: var(--accent); }
|
|
396
|
+
|
|
397
|
+
.cpub-editor-back {
|
|
398
|
+
width: 30px; height: 30px;
|
|
399
|
+
background: none;
|
|
400
|
+
border: var(--border-width-default) solid transparent;
|
|
401
|
+
color: var(--text-dim);
|
|
402
|
+
cursor: pointer;
|
|
403
|
+
display: flex; align-items: center; justify-content: center;
|
|
404
|
+
font-size: 12px;
|
|
405
|
+
margin-left: 6px;
|
|
406
|
+
flex-shrink: 0;
|
|
407
|
+
}
|
|
408
|
+
.cpub-editor-back:hover { background: var(--surface2); border-color: var(--border2); color: var(--text); }
|
|
409
|
+
|
|
410
|
+
.cpub-topbar-divider {
|
|
411
|
+
width: 2px; height: 22px;
|
|
412
|
+
background: var(--border);
|
|
413
|
+
margin: 0 12px;
|
|
414
|
+
flex-shrink: 0;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.cpub-topbar-title-wrap {
|
|
418
|
+
display: flex;
|
|
419
|
+
align-items: center;
|
|
420
|
+
gap: 8px;
|
|
421
|
+
flex: 1;
|
|
422
|
+
min-width: 0;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.cpub-topbar-title-input {
|
|
426
|
+
font-size: 13px;
|
|
427
|
+
font-weight: 500;
|
|
428
|
+
color: var(--text);
|
|
429
|
+
background: none;
|
|
430
|
+
border: var(--border-width-default) solid transparent;
|
|
431
|
+
padding: 4px 8px;
|
|
432
|
+
cursor: text;
|
|
433
|
+
white-space: nowrap;
|
|
434
|
+
overflow: hidden;
|
|
435
|
+
text-overflow: ellipsis;
|
|
436
|
+
max-width: 380px;
|
|
437
|
+
outline: none;
|
|
438
|
+
font-family: var(--font-sans, system-ui);
|
|
439
|
+
}
|
|
440
|
+
.cpub-topbar-title-input:hover { border-color: var(--border2); background: var(--surface2); }
|
|
441
|
+
.cpub-topbar-title-input:focus { border-color: var(--accent); background: var(--surface2); }
|
|
442
|
+
|
|
443
|
+
.cpub-unsaved-dot {
|
|
444
|
+
width: 8px; height: 8px;
|
|
445
|
+
border-radius: 50%;
|
|
446
|
+
background: var(--yellow);
|
|
447
|
+
flex-shrink: 0;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.cpub-autosave-status {
|
|
451
|
+
font-family: var(--font-mono);
|
|
452
|
+
font-size: 10px;
|
|
453
|
+
color: var(--text-faint);
|
|
454
|
+
display: flex;
|
|
455
|
+
align-items: center;
|
|
456
|
+
gap: 4px;
|
|
457
|
+
flex-shrink: 0;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.cpub-autosave-status--saved {
|
|
461
|
+
color: var(--green);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.cpub-autosave-status--error {
|
|
465
|
+
color: var(--red);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.cpub-mode-tabs {
|
|
469
|
+
display: flex;
|
|
470
|
+
background: var(--surface2);
|
|
471
|
+
border: var(--border-width-default) solid var(--border);
|
|
472
|
+
padding: 2px;
|
|
473
|
+
flex-shrink: 0;
|
|
474
|
+
margin: 0 10px;
|
|
475
|
+
}
|
|
476
|
+
.cpub-mode-tab {
|
|
477
|
+
font-family: var(--font-mono);
|
|
478
|
+
font-size: 10px;
|
|
479
|
+
font-weight: 600;
|
|
480
|
+
letter-spacing: 0.06em;
|
|
481
|
+
text-transform: uppercase;
|
|
482
|
+
padding: 5px 14px;
|
|
483
|
+
border: none;
|
|
484
|
+
background: none;
|
|
485
|
+
color: var(--text-dim);
|
|
486
|
+
cursor: pointer;
|
|
487
|
+
}
|
|
488
|
+
.cpub-mode-tab.active {
|
|
489
|
+
background: var(--surface);
|
|
490
|
+
color: var(--text);
|
|
491
|
+
box-shadow: var(--shadow-sm);
|
|
492
|
+
}
|
|
493
|
+
.cpub-mode-tab:hover:not(.active) { color: var(--text); }
|
|
494
|
+
|
|
495
|
+
.cpub-topbar-spacer { flex: 1; }
|
|
496
|
+
|
|
497
|
+
.cpub-topbar-actions {
|
|
498
|
+
display: flex;
|
|
499
|
+
align-items: center;
|
|
500
|
+
gap: 8px;
|
|
501
|
+
flex-shrink: 0;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.cpub-topbar-btn {
|
|
505
|
+
font-family: var(--font-sans, system-ui);
|
|
506
|
+
font-size: 12px;
|
|
507
|
+
padding: 6px 14px;
|
|
508
|
+
border: var(--border-width-default) solid var(--border);
|
|
509
|
+
background: var(--surface);
|
|
510
|
+
color: var(--text);
|
|
511
|
+
cursor: pointer;
|
|
512
|
+
}
|
|
513
|
+
.cpub-topbar-btn:hover { background: var(--surface2); }
|
|
514
|
+
.cpub-topbar-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
515
|
+
.cpub-topbar-btn-primary {
|
|
516
|
+
background: var(--accent);
|
|
517
|
+
color: var(--color-text-inverse);
|
|
518
|
+
font-weight: 600;
|
|
519
|
+
box-shadow: var(--shadow-md);
|
|
520
|
+
}
|
|
521
|
+
.cpub-topbar-btn-primary:hover { box-shadow: var(--shadow-sm); }
|
|
522
|
+
.cpub-topbar-btn-import { border-color: var(--teal); color: var(--teal); }
|
|
523
|
+
.cpub-topbar-btn-import:hover { background: var(--teal-bg, var(--surface2)); }
|
|
524
|
+
|
|
525
|
+
.cpub-editor-error {
|
|
526
|
+
padding: 10px 16px;
|
|
527
|
+
background: var(--red-bg);
|
|
528
|
+
color: var(--red);
|
|
529
|
+
border-bottom: var(--border-width-default) solid var(--red);
|
|
530
|
+
font-size: 12px;
|
|
531
|
+
font-family: var(--font-mono);
|
|
532
|
+
display: flex;
|
|
533
|
+
align-items: center;
|
|
534
|
+
gap: 8px;
|
|
535
|
+
z-index: 99;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.cpub-editor-shell {
|
|
539
|
+
display: flex;
|
|
540
|
+
flex: 1;
|
|
541
|
+
overflow: hidden;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
.cpub-editor-canvas {
|
|
545
|
+
flex: 1;
|
|
546
|
+
overflow-y: auto;
|
|
547
|
+
padding: 24px;
|
|
548
|
+
background: var(--bg);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
.cpub-preview-canvas {
|
|
552
|
+
flex: 1;
|
|
553
|
+
overflow-y: auto;
|
|
554
|
+
padding: 48px;
|
|
555
|
+
max-width: 740px;
|
|
556
|
+
margin: 0 auto;
|
|
557
|
+
}
|
|
558
|
+
.cpub-preview-title {
|
|
559
|
+
font-size: 28px;
|
|
560
|
+
font-weight: 700;
|
|
561
|
+
margin-bottom: 12px;
|
|
562
|
+
line-height: 1.25;
|
|
563
|
+
}
|
|
564
|
+
.cpub-preview-desc {
|
|
565
|
+
font-size: 15px;
|
|
566
|
+
color: var(--text-dim);
|
|
567
|
+
margin-bottom: 32px;
|
|
568
|
+
}
|
|
569
|
+
.cpub-preview-blocks {
|
|
570
|
+
display: flex;
|
|
571
|
+
flex-direction: column;
|
|
572
|
+
gap: 16px;
|
|
573
|
+
}
|
|
574
|
+
.cpub-preview-block {
|
|
575
|
+
font-size: 15px;
|
|
576
|
+
line-height: 1.75;
|
|
577
|
+
}
|
|
578
|
+
.cpub-preview-code {
|
|
579
|
+
background: var(--text);
|
|
580
|
+
color: var(--surface);
|
|
581
|
+
padding: 16px;
|
|
582
|
+
font-family: var(--font-mono);
|
|
583
|
+
font-size: 13px;
|
|
584
|
+
overflow-x: auto;
|
|
585
|
+
margin: 0;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.cpub-code-canvas {
|
|
589
|
+
flex: 1;
|
|
590
|
+
overflow: auto;
|
|
591
|
+
background: var(--text);
|
|
592
|
+
padding: 16px;
|
|
593
|
+
}
|
|
594
|
+
.cpub-code-view {
|
|
595
|
+
color: var(--border2);
|
|
596
|
+
font-family: var(--font-mono);
|
|
597
|
+
font-size: 12px;
|
|
598
|
+
white-space: pre-wrap;
|
|
599
|
+
margin: 0;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
.cpub-hidden {
|
|
603
|
+
display: none;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/* ── RESPONSIVE ── */
|
|
607
|
+
@media (max-width: 768px) {
|
|
608
|
+
.cpub-editor-topbar { padding: 0 10px; gap: 0; }
|
|
609
|
+
.cpub-editor-logo { display: none; }
|
|
610
|
+
.cpub-topbar-divider { display: none; }
|
|
611
|
+
.cpub-editor-back { margin-left: 0; }
|
|
612
|
+
.cpub-topbar-title-input { max-width: none; font-size: 12px; padding: 3px 6px; }
|
|
613
|
+
.cpub-autosave-status { display: none; }
|
|
614
|
+
.cpub-mode-tabs { margin: 0 6px; padding: 1px; }
|
|
615
|
+
.cpub-mode-tab { padding: 4px 10px; font-size: 10px; }
|
|
616
|
+
.cpub-topbar-spacer { display: none; }
|
|
617
|
+
.cpub-topbar-actions { gap: 4px; }
|
|
618
|
+
.cpub-topbar-btn { font-size: 11px; padding: 8px 10px; min-height: 36px; }
|
|
619
|
+
.cpub-import-label { display: none; }
|
|
620
|
+
.cpub-editor-canvas { padding: 12px; }
|
|
621
|
+
.cpub-preview-canvas { padding: 16px; }
|
|
622
|
+
.cpub-preview-title { font-size: 22px; }
|
|
623
|
+
.cpub-code-canvas { padding: 10px; }
|
|
624
|
+
.cpub-code-view { font-size: 11px; }
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
@media (max-width: 480px) {
|
|
628
|
+
.cpub-mode-tabs { margin: 0 4px; }
|
|
629
|
+
.cpub-mode-tab { padding: 4px 8px; font-size: 9px; }
|
|
630
|
+
.cpub-topbar-btn { padding: 6px 8px; font-size: 10px; min-height: 34px; }
|
|
631
|
+
.cpub-editor-back { width: 34px; height: 34px; }
|
|
632
|
+
.cpub-preview-title { font-size: 18px; }
|
|
633
|
+
}
|
|
634
|
+
</style>
|
|
635
|
+
|
|
636
|
+
<style>
|
|
637
|
+
/* Unscoped so Teleport overlay works */
|
|
638
|
+
.cpub-explainer-preview-overlay {
|
|
639
|
+
position: fixed;
|
|
640
|
+
inset: 0;
|
|
641
|
+
z-index: 9999;
|
|
642
|
+
background: var(--bg);
|
|
643
|
+
overflow: hidden;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.cpub-preview-close-btn {
|
|
647
|
+
position: fixed;
|
|
648
|
+
top: 10px;
|
|
649
|
+
right: 16px;
|
|
650
|
+
z-index: 10001;
|
|
651
|
+
display: flex;
|
|
652
|
+
align-items: center;
|
|
653
|
+
gap: 6px;
|
|
654
|
+
padding: 6px 14px;
|
|
655
|
+
background: var(--surface);
|
|
656
|
+
border: var(--border-width-default) solid var(--border);
|
|
657
|
+
color: var(--text);
|
|
658
|
+
font-family: var(--font-mono);
|
|
659
|
+
font-size: 11px;
|
|
660
|
+
font-weight: 600;
|
|
661
|
+
letter-spacing: 0.04em;
|
|
662
|
+
cursor: pointer;
|
|
663
|
+
box-shadow: var(--shadow-md);
|
|
664
|
+
transition: box-shadow 0.1s, transform 0.1s;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.cpub-preview-close-btn:hover {
|
|
668
|
+
box-shadow: var(--shadow-sm);
|
|
669
|
+
transform: translate(1px, 1px);
|
|
670
|
+
background: var(--surface2);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.cpub-preview-close-btn i {
|
|
674
|
+
font-size: 12px;
|
|
675
|
+
}
|
|
676
|
+
</style>
|