@contentful/field-editor-reference 4.1.2 → 4.2.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
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.2.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.1.2...@contentful/field-editor-reference@4.2.0) (2022-03-02)
7
+
8
+ ### Features
9
+
10
+ - support onclick on wrappedentrycard components ([#1053](https://github.com/contentful/field-editors/issues/1053)) ([2480c9c](https://github.com/contentful/field-editors/commit/2480c9cbf1609b9ee2da73a951355a6972fdd859))
11
+
6
12
  ## [4.1.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.1.1...@contentful/field-editor-reference@4.1.2) (2022-02-15)
7
13
 
8
14
  ### Bug Fixes
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { SpaceAPI } from '@contentful/app-sdk';
3
3
  import { ContentType, Entry, RenderDragFn } from '../../types';
4
4
  export interface WrappedEntryCardProps {
@@ -10,6 +10,7 @@ export interface WrappedEntryCardProps {
10
10
  isSelected?: boolean;
11
11
  onRemove?: () => void;
12
12
  onEdit?: () => void;
13
+ onClick?: (e: React.MouseEvent<HTMLElement>) => void;
13
14
  localeCode: string;
14
15
  defaultLocaleCode: string;
15
16
  contentType?: ContentType;
@@ -2528,6 +2528,7 @@ function WrappedEntryCard(props) {
2528
2528
  onClick: function onClick(e) {
2529
2529
  e.preventDefault();
2530
2530
  if (!props.isClickable) return;
2531
+ if (props.onClick) return props.onClick(e);
2531
2532
  props.onEdit && props.onEdit();
2532
2533
  }
2533
2534
  });