@contentful/experiences-core 3.3.1-dev-20250821T1304-a31a6e8.0 → 3.3.1-dev-20250825T0658-5f2fae7.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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z, ZodIssueCode } from 'zod';
2
- import { omit, isArray, uniqBy } from 'lodash-es';
2
+ import { cloneDeep, omit, isArray, uniqBy } from 'lodash-es';
3
3
  import md5 from 'md5';
4
4
  import { BLOCKS } from '@contentful/rich-text-types';
5
5
  import { create } from 'zustand';
@@ -1743,7 +1743,7 @@ function localizeEntity(entity, locale) {
1743
1743
  if (entity.sys.locale) {
1744
1744
  return entity;
1745
1745
  }
1746
- const cloned = structuredClone(entity);
1746
+ const cloned = cloneDeep(entity);
1747
1747
  // Set the requested locale as entry locale to follow the API shape:
1748
1748
  // https://www.contentful.com/developers/docs/references/content-delivery-api/#/introduction/common-resource-attributes
1749
1749
  cloned.sys.locale = locale;
@@ -2894,7 +2894,7 @@ const transformRichText = (entryOrAsset, entityStore, path) => {
2894
2894
  // resolve any links to assets/entries/hyperlinks
2895
2895
  // we need to clone, as we want to keep the original Entity in the EntityStore intact,
2896
2896
  // and resolveLinks() is mutating the node object.
2897
- const richTextDocument = structuredClone(value);
2897
+ const richTextDocument = cloneDeep(value);
2898
2898
  resolveLinks(richTextDocument, entityStore);
2899
2899
  return richTextDocument;
2900
2900
  }
@@ -3558,11 +3558,11 @@ class EntityStoreBase {
3558
3558
  addEntity(entity) {
3559
3559
  if (isAsset(entity)) {
3560
3560
  // cloned and frozen
3561
- this.assetMap.set(entity.sys.id, deepFreeze(structuredClone(entity)));
3561
+ this.assetMap.set(entity.sys.id, deepFreeze(cloneDeep(entity)));
3562
3562
  }
3563
3563
  else if (isEntry(entity)) {
3564
3564
  // cloned and frozen
3565
- this.entryMap.set(entity.sys.id, deepFreeze(structuredClone(entity)));
3565
+ this.entryMap.set(entity.sys.id, deepFreeze(cloneDeep(entity)));
3566
3566
  }
3567
3567
  else {
3568
3568
  throw new Error(`Attempted to add an entity to the store that is neither Asset nor Entry: '${JSON.stringify(entity)}'`);