@contentful/field-editor-reference 5.8.0 → 5.8.1

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
+ ## [5.8.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.8.0...@contentful/field-editor-reference@5.8.1) (2023-01-13)
7
+
8
+ ### Bug Fixes
9
+
10
+ - enter key open asset modal [TOL-889] ([#1320](https://github.com/contentful/field-editors/issues/1320)) ([5e142ca](https://github.com/contentful/field-editors/commit/5e142ca14c1eac5816e8c962e4e32be6fe10aad6))
11
+
6
12
  # [5.8.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.6.0...@contentful/field-editor-reference@5.8.0) (2023-01-11)
7
13
 
8
14
  ### Features
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { Asset, RenderDragFn } from '../../types';
3
2
  import { SpaceAPI } from '@contentful/field-editor-shared';
3
+ import { Asset, RenderDragFn } from '../../types';
4
4
  export interface WrappedAssetLinkProps {
5
5
  getEntityScheduledActions: SpaceAPI['getEntityScheduledActions'];
6
6
  asset: Asset;
@@ -3610,6 +3610,15 @@ var WrappedAssetCard = function WrappedAssetCard(props) {
3610
3610
  e.preventDefault();
3611
3611
  onEdit && onEdit();
3612
3612
  } : undefined,
3613
+
3614
+ /* todo - remove this when onKeyDown is allowed as a prop for BaseCard in forma 36
3615
+ // @ts-expect-error */
3616
+ onKeyDown: isClickable ? function (e) {
3617
+ if (e.key === 'Enter' && onEdit) {
3618
+ e.preventDefault();
3619
+ onEdit();
3620
+ }
3621
+ } : undefined,
3613
3622
  dragHandleRender: props.renderDragHandle,
3614
3623
  withDragHandle: !!props.renderDragHandle,
3615
3624
  actions: [].concat(renderActions({
@@ -3680,6 +3689,12 @@ var WrappedAssetLink = function WrappedAssetLink(props) {
3680
3689
  e.preventDefault();
3681
3690
  onEdit();
3682
3691
  },
3692
+ onKeyDown: function onKeyDown(e) {
3693
+ if (e.key === 'Enter' && onEdit) {
3694
+ e.preventDefault();
3695
+ onEdit();
3696
+ }
3697
+ },
3683
3698
  dragHandleRender: props.renderDragHandle,
3684
3699
  withDragHandle: !!props.renderDragHandle,
3685
3700
  actions: [renderActions({