@contentful/experiences-visual-editor-react 3.3.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 +6 -6
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +35 -9
- package/dist/renderApp.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
import React, { useState, useEffect, useCallback, forwardRef, useMemo, useLayoutEffect, useRef } from 'react';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { omit, isArray, isEqual, get as get$2, debounce } from 'lodash-es';
|
|
4
|
+
import { cloneDeep, omit, isArray, isEqual, get as get$2, debounce } from 'lodash-es';
|
|
5
5
|
import md5 from 'md5';
|
|
6
6
|
import { BLOCKS } from '@contentful/rich-text-types';
|
|
7
7
|
import { create, useStore } from 'zustand';
|
|
@@ -1805,7 +1805,7 @@ const transformRichText = (entryOrAsset, entityStore, path) => {
|
|
|
1805
1805
|
// resolve any links to assets/entries/hyperlinks
|
|
1806
1806
|
// we need to clone, as we want to keep the original Entity in the EntityStore intact,
|
|
1807
1807
|
// and resolveLinks() is mutating the node object.
|
|
1808
|
-
const richTextDocument =
|
|
1808
|
+
const richTextDocument = cloneDeep(value);
|
|
1809
1809
|
resolveLinks(richTextDocument, entityStore);
|
|
1810
1810
|
return richTextDocument;
|
|
1811
1811
|
}
|
|
@@ -2282,11 +2282,11 @@ let EntityStoreBase$1 = class EntityStoreBase {
|
|
|
2282
2282
|
addEntity(entity) {
|
|
2283
2283
|
if (isAsset$1(entity)) {
|
|
2284
2284
|
// cloned and frozen
|
|
2285
|
-
this.assetMap.set(entity.sys.id, deepFreeze$1(
|
|
2285
|
+
this.assetMap.set(entity.sys.id, deepFreeze$1(cloneDeep(entity)));
|
|
2286
2286
|
}
|
|
2287
2287
|
else if (isEntry$1(entity)) {
|
|
2288
2288
|
// cloned and frozen
|
|
2289
|
-
this.entryMap.set(entity.sys.id, deepFreeze$1(
|
|
2289
|
+
this.entryMap.set(entity.sys.id, deepFreeze$1(cloneDeep(entity)));
|
|
2290
2290
|
}
|
|
2291
2291
|
else {
|
|
2292
2292
|
throw new Error(`Attempted to add an entity to the store that is neither Asset nor Entry: '${JSON.stringify(entity)}'`);
|
|
@@ -4093,11 +4093,11 @@ class EntityStoreBase {
|
|
|
4093
4093
|
addEntity(entity) {
|
|
4094
4094
|
if (isAsset(entity)) {
|
|
4095
4095
|
// cloned and frozen
|
|
4096
|
-
this.assetMap.set(entity.sys.id, deepFreeze(
|
|
4096
|
+
this.assetMap.set(entity.sys.id, deepFreeze(cloneDeep(entity)));
|
|
4097
4097
|
}
|
|
4098
4098
|
else if (isEntry(entity)) {
|
|
4099
4099
|
// cloned and frozen
|
|
4100
|
-
this.entryMap.set(entity.sys.id, deepFreeze(
|
|
4100
|
+
this.entryMap.set(entity.sys.id, deepFreeze(cloneDeep(entity)));
|
|
4101
4101
|
}
|
|
4102
4102
|
else {
|
|
4103
4103
|
throw new Error(`Attempted to add an entity to the store that is neither Asset nor Entry: '${JSON.stringify(entity)}'`);
|