@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/index.js
CHANGED
|
@@ -1863,13 +1863,20 @@ function getResolvedEntryFromLink(entryOrAsset, path, entityStore) {
|
|
|
1863
1863
|
throw new Error(`Expected an Entry or Asset, but got: ${JSON.stringify(entryOrAsset)}`);
|
|
1864
1864
|
}
|
|
1865
1865
|
const value = get(entryOrAsset, path.split('/').slice(2, -1));
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1866
|
+
let resolvedEntity;
|
|
1867
|
+
if (isAsset(value) || isEntry(value)) {
|
|
1868
|
+
// In some cases, reference fields are already resolved
|
|
1869
|
+
resolvedEntity = value;
|
|
1870
|
+
}
|
|
1871
|
+
else if (value?.sys.type === 'Link') {
|
|
1872
|
+
// Look up the reference in the entity store
|
|
1873
|
+
resolvedEntity = entityStore.getEntityFromLink(value);
|
|
1874
|
+
if (!resolvedEntity) {
|
|
1875
|
+
return;
|
|
1876
|
+
}
|
|
1869
1877
|
}
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
if (!resolvedEntity) {
|
|
1878
|
+
else {
|
|
1879
|
+
console.warn(`Expected a link to a reference, but got: ${JSON.stringify(value)}`);
|
|
1873
1880
|
return;
|
|
1874
1881
|
}
|
|
1875
1882
|
//resolve any embedded links - we currently only support 2 levels deep
|