@contentful/experiences-core 1.16.0 → 1.16.1-beta.1

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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { isComponentAllowedOnRoot, isContentfulComponent, isContentfulStructureComponent, isStructureWithRelativeHeight } from './utils/components.js';
1
+ export { isComponentAllowedOnRoot, isContentfulComponent, isContentfulStructureComponent, isPatternComponent, isStructureWithRelativeHeight } from './utils/components.js';
2
2
  export { findOutermostCoordinates, getElementCoordinates } from './utils/domValues.js';
3
3
  export { doesMismatchMessageSchema, tryParseMessage, validateExperienceBuilderConfig } from './utils/validations.js';
4
4
  export { buildCfStyles, buildStyleTag, calculateNodeDefaultHeight, toCSSAttribute } from './utils/styleUtils/stylesUtils.js';
package/dist/index.js CHANGED
@@ -76,7 +76,9 @@ const CONTENTFUL_COMPONENTS = {
76
76
  name: 'Divider',
77
77
  },
78
78
  };
79
+ const ASSEMBLY_NODE_TYPE = 'assembly';
79
80
  const ASSEMBLY_DEFAULT_CATEGORY = 'Assemblies';
81
+ const ASSEMBLY_BLOCK_NODE_TYPE = 'assemblyBlock';
80
82
  const CF_STYLE_ATTRIBUTES = [
81
83
  'cfVisibility',
82
84
  'cfHorizontalAlignment',
@@ -130,10 +132,15 @@ const structureComponentIds = new Set([
130
132
  CONTENTFUL_COMPONENTS.container.id,
131
133
  CONTENTFUL_COMPONENTS.singleColumn.id,
132
134
  ]);
135
+ const patternTypes = new Set([ASSEMBLY_NODE_TYPE, ASSEMBLY_BLOCK_NODE_TYPE]);
133
136
  const allContentfulComponentIds = new Set(Object.values(CONTENTFUL_COMPONENTS).map((component) => component.id));
137
+ const isPatternComponent = (type) => patternTypes.has(type ?? '');
134
138
  const isContentfulStructureComponent = (componentId) => structureComponentIds.has(componentId ?? '');
135
139
  const isContentfulComponent = (componentId) => allContentfulComponentIds.has(componentId ?? '');
136
- const isComponentAllowedOnRoot = (componentId) => isContentfulStructureComponent(componentId) || componentId === CONTENTFUL_COMPONENTS.divider.id;
140
+ const isComponentAllowedOnRoot = ({ type, category, componentId }) => isPatternComponent(type) ||
141
+ category === ASSEMBLY_DEFAULT_CATEGORY ||
142
+ isContentfulStructureComponent(componentId) ||
143
+ componentId === CONTENTFUL_COMPONENTS.divider.id;
137
144
  const isStructureWithRelativeHeight = (componentId, height) => {
138
145
  return isContentfulStructureComponent(componentId) && !height?.toString().endsWith('px');
139
146
  };
@@ -3406,8 +3413,7 @@ const fetchAllEntries = async ({ client, ids, locale, skip = 0, limit = 100, res
3406
3413
  },
3407
3414
  };
3408
3415
  }
3409
- const query = { 'sys.id[in]': ids, locale, limit, skip };
3410
- const { items, includes, total: responseTotal, } = await client.withoutLinkResolution.getEntries({ ...query });
3416
+ const { items, includes, total: responseTotal, } = await client.getEntries({ 'sys.id[in]': ids, locale, limit, skip, include: 2 });
3411
3417
  responseItems.push(...items);
3412
3418
  responseIncludes?.Entry?.push(...(includes?.Entry || []));
3413
3419
  responseIncludes?.Asset?.push(...(includes?.Asset || []));
@@ -3649,5 +3655,5 @@ async function fetchById({ client, experienceTypeId, id, localeCode, }) {
3649
3655
  }
3650
3656
  }
3651
3657
 
