@contentful/experiences-core 3.6.1-dev-20250904T1450-0286e47.0 → 3.6.1-dev-20250909T1146-4eefde4.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/dist/index.js +34 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -6
package/dist/index.js
CHANGED
|
@@ -1136,8 +1136,20 @@ z.object({
|
|
|
1136
1136
|
componentSettings: localeWrapper(ComponentSettingsSchema),
|
|
1137
1137
|
});
|
|
1138
1138
|
|
|
1139
|
-
z
|
|
1139
|
+
z
|
|
1140
|
+
.object({
|
|
1140
1141
|
id: DefinitionPropertyKeySchema,
|
|
1142
|
+
name: z.string(),
|
|
1143
|
+
category: z.string().optional(),
|
|
1144
|
+
thumbnailUrl: z.string().optional(),
|
|
1145
|
+
thumbnailId: z.string().optional(),
|
|
1146
|
+
hyperlinkPattern: z.string().optional(),
|
|
1147
|
+
children: z.boolean().optional(),
|
|
1148
|
+
slots: z
|
|
1149
|
+
.record(DefinitionPropertyKeySchema, z.object({ displayName: z.string().optional() }))
|
|
1150
|
+
.optional(),
|
|
1151
|
+
builtInStyles: z.array(z.string()).optional(),
|
|
1152
|
+
tooltip: z.object({ imageUrl: z.string().optional(), description: z.string() }).optional(),
|
|
1141
1153
|
variables: z.record(DefinitionPropertyKeySchema, ComponentVariableSchema.extend({
|
|
1142
1154
|
defaultValue: PrimitiveValueSchema.optional(),
|
|
1143
1155
|
}).superRefine((val, ctx) => {
|
|
@@ -1243,6 +1255,27 @@ z.object({
|
|
|
1243
1255
|
break;
|
|
1244
1256
|
}
|
|
1245
1257
|
})),
|
|
1258
|
+
})
|
|
1259
|
+
.superRefine((val, ctx) => {
|
|
1260
|
+
if (val.children === true && (!!val.variables.children || !!val.slots?.children)) {
|
|
1261
|
+
ctx.addIssue({
|
|
1262
|
+
code: z.ZodIssueCode.custom,
|
|
1263
|
+
message: `Cannot activate 'children: true' and name a variable or slot 'children' at the same time`,
|
|
1264
|
+
fatal: false,
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
// Ensure that slots and variables don't use the same names
|
|
1268
|
+
if (val.variables && val.slots) {
|
|
1269
|
+
Object.keys(val.variables).forEach((name) => {
|
|
1270
|
+
if (val.slots[name]) {
|
|
1271
|
+
ctx.addIssue({
|
|
1272
|
+
code: z.ZodIssueCode.custom,
|
|
1273
|
+
message: `Variable and slot cannot have the same name: ${name}`,
|
|
1274
|
+
fatal: false,
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
1246
1279
|
});
|
|
1247
1280
|
|
|
1248
1281
|
var CodeNames;
|