@happyvertical/smrt-content 0.40.65 → 0.40.66

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.
@@ -0,0 +1,390 @@
1
+ import { CONTENT_MODULE_META } from "../ui.js";
2
+ //#region src/svelte/playground.ts
3
+ var DEFAULT_CONTENT_PLAYGROUND_API_BASE_URL = "/api/v1";
4
+ function resolveContentPlaygroundApiBaseUrl() {
5
+ const configuredViaGlobal = globalThis.__SMRT_CONTENT_PLAYGROUND_API_BASE_URL__;
6
+ if (configuredViaGlobal) return configuredViaGlobal;
7
+ const browserLocation = globalThis.location;
8
+ if (browserLocation) {
9
+ const configuredViaQuery = new URLSearchParams(browserLocation.search).get("smrtContentApiBaseUrl");
10
+ if (configuredViaQuery) return configuredViaQuery;
11
+ }
12
+ return DEFAULT_CONTENT_PLAYGROUND_API_BASE_URL;
13
+ }
14
+ var sampleArticles = [{
15
+ id: "article-aurora-kitchen",
16
+ slug: "aurora-kitchen-notes",
17
+ title: "Aurora Kitchen Notes",
18
+ description: "A reference article card preview showing how editorial metadata lands in the package playground.",
19
+ publish_date: "2026-03-14T12:00:00.000Z",
20
+ author: "Editorial Systems",
21
+ tags: [
22
+ "release",
23
+ "editorial",
24
+ "qa"
25
+ ]
26
+ }, {
27
+ id: "article-governance-habits",
28
+ slug: "governance-habits",
29
+ title: "Governance Habits That Scale",
30
+ description: "Teams can move fast when quality gates are visible, lightweight, and shared with contributors.",
31
+ publish_date: "2026-03-19T09:30:00.000Z",
32
+ author: "Content Ops",
33
+ tags: [
34
+ "governance",
35
+ "quality",
36
+ "workflows"
37
+ ]
38
+ }];
39
+ var sampleContributions = [{
40
+ id: "contribution-1",
41
+ title: "Spring buyer guide",
42
+ contributionTypeKey: "article",
43
+ status: "needs_changes",
44
+ revisionCount: 2,
45
+ editorNotes: "Please tighten the sourcing notes in the opening section.",
46
+ contributorName: "Taylor Rowan",
47
+ contributorEmail: "taylor@example.com",
48
+ intakeDecision: "needs_changes",
49
+ body: "The spring buyer guide draft is attached, with sourcing notes for the opening section and the product comparison appendix.",
50
+ updatedAt: "2026-03-20T15:18:00.000Z"
51
+ }, {
52
+ id: "contribution-2",
53
+ title: "Field report: Pacific logistics",
54
+ contributionTypeKey: "report",
55
+ status: "submitted",
56
+ revisionCount: 1,
57
+ contributorName: "Jordan Lee",
58
+ contributorEmail: "jordan@example.com",
59
+ intakeDecision: "submitted",
60
+ body: "Field notes from the Pacific corridor include updated shipping windows, route constraints, and operator interviews.",
61
+ updatedAt: "2026-03-18T10:40:00.000Z"
62
+ }];
63
+ var sampleGovernanceDefinitions = {
64
+ effective: {
65
+ policies: [{
66
+ id: "policy-facts",
67
+ key: "facts",
68
+ label: "Facts review",
69
+ kind: "facts",
70
+ instructions: "Compare claims against linked facts before publication.",
71
+ enabled: true
72
+ }, {
73
+ id: "policy-style",
74
+ key: "style",
75
+ label: "Style review",
76
+ kind: "custom",
77
+ instructions: "Apply newsroom tone, structure, and clarity guidelines.",
78
+ enabled: true
79
+ }],
80
+ profiles: [{
81
+ id: "profile-publication",
82
+ key: "publication",
83
+ label: "Publication",
84
+ description: "Required before governed content can be published.",
85
+ enabled: true,
86
+ requirements: [{
87
+ policyKey: "facts",
88
+ label: "Facts review",
89
+ blocking: true,
90
+ acceptedStatuses: ["passed"]
91
+ }, {
92
+ policyKey: "style",
93
+ label: "Style review",
94
+ blocking: false,
95
+ acceptedStatuses: ["passed", "warning"]
96
+ }]
97
+ }],
98
+ assignments: [{
99
+ id: "assignment-article",
100
+ key: "article",
101
+ label: "Articles",
102
+ contentType: "article",
103
+ contentVariant: null,
104
+ enabled: true,
105
+ factLinkingEnabled: true,
106
+ transparencyEnabled: true,
107
+ publicationProfileKey: "publication",
108
+ correctionProfileKey: null,
109
+ enforcePublishReadiness: true,
110
+ defaultFactRelationship: "supports"
111
+ }]
112
+ },
113
+ persisted: {
114
+ policies: [{
115
+ id: "policy-style",
116
+ key: "style",
117
+ label: "Style review",
118
+ kind: "custom",
119
+ instructions: "Apply newsroom tone, structure, and clarity guidelines.",
120
+ enabled: true
121
+ }],
122
+ profiles: [{
123
+ id: "profile-publication",
124
+ key: "publication",
125
+ label: "Publication",
126
+ description: "Required before governed content can be published.",
127
+ enabled: true,
128
+ requirements: [{
129
+ policyKey: "facts",
130
+ label: "Facts review",
131
+ blocking: true,
132
+ acceptedStatuses: ["passed"]
133
+ }, {
134
+ policyKey: "style",
135
+ label: "Style review",
136
+ blocking: false,
137
+ acceptedStatuses: ["passed", "warning"]
138
+ }]
139
+ }],
140
+ assignments: [{
141
+ id: "assignment-article",
142
+ key: "article",
143
+ label: "Articles",
144
+ contentType: "article",
145
+ contentVariant: null,
146
+ enabled: true,
147
+ factLinkingEnabled: true,
148
+ transparencyEnabled: true,
149
+ publicationProfileKey: "publication",
150
+ correctionProfileKey: null,
151
+ enforcePublishReadiness: true,
152
+ defaultFactRelationship: "supports"
153
+ }]
154
+ }
155
+ };
156
+ var sampleEditorContent = {
157
+ id: "content-playground-editor",
158
+ slug: "playground-editor-reference",
159
+ title: "Reference editorial draft",
160
+ description: "A working editor preview with copy, references, and assets already populated.",
161
+ body: `# Editorial Draft
162
+
163
+ This preview is meant to feel like a real authoring surface.
164
+
165
+ - tighten the lede
166
+ - verify product claims
167
+ - attach supporting references`,
168
+ author: "Editorial Systems",
169
+ type: "article",
170
+ status: "draft",
171
+ state: "active",
172
+ source: "manual",
173
+ tags: ["editorial", "playground"],
174
+ referenceIds: ["fact-aurora", "source-governance"],
175
+ assetIds: [],
176
+ assets: []
177
+ };
178
+ var noop = () => {};
179
+ function cloneValue(value) {
180
+ return JSON.parse(JSON.stringify(value));
181
+ }
182
+ function buildPlaygroundResponse(data) {
183
+ return {
184
+ data,
185
+ success: true
186
+ };
187
+ }
188
+ function upsertByIdOrKey(items, value, prefix) {
189
+ const id = value.id || `${prefix}-${value.key || items.length + 1}`;
190
+ const nextValue = {
191
+ ...value,
192
+ id
193
+ };
194
+ const index = items.findIndex((item) => item.id === id || !!value.key && item.key === value.key);
195
+ if (index === -1) return [...items, nextValue];
196
+ const nextItems = [...items];
197
+ nextItems[index] = {
198
+ ...nextItems[index],
199
+ ...nextValue
200
+ };
201
+ return nextItems;
202
+ }
203
+ function createGovernancePlaygroundClient(seed = sampleGovernanceDefinitions) {
204
+ let policies = cloneValue(seed.effective.policies);
205
+ let profiles = cloneValue(seed.effective.profiles);
206
+ let assignments = cloneValue(seed.effective.assignments);
207
+ const getDefinitions = () => ({
208
+ effective: {
209
+ policies: cloneValue(policies),
210
+ profiles: cloneValue(profiles),
211
+ assignments: cloneValue(assignments)
212
+ },
213
+ persisted: {
214
+ policies: cloneValue(policies),
215
+ profiles: cloneValue(profiles),
216
+ assignments: cloneValue(assignments)
217
+ }
218
+ });
219
+ return {
220
+ contents: { getGovernanceDefinitions: async () => buildPlaygroundResponse(getDefinitions()) },
221
+ contentGovernancePolicies: {
222
+ create: async (policy) => {
223
+ policies = upsertByIdOrKey(policies, policy, "policy");
224
+ return buildPlaygroundResponse(policies[policies.length - 1]);
225
+ },
226
+ update: async (id, policy) => {
227
+ policies = upsertByIdOrKey(policies, {
228
+ ...policy,
229
+ id
230
+ }, "policy");
231
+ return buildPlaygroundResponse(policies.find((item) => item.id === id));
232
+ },
233
+ delete: async (id) => {
234
+ policies = policies.filter((item) => item.id !== id);
235
+ return buildPlaygroundResponse(void 0);
236
+ }
237
+ },
238
+ contentGovernanceProfiles: {
239
+ create: async (profile) => {
240
+ profiles = upsertByIdOrKey(profiles, profile, "profile");
241
+ return buildPlaygroundResponse(profiles[profiles.length - 1]);
242
+ },
243
+ update: async (id, profile) => {
244
+ profiles = upsertByIdOrKey(profiles, {
245
+ ...profile,
246
+ id
247
+ }, "profile");
248
+ return buildPlaygroundResponse(profiles.find((item) => item.id === id));
249
+ },
250
+ delete: async (id) => {
251
+ profiles = profiles.filter((item) => item.id !== id);
252
+ return buildPlaygroundResponse(void 0);
253
+ }
254
+ },
255
+ contentGovernanceAssignments: {
256
+ create: async (assignment) => {
257
+ assignments = upsertByIdOrKey(assignments, assignment, "assignment");
258
+ return buildPlaygroundResponse(assignments[assignments.length - 1]);
259
+ },
260
+ update: async (id, assignment) => {
261
+ assignments = upsertByIdOrKey(assignments, {
262
+ ...assignment,
263
+ id
264
+ }, "assignment");
265
+ return buildPlaygroundResponse(assignments.find((item) => item.id === id));
266
+ },
267
+ delete: async (id) => {
268
+ assignments = assignments.filter((item) => item.id !== id);
269
+ return buildPlaygroundResponse(void 0);
270
+ }
271
+ }
272
+ };
273
+ }
274
+ var markdownExample = `# Content Playground
275
+
276
+ This preview module lives in \`src/svelte/playground.ts\`.
277
+
278
+ - Package-owned previews stay close to the real components
279
+ - The shared host simply discovers and renders them
280
+ - Live entries can point at the package's generated API routes`;
281
+ var loadArticleCard = () => import("../svelte/components/ArticleCard.svelte");
282
+ var loadArticleList = () => import("../svelte/components/ArticleList.svelte");
283
+ var loadContentEditor = () => import("../svelte/components/ContentEditor.svelte");
284
+ var loadContentContributionInbox = () => import("../svelte/components/ContentContributionInbox.svelte");
285
+ var loadContentContributionPortal = () => import("../svelte/components/ContentContributionPortal.svelte");
286
+ var loadContentGovernanceManager = () => import("../svelte/components/ContentGovernanceManager.svelte");
287
+ var loadMarkdown = () => import("../svelte/components/Markdown.svelte");
288
+ var governancePlaygroundClient = createGovernancePlaygroundClient();
289
+ var playground_default = {
290
+ packageName: "@happyvertical/smrt-content",
291
+ displayName: "Content",
292
+ description: CONTENT_MODULE_META.description,
293
+ moduleMeta: CONTENT_MODULE_META,
294
+ entries: [
295
+ {
296
+ id: "article-card",
297
+ slotId: "article-card",
298
+ title: "Article Card",
299
+ description: "Editorial teaser card with tags and metadata.",
300
+ loadComponent: loadArticleCard,
301
+ order: 1,
302
+ props: {
303
+ article: sampleArticles[0],
304
+ showTags: true
305
+ },
306
+ modes: { mock: { label: "Mock" } }
307
+ },
308
+ {
309
+ id: "article-list",
310
+ slotId: "article-list",
311
+ title: "Article List",
312
+ description: "Reference list/grid layout for published content.",
313
+ loadComponent: loadArticleList,
314
+ order: 2,
315
+ props: {
316
+ articles: sampleArticles,
317
+ showTags: true
318
+ },
319
+ modes: { mock: { label: "Mock" } }
320
+ },
321
+ {
322
+ id: "markdown",
323
+ slotId: "markdown",
324
+ title: "Markdown Renderer",
325
+ description: "Safe markdown rendering with a small editorial snippet.",
326
+ loadComponent: loadMarkdown,
327
+ order: 3,
328
+ props: { content: markdownExample },
329
+ modes: { mock: { label: "Mock" } }
330
+ },
331
+ {
332
+ id: "content-editor",
333
+ title: "Content Editor",
334
+ description: "Authoring surface for body copy, references, and media.",
335
+ loadComponent: loadContentEditor,
336
+ order: 4,
337
+ props: {
338
+ apiBaseUrl: resolveContentPlaygroundApiBaseUrl(),
339
+ content: sampleEditorContent,
340
+ contentId: sampleEditorContent.id,
341
+ agentChatEnabled: false,
342
+ agentChatNotice: "The shared playground keeps the editor preview local. Run the content package app when you want the live agent chat routes too.",
343
+ onSave: noop,
344
+ onCancel: noop
345
+ },
346
+ modes: { mock: { label: "Mock" } }
347
+ },
348
+ {
349
+ id: "contribution-portal",
350
+ title: "Contribution Portal",
351
+ description: "Contributor-facing inbox and submission status view.",
352
+ loadComponent: loadContentContributionPortal,
353
+ order: 5,
354
+ props: { contributions: sampleContributions },
355
+ modes: { mock: { label: "Mock" } }
356
+ },
357
+ {
358
+ id: "contribution-inbox",
359
+ title: "Contribution Inbox",
360
+ description: "Editorial review queue for approving, rejecting, or requesting changes.",
361
+ loadComponent: loadContentContributionInbox,
362
+ order: 6,
363
+ props: { contributions: sampleContributions },
364
+ modes: { mock: { label: "Mock" } }
365
+ },
366
+ {
367
+ id: "governance-manager",
368
+ title: "Governance Manager",
369
+ description: "Administrative view with in-memory mock data and optional live package routes.",
370
+ loadComponent: loadContentGovernanceManager,
371
+ order: 7,
372
+ modes: {
373
+ mock: {
374
+ label: "Mock",
375
+ description: "Uses an in-memory governance client so the shared playground works without a package-local dev server.",
376
+ props: { client: governancePlaygroundClient }
377
+ },
378
+ live: {
379
+ label: "Live",
380
+ description: "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.",
381
+ props: { apiBaseUrl: resolveContentPlaygroundApiBaseUrl() }
382
+ }
383
+ }
384
+ }
385
+ ]
386
+ };
387
+ //#endregion
388
+ export { playground_default as t };
389
+
390
+ //# sourceMappingURL=playground-DryZ2Hm_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playground-DryZ2Hm_.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 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,IAAM,iBAAiB,CACrB;CACE,IAAI;CACJ,MAAM;CACN,OAAO;CACP,aACE;CACF,cAAc;CACd,QAAQ;CACR,MAAM;EAAC;EAAW;EAAa;CAAI;AACrC,GACA;CACE,IAAI;CACJ,MAAM;CACN,OAAO;CACP,aACE;CACF,cAAc;CACd,QAAQ;CACR,MAAM;EAAC;EAAc;EAAW;CAAW;AAC7C,CACF;AAEA,IAAM,sBAAsB,CAC1B;CACE,IAAI;CACJ,OAAO;CACP,qBAAqB;CACrB,QAAQ;CACR,eAAe;CACf,aAAa;CACb,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB,MAAM;CACN,WAAW;AACb,GACA;CACE,IAAI;CACJ,OAAO;CACP,qBAAqB;CACrB,QAAQ;CACR,eAAe;CACf,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB,MAAM;CACN,WAAW;AACb,CACF;AAEA,IAAM,8BAAgE;CACpE,WAAW;EACT,UAAU,CACR;GACE,IAAI;GACJ,KAAK;GACL,OAAO;GACP,MAAM;GACN,cAAc;GACd,SAAS;EACX,GACA;GACE,IAAI;GACJ,KAAK;GACL,OAAO;GACP,MAAM;GACN,cAAc;GACd,SAAS;EACX,CACF;EACA,UAAU,CACR;GACE,IAAI;GACJ,KAAK;GACL,OAAO;GACP,aAAa;GACb,SAA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ACjC,YAAY;CACZ,SAAS;EACP;GACE,IAAI;GACJ,QAAQ;GACR,OAAO;GACP,aAAa;GACb,eAAe;GACf,OAAO;GACP,OAAO;IACL,SAAS,eAAe;IACxB,UAAU;GACZ;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;EACA;GACE,IAAI;GACJ,QAAQ;GACR,OAAO;GACP,aAAa;GACb,eAAe;GACf,OAAO;GACP,OAAO;IACL,UAAU;IACV,UAAU;GACZ;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;EACA;GACE,IAAI;GACJ,QAAQ;GACR,OAAO;GACP,aAAa;GACb,eAAe;GACf,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"}