@contentful/experiences-core 1.42.0-prerelease-20250627T1335-d74dad7.0 → 1.42.0-prerelease-20250630T1135-a8b68d4.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 +21 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1072,13 +1072,29 @@ const ParameterDefinitionsSchema = z.record(propertyKeySchema, ParameterDefiniti
|
|
|
1072
1072
|
const VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);
|
|
1073
1073
|
const ComponentVariablesSchema = z.record(z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/), // Here the key is <variableName>_<nanoidId> so we need to allow for a longer length
|
|
1074
1074
|
ComponentVariableSchema);
|
|
1075
|
-
const
|
|
1075
|
+
const PassToNodeSchema = z
|
|
1076
|
+
.object({
|
|
1077
|
+
nodeId: propertyKeySchema,
|
|
1078
|
+
parameterId: propertyKeySchema,
|
|
1079
|
+
prebindingId: propertyKeySchema,
|
|
1080
|
+
})
|
|
1081
|
+
.strict();
|
|
1082
|
+
const PrebindingDefinitionSchema = z
|
|
1083
|
+
.object({
|
|
1084
|
+
id: propertyKeySchema,
|
|
1085
|
+
variableMappings: VariableMappingsSchema.optional(),
|
|
1086
|
+
parameterDefinitions: ParameterDefinitionsSchema,
|
|
1087
|
+
passToNodes: z.array(PassToNodeSchema).optional(),
|
|
1088
|
+
})
|
|
1089
|
+
.strict();
|
|
1090
|
+
const ComponentSettingsSchema = z
|
|
1091
|
+
.object({
|
|
1076
1092
|
variableDefinitions: ComponentVariablesSchema,
|
|
1077
1093
|
thumbnailId: z.enum(THUMBNAIL_IDS).optional(),
|
|
1078
1094
|
category: z.string().max(50, 'Category must contain at most 50 characters').optional(),
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1095
|
+
prebindingDefinitions: z.array(PrebindingDefinitionSchema).optional(),
|
|
1096
|
+
})
|
|
1097
|
+
.strict();
|
|
1082
1098
|
z.object({
|
|
1083
1099
|
componentTree: localeWrapper(ComponentTreeSchema),
|
|
1084
1100
|
dataSource: localeWrapper(DataSourceSchema),
|
|
@@ -4156,7 +4172,7 @@ const attachPrebindingDefaultValueAsDataSource = (experienceEntry) => {
|
|
|
4156
4172
|
// Only supported for pattern entries since experience entries don't define pattern properties.
|
|
4157
4173
|
return;
|
|
4158
4174
|
}
|
|
4159
|
-
const patternDefs = experienceEntry.fields.componentSettings?.parameterDefinitions ?? {};
|
|
4175
|
+
const patternDefs = experienceEntry.fields.componentSettings?.prebindingDefinitions?.[0].parameterDefinitions ?? {};
|
|
4160
4176
|
const defaultPrebinding = Object.values(patternDefs).find((def) => def.defaultSource)?.defaultSource;
|
|
4161
4177
|
const { link, type } = defaultPrebinding ?? {};
|
|
4162
4178
|
if (!link || !type)
|