@rizom/site-rizom-ai 0.2.0-alpha.256 → 0.2.0-alpha.258

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 CHANGED
@@ -22,26 +22,6 @@ type ComponentType<P = unknown> = {
22
22
  /** Navigation slot types exposed to authored routes and generated entity routes. */
23
23
  type NavigationSlot = "primary" | "secondary";
24
24
  /** Display and behavior metadata for an entity type. */
25
- interface EntityDisplayEntry {
26
- label: string;
27
- pluralName?: string | undefined;
28
- /** Layout name for this entity type's generated routes (defaults to "default"). */
29
- layout?: string | undefined;
30
- /** Enable pagination for list pages. */
31
- paginate?: boolean | undefined;
32
- /** Items per page (default: 10). */
33
- pageSize?: number | undefined;
34
- /**
35
- * A piece of work a visitor's answer may cite as a source. When no type
36
- * is marked, an answer may cite any type the site has pages for.
37
- */
38
- citable?: boolean | undefined;
39
- navigation?: {
40
- show?: boolean | undefined;
41
- slot?: NavigationSlot | undefined;
42
- priority?: number | undefined;
43
- } | undefined;
44
- }
45
25
  interface SectionDefinitionInput {
46
26
  id: string;
47
27
  template: string;
@@ -207,6 +187,28 @@ interface SiteDefinition {
207
187
  staticAssets?: Record<string, string> | undefined;
208
188
  }
209
189
  type SiteDefinitionOverrides = { [K in keyof SiteDefinition]?: SiteDefinition[K] | undefined; };
190
+ type Strict<Shape extends z.ZodRawShape> = z.ZodObject<Shape, z.core.$strict>;
191
+ /**
192
+ * Display and behavior metadata for an entity type, as a site declares it.
193
+ * The one definition: the site-builder takes it as it is.
194
+ */
195
+ declare const entityDisplaySchema: Strict<{
196
+ label: z.ZodString;
197
+ pluralName: z.ZodOptional<z.ZodString>;
198
+ layout: z.ZodOptional<z.ZodString>;
199
+ paginate: z.ZodOptional<z.ZodBoolean>;
200
+ pageSize: z.ZodOptional<z.ZodNumber>;
201
+ citable: z.ZodOptional<z.ZodBoolean>;
202
+ navigation: z.ZodOptional<Strict<{
203
+ show: z.ZodOptional<z.ZodBoolean>;
204
+ slot: z.ZodOptional<z.ZodEnum<{
205
+ primary: "primary";
206
+ secondary: "secondary";
207
+ }>>;
208
+ priority: z.ZodOptional<z.ZodNumber>;
209
+ }>>;
210
+ }>;
211
+ type EntityDisplayEntry = z.output<typeof entityDisplaySchema>;
210
212
  //#endregion
211
213
  //#region src/rizom/contracts.d.ts
212
214
  interface RizomLink {
package/dist/index.js CHANGED
@@ -28019,13 +28019,11 @@ html[data-theme="light"] .brain-page .button {
28019
28019
  margin: 4px 0 24px;
28020
28020
  border-top: 1px solid var(--color-border-light);
28021
28021
  }
28022
- .brain-box-notice h3,
28023
- .brain-box-privacy h3 {
28022
+ .brain-box-notice h3 {
28024
28023
  font: 600 14px/1.4 var(--font-body);
28025
28024
  margin: 0 0 6px;
28026
28025
  }
28027
- .brain-box-notice p,
28028
- .brain-box-privacy p {
28026
+ .brain-box-notice p {
28029
28027
  font: 13px/1.6 var(--font-body);
28030
28028
  color: var(--color-text-muted);
28031
28029
  margin: 0 0 10px;
@@ -28055,13 +28053,6 @@ html[data-theme="light"] .brain-page .button {
28055
28053
  text-decoration: underline;
28056
28054
  text-underline-offset: 4px;
28057
28055
  }
28058
- .brain-box-privacy {
28059
- margin: 0 0 18px;
28060
- padding: 15px;
28061
- background: var(--color-bg-subtle);
28062
- border: 1px solid var(--color-border-light);
28063
- border-radius: 5px;
28064
- }
28065
28056
  .brain-box-earlier {
28066
28057
  margin-bottom: 20px;
28067
28058
  color: var(--color-text-muted);
@@ -30328,6 +30319,159 @@ var rizomBaseSite = {
30328
30319
  entityDisplay: {},
30329
30320
  staticAssets: rizomRuntimeStaticAssets
30330
30321
  };
30322
+ // ../../packages/site/src/index.ts
30323
+ var NavigationSlots = [
30324
+ "primary",
30325
+ "secondary"
30326
+ ];
30327
+ function defineSection(schema, component, meta3) {
30328
+ return Object.freeze({ schema, component, ...meta3 });
30329
+ }
30330
+ function sectionGroup(namespace, sections) {
30331
+ if (!namespace.trim()) {
30332
+ throw new Error("Section group namespace must not be empty");
30333
+ }
30334
+ if (Object.keys(sections).length === 0) {
30335
+ throw new Error(`Section group "${namespace}" must contain a section`);
30336
+ }
30337
+ return Object.freeze({
30338
+ namespace,
30339
+ sections: Object.freeze({ ...sections })
30340
+ });
30341
+ }
30342
+ var componentSchema = exports_external.custom((value) => typeof value === "function", "Expected a React component");
30343
+ var navigationInputSchema = exports_external.strictObject({
30344
+ show: exports_external.boolean().optional(),
30345
+ label: exports_external.string().min(1).optional(),
30346
+ slot: exports_external.enum(NavigationSlots).optional(),
30347
+ priority: exports_external.number().optional()
30348
+ });
30349
+ var routeSectionSchema = exports_external.strictObject({
30350
+ id: exports_external.string().min(1),
30351
+ template: exports_external.string().min(1),
30352
+ content: exports_external.unknown().optional(),
30353
+ dataQuery: exports_external.looseObject({
30354
+ entityType: exports_external.string().optional(),
30355
+ template: exports_external.string().optional(),
30356
+ query: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
30357
+ }).optional(),
30358
+ order: exports_external.number().optional()
30359
+ });
30360
+ var routeInputSchema = exports_external.strictObject({
30361
+ id: exports_external.string().min(1),
30362
+ path: exports_external.string().startsWith("/"),
30363
+ title: exports_external.string().optional(),
30364
+ pageLabel: exports_external.string().optional(),
30365
+ description: exports_external.string().optional(),
30366
+ sections: exports_external.array(routeSectionSchema).optional(),
30367
+ layout: exports_external.string().min(1).optional(),
30368
+ fullscreen: exports_external.boolean().optional(),
30369
+ pluginId: exports_external.string().optional(),
30370
+ sourceEntityType: exports_external.string().optional(),
30371
+ external: exports_external.boolean().optional(),
30372
+ navigation: navigationInputSchema.optional()
30373
+ });
30374
+ var entityDisplaySchema = exports_external.strictObject({
30375
+ label: exports_external.string().min(1),
30376
+ pluralName: exports_external.string().min(1).optional(),
30377
+ layout: exports_external.string().min(1).optional(),
30378
+ paginate: exports_external.boolean().optional(),
30379
+ pageSize: exports_external.number().int().positive().optional(),
30380
+ citable: exports_external.boolean().optional(),
30381
+ navigation: exports_external.strictObject({
30382
+ show: exports_external.boolean().optional(),
30383
+ slot: exports_external.enum(NavigationSlots).optional(),
30384
+ priority: exports_external.number().optional()
30385
+ }).optional()
30386
+ });
30387
+ var sectionDefinitionSchema = exports_external.strictObject({
30388
+ schema: exports_external.custom((value) => value instanceof exports_external.ZodType, "Expected a Zod schema"),
30389
+ component: exports_external.custom((value) => typeof value === "function", "Expected a React component"),
30390
+ title: exports_external.string().min(1),
30391
+ description: exports_external.string(),
30392
+ requiredPermission: exports_external.enum(["admin", "trusted", "public"]).optional(),
30393
+ fullscreen: exports_external.boolean().optional()
30394
+ });
30395
+ var sectionGroupSchema = exports_external.strictObject({
30396
+ namespace: exports_external.string().min(1),
30397
+ sections: exports_external.record(exports_external.string(), sectionDefinitionSchema)
30398
+ });
30399
+ var jsonObjectSchema2 = exports_external.record(exports_external.string(), exports_external.json());
30400
+ var siteContentSchema = exports_external.record(exports_external.string(), exports_external.record(exports_external.string(), jsonObjectSchema2));
30401
+ var siteDefinitionShape = {
30402
+ layouts: exports_external.record(exports_external.string(), componentSchema).refine((layouts) => typeof layouts["default"] === "function", {
30403
+ message: 'Site layouts must include a "default" component'
30404
+ }),
30405
+ routes: exports_external.array(routeInputSchema),
30406
+ content: siteContentSchema.optional(),
30407
+ sections: exports_external.union([sectionGroupSchema, exports_external.array(sectionGroupSchema)]).optional(),
30408
+ themeOverride: exports_external.string().optional(),
30409
+ headScripts: exports_external.array(exports_external.string()).optional(),
30410
+ entityDisplay: exports_external.record(exports_external.string(), entityDisplaySchema),
30411
+ staticAssets: exports_external.record(exports_external.string(), exports_external.string()).optional()
30412
+ };
30413
+ var siteDefinitionOverridesSchema = exports_external.strictObject(siteDefinitionShape).partial();
30414
+ var siteDefinitionSchema = exports_external.strictObject(siteDefinitionShape).superRefine((site, context) => {
30415
+ const routeIds = new Set;
30416
+ for (const [index, route] of site.routes.entries()) {
30417
+ if (routeIds.has(route.id)) {
30418
+ context.addIssue({
30419
+ code: "custom",
30420
+ path: ["routes", index, "id"],
30421
+ message: `Duplicate route id "${route.id}"`
30422
+ });
30423
+ }
30424
+ routeIds.add(route.id);
30425
+ const layout = route.layout ?? "default";
30426
+ if (!site.layouts[layout]) {
30427
+ context.addIssue({
30428
+ code: "custom",
30429
+ path: ["routes", index, "layout"],
30430
+ message: `Unknown layout "${layout}"`
30431
+ });
30432
+ }
30433
+ }
30434
+ const groups = Array.isArray(site.sections) ? site.sections : site.sections ? [site.sections] : [];
30435
+ const groupsByNamespace = new Map(groups.map((group) => [group.namespace, group]));
30436
+ if (groupsByNamespace.size !== groups.length) {
30437
+ context.addIssue({
30438
+ code: "custom",
30439
+ path: ["sections"],
30440
+ message: "Section group namespaces must be unique"
30441
+ });
30442
+ }
30443
+ for (const [namespace, sections] of Object.entries(site.content ?? {})) {
30444
+ const group = groupsByNamespace.get(namespace);
30445
+ if (!group) {
30446
+ context.addIssue({
30447
+ code: "custom",
30448
+ path: ["content", namespace],
30449
+ message: `Content namespace "${namespace}" has no section group`
30450
+ });
30451
+ continue;
30452
+ }
30453
+ for (const [sectionId, content] of Object.entries(sections)) {
30454
+ const section = group.sections[sectionId];
30455
+ if (!section) {
30456
+ context.addIssue({
30457
+ code: "custom",
30458
+ path: ["content", namespace, sectionId],
30459
+ message: `Content section "${namespace}.${sectionId}" is not defined`
30460
+ });
30461
+ continue;
30462
+ }
30463
+ const parsed = section.schema.safeParse(content);
30464
+ if (!parsed.success) {
30465
+ context.addIssue({
30466
+ code: "custom",
30467
+ path: ["content", namespace, sectionId],
30468
+ message: `Content does not satisfy the "${namespace}.${sectionId}" schema: ${exports_external.prettifyError(parsed.error)}`
30469
+ });
30470
+ }
30471
+ }
30472
+ }
30473
+ });
30474
+
30331
30475
  // ../../shared/site-composition/src/routes.ts
30332
30476
  var SectionDefinitionSchema = exports_external.object({
30333
30477
  id: exports_external.string(),
@@ -30344,11 +30488,11 @@ var SectionDefinitionSchema = exports_external.object({
30344
30488
  }).optional(),
30345
30489
  order: exports_external.number().optional()
30346
30490
  });
30347
- var NavigationSlots = ["primary", "secondary"];
30491
+ var NavigationSlots2 = ["primary", "secondary"];
30348
30492
  var NavigationMetadataSchema = exports_external.object({
30349
30493
  show: exports_external.boolean().default(false),
30350
30494
  label: exports_external.string().optional(),
30351
- slot: exports_external.enum(NavigationSlots).default("primary"),
30495
+ slot: exports_external.enum(NavigationSlots2).default("primary"),
30352
30496
  priority: exports_external.number().min(0).max(100).default(50)
30353
30497
  }).optional();
30354
30498
  var RouteDefinitionSchema = exports_external.object({
@@ -43101,159 +43245,6 @@ var siteInfoBodySchema = siteInfoBaseSchema.extend({
43101
43245
  title: exports_external.string().optional().describe("Optional site title override"),
43102
43246
  description: exports_external.string().optional().describe("Optional site description override")
43103
43247
  });
43104
- // ../../packages/site/src/index.ts
43105
- var NavigationSlots2 = [
43106
- "primary",
43107
- "secondary"
43108
- ];
43109
- function defineSection(schema2, component, meta3) {
43110
- return Object.freeze({ schema: schema2, component, ...meta3 });
43111
- }
43112
- function sectionGroup(namespace, sections) {
43113
- if (!namespace.trim()) {
43114
- throw new Error("Section group namespace must not be empty");
43115
- }
43116
- if (Object.keys(sections).length === 0) {
43117
- throw new Error(`Section group "${namespace}" must contain a section`);
43118
- }
43119
- return Object.freeze({
43120
- namespace,
43121
- sections: Object.freeze({ ...sections })
43122
- });
43123
- }
43124
- var componentSchema = exports_external.custom((value) => typeof value === "function", "Expected a React component");
43125
- var navigationInputSchema = exports_external.strictObject({
43126
- show: exports_external.boolean().optional(),
43127
- label: exports_external.string().min(1).optional(),
43128
- slot: exports_external.enum(NavigationSlots2).optional(),
43129
- priority: exports_external.number().optional()
43130
- });
43131
- var routeSectionSchema = exports_external.strictObject({
43132
- id: exports_external.string().min(1),
43133
- template: exports_external.string().min(1),
43134
- content: exports_external.unknown().optional(),
43135
- dataQuery: exports_external.looseObject({
43136
- entityType: exports_external.string().optional(),
43137
- template: exports_external.string().optional(),
43138
- query: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
43139
- }).optional(),
43140
- order: exports_external.number().optional()
43141
- });
43142
- var routeInputSchema = exports_external.strictObject({
43143
- id: exports_external.string().min(1),
43144
- path: exports_external.string().startsWith("/"),
43145
- title: exports_external.string().optional(),
43146
- pageLabel: exports_external.string().optional(),
43147
- description: exports_external.string().optional(),
43148
- sections: exports_external.array(routeSectionSchema).optional(),
43149
- layout: exports_external.string().min(1).optional(),
43150
- fullscreen: exports_external.boolean().optional(),
43151
- pluginId: exports_external.string().optional(),
43152
- sourceEntityType: exports_external.string().optional(),
43153
- external: exports_external.boolean().optional(),
43154
- navigation: navigationInputSchema.optional()
43155
- });
43156
- var entityDisplaySchema = exports_external.strictObject({
43157
- label: exports_external.string().min(1),
43158
- pluralName: exports_external.string().min(1).optional(),
43159
- layout: exports_external.string().min(1).optional(),
43160
- paginate: exports_external.boolean().optional(),
43161
- pageSize: exports_external.number().int().positive().optional(),
43162
- citable: exports_external.boolean().optional(),
43163
- navigation: exports_external.strictObject({
43164
- show: exports_external.boolean().optional(),
43165
- slot: exports_external.enum(NavigationSlots2).optional(),
43166
- priority: exports_external.number().optional()
43167
- }).optional()
43168
- });
43169
- var sectionDefinitionSchema = exports_external.strictObject({
43170
- schema: exports_external.custom((value) => value instanceof exports_external.ZodType, "Expected a Zod schema"),
43171
- component: exports_external.custom((value) => typeof value === "function", "Expected a React component"),
43172
- title: exports_external.string().min(1),
43173
- description: exports_external.string(),
43174
- requiredPermission: exports_external.enum(["admin", "trusted", "public"]).optional(),
43175
- fullscreen: exports_external.boolean().optional()
43176
- });
43177
- var sectionGroupSchema = exports_external.strictObject({
43178
- namespace: exports_external.string().min(1),
43179
- sections: exports_external.record(exports_external.string(), sectionDefinitionSchema)
43180
- });
43181
- var jsonObjectSchema2 = exports_external.record(exports_external.string(), exports_external.json());
43182
- var siteContentSchema = exports_external.record(exports_external.string(), exports_external.record(exports_external.string(), jsonObjectSchema2));
43183
- var siteDefinitionShape = {
43184
- layouts: exports_external.record(exports_external.string(), componentSchema).refine((layouts) => typeof layouts["default"] === "function", {
43185
- message: 'Site layouts must include a "default" component'
43186
- }),
43187
- routes: exports_external.array(routeInputSchema),
43188
- content: siteContentSchema.optional(),
43189
- sections: exports_external.union([sectionGroupSchema, exports_external.array(sectionGroupSchema)]).optional(),
43190
- themeOverride: exports_external.string().optional(),
43191
- headScripts: exports_external.array(exports_external.string()).optional(),
43192
- entityDisplay: exports_external.record(exports_external.string(), entityDisplaySchema),
43193
- staticAssets: exports_external.record(exports_external.string(), exports_external.string()).optional()
43194
- };
43195
- var siteDefinitionOverridesSchema = exports_external.strictObject(siteDefinitionShape).partial();
43196
- var siteDefinitionSchema = exports_external.strictObject(siteDefinitionShape).superRefine((site, context) => {
43197
- const routeIds = new Set;
43198
- for (const [index2, route] of site.routes.entries()) {
43199
- if (routeIds.has(route.id)) {
43200
- context.addIssue({
43201
- code: "custom",
43202
- path: ["routes", index2, "id"],
43203
- message: `Duplicate route id "${route.id}"`
43204
- });
43205
- }
43206
- routeIds.add(route.id);
43207
- const layout = route.layout ?? "default";
43208
- if (!site.layouts[layout]) {
43209
- context.addIssue({
43210
- code: "custom",
43211
- path: ["routes", index2, "layout"],
43212
- message: `Unknown layout "${layout}"`
43213
- });
43214
- }
43215
- }
43216
- const groups = Array.isArray(site.sections) ? site.sections : site.sections ? [site.sections] : [];
43217
- const groupsByNamespace = new Map(groups.map((group) => [group.namespace, group]));
43218
- if (groupsByNamespace.size !== groups.length) {
43219
- context.addIssue({
43220
- code: "custom",
43221
- path: ["sections"],
43222
- message: "Section group namespaces must be unique"
43223
- });
43224
- }
43225
- for (const [namespace, sections] of Object.entries(site.content ?? {})) {
43226
- const group = groupsByNamespace.get(namespace);
43227
- if (!group) {
43228
- context.addIssue({
43229
- code: "custom",
43230
- path: ["content", namespace],
43231
- message: `Content namespace "${namespace}" has no section group`
43232
- });
43233
- continue;
43234
- }
43235
- for (const [sectionId, content3] of Object.entries(sections)) {
43236
- const section = group.sections[sectionId];
43237
- if (!section) {
43238
- context.addIssue({
43239
- code: "custom",
43240
- path: ["content", namespace, sectionId],
43241
- message: `Content section "${namespace}.${sectionId}" is not defined`
43242
- });
43243
- continue;
43244
- }
43245
- const parsed = section.schema.safeParse(content3);
43246
- if (!parsed.success) {
43247
- context.addIssue({
43248
- code: "custom",
43249
- path: ["content", namespace, sectionId],
43250
- message: `Content does not satisfy the "${namespace}.${sectionId}" schema: ${exports_external.prettifyError(parsed.error)}`
43251
- });
43252
- }
43253
- }
43254
- }
43255
- });
43256
-
43257
43248
  // ../../shared/site-composition/src/package.ts
43258
43249
  function mergeContent(baseContent, overrideContent) {
43259
43250
  if (!baseContent)
@@ -48671,4 +48662,4 @@ export {
48671
48662
  workSections
48672
48663
  };
48673
48664
 
48674
- //# debugId=6F836211942A235964756E2164756E21
48665
+ //# debugId=0279ADD07C1A9DEF64756E2164756E21