@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/renderApp.js CHANGED
@@ -44120,11 +44120,11 @@ function getArrayValue(entryOrAsset, path, entityStore) {
44120
44120
  return result;
44121
44121
  }
44122
44122
 
44123
- const transformBoundContentValue = (variables, entityStore, binding, resolveDesignValue, variableName, variableDefinition, path) => {
44123
+ const transformBoundContentValue = (variables, entityStore, binding, resolveDesignValue, variableName, variableType, path) => {
44124
44124
  const entityOrAsset = entityStore.getEntryOrAsset(binding, path);
44125
44125
  if (!entityOrAsset)
44126
44126
  return;
44127
- switch (variableDefinition.type) {
44127
+ switch (variableType) {
44128
44128
  case 'Media':
44129
44129
  // If we bound a normal entry field to the media variable we just return the bound value
44130
44130
  if (entityOrAsset.sys.type === 'Entry') {
@@ -56682,12 +56682,11 @@ styleInject(css_248z$9);
56682
56682
  * and then decending by screen width. For mobile-first designs, the order would be ascending
56683
56683
  */
56684
56684
  const useBreakpoints = (breakpoints) => {
56685
- const [mediaQueryMatches, setMediaQueryMatches] = reactExports.useState({});
56685
+ const [, initialMediaQueryMatches] = mediaQueryMatcher(breakpoints);
56686
+ const [mediaQueryMatches, setMediaQueryMatches] = reactExports.useState(initialMediaQueryMatches);
56686
56687
  // Register event listeners to update the media query states
56687
56688
  reactExports.useEffect(() => {
56688
- const [mediaQueryMatchers, initialMediaQueryMatches] = mediaQueryMatcher(breakpoints);
56689
- // Store the media query state in the beginning to initialise the state
56690
- setMediaQueryMatches(initialMediaQueryMatches);
56689
+ const [mediaQueryMatchers] = mediaQueryMatcher(breakpoints);
56691
56690
  const eventListeners = mediaQueryMatchers.map(({ id, signal }) => {
56692
56691
  const onChange = () => setMediaQueryMatches((prev) => ({
56693
56692
  ...prev,
@@ -56701,8 +56700,6 @@ const useBreakpoints = (breakpoints) => {
56701
56700
  mediaQueryMatchers[index].signal.removeEventListener('change', eventListener);
56702
56701
  });
56703
56702
  };
56704
- // Only re-setup all listeners when the breakpoint definition changed
56705
- // eslint-disable-next-line react-hooks/exhaustive-deps
56706
56703
  }, [breakpoints]);
56707
56704
  const resolveDesignValue = reactExports.useCallback((valuesByBreakpoint, variableName) => {
56708
56705
  const fallbackBreakpointIndex = getFallbackBreakpointIndex(breakpoints);
@@ -59453,7 +59450,7 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
59453
59450
  const [, uuid, path] = variableMapping.path.split('/');
59454
59451
  const binding = dataSource[uuid];
59455
59452
  const variableDefinition = definition.variables[variableName];
59456
- let boundValue = transformBoundContentValue(node.data.props, entityStore, binding, resolveDesignValue, variableName, variableDefinition, variableMapping.path);
59453
+ let boundValue = transformBoundContentValue(node.data.props, entityStore, binding, resolveDesignValue, variableName, variableDefinition.type, variableMapping.path);
59457
59454
  // In some cases, there may be an asset linked in the path, so we need to consider this scenario:
59458
59455
  // If no 'boundValue' is found, we also attempt to extract the value associated with the second-to-last item in the path.
59459
59456
  // If successful, it means we have identified the linked asset.
@@ -60251,7 +60248,7 @@ function useSingleColumn(node, resolveDesignValue) {
60251
60248
  return { isWrapped, wrapColumnsCount };
60252
60249
  }
60253
60250
  const parentNode = getItem({ id: node.parentId }, tree);
60254
- if (!parentNode) {
60251
+ if (!parentNode || parentNode.data.blockId !== CONTENTFUL_COMPONENTS$1.columns.id) {
60255
60252
  return { isWrapped, wrapColumnsCount };
60256
60253
  }
60257
60254
  const { cfWrapColumns, cfWrapColumnsCount } = parentNode.data.props;