@rizom/site-rizom 0.2.0-alpha.150 → 0.2.0-alpha.151
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/dist/index.d.ts +282 -83
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,193 @@
|
|
|
1
|
-
import { ComponentChildren, JSX } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ComponentChildren, JSX } from "preact";
|
|
2
|
+
//#region ../../packages/site/src/index.d.ts
|
|
3
|
+
/** Permission levels for editable site content templates. */
|
|
4
|
+
type UserPermissionLevel = "anchor" | "trusted" | "public";
|
|
5
|
+
/** Runtime script declaration attached to a content section/template. */
|
|
6
|
+
interface RuntimeScript {
|
|
7
|
+
src: string;
|
|
8
|
+
defer?: boolean;
|
|
9
|
+
module?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Bivariant component type for author-supplied layout components. */
|
|
12
|
+
type ComponentType<P = unknown> = {
|
|
13
|
+
bivarianceHack(props: P): JSX.Element;
|
|
14
|
+
}["bivarianceHack"];
|
|
15
|
+
/** Navigation slot types exposed to authored routes and generated entity routes. */
|
|
16
|
+
type NavigationSlot = "primary" | "secondary";
|
|
17
|
+
/** Display and behavior metadata for an entity type. */
|
|
18
|
+
interface EntityDisplayEntry {
|
|
19
|
+
label: string;
|
|
20
|
+
pluralName?: string | undefined;
|
|
21
|
+
/** Layout name for this entity type's generated routes (defaults to "default"). */
|
|
22
|
+
layout?: string | undefined;
|
|
23
|
+
/** Enable pagination for list pages. */
|
|
24
|
+
paginate?: boolean | undefined;
|
|
25
|
+
/** Items per page (default: 10). */
|
|
26
|
+
pageSize?: number | undefined;
|
|
27
|
+
navigation?: {
|
|
28
|
+
show?: boolean | undefined;
|
|
29
|
+
slot?: NavigationSlot | undefined;
|
|
30
|
+
priority?: number | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
}
|
|
33
|
+
interface SectionDefinitionInput {
|
|
34
|
+
id: string;
|
|
35
|
+
template: string;
|
|
36
|
+
content?: unknown;
|
|
37
|
+
dataQuery?: {
|
|
38
|
+
entityType?: string | undefined;
|
|
39
|
+
template?: string | undefined;
|
|
40
|
+
query?: Record<string, unknown> | undefined;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
} | undefined;
|
|
43
|
+
order?: number | undefined;
|
|
44
|
+
}
|
|
45
|
+
interface NavigationMetadataInput {
|
|
46
|
+
show?: boolean | undefined;
|
|
47
|
+
label?: string | undefined;
|
|
48
|
+
slot?: NavigationSlot | undefined;
|
|
49
|
+
priority?: number | undefined;
|
|
50
|
+
}
|
|
51
|
+
interface RouteDefinitionInput {
|
|
52
|
+
id: string;
|
|
53
|
+
path: string;
|
|
54
|
+
title?: string | undefined;
|
|
55
|
+
/** Bare display label without any page suffix. */
|
|
56
|
+
pageLabel?: string | undefined;
|
|
57
|
+
description?: string | undefined;
|
|
58
|
+
sections?: SectionDefinitionInput[] | undefined;
|
|
59
|
+
layout?: string | undefined;
|
|
60
|
+
fullscreen?: boolean | undefined;
|
|
61
|
+
pluginId?: string | undefined;
|
|
62
|
+
sourceEntityType?: string | undefined;
|
|
63
|
+
external?: boolean | undefined;
|
|
64
|
+
navigation?: NavigationMetadataInput | undefined;
|
|
65
|
+
}
|
|
66
|
+
interface SiteContentStringFieldDefinition {
|
|
67
|
+
type: "string";
|
|
68
|
+
label: string;
|
|
69
|
+
optional?: boolean;
|
|
70
|
+
}
|
|
71
|
+
interface SiteContentNumberFieldDefinition {
|
|
72
|
+
type: "number";
|
|
73
|
+
label: string;
|
|
74
|
+
optional?: boolean;
|
|
75
|
+
}
|
|
76
|
+
interface SiteContentEnumFieldDefinition {
|
|
77
|
+
type: "enum";
|
|
78
|
+
label: string;
|
|
79
|
+
options: [string, ...string[]] | readonly [string, ...string[]];
|
|
80
|
+
optional?: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface SiteContentObjectFieldDefinition {
|
|
83
|
+
type: "object";
|
|
84
|
+
label: string;
|
|
85
|
+
fields: Record<string, SiteContentFieldDefinition>;
|
|
86
|
+
optional?: boolean;
|
|
87
|
+
}
|
|
88
|
+
interface SiteContentArrayFieldDefinition {
|
|
89
|
+
type: "array";
|
|
90
|
+
label: string;
|
|
91
|
+
items: SiteContentStringFieldDefinition | SiteContentNumberFieldDefinition | SiteContentEnumFieldDefinition | SiteContentObjectFieldDefinition;
|
|
92
|
+
minItems?: number;
|
|
93
|
+
length?: number;
|
|
94
|
+
optional?: boolean;
|
|
95
|
+
}
|
|
96
|
+
type SiteContentFieldDefinition = SiteContentStringFieldDefinition | SiteContentNumberFieldDefinition | SiteContentEnumFieldDefinition | SiteContentObjectFieldDefinition | SiteContentArrayFieldDefinition;
|
|
97
|
+
interface SiteContentSectionDefinition {
|
|
98
|
+
description: string;
|
|
99
|
+
title: string;
|
|
100
|
+
layout: ComponentType<unknown>;
|
|
101
|
+
fields: Record<string, SiteContentFieldDefinition>;
|
|
102
|
+
requiredPermission?: UserPermissionLevel;
|
|
103
|
+
fullscreen?: boolean;
|
|
104
|
+
runtimeScripts?: RuntimeScript[];
|
|
105
|
+
}
|
|
106
|
+
interface SiteContentDefinition {
|
|
107
|
+
namespace: string;
|
|
108
|
+
sections: Record<string, SiteContentSectionDefinition>;
|
|
109
|
+
}
|
|
110
|
+
interface SiteMetadataCTA {
|
|
111
|
+
heading: string;
|
|
112
|
+
buttonText: string;
|
|
113
|
+
buttonLink: string;
|
|
114
|
+
}
|
|
115
|
+
interface SiteMetadataSection {
|
|
116
|
+
blurb?: string | undefined;
|
|
117
|
+
}
|
|
118
|
+
interface SiteMetadata {
|
|
119
|
+
title: string;
|
|
120
|
+
description: string;
|
|
121
|
+
url?: string | undefined;
|
|
122
|
+
copyright?: string | undefined;
|
|
123
|
+
logo?: boolean | undefined;
|
|
124
|
+
themeMode?: "light" | "dark" | undefined;
|
|
125
|
+
analyticsScript?: string | undefined;
|
|
126
|
+
cta?: SiteMetadataCTA | undefined;
|
|
127
|
+
sections?: Record<string, SiteMetadataSection> | undefined;
|
|
128
|
+
}
|
|
129
|
+
interface NavigationItem {
|
|
130
|
+
label: string;
|
|
131
|
+
href: string;
|
|
132
|
+
priority: number;
|
|
133
|
+
}
|
|
134
|
+
interface SiteLayoutInfo extends SiteMetadata {
|
|
135
|
+
copyright: string;
|
|
136
|
+
navigation: {
|
|
137
|
+
primary: NavigationItem[];
|
|
138
|
+
secondary: NavigationItem[];
|
|
139
|
+
};
|
|
140
|
+
socialLinks?: Array<{
|
|
141
|
+
platform: "github" | "instagram" | "linkedin" | "email" | "website";
|
|
142
|
+
url: string;
|
|
143
|
+
label?: string | undefined;
|
|
144
|
+
}> | undefined;
|
|
145
|
+
}
|
|
146
|
+
/** Declarative site-package shape authored by public site packages. */
|
|
147
|
+
interface SiteDefinition {
|
|
148
|
+
/** Layout components keyed by name — at minimum "default" is required. */
|
|
149
|
+
layouts: Record<string, unknown>;
|
|
150
|
+
/** Hand-written route definitions (home, about, etc.). */
|
|
151
|
+
routes: RouteDefinitionInput[];
|
|
152
|
+
/** Optional content definitions owned by this package. */
|
|
153
|
+
content?: SiteContentDefinition | SiteContentDefinition[];
|
|
154
|
+
/** Optional additive CSS owned by the site package. */
|
|
155
|
+
themeOverride?: string;
|
|
156
|
+
/** Global head scripts to inject into every rendered page. */
|
|
157
|
+
headScripts?: string[];
|
|
158
|
+
/** Display metadata per entity type. */
|
|
159
|
+
entityDisplay: Record<string, EntityDisplayEntry>;
|
|
160
|
+
/** Static assets to write into the site output directory at build time. */
|
|
161
|
+
staticAssets?: Record<string, string>;
|
|
162
|
+
}
|
|
163
|
+
type SiteDefinitionOverrides = Partial<SiteDefinition>;
|
|
164
|
+
interface RizomLink {
|
|
165
|
+
href: string;
|
|
166
|
+
label: string;
|
|
167
|
+
/** Open in a new tab with rel="noopener noreferrer". */
|
|
168
|
+
external?: boolean;
|
|
169
|
+
}
|
|
170
|
+
type RizomBrandSuffix = "ai" | "foundation" | "work";
|
|
171
|
+
interface RizomSideNavItem {
|
|
172
|
+
href: string;
|
|
173
|
+
label: string;
|
|
174
|
+
}
|
|
175
|
+
interface RizomFooterTagline {
|
|
176
|
+
prefix?: string;
|
|
177
|
+
link: RizomLink;
|
|
178
|
+
suffix?: string;
|
|
179
|
+
}
|
|
180
|
+
interface RizomLayoutProps {
|
|
181
|
+
sections: ComponentChildren[];
|
|
182
|
+
title: string;
|
|
183
|
+
description: string;
|
|
184
|
+
path: string;
|
|
185
|
+
siteInfo: SiteLayoutInfo;
|
|
186
|
+
}
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/ui/frame.d.ts
|
|
5
189
|
interface RizomFrameProps {
|
|
6
|
-
|
|
190
|
+
children?: ComponentChildren;
|
|
7
191
|
}
|
|
8
192
|
/**
|
|
9
193
|
* Shared Rizom page frame.
|
|
@@ -12,59 +196,67 @@ interface RizomFrameProps {
|
|
|
12
196
|
* container. Wrapper sites own their actual chrome/layout composition.
|
|
13
197
|
*/
|
|
14
198
|
declare const RizomFrame: ({ children }: RizomFrameProps) => JSX.Element;
|
|
15
|
-
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/ui/Header.d.ts
|
|
16
201
|
interface HeaderProps {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
202
|
+
brandSuffix: RizomBrandSuffix;
|
|
203
|
+
navLinks: RizomLink[];
|
|
204
|
+
primaryCta: RizomLink;
|
|
20
205
|
}
|
|
21
|
-
declare const Header: ({ brandSuffix, navLinks, primaryCta
|
|
22
|
-
|
|
206
|
+
declare const Header: ({ brandSuffix, navLinks, primaryCta }: HeaderProps) => JSX.Element;
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/ui/Footer.d.ts
|
|
23
209
|
interface FooterProps {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
declare const Footer: ({ brandSuffix, metaLabel, tagline, links, className
|
|
31
|
-
|
|
210
|
+
brandSuffix: RizomBrandSuffix;
|
|
211
|
+
metaLabel: string;
|
|
212
|
+
tagline?: RizomFooterTagline;
|
|
213
|
+
links: RizomLink[];
|
|
214
|
+
className?: string;
|
|
215
|
+
}
|
|
216
|
+
declare const Footer: ({ brandSuffix, metaLabel, tagline, links, className }: FooterProps) => JSX.Element;
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/ui/SideNav.d.ts
|
|
32
219
|
interface SideNavProps {
|
|
33
|
-
|
|
220
|
+
items: RizomSideNavItem[];
|
|
34
221
|
}
|
|
35
222
|
declare const SideNav: ({ items }: SideNavProps) => JSX.Element;
|
|
36
|
-
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/ui/Section.d.ts
|
|
37
225
|
interface SectionProps {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
226
|
+
id?: string;
|
|
227
|
+
className?: string;
|
|
228
|
+
children?: ComponentChildren;
|
|
41
229
|
}
|
|
42
230
|
declare const GUTTER = "px-6 md:px-10 xl:px-20";
|
|
43
|
-
declare const Section: ({ id, className, children
|
|
44
|
-
|
|
231
|
+
declare const Section: ({ id, className, children }: SectionProps) => JSX.Element;
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/ui/Button.d.ts
|
|
45
234
|
type ButtonVariant = "primary" | "primary-strong" | "secondary";
|
|
46
235
|
type ButtonSize = "md" | "lg";
|
|
47
236
|
interface ButtonProps {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
declare const Button: ({ href, variant, size, block, className, children
|
|
56
|
-
|
|
237
|
+
href: string;
|
|
238
|
+
variant?: ButtonVariant;
|
|
239
|
+
size?: ButtonSize;
|
|
240
|
+
block?: boolean;
|
|
241
|
+
className?: string;
|
|
242
|
+
children?: ComponentChildren;
|
|
243
|
+
}
|
|
244
|
+
declare const Button: ({ href, variant, size, block, className, children }: ButtonProps) => JSX.Element;
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/ui/Badge.d.ts
|
|
57
247
|
interface BadgeProps {
|
|
58
|
-
|
|
59
|
-
|
|
248
|
+
children?: ComponentChildren;
|
|
249
|
+
className?: string;
|
|
60
250
|
}
|
|
61
251
|
declare const Badge: ({ children, className }: BadgeProps) => JSX.Element;
|
|
62
|
-
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/ui/Divider.d.ts
|
|
63
254
|
interface DividerProps {
|
|
64
|
-
|
|
255
|
+
className?: string;
|
|
65
256
|
}
|
|
66
257
|
declare const Divider: ({ className }: DividerProps) => JSX.Element;
|
|
67
|
-
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/ui/highlighted-text.d.ts
|
|
68
260
|
/**
|
|
69
261
|
* Render a content string with two lightweight markup conventions:
|
|
70
262
|
*
|
|
@@ -78,58 +270,65 @@ declare const Divider: ({ className }: DividerProps) => JSX.Element;
|
|
|
78
270
|
* the parsing/structure is shared.
|
|
79
271
|
*/
|
|
80
272
|
declare function renderHighlightedText(text: string, highlightClass: string): JSX.Element;
|
|
81
|
-
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/ui/site-info-links.d.ts
|
|
82
275
|
declare function socialLinksToRizomLinks(siteInfo: Pick<SiteLayoutInfo, "socialLinks">, allowedPlatforms?: string[]): RizomLink[];
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/runtime/default-layout.d.ts
|
|
278
|
+
declare const DefaultRizomLayout: ({ sections }: RizomLayoutProps) => JSX.Element;
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region src/runtime/base-site.d.ts
|
|
86
281
|
declare const rizomBaseSite: SiteDefinition;
|
|
87
|
-
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region src/contracts.d.ts
|
|
88
284
|
type RizomThemeProfile = "product" | "editorial" | "studio";
|
|
89
|
-
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/create-site.d.ts
|
|
90
287
|
interface RizomRuntimeHooks {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
288
|
+
contentNamespace: string;
|
|
289
|
+
templates?: Record<string, unknown>;
|
|
290
|
+
dataSources?: unknown[];
|
|
94
291
|
}
|
|
95
292
|
interface CreateRizomSiteOptions {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
293
|
+
packageName: string;
|
|
294
|
+
themeProfile: RizomThemeProfile;
|
|
295
|
+
layout: unknown;
|
|
296
|
+
routes: RouteDefinitionInput[];
|
|
297
|
+
content?: SiteContentDefinition | SiteContentDefinition[];
|
|
298
|
+
themeOverride?: string;
|
|
299
|
+
/** Advanced runtime hooks for in-repo sites that need custom template/data-source wiring. */
|
|
300
|
+
runtime?: RizomRuntimeHooks;
|
|
104
301
|
}
|
|
105
302
|
declare function createRizomSite(options: CreateRizomSiteOptions): SiteDefinition;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region ../../shared/rizom-ui/src/types.d.ts
|
|
305
|
+
type RizomBrandSuffix$1 = "ai" | "foundation" | "work";
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region ../../shared/rizom-ui/src/Wordmark.d.ts
|
|
109
308
|
interface WordmarkProps {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
declare const Wordmark: ({ name, brandSuffix, className, dotClassName, suffixClassName
|
|
119
|
-
|
|
309
|
+
/** Brand name before the dot. Defaults to `"rizom"`. */
|
|
310
|
+
name?: string;
|
|
311
|
+
/** Suffix after the dot. Any string (e.g. `"ai"`, `"io"`, `"foundation"`). */
|
|
312
|
+
brandSuffix: RizomBrandSuffix$1 | string;
|
|
313
|
+
className?: string;
|
|
314
|
+
dotClassName?: string;
|
|
315
|
+
suffixClassName?: string;
|
|
316
|
+
}
|
|
317
|
+
declare const Wordmark: ({ name, brandSuffix, className, dotClassName, suffixClassName }: WordmarkProps) => JSX.Element;
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region ../../shared/rizom-ui/src/Ecosystem.d.ts
|
|
120
320
|
interface EcosystemCard {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
321
|
+
suffix: RizomBrandSuffix$1;
|
|
322
|
+
title: string;
|
|
323
|
+
body: string;
|
|
324
|
+
linkLabel: string;
|
|
325
|
+
linkHref: string;
|
|
126
326
|
}
|
|
127
327
|
interface EcosystemContent {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
declare const Ecosystem: ({ eyebrow, headline, cards
|
|
133
|
-
|
|
134
|
-
export { Badge, Button, DefaultRizomLayout, Divider, Ecosystem, Footer, GUTTER, Header, RizomFrame, Section, SideNav, Wordmark, createRizomSite, rizomBaseSite as default,
|
|
135
|
-
export type { BadgeProps, ButtonProps, ButtonSize, ButtonVariant, CreateRizomSiteOptions, DividerProps, EcosystemCard, EcosystemContent, RizomFrameProps, RizomThemeProfile, SectionProps, WordmarkProps };
|
|
328
|
+
eyebrow: string;
|
|
329
|
+
headline: string;
|
|
330
|
+
cards: EcosystemCard[];
|
|
331
|
+
}
|
|
332
|
+
declare const Ecosystem: ({ eyebrow, headline, cards }: EcosystemContent) => JSX.Element;
|
|
333
|
+
//#endregion
|
|
334
|
+
export { Badge, type BadgeProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, type CreateRizomSiteOptions, DefaultRizomLayout, Divider, type DividerProps, Ecosystem, type EcosystemCard, type EcosystemContent, type EntityDisplayEntry, Footer, GUTTER, Header, type RizomBrandSuffix, type RizomFooterTagline, RizomFrame, type RizomFrameProps, type RizomLayoutProps, type RizomLink, type RizomSideNavItem, type RizomThemeProfile, type RouteDefinitionInput, Section, type SectionDefinitionInput, type SectionProps, SideNav, type SiteContentArrayFieldDefinition, type SiteContentDefinition, type SiteContentEnumFieldDefinition, type SiteContentFieldDefinition, type SiteContentNumberFieldDefinition, type SiteContentObjectFieldDefinition, type SiteContentSectionDefinition, type SiteContentStringFieldDefinition, type SiteDefinition, type SiteDefinitionOverrides, type SiteLayoutInfo, Wordmark, type WordmarkProps, createRizomSite, rizomBaseSite as default, rizomBaseSite, renderHighlightedText, socialLinksToRizomLinks };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rizom/site-rizom",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.151",
|
|
4
4
|
"description": "Shared Rizom site core — structural base for rizom.ai, rizom.foundation, and rizom.work",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"typecheck": "tsc --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@rizom/site": "0.2.0-alpha.
|
|
29
|
+
"@rizom/site": "0.2.0-alpha.151",
|
|
30
30
|
"clsx": "^2.1.0",
|
|
31
31
|
"preact": "^10.27.2",
|
|
32
32
|
"tailwind-merge": "^3.6.0"
|