@contentful/experiences-visual-editor-react 1.40.1-dev-20250605T1324-83179af.0 → 1.40.1

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
@@ -2232,6 +2232,17 @@ class EntityStoreBase {
2232
2232
  resolvedFieldset.push([entityToResolveFieldsFrom, field, _localeQualifier]);
2233
2233
  entityToResolveFieldsFrom = entity; // we move up
2234
2234
  }
2235
+ else if (this.isAsset(fieldValue) || this.isEntry(fieldValue)) {
2236
+ resolvedFieldset.push([entityToResolveFieldsFrom, field, _localeQualifier]);
2237
+ entityToResolveFieldsFrom = fieldValue; // we move up
2238
+ }
2239
+ else {
2240
+ return {
2241
+ resolvedFieldset,
2242
+ isFullyResolved: false,
2243
+ reason: `Deep path points to an invalid field value of type '${typeof fieldValue}' (value=${fieldValue})`,
2244
+ };
2245
+ }
2235
2246
  }
2236
2247
  return {
2237
2248
  resolvedFieldset,
@@ -2257,8 +2268,17 @@ class EntityStoreBase {
2257
2268
  const [leafEntity] = resolvedFieldset[resolvedFieldset.length - 1];
2258
2269
  return leafEntity;
2259
2270
  }
2260
- isAsset(entity) {
2261
- return entity.sys.type === 'Asset';
2271
+ isAsset(value) {
2272
+ return (null !== value &&
2273
+ typeof value === 'object' &&
2274
+ 'sys' in value &&
2275
+ value.sys?.type === 'Asset');
2276
+ }
2277
+ isEntry(value) {
2278
+ return (null !== value &&
2279
+ typeof value === 'object' &&
2280
+ 'sys' in value &&
2281
+ value.sys?.type === 'Entry');
2262
2282
  }
2263
2283
  getEntity(type, id) {
2264
2284
  if (type === 'Asset') {