@happyvertical/smrt-content 0.37.2 → 0.37.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"playground.js","sources":["../src/svelte/playground.ts"],"sourcesContent":["import type {\n ApiResponse,\n ContentGovernanceAssignmentData,\n ContentGovernanceDefinitionsData,\n ContentGovernanceProfileData,\n ContentReviewPolicyData,\n} from '../mock-smrt-client';\nimport { CONTENT_MODULE_META } from '../ui.js';\nimport type { ContentGovernanceManagerClient } from './governance-manager-client';\n\nconst DEFAULT_CONTENT_PLAYGROUND_API_BASE_URL = '/api/v1';\n\ntype ContentPlaygroundGlobal = typeof globalThis & {\n __SMRT_CONTENT_PLAYGROUND_API_BASE_URL__?: string;\n location?: {\n search: string;\n };\n};\n\nfunction resolveContentPlaygroundApiBaseUrl(): string {\n const configuredViaGlobal = (globalThis as ContentPlaygroundGlobal)\n .__SMRT_CONTENT_PLAYGROUND_API_BASE_URL__;\n if (configuredViaGlobal) {\n return configuredViaGlobal;\n }\n\n const browserLocation = (globalThis as ContentPlaygroundGlobal).location;\n if (browserLocation) {\n const configuredViaQuery = new URLSearchParams(browserLocation.search).get(\n 'smrtContentApiBaseUrl',\n );\n\n if (configuredViaQuery) {\n return configuredViaQuery;\n }\n }\n\n return DEFAULT_CONTENT_PLAYGROUND_API_BASE_URL;\n}\n\nconst sampleArticles = [\n {\n id: 'article-aurora-kitchen',\n slug: 'aurora-kitchen-notes',\n title: 'Aurora Kitchen Notes',\n description:\n 'A reference article card preview showing how editorial metadata lands in the package playground.',\n publish_date: '2026-03-14T12:00:00.000Z',\n author: 'Editorial Systems',\n tags: ['release', 'editorial', 'qa'],\n },\n {\n id: 'article-governance-habits',\n slug: 'governance-habits',\n title: 'Governance Habits That Scale',\n description:\n 'Teams can move fast when quality gates are visible, lightweight, and shared with contributors.',\n publish_date: '2026-03-19T09:30:00.000Z',\n author: 'Content Ops',\n tags: ['governance', 'quality', 'workflows'],\n },\n];\n\nconst sampleContributions = [\n {\n id: 'contribution-1',\n title: 'Spring buyer guide',\n contributionTypeKey: 'article',\n status: 'needs_changes',\n revisionCount: 2,\n editorNotes: 'Please tighten the sourcing notes in the opening section.',\n contributorName: 'Taylor Rowan',\n contributorEmail: 'taylor@example.com',\n intakeDecision: 'needs_changes',\n body: 'The spring buyer guide draft is attached, with sourcing notes for the opening section and the product comparison appendix.',\n updatedAt: '2026-03-20T15:18:00.000Z',\n },\n {\n id: 'contribution-2',\n title: 'Field report: Pacific logistics',\n contributionTypeKey: 'report',\n status: 'submitted',\n revisionCount: 1,\n contributorName: 'Jordan Lee',\n contributorEmail: 'jordan@example.com',\n intakeDecision: 'submitted',\n body: 'Field notes from the Pacific corridor include updated shipping windows, route constraints, and operator interviews.',\n updatedAt: '2026-03-18T10:40:00.000Z',\n },\n];\n\nconst sampleGovernanceDefinitions: ContentGovernanceDefinitionsData = {\n effective: {\n policies: [\n {\n id: 'policy-facts',\n key: 'facts',\n label: 'Facts review',\n kind: 'facts',\n instructions: 'Compare claims against linked facts before publication.',\n enabled: true,\n },\n {\n id: 'policy-style',\n key: 'style',\n label: 'Style review',\n kind: 'custom',\n instructions: 'Apply newsroom tone, structure, and clarity guidelines.',\n enabled: true,\n },\n ],\n profiles: [\n {\n id: 'profile-publication',\n key: 'publication',\n label: 'Publication',\n description: 'Required before governed content can be published.',\n enabled: true,\n requirements: [\n {\n policyKey: 'facts',\n label: 'Facts review',\n blocking: true,\n acceptedStatuses: ['passed'],\n },\n {\n policyKey: 'style',\n label: 'Style review',\n blocking: false,\n acceptedStatuses: ['passed', 'warning'],\n },\n ],\n },\n ],\n assignments: [\n {\n id: 'assignment-article',\n key: 'article',\n label: 'Articles',\n contentType: 'article',\n contentVariant: null,\n enabled: true,\n factLinkingEnabled: true,\n transparencyEnabled: true,\n publicationProfileKey: 'publication',\n correctionProfileKey: null,\n enforcePublishReadiness: true,\n defaultFactRelationship: 'supports',\n },\n ],\n },\n persisted: {\n policies: [\n {\n id: 'policy-style',\n key: 'style',\n label: 'Style review',\n kind: 'custom',\n instructions: 'Apply newsroom tone, structure, and clarity guidelines.',\n enabled: true,\n },\n ],\n profiles: [\n {\n id: 'profile-publication',\n key: 'publication',\n label: 'Publication',\n description: 'Required before governed content can be published.',\n enabled: true,\n requirements: [\n {\n policyKey: 'facts',\n label: 'Facts review',\n blocking: true,\n acceptedStatuses: ['passed'],\n },\n {\n policyKey: 'style',\n label: 'Style review',\n blocking: false,\n acceptedStatuses: ['passed', 'warning'],\n },\n ],\n },\n ],\n assignments: [\n {\n id: 'assignment-article',\n key: 'article',\n label: 'Articles',\n contentType: 'article',\n contentVariant: null,\n enabled: true,\n factLinkingEnabled: true,\n transparencyEnabled: true,\n publicationProfileKey: 'publication',\n correctionProfileKey: null,\n enforcePublishReadiness: true,\n defaultFactRelationship: 'supports',\n },\n ],\n },\n};\n\nconst sampleEditorContent = {\n id: 'content-playground-editor',\n slug: 'playground-editor-reference',\n title: 'Reference editorial draft',\n description:\n 'A working editor preview with copy, references, and assets already populated.',\n body: `# Editorial Draft\n\nThis preview is meant to feel like a real authoring surface.\n\n- tighten the lede\n- verify product claims\n- attach supporting references`,\n author: 'Editorial Systems',\n type: 'article',\n status: 'draft',\n state: 'active',\n source: 'manual',\n tags: ['editorial', 'playground'],\n referenceIds: ['fact-aurora', 'source-governance'],\n assetIds: [],\n assets: [],\n};\n\nconst noop = () => {};\n\nfunction cloneValue<T>(value: T): T {\n return JSON.parse(JSON.stringify(value)) as T;\n}\n\nfunction buildPlaygroundResponse<T>(data: T): ApiResponse<T> {\n return {\n data,\n success: true,\n };\n}\n\nfunction upsertByIdOrKey<\n T extends {\n id?: string;\n key?: string;\n },\n>(items: T[], value: Partial<T>, prefix: string): T[] {\n const id = value.id || `${prefix}-${value.key || items.length + 1}`;\n const nextValue = {\n ...value,\n id,\n } as T;\n\n const index = items.findIndex(\n (item) => item.id === id || (!!value.key && item.key === value.key),\n );\n\n if (index === -1) {\n return [...items, nextValue];\n }\n\n const nextItems = [...items];\n nextItems[index] = {\n ...nextItems[index],\n ...nextValue,\n };\n return nextItems;\n}\n\nfunction createGovernancePlaygroundClient(\n seed = sampleGovernanceDefinitions,\n): ContentGovernanceManagerClient {\n let policies = cloneValue(seed.effective.policies);\n let profiles = cloneValue(seed.effective.profiles);\n let assignments = cloneValue(seed.effective.assignments);\n\n const getDefinitions = (): ContentGovernanceDefinitionsData => ({\n effective: {\n policies: cloneValue(policies),\n profiles: cloneValue(profiles),\n assignments: cloneValue(assignments),\n },\n persisted: {\n policies: cloneValue(policies),\n profiles: cloneValue(profiles),\n assignments: cloneValue(assignments),\n },\n });\n\n return {\n contents: {\n getGovernanceDefinitions: async () =>\n buildPlaygroundResponse(getDefinitions()),\n },\n contentGovernancePolicies: {\n create: async (policy: Partial<ContentReviewPolicyData>) => {\n policies = upsertByIdOrKey(policies, policy, 'policy');\n return buildPlaygroundResponse(policies[policies.length - 1]);\n },\n update: async (id: string, policy: Partial<ContentReviewPolicyData>) => {\n policies = upsertByIdOrKey(policies, { ...policy, id }, 'policy');\n return buildPlaygroundResponse(\n policies.find((item) => item.id === id)!,\n );\n },\n delete: async (id: string) => {\n policies = policies.filter((item) => item.id !== id);\n return buildPlaygroundResponse(undefined);\n },\n },\n contentGovernanceProfiles: {\n create: async (profile: Partial<ContentGovernanceProfileData>) => {\n profiles = upsertByIdOrKey(profiles, profile, 'profile');\n return buildPlaygroundResponse(profiles[profiles.length - 1]);\n },\n update: async (\n id: string,\n profile: Partial<ContentGovernanceProfileData>,\n ) => {\n profiles = upsertByIdOrKey(profiles, { ...profile, id }, 'profile');\n return buildPlaygroundResponse(\n profiles.find((item) => item.id === id)!,\n );\n },\n delete: async (id: string) => {\n profiles = profiles.filter((item) => item.id !== id);\n return buildPlaygroundResponse(undefined);\n },\n },\n contentGovernanceAssignments: {\n create: async (assignment: Partial<ContentGovernanceAssignmentData>) => {\n assignments = upsertByIdOrKey(assignments, assignment, 'assignment');\n return buildPlaygroundResponse(assignments[assignments.length - 1]);\n },\n update: async (\n id: string,\n assignment: Partial<ContentGovernanceAssignmentData>,\n ) => {\n assignments = upsertByIdOrKey(\n assignments,\n { ...assignment, id },\n 'assignment',\n );\n return buildPlaygroundResponse(\n assignments.find((item) => item.id === id)!,\n );\n },\n delete: async (id: string) => {\n assignments = assignments.filter((item) => item.id !== id);\n return buildPlaygroundResponse(undefined);\n },\n },\n };\n}\n\nconst markdownExample = `# Content Playground\n\nThis preview module lives in \\`src/svelte/playground.ts\\`.\n\n- Package-owned previews stay close to the real components\n- The shared host simply discovers and renders them\n- Live entries can still point at the package's generated API routes`;\n\n// Keep the published playground module importable from Node so `smrt\n// playground list` can inspect entry metadata without needing a Svelte loader.\nconst loadArticleCard = () => import('./components/ArticleCard.svelte');\nconst loadArticleList = () => import('./components/ArticleList.svelte');\nconst loadContentEditor = () => import('./components/ContentEditor.svelte');\nconst loadContentContributionInbox = () =>\n import('./components/ContentContributionInbox.svelte');\nconst loadContentContributionPortal = () =>\n import('./components/ContentContributionPortal.svelte');\nconst loadContentGovernanceManager = () =>\n import('./components/ContentGovernanceManager.svelte');\nconst loadMarkdown = () => import('./components/Markdown.svelte');\nconst governancePlaygroundClient = createGovernancePlaygroundClient();\n\nexport default {\n packageName: '@happyvertical/smrt-content',\n displayName: 'Content',\n description: CONTENT_MODULE_META.description,\n moduleMeta: CONTENT_MODULE_META,\n entries: [\n {\n id: 'article-card',\n slotId: 'article-card',\n title: 'Article Card',\n description: 'Editorial teaser card with tags and metadata.',\n loadComponent: loadArticleCard,\n order: 1,\n props: {\n article: sampleArticles[0],\n showTags: true,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'article-list',\n slotId: 'article-list',\n title: 'Article List',\n description: 'Reference list/grid layout for published content.',\n loadComponent: loadArticleList,\n order: 2,\n props: {\n articles: sampleArticles,\n showTags: true,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'markdown',\n slotId: 'markdown',\n title: 'Markdown Renderer',\n description: 'Safe markdown rendering with a small editorial snippet.',\n loadComponent: loadMarkdown,\n order: 3,\n props: {\n content: markdownExample,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'content-editor',\n title: 'Content Editor',\n description: 'Authoring surface for body copy, references, and media.',\n loadComponent: loadContentEditor,\n order: 4,\n props: {\n apiBaseUrl: resolveContentPlaygroundApiBaseUrl(),\n content: sampleEditorContent,\n contentId: sampleEditorContent.id,\n agentChatEnabled: false,\n agentChatNotice:\n 'The shared playground keeps the editor preview local. Run the content package app when you want the live agent chat routes too.',\n onSave: noop,\n onCancel: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'contribution-portal',\n title: 'Contribution Portal',\n description: 'Contributor-facing inbox and submission status view.',\n loadComponent: loadContentContributionPortal,\n order: 5,\n props: {\n contributions: sampleContributions,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'contribution-inbox',\n title: 'Contribution Inbox',\n description:\n 'Editorial review queue for approving, rejecting, or requesting changes.',\n loadComponent: loadContentContributionInbox,\n order: 6,\n props: {\n contributions: sampleContributions,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'governance-manager',\n title: 'Governance Manager',\n description:\n 'Administrative view with in-memory mock data and optional live package routes.',\n loadComponent: loadContentGovernanceManager,\n order: 7,\n modes: {\n mock: {\n label: 'Mock',\n description:\n 'Uses an in-memory governance client so the shared playground works without a package-local dev server.',\n props: {\n client: governancePlaygroundClient,\n },\n },\n live: {\n label: 'Live',\n description:\n 'Requires the content package dev server and generated routes. Override the base URL with ?smrtContentApiBaseUrl=... or window.__SMRT_CONTENT_PLAYGROUND_API_BASE_URL__ when needed.',\n props: {\n apiBaseUrl: resolveContentPlaygroundApiBaseUrl(),\n },\n },\n },\n },\n ],\n};\n"],"names":[],"mappings":";AAUA,MAAM,0CAA0C;AAShD,SAAS,qCAA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b,eAAe;AAAA,MACf,OAAO;AAAA,MACP,OAAO;AAAA,QACL,YAAY,mCAAA;AAAA,QACZ,SAAS;AAAA,QACT,WAAW,oBAAoB;AAAA,QAC/B,kBAAkB;AAAA,QAClB,iBACE;AAAA,QACF,QAAQ;AAAA,QACR,UAAU;AAAA,MAAA;AAAA,MAEZ,OAAO;AAAA,QACL,MAAM;AAAA,UACJ,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF;AAAA,IAEF;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,aAAa;AAAA,MACb,eAAe;AAAA,MACf,OAAO;AAAA,MACP,OAAO;AAAA,QACL,eAAe;AAAA,MAAA;AAAA,MAEjB,OAAO;AAAA,QACL,MAAM;AAAA,UACJ,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF;AAAA,IAEF;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,aACE;AAAA,MACF,eAAe;AAAA,MACf,OAAO;AAAA,MACP,OAAO;AAAA,QACL,eAAe;AAAA,MAAA;AAAA,MAEjB,OAAO;AAAA,QACL,MAAM;AAAA,UACJ,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF;AAAA,IAEF;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,aACE;AAAA,MACF,eAAe;AAAA,MACf,OAAO;AAAA,MACP,OAAO;AAAA,QACL,MAAM;AAAA,UACJ,OAAO;AAAA,UACP,aACE;AAAA,UACF,OAAO;AAAA,YACL,QAAQ;AAAA,UAAA;AAAA,QACV;AAAA,QAEF,MAAM;AAAA,UACJ,OAAO;AAAA,UACP,aACE;AAAA,UACF,OAAO;AAAA,YACL,YAAY,mCAAA;AAAA,UAAmC;AAAA,QACjD;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"playground.js","names":[],"sources":["../src/svelte/playground.ts"],"sourcesContent":["import type {\n ApiResponse,\n ContentGovernanceAssignmentData,\n ContentGovernanceDefinitionsData,\n ContentGovernanceProfileData,\n ContentReviewPolicyData,\n} from '../mock-smrt-client';\nimport { CONTENT_MODULE_META } from '../ui.js';\nimport type { ContentGovernanceManagerClient } from './governance-manager-client';\n\nconst DEFAULT_CONTENT_PLAYGROUND_API_BASE_URL = '/api/v1';\n\ntype ContentPlaygroundGlobal = typeof globalThis & {\n __SMRT_CONTENT_PLAYGROUND_API_BASE_URL__?: string;\n location?: {\n search: string;\n };\n};\n\nfunction resolveContentPlaygroundApiBaseUrl(): string {\n const configuredViaGlobal = (globalThis as ContentPlaygroundGlobal)\n .__SMRT_CONTENT_PLAYGROUND_API_BASE_URL__;\n if (configuredViaGlobal) {\n return configuredViaGlobal;\n }\n\n const browserLocation = (globalThis as ContentPlaygroundGlobal).location;\n if (browserLocation) {\n const configuredViaQuery = new URLSearchParams(browserLocation.search).get(\n 'smrtContentApiBaseUrl',\n );\n\n if (configuredViaQuery) {\n return configuredViaQuery;\n }\n }\n\n return DEFAULT_CONTENT_PLAYGROUND_API_BASE_URL;\n}\n\nconst sampleArticles = [\n {\n id: 'article-aurora-kitchen',\n slug: 'aurora-kitchen-notes',\n title: 'Aurora Kitchen Notes',\n description:\n 'A reference article card preview showing how editorial metadata lands in the package playground.',\n publish_date: '2026-03-14T12:00:00.000Z',\n author: 'Editorial Systems',\n tags: ['release', 'editorial', 'qa'],\n },\n {\n id: 'article-governance-habits',\n slug: 'governance-habits',\n title: 'Governance Habits That Scale',\n description:\n 'Teams can move fast when quality gates are visible, lightweight, and shared with contributors.',\n publish_date: '2026-03-19T09:30:00.000Z',\n author: 'Content Ops',\n tags: ['governance', 'quality', 'workflows'],\n },\n];\n\nconst sampleContributions = [\n {\n id: 'contribution-1',\n title: 'Spring buyer guide',\n contributionTypeKey: 'article',\n status: 'needs_changes',\n revisionCount: 2,\n editorNotes: 'Please tighten the sourcing notes in the opening section.',\n contributorName: 'Taylor Rowan',\n contributorEmail: 'taylor@example.com',\n intakeDecision: 'needs_changes',\n body: 'The spring buyer guide draft is attached, with sourcing notes for the opening section and the product comparison appendix.',\n updatedAt: '2026-03-20T15:18:00.000Z',\n },\n {\n id: 'contribution-2',\n title: 'Field report: Pacific logistics',\n contributionTypeKey: 'report',\n status: 'submitted',\n revisionCount: 1,\n contributorName: 'Jordan Lee',\n contributorEmail: 'jordan@example.com',\n intakeDecision: 'submitted',\n body: 'Field notes from the Pacific corridor include updated shipping windows, route constraints, and operator interviews.',\n updatedAt: '2026-03-18T10:40:00.000Z',\n },\n];\n\nconst sampleGovernanceDefinitions: ContentGovernanceDefinitionsData = {\n effective: {\n policies: [\n {\n id: 'policy-facts',\n key: 'facts',\n label: 'Facts review',\n kind: 'facts',\n instructions: 'Compare claims against linked facts before publication.',\n enabled: true,\n },\n {\n id: 'policy-style',\n key: 'style',\n label: 'Style review',\n kind: 'custom',\n instructions: 'Apply newsroom tone, structure, and clarity guidelines.',\n enabled: true,\n },\n ],\n profiles: [\n {\n id: 'profile-publication',\n key: 'publication',\n label: 'Publication',\n description: 'Required before governed content can be published.',\n enabled: true,\n requirements: [\n {\n policyKey: 'facts',\n label: 'Facts review',\n blocking: true,\n acceptedStatuses: ['passed'],\n },\n {\n policyKey: 'style',\n label: 'Style review',\n blocking: false,\n acceptedStatuses: ['passed', 'warning'],\n },\n ],\n },\n ],\n assignments: [\n {\n id: 'assignment-article',\n key: 'article',\n label: 'Articles',\n contentType: 'article',\n contentVariant: null,\n enabled: true,\n factLinkingEnabled: true,\n transparencyEnabled: true,\n publicationProfileKey: 'publication',\n correctionProfileKey: null,\n enforcePublishReadiness: true,\n defaultFactRelationship: 'supports',\n },\n ],\n },\n persisted: {\n policies: [\n {\n id: 'policy-style',\n key: 'style',\n label: 'Style review',\n kind: 'custom',\n instructions: 'Apply newsroom tone, structure, and clarity guidelines.',\n enabled: true,\n },\n ],\n profiles: [\n {\n id: 'profile-publication',\n key: 'publication',\n label: 'Publication',\n description: 'Required before governed content can be published.',\n enabled: true,\n requirements: [\n {\n policyKey: 'facts',\n label: 'Facts review',\n blocking: true,\n acceptedStatuses: ['passed'],\n },\n {\n policyKey: 'style',\n label: 'Style review',\n blocking: false,\n acceptedStatuses: ['passed', 'warning'],\n },\n ],\n },\n ],\n assignments: [\n {\n id: 'assignment-article',\n key: 'article',\n label: 'Articles',\n contentType: 'article',\n contentVariant: null,\n enabled: true,\n factLinkingEnabled: true,\n transparencyEnabled: true,\n publicationProfileKey: 'publication',\n correctionProfileKey: null,\n enforcePublishReadiness: true,\n defaultFactRelationship: 'supports',\n },\n ],\n },\n};\n\nconst sampleEditorContent = {\n id: 'content-playground-editor',\n slug: 'playground-editor-reference',\n title: 'Reference editorial draft',\n description:\n 'A working editor preview with copy, references, and assets already populated.',\n body: `# Editorial Draft\n\nThis preview is meant to feel like a real authoring surface.\n\n- tighten the lede\n- verify product claims\n- attach supporting references`,\n author: 'Editorial Systems',\n type: 'article',\n status: 'draft',\n state: 'active',\n source: 'manual',\n tags: ['editorial', 'playground'],\n referenceIds: ['fact-aurora', 'source-governance'],\n assetIds: [],\n assets: [],\n};\n\nconst noop = () => {};\n\nfunction cloneValue<T>(value: T): T {\n return JSON.parse(JSON.stringify(value)) as T;\n}\n\nfunction buildPlaygroundResponse<T>(data: T): ApiResponse<T> {\n return {\n data,\n success: true,\n };\n}\n\nfunction upsertByIdOrKey<\n T extends {\n id?: string;\n key?: string;\n },\n>(items: T[], value: Partial<T>, prefix: string): T[] {\n const id = value.id || `${prefix}-${value.key || items.length + 1}`;\n const nextValue = {\n ...value,\n id,\n } as T;\n\n const index = items.findIndex(\n (item) => item.id === id || (!!value.key && item.key === value.key),\n );\n\n if (index === -1) {\n return [...items, nextValue];\n }\n\n const nextItems = [...items];\n nextItems[index] = {\n ...nextItems[index],\n ...nextValue,\n };\n return nextItems;\n}\n\nfunction createGovernancePlaygroundClient(\n seed = sampleGovernanceDefinitions,\n): ContentGovernanceManagerClient {\n let policies = cloneValue(seed.effective.policies);\n let profiles = cloneValue(seed.effective.profiles);\n let assignments = cloneValue(seed.effective.assignments);\n\n const getDefinitions = (): ContentGovernanceDefinitionsData => ({\n effective: {\n policies: cloneValue(policies),\n profiles: cloneValue(profiles),\n assignments: cloneValue(assignments),\n },\n persisted: {\n policies: cloneValue(policies),\n profiles: cloneValue(profiles),\n assignments: cloneValue(assignments),\n },\n });\n\n return {\n contents: {\n getGovernanceDefinitions: async () =>\n buildPlaygroundResponse(getDefinitions()),\n },\n contentGovernancePolicies: {\n create: async (policy: Partial<ContentReviewPolicyData>) => {\n policies = upsertByIdOrKey(policies, policy, 'policy');\n return buildPlaygroundResponse(policies[policies.length - 1]);\n },\n update: async (id: string, policy: Partial<ContentReviewPolicyData>) => {\n policies = upsertByIdOrKey(policies, { ...policy, id }, 'policy');\n return buildPlaygroundResponse(\n policies.find((item) => item.id === id)!,\n );\n },\n delete: async (id: string) => {\n policies = policies.filter((item) => item.id !== id);\n return buildPlaygroundResponse(undefined);\n },\n },\n contentGovernanceProfiles: {\n create: async (profile: Partial<ContentGovernanceProfileData>) => {\n profiles = upsertByIdOrKey(profiles, profile, 'profile');\n return buildPlaygroundResponse(profiles[profiles.length - 1]);\n },\n update: async (\n id: string,\n profile: Partial<ContentGovernanceProfileData>,\n ) => {\n profiles = upsertByIdOrKey(profiles, { ...profile, id }, 'profile');\n return buildPlaygroundResponse(\n profiles.find((item) => item.id === id)!,\n );\n },\n delete: async (id: string) => {\n profiles = profiles.filter((item) => item.id !== id);\n return buildPlaygroundResponse(undefined);\n },\n },\n contentGovernanceAssignments: {\n create: async (assignment: Partial<ContentGovernanceAssignmentData>) => {\n assignments = upsertByIdOrKey(assignments, assignment, 'assignment');\n return buildPlaygroundResponse(assignments[assignments.length - 1]);\n },\n update: async (\n id: string,\n assignment: Partial<ContentGovernanceAssignmentData>,\n ) => {\n assignments = upsertByIdOrKey(\n assignments,\n { ...assignment, id },\n 'assignment',\n );\n return buildPlaygroundResponse(\n assignments.find((item) => item.id === id)!,\n );\n },\n delete: async (id: string) => {\n assignments = assignments.filter((item) => item.id !== id);\n return buildPlaygroundResponse(undefined);\n },\n },\n };\n}\n\nconst markdownExample = `# Content Playground\n\nThis preview module lives in \\`src/svelte/playground.ts\\`.\n\n- Package-owned previews stay close to the real components\n- The shared host simply discovers and renders them\n- Live entries can still point at the package's generated API routes`;\n\n// Keep the published playground module importable from Node so `smrt\n// playground list` can inspect entry metadata without needing a Svelte loader.\nconst loadArticleCard = () => import('./components/ArticleCard.svelte');\nconst loadArticleList = () => import('./components/ArticleList.svelte');\nconst loadContentEditor = () => import('./components/ContentEditor.svelte');\nconst loadContentContributionInbox = () =>\n import('./components/ContentContributionInbox.svelte');\nconst loadContentContributionPortal = () =>\n import('./components/ContentContributionPortal.svelte');\nconst loadContentGovernanceManager = () =>\n import('./components/ContentGovernanceManager.svelte');\nconst loadMarkdown = () => import('./components/Markdown.svelte');\nconst governancePlaygroundClient = createGovernancePlaygroundClient();\n\nexport default {\n packageName: '@happyvertical/smrt-content',\n displayName: 'Content',\n description: CONTENT_MODULE_META.description,\n moduleMeta: CONTENT_MODULE_META,\n entries: [\n {\n id: 'article-card',\n slotId: 'article-card',\n title: 'Article Card',\n description: 'Editorial teaser card with tags and metadata.',\n loadComponent: loadArticleCard,\n order: 1,\n props: {\n article: sampleArticles[0],\n showTags: true,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'article-list',\n slotId: 'article-list',\n title: 'Article List',\n description: 'Reference list/grid layout for published content.',\n loadComponent: loadArticleList,\n order: 2,\n props: {\n articles: sampleArticles,\n showTags: true,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'markdown',\n slotId: 'markdown',\n title: 'Markdown Renderer',\n description: 'Safe markdown rendering with a small editorial snippet.',\n loadComponent: loadMarkdown,\n order: 3,\n props: {\n content: markdownExample,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'content-editor',\n title: 'Content Editor',\n description: 'Authoring surface for body copy, references, and media.',\n loadComponent: loadContentEditor,\n order: 4,\n props: {\n apiBaseUrl: resolveContentPlaygroundApiBaseUrl(),\n content: sampleEditorContent,\n contentId: sampleEditorContent.id,\n agentChatEnabled: false,\n agentChatNotice:\n 'The shared playground keeps the editor preview local. Run the content package app when you want the live agent chat routes too.',\n onSave: noop,\n onCancel: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'contribution-portal',\n title: 'Contribution Portal',\n description: 'Contributor-facing inbox and submission status view.',\n loadComponent: loadContentContributionPortal,\n order: 5,\n props: {\n contributions: sampleContributions,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'contribution-inbox',\n title: 'Contribution Inbox',\n description:\n 'Editorial review queue for approving, rejecting, or requesting changes.',\n loadComponent: loadContentContributionInbox,\n order: 6,\n props: {\n contributions: sampleContributions,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'governance-manager',\n title: 'Governance Manager',\n description:\n 'Administrative view with in-memory mock data and optional live package routes.',\n loadComponent: loadContentGovernanceManager,\n order: 7,\n modes: {\n mock: {\n label: 'Mock',\n description:\n 'Uses an in-memory governance client so the shared playground works without a package-local dev server.',\n props: {\n client: governancePlaygroundClient,\n },\n },\n live: {\n label: 'Live',\n description:\n 'Requires the content package dev server and generated routes. Override the base URL with ?smrtContentApiBaseUrl=... or window.__SMRT_CONTENT_PLAYGROUND_API_BASE_URL__ when needed.',\n props: {\n apiBaseUrl: resolveContentPlaygroundApiBaseUrl(),\n },\n },\n },\n },\n ],\n};\n"],"mappings":";;AAUA,IAAM,0CAA0C;AAShD,SAAS,qCAA6C;CACpD,MAAM,sBAAuB,WAC1B;CACH,IAAI,qBACF,OAAO;CAGT,MAAM,kBAAmB,WAAuC;CAChE,IAAI,iBAAiB;EACnB,MAAM,qBAAqB,IAAI,gBAAgB,gBAAgB,MAAM,CAAA,CAAE,IACrE,uBACF;EAEA,IAAI,oBACF,OAAO;CAEX;CAEA,OAAO;AACT;AAEA,IAA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OAAO;GACP,OAAO,EACL,SAAS,gBACX;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,eAAe;GACf,OAAO;GACP,OAAO;IACL,YAAY,mCAAmC;IAC/C,SAAS;IACT,WAAW,oBAAoB;IAC/B,kBAAkB;IAClB,iBACE;IACF,QAAQ;IACR,UAAU;GACZ;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,eAAe;GACf,OAAO;GACP,OAAO,EACL,eAAe,oBACjB;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO,EACL,eAAe,oBACjB;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO;IACL,MAAM;KACJ,OAAO;KACP,aACE;KACF,OAAO,EACL,QAAQ,2BACV;IACF;IACA,MAAM;KACJ,OAAO;KACP,aACE;KACF,OAAO,EACL,YAAY,mCAAmC,EACjD;IACF;GACF;EACF;CACF;AACF"}
@@ -1,74 +1,53 @@
1
+ //#region src/publish-readiness.ts
1
2
  function describeRequirement(requirement) {
2
- if (requirement.missing) {
3
- return `${requirement.label}: not run yet`;
4
- }
5
- if (requirement.stale) {
6
- return `${requirement.label}: stale, rerun required`;
7
- }
8
- if (requirement.latestStatus) {
9
- return `${requirement.label}: ${requirement.latestStatus}`;
10
- }
11
- return `${requirement.label}: not satisfied`;
3
+ if (requirement.missing) return `${requirement.label}: not run yet`;
4
+ if (requirement.stale) return `${requirement.label}: stale, rerun required`;
5
+ if (requirement.latestStatus) return `${requirement.label}: ${requirement.latestStatus}`;
6
+ return `${requirement.label}: not satisfied`;
12
7
  }
