@contentful/experiences-visual-editor-react 1.41.0-dev-20250612T1212-618fdd9.0 → 1.41.0-dev-20250612T1336-5a7de24.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 +13 -6
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +13 -6
- package/dist/renderApp.js.map +1 -1
- package/package.json +4 -4
package/dist/renderApp.js
CHANGED
|
@@ -44484,13 +44484,20 @@ function getResolvedEntryFromLink(entryOrAsset, path, entityStore) {
|
|
|
44484
44484
|
throw new Error(`Expected an Entry or Asset, but got: ${JSON.stringify(entryOrAsset)}`);
|
|
44485
44485
|
}
|
|
44486
44486
|
const value = get(entryOrAsset, path.split('/').slice(2, -1));
|
|
44487
|
-
|
|
44488
|
-
|
|
44489
|
-
|
|
44487
|
+
let resolvedEntity;
|
|
44488
|
+
if (isAsset(value) || isEntry(value)) {
|
|
44489
|
+
// In some cases, reference fields are already resolved
|
|
44490
|
+
resolvedEntity = value;
|
|
44491
|
+
}
|
|
44492
|
+
else if (value?.sys.type === 'Link') {
|
|
44493
|
+
// Look up the reference in the entity store
|
|
44494
|
+
resolvedEntity = entityStore.getEntityFromLink(value);
|
|
44495
|
+
if (!resolvedEntity) {
|
|
44496
|
+
return;
|
|
44497
|
+
}
|
|
44490
44498
|
}
|
|
44491
|
-
|
|
44492
|
-
|
|
44493
|
-
if (!resolvedEntity) {
|
|
44499
|
+
else {
|
|
44500
|
+
console.warn(`Expected a link to a reference, but got: ${JSON.stringify(value)}`);
|
|
44494
44501
|
return;
|
|
44495
44502
|
}
|
|
44496
44503
|
//resolve any embedded links - we currently only support 2 levels deep
|