@decocms/blocks 7.79.5 → 7.79.7
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/package.json +1 -1
- package/src/cms/schema.ts +11 -1
package/package.json
CHANGED
package/src/cms/schema.ts
CHANGED
|
@@ -1294,6 +1294,16 @@ export function composeMeta(siteMeta: MetaResponse, options?: ComposeMetaOptions
|
|
|
1294
1294
|
const page = buildPageSchema(fullSectionAnyOf);
|
|
1295
1295
|
const actions = buildActionDefinitions();
|
|
1296
1296
|
const matchers = buildMatcherDefinitions();
|
|
1297
|
+
// The site's own matchers (src/matchers, emitted by the schema generator)
|
|
1298
|
+
// join the framework's, as the site's loaders join the loader union above.
|
|
1299
|
+
const seenMatcherRefs = new Set<string>(matchers.matcherAnyOf.map((r: any) => r.$ref));
|
|
1300
|
+
const matcherUnion = [
|
|
1301
|
+
...matchers.matcherAnyOf,
|
|
1302
|
+
...(siteMeta.schema?.root?.matchers?.anyOf ?? []).filter(
|
|
1303
|
+
(ref: any): ref is { $ref: string } =>
|
|
1304
|
+
Boolean(ref) && typeof ref.$ref === "string" && !seenMatcherRefs.has(ref.$ref),
|
|
1305
|
+
),
|
|
1306
|
+
];
|
|
1297
1307
|
const functions = buildFunctionDefinitions();
|
|
1298
1308
|
|
|
1299
1309
|
const sectionRefDef = { title: "Section", anyOf: fullSectionAnyOf };
|
|
@@ -1359,7 +1369,7 @@ export function composeMeta(siteMeta: MetaResponse, options?: ComposeMetaOptions
|
|
|
1359
1369
|
sections: { anyOf: fullSectionAnyOf },
|
|
1360
1370
|
pages: { anyOf: page.rootAnyOf },
|
|
1361
1371
|
loaders: { anyOf: loaderUnion },
|
|
1362
|
-
matchers: { anyOf:
|
|
1372
|
+
matchers: { anyOf: matcherUnion },
|
|
1363
1373
|
functions: { title: "functions", anyOf: functions.functionAnyOf },
|
|
1364
1374
|
},
|
|
1365
1375
|
},
|