13
8
  function evaluateContentPublishReadiness(options) {
14
- if (options.status !== "published") {
15
- return null;
16
- }
17
- const enforce = options.enforce === true;
18
- if (!options.contentId || options.contentId === "new") {
19
- return {
20
- level: enforce ? "blocked" : "advisory",
21
- title: "Publication Needs A Saved Draft",
22
- message: "Save this governed content first so reviews can run before publication.",
23
- details: [],
24
- disableSave: enforce
25
- };
26
- }
27
- const profile = (options.reviewProfiles || []).find(
28
- (candidate) => candidate.profileKey === options.reviewProfileKey
29
- );
30
- if (!profile) {
31
- return {
32
- level: "ready",
33
- title: "No Publish Profile Configured",
34
- message: "No publication review profile is configured, so publish readiness is not being enforced here.",
35
- details: [],
36
- disableSave: false
37
- };
38
- }
39
- const unsatisfiedBlocking = profile.requirements.filter(
40
- (requirement) => requirement.blocking && !requirement.satisfied
41
- );
42
- if (unsatisfiedBlocking.length > 0) {
43
- return {
44
- level: enforce ? "blocked" : "advisory",
45
- title: enforce ? "Blocking Reviews Must Pass" : "Blocking Reviews Are Not Satisfied",
46
- message: enforce ? "Resolve the blocking review requirements before publishing this content." : "This content can still be published, but blocking review requirements are not yet satisfied.",
47
- details: unsatisfiedBlocking.map(describeRequirement),
48
- disableSave: enforce
49
- };
50
- }
51
- const incompleteRequirements = profile.requirements.filter(
52
- (requirement) => !requirement.satisfied
53
- );
54
- if (incompleteRequirements.length > 0 || !profile.complete) {
55
- return {
56
- level: "advisory",
57
- title: "Some Reviews Are Still Pending",
58
- message: "Blocking requirements are satisfied, but some advisory reviews are still missing or need follow-up.",
59
- details: incompleteRequirements.map(describeRequirement),
60
- disableSave: false
61
- };
62
- }
63
- return {
64
- level: "ready",
65
- title: "Ready To Publish",
66
- message: "All configured review requirements for this publication profile are satisfied.",
67
- details: [],
68
- disableSave: false
69
- };
9
+ if (options.status !== "published") return null;
10
+ const enforce = options.enforce === true;
11
+ if (!options.contentId || options.contentId === "new") return {
12
+ level: enforce ? "blocked" : "advisory",
13
+ title: "Publication Needs A Saved Draft",
14
+ message: "Save this governed content first so reviews can run before publication.",
15
+ details: [],
16
+ disableSave: enforce
17
+ };
18
+ const profile = (options.reviewProfiles || []).find((candidate) => candidate.profileKey === options.reviewProfileKey);
19
+ if (!profile) return {
20
+ level: "ready",
21
+ title: "No Publish Profile Configured",
22
+ message: "No publication review profile is configured, so publish readiness is not being enforced here.",
23
+ details: [],
24
+ disableSave: false
25
+ };
26
+ const unsatisfiedBlocking = profile.requirements.filter((requirement) => requirement.blocking && !requirement.satisfied);
27
+ if (unsatisfiedBlocking.length > 0) return {
28
+ level: enforce ? "blocked" : "advisory",
29
+ title: enforce ? "Blocking Reviews Must Pass" : "Blocking Reviews Are Not Satisfied",
30
+ message: enforce ? "Resolve the blocking review requirements before publishing this content." : "This content can still be published, but blocking review requirements are not yet satisfied.",
31
+ details: unsatisfiedBlocking.map(describeRequirement),
32
+ disableSave: enforce
33
+ };
34
+ const incompleteRequirements = profile.requirements.filter((requirement) => !requirement.satisfied);
35
+ if (incompleteRequirements.length > 0 || !profile.complete) return {
36
+ level: "advisory",
37
+ title: "Some Reviews Are Still Pending",
38
+ message: "Blocking requirements are satisfied, but some advisory reviews are still missing or need follow-up.",
39
+ details: incompleteRequirements.map(describeRequirement),
40
+ disableSave: false
41
+ };
42
+ return {
43
+ level: "ready",
44
+ title: "Ready To Publish",
45
+ message: "All configured review requirements for this publication profile are satisfied.",
46
+ details: [],
47
+ disableSave: false
48
+ };
70
49
  }
