@contentful/experiences-visual-editor-react 3.0.0-alpha-20250711T0717-d5ee667.0 → 3.0.0-alpha-20250801T0844-68b7839.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 {};
@@ -50061,7 +50072,12 @@ const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesig
50061
50072
  entityStore,
50062
50073
  findNodeById,
50063
50074
  ]);
50064
- const cfStyles = reactExports.useMemo(() => buildCfStyles(props), [props]);
50075
+ const cfStyles = reactExports.useMemo(() => ({
50076
+ ...buildCfStyles(props),
50077
+ // The visibility needs to be transformed separately as it requires
50078
+ // a special handling for preview & SSR rendering (not here though).
50079
+ ...transformVisibility(props.cfVisibility),
50080
+ }), [props]);
50065
50081
  const shouldRenderEmptySpaceWithMinSize = reactExports.useMemo(() => {
50066
50082
  if (node.children.length)
50067
50083
  return false;