@contentful/field-editor-reference 4.3.6 → 4.3.9

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.3.9](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.8...@contentful/field-editor-reference@4.3.9) (2022-06-21)
7
+
8
+ **Note:** Version bump only for package @contentful/field-editor-reference
9
+
10
+ ## [4.3.8](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.7...@contentful/field-editor-reference@4.3.8) (2022-06-15)
11
+
12
+ ### Bug Fixes
13
+
14
+ - don't register onClick callbacks when isClickable is false ([#1163](https://github.com/contentful/field-editors/issues/1163)) ([fe6fc6b](https://github.com/contentful/field-editors/commit/fe6fc6b872acfde3b097c626d2eef81a7cc24193))
15
+
16
+ ## [4.3.7](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.6...@contentful/field-editor-reference@4.3.7) (2022-06-07)
17
+
18
+ ### Bug Fixes
19
+
20
+ - **reference:** avoid infinite getEntityScheduledActions calls ([#1159](https://github.com/contentful/field-editors/issues/1159)) ([620111b](https://github.com/contentful/field-editors/commit/620111bdca45a083369bdb42be8e93a16b670937))
21
+
6
22
  ## [4.3.6](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.5...@contentful/field-editor-reference@4.3.6) (2022-05-24)
7
23
 
8
24
  ### Bug Fixes
@@ -1799,8 +1799,10 @@ var ScheduledIconWithTooltip = function ScheduledIconWithTooltip(_ref) {
1799
1799
  type: 'error',
1800
1800
  error: e
1801
1801
  });
1802
- });
1803
- }, [getEntityScheduledActions, entityType, entityId]);
1802
+ }); // This should only be ever called once. Following the eslint hint to add used
1803
+ // dependencies will cause page freeze (infinite loop)
1804
+ // eslint-disable-next-line
1805
+ }, []);
1804
1806
 
1805
1807
  if (status.type === 'loading' || status.type === 'error') {
1806
1808
  return null;
@@ -2566,12 +2568,15 @@ function WrappedEntryCard(props) {
2566
2568
  }, "Move to bottom") : null].filter(function (item) {
2567
2569
  return item;
2568
2570
  }) : [],
2569
- onClick: function onClick(e) {
2571
+ onClick: // Providing an onClick handler messes up with some rich text
2572
+ // features e.g. pressing ENTER on a card to add a new paragraph
2573
+ // underneath. It's crucial not to pass a custom handler when
2574
+ // isClickable is disabled which in the case of RT it's.
2575
+ props.isClickable ? function (e) {
2570
2576
  e.preventDefault();
2571
- if (!props.isClickable) return;
2572
2577
  if (props.onClick) return props.onClick(e);
2573
2578
  props.onEdit && props.onEdit();
2574
- }
2579
+ } : undefined
2575
2580
  });
2576
2581
  }
2577
2582
  WrappedEntryCard.defaultProps = defaultProps;
@@ -3102,11 +3107,14 @@ var WrappedAssetCard = function WrappedAssetCard(props) {
3102
3107
  testId: "schedule-icon"
3103
3108
  })),
3104
3109
  src: entityFile && entityFile.url ? size === 'small' ? entityFile.url + "?w=150&h=150&fit=thumb" : entityFile.url + "?h=300" : '',
3105
- onClick: function onClick(e) {
3110
+ onClick: // Providing an onClick handler messes up with some rich text
3111
+ // features e.g. pressing ENTER on a card to add a new paragraph
3112
+ // underneath. It's crucial not to pass a custom handler when
3113
+ // isClickable is disabled which in the case of RT it's.
3114
+ isClickable ? function (e) {
3106
3115
  e.preventDefault();
3107
- if (!isClickable) return;
3108
3116
  onEdit && onEdit();
3109
- },
3117
+ } : undefined,
3110
3118
  dragHandleRender: props.renderDragHandle,
3111
3119
  withDragHandle: !!props.renderDragHandle,
3112
3120
  actions: [].concat(renderActions({