@contentful/experiences-visual-editor-react 3.0.0-alpha-20250711T0717-d5ee667.0 → 3.0.0-alpha-20250804T0859-6413b63.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
@@ -44882,6 +44882,17 @@ const propsToRemove = [
44882
44882
  const sanitizeNodeProps = (nodeProps) => {
44883
44883
  return omit(nodeProps, stylesToRemove, propsToRemove);
44884
44884
  };
44885
+
44886
+ /** Turn the visibility value into a style object that can be used for inline styles in React */
44887
+ const transformVisibility = (value) => {
44888
+ if (value === false) {
44889
+ return {
44890
+ display: 'none !important',
44891
+ };
44892
+ }
44893
+ // Don't explicitly set anything when visible to not overwrite values like `grid` or `flex`.
44894
+ return {};
44895
+ };
44885
44896
  const transformGridColumn = (span) => {
44886
44897
  if (!span) {
44887
44898
  return {};
@@ -46959,11 +46970,6 @@ function compareNodes({ currentNode, updatedNode, originalTree, differences = []
46959
46970
  });
46960
46971
  });
46961
46972
  map.forEach((index, key) => {
46962
- // If the node count of the entire tree doesn't signify
46963
- // a node was removed, don't add that as a diff
46964
- if (!nodeRemoved) {
46965
- return;
46966
- }
46967
46973
  // Remaining nodes in the map are removed in the second tree
46968
46974
  differences.push({
46969
46975
  type: TreeAction.REMOVE_NODE,
@@ -48541,7 +48547,7 @@ styleInject(css_248z$5);
48541
48547
  var css_248z$4 = ".cf-text{white-space:pre-line}.cf-text-link .cf-text{margin:0}";
48542
48548
  styleInject(css_248z$4);
48543
48549
 
48544
- var css_248z$3 = "div.cf-placeholder-wrapper{position:relative}img.cf-placeholder-image{background-color:var(--cf-color-gray100);height:100%;outline:2px solid rgba(var(--cf-color-gray400-rgb),.5);outline-offset:-2px;width:100%}svg.cf-placeholder-icon{height:var(--cf-text-3xl);left:50%;max-height:100%;max-width:100%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--cf-text-3xl)}svg.cf-placeholder-icon path{fill:var(--cf-color-gray400)}";
48550
+ var css_248z$3 = "div.cf-placeholder-wrapper{outline:2px solid rgba(var(--cf-color-gray400-rgb),.5);outline-offset:-2px;overflow:hidden;position:relative}img.cf-placeholder-image{background-color:var(--cf-color-gray100);height:100%;width:100%}svg.cf-placeholder-icon{height:var(--cf-text-3xl);left:50%;max-height:100%;max-width:100%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--cf-text-3xl)}svg.cf-placeholder-icon path{fill:var(--cf-color-gray400)}";
48545
48551
  styleInject(css_248z$3);
48546
48552
 
48547
48553
  /**
@@ -50061,7 +50067,12 @@ const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesig
50061
50067
  entityStore,
50062
50068
  findNodeById,
50063
50069
  ]);
50064
- const cfStyles = reactExports.useMemo(() => buildCfStyles(props), [props]);
50070
+ const cfStyles = reactExports.useMemo(() => ({
50071
+ ...buildCfStyles(props),
50072
+ // The visibility needs to be transformed separately as it requires
50073
+ // a special handling for preview & SSR rendering (not here though).
50074
+ ...transformVisibility(props.cfVisibility),
50075
+ }), [props]);
50065
50076
  const shouldRenderEmptySpaceWithMinSize = reactExports.useMemo(() => {
50066
50077
  if (node.children.length)
50067
50078
  return false;