71
- export {
72
- evaluateContentPublishReadiness
73
- };
74
- //# sourceMappingURL=publish-readiness.js.map
50
+ //#endregion
51
+ export { evaluateContentPublishReadiness };
52
+
53
+ //# sourceMappingURL=publish-readiness.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"publish-readiness.js","sources":["../src/publish-readiness.ts"],"sourcesContent":["export interface PublishReadinessRequirement {\n label: string;\n blocking: boolean;\n missing: boolean;\n stale?: boolean;\n satisfied: boolean;\n latestStatus: string | null;\n}\n\nexport interface PublishReadinessProfile {\n profileKey: string;\n ready: boolean;\n complete: boolean;\n requirements: PublishReadinessRequirement[];\n}\n\nexport interface ContentPublishReadinessState {\n level: 'ready' | 'advisory' | 'blocked';\n title: string;\n message: string;\n details: string[];\n disableSave: boolean;\n}\n\nexport interface EvaluateContentPublishReadinessOptions {\n status?: string | null;\n contentId?: string | null;\n reviewProfileKey: string;\n reviewProfiles?: PublishReadinessProfile[] | null;\n enforce?: boolean;\n}\n\nfunction describeRequirement(requirement: PublishReadinessRequirement): string {\n if (requirement.missing) {\n return `${requirement.label}: not run yet`;\n }\n\n if (requirement.stale) {\n return `${requirement.label}: stale, rerun required`;\n }\n\n if (requirement.latestStatus) {\n return `${requirement.label}: ${requirement.latestStatus}`;\n }\n\n return `${requirement.label}: not satisfied`;\n}\n\nexport function evaluateContentPublishReadiness(\n options: EvaluateContentPublishReadinessOptions,\n): ContentPublishReadinessState | null {\n if (options.status !== 'published') {\n return null;\n }\n\n const enforce = options.enforce === true;\n\n if (!options.contentId || options.contentId === 'new') {\n return {\n level: enforce ? 'blocked' : 'advisory',\n title: 'Publication Needs A Saved Draft',\n message:\n 'Save this governed content first so reviews can run before publication.',\n details: [],\n disableSave: enforce,\n };\n }\n\n const profile = (options.reviewProfiles || []).find(\n (candidate) => candidate.profileKey === options.reviewProfileKey,\n );\n\n if (!profile) {\n return {\n level: 'ready',\n title: 'No Publish Profile Configured',\n message:\n 'No publication review profile is configured, so publish readiness is not being enforced here.',\n details: [],\n disableSave: false,\n };\n }\n\n const unsatisfiedBlocking = profile.requirements.filter(\n (requirement) => requirement.blocking && !requirement.satisfied,\n );\n if (unsatisfiedBlocking.length > 0) {\n return {\n level: enforce ? 'blocked' : 'advisory',\n title: enforce\n ? 'Blocking Reviews Must Pass'\n : 'Blocking Reviews Are Not Satisfied',\n message: enforce\n ? 'Resolve the blocking review requirements before publishing this content.'\n : 'This content can still be published, but blocking review requirements are not yet satisfied.',\n details: unsatisfiedBlocking.map(describeRequirement),\n disableSave: enforce,\n };\n }\n\n const incompleteRequirements = profile.requirements.filter(\n (requirement) => !requirement.satisfied,\n );\n if (incompleteRequirements.length > 0 || !profile.complete) {\n return {\n level: 'advisory',\n title: 'Some Reviews Are Still Pending',\n message:\n 'Blocking requirements are satisfied, but some advisory reviews are still missing or need follow-up.',\n details: incompleteRequirements.map(describeRequirement),\n disableSave: false,\n };\n }\n\n return {\n level: 'ready',\n title: 'Ready To Publish',\n message:\n 'All configured review requirements for this publication profile are satisfied.',\n details: [],\n disableSave: false,\n };\n}\n"],"names":[],"mappings":"AAgCA,SAAS,oBAAoB,aAAkD;AAC7E,MAAI,YAAY,SAAS;AACvB,WAAO,GAAG,YAAY,KAAK;AAAA,EAC7B;AAEA,MAAI,YAAY,OAAO;AACrB,WAAO,GAAG,YAAY,KAAK;AAAA,EAC7B;AAEA,MAAI,YAAY,cAAc;AAC5B,WAAO,GAAG,YAAY,KAAK,KAAK,YAAY,YAAY;AAAA,EAC1D;AAEA,SAAO,GAAG,YAAY,KAAK;AAC7B;AAEO,SAAS,gCACd,SACqC;AACrC,MAAI,QAAQ,WAAW,aAAa;AAClC,WAAO;AAAA,EACT;AAEA,QAAM,UAAU,QAAQ,YAAY;AAEpC,MAAI,CAAC,QAAQ,aAAa,QAAQ,cAAc,OAAO;AACrD,WAAO;AAAA,MACL,OAAO,UAAU,YAAY;AAAA,MAC7B,OAAO;AAAA,MACP,SACE;AAAA,MACF,SAAS,CAAA;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EAEjB;AAEA,QAAM,WAAW,QAAQ,kBAAkB,CAAA,GAAI;AAAA,IAC7C,CAAC,cAAc,UAAU,eAAe,QAAQ;AAAA,EAAA;AAGlD,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,MACL,OAAO;AAAA,MACP,OAAO;AAAA,MACP,SACE;AAAA,MACF,SAAS,CAAA;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EAEjB;AAEA,QAAM,sBAAsB,QAAQ,aAAa;AAAA,IAC/C,CAAC,gBAAgB,YAAY,YAAY,CAAC,YAAY;AAAA,EAAA;AAExD,MAAI,oBAAoB,SAAS,GAAG;AAClC,WAAO;AAAA,MACL,OAAO,UAAU,YAAY;AAAA,MAC7B,OAAO,UACH,+BACA;AAAA,MACJ,SAAS,UACL,6EACA;AAAA,MACJ,SAAS,oBAAoB,IAAI,mBAAmB;AAAA,MACpD,aAAa;AAAA,IAAA;AAAA,EAEjB;AAEA,QAAM,yBAAyB,QAAQ,aAAa;AAAA,IAClD,CAAC,gBAAgB,CAAC,YAAY;AAAA,EAAA;AAEhC,MAAI,uBAAuB,SAAS,KAAK,CAAC,QAAQ,UAAU;AAC1D,WAAO;AAAA,MACL,OAAO;AAAA,MACP,OAAO;AAAA,MACP,SACE;AAAA,MACF,SAAS,uBAAuB,IAAI,mBAAmB;AAAA,MACvD,aAAa;AAAA,IAAA;AAAA,EAEjB;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,SACE;AAAA,IACF,SAAS,CAAA;AAAA,IACT,aAAa;AAAA,EAAA;AAEjB;"}
1
+ {"version":3,"file":"publish-readiness.js","names":[],"sources":["../src/publish-readiness.ts"],"sourcesContent":["export interface PublishReadinessRequirement {\n label: string;\n blocking: boolean;\n missing: boolean;\n stale?: boolean;\n satisfied: boolean;\n latestStatus: string | null;\n}\n\nexport interface PublishReadinessProfile {\n profileKey: string;\n ready: boolean;\n complete: boolean;\n requirements: PublishReadinessRequirement[];\n}\n\nexport interface ContentPublishReadinessState {\n level: 'ready' | 'advisory' | 'blocked';\n title: string;\n message: string;\n details: string[];\n disableSave: boolean;\n}\n\nexport interface EvaluateContentPublishReadinessOptions {\n status?: string | null;\n contentId?: string | null;\n reviewProfileKey: string;\n reviewProfiles?: PublishReadinessProfile[] | null;\n enforce?: boolean;\n}\n\nfunction describeRequirement(requirement: PublishReadinessRequirement): string {\n if (requirement.missing) {\n return `${requirement.label}: not run yet`;\n }\n\n if (requirement.stale) {\n return `${requirement.label}: stale, rerun required`;\n }\n\n if (requirement.latestStatus) {\n return `${requirement.label}: ${requirement.latestStatus}`;\n }\n\n return `${requirement.label}: not satisfied`;\n}\n\nexport function evaluateContentPublishReadiness(\n options: EvaluateContentPublishReadinessOptions,\n): ContentPublishReadinessState | null {\n if (options.status !== 'published') {\n return null;\n }\n\n const enforce = options.enforce === true;\n\n if (!options.contentId || options.contentId === 'new') {\n return {\n level: enforce ? 'blocked' : 'advisory',\n title: 'Publication Needs A Saved Draft',\n message:\n 'Save this governed content first so reviews can run before publication.',\n details: [],\n disableSave: enforce,\n };\n }\n\n const profile = (options.reviewProfiles || []).find(\n (candidate) => candidate.profileKey === options.reviewProfileKey,\n );\n\n if (!profile) {\n return {\n level: 'ready',\n title: 'No Publish Profile Configured',\n message:\n 'No publication review profile is configured, so publish readiness is not being enforced here.',\n details: [],\n disableSave: false,\n };\n }\n\n const unsatisfiedBlocking = profile.requirements.filter(\n (requirement) => requirement.blocking && !requirement.satisfied,\n );\n if (unsatisfiedBlocking.length > 0) {\n return {\n level: enforce ? 'blocked' : 'advisory',\n title: enforce\n ? 'Blocking Reviews Must Pass'\n : 'Blocking Reviews Are Not Satisfied',\n message: enforce\n ? 'Resolve the blocking review requirements before publishing this content.'\n : 'This content can still be published, but blocking review requirements are not yet satisfied.',\n details: unsatisfiedBlocking.map(describeRequirement),\n disableSave: enforce,\n };\n }\n\n const incompleteRequirements = profile.requirements.filter(\n (requirement) => !requirement.satisfied,\n );\n if (incompleteRequirements.length > 0 || !profile.complete) {\n return {\n level: 'advisory',\n title: 'Some Reviews Are Still Pending',\n message:\n 'Blocking requirements are satisfied, but some advisory reviews are still missing or need follow-up.',\n details: incompleteRequirements.map(describeRequirement),\n disableSave: false,\n };\n }\n\n return {\n level: 'ready',\n title: 'Ready To Publish',\n message:\n 'All configured review requirements for this publication profile are satisfied.',\n details: [],\n disableSave: false,\n };\n}\n"],"mappings":";AAgCA,SAAS,oBAAoB,aAAkD;CAC7E,IAAI,YAAY,SACd,OAAO,GAAG,YAAY,MAAK;CAG7B,IAAI,YAAY,OACd,OAAO,GAAG,YAAY,MAAK;CAG7B,IAAI,YAAY,cACd,OAAO,GAAG,YAAY,MAAK,IAAK,YAAY;CAG9C,OAAO,GAAG,YAAY,MAAK;AAC7B;AAEO,SAAS,gCACd,SACqC;CACrC,IAAI,QAAQ,WAAW,aACrB,OAAO;CAGT,MAAM,UAAU,QAAQ,YAAY;CAEpC,IAAI,CAAC,QAAQ,aAAa,QAAQ,cAAc,OAC9C,OAAO;EACL,OAAO,UAAU,YAAY;EAC7B,OAAO;EACP,SACE;EACF,SAAS,CAAC;EACV,aAAa;CACf;CAGF,MAAM,WAAW,QAAQ,kBAAkB,CAAC,EAAA,CAAG,MAC5C,cAAc,UAAU,eAAe,QAAQ,gBAClD;CAEA,IAAI,CAAC,SACH,OAAO;EACL,OAAO;EACP,OAAO;EACP,SACE;EACF,SAAS,CAAC;EACV,aAAa;CACf;CAGF,MAAM,sBAAsB,QAAQ,aAAa,QAC9C,gBAAgB,YAAY,YAAY,CAAC,YAAY,SACxD;CACA,IAAI,oBAAoB,SAAS,GAC/B,OAAO;EACL,OAAO,UAAU,YAAY;EAC7B,OAAO,UACH,+BACA;EACJ,SAAS,UACL,6EACA;EACJ,SAAS,oBAAoB,IAAI,mBAAmB;EACpD,aAAa;CACf;CAGF,MAAM,yBAAyB,QAAQ,aAAa,QACjD,gBAAgB,CAAC,YAAY,SAChC;CACA,IAAI,uBAAuB,SAAS,KAAK,CAAC,QAAQ,UAChD,OAAO;EACL,OAAO;EACP,OAAO;EACP,SACE;EACF,SAAS,uBAAuB,IAAI,mBAAmB;EACvD,aAAa;CACf;CAGF,OAAO;EACL,OAAO;EACP,OAAO;EACP,SACE;EACF,SAAS,CAAC;EACV,aAAa;CACf;AACF"}
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-07-01T02:36:38.004Z",
3
+ "generatedAt": "2026-07-01T20:05:18.970Z",
4
4
  "packageName": "@happyvertical/smrt-content",
