@contentful/experiences-visual-editor-react 3.8.0-prerelease-20250922T2329-e132272.0 → 3.8.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/renderApp.js CHANGED
@@ -41554,7 +41554,6 @@ const builtInStyles = {
41554
41554
  },
41555
41555
  type: 'Text',
41556
41556
  group: 'style',
41557
- description: 'The vertical alignment of the section',
41558
41557
  defaultValue: 'center',
41559
41558
  displayName: 'Vertical alignment',
41560
41559
  },
@@ -41581,7 +41580,6 @@ const builtInStyles = {
41581
41580
  },
41582
41581
  type: 'Text',
41583
41582
  group: 'style',
41584
- description: 'The horizontal alignment of the section',
41585
41583
  defaultValue: 'center',
41586
41584
  displayName: 'Horizontal alignment',
41587
41585
  },
@@ -41590,83 +41588,71 @@ const builtInStyles = {
41590
41588
  type: 'Boolean',
41591
41589
  group: 'style',
41592
41590
  defaultValue: true,
41593
- description: 'The visibility of the component',
41594
41591
  },
41595
41592
  cfMargin: {
41596
41593
  displayName: 'Margin',
41597
41594
  type: 'Text',
41598
41595
  group: 'style',
41599
- description: 'The margin of the section',
41600
41596
  defaultValue: '0 0 0 0',
41601
41597
  },
41602
41598
  cfPadding: {
41603
41599
  displayName: 'Padding',
41604
41600
  type: 'Text',
41605
41601
  group: 'style',
41606
- description: 'The padding of the section',
41607
41602
  defaultValue: '0 0 0 0',
41608
41603
  },
41609
41604
  cfBackgroundColor: {
41610
41605
  displayName: 'Background color',
41611
41606
  type: 'Text',
41612
41607
  group: 'style',
41613
- description: 'The background color of the section',
41614
41608
  defaultValue: 'rgba(0, 0, 0, 0)',
41615
41609
  },
41616
41610
  cfWidth: {
41617
41611
  displayName: 'Width',
41618
41612
  type: 'Text',
41619
41613
  group: 'style',
41620
- description: 'The width of the section',
41621
41614
  defaultValue: '100%',
41622
41615
  },
41623
41616
  cfHeight: {
41624
41617
  displayName: 'Height',
41625
41618
  type: 'Text',
41626
41619
  group: 'style',
41627
- description: 'The height of the section',
41628
41620
  defaultValue: 'fit-content',
41629
41621
  },
41630
41622
  cfMaxWidth: {
41631
41623
  displayName: 'Max width',
41632
41624
  type: 'Text',
41633
41625
  group: 'style',
41634
- description: 'The max-width of the section',
41635
41626
  defaultValue: 'none',
41636
41627
  },
41637
41628
  cfFlexDirection: {
41638
41629
  displayName: 'Direction',
41639
41630
  type: 'Text',
41640
41631
  group: 'style',
41641
- description: 'The orientation of the section',
41642
41632
  defaultValue: 'column',
41643
41633
  },
41644
41634
  cfFlexReverse: {
41645
41635
  displayName: 'Reverse Direction',
41646
41636
  type: 'Boolean',
41647
41637
  group: 'style',
41648
- description: 'Toggle the flex direction to be reversed',
41649
41638
  defaultValue: false,
41650
41639
  },
41651
41640
  cfFlexWrap: {
41652
41641
  displayName: 'Wrap objects',
41653
41642
  type: 'Text',
41654
41643
  group: 'style',
41655
- description: 'Wrap objects',
41656
41644
  defaultValue: 'nowrap',
41657
41645
  },
41658
41646
  cfBorder: {
41659
41647
  displayName: 'Border',
41660
41648
  type: 'Text',
41661
41649
  group: 'style',
41662
- description: 'The border of the section',
41663
41650
  defaultValue: '0px solid rgba(0, 0, 0, 0)',
41664
41651
  },
41665
41652
  cfGap: {
41666
41653
  displayName: 'Gap',
41667
41654
  type: 'Text',
41668
41655
  group: 'style',
41669
- description: 'The spacing between the elements of the section',
41670
41656
  defaultValue: '0px',
41671
41657
  },
41672
41658
  cfHyperlink: {
@@ -41677,7 +41663,6 @@ const builtInStyles = {
41677
41663
  format: 'URL',
41678
41664
  bindingSourceType: ['entry', 'experience', 'manual'],
41679
41665
  },
41680
- description: 'hyperlink for section or container',
41681
41666
  },
