@contentful/experiences-core 1.21.1-dev-20241107T2156-6c005a7.0 → 1.22.0-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/index.d.ts CHANGED
@@ -11,7 +11,6 @@ export { isLinkToAsset } from './utils/isLinkToAsset.js';
11
11
  export { isLink } from './utils/isLink.js';
12
12
  export { Fieldset, UnresolvedFieldset, isDeepPath, lastPathNamedSegmentEq, parseDataSourcePathIntoFieldset, parseDataSourcePathWithL1DeepBindings } from './utils/pathSchema.js';
13
13
  export { addLocale, buildTemplate, getTemplateValue, resolveHyperlinkPattern } from './utils/resolveHyperlinkPattern.js';
14
- export { deserializePatternVariables } from './utils/patternUtils.js';
15
14
  export { sanitizeNodeProps } from './utils/sanitizeNodeProps.js';
16
15
  export { columnsDefinition, containerDefinition, dividerDefinition, sectionDefinition, singleColumnDefinition } from './definitions/components.js';
17
16
  export { builtInStyles, columnsBuiltInStyles, containerBuiltInStyles, dividerBuiltInStyles, optionalBuiltInStyles, sectionBuiltInStyles, singleColumnBuiltInStyles } from './definitions/styles.js';
package/dist/index.js CHANGED
@@ -2726,49 +2726,6 @@ function buildTemplate({ template, context, }) {
2726
2726
  }));
2727
2727
  }
2728
2728
 
2729
- const deserializePatternVariables = ({ nodeVariables, componentInstanceProps, componentInstanceUnboundValues, componentInstanceDataSource, patternVariableDefinitions, }) => {
2730
- const childNodeVariable = {};
2731
- const dataSource = {};
2732
- const unboundValues = {};
2733
- for (const [variableName, variable] of Object.entries(nodeVariables)) {
2734
- childNodeVariable[variableName] = variable;
2735
- if (variable.type === 'ComponentValue') {
2736
- const componentValueKey = variable.key;
2737
- const instanceProperty = componentInstanceProps[componentValueKey];
2738
- const variableDefinition = patternVariableDefinitions?.[componentValueKey];
2739
- const defaultValue = variableDefinition?.defaultValue;
2740
- // For pattern, we look up the value in the pattern instance and
2741
- // replace the componentValue with that one.
2742
- if (instanceProperty?.type === 'UnboundValue') {
2743
- const componentInstanceValue = componentInstanceUnboundValues[instanceProperty.key];
2744
- unboundValues[instanceProperty.key] = componentInstanceValue;
2745
- childNodeVariable[variableName] = instanceProperty;
2746
- }
2747
- else if (instanceProperty?.type === 'BoundValue') {
2748
- const [, dataSourceKey] = instanceProperty.path.split('/');
2749
- const componentInstanceValue = componentInstanceDataSource[dataSourceKey];
2750
- dataSource[dataSourceKey] = componentInstanceValue;
2751
- childNodeVariable[variableName] = instanceProperty;
2752
- }
2753
- else if (instanceProperty?.type === 'HyperlinkValue') {
2754
- const componentInstanceValue = componentInstanceDataSource[instanceProperty.linkTargetKey];
2755
- dataSource[instanceProperty.linkTargetKey] == componentInstanceValue;
2756
- childNodeVariable[variableName] = instanceProperty;
2757
- }
2758
- else if (instanceProperty?.type === 'DesignValue') {
2759
- childNodeVariable[variableName] = instanceProperty;
2760
- }
2761
- else if (!instanceProperty && defaultValue) {
2762
- // So far, we only automatically fallback to the defaultValue for design properties
2763
- if (variableDefinition.group === 'style') {
2764
- childNodeVariable[variableName] = defaultValue;
2765
- }
2766
- }
2767
- }
2768
- }
2769
- return { childNodeVariable, dataSource, unboundValues };
2770
- };
2771
-
2772
2729
  const stylesToKeep = ['cfImageAsset'];
2773
2730
  const stylesToRemove = CF_STYLE_ATTRIBUTES.filter((style) => !stylesToKeep.includes(style));
2774
2731
  const propsToRemove = ['cfHyperlink', 'cfOpenInNewTab', 'cfSsrClassName'];
@@ -3709,5 +3666,5 @@ async function fetchById({ client, experienceTypeId, id, localeCode, }) {
3709
3666
  }
3710
3667
  }
3711
3668
 
3712
- 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, sanitizeNodeProps, sectionBuiltInStyles, sectionDefinition, sendMessage, singleColumnBuiltInStyles, singleColumnDefinition, toCSSAttribute, toCSSString, toMediaQuery, transformBoundContentValue, tryParseMessage, validateExperienceBuilderConfig };
3669
+ 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, 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, sanitizeNodeProps, sectionBuiltInStyles, sectionDefinition, sendMessage, singleColumnBuiltInStyles, singleColumnDefinition, toCSSAttribute, toCSSString, toMediaQuery, transformBoundContentValue, tryParseMessage, validateExperienceBuilderConfig };
3713
3670
  //# sourceMappingURL=index.js.map