@contentful/experiences-core 1.42.0-prerelease-20250627T1335-d74dad7.0 → 1.42.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 +11 -17
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1047,18 +1047,14 @@ const VariableMappingSchema = z.object({
|
|
|
1047
1047
|
// TODO: finalize schema structure before release
|
|
1048
1048
|
// https://contentful.atlassian.net/browse/LUMOS-523
|
|
1049
1049
|
const ParameterDefinitionSchema = z.object({
|
|
1050
|
-
|
|
1051
|
-
.
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
type: z.literal('Link'),
|
|
1057
|
-
id: z.string(),
|
|
1058
|
-
linkType: z.enum(['Entry']),
|
|
1059
|
-
}),
|
|
1050
|
+
defaultValue: z
|
|
1051
|
+
.record(z.string(), z.object({
|
|
1052
|
+
sys: z.object({
|
|
1053
|
+
type: z.literal('Link'),
|
|
1054
|
+
id: z.string(),
|
|
1055
|
+
linkType: z.enum(['Entry']),
|
|
1060
1056
|
}),
|
|
1061
|
-
})
|
|
1057
|
+
}))
|
|
1062
1058
|
.optional(),
|
|
1063
1059
|
contentTypes: z.record(z.string(), z.object({
|
|
1064
1060
|
sys: z.object({
|
|
@@ -4157,11 +4153,9 @@ const attachPrebindingDefaultValueAsDataSource = (experienceEntry) => {
|
|
|
4157
4153
|
return;
|
|
4158
4154
|
}
|
|
4159
4155
|
const patternDefs = experienceEntry.fields.componentSettings?.parameterDefinitions ?? {};
|
|
4160
|
-
const defaultPrebinding = Object.values(patternDefs).find((def) => def.
|
|
4161
|
-
const
|
|
4162
|
-
|
|
4163
|
-
return;
|
|
4164
|
-
const id = link.sys?.id;
|
|
4156
|
+
const defaultPrebinding = Object.values(patternDefs).find((def) => def.defaultValue)?.defaultValue;
|
|
4157
|
+
const [value] = Object.values(defaultPrebinding ?? {});
|
|
4158
|
+
const id = value?.sys?.id;
|
|
4165
4159
|
if (!id)
|
|
4166
4160
|
return;
|
|
4167
4161
|
experienceEntry.fields.dataSource = {
|
|
@@ -4169,7 +4163,7 @@ const attachPrebindingDefaultValueAsDataSource = (experienceEntry) => {
|
|
|
4169
4163
|
[id]: {
|
|
4170
4164
|
sys: {
|
|
4171
4165
|
type: 'Link',
|
|
4172
|
-
linkType:
|
|
4166
|
+
linkType: 'Entry',
|
|
4173
4167
|
id,
|
|
4174
4168
|
},
|
|
4175
4169
|
},
|