@happyvertical/smrt-content 0.30.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/AGENTS.md +194 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +634 -0
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/asset-associable.d.ts +115 -0
- package/dist/asset-associable.d.ts.map +1 -0
- package/dist/body-format.d.ts +29 -0
- package/dist/body-format.d.ts.map +1 -0
- package/dist/body-format.js +604 -0
- package/dist/body-format.js.map +1 -0
- package/dist/content-asset.d.ts +17 -0
- package/dist/content-asset.d.ts.map +1 -0
- package/dist/content-assets.d.ts +10 -0
- package/dist/content-assets.d.ts.map +1 -0
- package/dist/content-chat-handlers.d.ts +115 -0
- package/dist/content-chat-handlers.d.ts.map +1 -0
- package/dist/content-chat-prompts.d.ts +3 -0
- package/dist/content-chat-prompts.d.ts.map +1 -0
- package/dist/content-chat-session.d.ts +26 -0
- package/dist/content-chat-session.d.ts.map +1 -0
- package/dist/content-contribution-attachment.d.ts +42 -0
- package/dist/content-contribution-attachment.d.ts.map +1 -0
- package/dist/content-contribution-attachments.d.ts +8 -0
- package/dist/content-contribution-attachments.d.ts.map +1 -0
- package/dist/content-contribution-config.d.ts +84 -0
- package/dist/content-contribution-config.d.ts.map +1 -0
- package/dist/content-contribution-revision.d.ts +38 -0
- package/dist/content-contribution-revision.d.ts.map +1 -0
- package/dist/content-contribution-revisions.d.ts +8 -0
- package/dist/content-contribution-revisions.d.ts.map +1 -0
- package/dist/content-contribution-type.d.ts +51 -0
- package/dist/content-contribution-type.d.ts.map +1 -0
- package/dist/content-contribution-types.d.ts +7 -0
- package/dist/content-contribution-types.d.ts.map +1 -0
- package/dist/content-contribution.d.ts +161 -0
- package/dist/content-contribution.d.ts.map +1 -0
- package/dist/content-contributions.d.ts +53 -0
- package/dist/content-contributions.d.ts.map +1 -0
- package/dist/content-contributor.d.ts +30 -0
- package/dist/content-contributor.d.ts.map +1 -0
- package/dist/content-contributors.d.ts +13 -0
- package/dist/content-contributors.d.ts.map +1 -0
- package/dist/content-correction.d.ts +39 -0
- package/dist/content-correction.d.ts.map +1 -0
- package/dist/content-corrections.d.ts +9 -0
- package/dist/content-corrections.d.ts.map +1 -0
- package/dist/content-editor-assistant.d.ts +68 -0
- package/dist/content-editor-assistant.d.ts.map +1 -0
- package/dist/content-editor-assistant.js +97 -0
- package/dist/content-editor-assistant.js.map +1 -0
- package/dist/content-feed-parser.d.ts +19 -0
- package/dist/content-feed-parser.d.ts.map +1 -0
- package/dist/content-feed-source.d.ts +52 -0
- package/dist/content-feed-source.d.ts.map +1 -0
- package/dist/content-feed-sources.d.ts +11 -0
- package/dist/content-feed-sources.d.ts.map +1 -0
- package/dist/content-feed-sync.d.ts +23 -0
- package/dist/content-feed-sync.d.ts.map +1 -0
- package/dist/content-governance-assignment.d.ts +42 -0
- package/dist/content-governance-assignment.d.ts.map +1 -0
- package/dist/content-governance-assignments.d.ts +11 -0
- package/dist/content-governance-assignments.d.ts.map +1 -0
- package/dist/content-governance-policies.d.ts +7 -0
- package/dist/content-governance-policies.d.ts.map +1 -0
- package/dist/content-governance-policy.d.ts +29 -0
- package/dist/content-governance-policy.d.ts.map +1 -0
- package/dist/content-governance-profile.d.ts +31 -0
- package/dist/content-governance-profile.d.ts.map +1 -0
- package/dist/content-governance-profiles.d.ts +7 -0
- package/dist/content-governance-profiles.d.ts.map +1 -0
- package/dist/content-governance.d.ts +188 -0
- package/dist/content-governance.d.ts.map +1 -0
- package/dist/content-prompts.d.ts +10 -0
- package/dist/content-prompts.d.ts.map +1 -0
- package/dist/content-reference.d.ts +17 -0
- package/dist/content-reference.d.ts.map +1 -0
- package/dist/content-references.d.ts +55 -0
- package/dist/content-references.d.ts.map +1 -0
- package/dist/content-review.d.ts +34 -0
- package/dist/content-review.d.ts.map +1 -0
- package/dist/content-reviews.d.ts +21 -0
- package/dist/content-reviews.d.ts.map +1 -0
- package/dist/content-transparency.d.ts +72 -0
- package/dist/content-transparency.d.ts.map +1 -0
- package/dist/content-types.d.ts +51 -0
- package/dist/content-types.d.ts.map +1 -0
- package/dist/content-version.d.ts +38 -0
- package/dist/content-version.d.ts.map +1 -0
- package/dist/content-versions.d.ts +16 -0
- package/dist/content-versions.d.ts.map +1 -0
- package/dist/content.d.ts +736 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/contents.d.ts +292 -0
- package/dist/contents.d.ts.map +1 -0
- package/dist/database-utils.d.ts +3 -0
- package/dist/database-utils.d.ts.map +1 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11602 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.json +12308 -0
- package/dist/mock-smrt-client.d.ts +493 -0
- package/dist/mock-smrt-client.d.ts.map +1 -0
- package/dist/mock-smrt-client.js +390 -0
- package/dist/mock-smrt-client.js.map +1 -0
- package/dist/playground.d.ts +2 -0
- package/dist/playground.d.ts.map +1 -0
- package/dist/playground.js +454 -0
- package/dist/playground.js.map +1 -0
- package/dist/publish-readiness.d.ts +30 -0
- package/dist/publish-readiness.d.ts.map +1 -0
- package/dist/publish-readiness.js +74 -0
- package/dist/publish-readiness.js.map +1 -0
- package/dist/safe-remote-url.d.ts +52 -0
- package/dist/safe-remote-url.d.ts.map +1 -0
- package/dist/serialization.d.ts +78 -0
- package/dist/serialization.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +6130 -0
- package/dist/svelte/api.d.ts +3 -0
- package/dist/svelte/api.d.ts.map +1 -0
- package/dist/svelte/api.js +10 -0
- package/dist/svelte/components/ArticleCard.svelte +159 -0
- package/dist/svelte/components/ArticleCard.svelte.d.ts +17 -0
- package/dist/svelte/components/ArticleCard.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ArticleList.svelte +75 -0
- package/dist/svelte/components/ArticleList.svelte.d.ts +21 -0
- package/dist/svelte/components/ArticleList.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentAgentChat.svelte +652 -0
- package/dist/svelte/components/ContentAgentChat.svelte.d.ts +17 -0
- package/dist/svelte/components/ContentAgentChat.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentBodyEditor.svelte +1446 -0
- package/dist/svelte/components/ContentBodyEditor.svelte.d.ts +25 -0
- package/dist/svelte/components/ContentBodyEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentBodyRenderer.svelte +152 -0
- package/dist/svelte/components/ContentBodyRenderer.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentBodyRenderer.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentClaimAuditTool.svelte +441 -0
- package/dist/svelte/components/ContentClaimAuditTool.svelte.d.ts +12 -0
- package/dist/svelte/components/ContentClaimAuditTool.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentContributionForm.svelte +226 -0
- package/dist/svelte/components/ContentContributionForm.svelte.d.ts +23 -0
- package/dist/svelte/components/ContentContributionForm.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentContributionInbox.svelte +322 -0
- package/dist/svelte/components/ContentContributionInbox.svelte.d.ts +22 -0
- package/dist/svelte/components/ContentContributionInbox.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentContributionPortal.svelte +182 -0
- package/dist/svelte/components/ContentContributionPortal.svelte.d.ts +12 -0
- package/dist/svelte/components/ContentContributionPortal.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentContributionTypeManager.svelte +281 -0
- package/dist/svelte/components/ContentContributionTypeManager.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentContributionTypeManager.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentContributorManager.svelte +140 -0
- package/dist/svelte/components/ContentContributorManager.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentContributorManager.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentCorrectionsTool.svelte +361 -0
- package/dist/svelte/components/ContentCorrectionsTool.svelte.d.ts +11 -0
- package/dist/svelte/components/ContentCorrectionsTool.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentEditor.svelte +2166 -0
- package/dist/svelte/components/ContentEditor.svelte.d.ts +26 -0
- package/dist/svelte/components/ContentEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte +199 -0
- package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte.d.ts +11 -0
- package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernanceManager.svelte +340 -0
- package/dist/svelte/components/ContentGovernanceManager.svelte.d.ts +11 -0
- package/dist/svelte/components/ContentGovernanceManager.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernancePanel.svelte +2244 -0
- package/dist/svelte/components/ContentGovernancePanel.svelte.d.ts +26 -0
- package/dist/svelte/components/ContentGovernancePanel.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernancePolicyEditor.svelte +110 -0
- package/dist/svelte/components/ContentGovernancePolicyEditor.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentGovernancePolicyEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernanceProfileEditor.svelte +185 -0
- package/dist/svelte/components/ContentGovernanceProfileEditor.svelte.d.ts +11 -0
- package/dist/svelte/components/ContentGovernanceProfileEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernanceTool.svelte +56 -0
- package/dist/svelte/components/ContentGovernanceTool.svelte.d.ts +13 -0
- package/dist/svelte/components/ContentGovernanceTool.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentImageBrowser.svelte +243 -0
- package/dist/svelte/components/ContentImageBrowser.svelte.d.ts +18 -0
- package/dist/svelte/components/ContentImageBrowser.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentImageChooser.svelte +134 -0
- package/dist/svelte/components/ContentImageChooser.svelte.d.ts +11 -0
- package/dist/svelte/components/ContentImageChooser.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentList.svelte +906 -0
- package/dist/svelte/components/ContentList.svelte.d.ts +16 -0
- package/dist/svelte/components/ContentList.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentMetadataFields.svelte +107 -0
- package/dist/svelte/components/ContentMetadataFields.svelte.d.ts +8 -0
- package/dist/svelte/components/ContentMetadataFields.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentReferencesPanel.svelte +221 -0
- package/dist/svelte/components/ContentReferencesPanel.svelte.d.ts +20 -0
- package/dist/svelte/components/ContentReferencesPanel.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentReviewStatusTray.svelte +151 -0
- package/dist/svelte/components/ContentReviewStatusTray.svelte.d.ts +20 -0
- package/dist/svelte/components/ContentReviewStatusTray.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentStatusFields.svelte +85 -0
- package/dist/svelte/components/ContentStatusFields.svelte.d.ts +8 -0
- package/dist/svelte/components/ContentStatusFields.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentTitleField.svelte +54 -0
- package/dist/svelte/components/ContentTitleField.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentTitleField.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentTransparencyReport.svelte +322 -0
- package/dist/svelte/components/ContentTransparencyReport.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentTransparencyReport.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentTransparencyTool.svelte +314 -0
- package/dist/svelte/components/ContentTransparencyTool.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentTransparencyTool.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentVersionsTool.svelte +291 -0
- package/dist/svelte/components/ContentVersionsTool.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentVersionsTool.svelte.d.ts.map +1 -0
- package/dist/svelte/components/GovernedContentEditor.svelte +409 -0
- package/dist/svelte/components/GovernedContentEditor.svelte.d.ts +35 -0
- package/dist/svelte/components/GovernedContentEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ImageThumbnail.cache.d.ts +14 -0
- package/dist/svelte/components/ImageThumbnail.cache.d.ts.map +1 -0
- package/dist/svelte/components/ImageThumbnail.cache.js +36 -0
- package/dist/svelte/components/ImageThumbnail.svelte +159 -0
- package/dist/svelte/components/ImageThumbnail.svelte.d.ts +8 -0
- package/dist/svelte/components/ImageThumbnail.svelte.d.ts.map +1 -0
- package/dist/svelte/components/Markdown.svelte +125 -0
- package/dist/svelte/components/Markdown.svelte.d.ts +11 -0
- package/dist/svelte/components/Markdown.svelte.d.ts.map +1 -0
- package/dist/svelte/content-editor-form.d.ts +63 -0
- package/dist/svelte/content-editor-form.d.ts.map +1 -0
- package/dist/svelte/content-editor-form.js +94 -0
- package/dist/svelte/content-editor-media.d.ts +12 -0
- package/dist/svelte/content-editor-media.d.ts.map +1 -0
- package/dist/svelte/content-editor-media.js +84 -0
- package/dist/svelte/content-editor-state.svelte.d.ts +35 -0
- package/dist/svelte/content-editor-state.svelte.d.ts.map +1 -0
- package/dist/svelte/content-editor-state.svelte.js +141 -0
- package/dist/svelte/governance-manager-client.d.ts +22 -0
- package/dist/svelte/governance-manager-client.d.ts.map +1 -0
- package/dist/svelte/governance-manager-client.js +1 -0
- package/dist/svelte/i18n.contribution.d.ts +57 -0
- package/dist/svelte/i18n.contribution.d.ts.map +1 -0
- package/dist/svelte/i18n.contribution.js +64 -0
- package/dist/svelte/i18n.editor.d.ts +71 -0
- package/dist/svelte/i18n.editor.d.ts.map +1 -0
- package/dist/svelte/i18n.editor.js +87 -0
- package/dist/svelte/i18n.governance.d.ts +66 -0
- package/dist/svelte/i18n.governance.d.ts.map +1 -0
- package/dist/svelte/i18n.governance.js +66 -0
- package/dist/svelte/i18n.routes.d.ts +66 -0
- package/dist/svelte/i18n.routes.d.ts.map +1 -0
- package/dist/svelte/i18n.routes.js +75 -0
- package/dist/svelte/i18n.tools.d.ts +81 -0
- package/dist/svelte/i18n.tools.d.ts.map +1 -0
- package/dist/svelte/i18n.tools.js +90 -0
- package/dist/svelte/index.d.ts +101 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +63 -0
- package/dist/svelte/playground.d.ts +281 -0
- package/dist/svelte/playground.d.ts.map +1 -0
- package/dist/svelte/playground.js +438 -0
- package/dist/svelte/routes/ContentContributionsRoute.svelte +809 -0
- package/dist/svelte/routes/ContentContributionsRoute.svelte.d.ts +10 -0
- package/dist/svelte/routes/ContentContributionsRoute.svelte.d.ts.map +1 -0
- package/dist/svelte/routes/ContentFactsRoute.svelte +612 -0
- package/dist/svelte/routes/ContentFactsRoute.svelte.d.ts +11 -0
- package/dist/svelte/routes/ContentFactsRoute.svelte.d.ts.map +1 -0
- package/dist/svelte/routes/ContentGovernanceRoute.svelte +218 -0
- package/dist/svelte/routes/ContentGovernanceRoute.svelte.d.ts +10 -0
- package/dist/svelte/routes/ContentGovernanceRoute.svelte.d.ts.map +1 -0
- package/dist/svelte/routes/ContentWorkspaceRoute.svelte +431 -0
- package/dist/svelte/routes/ContentWorkspaceRoute.svelte.d.ts +12 -0
- package/dist/svelte/routes/ContentWorkspaceRoute.svelte.d.ts.map +1 -0
- package/dist/svelte/routes/PublishedArticleRoute.svelte +194 -0
- package/dist/svelte/routes/PublishedArticleRoute.svelte.d.ts +10 -0
- package/dist/svelte/routes/PublishedArticleRoute.svelte.d.ts.map +1 -0
- package/dist/svelte/routes/index.d.ts +8 -0
- package/dist/svelte/routes/index.d.ts.map +1 -0
- package/dist/svelte/routes/index.js +6 -0
- package/dist/svelte/routes/shared.d.ts +90 -0
- package/dist/svelte/routes/shared.d.ts.map +1 -0
- package/dist/svelte/routes/shared.js +104 -0
- package/dist/svelte/types.d.ts +69 -0
- package/dist/svelte/types.d.ts.map +1 -0
- package/dist/svelte/types.js +6 -0
- package/dist/thumbnail-generator.d.ts +174 -0
- package/dist/thumbnail-generator.d.ts.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +42 -0
- package/dist/ui.js.map +1 -0
- package/dist/utils.d.ts +18 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +119 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
3
|
+
import ContentBodyRenderer from '../components/ContentBodyRenderer.svelte';
|
|
4
|
+
import ContentTransparencyReport from '../components/ContentTransparencyReport.svelte';
|
|
5
|
+
import { M } from '../i18n.routes.js';
|
|
6
|
+
import {
|
|
7
|
+
CONTENT_ROUTE_IDS,
|
|
8
|
+
getContentRouteDefaultPath,
|
|
9
|
+
type PublishedContentArticleRouteData,
|
|
10
|
+
} from './shared.js';
|
|
11
|
+
|
|
12
|
+
interface PublishedArticleRouteProps {
|
|
13
|
+
data: PublishedContentArticleRouteData;
|
|
14
|
+
backHref?: string;
|
|
15
|
+
backLabel?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let {
|
|
19
|
+
data,
|
|
20
|
+
backHref = getContentRouteDefaultPath(CONTENT_ROUTE_IDS.workspace),
|
|
21
|
+
backLabel = 'Back to content workspace',
|
|
22
|
+
}: PublishedArticleRouteProps = $props();
|
|
23
|
+
|
|
24
|
+
const { t } = useI18n();
|
|
25
|
+
|
|
26
|
+
function formatTimestamp(value: string | null | undefined) {
|
|
27
|
+
if (!value) {
|
|
28
|
+
return 'Unscheduled';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return new Date(value).toLocaleString();
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<div class="article-page">
|
|
36
|
+
<header class="article-hero">
|
|
37
|
+
<div class="article-hero__inner">
|
|
38
|
+
<a href={backHref} class="back-link">{backLabel}</a>
|
|
39
|
+
<div class="eyebrow">{t(M['content.published_article.eyebrow'])}</div>
|
|
40
|
+
<h1>{data.content.title || t(M['content.published_article.untitled'])}</h1>
|
|
41
|
+
{#if data.content.description}
|
|
42
|
+
<p class="article-dek">{data.content.description}</p>
|
|
43
|
+
{/if}
|
|
44
|
+
|
|
45
|
+
<div class="article-meta">
|
|
46
|
+
<span>{data.content.author || t(M['content.published_article.unknown_author'])}</span>
|
|
47
|
+
<span>{formatTimestamp(data.content.publish_date)}</span>
|
|
48
|
+
{#if data.content.slug}
|
|
49
|
+
<span>/{data.content.slug}</span>
|
|
50
|
+
{/if}
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</header>
|
|
54
|
+
|
|
55
|
+
<main class="article-layout">
|
|
56
|
+
<article class="article-body">
|
|
57
|
+
<ContentBodyRenderer
|
|
58
|
+
content={data.content.body || ''}
|
|
59
|
+
format={data.content.bodyFormat}
|
|
60
|
+
/>
|
|
61
|
+
</article>
|
|
62
|
+
|
|
63
|
+
<aside class="article-sidebar">
|
|
64
|
+
<ContentTransparencyReport
|
|
65
|
+
transparency={data.transparency}
|
|
66
|
+
title={t(M['content.published_article.transparency_title'])}
|
|
67
|
+
emptyCopy={t(M['content.published_article.empty_copy'])}
|
|
68
|
+
/>
|
|
69
|
+
</aside>
|
|
70
|
+
</main>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<style>
|
|
74
|
+
:global(body) {
|
|
75
|
+
margin: 0;
|
|
76
|
+
font-family:
|
|
77
|
+
var(--smrt-font-family, 'Inter', -apple-system, BlinkMacSystemFont,
|
|
78
|
+
'Segoe UI', Roboto, sans-serif);
|
|
79
|
+
background:
|
|
80
|
+
radial-gradient(
|
|
81
|
+
circle at top,
|
|
82
|
+
color-mix(in srgb, var(--smrt-color-primary) 10%, transparent),
|
|
83
|
+
transparent 34%
|
|
84
|
+
),
|
|
85
|
+
var(--smrt-color-background);
|
|
86
|
+
color: var(--smrt-color-on-background);
|
|
87
|
+
min-height: 100vh;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.article-page {
|
|
91
|
+
min-height: 100vh;
|
|
92
|
+
padding: 2rem 1.25rem 3rem;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.article-hero,
|
|
96
|
+
.article-layout {
|
|
97
|
+
max-width: 1280px;
|
|
98
|
+
margin: 0 auto;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.article-hero {
|
|
102
|
+
margin-bottom: 2rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.article-hero__inner {
|
|
106
|
+
border: 1px solid var(--smrt-color-outline-variant);
|
|
107
|
+
background: color-mix(
|
|
108
|
+
in srgb,
|
|
109
|
+
var(--smrt-color-surface) 92%,
|
|
110
|
+
transparent
|
|
111
|
+
);
|
|
112
|
+
box-shadow: var(--smrt-elevation-2, 0 12px 40px rgba(15, 23, 42, 0.08));
|
|
113
|
+
border-radius: 1.25rem;
|
|
114
|
+
padding: 1.5rem;
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: column;
|
|
117
|
+
gap: 1rem;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.back-link {
|
|
121
|
+
color: var(--smrt-color-primary);
|
|
122
|
+
text-decoration: none;
|
|
123
|
+
font-weight: var(--smrt-typography-weight-semibold, 600);
|
|
124
|
+
width: fit-content;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.back-link:hover {
|
|
128
|
+
text-decoration: underline;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.eyebrow {
|
|
132
|
+
color: var(--smrt-color-on-surface-variant);
|
|
133
|
+
text-transform: uppercase;
|
|
134
|
+
letter-spacing: var(--smrt-typography-label-medium-tracking, 0.08em);
|
|
135
|
+
font-size: var(--smrt-typography-label-medium-size, 0.8rem);
|
|
136
|
+
font-weight: var(--smrt-typography-weight-bold, 700);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.article-hero h1 {
|
|
140
|
+
margin: 0;
|
|
141
|
+
font-size: clamp(2.2rem, 5vw, 4rem);
|
|
142
|
+
line-height: 1.05;
|
|
143
|
+
color: var(--smrt-color-on-surface);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.article-dek {
|
|
147
|
+
margin: 0;
|
|
148
|
+
font-size: var(--smrt-typography-body-large-size, 1.15rem);
|
|
149
|
+
color: var(--smrt-color-on-surface-variant);
|
|
150
|
+
max-width: 55rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.article-meta {
|
|
154
|
+
display: flex;
|
|
155
|
+
flex-wrap: wrap;
|
|
156
|
+
gap: 0.85rem;
|
|
157
|
+
color: var(--smrt-color-on-surface-variant);
|
|
158
|
+
font-size: var(--smrt-typography-body-medium-size, 0.92rem);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.article-layout {
|
|
162
|
+
display: grid;
|
|
163
|
+
gap: 1.5rem;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.article-body,
|
|
167
|
+
.article-sidebar {
|
|
168
|
+
border: 1px solid var(--smrt-color-outline-variant);
|
|
169
|
+
background: color-mix(
|
|
170
|
+
in srgb,
|
|
171
|
+
var(--smrt-color-surface) 95%,
|
|
172
|
+
transparent
|
|
173
|
+
);
|
|
174
|
+
border-radius: 1.25rem;
|
|
175
|
+
padding: 1.5rem;
|
|
176
|
+
box-shadow: var(--smrt-elevation-1, 0 8px 24px rgba(15, 23, 42, 0.05));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.article-body {
|
|
180
|
+
min-width: 0;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@media (min-width: 1080px) {
|
|
184
|
+
.article-layout {
|
|
185
|
+
grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
|
|
186
|
+
align-items: start;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.article-sidebar {
|
|
190
|
+
position: sticky;
|
|
191
|
+
top: 1.5rem;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PublishedContentArticleRouteData } from './shared.js';
|
|
2
|
+
interface PublishedArticleRouteProps {
|
|
3
|
+
data: PublishedContentArticleRouteData;
|
|
4
|
+
backHref?: string;
|
|
5
|
+
backLabel?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const PublishedArticleRoute: import("svelte").Component<PublishedArticleRouteProps, {}, "">;
|
|
8
|
+
type PublishedArticleRoute = ReturnType<typeof PublishedArticleRoute>;
|
|
9
|
+
export default PublishedArticleRoute;
|
|
10
|
+
//# sourceMappingURL=PublishedArticleRoute.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublishedArticleRoute.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/routes/PublishedArticleRoute.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,gCAAgC,EACtC,MAAM,aAAa,CAAC;AAGrB,UAAU,0BAA0B;IAClC,IAAI,EAAE,gCAAgC,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6DD,QAAA,MAAM,qBAAqB,gEAAwC,CAAC;AACpE,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACtE,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as ContentContributionsRoute } from './ContentContributionsRoute.svelte';
|
|
2
|
+
export { default as ContentFactsRoute } from './ContentFactsRoute.svelte';
|
|
3
|
+
export { default as ContentGovernanceRoute } from './ContentGovernanceRoute.svelte';
|
|
4
|
+
export { default as ContentWorkspaceRoute } from './ContentWorkspaceRoute.svelte';
|
|
5
|
+
export { default as PublishedArticleRoute } from './PublishedArticleRoute.svelte';
|
|
6
|
+
export type { ContentRouteId, ContentRouteKey, ContentRouteNavigationItem, LoadPublishedArticleRouteInput, PublishedContentArticleRouteData, } from './shared.js';
|
|
7
|
+
export { buildPublishedArticlePath, CONTENT_DEFAULT_ROUTE_NAVIGATION, CONTENT_ROUTE_IDS, CONTENT_ROUTE_META, createContentRouteNavigation, getContentRouteDefaultPath, getContentRouteHref, } from './shared.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/svelte/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAClF,YAAY,EACV,cAAc,EACd,eAAe,EACf,0BAA0B,EAC1B,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,iBAAiB,EACjB,kBAAkB,EAClB,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as ContentContributionsRoute } from './ContentContributionsRoute.svelte';
|
|
2
|
+
export { default as ContentFactsRoute } from './ContentFactsRoute.svelte';
|
|
3
|
+
export { default as ContentGovernanceRoute } from './ContentGovernanceRoute.svelte';
|
|
4
|
+
export { default as ContentWorkspaceRoute } from './ContentWorkspaceRoute.svelte';
|
|
5
|
+
export { default as PublishedArticleRoute } from './PublishedArticleRoute.svelte';
|
|
6
|
+
export { buildPublishedArticlePath, CONTENT_DEFAULT_ROUTE_NAVIGATION, CONTENT_ROUTE_IDS, CONTENT_ROUTE_META, createContentRouteNavigation, getContentRouteDefaultPath, getContentRouteHref, } from './shared.js';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { SmrtRouteNavigationItem } from '@happyvertical/smrt-types';
|
|
2
|
+
import type { ContentData, ContentTransparencyData } from '../../mock-smrt-client.js';
|
|
3
|
+
export declare const CONTENT_ROUTE_IDS: {
|
|
4
|
+
readonly workspace: "content.workspace";
|
|
5
|
+
readonly facts: "content.facts";
|
|
6
|
+
readonly governance: "content.governance";
|
|
7
|
+
readonly contributions: "content.contributions";
|
|
8
|
+
readonly article: "content.article";
|
|
9
|
+
};
|
|
10
|
+
export type ContentRouteKey = keyof typeof CONTENT_ROUTE_IDS;
|
|
11
|
+
export type ContentRouteId = (typeof CONTENT_ROUTE_IDS)[ContentRouteKey];
|
|
12
|
+
export interface ContentRouteNavigationItem extends SmrtRouteNavigationItem {
|
|
13
|
+
routeId: ContentRouteId;
|
|
14
|
+
}
|
|
15
|
+
export interface PublishedContentArticleRouteData {
|
|
16
|
+
content: ContentData;
|
|
17
|
+
transparency: ContentTransparencyData | null;
|
|
18
|
+
}
|
|
19
|
+
export interface LoadPublishedArticleRouteInput {
|
|
20
|
+
fetch: typeof globalThis.fetch;
|
|
21
|
+
slug: string;
|
|
22
|
+
apiBasePath?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const CONTENT_ROUTE_META: {
|
|
25
|
+
readonly workspace: {
|
|
26
|
+
readonly id: "content.workspace";
|
|
27
|
+
readonly title: "Contents";
|
|
28
|
+
readonly description: "Author, review, and publish content records against the content module workflows.";
|
|
29
|
+
readonly defaultPath: "/workspace";
|
|
30
|
+
readonly nav: {
|
|
31
|
+
readonly label: "Workspace";
|
|
32
|
+
readonly description: "Authoring and publishing workspace";
|
|
33
|
+
readonly icon: "file-text";
|
|
34
|
+
readonly order: 10;
|
|
35
|
+
readonly group: "content";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly governance: {
|
|
39
|
+
readonly id: "content.governance";
|
|
40
|
+
readonly title: "Governance Admin";
|
|
41
|
+
readonly description: "Manage review policies, profiles, and publication assignments for governed content.";
|
|
42
|
+
readonly defaultPath: "/governance";
|
|
43
|
+
readonly nav: {
|
|
44
|
+
readonly label: "Governance";
|
|
45
|
+
readonly description: "Policy, profile, and assignment management";
|
|
46
|
+
readonly icon: "shield-check";
|
|
47
|
+
readonly order: 20;
|
|
48
|
+
readonly group: "content";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly facts: {
|
|
52
|
+
readonly id: "content.facts";
|
|
53
|
+
readonly title: "Fact Catalog";
|
|
54
|
+
readonly description: "Browse extracted facts, search by text or domain, and confirm what content workflows can cite.";
|
|
55
|
+
readonly defaultPath: "/facts";
|
|
56
|
+
readonly nav: {
|
|
57
|
+
readonly label: "Facts";
|
|
58
|
+
readonly description: "Browse indexed facts and confidence";
|
|
59
|
+
readonly icon: "sparkles";
|
|
60
|
+
readonly order: 15;
|
|
61
|
+
readonly group: "content";
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
readonly contributions: {
|
|
65
|
+
readonly id: "content.contributions";
|
|
66
|
+
readonly title: "Contribution Intake and Review";
|
|
67
|
+
readonly description: "Review contributor submissions, moderation state, and promotion flows into content.";
|
|
68
|
+
readonly defaultPath: "/contributions";
|
|
69
|
+
readonly nav: {
|
|
70
|
+
readonly label: "Contributions";
|
|
71
|
+
readonly description: "Contributor intake, moderation, and promotion";
|
|
72
|
+
readonly icon: "inbox";
|
|
73
|
+
readonly order: 30;
|
|
74
|
+
readonly group: "content";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly article: {
|
|
78
|
+
readonly id: "content.article";
|
|
79
|
+
readonly title: "Published article";
|
|
80
|
+
readonly description: "Render a published content record with its public transparency information.";
|
|
81
|
+
readonly defaultPath: "/articles/[slug]";
|
|
82
|
+
readonly loadKind: "page";
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export declare function getContentRouteDefaultPath(routeId: ContentRouteId): string;
|
|
86
|
+
export declare function buildPublishedArticlePath(slug: string, basePath?: "/articles/[slug]"): string;
|
|
87
|
+
export declare function createContentRouteNavigation(pathOverrides?: Partial<Record<ContentRouteId, string>>): ContentRouteNavigationItem[];
|
|
88
|
+
export declare const CONTENT_DEFAULT_ROUTE_NAVIGATION: ContentRouteNavigationItem[];
|
|
89
|
+
export declare function getContentRouteHref(navigation: ContentRouteNavigationItem[], routeId: ContentRouteId): string;
|
|
90
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/svelte/routes/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,uBAAuB,EAExB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,WAAW,EACX,uBAAuB,EACxB,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAC7D,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,eAAe,CAAC,CAAC;AAWzE,MAAM,WAAW,0BAA2B,SAAQ,uBAAuB;IACzE,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,WAAW,CAAC;IACrB,YAAY,EAAE,uBAAuB,GAAG,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,8BAA8B;IAC7C,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiE+B,CAAC;AAW/D,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAS1E;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,QAAQ,qBAAyC,GAChD,MAAM,CAGR;AAED,wBAAgB,4BAA4B,CAC1C,aAAa,GAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAM,GAC1D,0BAA0B,EAAE,CAc9B;AAED,eAAO,MAAM,gCAAgC,8BAAiC,CAAC;AAE/E,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,0BAA0B,EAAE,EACxC,OAAO,EAAE,cAAc,GACtB,MAAM,CAKR"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export const CONTENT_ROUTE_IDS = {
|
|
2
|
+
workspace: 'content.workspace',
|
|
3
|
+
facts: 'content.facts',
|
|
4
|
+
governance: 'content.governance',
|
|
5
|
+
contributions: 'content.contributions',
|
|
6
|
+
article: 'content.article',
|
|
7
|
+
};
|
|
8
|
+
export const CONTENT_ROUTE_META = {
|
|
9
|
+
workspace: {
|
|
10
|
+
id: CONTENT_ROUTE_IDS.workspace,
|
|
11
|
+
title: 'Contents',
|
|
12
|
+
description: 'Author, review, and publish content records against the content module workflows.',
|
|
13
|
+
defaultPath: '/workspace',
|
|
14
|
+
nav: {
|
|
15
|
+
label: 'Workspace',
|
|
16
|
+
description: 'Authoring and publishing workspace',
|
|
17
|
+
icon: 'file-text',
|
|
18
|
+
order: 10,
|
|
19
|
+
group: 'content',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
governance: {
|
|
23
|
+
id: CONTENT_ROUTE_IDS.governance,
|
|
24
|
+
title: 'Governance Admin',
|
|
25
|
+
description: 'Manage review policies, profiles, and publication assignments for governed content.',
|
|
26
|
+
defaultPath: '/governance',
|
|
27
|
+
nav: {
|
|
28
|
+
label: 'Governance',
|
|
29
|
+
description: 'Policy, profile, and assignment management',
|
|
30
|
+
icon: 'shield-check',
|
|
31
|
+
order: 20,
|
|
32
|
+
group: 'content',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
facts: {
|
|
36
|
+
id: CONTENT_ROUTE_IDS.facts,
|
|
37
|
+
title: 'Fact Catalog',
|
|
38
|
+
description: 'Browse extracted facts, search by text or domain, and confirm what content workflows can cite.',
|
|
39
|
+
defaultPath: '/facts',
|
|
40
|
+
nav: {
|
|
41
|
+
label: 'Facts',
|
|
42
|
+
description: 'Browse indexed facts and confidence',
|
|
43
|
+
icon: 'sparkles',
|
|
44
|
+
order: 15,
|
|
45
|
+
group: 'content',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
contributions: {
|
|
49
|
+
id: CONTENT_ROUTE_IDS.contributions,
|
|
50
|
+
title: 'Contribution Intake and Review',
|
|
51
|
+
description: 'Review contributor submissions, moderation state, and promotion flows into content.',
|
|
52
|
+
defaultPath: '/contributions',
|
|
53
|
+
nav: {
|
|
54
|
+
label: 'Contributions',
|
|
55
|
+
description: 'Contributor intake, moderation, and promotion',
|
|
56
|
+
icon: 'inbox',
|
|
57
|
+
order: 30,
|
|
58
|
+
group: 'content',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
article: {
|
|
62
|
+
id: CONTENT_ROUTE_IDS.article,
|
|
63
|
+
title: 'Published article',
|
|
64
|
+
description: 'Render a published content record with its public transparency information.',
|
|
65
|
+
defaultPath: '/articles/[slug]',
|
|
66
|
+
loadKind: 'page',
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
const CONTENT_NAV_ROUTE_KEYS = [
|
|
70
|
+
'workspace',
|
|
71
|
+
'facts',
|
|
72
|
+
'governance',
|
|
73
|
+
'contributions',
|
|
74
|
+
];
|
|
75
|
+
export function getContentRouteDefaultPath(routeId) {
|
|
76
|
+
const route = Object.values(CONTENT_ROUTE_META).find((entry) => entry.id === routeId);
|
|
77
|
+
if (!route) {
|
|
78
|
+
throw new Error(`Unknown content route id: ${routeId}`);
|
|
79
|
+
}
|
|
80
|
+
return route.defaultPath;
|
|
81
|
+
}
|
|
82
|
+
export function buildPublishedArticlePath(slug, basePath = CONTENT_ROUTE_META.article.defaultPath) {
|
|
83
|
+
const normalizedBase = basePath.replace(/\/\[[^/]+\]$/, '');
|
|
84
|
+
return `${normalizedBase}/${slug}`;
|
|
85
|
+
}
|
|
86
|
+
export function createContentRouteNavigation(pathOverrides = {}) {
|
|
87
|
+
return CONTENT_NAV_ROUTE_KEYS.map((routeKey) => {
|
|
88
|
+
const route = CONTENT_ROUTE_META[routeKey];
|
|
89
|
+
return {
|
|
90
|
+
routeId: route.id,
|
|
91
|
+
href: pathOverrides[route.id] || route.defaultPath,
|
|
92
|
+
label: route.nav.label,
|
|
93
|
+
description: route.nav.description,
|
|
94
|
+
icon: route.nav.icon,
|
|
95
|
+
order: route.nav.order,
|
|
96
|
+
group: route.nav.group,
|
|
97
|
+
};
|
|
98
|
+
}).sort((left, right) => (left.order || 0) - (right.order || 0));
|
|
99
|
+
}
|
|
100
|
+
export const CONTENT_DEFAULT_ROUTE_NAVIGATION = createContentRouteNavigation();
|
|
101
|
+
export function getContentRouteHref(navigation, routeId) {
|
|
102
|
+
return (navigation.find((item) => item.routeId === routeId)?.href ||
|
|
103
|
+
getContentRouteDefaultPath(routeId));
|
|
104
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content component types
|
|
3
|
+
*
|
|
4
|
+
* Shared types for Article, Markdown, and other content components.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Article data structure
|
|
8
|
+
* Matches database schema with snake_case fields
|
|
9
|
+
*/
|
|
10
|
+
export interface Article {
|
|
11
|
+
/** Unique identifier */
|
|
12
|
+
id: string;
|
|
13
|
+
/** URL-friendly identifier */
|
|
14
|
+
slug: string;
|
|
15
|
+
/** Article title */
|
|
16
|
+
title: string;
|
|
17
|
+
/** Article description/summary */
|
|
18
|
+
description: string | null;
|
|
19
|
+
/** Publication date as ISO string */
|
|
20
|
+
publish_date: string | null;
|
|
21
|
+
/** Author name */
|
|
22
|
+
author: string | null;
|
|
23
|
+
/** Tags as JSON string, comma-separated list, or parsed string array */
|
|
24
|
+
tags: string | string[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Props for the ArticleCard component
|
|
28
|
+
*/
|
|
29
|
+
export interface ArticleCardProps {
|
|
30
|
+
/** Article data to display */
|
|
31
|
+
article: Article;
|
|
32
|
+
/** Show article excerpt/description */
|
|
33
|
+
showExcerpt?: boolean;
|
|
34
|
+
/** Show publication date */
|
|
35
|
+
showDate?: boolean;
|
|
36
|
+
/** Show author name */
|
|
37
|
+
showAuthor?: boolean;
|
|
38
|
+
/** Show tags */
|
|
39
|
+
showTags?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Props for the ArticleList component
|
|
43
|
+
*/
|
|
44
|
+
export interface ArticleListProps {
|
|
45
|
+
/** Array of articles to display */
|
|
46
|
+
articles: Article[];
|
|
47
|
+
/** Number of columns in grid (or 'auto') */
|
|
48
|
+
columns?: number | 'auto';
|
|
49
|
+
/** Show article excerpts */
|
|
50
|
+
showExcerpt?: boolean;
|
|
51
|
+
/** Show publication dates */
|
|
52
|
+
showDate?: boolean;
|
|
53
|
+
/** Show author names */
|
|
54
|
+
showAuthor?: boolean;
|
|
55
|
+
/** Show tags */
|
|
56
|
+
showTags?: boolean;
|
|
57
|
+
/** Message when no articles */
|
|
58
|
+
emptyMessage?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Props for the Markdown component
|
|
62
|
+
*/
|
|
63
|
+
export interface MarkdownProps {
|
|
64
|
+
/** Markdown content to render */
|
|
65
|
+
content: string;
|
|
66
|
+
/** Optional CSS class for styling */
|
|
67
|
+
class?: string;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/svelte/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,qCAAqC;IACrC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,kBAAkB;IAClB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,wEAAwE;IACxE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8BAA8B;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,4BAA4B;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { AIClient, AIClientOptions } from '@happyvertical/ai';
|
|
2
|
+
import { StaticMapProvider } from '@happyvertical/geo';
|
|
3
|
+
import { HeadlineCardTemplate } from '@happyvertical/images';
|
|
4
|
+
import { DatabaseConfig } from '@happyvertical/smrt-core';
|
|
5
|
+
import { Image } from '@happyvertical/smrt-images';
|
|
6
|
+
import { Content } from './content';
|
|
7
|
+
/**
|
|
8
|
+
* Available thumbnail generation strategies
|
|
9
|
+
*/
|
|
10
|
+
export type ThumbnailStrategy = 'headline-card' | 'static-map' | 'ai-generate';
|
|
11
|
+
/**
|
|
12
|
+
* Base options for all strategies
|
|
13
|
+
*/
|
|
14
|
+
interface BaseThumbnailOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Generation strategy
|
|
17
|
+
*/
|
|
18
|
+
strategy: ThumbnailStrategy;
|
|
19
|
+
/**
|
|
20
|
+
* Width in pixels
|
|
21
|
+
* @default 1200
|
|
22
|
+
*/
|
|
23
|
+
width?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Height in pixels
|
|
26
|
+
* @default 630
|
|
27
|
+
*/
|
|
28
|
+
height?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Options for headline card strategy
|
|
32
|
+
*/
|
|
33
|
+
export interface HeadlineCardThumbnailOptions extends BaseThumbnailOptions {
|
|
34
|
+
strategy: 'headline-card';
|
|
35
|
+
/**
|
|
36
|
+
* Primary brand color (hex)
|
|
37
|
+
* @default '#3b82f6'
|
|
38
|
+
*/
|
|
39
|
+
brandColor?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Background color (hex)
|
|
42
|
+
* @default '#ffffff'
|
|
43
|
+
*/
|
|
44
|
+
backgroundColor?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional subtitle/category text
|
|
47
|
+
*/
|
|
48
|
+
subtitle?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Optional logo URL
|
|
51
|
+
*/
|
|
52
|
+
logoUrl?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Template style
|
|
55
|
+
* @default 'default'
|
|
56
|
+
*/
|
|
57
|
+
template?: HeadlineCardTemplate;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Options for static map strategy
|
|
61
|
+
*/
|
|
62
|
+
export interface StaticMapThumbnailOptions extends BaseThumbnailOptions {
|
|
63
|
+
strategy: 'static-map';
|
|
64
|
+
/**
|
|
65
|
+
* Map provider
|
|
66
|
+
* @default 'mapbox'
|
|
67
|
+
*/
|
|
68
|
+
mapProvider?: StaticMapProvider;
|
|
69
|
+
/**
|
|
70
|
+
* Zoom level (1-20)
|
|
71
|
+
* @default 14
|
|
72
|
+
*/
|
|
73
|
+
zoom?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Marker color
|
|
76
|
+
* @default 'e74c3c'
|
|
77
|
+
*/
|
|
78
|
+
markerColor?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Mapbox style (if using mapbox provider)
|
|
81
|
+
*/
|
|
82
|
+
mapboxStyle?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Google map type (if using google provider)
|
|
85
|
+
*/
|
|
86
|
+
googleMapType?: 'roadmap' | 'satellite' | 'terrain' | 'hybrid';
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Options for AI generation strategy
|
|
90
|
+
*/
|
|
91
|
+
export interface AIGenerateThumbnailOptions extends BaseThumbnailOptions {
|
|
92
|
+
strategy: 'ai-generate';
|
|
93
|
+
/**
|
|
94
|
+
* AI provider configuration
|
|
95
|
+
*/
|
|
96
|
+
ai?: AIClientOptions | AIClient;
|
|
97
|
+
/**
|
|
98
|
+
* Custom prompt for image generation
|
|
99
|
+
* If not provided, generates based on content title/body
|
|
100
|
+
*/
|
|
101
|
+
prompt?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Style hint for image generation
|
|
104
|
+
* @default 'photorealistic'
|
|
105
|
+
*/
|
|
106
|
+
style?: 'photorealistic' | 'illustration' | 'abstract' | 'minimal';
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Union type for all thumbnail options
|
|
110
|
+
*/
|
|
111
|
+
export type ThumbnailOptions = HeadlineCardThumbnailOptions | StaticMapThumbnailOptions | AIGenerateThumbnailOptions;
|
|
112
|
+
/**
|
|
113
|
+
* Options for ThumbnailGenerator
|
|
114
|
+
*/
|
|
115
|
+
export interface ThumbnailGeneratorOptions {
|
|
116
|
+
/**
|
|
117
|
+
* Database configuration for storing generated images
|
|
118
|
+
*/
|
|
119
|
+
db?: DatabaseConfig;
|
|
120
|
+
/**
|
|
121
|
+
* Alias for `db` — mirrors the `SmrtClassOptions.persistence` alias so
|
|
122
|
+
* callers can pass the same options shape they use for SmrtObject/Collection.
|
|
123
|
+
*
|
|
124
|
+
* @deprecated Prefer `db`. Retained for parity with `SmrtClassOptions`.
|
|
125
|
+
*/
|
|
126
|
+
persistence?: DatabaseConfig;
|
|
127
|
+
/**
|
|
128
|
+
* AI client configuration for AI-generated thumbnails
|
|
129
|
+
*/
|
|
130
|
+
ai?: AIClientOptions | AIClient;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* ThumbnailGenerator creates thumbnails for content using various strategies
|
|
134
|
+
*/
|
|
135
|
+
export declare class ThumbnailGenerator {
|
|
136
|
+
private content;
|
|
137
|
+
private options;
|
|
138
|
+
constructor(content: Content, options?: ThumbnailGeneratorOptions);
|
|
139
|
+
/**
|
|
140
|
+
* Generate a thumbnail using the specified strategy
|
|
141
|
+
*/
|
|
142
|
+
generate(options: ThumbnailOptions): Promise<Image>;
|
|
143
|
+
/**
|
|
144
|
+
* Generate a headline card thumbnail
|
|
145
|
+
*/
|
|
146
|
+
private generateHeadlineCard;
|
|
147
|
+
/**
|
|
148
|
+
* Generate a static map thumbnail
|
|
149
|
+
*/
|
|
150
|
+
private generateStaticMap;
|
|
151
|
+
/**
|
|
152
|
+
* Generate a thumbnail using AI image generation
|
|
153
|
+
*/
|
|
154
|
+
private generateWithAI;
|
|
155
|
+
/**
|
|
156
|
+
* Build a prompt for AI image generation based on content.
|
|
157
|
+
*
|
|
158
|
+
* Resolves via `@happyvertical/smrt-prompts` so tenants can override the
|
|
159
|
+
* template/profile/model/params at runtime. Only non-PII content fields
|
|
160
|
+
* (title, description) and the caller-supplied style hint are passed.
|
|
161
|
+
* Internal IDs and the freeform `metadata` blob are intentionally excluded.
|
|
162
|
+
*
|
|
163
|
+
* Returns the full ResolvedPrompt (text + ai config) so the caller can
|
|
164
|
+
* forward `model`/`params` overrides to `ai.generateImage()`. Returning
|
|
165
|
+
* only the text would silently drop the editable model/params overrides.
|
|
166
|
+
*/
|
|
167
|
+
private buildAIPrompt;
|
|
168
|
+
/**
|
|
169
|
+
* Create an Image object from a buffer
|
|
170
|
+
*/
|
|
171
|
+
private createImageFromBuffer;
|
|
172
|
+
}
|
|
173
|
+
export {};
|
|
174
|
+
//# sourceMappingURL=thumbnail-generator.d.ts.map
|