@riverbankcms/sdk 0.2.1 → 0.4.0
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 +255 -1
- package/dist/cli/index.js +249 -40
- package/dist/cli/index.js.map +1 -1
- package/dist/client/bookings.js +15 -1
- package/dist/client/bookings.js.map +1 -1
- package/dist/client/bookings.mjs +15 -1
- package/dist/client/bookings.mjs.map +1 -1
- package/dist/client/client.d.mts +2 -2
- package/dist/client/client.d.ts +2 -2
- package/dist/client/client.js +51 -6
- package/dist/client/client.js.map +1 -1
- package/dist/client/client.mjs +51 -6
- package/dist/client/client.mjs.map +1 -1
- package/dist/client/hooks.d.mts +2 -2
- package/dist/client/hooks.d.ts +2 -2
- package/dist/client/rendering/client.js +114 -116
- package/dist/client/rendering/client.js.map +1 -1
- package/dist/client/rendering/client.mjs +114 -116
- package/dist/client/rendering/client.mjs.map +1 -1
- package/dist/client/usePage-BcjWPXvh.d.mts +6388 -0
- package/dist/client/usePage-C3ZKNwY7.d.mts +6393 -0
- package/dist/client/usePage-CrKw1H6Y.d.ts +6338 -0
- package/dist/client/usePage-CyYpOJud.d.ts +6388 -0
- package/dist/client/usePage-DMI8ImsU.d.mts +6338 -0
- package/dist/client/usePage-gpVaeWDy.d.ts +6393 -0
- package/dist/server/{Layout-DK_9OOgb.d.mts → Layout-B_zUr9ci.d.mts} +1 -1
- package/dist/server/{Layout-CLg8oH_S.d.ts → Layout-CHG77dhK.d.ts} +1 -1
- package/dist/server/blockKinds-B6MWzNWp.d.mts +16 -0
- package/dist/server/blockKinds-B6MWzNWp.d.ts +16 -0
- package/dist/server/chunk-BOHTTHY5.mjs +406 -0
- package/dist/server/chunk-BOHTTHY5.mjs.map +1 -0
- package/dist/server/{chunk-5R4NMVXA.js → chunk-BUCJWG6G.js} +5 -5
- package/dist/server/chunk-BUCJWG6G.js.map +1 -0
- package/dist/server/chunk-D2QLTPUJ.mjs +33 -0
- package/dist/server/chunk-D2QLTPUJ.mjs.map +1 -0
- package/dist/server/{chunk-62ZJI564.js → chunk-FPYK6527.js} +4 -4
- package/dist/server/{chunk-62ZJI564.js.map → chunk-FPYK6527.js.map} +1 -1
- package/dist/server/{chunk-YXDDFG3N.js → chunk-G4CKM4EN.js} +1 -1
- package/dist/server/chunk-G4CKM4EN.js.map +1 -0
- package/dist/server/chunk-GERCMTPQ.js +33 -0
- package/dist/server/chunk-GERCMTPQ.js.map +1 -0
- package/dist/server/{chunk-SF63XAX7.js → chunk-IT5ICP43.js} +24 -4
- package/dist/server/chunk-IT5ICP43.js.map +1 -0
- package/dist/server/{chunk-GWBMJPLH.mjs → chunk-M5KTLZTD.mjs} +1 -1
- package/dist/server/chunk-M5KTLZTD.mjs.map +1 -0
- package/dist/server/{chunk-3J46ILMJ.mjs → chunk-N3PX76AP.mjs} +29 -4
- package/dist/server/chunk-N3PX76AP.mjs.map +1 -0
- package/dist/server/{chunk-O5DC7MYW.mjs → chunk-NKXS4TBK.mjs} +24 -4
- package/dist/server/chunk-NKXS4TBK.mjs.map +1 -0
- package/dist/server/{chunk-INWKF3IC.js → chunk-P6CDRJN3.js} +8 -8
- package/dist/server/{chunk-INWKF3IC.js.map → chunk-P6CDRJN3.js.map} +1 -1
- package/dist/server/{chunk-GKYNDDJS.js → chunk-R5B6IOFQ.js} +29 -4
- package/dist/server/chunk-R5B6IOFQ.js.map +1 -0
- package/dist/server/{chunk-FK64TZBT.mjs → chunk-SFQ7VF3G.mjs} +2 -2
- package/dist/server/{chunk-JTAERCX2.mjs → chunk-VVFYHAUD.mjs} +2 -2
- package/dist/server/{chunk-PN3CHDVX.mjs → chunk-XK2YIISA.mjs} +2 -2
- package/dist/server/chunk-XK2YIISA.mjs.map +1 -0
- package/dist/server/chunk-ZIM53VP6.js +406 -0
- package/dist/server/chunk-ZIM53VP6.js.map +1 -0
- package/dist/server/{components-DhIcstww.d.ts → components-BYxloYJm.d.ts} +3 -3
- package/dist/server/{components-BzdA6NAc.d.mts → components-Ci5nlyUj.d.mts} +3 -3
- package/dist/server/components.d.mts +7 -5
- package/dist/server/components.d.ts +7 -5
- package/dist/server/components.js +3 -3
- package/dist/server/components.mjs +2 -2
- package/dist/server/config-validation.d.mts +5 -300
- package/dist/server/config-validation.d.ts +5 -300
- package/dist/server/config-validation.js +6 -3
- package/dist/server/config-validation.js.map +1 -1
- package/dist/server/config-validation.mjs +5 -2
- package/dist/server/config.d.mts +43 -4
- package/dist/server/config.d.ts +43 -4
- package/dist/server/config.js +27 -3
- package/dist/server/config.js.map +1 -1
- package/dist/server/config.mjs +26 -2
- package/dist/server/config.mjs.map +1 -1
- package/dist/server/data.d.mts +5 -3
- package/dist/server/data.d.ts +5 -3
- package/dist/server/data.js +2 -2
- package/dist/server/data.mjs +1 -1
- package/dist/server/{index-BB28KAui.d.ts → index-DbSfrRA0.d.ts} +1 -1
- package/dist/server/{index-C_FVup_o.d.mts → index-Dj7VKH34.d.mts} +1 -1
- package/dist/server/index.d.mts +19 -4
- package/dist/server/index.d.ts +19 -4
- package/dist/server/index.js +6 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +5 -1
- package/dist/server/{loadContent-AQOBf_gP.d.ts → loadContent-BqQ-VPMW.d.ts} +4 -3
- package/dist/server/{loadContent-DBmprsB4.d.mts → loadContent-Czu7xTOU.d.mts} +4 -3
- package/dist/server/{loadPage-BMg8PJxJ.d.ts → loadPage-BElEkA_J.d.ts} +3 -2
- package/dist/server/{loadPage-pg4HimlK.d.mts → loadPage-Dw57_n5N.d.mts} +3 -2
- package/dist/server/loadPage-E3ZC6NHB.js +11 -0
- package/dist/server/{loadPage-3ECPF426.js.map → loadPage-E3ZC6NHB.js.map} +1 -1
- package/dist/server/{loadPage-LW273NYO.mjs → loadPage-E7L7NMR3.mjs} +3 -3
- package/dist/server/metadata.d.mts +5 -3
- package/dist/server/metadata.d.ts +5 -3
- package/dist/server/navigation.d.mts +100 -0
- package/dist/server/navigation.d.ts +100 -0
- package/dist/server/navigation.js +44 -0
- package/dist/server/navigation.js.map +1 -0
- package/dist/server/navigation.mjs +44 -0
- package/dist/server/navigation.mjs.map +1 -0
- package/dist/server/rendering/server.d.mts +8 -6
- package/dist/server/rendering/server.d.ts +8 -6
- package/dist/server/rendering/server.js +4 -4
- package/dist/server/rendering/server.mjs +3 -3
- package/dist/server/rendering.d.mts +9 -7
- package/dist/server/rendering.d.ts +9 -7
- package/dist/server/rendering.js +6 -6
- package/dist/server/rendering.mjs +5 -5
- package/dist/server/routing.d.mts +5 -3
- package/dist/server/routing.d.ts +5 -3
- package/dist/server/routing.js +1 -1
- package/dist/server/routing.mjs +1 -1
- package/dist/server/server.d.mts +7 -5
- package/dist/server/server.d.ts +7 -5
- package/dist/server/server.js +4 -4
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.js +7 -7
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/{types-BprgZt-t.d.ts → types-5XdVD2J1.d.ts} +43 -147
- package/dist/server/{types-C0G9IxWO.d.mts → types-BA-J9K8r.d.mts} +43 -147
- package/dist/server/types-BC9eB2KH.d.mts +198 -0
- package/dist/server/{types-_nDnPHpv.d.ts → types-BuZJWVmj.d.mts} +4 -1
- package/dist/server/types-CAnC529E.d.ts +198 -0
- package/dist/server/{types--u4GLCAY.d.ts → types-CMqVHYLG.d.ts} +266 -4
- package/dist/server/{types-_zWJTgv0.d.mts → types-CYfHxUhe.d.mts} +266 -4
- package/dist/server/{types-_nDnPHpv.d.mts → types-DSFvXKhO.d.ts} +4 -1
- package/dist/server/validation-C7W2Fe0i.d.ts +459 -0
- package/dist/server/validation-hg1sqhrt.d.mts +459 -0
- package/package.json +23 -17
- package/dist/server/chunk-3J46ILMJ.mjs.map +0 -1
- package/dist/server/chunk-5R4NMVXA.js.map +0 -1
- package/dist/server/chunk-BPKYRPCQ.mjs +0 -215
- package/dist/server/chunk-BPKYRPCQ.mjs.map +0 -1
- package/dist/server/chunk-GKYNDDJS.js.map +0 -1
- package/dist/server/chunk-GWBMJPLH.mjs.map +0 -1
- package/dist/server/chunk-O5DC7MYW.mjs.map +0 -1
- package/dist/server/chunk-PN3CHDVX.mjs.map +0 -1
- package/dist/server/chunk-SF63XAX7.js.map +0 -1
- package/dist/server/chunk-XLVL5WPH.js +0 -215
- package/dist/server/chunk-XLVL5WPH.js.map +0 -1
- package/dist/server/chunk-YXDDFG3N.js.map +0 -1
- package/dist/server/loadPage-3ECPF426.js +0 -11
- /package/dist/server/{chunk-FK64TZBT.mjs.map → chunk-SFQ7VF3G.mjs.map} +0 -0
- /package/dist/server/{chunk-JTAERCX2.mjs.map → chunk-VVFYHAUD.mjs.map} +0 -0
- /package/dist/server/{loadPage-LW273NYO.mjs.map → loadPage-E7L7NMR3.mjs.map} +0 -0
|
@@ -1,4 +1,247 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as FieldDefinition, S as SdkCustomBlock } from './schema-Bpy9N5ZI.js';
|
|
2
|
+
import { B as BlockKind } from './blockKinds-B6MWzNWp.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SDK Content Scaffolding Types
|
|
6
|
+
*
|
|
7
|
+
* These types define the schema for SDK content configuration that allows
|
|
8
|
+
* SDK sites to define content types, pages, entries, and navigation in code.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Content type definition for SDK config.
|
|
13
|
+
*
|
|
14
|
+
* Defines the structure of a content type that SDK sites can declare.
|
|
15
|
+
* When pushed, the dashboard will ensure this content type exists.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* {
|
|
20
|
+
* key: 'testimonial',
|
|
21
|
+
* name: 'Testimonial',
|
|
22
|
+
* hasPages: false,
|
|
23
|
+
* fields: [
|
|
24
|
+
* { id: 'quote', type: 'richText', label: 'Quote', required: true },
|
|
25
|
+
* { id: 'author', type: 'text', label: 'Author', required: true },
|
|
26
|
+
* ],
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
interface ContentTypeConfig {
|
|
31
|
+
/** Unique key for this content type (e.g., 'post', 'event'). Must be lowercase with hyphens. */
|
|
32
|
+
key: string;
|
|
33
|
+
/** Display name shown in dashboard UI */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Optional description */
|
|
36
|
+
description?: string;
|
|
37
|
+
/** Whether entries of this type have routable pages */
|
|
38
|
+
hasPages: boolean;
|
|
39
|
+
/** Route pattern with {slug} placeholder. Required if hasPages=true. */
|
|
40
|
+
routePattern?: string;
|
|
41
|
+
/** Field definitions for this content type */
|
|
42
|
+
fields: FieldDefinition[];
|
|
43
|
+
/** Field ID to use as the entry title source */
|
|
44
|
+
titleField?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Block content for page scaffolding.
|
|
48
|
+
*
|
|
49
|
+
* Represents initial block content that can be added to SDK-defined pages.
|
|
50
|
+
*/
|
|
51
|
+
interface BlockConfig {
|
|
52
|
+
/** Block kind (e.g., 'block.hero', 'block.bodyText', 'custom.myBlock') */
|
|
53
|
+
kind: BlockKind;
|
|
54
|
+
/** Block content data matching the block's field definitions */
|
|
55
|
+
content: Record<string, unknown>;
|
|
56
|
+
/** Order index (optional, defaults to array position) */
|
|
57
|
+
orderIndex?: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Page definition for SDK config.
|
|
61
|
+
*
|
|
62
|
+
* Defines a page that should exist on the site.
|
|
63
|
+
* When pushed, the dashboard will ensure this page exists.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* {
|
|
68
|
+
* identifier: 'home',
|
|
69
|
+
* title: 'Home',
|
|
70
|
+
* path: '/',
|
|
71
|
+
* status: 'published',
|
|
72
|
+
* blocks: [
|
|
73
|
+
* { kind: 'block.hero', content: { heading: 'Welcome' } },
|
|
74
|
+
* ],
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
interface PageConfig {
|
|
79
|
+
/** Unique identifier for this page. Required for SDK sync. */
|
|
80
|
+
identifier: string;
|
|
81
|
+
/** Page title */
|
|
82
|
+
title: string;
|
|
83
|
+
/** URL path (e.g., '/', '/about', '/contact'). Must start with /. */
|
|
84
|
+
path: string;
|
|
85
|
+
/** Page purpose (default: 'content') */
|
|
86
|
+
purpose?: string;
|
|
87
|
+
/** Initial block content (optional) */
|
|
88
|
+
blocks?: BlockConfig[];
|
|
89
|
+
/** Status: 'draft' or 'published' (default: 'draft') */
|
|
90
|
+
status?: 'draft' | 'published';
|
|
91
|
+
/** SEO meta title */
|
|
92
|
+
metaTitle?: string;
|
|
93
|
+
/** SEO meta description */
|
|
94
|
+
metaDescription?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Content entry definition for SDK config.
|
|
98
|
+
*
|
|
99
|
+
* Defines a content entry that should exist.
|
|
100
|
+
* When pushed, the dashboard will ensure this entry exists.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* {
|
|
105
|
+
* identifier: 'testimonial-1',
|
|
106
|
+
* contentType: 'testimonial',
|
|
107
|
+
* title: 'First Testimonial',
|
|
108
|
+
* status: 'published',
|
|
109
|
+
* data: {
|
|
110
|
+
* quote: '<p>Great product!</p>',
|
|
111
|
+
* author: 'Jane Doe',
|
|
112
|
+
* },
|
|
113
|
+
* }
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
interface EntryConfig {
|
|
117
|
+
/** Unique identifier for this entry. Required for SDK sync. */
|
|
118
|
+
identifier: string;
|
|
119
|
+
/** Content type key this entry belongs to */
|
|
120
|
+
contentType: string;
|
|
121
|
+
/** Entry data matching the content type's field definitions */
|
|
122
|
+
data: Record<string, unknown>;
|
|
123
|
+
/** Status: 'draft' or 'published' (default: 'draft') */
|
|
124
|
+
status?: 'draft' | 'published';
|
|
125
|
+
/** Slug for routable entries. Defaults to identifier if content type hasPages. */
|
|
126
|
+
slug?: string;
|
|
127
|
+
/** Title for the entry (used in route metadata if routable) */
|
|
128
|
+
title?: string;
|
|
129
|
+
/** Summary/description */
|
|
130
|
+
summary?: string;
|
|
131
|
+
/** SEO meta title */
|
|
132
|
+
metaTitle?: string;
|
|
133
|
+
/** SEO meta description */
|
|
134
|
+
metaDescription?: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Navigation link types for menu items.
|
|
138
|
+
*/
|
|
139
|
+
type NavigationLinkType = {
|
|
140
|
+
kind: 'page';
|
|
141
|
+
identifier: string;
|
|
142
|
+
} | {
|
|
143
|
+
kind: 'entry';
|
|
144
|
+
identifier: string;
|
|
145
|
+
} | {
|
|
146
|
+
kind: 'external';
|
|
147
|
+
href: string;
|
|
148
|
+
} | {
|
|
149
|
+
kind: 'dropdown';
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Navigation item definition.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* {
|
|
157
|
+
* label: 'Products',
|
|
158
|
+
* link: { kind: 'dropdown' },
|
|
159
|
+
* children: [
|
|
160
|
+
* { label: 'Product 1', link: { kind: 'page', identifier: 'product-1' } },
|
|
161
|
+
* ],
|
|
162
|
+
* }
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
interface NavigationItemConfig {
|
|
166
|
+
/** Display label */
|
|
167
|
+
label: string;
|
|
168
|
+
/** Link configuration */
|
|
169
|
+
link: NavigationLinkType;
|
|
170
|
+
/** Is this a CTA button? */
|
|
171
|
+
isCta?: boolean;
|
|
172
|
+
/** Child items (for dropdown menus, max 1 level) */
|
|
173
|
+
children?: NavigationItemConfig[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Navigation menu definition.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* {
|
|
181
|
+
* identifier: 'main',
|
|
182
|
+
* name: 'Main Navigation',
|
|
183
|
+
* isPrimary: true,
|
|
184
|
+
* items: [
|
|
185
|
+
* { label: 'Home', link: { kind: 'page', identifier: 'home' } },
|
|
186
|
+
* { label: 'About', link: { kind: 'page', identifier: 'about' } },
|
|
187
|
+
* ],
|
|
188
|
+
* }
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
interface NavigationMenuConfig {
|
|
192
|
+
/** Unique identifier for this menu */
|
|
193
|
+
identifier: string;
|
|
194
|
+
/** Menu display name */
|
|
195
|
+
name: string;
|
|
196
|
+
/** Is this the primary/main menu? */
|
|
197
|
+
isPrimary?: boolean;
|
|
198
|
+
/** Menu items */
|
|
199
|
+
items: NavigationItemConfig[];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Site settings for SDK config.
|
|
203
|
+
*/
|
|
204
|
+
interface SiteSettingsConfig {
|
|
205
|
+
/** Homepage path (default: '/') */
|
|
206
|
+
homepagePath?: string;
|
|
207
|
+
/** Site title (for SEO/metadata) */
|
|
208
|
+
siteTitle?: string;
|
|
209
|
+
/** Site description (for SEO/metadata) */
|
|
210
|
+
siteDescription?: string;
|
|
211
|
+
/** Default template ID per content type key */
|
|
212
|
+
defaultTemplates?: Record<string, string>;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Complete content configuration for SDK sites.
|
|
216
|
+
*
|
|
217
|
+
* This is imported into riverbank.config.ts via the `content` field.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* // content.config.ts
|
|
222
|
+
* import { defineContentConfig } from '@riverbankcms/sdk/config';
|
|
223
|
+
*
|
|
224
|
+
* export const contentConfig = defineContentConfig({
|
|
225
|
+
* contentTypes: [...],
|
|
226
|
+
* pages: [...],
|
|
227
|
+
* entries: [...],
|
|
228
|
+
* navigationMenus: [...],
|
|
229
|
+
* settings: {...},
|
|
230
|
+
* });
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
interface ContentConfig {
|
|
234
|
+
/** Content type definitions */
|
|
235
|
+
contentTypes?: ContentTypeConfig[];
|
|
236
|
+
/** Content entries */
|
|
237
|
+
entries?: EntryConfig[];
|
|
238
|
+
/** Page definitions */
|
|
239
|
+
pages?: PageConfig[];
|
|
240
|
+
/** Navigation menus */
|
|
241
|
+
navigationMenus?: NavigationMenuConfig[];
|
|
242
|
+
/** Site settings */
|
|
243
|
+
settings?: SiteSettingsConfig;
|
|
244
|
+
}
|
|
2
245
|
|
|
3
246
|
/**
|
|
4
247
|
* SDK Site Configuration Types
|
|
@@ -175,11 +418,11 @@ type BlockFieldOptionsMap = Record<string, Record<string, BlockFieldConfig>>;
|
|
|
175
418
|
* id: 'layout',
|
|
176
419
|
* type: 'select',
|
|
177
420
|
* label: 'Layout',
|
|
178
|
-
* defaultValue: 'default',
|
|
179
421
|
* options: [
|
|
180
422
|
* { value: 'default', label: 'Default' },
|
|
181
423
|
* { value: 'wide', label: 'Wide' },
|
|
182
424
|
* ],
|
|
425
|
+
* defaultValue: 'default',
|
|
183
426
|
* },
|
|
184
427
|
* ],
|
|
185
428
|
* }
|
|
@@ -316,11 +559,11 @@ interface RiverbankSiteConfig {
|
|
|
316
559
|
* id: 'layout',
|
|
317
560
|
* type: 'select',
|
|
318
561
|
* label: 'Layout',
|
|
319
|
-
* defaultValue: 'default',
|
|
320
562
|
* options: [
|
|
321
563
|
* { value: 'default', label: 'Default' },
|
|
322
564
|
* { value: 'wide', label: 'Wide' },
|
|
323
565
|
* ],
|
|
566
|
+
* defaultValue: 'default',
|
|
324
567
|
* },
|
|
325
568
|
* ],
|
|
326
569
|
* },
|
|
@@ -328,6 +571,25 @@ interface RiverbankSiteConfig {
|
|
|
328
571
|
* ```
|
|
329
572
|
*/
|
|
330
573
|
blockFieldExtensions?: BlockFieldExtensionsMap;
|
|
574
|
+
/**
|
|
575
|
+
* Content scaffolding configuration.
|
|
576
|
+
*
|
|
577
|
+
* Defines content types, pages, entries, and navigation menus that
|
|
578
|
+
* should exist on the site. When SDK config is pushed, the dashboard
|
|
579
|
+
* will ensure these items exist.
|
|
580
|
+
*
|
|
581
|
+
* @example
|
|
582
|
+
* ```typescript
|
|
583
|
+
* content: {
|
|
584
|
+
* contentTypes: [...],
|
|
585
|
+
* pages: [...],
|
|
586
|
+
* entries: [...],
|
|
587
|
+
* navigationMenus: [...],
|
|
588
|
+
* settings: { homepagePath: '/' },
|
|
589
|
+
* }
|
|
590
|
+
* ```
|
|
591
|
+
*/
|
|
592
|
+
content?: ContentConfig;
|
|
331
593
|
}
|
|
332
594
|
|
|
333
|
-
export type { BlockFieldConfig as B,
|
|
595
|
+
export type { BlockFieldConfig as B, ContentConfig as C, EntryConfig as E, FieldSelectOption as F, NavigationMenuConfig as N, PageConfig as P, RiverbankSiteConfig as R, SiteStyleConfig as S, SectionBackground as a, SectionOptionsConfig as b, ContainerOptionsConfig as c, SectionSpacing as d, ContainerMaxWidth as e, ContainerAlignment as f, SdkThemeConfig as g, SdkThemePalette as h, BlockFieldOptionsMap as i, BlockFieldExtension as j, BlockFieldExtensionsMap as k, ContentTypeConfig as l, BlockConfig as m, NavigationItemConfig as n, NavigationLinkType as o, SiteSettingsConfig as p };
|
|
@@ -1,4 +1,247 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as FieldDefinition, S as SdkCustomBlock } from './schema-Bpy9N5ZI.mjs';
|
|
2
|
+
import { B as BlockKind } from './blockKinds-B6MWzNWp.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SDK Content Scaffolding Types
|
|
6
|
+
*
|
|
7
|
+
* These types define the schema for SDK content configuration that allows
|
|
8
|
+
* SDK sites to define content types, pages, entries, and navigation in code.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Content type definition for SDK config.
|
|
13
|
+
*
|
|
14
|
+
* Defines the structure of a content type that SDK sites can declare.
|
|
15
|
+
* When pushed, the dashboard will ensure this content type exists.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* {
|
|
20
|
+
* key: 'testimonial',
|
|
21
|
+
* name: 'Testimonial',
|
|
22
|
+
* hasPages: false,
|
|
23
|
+
* fields: [
|
|
24
|
+
* { id: 'quote', type: 'richText', label: 'Quote', required: true },
|
|
25
|
+
* { id: 'author', type: 'text', label: 'Author', required: true },
|
|
26
|
+
* ],
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
interface ContentTypeConfig {
|
|
31
|
+
/** Unique key for this content type (e.g., 'post', 'event'). Must be lowercase with hyphens. */
|
|
32
|
+
key: string;
|
|
33
|
+
/** Display name shown in dashboard UI */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Optional description */
|
|
36
|
+
description?: string;
|
|
37
|
+
/** Whether entries of this type have routable pages */
|
|
38
|
+
hasPages: boolean;
|
|
39
|
+
/** Route pattern with {slug} placeholder. Required if hasPages=true. */
|
|
40
|
+
routePattern?: string;
|
|
41
|
+
/** Field definitions for this content type */
|
|
42
|
+
fields: FieldDefinition[];
|
|
43
|
+
/** Field ID to use as the entry title source */
|
|
44
|
+
titleField?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Block content for page scaffolding.
|
|
48
|
+
*
|
|
49
|
+
* Represents initial block content that can be added to SDK-defined pages.
|
|
50
|
+
*/
|
|
51
|
+
interface BlockConfig {
|
|
52
|
+
/** Block kind (e.g., 'block.hero', 'block.bodyText', 'custom.myBlock') */
|
|
53
|
+
kind: BlockKind;
|
|
54
|
+
/** Block content data matching the block's field definitions */
|
|
55
|
+
content: Record<string, unknown>;
|
|
56
|
+
/** Order index (optional, defaults to array position) */
|
|
57
|
+
orderIndex?: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Page definition for SDK config.
|
|
61
|
+
*
|
|
62
|
+
* Defines a page that should exist on the site.
|
|
63
|
+
* When pushed, the dashboard will ensure this page exists.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* {
|
|
68
|
+
* identifier: 'home',
|
|
69
|
+
* title: 'Home',
|
|
70
|
+
* path: '/',
|
|
71
|
+
* status: 'published',
|
|
72
|
+
* blocks: [
|
|
73
|
+
* { kind: 'block.hero', content: { heading: 'Welcome' } },
|
|
74
|
+
* ],
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
interface PageConfig {
|
|
79
|
+
/** Unique identifier for this page. Required for SDK sync. */
|
|
80
|
+
identifier: string;
|
|
81
|
+
/** Page title */
|
|
82
|
+
title: string;
|
|
83
|
+
/** URL path (e.g., '/', '/about', '/contact'). Must start with /. */
|
|
84
|
+
path: string;
|
|
85
|
+
/** Page purpose (default: 'content') */
|
|
86
|
+
purpose?: string;
|
|
87
|
+
/** Initial block content (optional) */
|
|
88
|
+
blocks?: BlockConfig[];
|
|
89
|
+
/** Status: 'draft' or 'published' (default: 'draft') */
|
|
90
|
+
status?: 'draft' | 'published';
|
|
91
|
+
/** SEO meta title */
|
|
92
|
+
metaTitle?: string;
|
|
93
|
+
/** SEO meta description */
|
|
94
|
+
metaDescription?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Content entry definition for SDK config.
|
|
98
|
+
*
|
|
99
|
+
* Defines a content entry that should exist.
|
|
100
|
+
* When pushed, the dashboard will ensure this entry exists.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* {
|
|
105
|
+
* identifier: 'testimonial-1',
|
|
106
|
+
* contentType: 'testimonial',
|
|
107
|
+
* title: 'First Testimonial',
|
|
108
|
+
* status: 'published',
|
|
109
|
+
* data: {
|
|
110
|
+
* quote: '<p>Great product!</p>',
|
|
111
|
+
* author: 'Jane Doe',
|
|
112
|
+
* },
|
|
113
|
+
* }
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
interface EntryConfig {
|
|
117
|
+
/** Unique identifier for this entry. Required for SDK sync. */
|
|
118
|
+
identifier: string;
|
|
119
|
+
/** Content type key this entry belongs to */
|
|
120
|
+
contentType: string;
|
|
121
|
+
/** Entry data matching the content type's field definitions */
|
|
122
|
+
data: Record<string, unknown>;
|
|
123
|
+
/** Status: 'draft' or 'published' (default: 'draft') */
|
|
124
|
+
status?: 'draft' | 'published';
|
|
125
|
+
/** Slug for routable entries. Defaults to identifier if content type hasPages. */
|
|
126
|
+
slug?: string;
|
|
127
|
+
/** Title for the entry (used in route metadata if routable) */
|
|
128
|
+
title?: string;
|
|
129
|
+
/** Summary/description */
|
|
130
|
+
summary?: string;
|
|
131
|
+
/** SEO meta title */
|
|
132
|
+
metaTitle?: string;
|
|
133
|
+
/** SEO meta description */
|
|
134
|
+
metaDescription?: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Navigation link types for menu items.
|
|
138
|
+
*/
|
|
139
|
+
type NavigationLinkType = {
|
|
140
|
+
kind: 'page';
|
|
141
|
+
identifier: string;
|
|
142
|
+
} | {
|
|
143
|
+
kind: 'entry';
|
|
144
|
+
identifier: string;
|
|
145
|
+
} | {
|
|
146
|
+
kind: 'external';
|
|
147
|
+
href: string;
|
|
148
|
+
} | {
|
|
149
|
+
kind: 'dropdown';
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Navigation item definition.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* {
|
|
157
|
+
* label: 'Products',
|
|
158
|
+
* link: { kind: 'dropdown' },
|
|
159
|
+
* children: [
|
|
160
|
+
* { label: 'Product 1', link: { kind: 'page', identifier: 'product-1' } },
|
|
161
|
+
* ],
|
|
162
|
+
* }
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
interface NavigationItemConfig {
|
|
166
|
+
/** Display label */
|
|
167
|
+
label: string;
|
|
168
|
+
/** Link configuration */
|
|
169
|
+
link: NavigationLinkType;
|
|
170
|
+
/** Is this a CTA button? */
|
|
171
|
+
isCta?: boolean;
|
|
172
|
+
/** Child items (for dropdown menus, max 1 level) */
|
|
173
|
+
children?: NavigationItemConfig[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Navigation menu definition.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* {
|
|
181
|
+
* identifier: 'main',
|
|
182
|
+
* name: 'Main Navigation',
|
|
183
|
+
* isPrimary: true,
|
|
184
|
+
* items: [
|
|
185
|
+
* { label: 'Home', link: { kind: 'page', identifier: 'home' } },
|
|
186
|
+
* { label: 'About', link: { kind: 'page', identifier: 'about' } },
|
|
187
|
+
* ],
|
|
188
|
+
* }
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
interface NavigationMenuConfig {
|
|
192
|
+
/** Unique identifier for this menu */
|
|
193
|
+
identifier: string;
|
|
194
|
+
/** Menu display name */
|
|
195
|
+
name: string;
|
|
196
|
+
/** Is this the primary/main menu? */
|
|
197
|
+
isPrimary?: boolean;
|
|
198
|
+
/** Menu items */
|
|
199
|
+
items: NavigationItemConfig[];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Site settings for SDK config.
|
|
203
|
+
*/
|
|
204
|
+
interface SiteSettingsConfig {
|
|
205
|
+
/** Homepage path (default: '/') */
|
|
206
|
+
homepagePath?: string;
|
|
207
|
+
/** Site title (for SEO/metadata) */
|
|
208
|
+
siteTitle?: string;
|
|
209
|
+
/** Site description (for SEO/metadata) */
|
|
210
|
+
siteDescription?: string;
|
|
211
|
+
/** Default template ID per content type key */
|
|
212
|
+
defaultTemplates?: Record<string, string>;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Complete content configuration for SDK sites.
|
|
216
|
+
*
|
|
217
|
+
* This is imported into riverbank.config.ts via the `content` field.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* // content.config.ts
|
|
222
|
+
* import { defineContentConfig } from '@riverbankcms/sdk/config';
|
|
223
|
+
*
|
|
224
|
+
* export const contentConfig = defineContentConfig({
|
|
225
|
+
* contentTypes: [...],
|
|
226
|
+
* pages: [...],
|
|
227
|
+
* entries: [...],
|
|
228
|
+
* navigationMenus: [...],
|
|
229
|
+
* settings: {...},
|
|
230
|
+
* });
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
interface ContentConfig {
|
|
234
|
+
/** Content type definitions */
|
|
235
|
+
contentTypes?: ContentTypeConfig[];
|
|
236
|
+
/** Content entries */
|
|
237
|
+
entries?: EntryConfig[];
|
|
238
|
+
/** Page definitions */
|
|
239
|
+
pages?: PageConfig[];
|
|
240
|
+
/** Navigation menus */
|
|
241
|
+
navigationMenus?: NavigationMenuConfig[];
|
|
242
|
+
/** Site settings */
|
|
243
|
+
settings?: SiteSettingsConfig;
|
|
244
|
+
}
|
|
2
245
|
|
|
3
246
|
/**
|
|
4
247
|
* SDK Site Configuration Types
|
|
@@ -175,11 +418,11 @@ type BlockFieldOptionsMap = Record<string, Record<string, BlockFieldConfig>>;
|
|
|
175
418
|
* id: 'layout',
|
|
176
419
|
* type: 'select',
|
|
177
420
|
* label: 'Layout',
|
|
178
|
-
* defaultValue: 'default',
|
|
179
421
|
* options: [
|
|
180
422
|
* { value: 'default', label: 'Default' },
|
|
181
423
|
* { value: 'wide', label: 'Wide' },
|
|
182
424
|
* ],
|
|
425
|
+
* defaultValue: 'default',
|
|
183
426
|
* },
|
|
184
427
|
* ],
|
|
185
428
|
* }
|
|
@@ -316,11 +559,11 @@ interface RiverbankSiteConfig {
|
|
|
316
559
|
* id: 'layout',
|
|
317
560
|
* type: 'select',
|
|
318
561
|
* label: 'Layout',
|
|
319
|
-
* defaultValue: 'default',
|
|
320
562
|
* options: [
|
|
321
563
|
* { value: 'default', label: 'Default' },
|
|
322
564
|
* { value: 'wide', label: 'Wide' },
|
|
323
565
|
* ],
|
|
566
|
+
* defaultValue: 'default',
|
|
324
567
|
* },
|
|
325
568
|
* ],
|
|
326
569
|
* },
|
|
@@ -328,6 +571,25 @@ interface RiverbankSiteConfig {
|
|
|
328
571
|
* ```
|
|
329
572
|
*/
|
|
330
573
|
blockFieldExtensions?: BlockFieldExtensionsMap;
|
|
574
|
+
/**
|
|
575
|
+
* Content scaffolding configuration.
|
|
576
|
+
*
|
|
577
|
+
* Defines content types, pages, entries, and navigation menus that
|
|
578
|
+
* should exist on the site. When SDK config is pushed, the dashboard
|
|
579
|
+
* will ensure these items exist.
|
|
580
|
+
*
|
|
581
|
+
* @example
|
|
582
|
+
* ```typescript
|
|
583
|
+
* content: {
|
|
584
|
+
* contentTypes: [...],
|
|
585
|
+
* pages: [...],
|
|
586
|
+
* entries: [...],
|
|
587
|
+
* navigationMenus: [...],
|
|
588
|
+
* settings: { homepagePath: '/' },
|
|
589
|
+
* }
|
|
590
|
+
* ```
|
|
591
|
+
*/
|
|
592
|
+
content?: ContentConfig;
|
|
331
593
|
}
|
|
332
594
|
|
|
333
|
-
export type { BlockFieldConfig as B,
|
|
595
|
+
export type { BlockFieldConfig as B, ContentConfig as C, EntryConfig as E, FieldSelectOption as F, NavigationMenuConfig as N, PageConfig as P, RiverbankSiteConfig as R, SiteStyleConfig as S, SectionBackground as a, SectionOptionsConfig as b, ContainerOptionsConfig as c, SectionSpacing as d, ContainerMaxWidth as e, ContainerAlignment as f, SdkThemeConfig as g, SdkThemePalette as h, BlockFieldOptionsMap as i, BlockFieldExtension as j, BlockFieldExtensionsMap as k, ContentTypeConfig as l, BlockConfig as m, NavigationItemConfig as n, NavigationLinkType as o, SiteSettingsConfig as p };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { B as BlockKind } from './blockKinds-B6MWzNWp.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Data loading types for block prefetching.
|
|
3
5
|
* Shared between frontend and SDK implementations.
|
|
@@ -30,6 +32,7 @@ type ResolvedBlockData = Record<string, Record<string, unknown>>;
|
|
|
30
32
|
* These types enable SDK sites to define loader functions that fetch
|
|
31
33
|
* data from external APIs (not just CMS endpoints).
|
|
32
34
|
*/
|
|
35
|
+
|
|
33
36
|
/**
|
|
34
37
|
* Context provided to code-based data loaders.
|
|
35
38
|
*
|
|
@@ -44,7 +47,7 @@ interface DataLoaderContext {
|
|
|
44
47
|
/** Unique block instance ID */
|
|
45
48
|
blockId: string;
|
|
46
49
|
/** Block kind (e.g., 'custom.featured-products') */
|
|
47
|
-
blockKind:
|
|
50
|
+
blockKind: BlockKind;
|
|
48
51
|
/**
|
|
49
52
|
* The block's CMS content.
|
|
50
53
|
* Use this to access field values for parameterizing API calls.
|