3652
- export { DeepReference, EditorModeEntityStore, EntityStore, EntityStoreBase, MEDIA_QUERY_REGEXP, VisualEditorMode, addLocale, breakpointsRegistry, buildCfStyles, buildStyleTag, buildTemplate, builtInStyles, calculateNodeDefaultHeight, checkIsAssembly, checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, columnsBuiltInStyles, columnsDefinition, containerBuiltInStyles, containerDefinition, createExperience, defineBreakpoints, defineDesignTokens, deserializePatternVariables, designTokensRegistry, detachExperienceStyles, dividerBuiltInStyles, dividerDefinition, doesMismatchMessageSchema, fetchAllAssets, fetchAllEntries, fetchById, fetchBySlug, findOutermostCoordinates, flattenDesignTokenRegistry, gatherDeepReferencesFromExperienceEntry, gatherDeepReferencesFromTree, generateRandomId, getActiveBreakpointIndex, getBreakpointRegistration, getDataFromTree, getDesignTokenRegistration, getElementCoordinates, getFallbackBreakpointIndex, getInsertionData, getTemplateValue, getValueForBreakpoint, indexByBreakpoint, isCfStyleAttribute, isComponentAllowedOnRoot, isContentfulComponent, isContentfulStructureComponent, isDeepPath, isExperienceEntry, isLink, isLinkToAsset, isStructureWithRelativeHeight, isValidBreakpointValue, lastPathNamedSegmentEq, maybePopulateDesignTokenValue, mediaQueryMatcher, optionalBuiltInStyles, parseDataSourcePathIntoFieldset, parseDataSourcePathWithL1DeepBindings, resetBreakpointsRegistry, resetDesignTokenRegistry, resolveBackgroundImageBinding, resolveHyperlinkPattern, runBreakpointsValidation, sectionBuiltInStyles, sectionDefinition, sendMessage, singleColumnBuiltInStyles, singleColumnDefinition, toCSSAttribute, toCSSString, toMediaQuery, transformBoundContentValue, tryParseMessage, validateExperienceBuilderConfig };
3658
+ export { DeepReference, EditorModeEntityStore, EntityStore, EntityStoreBase, MEDIA_QUERY_REGEXP, VisualEditorMode, addLocale, breakpointsRegistry, buildCfStyles, buildStyleTag, buildTemplate, builtInStyles, calculateNodeDefaultHeight, checkIsAssembly, checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, columnsBuiltInStyles, columnsDefinition, containerBuiltInStyles, containerDefinition, createExperience, defineBreakpoints, defineDesignTokens, deserializePatternVariables, designTokensRegistry, detachExperienceStyles, dividerBuiltInStyles, dividerDefinition, doesMismatchMessageSchema, fetchAllAssets, fetchAllEntries, fetchById, fetchBySlug, findOutermostCoordinates, flattenDesignTokenRegistry, gatherDeepReferencesFromExperienceEntry, gatherDeepReferencesFromTree, generateRandomId, getActiveBreakpointIndex, getBreakpointRegistration, getDataFromTree, getDesignTokenRegistration, getElementCoordinates, getFallbackBreakpointIndex, getInsertionData, getTemplateValue, getValueForBreakpoint, indexByBreakpoint, isCfStyleAttribute, isComponentAllowedOnRoot, isContentfulComponent, isContentfulStructureComponent, isDeepPath, isExperienceEntry, isLink, isLinkToAsset, isPatternComponent, isStructureWithRelativeHeight, isValidBreakpointValue, lastPathNamedSegmentEq, maybePopulateDesignTokenValue, mediaQueryMatcher, optionalBuiltInStyles, parseDataSourcePathIntoFieldset, parseDataSourcePathWithL1DeepBindings, resetBreakpointsRegistry, resetDesignTokenRegistry, resolveBackgroundImageBinding, resolveHyperlinkPattern, runBreakpointsValidation, sectionBuiltInStyles, sectionDefinition, sendMessage, singleColumnBuiltInStyles, singleColumnDefinition, toCSSAttribute, toCSSString, toMediaQuery, transformBoundContentValue, tryParseMessage, validateExperienceBuilderConfig };
3653
3659
  //# sourceMappingURL=index.js.map