@contentful/field-editor-reference 4.3.2 → 4.3.5

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.
@@ -355,7 +355,7 @@ var CreateEntryLinkButton = function CreateEntryLinkButton(_ref) {
355
355
  endIcon: hasDropdown ? React__default.createElement(ChevronDownIcon, null) : undefined,
356
356
  variant: "secondary",
357
357
  className: styles.action,
358
- isDisabled: disabled || isSelecting || contentTypes && contentTypes.length === 0,
358
+ isDisabled: disabled || isSelecting,
359
359
  startIcon: isSelecting ? undefined : plusIcon,
360
360
  size: "small",
361
361
  testId: "create-entry-link-button",
@@ -1600,8 +1600,9 @@ function useLinkActionsProps(props) {
1600
1600
  return function (_x, _x2) {
1601
1601
  return _ref.apply(this, arguments);
1602
1602
  };
1603
- }(), [sdk, entityType, onCreated]);
1604
- var onLinkExisting = useCallback( /*#__PURE__*/function () {
1603
+ }(), [sdk, entityType, onCreated]); // Wrapping these two with useCallback caused a bug [ZEND-2154] where CTs were not propagated to the UI at all
1604
+
1605
+ var onLinkExisting = /*#__PURE__*/function () {
1605
1606
  var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(index) {
1606
1607
  var entity;
1607
1608
  return runtime_1.wrap(function _callee2$(_context2) {
@@ -1636,11 +1637,12 @@ function useLinkActionsProps(props) {
1636
1637
  }, _callee2);
1637
1638
  }));
1638
1639
 
1639
- return function (_x3) {
1640
+ return function onLinkExisting(_x3) {
1640
1641
  return _ref2.apply(this, arguments);
1641
1642
  };
1642
- }(), [sdk, entityType, onLinkedExisting]);
1643
- var onLinkSeveralExisting = useCallback( /*#__PURE__*/function () {
1643
+ }();
1644
+
1645
+ var onLinkSeveralExisting = /*#__PURE__*/function () {
1644
1646
  var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(index) {
1645
1647
  var entities;
1646
1648
  return runtime_1.wrap(function _callee3$(_context3) {
@@ -1675,10 +1677,12 @@ function useLinkActionsProps(props) {
1675
1677
  }, _callee3);
1676
1678
  }));
1677
1679
 
1678
- return function (_x4) {
1680
+ return function onLinkSeveralExisting(_x4) {
1679
1681
  return _ref3.apply(this, arguments);
1680
1682
  };
1681
- }(), [sdk, entityType, onLinkedExisting]);
1683
+ }(); // FIXME: The memoization might rerun every time due to the always changing callback identities above
1684
+
1685
+
1682
1686
  return useMemo(function () {
1683
1687
  return {
1684
1688
  entityType: entityType,
@@ -1789,7 +1793,7 @@ var ScheduledIconWithTooltip = function ScheduledIconWithTooltip(_ref) {
1789
1793
  error: e
1790
1794
  });
1791
1795
  });
1792
- }, []);
1796
+ }, [getEntityScheduledActions, entityType, entityId]);
1793
1797
 
1794
1798
  if (status.type === 'loading' || status.type === 'error') {
1795
1799
  return null;
@@ -1822,7 +1826,7 @@ function AssetThumbnail(props) {
1822
1826
  }
1823
1827
 
1824
1828
  function reducer(state, action) {
1825
- var _extends2, _extends3, _extends4, _extends5;
1829
+ var _extends2, _extends3, _extends4, _extends5, _extends6;
1826
1830
 
1827
1831
  switch (action.type) {
1828
1832
  case 'set_entry':
@@ -1845,6 +1849,11 @@ function reducer(state, action) {
1845
1849
  assets: _extends({}, state.assets, (_extends5 = {}, _extends5[action.id] = 'failed', _extends5))
1846
1850
  });
1847
1851
 
1852
+ case 'set_scheduled_actions':
1853
+ return _extends({}, state, {
1854
+ scheduledActions: _extends({}, state.scheduledActions, (_extends6 = {}, _extends6[action.key] = action.actions, _extends6))
1855
+ });
1856
+
1848
1857
  default:
1849
1858
  return state;
1850
1859
  }