@contentful/field-editor-reference 4.2.3 → 4.3.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.
@@ -2421,7 +2421,8 @@ function SingleReferenceEditor(props) {
2421
2421
  });
2422
2422
  }
2423
2423
  SingleReferenceEditor.defaultProps = {
2424
- hasCardEditActions: true
2424
+ hasCardEditActions: true,
2425
+ hasCardRemoveActions: true
2425
2426
  };
2426
2427
 
2427
2428
  var getEntryTitle = entityHelpers.getEntryTitle,
@@ -2436,7 +2437,8 @@ var styles$1 = {
2436
2437
  var defaultProps = {
2437
2438
  isClickable: true,
2438
2439
  hasCardEditActions: true,
2439
- hasMoveOptions: true
2440
+ hasCardMoveActions: true,
2441
+ hasCardRemoveActions: true
2440
2442
  };
2441
2443
  function WrappedEntryCard(props) {
2442
2444
  var _props$entry;
@@ -2513,18 +2515,18 @@ function WrappedEntryCard(props) {
2513
2515
  onClick: function onClick() {
2514
2516
  props.onEdit && props.onEdit();
2515
2517
  }
2516
- }, "Edit") : null, props.onRemove ? createElement(MenuItem, {
2518
+ }, "Edit") : null, props.hasCardRemoveActions && props.onRemove ? createElement(MenuItem, {
2517
2519
  key: "delete",
2518
2520
  testId: "delete",
2519
2521
  onClick: function onClick() {
2520
2522
  props.onRemove && props.onRemove();
2521
2523
  }
2522
- }, "Remove") : null, props.hasMoveOptions && (props.onMoveTop || props.onMoveBottom) ? createElement(MenuDivider, null) : null, props.hasMoveOptions && props.onMoveTop ? createElement(MenuItem, {
2524
+ }, "Remove") : null, props.hasCardMoveActions && (props.onMoveTop || props.onMoveBottom) ? createElement(MenuDivider, null) : null, props.hasCardMoveActions && props.onMoveTop ? createElement(MenuItem, {
2523
2525
  onClick: function onClick() {
2524
2526
  return props.onMoveTop && props.onMoveTop();
2525
2527
  },
2526
2528
  testId: "move-top"
2527
- }, "Move to top") : null, props.hasMoveOptions && props.onMoveBottom ? createElement(MenuItem, {
2529
+ }, "Move to top") : null, props.hasCardMoveActions && props.onMoveBottom ? createElement(MenuItem, {
2528
2530
  onClick: function onClick() {
2529
2531
  return props.onMoveBottom && props.onMoveBottom();
2530
2532
  },
@@ -2710,11 +2712,15 @@ function FetchingWrappedEntryCard(props) {
2710
2712
  onMoveTop: props.onMoveTop,
2711
2713
  onMoveBottom: props.onMoveBottom
2712
2714
  };
2713
- var hasCardEditActions = props.hasCardEditActions;
2715
+ var hasCardEditActions = props.hasCardEditActions,
2716
+ hasCardMoveActions = props.hasCardMoveActions,
2717
+ hasCardRemoveActions = props.hasCardRemoveActions;
2714
2718
 
2715
2719
  function renderDefaultCard(props) {
2716
2720
  var builtinCardProps = _extends({}, sharedCardProps, props, {
2717
2721
  hasCardEditActions: hasCardEditActions,
2722
+ hasCardMoveActions: hasCardMoveActions,
2723
+ hasCardRemoveActions: hasCardRemoveActions,
2718
2724
  getAsset: getOrLoadAsset,
2719
2725
  getEntityScheduledActions: loadEntityScheduledActions,
2720
2726
  entry: (props == null ? void 0 : props.entity) || sharedCardProps.entity,
@@ -2746,6 +2752,7 @@ function SingleEntryReferenceEditor(props) {
2746
2752
  entityId = _ref.entityId,
2747
2753
  setValue = _ref.setValue,
2748
2754
  renderCustomCard = _ref.renderCustomCard,
2755
+ hasCardRemoveActions = _ref.hasCardRemoveActions,
2749
2756
  hasCardEditActions = _ref.hasCardEditActions;
2750
2757
  return createElement(FetchingWrappedEntryCard, Object.assign({}, props, {
2751
2758
  allContentTypes: allContentTypes,
@@ -2753,6 +2760,7 @@ function SingleEntryReferenceEditor(props) {
2753
2760
  entryId: entityId,
2754
2761
  renderCustomCard: renderCustomCard,
2755
2762
  hasCardEditActions: hasCardEditActions,
2763
+ hasCardRemoveActions: hasCardRemoveActions,
2756
2764
  onRemove: function onRemove() {
2757
2765
  setValue(null);
2758
2766
  }