@contentful/field-editor-reference 5.30.0 → 5.30.2

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.
@@ -98,9 +98,14 @@ function ExternalResourceCardDescription({ subtitle, description }) {
98
98
  }, truncatedDescription));
99
99
  }
100
100
  ExternalResourceCardDescription.displayName = 'ExternalResourceCardDescription';
101
- function ExternalResourceCard({ info, isClickable, onEdit, onRemove, onMoveTop, onMoveBottom, hasCardEditActions, hasCardMoveActions, hasCardRemoveActions, renderDragHandle, onClick, isSelected }) {
101
+ function ExternalResourceCard({ info, isClickable, onRemove, onMoveTop, onMoveBottom, hasCardEditActions, hasCardMoveActions, hasCardRemoveActions, renderDragHandle, onClick, isSelected }) {
102
102
  const { resource: entity, resourceType } = info;
103
103
  const badge = ExternalEntityBadge(entity.fields.badge);
104
+ const onEdit = ()=>{
105
+ if (entity.fields.externalUrl) {
106
+ window.open(entity.fields.externalUrl, '_blank', 'noopener,noreferrer');
107
+ }
108
+ };
104
109
  return _react.createElement(_f36components.EntryCard, {
105
110
  as: entity.fields.externalUrl ? 'a' : 'article',
106
111
  href: entity.fields.externalUrl,
@@ -147,7 +152,7 @@ function ExternalResourceCard({ info, isClickable, onEdit, onRemove, onMoveTop,
147
152
  onClick: isClickable ? (e)=>{
148
153
  e.preventDefault();
149
154
  if (onClick) return onClick(e);
150
- onEdit && onEdit();
155
+ onEdit();
151
156
  } : undefined
152
157
  }, _react.createElement(ExternalResourceCardDescription, {
153
158
  subtitle: entity.fields.subtitle,
@@ -42,9 +42,14 @@ function ExternalResourceCardDescription({ subtitle, description }) {
42
42
  }, truncatedDescription));
43
43
  }
44
44
  ExternalResourceCardDescription.displayName = 'ExternalResourceCardDescription';
45
- export function ExternalResourceCard({ info, isClickable, onEdit, onRemove, onMoveTop, onMoveBottom, hasCardEditActions, hasCardMoveActions, hasCardRemoveActions, renderDragHandle, onClick, isSelected }) {
45
+ export function ExternalResourceCard({ info, isClickable, onRemove, onMoveTop, onMoveBottom, hasCardEditActions, hasCardMoveActions, hasCardRemoveActions, renderDragHandle, onClick, isSelected }) {
46
46
  const { resource: entity, resourceType } = info;
47
47
  const badge = ExternalEntityBadge(entity.fields.badge);
48
+ const onEdit = ()=>{
49
+ if (entity.fields.externalUrl) {
50
+ window.open(entity.fields.externalUrl, '_blank', 'noopener,noreferrer');
51
+ }
52
+ };
48
53
  return React.createElement(EntryCard, {
49
54
  as: entity.fields.externalUrl ? 'a' : 'article',
50
55
  href: entity.fields.externalUrl,
@@ -91,7 +96,7 @@ export function ExternalResourceCard({ info, isClickable, onEdit, onRemove, onMo
91
96
  onClick: isClickable ? (e)=>{
92
97
  e.preventDefault();
93
98
  if (onClick) return onClick(e);
94
- onEdit && onEdit();
99
+ onEdit();
95
100
  } : undefined
96
101
  }, React.createElement(ExternalResourceCardDescription, {
97
102
  subtitle: entity.fields.subtitle,
@@ -6,7 +6,6 @@ export interface ExternalResourceCardProps {
6
6
  isDisabled: boolean;
7
7
  isSelected?: boolean;
8
8
  onRemove?: () => void;
9
- onEdit?: () => void;
10
9
  onClick?: (e: React.MouseEvent<HTMLElement>) => void;
11
10
  renderDragHandle?: RenderDragFn;
12
11
  isClickable?: boolean;
@@ -16,7 +15,7 @@ export interface ExternalResourceCardProps {
16
15
  hasCardMoveActions?: boolean;
17
16
  hasCardRemoveActions?: boolean;
18
17
  }
19
- export declare function ExternalResourceCard({ info, isClickable, onEdit, onRemove, onMoveTop, onMoveBottom, hasCardEditActions, hasCardMoveActions, hasCardRemoveActions, renderDragHandle, onClick, isSelected, }: ExternalResourceCardProps): JSX.Element;
18
+ export declare function ExternalResourceCard({ info, isClickable, onRemove, onMoveTop, onMoveBottom, hasCardEditActions, hasCardMoveActions, hasCardRemoveActions, renderDragHandle, onClick, isSelected, }: ExternalResourceCardProps): JSX.Element;
20
19
  export declare namespace ExternalResourceCard {
21
20
  var defaultProps: {
22
21
  isClickable: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-reference",
3
- "version": "5.30.0",
3
+ "version": "5.30.2",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -56,7 +56,7 @@
56
56
  "devDependencies": {
57
57
  "@contentful/app-sdk": "^4.29.0",
58
58
  "@contentful/field-editor-test-utils": "^1.5.0",
59
- "@testing-library/react-hooks": "^5.0.3"
59
+ "@testing-library/react-hooks": "^8.0.1"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@contentful/app-sdk": "^4.29.0",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "registry": "https://npm.pkg.github.com/"
67
67
  },
68
- "gitHead": "6598ec65e210c4e84bed073f8b50c8bdb883a9a4"
68
+ "gitHead": "d6378c31a4dfd237fce1f7290cffaef23162f7e2"
69
69
  }