@contentful/experiences-core 3.7.2-dev-20250924T1519-77d453c.0 → 3.8.0-dev-20250925T1014-c658e71.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/entity/EntityStore.d.ts +5 -5
- package/dist/index.cjs +8 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -9
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -30,6 +30,11 @@ declare class EntityStore extends EntityStoreBase {
|
|
|
30
30
|
}>;
|
|
31
31
|
get hoistedParameterDefinitions(): Record<string, {
|
|
32
32
|
contentTypes: string[];
|
|
33
|
+
passToNodes: {
|
|
34
|
+
prebindingId: string;
|
|
35
|
+
parameterId: string;
|
|
36
|
+
nodeId: string;
|
|
37
|
+
}[];
|
|
33
38
|
defaultSource?: {
|
|
34
39
|
type: "Entry";
|
|
35
40
|
contentTypeId: string;
|
|
@@ -41,11 +46,6 @@ declare class EntityStore extends EntityStoreBase {
|
|
|
41
46
|
};
|
|
42
47
|
};
|
|
43
48
|
} | undefined;
|
|
44
|
-
passToNodes?: {
|
|
45
|
-
prebindingId: string;
|
|
46
|
-
parameterId: string;
|
|
47
|
-
nodeId: string;
|
|
48
|
-
}[] | undefined;
|
|
49
49
|
}>;
|
|
50
50
|
get experienceEntryFields(): ExperienceFields | undefined;
|
|
51
51
|
get experienceEntryId(): string | undefined;
|
package/dist/index.cjs
CHANGED
|
@@ -951,7 +951,7 @@ const BREAKPOINT_QUERY_REGEX = /^\*$|^[<>][0-9]+px$/;
|
|
|
951
951
|
const BreakpointSchema = zod.z
|
|
952
952
|
.object({
|
|
953
953
|
id: propertyKeySchema,
|
|
954
|
-
// Can be
|
|
954
|
+
// Can be replaced with z.templateLiteral when upgrading to zod v4
|
|
955
955
|
query: zod.z.string().refine((s) => BREAKPOINT_QUERY_REGEX.test(s)),
|
|
956
956
|
previewSize: zod.z.string().optional(),
|
|
957
957
|
displayName: zod.z.string(),
|
|
@@ -1092,8 +1092,7 @@ const ParameterDefinitionSchema = zod.z.object({
|
|
|
1092
1092
|
contentTypes: zod.z.array(zod.z.string()).min(1),
|
|
1093
1093
|
passToNodes: zod.z
|
|
1094
1094
|
.array(PassToNodeSchema)
|
|
1095
|
-
.max(1, 'At most one "passToNodes" element is allowed per parameter definition.')
|
|
1096
|
-
.optional(), // we might change this to be empty array for native parameter definitions, that's why we don't use .length(1)
|
|
1095
|
+
.max(1, 'At most one "passToNodes" element is allowed per parameter definition.'),
|
|
1097
1096
|
});
|
|
1098
1097
|
const ParameterDefinitionsSchema = zod.z.record(propertyKeySchema, ParameterDefinitionSchema);
|
|
1099
1098
|
const VariableMappingsSchema = zod.z.record(propertyKeySchema, VariableMappingSchema);
|
|
@@ -1195,7 +1194,7 @@ const validatePassToNodes = (rootChildren, componentSettings, ctx) => {
|
|
|
1195
1194
|
return;
|
|
1196
1195
|
}
|
|
1197
1196
|
const { parameterDefinitions } = componentSettings.prebindingDefinitions[0];
|
|
1198
|
-
|
|
1197
|
+
const nodeIds = new Set();
|
|
1199
1198
|
for (const paramDef of Object.values(parameterDefinitions || {})) {
|
|
1200
1199
|
paramDef.passToNodes?.forEach((n) => nodeIds.add(n.nodeId));
|
|
1201
1200
|
}
|
|
@@ -2219,7 +2218,7 @@ const transformTextAlign = (value) => {
|
|
|
2219
2218
|
return undefined;
|
|
2220
2219
|
const sdkOptions = getSdkOptions();
|
|
2221
2220
|
// New behavior: translate left/right to start/end
|
|
2222
|
-
// Customer can opt
|
|
2221
|
+
// Customer can opt out by activating this global option toggle
|
|
2223
2222
|
if (!sdkOptions.__disableTextAlignmentTransform) {
|
|
2224
2223
|
if (value === 'left')
|
|
2225
2224
|
return 'start';
|
|
@@ -3671,7 +3670,7 @@ const extractPrebindingDataByPatternId = (patterns) => {
|
|
|
3671
3670
|
const [prebindingDefinition] = pattern.fields.componentSettings?.prebindingDefinitions ?? [];
|
|
3672
3671
|
if (!prebindingDefinition)
|
|
3673
3672
|
continue;
|
|
3674
|
-
const [nativeParameterId] = Object.entries(prebindingDefinition.parameterDefinitions ?? {}).find(([, value]) => value.passToNodes
|
|
3673
|
+
const [nativeParameterId] = Object.entries(prebindingDefinition.parameterDefinitions ?? {}).find(([, value]) => !value.passToNodes?.length) ?? [];
|
|
3675
3674
|
const prebindingData = {
|
|
3676
3675
|
prebindingDefinitionId: prebindingDefinition.id,
|
|
3677
3676
|
parameterIds: Object.keys(prebindingDefinition.parameterDefinitions),
|
|
@@ -3719,7 +3718,7 @@ function getTargetPatternMappingsForParameter({ fetchedPatterns, prebindingDataB
|
|
|
3719
3718
|
}
|
|
3720
3719
|
else {
|
|
3721
3720
|
const parameterDefinition = patternPrebindingData.parameterDefinitions[parameterId];
|
|
3722
|
-
if (!parameterDefinition || !parameterDefinition.passToNodes)
|
|
3721
|
+
if (!parameterDefinition || !parameterDefinition.passToNodes?.length)
|
|
3723
3722
|
return undefined;
|
|
3724
3723
|
const patternEntry = fetchedPatterns.find((entry) => entry.sys.id === patternNodeDefinitionId);
|
|
3725
3724
|
if (!patternEntry)
|
|
@@ -3730,7 +3729,7 @@ function getTargetPatternMappingsForParameter({ fetchedPatterns, prebindingDataB
|
|
|
3730
3729
|
parameters: {},
|
|
3731
3730
|
children: patternEntry.fields.componentTree.children,
|
|
3732
3731
|
}, (node) => {
|
|
3733
|
-
if (node.id === parameterDefinition.passToNodes?.[0]
|
|
3732
|
+
if (node.id === parameterDefinition.passToNodes?.[0]?.nodeId) {
|
|
3734
3733
|
nestedPatternNode = node;
|
|
3735
3734
|
}
|
|
3736
3735
|
return undefined;
|
|
@@ -3742,7 +3741,7 @@ function getTargetPatternMappingsForParameter({ fetchedPatterns, prebindingDataB
|
|
|
3742
3741
|
fetchedPatterns,
|
|
3743
3742
|
prebindingDataByPatternId,
|
|
3744
3743
|
patternNodeDefinitionId: nestedPatternNode.definitionId,
|
|
3745
|
-
parameterId: parameterDefinition.passToNodes?.[0]
|
|
3744
|
+
parameterId: parameterDefinition.passToNodes?.[0]?.parameterId,
|
|
3746
3745
|
});
|
|
3747
3746
|
}
|
|
3748
3747
|
}
|