@contentful/experiences-visual-editor-react 1.16.0 → 1.16.1-beta.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
@@ -42218,6 +42218,9 @@ const CONTENTFUL_COMPONENTS$1 = {
42218
42218
  name: 'Divider',
42219
42219
  },
42220
42220
  };
42221
+ const ASSEMBLY_NODE_TYPE$1 = 'assembly';
42222
+ const ASSEMBLY_DEFAULT_CATEGORY$1 = 'Assemblies';
42223
+ const ASSEMBLY_BLOCK_NODE_TYPE$1 = 'assemblyBlock';
42221
42224
  const EMPTY_CONTAINER_HEIGHT$1 = '80px';
42222
42225
  const DEFAULT_IMAGE_WIDTH = '500px';
42223
42226
  var PostMessageMethods$2;
@@ -42233,10 +42236,15 @@ const structureComponentIds = new Set([
42233
42236
  CONTENTFUL_COMPONENTS$1.container.id,
42234
42237
  CONTENTFUL_COMPONENTS$1.singleColumn.id,
42235
42238
  ]);
42239
+ const patternTypes = new Set([ASSEMBLY_NODE_TYPE$1, ASSEMBLY_BLOCK_NODE_TYPE$1]);
42236
42240
  const allContentfulComponentIds = new Set(Object.values(CONTENTFUL_COMPONENTS$1).map((component) => component.id));
42241
+ const isPatternComponent = (type) => patternTypes.has(type ?? '');
42237
42242
  const isContentfulStructureComponent = (componentId) => structureComponentIds.has(componentId ?? '');
42238
42243
  const isContentfulComponent = (componentId) => allContentfulComponentIds.has(componentId ?? '');
42239
- const isComponentAllowedOnRoot = (componentId) => isContentfulStructureComponent(componentId) || componentId === CONTENTFUL_COMPONENTS$1.divider.id;
42244
+ const isComponentAllowedOnRoot = ({ type, category, componentId }) => isPatternComponent(type) ||
42245
+ category === ASSEMBLY_DEFAULT_CATEGORY$1 ||
42246
+ isContentfulStructureComponent(componentId) ||
42247
+ componentId === CONTENTFUL_COMPONENTS$1.divider.id;
42240
42248
  const isStructureWithRelativeHeight = (componentId, height) => {
42241
42249
  return isContentfulStructureComponent(componentId) && !height?.toString().endsWith('px');
42242
42250
  };
@@ -46159,7 +46167,7 @@ function _objectWithoutPropertiesLoose(r, e) {
46159
46167
  if (null == r) return {};
46160
46168
  var t = {};
46161
46169
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
46162
- if (e.indexOf(n) >= 0) continue;
46170
+ if (e.includes(n)) continue;
46163
46171
  t[n] = r[n];
46164
46172
  }
46165
46173
  return t;
@@ -59166,7 +59174,8 @@ function Dropzone({ node, zoneId, resolveDesignValue, className, WrapperComponen
59166
59174
  return false;
59167
59175
  }
59168
59176
  // Enable dropzone for the non-root hovered zones if component is not allowed on root
59169
- if (!isDraggingNewComponent && !isComponentAllowedOnRoot(draggedNode?.data.blockId)) {
59177
+ if (!isDraggingNewComponent &&
59178
+ !isComponentAllowedOnRoot({ type: draggedNode?.type, componentId: draggedNode?.data.blockId })) {
59170
59179
  return isHoveringZone && !isRootZone;
59171
59180
  }
59172
59181
  // Enable dropzone for the hovered zone only