@contentful/experiences-visual-editor-react 1.0.1 → 1.0.2-beta.1

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
@@ -50542,13 +50542,24 @@ const sendSelectedComponentCoordinates = (instanceId) => {
50542
50542
  parent = parent?.parentElement;
50543
50543
  }
50544
50544
  if (selectedElement) {
50545
- sendMessage(OUTGOING_EVENTS.UpdateSelectedComponentCoordinates, {
50546
- selectedNodeCoordinates: getElementCoordinates(selectedElement),
50547
- selectedAssemblyChildCoordinates: selectedAssemblyChild
50548
- ? getElementCoordinates(selectedAssemblyChild)
50549
- : null,
50550
- parentCoordinates: parent ? getElementCoordinates(parent) : null,
50551
- });
50545
+ const sendUpdateSelectedComponentCoordinates = () => {
50546
+ sendMessage(OUTGOING_EVENTS.UpdateSelectedComponentCoordinates, {
50547
+ selectedNodeCoordinates: getElementCoordinates(selectedElement),
50548
+ selectedAssemblyChildCoordinates: selectedAssemblyChild
50549
+ ? getElementCoordinates(selectedAssemblyChild)
50550
+ : null,
50551
+ parentCoordinates: parent ? getElementCoordinates(parent) : null,
50552
+ });
50553
+ };
50554
+ const childImage = selectedElement.querySelector('img');
50555
+ if (childImage) {
50556
+ const handleImageLoad = () => {
50557
+ sendUpdateSelectedComponentCoordinates();
50558
+ childImage.removeEventListener('load', handleImageLoad);
50559
+ };
50560
+ childImage.addEventListener('load', handleImageLoad);
50561
+ }
50562
+ sendUpdateSelectedComponentCoordinates();
50552
50563
  }
50553
50564
  };
50554
50565
 
@@ -50750,7 +50761,7 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
50750
50761
  [variableName]: value,
50751
50762
  };
50752
50763
  }
50753
- else {
50764
+ else if (variableMapping.type === 'UnboundValue') {
50754
50765
  const value = getUnboundValues({
50755
50766
  key: variableMapping.key,
50756
50767
  fallback: variableDefinition.defaultValue,
@@ -50761,6 +50772,9 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
50761
50772
  [variableName]: value,
50762
50773
  };
50763
50774
  }
50775
+ else {
50776
+ return { ...acc };
50777
+ }
50764
50778
  }, {});
50765
50779
  }, [
50766
50780
  definition,
@@ -51393,7 +51407,7 @@ var PostMessageMethods;
51393
51407
  var css_248z$6 = ".cf-heading {\n white-space: pre-line;\n}\n";
51394
51408
  styleInject(css_248z$6);
51395
51409
 
51396
- var css_248z$5 = ".cf-richtext {\n white-space: pre-line;\n}\n";
51410
+ var css_248z$5 = ".cf-richtext {\n white-space: pre-line;\n}\n\n.cf-richtext > *:first-child {\n margin-top: 0;\n}\n\n.cf-richtext > *:last-child {\n margin-bottom: 0;\n}\n";
51397
51411
  styleInject(css_248z$5);
51398
51412
 
51399
51413
  var css_248z$4 = ".cf-text {\n white-space: pre-line;\n}\n";