@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.
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-content",
5
- "packageVersion": "0.40.65",
5
+ "packageVersion": "0.40.66",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-content:ContentAsset": {
8
8
  "name": "contentasset",
@@ -1,390 +1,2 @@
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
1
+ import { t as playground_default } from "./chunks/playground-DryZ2Hm_.js";
388
2
  export { playground_default as default };
389
-
390
- //# sourceMappingURL=playground.js.map
@@ -0,0 +1,9 @@
1
+ import { LoadPublishedArticleRouteInput, PublishedContentArticleRouteData } from './svelte/routes/shared.js';
2
+ export type ContentRouteLoadError = Error & {
3
+ name: 'ContentRouteLoadError';
4
+ status: number;
5
+ code?: string;
6
+ };
7
+ export declare function isContentRouteLoadError(value: unknown): value is ContentRouteLoadError;
8
+ export declare function loadPublishedArticleRouteData({ fetch, slug, apiBasePath, }: LoadPublishedArticleRouteInput): Promise<PublishedContentArticleRouteData>;
9
+ //# sourceMappingURL=route-loaders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-loaders.d.ts","sourceRoot":"","sources":["../src/route-loaders.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG;IAC1C,IAAI,EAAE,uBAAuB,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAcF,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,qBAAqB,CAMhC;AAmBD,wBAAsB,6BAA6B,CAAC,EAClD,KAAK,EACL,IAAI,EACJ,WAAuB,GACxB,EAAE,8BAA8B,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAkD5E"}
@@ -0,0 +1,19 @@
1
+ import { SmrtRouteDefinition, SmrtRouteModule } from '@happyvertical/smrt-types';
2
+ import { ContentRouteLoadError, isContentRouteLoadError, loadPublishedArticleRouteData } from './route-loaders.js';
3
+ import { ContentContributionsRoute, ContentFactsRoute, ContentGovernanceRoute, ContentWorkspaceRoute, PublishedArticleRoute } from './svelte/routes/index.js';
4
+ import { CONTENT_DEFAULT_ROUTE_NAVIGATION, CONTENT_ROUTE_IDS, CONTENT_ROUTE_META, ContentRouteId, ContentRouteNavigationItem, createContentRouteNavigation, LoadPublishedArticleRouteInput, PublishedContentArticleRouteData } from './svelte/routes/shared.js';
5
+ export type { ContentRouteId, ContentRouteLoadError, ContentRouteNavigationItem, LoadPublishedArticleRouteInput, PublishedContentArticleRouteData, };
6
+ export { CONTENT_DEFAULT_ROUTE_NAVIGATION, CONTENT_ROUTE_IDS, CONTENT_ROUTE_META, ContentContributionsRoute, ContentFactsRoute, ContentGovernanceRoute, ContentWorkspaceRoute, createContentRouteNavigation, isContentRouteLoadError, loadPublishedArticleRouteData, PublishedArticleRoute, };
7
+ export interface ContentRouteDefinitions {
8
+ workspace: SmrtRouteDefinition;
9
+ facts: SmrtRouteDefinition;
10
+ governance: SmrtRouteDefinition;
11
+ contributions: SmrtRouteDefinition;
12
+ article: SmrtRouteDefinition<PublishedContentArticleRouteData, LoadPublishedArticleRouteInput>;
13
+ }
14
+ export type ContentRouteModule = Omit<SmrtRouteModule, 'routes'> & {
15
+ routes: ContentRouteDefinitions;
16
+ };
17
+ export declare const CONTENT_ROUTE_MODULE: ContentRouteModule;
18
+ export default CONTENT_ROUTE_MODULE;
19
+ //# sourceMappingURL=route-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-module.d.ts","sourceRoot":"","sources":["../src/route-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,qBAAqB,EAC1B,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gCAAgC,EAChC,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAC/B,4BAA4B,EAC5B,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACtC,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,8BAA8B,EAC9B,gCAAgC,GACjC,CAAC;AACF,OAAO,EACL,gCAAgC,EAChC,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,uBAAuB,EACvB,6BAA6B,EAC7B,qBAAqB,GACtB,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,mBAAmB,CAAC;IAC/B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,UAAU,EAAE,mBAAmB,CAAC;IAChC,aAAa,EAAE,mBAAmB,CAAC;IACnC,OAAO,EAAE,mBAAmB,CAC1B,gCAAgC,EAChC,8BAA8B,CAC/B,CAAC;CACH;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,GAAG;IACjE,MAAM,EAAE,uBAAuB,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,kBAiClC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}