41682
41667
  cfOpenInNewTab: {
41683
41668
  displayName: 'URL behaviour',
@@ -41691,7 +41676,6 @@ const optionalBuiltInStyles = {
41691
41676
  displayName: 'Font Size',
41692
41677
  type: 'Text',
41693
41678
  group: 'style',
41694
- description: 'The font size of the element',
41695
41679
  defaultValue: '16px',
41696
41680
  },
41697
41681
  cfFontWeight: {
@@ -41714,13 +41698,11 @@ const optionalBuiltInStyles = {
41714
41698
  displayName: 'Font Weight',
41715
41699
  type: 'Text',
41716
41700
  group: 'style',
41717
- description: 'The font weight of the element',
41718
41701
  defaultValue: '400',
41719
41702
  },
41720
41703
  cfImageAsset: {
41721
41704
  displayName: 'Image',
41722
41705
  type: 'Media',
41723
- description: 'Image to display',
41724
41706
  validations: {
41725
41707
  bindingSourceType: ['asset', 'entry', 'manual'],
41726
41708
  },
@@ -41739,13 +41721,11 @@ const optionalBuiltInStyles = {
41739
41721
  displayName: 'Background color',
41740
41722
  type: 'Text',
41741
41723
  group: 'style',
41742
- description: 'The background color of the element',
41743
41724
  defaultValue: 'rgba(0, 0, 0, 0)',
41744
41725
  },
41745
41726
  cfBackgroundImageUrl: {
41746
41727
  displayName: 'Background image',
41747
41728
  type: 'Media',
41748
- description: 'Background image for component',
41749
41729
  validations: {
41750
41730
  bindingSourceType: ['asset', 'entry', 'manual'],
41751
41731
  },
@@ -41764,28 +41744,24 @@ const optionalBuiltInStyles = {
41764
41744
  displayName: 'Border Radius',
41765
41745
  type: 'Text',
41766
41746
  group: 'style',
41767
- description: 'The border radius of the section',
41768
41747
  defaultValue: '0px',
41769
41748
  },
41770
41749
  cfLineHeight: {
41771
41750
  displayName: 'Line Height',
41772
41751
  type: 'Text',
41773
41752
  group: 'style',
41774
- description: 'The line height of the element',
41775
41753
  defaultValue: '20px',
41776
41754
  },
41777
41755
  cfLetterSpacing: {
41778
41756
  displayName: 'Letter Spacing',
41779
41757
  type: 'Text',
41780
41758
  group: 'style',
41781
- description: 'The letter spacing of the element',
41782
41759
  defaultValue: '0px',
41783
41760
  },
41784
41761
  cfTextColor: {
41785
41762
  displayName: 'Text Color',
41786
41763
  type: 'Text',
41787
41764
  group: 'style',
41788
- description: 'The text color of the element',
41789
41765
  defaultValue: 'rgba(0, 0, 0, 1)',
41790
41766
  },
41791
41767
  cfTextAlign: {
@@ -41808,7 +41784,6 @@ const optionalBuiltInStyles = {
41808
41784
  displayName: 'Text Align',
41809
41785
  type: 'Text',
41810
41786
  group: 'style',
41811
- description: 'The text alignment of the element',
41812
41787
  defaultValue: 'start',
41813
41788
  },
41814
41789
  cfTextTransform: {
@@ -41835,28 +41810,24 @@ const optionalBuiltInStyles = {
41835
41810
  displayName: 'Text Transform',
41836
41811
  type: 'Text',
41837
41812
  group: 'style',
41838
- description: 'The text transform of the element',
41839
41813
  defaultValue: 'none',
41840
41814
  },
41841
41815
  cfTextBold: {
41842
41816
  displayName: 'Bold',
41843
41817
  type: 'Boolean',
41844
41818
  group: 'style',
41845
- description: 'The text bold of the element',
41846
41819
  defaultValue: false,
41847
41820
  },
41848
41821
  cfTextItalic: {
41849
41822
  displayName: 'Italic',
41850
41823
  type: 'Boolean',
41851
41824
  group: 'style',
41852
- description: 'The text italic of the element',
41853
41825
  defaultValue: false,
41854
41826
  },
41855
41827
  cfTextUnderline: {
41856
41828
  displayName: 'Underline',
41857
41829
  type: 'Boolean',
41858
41830
  group: 'style',
41859
- description: 'The text underline of the element',
41860
41831
  defaultValue: false,
41861
41832
  },
41862
41833
  };
@@ -42170,18 +42141,15 @@ const ComponentVariableSchema$1 = z.object({
42170
42141
  const ComponentTreeNodeSchema$1 = BaseComponentTreeNodeSchema$1.extend({
42171
42142
  children: z.lazy(() => ComponentTreeNodeSchema$1.array()),
42172
42143
  }).superRefine(({ id, prebindingId, parameters }, ctx) => {
42144
+ // We don't fail if parameters are present but prebindingId is not because
42145
+ // older experiences (updated before 21-09-2025) always included parameters
42146
+ // and they will start failing if we do.
42173
42147
  if (prebindingId && !parameters) {
42174
42148
  ctx.addIssue({
42175
42149
  code: z.ZodIssueCode.custom,
42176
42150
  message: `Found "prebindingId" but no "parameters" for node with id: "${id}"`,
42177
42151
  });
42178
42152
  }
42179
- if (parameters && !prebindingId) {
42180
- ctx.addIssue({
42181
- code: z.ZodIssueCode.custom,
42182
- message: `Found "parameters" but no "prebindingId" for node with id: "${id}"`,
42183
- });
42184
- }
42185
42153
  });
42186
42154
  const ComponentTreeSchema$1 = z
42187
42155
  .object({
@@ -42285,7 +42253,6 @@ const ParameterDefinitionSchema$1 = z.object({
42285
42253
  passToNodes: z
42286
42254
  .array(PassToNodeSchema$1)
42287
42255
  .max(1, 'At most one "passToNodes" element is allowed per parameter definition.'),
42288
- // we might change this to be empty array for native parameter definitions, that's why we don't use .length(1)
42289
42256
  });
42290
42257
  const ParameterDefinitionsSchema$1 = z.record(propertyKeySchema$1, ParameterDefinitionSchema$1);
42291
42258
  const VariableMappingsSchema$1 = z.record(propertyKeySchema$1, VariableMappingSchema$1);
@@ -42937,6 +42904,9 @@ const getPrebindingPathBySourceEntry = (preboundValueProperty, getHeadEntityByDa
42937
42904
  return undefined;
42938
42905
  }
42939
42906
  const contentTypeId = headEntity.sys.contentType.sys.id;
42907
+ if (!preboundValueProperty.pathsByContentType?.[contentTypeId]) {
42908
+ return undefined;
42909
+ }
42940
42910
  return preboundValueProperty.pathsByContentType?.[contentTypeId]?.path;
42941
42911
  };
42942
42912
  const parseDeepPath$1 = (deepPathCandidate) => {
@@ -49993,18 +49963,15 @@ const ComponentVariableSchema = z.object({
49993
49963
  const ComponentTreeNodeSchema = BaseComponentTreeNodeSchema.extend({
49994
49964
  children: z.lazy(() => ComponentTreeNodeSchema.array()),
49995
49965
  }).superRefine(({ id, prebindingId, parameters }, ctx) => {
49966
+ // We don't fail if parameters are present but prebindingId is not because
49967
+ // older experiences (updated before 21-09-2025) always included parameters
49968
+ // and they will start failing if we do.
49996
49969
  if (prebindingId && !parameters) {
49997
49970
  ctx.addIssue({
49998
49971
  code: z.ZodIssueCode.custom,
49999
49972
  message: `Found "prebindingId" but no "parameters" for node with id: "${id}"`,
50000
49973
  });
50001
49974
  }
50002
- if (parameters && !prebindingId) {
50003
- ctx.addIssue({
50004
- code: z.ZodIssueCode.custom,
50005
- message: `Found "parameters" but no "prebindingId" for node with id: "${id}"`,
50006
- });
50007
- }
50008
49975
  });
50009
49976
  const ComponentTreeSchema = z
50010
49977
  .object({
@@ -50108,7 +50075,6 @@ const ParameterDefinitionSchema = z.object({
50108
50075
  passToNodes: z
50109
50076
  .array(PassToNodeSchema)
50110
50077
  .max(1, 'At most one "passToNodes" element is allowed per parameter definition.'),
50111
- // we might change this to be empty array for native parameter definitions, that's why we don't use .length(1)
50112
50078
  });
50113
50079
  const ParameterDefinitionsSchema = z.record(propertyKeySchema, ParameterDefinitionSchema);
50114
50080
  const VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);
@@ -51086,14 +51052,28 @@ const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesig
51086
51052
  // eg: "/uuid" vs "/uuid/fields/[fileName]/~locale" as the regular BoundValue would have
51087
51053
  const [, uuid, maybePath] = variableMapping.path.split('/');
51088
51054
  const link = dataSource[uuid];
51089
- let boundValue;
51090
51055
  // starting from here, if the prop is of type 'BoundValue', and has prebinding
51091
51056
  // we are going to resolve the incomplete path
51057
+ let boundValue;
51058
+ // TODO: Temporary fix while we look into SPA-3212 it occurs where we have prebound props but data source link is missing
51059
+ // this only occurs after live updates of nested patterns.
51060
+ if (!link && isPreboundProp(variableMapping) && variableMapping.isPrebound) {
51061
+ return {
51062
+ ...acc,
51063
+ [variableName]: variableDefinition.defaultValue,
51064
+ };
51065
+ }
51092
51066
  if (link && isPreboundProp(variableMapping) && variableMapping.isPrebound) {
51093
51067
  const prebindingPath = getPrebindingPathBySourceEntry(variableMapping, (dataSourceKey) => {
51094
51068
  const link = dataSource[dataSourceKey];
51095
51069
  return entityStore.getEntityFromLink(link);
51096
- }) ?? variableMapping.path;
51070
+ });
51071
+ if (!prebindingPath) {
51072
+ return {
51073
+ ...acc,
51074
+ [variableName]: variableDefinition.defaultValue,
51075
+ };
51076
+ }
51097
51077
  // this allows us to resolve it regularly
51098
51078
  boundValue = transformBoundContentValue(node.data.props, entityStore, link, resolveDesignValue, variableName, variableDefinition.type, prebindingPath);
51099
51079
  }