@contentful/field-editor-reference 4.6.7 → 4.6.10

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.
@@ -393,6 +393,10 @@ var CreateEntryLinkButton = function CreateEntryLinkButton(_ref) {
393
393
  });
394
394
  };
395
395
 
396
+ function NoLinkPermissionsInfo() {
397
+ return React__default.createElement(Paragraph, null, "You don't have permission to view this content or this field is not correctly configured. Contact your administrator for help.");
398
+ }
399
+
396
400
  var container$1 = /*#__PURE__*/css({
397
401
  display: 'flex',
398
402
  width: '100%',
@@ -402,10 +406,6 @@ var separator = /*#__PURE__*/css({
402
406
  marginRight: tokens.spacingXl
403
407
  });
404
408
 
405
- function NoLinkPermissionsInfo() {
406
- return React__default.createElement(Paragraph, null, "You don't have permission to view this content or this field is not correctly configured. Contact your administrator for help.");
407
- }
408
-
409
409
  var defaultEntryLabels = {
410
410
  createNew: function createNew(props) {
411
411
  return props != null && props.contentType ? "Create new " + props.contentType + " and link" : 'Create new entry and link';
@@ -1628,9 +1628,8 @@ function useLinkActionsProps(props) {
1628
1628
  return function (_x, _x2) {
1629
1629
  return _ref.apply(this, arguments);
1630
1630
  };
1631
- }(), [sdk, entityType, onCreated]); // Wrapping these two with useCallback caused a bug [ZEND-2154] where CTs were not propagated to the UI at all
1632
-
1633
- var onLinkExisting = /*#__PURE__*/function () {
1631
+ }(), [sdk, entityType, onCreated]);
1632
+ var onLinkExisting = useCallback( /*#__PURE__*/function () {
1634
1633
  var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(index) {
1635
1634
  var entity;
1636
1635
  return runtime_1.wrap(function _callee2$(_context2) {
@@ -1665,12 +1664,12 @@ function useLinkActionsProps(props) {
1665
1664
  }, _callee2);
1666
1665
  }));
1667
1666
 
1668
- return function onLinkExisting(_x3) {
1667
+ return function (_x3) {
1669
1668
  return _ref2.apply(this, arguments);
1670
1669
  };
1671
- }();
1672
-
1673
- var onLinkSeveralExisting = /*#__PURE__*/function () {
1670
+ }(), // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
1671
+ [sdk, entityType, onLinkedExisting]);
1672
+ var onLinkSeveralExisting = useCallback( /*#__PURE__*/function () {
1674
1673
  var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(index) {
1675
1674
  var entities;
1676
1675
  return runtime_1.wrap(function _callee3$(_context3) {
@@ -1705,11 +1704,11 @@ function useLinkActionsProps(props) {
1705
1704
  }, _callee3);
1706
1705
  }));
1707
1706
 
1708
- return function onLinkSeveralExisting(_x4) {
1707
+ return function (_x4) {
1709
1708
  return _ref3.apply(this, arguments);
1710
1709
  };
1711
- }(); // FIXME: The memoization might rerun every time due to the always changing callback identities above
1712
-
1710
+ }(), // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
1711
+ [sdk, entityType, onLinkedExisting]); // FIXME: The memoization might rerun every time due to the always changing callback identities above
1713
1712
 
1714
1713
  return useMemo(function () {
1715
1714
  return {
@@ -3615,6 +3614,10 @@ function FetchingWrappedAssetCard(props) {
3615
3614
  assets = _useEntities.assets;
3616
3615
 
3617
3616
  useEffect(function () {
3617
+ if (!props.assetId) {
3618
+ return;
3619
+ }
3620
+
3618
3621
  getAsset(props.assetId); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
3619
3622
  }, [props.assetId]);
3620
3623
  var asset = assets[props.assetId];