@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,126 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface FileItem {
|
|
3
|
+
name: string;
|
|
4
|
+
url: string;
|
|
5
|
+
size?: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{ content: Record<string, unknown> }>();
|
|
10
|
+
|
|
11
|
+
const files = computed<FileItem[]>(() => {
|
|
12
|
+
const raw = props.content.files;
|
|
13
|
+
if (!Array.isArray(raw)) return [];
|
|
14
|
+
return raw as FileItem[];
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<div v-if="files.length > 0" class="cpub-block-downloads">
|
|
20
|
+
<div class="cpub-dl-header">
|
|
21
|
+
<i class="fa-solid fa-download cpub-dl-icon"></i>
|
|
22
|
+
<span class="cpub-dl-title">Downloads</span>
|
|
23
|
+
<span class="cpub-dl-count">{{ files.length }} file{{ files.length !== 1 ? 's' : '' }}</span>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="cpub-dl-list">
|
|
26
|
+
<div v-for="(file, i) in files" :key="i" class="cpub-dl-item">
|
|
27
|
+
<div class="cpub-dl-file-icon"><i class="fa-solid fa-file-arrow-down"></i></div>
|
|
28
|
+
<div class="cpub-dl-info">
|
|
29
|
+
<a :href="file.url" class="cpub-dl-name" download>{{ file.name }}</a>
|
|
30
|
+
<span v-if="file.size" class="cpub-dl-size">{{ file.size }}</span>
|
|
31
|
+
</div>
|
|
32
|
+
<a :href="file.url" class="cpub-dl-btn" download aria-label="Download">
|
|
33
|
+
<i class="fa-solid fa-download"></i>
|
|
34
|
+
</a>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<style scoped>
|
|
41
|
+
.cpub-block-downloads {
|
|
42
|
+
border: var(--border-width-default) solid var(--border);
|
|
43
|
+
margin: 20px 0;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
box-shadow: var(--shadow-md);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.cpub-dl-header {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
padding: 10px 14px;
|
|
53
|
+
background: var(--surface2);
|
|
54
|
+
border-bottom: var(--border-width-default) solid var(--border);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.cpub-dl-icon { font-size: 12px; color: var(--accent); }
|
|
58
|
+
.cpub-dl-title { font-size: 12px; font-weight: 600; color: var(--text); flex: 1; }
|
|
59
|
+
.cpub-dl-count { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
|
|
60
|
+
|
|
61
|
+
.cpub-dl-list { display: flex; flex-direction: column; }
|
|
62
|
+
|
|
63
|
+
.cpub-dl-item {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 12px;
|
|
67
|
+
padding: 10px 14px;
|
|
68
|
+
border-bottom: var(--border-width-default) solid var(--border2);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.cpub-dl-item:last-child { border-bottom: none; }
|
|
72
|
+
|
|
73
|
+
.cpub-dl-file-icon {
|
|
74
|
+
width: 32px;
|
|
75
|
+
height: 32px;
|
|
76
|
+
background: var(--surface2);
|
|
77
|
+
border: var(--border-width-default) solid var(--border2);
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
font-size: 12px;
|
|
82
|
+
color: var(--text-faint);
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.cpub-dl-info { flex: 1; min-width: 0; }
|
|
87
|
+
|
|
88
|
+
.cpub-dl-name {
|
|
89
|
+
font-size: 13px;
|
|
90
|
+
font-weight: 500;
|
|
91
|
+
color: var(--accent);
|
|
92
|
+
text-decoration: none;
|
|
93
|
+
display: block;
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
text-overflow: ellipsis;
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.cpub-dl-name:hover { text-decoration: underline; }
|
|
100
|
+
|
|
101
|
+
.cpub-dl-size {
|
|
102
|
+
font-family: var(--font-mono);
|
|
103
|
+
font-size: 10px;
|
|
104
|
+
color: var(--text-faint);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.cpub-dl-btn {
|
|
108
|
+
width: 32px;
|
|
109
|
+
height: 32px;
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
background: var(--accent-bg);
|
|
114
|
+
border: var(--border-width-default) solid var(--accent-border);
|
|
115
|
+
color: var(--accent);
|
|
116
|
+
font-size: 12px;
|
|
117
|
+
text-decoration: none;
|
|
118
|
+
flex-shrink: 0;
|
|
119
|
+
transition: background var(--transition-fast), color var(--transition-fast);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.cpub-dl-btn:hover {
|
|
123
|
+
background: var(--accent);
|
|
124
|
+
color: var(--color-text-inverse);
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{ content: Record<string, unknown> }>();
|
|
3
|
+
|
|
4
|
+
const url = computed(() => {
|
|
5
|
+
const raw = (props.content.url as string) || '';
|
|
6
|
+
// Only allow http/https URLs — block javascript:, data:, etc.
|
|
7
|
+
if (raw && (raw.startsWith('https://') || raw.startsWith('http://'))) return raw;
|
|
8
|
+
return '';
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div v-if="url" class="cpub-block-embed">
|
|
14
|
+
<div class="cpub-embed-label">
|
|
15
|
+
<i class="fa-solid fa-globe"></i> Embed
|
|
16
|
+
</div>
|
|
17
|
+
<div class="cpub-embed-wrap">
|
|
18
|
+
<iframe :src="url" class="cpub-embed-iframe" frameborder="0" loading="lazy" title="Embedded content" />
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<style scoped>
|
|
24
|
+
.cpub-block-embed {
|
|
25
|
+
margin: 24px 0;
|
|
26
|
+
border: var(--border-width-default) solid var(--border);
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
box-shadow: var(--shadow-md);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.cpub-embed-label {
|
|
32
|
+
padding: 6px 12px;
|
|
33
|
+
font-family: var(--font-mono);
|
|
34
|
+
font-size: 10px;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
text-transform: uppercase;
|
|
37
|
+
letter-spacing: 0.06em;
|
|
38
|
+
color: var(--text-faint);
|
|
39
|
+
background: var(--surface2);
|
|
40
|
+
border-bottom: var(--border-width-default) solid var(--border);
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 6px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.cpub-embed-label i { color: var(--accent); }
|
|
47
|
+
|
|
48
|
+
.cpub-embed-wrap {
|
|
49
|
+
position: relative;
|
|
50
|
+
padding-bottom: 56.25%;
|
|
51
|
+
height: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.cpub-embed-iframe {
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 0;
|
|
57
|
+
left: 0;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface GalleryImage {
|
|
3
|
+
src: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
caption: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{ content: Record<string, unknown> }>();
|
|
9
|
+
|
|
10
|
+
const images = computed<GalleryImage[]>(() => {
|
|
11
|
+
const raw = props.content.images;
|
|
12
|
+
if (!Array.isArray(raw)) return [];
|
|
13
|
+
return raw as GalleryImage[];
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div v-if="images.length > 0" class="cpub-block-gallery">
|
|
19
|
+
<div class="cpub-gallery-grid">
|
|
20
|
+
<figure v-for="(img, idx) in images" :key="idx" class="cpub-gallery-item">
|
|
21
|
+
<img :src="img.src" :alt="img.alt" class="cpub-gallery-img" loading="lazy" />
|
|
22
|
+
<figcaption v-if="img.caption" class="cpub-gallery-caption">{{ img.caption }}</figcaption>
|
|
23
|
+
</figure>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<style scoped>
|
|
29
|
+
.cpub-block-gallery {
|
|
30
|
+
margin: 24px 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.cpub-gallery-grid {
|
|
34
|
+
display: grid;
|
|
35
|
+
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
36
|
+
gap: 8px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.cpub-gallery-item {
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.cpub-gallery-img {
|
|
44
|
+
width: 100%;
|
|
45
|
+
aspect-ratio: 4/3;
|
|
46
|
+
object-fit: cover;
|
|
47
|
+
display: block;
|
|
48
|
+
border: var(--border-width-default) solid var(--border);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.cpub-gallery-caption {
|
|
52
|
+
font-size: 11px;
|
|
53
|
+
font-family: var(--font-mono);
|
|
54
|
+
color: var(--text-faint);
|
|
55
|
+
padding: 4px 0;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{ content: Record<string, unknown> }>();
|
|
3
|
+
|
|
4
|
+
const level = computed(() => Math.min(Math.max((props.content.level as number) || 2, 1), 6));
|
|
5
|
+
const text = computed(() => (props.content.text as string) || '');
|
|
6
|
+
const slug = computed(() => text.value.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, ''));
|
|
7
|
+
const tag = computed(() => `h${level.value}` as 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6');
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<component :is="tag" :id="slug" class="cpub-block-heading" :class="`cpub-heading-${level}`">
|
|
12
|
+
{{ text }}
|
|
13
|
+
</component>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
.cpub-block-heading {
|
|
18
|
+
color: var(--text);
|
|
19
|
+
line-height: 1.3;
|
|
20
|
+
letter-spacing: -0.01em;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.cpub-heading-1 { font-size: 28px; font-weight: 700; margin: 48px 0 16px; }
|
|
24
|
+
.cpub-heading-2 { font-size: 22px; font-weight: 700; margin: 40px 0 12px; padding-bottom: 8px; border-bottom: var(--border-width-default) solid var(--border); }
|
|
25
|
+
.cpub-heading-3 { font-size: 17px; font-weight: 600; margin: 28px 0 8px; }
|
|
26
|
+
.cpub-heading-4 { font-size: 15px; font-weight: 600; margin: 24px 0 6px; }
|
|
27
|
+
.cpub-heading-5 { font-size: 14px; font-weight: 600; margin: 20px 0 6px; }
|
|
28
|
+
.cpub-heading-6 { font-size: 13px; font-weight: 600; margin: 16px 0 4px; text-transform: uppercase; letter-spacing: 0.05em; }
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{ content: Record<string, unknown> }>();
|
|
3
|
+
|
|
4
|
+
const src = computed(() => (props.content.src as string) || (props.content.url as string) || '');
|
|
5
|
+
const alt = computed(() => (props.content.alt as string) || '');
|
|
6
|
+
const caption = computed(() => (props.content.caption as string) || '');
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<figure v-if="src" class="cpub-block-image">
|
|
11
|
+
<img :src="src" :alt="alt" class="cpub-image-img" loading="lazy" />
|
|
12
|
+
<figcaption v-if="caption" class="cpub-image-caption">{{ caption }}</figcaption>
|
|
13
|
+
</figure>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
.cpub-block-image {
|
|
18
|
+
margin: 24px 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.cpub-image-img {
|
|
22
|
+
width: 100%;
|
|
23
|
+
display: block;
|
|
24
|
+
border: var(--border-width-default) solid var(--border);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.cpub-image-caption {
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
font-family: var(--font-mono);
|
|
30
|
+
color: var(--text-faint);
|
|
31
|
+
padding: 8px 0;
|
|
32
|
+
text-align: center;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { markdownToBlockTuples } from '@commonpub/editor';
|
|
3
|
+
import type { BlockTuple } from '@commonpub/editor';
|
|
4
|
+
import { sanitizeBlockHtml } from '../../composables/useSanitize';
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
content: { source: string };
|
|
8
|
+
}>();
|
|
9
|
+
|
|
10
|
+
const renderedBlocks = computed(() => {
|
|
11
|
+
if (!props.content.source?.trim()) return [];
|
|
12
|
+
try {
|
|
13
|
+
return markdownToBlockTuples(props.content.source);
|
|
14
|
+
} catch {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/** Type-safe block content accessors — cast content to record for dynamic key access */
|
|
20
|
+
function bStr(block: BlockTuple, key: string): string {
|
|
21
|
+
return String((block[1] as Record<string, unknown>)[key] ?? '');
|
|
22
|
+
}
|
|
23
|
+
function bNum(block: BlockTuple, key: string): number {
|
|
24
|
+
return Number((block[1] as Record<string, unknown>)[key]) || 0;
|
|
25
|
+
}
|
|
26
|
+
function bHas(block: BlockTuple, key: string): boolean {
|
|
27
|
+
return !!(block[1] as Record<string, unknown>)[key];
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div class="cpub-markdown-view">
|
|
33
|
+
<div v-for="(block, i) in renderedBlocks" :key="i" class="cpub-md-block">
|
|
34
|
+
<template v-if="block[0] === 'heading'">
|
|
35
|
+
<component :is="`h${Math.min(bNum(block, 'level'), 4)}`" class="cpub-md-heading">
|
|
36
|
+
{{ bStr(block, 'text') }}
|
|
37
|
+
</component>
|
|
38
|
+
</template>
|
|
39
|
+
<template v-else-if="block[0] === 'text'">
|
|
40
|
+
<div class="cpub-md-text" v-html="sanitizeBlockHtml(bStr(block, 'html'))" />
|
|
41
|
+
</template>
|
|
42
|
+
<template v-else-if="block[0] === 'code'">
|
|
43
|
+
<pre class="cpub-md-code"><code :class="`language-${bStr(block, 'language')}`">{{ bStr(block, 'code') }}</code></pre>
|
|
44
|
+
</template>
|
|
45
|
+
<template v-else-if="block[0] === 'image'">
|
|
46
|
+
<figure class="cpub-md-figure">
|
|
47
|
+
<img :src="bStr(block, 'src')" :alt="bStr(block, 'alt')" loading="lazy" />
|
|
48
|
+
<figcaption v-if="bHas(block, 'caption')">{{ bStr(block, 'caption') }}</figcaption>
|
|
49
|
+
</figure>
|
|
50
|
+
</template>
|
|
51
|
+
<template v-else-if="block[0] === 'callout'">
|
|
52
|
+
<div :class="['cpub-md-callout', `cpub-md-callout--${bStr(block, 'variant') || 'info'}`]">
|
|
53
|
+
<div v-html="sanitizeBlockHtml(bStr(block, 'html'))" />
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
<template v-else-if="block[0] === 'quote'">
|
|
57
|
+
<blockquote class="cpub-md-quote" v-html="sanitizeBlockHtml(bStr(block, 'html'))" />
|
|
58
|
+
</template>
|
|
59
|
+
<template v-else-if="block[0] === 'divider'">
|
|
60
|
+
<hr class="cpub-md-hr" />
|
|
61
|
+
</template>
|
|
62
|
+
<template v-else-if="bHas(block, 'html')">
|
|
63
|
+
<div class="cpub-md-text" v-html="sanitizeBlockHtml(bStr(block, 'html'))" />
|
|
64
|
+
</template>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<style scoped>
|
|
70
|
+
.cpub-markdown-view {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
gap: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.cpub-md-heading { margin: 20px 0 8px; }
|
|
77
|
+
h1.cpub-md-heading { font-size: 1.75rem; font-weight: 800; }
|
|
78
|
+
h2.cpub-md-heading { font-size: 1.375rem; font-weight: 700; }
|
|
79
|
+
h3.cpub-md-heading { font-size: 1.125rem; font-weight: 700; }
|
|
80
|
+
h4.cpub-md-heading { font-size: 1rem; font-weight: 600; }
|
|
81
|
+
|
|
82
|
+
.cpub-md-text { font-size: 15px; line-height: 1.75; margin-bottom: 14px; }
|
|
83
|
+
.cpub-md-text :deep(p) { margin-bottom: 12px; }
|
|
84
|
+
.cpub-md-text :deep(ul), .cpub-md-text :deep(ol) { padding-left: 24px; margin-bottom: 12px; }
|
|
85
|
+
.cpub-md-text :deep(li) { margin-bottom: 4px; }
|
|
86
|
+
.cpub-md-text :deep(a) { color: var(--accent); text-decoration: underline; }
|
|
87
|
+
.cpub-md-text :deep(strong) { font-weight: 600; }
|
|
88
|
+
.cpub-md-text :deep(code) { font-family: var(--font-mono); font-size: 0.875em; padding: 1px 4px; background: var(--surface2); border-radius: 0; }
|
|
89
|
+
.cpub-md-text :deep(table) { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 13px; }
|
|
90
|
+
.cpub-md-text :deep(th), .cpub-md-text :deep(td) { padding: 6px 10px; border: var(--border-width-default) solid var(--border); text-align: left; }
|
|
91
|
+
.cpub-md-text :deep(th) { background: var(--surface2); font-weight: 600; }
|
|
92
|
+
|
|
93
|
+
.cpub-md-code {
|
|
94
|
+
background: var(--surface2); border: var(--border-width-default) solid var(--border); border-radius: 0;
|
|
95
|
+
padding: 14px 16px; font-family: var(--font-mono); font-size: 13px;
|
|
96
|
+
line-height: 1.6; overflow-x: auto; margin-bottom: 14px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.cpub-md-figure { margin-bottom: 14px; }
|
|
100
|
+
.cpub-md-figure img { max-width: 100%; border-radius: 0; }
|
|
101
|
+
.cpub-md-figure figcaption { font-size: 12px; color: var(--text-dim); margin-top: 6px; text-align: center; }
|
|
102
|
+
|
|
103
|
+
.cpub-md-callout {
|
|
104
|
+
padding: 12px 16px; border-radius: 0; border-left: 3px solid;
|
|
105
|
+
margin-bottom: 14px; font-size: 14px; line-height: 1.6;
|
|
106
|
+
}
|
|
107
|
+
.cpub-md-callout--info { background: var(--teal-bg); border-color: var(--teal); }
|
|
108
|
+
.cpub-md-callout--tip { background: var(--green-bg); border-color: var(--green); }
|
|
109
|
+
.cpub-md-callout--warning { background: var(--yellow-bg); border-color: var(--yellow); }
|
|
110
|
+
.cpub-md-callout--danger { background: var(--red-bg); border-color: var(--red); }
|
|
111
|
+
|
|
112
|
+
.cpub-md-quote {
|
|
113
|
+
border-left: 3px solid var(--border); padding: 8px 16px;
|
|
114
|
+
color: var(--text-dim); font-style: italic; margin-bottom: 14px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.cpub-md-hr { border: none; border-top: var(--border-width-default) solid var(--border); margin: 20px 0; }
|
|
118
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{ content: Record<string, unknown> }>();
|
|
3
|
+
|
|
4
|
+
const expression = computed(() => (props.content.expression as string) || '');
|
|
5
|
+
const label = computed(() => (props.content.label as string) || '');
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div class="cpub-block-math">
|
|
10
|
+
<div v-if="label" class="cpub-math-label">{{ label }}</div>
|
|
11
|
+
<pre class="cpub-math-expression"><code>{{ expression }}</code></pre>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<style scoped>
|
|
16
|
+
.cpub-block-math {
|
|
17
|
+
font-family: var(--font-mono);
|
|
18
|
+
background: var(--border);
|
|
19
|
+
border: var(--border-width-default) solid var(--border);
|
|
20
|
+
padding: 16px 18px;
|
|
21
|
+
margin: 16px 0;
|
|
22
|
+
box-shadow: var(--shadow-md);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.cpub-math-label {
|
|
26
|
+
font-size: 10px;
|
|
27
|
+
letter-spacing: 0.08em;
|
|
28
|
+
text-transform: uppercase;
|
|
29
|
+
color: var(--text-faint);
|
|
30
|
+
margin-bottom: 8px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.cpub-math-expression {
|
|
34
|
+
margin: 0;
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
line-height: 1.7;
|
|
37
|
+
color: var(--surface);
|
|
38
|
+
white-space: pre-wrap;
|
|
39
|
+
word-break: break-all;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.cpub-math-expression code {
|
|
43
|
+
font-family: inherit;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface Part {
|
|
3
|
+
name: string;
|
|
4
|
+
qty?: number;
|
|
5
|
+
quantity?: number;
|
|
6
|
+
price?: number;
|
|
7
|
+
notes?: string;
|
|
8
|
+
url?: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const props = defineProps<{ content: Record<string, unknown> }>();
|
|
13
|
+
|
|
14
|
+
const parts = computed<Part[]>(() => {
|
|
15
|
+
const raw = props.content.parts;
|
|
16
|
+
if (!Array.isArray(raw)) return [];
|
|
17
|
+
return raw as Part[];
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const totalPrice = computed(() => {
|
|
21
|
+
return parts.value.reduce((sum, p) => sum + (p.price ?? 0) * ((p.qty ?? p.quantity) ?? 1), 0);
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div v-if="parts.length > 0" class="cpub-block-parts">
|
|
27
|
+
<div class="cpub-parts-header">
|
|
28
|
+
<i class="fa-solid fa-list-check cpub-parts-icon"></i>
|
|
29
|
+
<span class="cpub-parts-title">Parts List</span>
|
|
30
|
+
<span class="cpub-parts-count">
|
|
31
|
+
{{ parts.length }} item{{ parts.length !== 1 ? 's' : '' }}
|
|
32
|
+
<template v-if="totalPrice > 0"> · ${{ totalPrice.toFixed(2) }} est.</template>
|
|
33
|
+
</span>
|
|
34
|
+
</div>
|
|
35
|
+
<table class="cpub-parts-table">
|
|
36
|
+
<thead>
|
|
37
|
+
<tr>
|
|
38
|
+
<th>Component</th>
|
|
39
|
+
<th class="cpub-col-qty">Qty</th>
|
|
40
|
+
<th>Notes</th>
|
|
41
|
+
</tr>
|
|
42
|
+
</thead>
|
|
43
|
+
<tbody>
|
|
44
|
+
<tr v-for="(part, idx) in parts" :key="idx">
|
|
45
|
+
<td class="cpub-part-name">
|
|
46
|
+
<a v-if="part.url" :href="part.url" target="_blank" rel="noopener">{{ part.name }}</a>
|
|
47
|
+
<span v-else>{{ part.name || 'Unknown' }}</span>
|
|
48
|
+
</td>
|
|
49
|
+
<td class="cpub-col-qty">{{ (part.qty ?? part.quantity) ?? 1 }}</td>
|
|
50
|
+
<td class="cpub-part-notes">{{ part.notes || '—' }}</td>
|
|
51
|
+
</tr>
|
|
52
|
+
</tbody>
|
|
53
|
+
</table>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<style scoped>
|
|
58
|
+
.cpub-block-parts {
|
|
59
|
+
border: var(--border-width-default) solid var(--border);
|
|
60
|
+
margin: 24px 0;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
box-shadow: var(--shadow-md);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.cpub-parts-header {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: 8px;
|
|
69
|
+
padding: 10px 14px;
|
|
70
|
+
background: var(--surface2);
|
|
71
|
+
border-bottom: var(--border-width-default) solid var(--border);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cpub-parts-icon { font-size: 12px; color: var(--accent); }
|
|
75
|
+
.cpub-parts-title { font-size: 12px; font-weight: 600; color: var(--text); }
|
|
76
|
+
.cpub-parts-count { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); margin-left: auto; }
|
|
77
|
+
|
|
78
|
+
.cpub-parts-table { width: 100%; border-collapse: collapse; }
|
|
79
|
+
|
|
80
|
+
.cpub-parts-table th {
|
|
81
|
+
font-family: var(--font-mono);
|
|
82
|
+
font-size: 9px;
|
|
83
|
+
font-weight: 700;
|
|
84
|
+
text-transform: uppercase;
|
|
85
|
+
letter-spacing: 0.1em;
|
|
86
|
+
text-align: left;
|
|
87
|
+
padding: 8px 12px;
|
|
88
|
+
background: var(--text);
|
|
89
|
+
color: var(--surface);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.cpub-parts-table td {
|
|
93
|
+
padding: 10px 12px;
|
|
94
|
+
border-bottom: var(--border-width-default) solid var(--border2);
|
|
95
|
+
font-size: 13px;
|
|
96
|
+
color: var(--text-dim);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.cpub-part-name { font-weight: 500; color: var(--text); }
|
|
100
|
+
.cpub-part-name a { color: var(--accent); text-decoration: none; }
|
|
101
|
+
.cpub-part-name a:hover { text-decoration: underline; }
|
|
102
|
+
.cpub-col-qty { width: 50px; text-align: center; font-family: var(--font-mono); font-size: 12px; }
|
|
103
|
+
.cpub-part-notes { font-size: 12px; color: var(--text-faint); }
|
|
104
|
+
</style>
|