5
- "packageVersion": "0.37.2",
5
+ "packageVersion": "0.37.3",
6
6
  "sourceManifestPath": "dist/manifest.json",
7
7
  "agentDocPath": "AGENTS.md",
8
8
  "sourceHashes": {
9
- "manifest": "03220a0b669aeb6356fa42491782562ed500a6edf5c73f9ac0ba298a547fc83c",
10
- "packageJson": "3bb4598efca95ecef139da8e1443a857682d737775911ae6d1315d1c281ae239",
9
+ "manifest": "3007893ef886d21ad2558741ea0b0dfdd7bef537d66ddab3ac4bbdc45a51ad5f",
10
+ "packageJson": "937c978f10259a2e11e1ffa4d92ca4072539e46c5c468f4de06380d836d82dfb",
11
11
  "agents": "d3e1fdba8cf8c8f393e682616c56fefcc789c44018407bbdf7332d5f06cfbb5c"
12
12
  },
13
13
  "exports": [
@@ -42,20 +42,20 @@
42
42
  "@happyvertical/spider": "catalog:",
43
43
  "@happyvertical/sql": "catalog:",
44
44
  "@happyvertical/utils": "catalog:",
45
- "fast-xml-parser": "^5.7.2",
46
- "yaml": "^2.8.2",
47
- "@faker-js/faker": "^10.2.0",
45
+ "fast-xml-parser": "^5.9.3",
46
+ "yaml": "^2.9.0",
47
+ "@faker-js/faker": "^10.5.0",
48
48
  "@happyvertical/smrt-playground": "workspace:*",
49
49
  "@happyvertical/smrt-vitest": "workspace:*",
50
- "@sveltejs/kit": "^2.0.0",
51
- "@sveltejs/package": "^2.5.7",
52
- "@sveltejs/vite-plugin-svelte": "^6.2.4",
53
- "@types/node": "25.0.9",
54
- "svelte": "^5.18.0",
55
- "svelte-check": "^4.3.5",
50
+ "@sveltejs/kit": "^2.68.0",
51
+ "@sveltejs/package": "^2.5.8",
52
+ "@sveltejs/vite-plugin-svelte": "^7.1.2",
53
+ "@types/node": "24.13.2",
54
+ "svelte": "^5.56.4",
55
+ "svelte-check": "^4.7.1",
56
56
  "typescript": "^5.9.3",
57
- "vite": "^7.3.6",
58
- "vitest": "^4.0.17"
57
+ "vite": "^8.1.2",
58
+ "vitest": "^4.1.9"
59
59
  },
