@contentful/experiences-core 1.42.0-dev-20250630T1149-4da2e67.0 → 1.42.0-prerelease-20250620T0958-8e54295.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/exports.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { ASSEMBLY_BLOCK_NODE_TYPE, ASSEMBLY_DEFAULT_CATEGORY, ASSEMBLY_NODE_TYPE, ASSEMBLY_NODE_TYPES, CF_STYLE_ATTRIBUTES, CONTENTFUL_COMPONENTS, CONTENTFUL_COMPONENT_CATEGORY, CONTENTFUL_DEFAULT_CATEGORY, DEFAULT_IMAGE_WIDTH, EMPTY_CONTAINER_HEIGHT, HYPERLINK_DEFAULT_PATTERN, INCOMING_EVENTS, INTERNAL_EVENTS, LATEST_SCHEMA_VERSION, OUTGOING_EVENTS, PATTERN_PROPERTY_DIVIDER, PostMessageMethods, SCROLL_STATES, SUPPORTED_IMAGE_FORMATS, StudioCanvasMode, VISUAL_EDITOR_CONTAINER_ID, VISUAL_EDITOR_EVENTS } from './constants.js';
2
2
  export { AssembliesAddedPayload, AssembliesRegisteredPayload, BackgroundImageAlignmentOption, BackgroundImageOptions, BackgroundImageScalingOption, Binding, BindingMap, BindingMapByBlockId, BoundComponentPropertyTypes, CSSProperties, CanvasErrorPayload, CanvasReloadPayload, CanvasResizedPayload, CanvasScrollPayload, ComponentBinding, ComponentDefinition, ComponentDefinitionVariable, ComponentDefinitionVariableBase, ComponentDefinitionVariableTypeMap, ComponentDefinitionVariableValidation, ComponentDragCanceledPayload, ComponentDragEndedPayload, ComponentDragStartedPayload, ComponentDraggingChangedPayload, ComponentDroppedPayload, ComponentMoveEndedPayload, ComponentMoveStartedPayload, ComponentMovedPayload, ComponentRegistration, ComponentRegistrationOptions, ComponentSelectedPayload, ConnectedPayload, ContainerStyleVariableName, Coordinates, DataSourceEntryValueType, DesignTokensDefinition, DesignTokensPayload, DesignVariableMap, DesignVariableTypes, DragWrapperProps, Experience, ExperienceEntry, ExperienceFields, ExperienceTree, ExperienceTreeNode, ExperienceUpdatedPayload, HoverComponentPayload, HoveredElement, ImageLoadingOption, ImageObjectFitOption, ImageObjectPositionOption, ImageOptions, IncomingComponentDragCanceledPayload, IncomingComponentMoveEndedPayload, IncomingEvent, IncomingMessage, IncomingMouseMovePayload, InternalEvent, Link, ManagementEntity, MouseMovePayload, NewHoveredElementPayload, OptimizedBackgroundImageAsset, OptimizedImageAsset, OutgoingEvent, OutgoingMessage, OutsideCanvasClickPayload, RawCoordinates, RecursiveDesignTokenDefinition, RegisteredBreakpointsPayload, RegisteredComponentsPayload, RequestComponentTreeUpdatePayload, RequestEditorModePayload, RequestEntitiesMessage, RequestEntitiesPayload, RequestReadOnlyModePayload, RequestedEntitiesMessage, RequestedEntitiesPayload, ResolveDesignValueType, SDKFeaturesPayload, ScrollState, SelectComponentPayload, SendMessageParams, StyleProps, UpdateSelectedComponentCoordinatesPayload, UpdatedEntityPayload, ValidationOption, VariableFormats, WrapperTags } from './types.js';
3
- export { BoundValue, Breakpoint, ComponentDefinitionPropertyType as ComponentDefinitionVariableType, ComponentPropertyValue, ComponentTreeNode, ComponentValue, DesignValue, ExperienceComponentSettings, ExperienceDataSource, ExperienceUnboundValues, NoValue, Parameter, ParameterDefinition, PrimitiveValue, SchemaVersions, UnboundValue, ValuesByBreakpoint, VariableMapping } from '@contentful/experiences-validators';
3
+ export { BoundValue, Breakpoint, ComponentDefinitionPropertyType as ComponentDefinitionVariableType, ComponentPropertyValue, ComponentTreeNode, ComponentValue, DesignValue, ExperienceComponentSettings, ExperienceDataSource, ExperienceUnboundValues, NoValue, PatternProperty, PatternPropertyDefinition, PrimitiveValue, SchemaVersions, UnboundValue, ValuesByBreakpoint, VariableMapping } from '@contentful/experiences-validators';
package/dist/index.js CHANGED
@@ -950,11 +950,11 @@ const ComponentPropertyValueSchema = z.discriminatedUnion('type', [
950
950
  ]);
951
951
  // TODO: finalize schema structure before release
952
952
  // https://contentful.atlassian.net/browse/LUMOS-523
953
- const ParameterSchema = z.object({
953
+ const PatternPropertySchema = z.object({
954
954
  type: z.literal('BoundValue'),
955
955
  path: z.string(),
956
956
  });
957
- const ParametersSchema = z.record(propertyKeySchema, ParameterSchema);
957
+ const ParametersSchema = z.record(propertyKeySchema, PatternPropertySchema);
958
958
  const BreakpointSchema = z
959
959
  .object({
960
960
  id: propertyKeySchema,
@@ -1040,25 +1040,21 @@ const THUMBNAIL_IDS = [
1040
1040
  // TODO: finalize schema structure before release
1041
1041
  // https://contentful.atlassian.net/browse/LUMOS-523
1042
1042
  const VariableMappingSchema = z.object({
1043
- parameterId: propertyKeySchema,
1043
+ parameterDefinitionId: propertyKeySchema,
1044
1044
  type: z.literal('ContentTypeMapping'),
1045
1045
  pathsByContentType: z.record(z.string(), z.object({ path: z.string() })),
1046
1046
  });
1047
1047
  // TODO: finalize schema structure before release
1048
1048
  // https://contentful.atlassian.net/browse/LUMOS-523
1049
1049
  const ParameterDefinitionSchema = z.object({
1050
- defaultSource: z
1051
- .strictObject({
1052
- type: z.enum(['Entry']),
1053
- contentTypeId: z.string(),
1054
- link: z.strictObject({
1055
- sys: z.strictObject({
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.defaultSource)?.defaultSource;
4161
- const { link, type } = defaultPrebinding ?? {};
4162
- if (!link || !type)
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: type,
4166
+ linkType: 'Entry',
4173
4167
  id,
4174
4168
  },
4175
4169
  },