@contentful/experiences-core 1.22.1-dev-20241111T0918-dbe183a.0 → 1.23.0-dev-20241114T1253-46573c4.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
@@ -12,7 +12,6 @@ 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
14
  export { sanitizeNodeProps } from './utils/sanitizeNodeProps.js';
15
- export { columnsDefinition, containerDefinition, dividerDefinition, sectionDefinition, singleColumnDefinition } from './definitions/components.js';
16
15
  export { builtInStyles, columnsBuiltInStyles, containerBuiltInStyles, dividerBuiltInStyles, optionalBuiltInStyles, sectionBuiltInStyles, singleColumnBuiltInStyles } from './definitions/styles.js';
17
16
  export { EditorModeEntityStore } from './entity/EditorModeEntityStore.js';
18
17
  export { EntityStore } from './entity/EntityStore.js';
package/dist/index.js CHANGED
@@ -32,8 +32,6 @@ var StudioCanvasMode;
32
32
  StudioCanvasMode["EDITOR"] = "editorMode";
33
33
  StudioCanvasMode["NONE"] = "none";
34
34
  })(StudioCanvasMode || (StudioCanvasMode = {}));
35
- const CONTENTFUL_COMPONENT_CATEGORY = 'contentful-component';
36
- const CONTENTFUL_DEFAULT_CATEGORY = 'Contentful';
37
35
  const CONTENTFUL_COMPONENTS = {
38
36
  section: {
39
37
  id: 'contentful-section',
@@ -976,54 +974,6 @@ const columnsBuiltInStyles = {
976
974
  },
977
975
  };
978
976
 
979
- const sectionDefinition = {
980
- id: CONTENTFUL_COMPONENTS.section.id,
981
- name: CONTENTFUL_COMPONENTS.section.name,
982
- category: CONTENTFUL_COMPONENT_CATEGORY,
983
- children: true,
984
- variables: sectionBuiltInStyles,
985
- tooltip: {
986
- description: 'Create a new full width section of your experience by dragging this component onto the canvas. Other components and patterns can be added into a section.',
987
- },
988
- };
989
- const containerDefinition = {
990
- id: CONTENTFUL_COMPONENTS.container.id,
991
- name: CONTENTFUL_COMPONENTS.container.name,
992
- category: CONTENTFUL_COMPONENT_CATEGORY,
993
- children: true,
994
- variables: containerBuiltInStyles,
995
- tooltip: {
996
- description: 'Create a new area or pattern within your page layout by dragging a container onto the canvas. Other components and patterns can be added into a container.',
997
- },
998
- };
999
- const columnsDefinition = {
1000
- id: CONTENTFUL_COMPONENTS.columns.id,
1001
- name: CONTENTFUL_COMPONENTS.columns.name,
1002
- category: CONTENTFUL_COMPONENT_CATEGORY,
1003
- children: true,
1004
- variables: columnsBuiltInStyles,
1005
- tooltip: {
1006
- description: 'Add columns to a container to create your desired layout and ensure that the experience is responsive across different screen sizes.',
1007
- },
1008
- };
1009
- const singleColumnDefinition = {
1010
- id: CONTENTFUL_COMPONENTS.singleColumn.id,
1011
- name: CONTENTFUL_COMPONENTS.singleColumn.name,
1012
- category: CONTENTFUL_COMPONENT_CATEGORY,
1013
- children: true,
1014
- variables: singleColumnBuiltInStyles,
1015
- };
1016
- const dividerDefinition = {
1017
- id: CONTENTFUL_COMPONENTS.divider.id,
1018
- name: CONTENTFUL_COMPONENTS.divider.name,
1019
- category: CONTENTFUL_DEFAULT_CATEGORY,
1020
- children: false,
1021
- variables: dividerBuiltInStyles,
1022
- tooltip: {
1023
- description: 'Drop onto the canvas to add a divider.',
1024
- },
1025
- };
1026
-
1027
977
  let designTokensRegistry = {};
1028
978
  // This function is used to ensure that the composite values are valid since composite values are optional.
1029
979
  // Therefore only border and in the future text related design tokens are/will be checked in this funciton.
@@ -3000,7 +2950,7 @@ class EditorEntityStore extends EntityStoreBase {
3000
2950
  ...message.entities.map((entity) => entity.sys.id),
3001
2951
  ...(message.missingEntityIds ?? []),
3002
2952
  ];
3003
- if (missing.every((id) => messageIds.find((entityId) => entityId === id))) {
2953
+ if (missing.every((id) => messageIds.includes(id))) {
3004
2954
  clearTimeout(timeout);
3005
2955
  resolve(message.entities);
3006
2956
  this.cleanupPromise(cacheId);
@@ -3012,7 +2962,7 @@ class EditorEntityStore extends EntityStoreBase {
3012
2962
  }
3013
2963
  });
3014
2964
  const timeout = setTimeout(() => {
3015
- reject(new Error(`Request for entities timed out ${this.timeoutDuration}ms} for ${cacheId}`));
2965
+ reject(new Error(`Request for entities timed out ${this.timeoutDuration}ms for ${cacheId}`));
3016
2966
  this.cleanupPromise(cacheId);
3017
2967
  ids.forEach((id) => this.cleanupPromise(id));
3018
2968
  unsubscribe();
@@ -3125,10 +3075,7 @@ class EditorModeEntityStore extends EditorEntityStore {
3125
3075
  return;
3126
3076
  }
3127
3077
  const fieldValue = get(entity, path);
3128
- // walk around to render asset files
3129
- return fieldValue && typeof fieldValue == 'object' && fieldValue.url
3130
- ? fieldValue.url
3131
- : fieldValue;
3078
+ return transformAssetFileToUrl(fieldValue);
3132
3079
  }
3133
3080
  }
3134
3081
 
@@ -3666,5 +3613,5 @@ async function fetchById({ client, experienceTypeId, id, localeCode, }) {
3666
3613
  }
3667
3614
  }
3668
3615
 
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 };
3616
+ export { DeepReference, EditorModeEntityStore, EntityStore, EntityStoreBase, MEDIA_QUERY_REGEXP, VisualEditorMode, addLocale, breakpointsRegistry, buildCfStyles, buildStyleTag, buildTemplate, builtInStyles, calculateNodeDefaultHeight, checkIsAssembly, checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, columnsBuiltInStyles, containerBuiltInStyles, createExperience, defineBreakpoints, defineDesignTokens, designTokensRegistry, detachExperienceStyles, dividerBuiltInStyles, 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, sendMessage, singleColumnBuiltInStyles, toCSSAttribute, toCSSString, toMediaQuery, transformBoundContentValue, tryParseMessage, validateExperienceBuilderConfig };
3670
3617
  //# sourceMappingURL=index.js.map