@growth-labs/cms 0.1.1 → 0.1.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.
- package/README.md +6 -2
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +2 -2
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/publisher.d.ts +14 -3
- package/dist/engine/publisher.d.ts.map +1 -1
- package/dist/engine/publisher.js +11 -5
- package/dist/engine/publisher.js.map +1 -1
- package/dist/engine/slug-redirects.d.ts +16 -0
- package/dist/engine/slug-redirects.d.ts.map +1 -1
- package/dist/engine/slug-redirects.js +34 -0
- package/dist/engine/slug-redirects.js.map +1 -1
- package/dist/routes/content.d.ts +1 -1
- package/dist/routes/content.d.ts.map +1 -1
- package/dist/routes/content.js +35 -26
- package/dist/routes/content.js.map +1 -1
- package/dist/schema/insights-ingest.d.ts +16 -16
- package/dist/schema/migrations.d.ts +5 -3
- package/dist/schema/migrations.d.ts.map +1 -1
- package/dist/schema/migrations.js +148 -4
- package/dist/schema/migrations.js.map +1 -1
- package/dist/schema/types.d.ts +2 -2
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/ui/commands.d.ts +2 -1
- package/dist/ui/commands.d.ts.map +1 -1
- package/dist/ui/commands.js +1 -2
- package/dist/ui/commands.js.map +1 -1
- package/dist/ui/components/SharePickers.d.ts.map +1 -1
- package/dist/ui/components/SharePickers.js +11 -7
- package/dist/ui/components/SharePickers.js.map +1 -1
- package/dist/ui/editor/ContentForm.d.ts +1 -1
- package/dist/ui/editor/ContentForm.d.ts.map +1 -1
- package/dist/ui/editor/ContentForm.js +5 -5
- package/dist/ui/editor/ContentForm.js.map +1 -1
- package/dist/ui/editor/content-payload.js +2 -2
- package/dist/ui/editor/content-payload.js.map +1 -1
- package/dist/ui/preview/draft-page.js +5 -4
- package/dist/ui/preview/draft-page.js.map +1 -1
- package/dist/ui/screens/EditorScreen.d.ts.map +1 -1
- package/dist/ui/screens/EditorScreen.js +2 -0
- package/dist/ui/screens/EditorScreen.js.map +1 -1
- package/dist/ui/screens/LibraryScreen.d.ts.map +1 -1
- package/dist/ui/screens/LibraryScreen.js +4 -2
- package/dist/ui/screens/LibraryScreen.js.map +1 -1
- package/dist/ui/screens/SocialShareScreen.js +1 -1
- package/dist/ui/screens/SocialShareScreen.js.map +1 -1
- package/dist/ui/screens/content-view.d.ts +2 -1
- package/dist/ui/screens/content-view.d.ts.map +1 -1
- package/dist/ui/screens/content-view.js.map +1 -1
- package/dist/ui/screens/public-url.d.ts.map +1 -1
- package/dist/ui/screens/public-url.js +2 -0
- package/dist/ui/screens/public-url.js.map +1 -1
- package/migrations/0001_create_cms_tables.sql +4 -4
- package/migrations/0017_content_pages.sql +138 -0
- package/package.json +1 -1
- package/src/engine/index.ts +6 -2
- package/src/engine/publisher.ts +45 -9
- package/src/engine/slug-redirects.ts +42 -0
- package/src/routes/content.ts +45 -29
- package/src/schema/migrations.ts +148 -4
- package/src/schema/types.ts +2 -2
- package/src/ui/commands.ts +3 -1
- package/src/ui/components/SharePickers.tsx +13 -10
- package/src/ui/editor/ContentForm.tsx +7 -7
- package/src/ui/editor/content-payload.ts +2 -2
- package/src/ui/preview/draft-page.tsx +7 -4
- package/src/ui/screens/EditorScreen.tsx +2 -0
- package/src/ui/screens/LibraryScreen.tsx +4 -2
- package/src/ui/screens/SocialShareScreen.tsx +1 -0
- package/src/ui/screens/content-view.ts +3 -1
- package/src/ui/screens/public-url.ts +2 -0
|
@@ -51,6 +51,7 @@ const CONTENT_TYPE_LABELS: Record<ContentType, string> = {
|
|
|
51
51
|
video: 'Video',
|
|
52
52
|
podcast: 'Podcast',
|
|
53
53
|
newsletter: 'Newsletter',
|
|
54
|
+
page: 'Page',
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
const STATUS_PILL_COLORS: Record<ContentStatus, string> = {
|
|
@@ -472,6 +473,7 @@ function contentTypeIcon(type: ContentType): import('../icons.js').IconName {
|
|
|
472
473
|
video: 'video',
|
|
473
474
|
podcast: 'mic',
|
|
474
475
|
newsletter: 'mail',
|
|
476
|
+
page: 'doc',
|
|
475
477
|
}
|
|
476
478
|
return map[type]
|
|
477
479
|
}
|
|
@@ -50,6 +50,7 @@ const TYPE_OPTIONS: Array<{ value: ContentType | ''; label: string }> = [
|
|
|
50
50
|
{ value: 'video', label: 'Video' },
|
|
51
51
|
{ value: 'podcast', label: 'Podcast' },
|
|
52
52
|
{ value: 'newsletter', label: 'Newsletter' },
|
|
53
|
+
{ value: 'page', label: 'Page' },
|
|
53
54
|
]
|
|
54
55
|
|
|
55
56
|
const CONTENT_TYPE_ICONS: Record<ContentType, string> = {
|
|
@@ -57,6 +58,7 @@ const CONTENT_TYPE_ICONS: Record<ContentType, string> = {
|
|
|
57
58
|
video: 'video',
|
|
58
59
|
podcast: 'mic',
|
|
59
60
|
newsletter: 'mail',
|
|
61
|
+
page: 'doc',
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
// ---------------------------------------------------------------------------
|
|
@@ -261,7 +263,7 @@ export function LibraryScreen({ openDoc }: LibraryScreenProps) {
|
|
|
261
263
|
<div>
|
|
262
264
|
<h1 className="page-title">Content</h1>
|
|
263
265
|
<div className="page-sub">
|
|
264
|
-
{lib.counts.all} items across articles, video, podcasts and
|
|
266
|
+
{lib.counts.all} items across articles, video, podcasts, newsletters and pages.
|
|
265
267
|
</div>
|
|
266
268
|
</div>
|
|
267
269
|
<div style={{ display: 'flex', gap: 8 }}>
|
|
@@ -509,7 +511,7 @@ function NewContentMenu({ openDoc }: { openDoc: LibraryScreenProps['openDoc'] })
|
|
|
509
511
|
return () => document.removeEventListener('mousedown', handler)
|
|
510
512
|
}, [open])
|
|
511
513
|
|
|
512
|
-
const types: ContentType[] = ['article', 'video', 'podcast', 'newsletter']
|
|
514
|
+
const types: ContentType[] = ['article', 'video', 'podcast', 'newsletter', 'page']
|
|
513
515
|
|
|
514
516
|
return (
|
|
515
517
|
<div ref={ref} style={{ position: 'relative' }}>
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
// ContentRoute owns a ContentView state; dispatching actions moves between the
|
|
3
3
|
// library list (open === null) and the editor (open !== null).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import type { ContentType } from '../../schema/types.js'
|
|
6
|
+
|
|
7
|
+
export type { ContentType } from '../../schema/types.js'
|
|
6
8
|
|
|
7
9
|
export interface ContentView {
|
|
8
10
|
/** null = create new; string = open existing by id */
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
// video → /video/<slug> (src/pages/video/[slug].astro)
|
|
11
11
|
// newsletter → /warfronts-weekly/<slug>
|
|
12
12
|
// (src/pages/warfronts-weekly/[slug].astro)
|
|
13
|
+
// page → /<slug>
|
|
13
14
|
//
|
|
14
15
|
// SOURCE OF TRUTH for the path scheme: the Fronts site page structure at
|
|
15
16
|
// /Users/zephyr/projects/fulcrum-labs/fronts/src/pages/
|
|
@@ -44,6 +45,7 @@ const CONTENT_PUBLIC_PATH: Record<ContentType, (slug: string) => string> = {
|
|
|
44
45
|
// SOURCE: fronts/src/pages/warfronts-weekly/[slug].astro
|
|
45
46
|
// fronts/src/lib/content.ts ~L779
|
|
46
47
|
newsletter: (slug) => `/warfronts-weekly/${slug}`,
|
|
48
|
+
page: (slug) => `/${slug.replace(/^\/+/, '')}`,
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
// ---------------------------------------------------------------------------
|