@contentful/experiences-visual-editor-react 1.31.1-dev-20250218T1728-50b0be5.0 → 1.31.1-dev-20250219T1258-06c6e3b.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/index.js CHANGED
@@ -1499,11 +1499,11 @@ function getArrayValue(entryOrAsset, path, entityStore) {
1499
1499
  return result;
1500
1500
  }
1501
1501
 
1502
- const transformBoundContentValue = (variables, entityStore, binding, resolveDesignValue, variableName, variableDefinition, path) => {
1502
+ const transformBoundContentValue = (variables, entityStore, binding, resolveDesignValue, variableName, variableType, path) => {
1503
1503
  const entityOrAsset = entityStore.getEntryOrAsset(binding, path);
1504
1504
  if (!entityOrAsset)
1505
1505
  return;
1506
- switch (variableDefinition.type) {
1506
+ switch (variableType) {
1507
1507
  case 'Media':
1508
1508
  // If we bound a normal entry field to the media variable we just return the bound value
1509
1509
  if (entityOrAsset.sys.type === 'Entry') {
@@ -2994,12 +2994,11 @@ styleInject(css_248z$9);
2994
2994
  * and then decending by screen width. For mobile-first designs, the order would be ascending
2995
2995
  */
2996
2996
  const useBreakpoints = (breakpoints) => {
2997
- const [mediaQueryMatches, setMediaQueryMatches] = useState({});
2997
+ const [, initialMediaQueryMatches] = mediaQueryMatcher(breakpoints);
2998
+ const [mediaQueryMatches, setMediaQueryMatches] = useState(initialMediaQueryMatches);
2998
2999
  // Register event listeners to update the media query states
2999
3000
  useEffect(() => {
3000
- const [mediaQueryMatchers, initialMediaQueryMatches] = mediaQueryMatcher(breakpoints);
3001
- // Store the media query state in the beginning to initialise the state
3002
- setMediaQueryMatches(initialMediaQueryMatches);
3001
+ const [mediaQueryMatchers] = mediaQueryMatcher(breakpoints);
3003
3002
  const eventListeners = mediaQueryMatchers.map(({ id, signal }) => {
3004
3003
  const onChange = () => setMediaQueryMatches((prev) => ({
3005
3004
  ...prev,
@@ -3013,8 +3012,6 @@ const useBreakpoints = (breakpoints) => {
3013
3012
  mediaQueryMatchers[index].signal.removeEventListener('change', eventListener);
3014
3013
  });
3015
3014
  };
3016
- // Only re-setup all listeners when the breakpoint definition changed
3017
- // eslint-disable-next-line react-hooks/exhaustive-deps
3018
3015
  }, [breakpoints]);
3019
3016
  const resolveDesignValue = useCallback((valuesByBreakpoint, variableName) => {
3020
3017
  const fallbackBreakpointIndex = getFallbackBreakpointIndex(breakpoints);
@@ -4484,7 +4481,7 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
4484
4481
  const [, uuid, path] = variableMapping.path.split('/');
4485
4482
  const binding = dataSource[uuid];
4486
4483
  const variableDefinition = definition.variables[variableName];
4487
- let boundValue = transformBoundContentValue(node.data.props, entityStore, binding, resolveDesignValue, variableName, variableDefinition, variableMapping.path);
4484
+ let boundValue = transformBoundContentValue(node.data.props, entityStore, binding, resolveDesignValue, variableName, variableDefinition.type, variableMapping.path);
4488
4485
  // In some cases, there may be an asset linked in the path, so we need to consider this scenario:
4489
4486
  // If no 'boundValue' is found, we also attempt to extract the value associated with the second-to-last item in the path.
4490
4487
  // If successful, it means we have identified the linked asset.
@@ -5208,7 +5205,7 @@ function useSingleColumn(node, resolveDesignValue) {
5208
5205
  return { isWrapped, wrapColumnsCount };
5209
5206
  }
5210
5207
  const parentNode = getItem({ id: node.parentId }, tree);
5211
- if (!parentNode) {
5208
+ if (!parentNode || parentNode.data.blockId !== CONTENTFUL_COMPONENTS$1.columns.id) {
5212
5209
  return { isWrapped, wrapColumnsCount };
5213
5210
  }
5214
5211
  const { cfWrapColumns, cfWrapColumnsCount } = parentNode.data.props;