@happyvertical/smrt-content 0.37.2 → 0.37.4

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