60
60
  "smrtDependencies": [
61
61
  "@happyvertical/smrt-assets",
package/dist/ui.js CHANGED
@@ -1,42 +1,50 @@
1
- const CONTENT_UI_SLOTS = {
2
- "article-card": {
3
- id: "article-card",
4
- label: "Article Card",
5
- description: "Article preview card with title, excerpt, and metadata",
6
- icon: "file-text",
7
- category: "display",
8
- order: 1,
9
- propsInterface: "ArticleCardProps"
10
- },
11
- "article-list": {
12
- id: "article-list",
13
- label: "Article List",
14
- description: "Grid or list of article cards",
15
- icon: "list",
16
- category: "list",
17
- order: 2,
18
- propsInterface: "ArticleListProps"
19
- },
20
- markdown: {
21
- id: "markdown",
22
- label: "Markdown",
23
- description: "Markdown content renderer with syntax highlighting",
24
- icon: "code",
25
- category: "display",
26
- order: 3,
27
- propsInterface: "MarkdownProps"
28
- }
1
+ //#region src/ui.ts
2
+ var CONTENT_UI_SLOTS = {
3
+ "article-card": {
4
+ id: "article-card",
5
+ label: "Article Card",
6
+ description: "Article preview card with title, excerpt, and metadata",
7
+ icon: "file-text",
8
+ category: "display",
9
+ order: 1,
10
+ propsInterface: "ArticleCardProps"
11
+ },
12
+ "article-list": {
13
+ id: "article-list",
14
+ label: "Article List",
15
+ description: "Grid or list of article cards",
16
+ icon: "list",
17
+ category: "list",
18
+ order: 2,
19
+ propsInterface: "ArticleListProps"
20
+ },
21
+ markdown: {
22
+ id: "markdown",
23
+ label: "Markdown",
24
+ description: "Markdown content renderer with syntax highlighting",
25
+ icon: "code",
26
+ category: "display",
27
+ order: 3,
28
+ propsInterface: "MarkdownProps"
29
+ }
29
30
  };
30
- const CONTENT_MODULE_META = {
31
- name: "@happyvertical/smrt-content",
32
- displayName: "Content",
33
- description: "Content processing: documents, web content, and media",
34
- uiSlots: CONTENT_UI_SLOTS,
35
- models: ["Content", "Article", "Document"],
36
- collections: ["ContentCollection", "ArticleCollection", "DocumentCollection"]
31
+ var CONTENT_MODULE_META = {
32
+ name: "@happyvertical/smrt-content",
33
+ displayName: "Content",
34
+ description: "Content processing: documents, web content, and media",
35
+ uiSlots: CONTENT_UI_SLOTS,
36
+ models: [
37
+ "Content",
38
+ "Article",
39
+ "Document"
40
+ ],
41
+ collections: [
42
+ "ContentCollection",
43
+ "ArticleCollection",
44
+ "DocumentCollection"
45
+ ]
37
46
  };
38
- export {
39
- CONTENT_MODULE_META,
40
- CONTENT_UI_SLOTS
41
- };
42
- //# sourceMappingURL=ui.js.map
47
+ //#endregion
48
+ export { CONTENT_MODULE_META, CONTENT_UI_SLOTS };
49
+
50
+ //# sourceMappingURL=ui.js.map
package/dist/ui.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ui.js","sources":["../src/ui.ts"],"sourcesContent":["/**\n * Content Module UI Slot Declarations\n *\n * This file defines the UI extension points for the content module.\n * UI components are implemented in the ./svelte subpath.\n */\n\nimport type { ModuleUISlot, SmrtModuleMeta } from '@happyvertical/smrt-types';\n\n/**\n * Content module UI slots\n */\nexport const CONTENT_UI_SLOTS: Record<string, ModuleUISlot> = {\n 'article-card': {\n id: 'article-card',\n label: 'Article Card',\n description: 'Article preview card with title, excerpt, and metadata',\n icon: 'file-text',\n category: 'display',\n order: 1,\n propsInterface: 'ArticleCardProps',\n },\n 'article-list': {\n id: 'article-list',\n label: 'Article List',\n description: 'Grid or list of article cards',\n icon: 'list',\n category: 'list',\n order: 2,\n propsInterface: 'ArticleListProps',\n },\n markdown: {\n id: 'markdown',\n label: 'Markdown',\n description: 'Markdown content renderer with syntax highlighting',\n icon: 'code',\n category: 'display',\n order: 3,\n propsInterface: 'MarkdownProps',\n },\n};\n\n/**\n * Content module metadata\n */\nexport const CONTENT_MODULE_META: SmrtModuleMeta = {\n name: '@happyvertical/smrt-content',\n displayName: 'Content',\n description: 'Content processing: documents, web content, and media',\n uiSlots: CONTENT_UI_SLOTS,\n models: ['Content', 'Article', 'Document'],\n collections: ['ContentCollection', 'ArticleCollection', 'DocumentCollection'],\n};\n"],"names":[],"mappings":"AAYO,MAAM,mBAAiD;AAAA,EAC5D,gBAAgB;AAAA,IACd,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,IACP,gBAAgB;AAAA,EAAA;AAAA,EAElB,gBAAgB;AAAA,IACd,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,IACP,gBAAgB;AAAA,EAAA;AAAA,EAElB,UAAU;AAAA,IACR,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,IACP,gBAAgB;AAAA,EAAA;AAEpB;AAKO,MAAM,sBAAsC;AAAA,EACjD,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,SAAS;AAAA,EACT,QAAQ,CAAC,WAAW,WAAW,UAAU;AAAA,EACzC,aAAa,CAAC,qBAAqB,qBAAqB,oBAAoB;AAC9E;"}
1
+ {"version":3,"file":"ui.js","names":[],"sources":["../src/ui.ts"],"sourcesContent":["/**\n * Content Module UI Slot Declarations\n *\n * This file defines the UI extension points for the content module.\n * UI components are implemented in the ./svelte subpath.\n */\n\nimport type { ModuleUISlot, SmrtModuleMeta } from '@happyvertical/smrt-types';\n\n/**\n * Content module UI slots\n */\nexport const CONTENT_UI_SLOTS: Record<string, ModuleUISlot> = {\n 'article-card': {\n id: 'article-card',\n label: 'Article Card',\n description: 'Article preview card with title, excerpt, and metadata',\n icon: 'file-text',\n category: 'display',\n order: 1,\n propsInterface: 'ArticleCardProps',\n },\n 'article-list': {\n id: 'article-list',\n label: 'Article List',\n description: 'Grid or list of article cards',\n icon: 'list',\n category: 'list',\n order: 2,\n propsInterface: 'ArticleListProps',\n },\n markdown: {\n id: 'markdown',\n label: 'Markdown',\n description: 'Markdown content renderer with syntax highlighting',\n icon: 'code',\n category: 'display',\n order: 3,\n propsInterface: 'MarkdownProps',\n },\n};\n\n/**\n * Content module metadata\n */\nexport const CONTENT_MODULE_META: SmrtModuleMeta = {\n name: '@happyvertical/smrt-content',\n displayName: 'Content',\n description: 'Content processing: documents, web content, and media',\n uiSlots: CONTENT_UI_SLOTS,\n models: ['Content', 'Article', 'Document'],\n collections: ['ContentCollection', 'ArticleCollection', 'DocumentCollection'],\n};\n"],"mappings":";AAYO,IAAM,mBAAiD;CAC5D,gBAAgB;EACd,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,gBAAgB;EACd,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,UAAU;EACR,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;AACF;AAKO,IAAM,sBAAsC;CACjD,MAAM;CACN,aAAa;CACb,aAAa;CACb,SAAS;CACT,QAAQ;EAAC;EAAW;EAAW;CAAU;CACzC,aAAa;EAAC;EAAqB;EAAqB;CAAoB;AAC9E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-content",
3
- "version": "0.37.2",
3
+ "version": "0.37.3",
4
4
  "description": "Content processing module for SMRT framework - handles documents, web content, and media",
5
5
  "type": "module",
6
6
  "smrtRawPrimitives": "strict",
@@ -37,33 +37,33 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@happyvertical/ai": "^0.74.10",
41
- "@happyvertical/documents": "^0.74.10",
42
- "@happyvertical/files": "^0.74.10",
43
- "@happyvertical/geo": "^0.74.10",
44
- "@happyvertical/images": "^0.74.10",
45
- "@happyvertical/logger": "^0.74.10",
40
+ "@happyvertical/ai": "^0.74.11",
41
+ "@happyvertical/documents": "^0.74.11",
42
+ "@happyvertical/files": "^0.74.11",
43
+ "@happyvertical/geo": "^0.74.11",
44
+ "@happyvertical/images": "^0.74.11",
45
+ "@happyvertical/logger": "^0.74.11",
46
46
  "@happyvertical/ocr": "^0.60.55",
47
47
  "@happyvertical/pdf": "^0.65.3",
48
48
  "@happyvertical/spider": "^1.1.10",
49
- "@happyvertical/sql": "^0.74.10",
50
- "@happyvertical/utils": "^0.74.10",
51
- "fast-xml-parser": "^5.7.2",
52
- "yaml": "^2.8.2",
53
- "@happyvertical/smrt-assets": "0.37.2",
54
- "@happyvertical/smrt-chat": "0.37.2",
55
- "@happyvertical/smrt-core": "0.37.2",
56
- "@happyvertical/smrt-facts": "0.37.2",
57
- "@happyvertical/smrt-images": "0.37.2",
58
- "@happyvertical/smrt-messages": "0.37.2",
59
- "@happyvertical/smrt-prompts": "0.37.2",
60
- "@happyvertical/smrt-profiles": "0.37.2",
61
- "@happyvertical/smrt-tenancy": "0.37.2",
62
- "@happyvertical/smrt-types": "0.37.2",
63
- "@happyvertical/smrt-ui": "0.37.2"
49
+ "@happyvertical/sql": "^0.74.11",
50
+ "@happyvertical/utils": "^0.74.11",
51
+ "fast-xml-parser": "^5.9.3",
52
+ "yaml": "^2.9.0",
53
+ "@happyvertical/smrt-assets": "0.37.3",
54
+ "@happyvertical/smrt-core": "0.37.3",
55
+ "@happyvertical/smrt-facts": "0.37.3",
56
+ "@happyvertical/smrt-images": "0.37.3",
57
+ "@happyvertical/smrt-chat": "0.37.3",
58
+ "@happyvertical/smrt-messages": "0.37.3",
59
+ "@happyvertical/smrt-prompts": "0.37.3",
60
+ "@happyvertical/smrt-profiles": "0.37.3",
61
+ "@happyvertical/smrt-types": "0.37.3",
62
+ "@happyvertical/smrt-ui": "0.37.3",
63
+ "@happyvertical/smrt-tenancy": "0.37.3"
64
64
  },
65
65
  "peerDependencies": {
66
- "svelte": "^5.18.0"
66
+ "svelte": "^5.56.4"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "svelte": {
@@ -71,18 +71,18 @@
71
71
  }
72
72
  },
73
73
  "devDependencies": {
74
- "@faker-js/faker": "^10.2.0",
75
- "@sveltejs/kit": "^2.0.0",
76
- "@sveltejs/package": "^2.5.7",
77
- "@sveltejs/vite-plugin-svelte": "^6.2.4",
78
- "@types/node": "25.0.9",
79
- "svelte": "^5.46.4",
80
- "svelte-check": "^4.3.5",
74
+ "@faker-js/faker": "^10.5.0",
75
+ "@sveltejs/kit": "^2.68.0",
76
+ "@sveltejs/package": "^2.5.8",
77
+ "@sveltejs/vite-plugin-svelte": "^7.1.2",
78
+ "@types/node": "24.13.2",
79
+ "svelte": "^5.56.4",
80
+ "svelte-check": "^4.7.1",
81
81
  "typescript": "^5.9.3",
82
- "vite": "^7.3.6",
83
- "vitest": "^4.0.17",
84
- "@happyvertical/smrt-playground": "0.37.2",
85
- "@happyvertical/smrt-vitest": "0.37.2"
82
+ "vite": "^8.1.2",
83
+ "vitest": "^4.1.9",
84
+ "@happyvertical/smrt-vitest": "0.37.3",
85
+ "@happyvertical/smrt-playground": "0.37.3"
86
86
  },
87
87
  "keywords": [
88
88
  "ai",