@contentful/experiences-visual-editor-react 1.40.0 → 1.40.1-dev-20250605T1324-83179af.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
@@ -44027,6 +44027,7 @@ const sanitizeNodeProps = (nodeProps) => {
44027
44027
  return omit(nodeProps, stylesToRemove, propsToRemove);
44028
44028
  };
44029
44029
 
44030
+ /** Turn the visibility value into a style object that can be used for inline styles in React */
44030
44031
  const transformVisibility = (value) => {
44031
44032
  if (value === false) {
44032
44033
  return {
@@ -44195,7 +44196,6 @@ const buildStyleTag = ({ styles, nodeId }) => {
44195
44196
  const buildCfStyles = (values) => {
44196
44197
  const cssProperties = {
44197
44198
  boxSizing: 'border-box',
44198
- ...transformVisibility(values.cfVisibility),
44199
44199
  margin: values.cfMargin,
44200
44200
  padding: values.cfPadding,
44201
44201
  backgroundColor: values.cfBackgroundColor,
@@ -59782,7 +59782,11 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
59782
59782
  entityStore,
59783
59783
  renderDropzone,
59784
59784
  ]);
59785
- const cfStyles = reactExports.useMemo(() => buildCfStyles(props), [props]);
59785
+ const cfStyles = reactExports.useMemo(() => ({
59786
+ ...buildCfStyles(props),
59787
+ // This is not handled by buildCfStyles as it requires separate disjunct media queries in preview mode
59788
+ ...transformVisibility(props.cfVisibility),
59789
+ }), [props]);
59786
59790
  const cfVisibility = props['cfVisibility'];
59787
59791
  const isAssemblyBlock = node.type === ASSEMBLY_BLOCK_NODE_TYPE;
59788
59792
  const isSingleColumn = node?.data.blockId === CONTENTFUL_COMPONENTS$1.columns.id;