@contentful/field-editor-reference 4.1.1 → 4.2.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,24 @@
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.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.2.0...@contentful/field-editor-reference@4.2.1) (2022-03-29)
7
+
8
+ ### Bug Fixes
9
+
10
+ - allow linking assets on permission rule with tags ([#1085](https://github.com/contentful/field-editors/issues/1085)) ([d7465d0](https://github.com/contentful/field-editors/commit/d7465d05ecc2674c3e10c927c6f2f414adb5df04))
11
+
12
+ # [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)
13
+
14
+ ### Features
15
+
16
+ - support onclick on wrappedentrycard components ([#1053](https://github.com/contentful/field-editors/issues/1053)) ([2480c9c](https://github.com/contentful/field-editors/commit/2480c9cbf1609b9ee2da73a951355a6972fdd859))
17
+
18
+ ## [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)
19
+
20
+ ### Bug Fixes
21
+
22
+ - bump f36 packages ([#1025](https://github.com/contentful/field-editors/issues/1025)) ([ec37a40](https://github.com/contentful/field-editors/commit/ec37a4000db7cd75c66dd9621136b2272c9feeea))
23
+
6
24
  ## [4.1.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.1.0...@contentful/field-editor-reference@4.1.1) (2022-02-14)
7
25
 
8
26
  **Note:** Version bump only for package @contentful/field-editor-reference
@@ -190,7 +190,7 @@ export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
190
190
  getEditorInterfaces: () => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").EditorInterface>>;
191
191
  getAllScheduledActions: () => Promise<import("@contentful/app-sdk").ScheduledAction[]>;
192
192
  signRequest: (request: import("@contentful/app-sdk").CanonicalRequest) => Promise<Record<string, string>>;
193
- createTag: (id: string, name: string, visibility?: any) => Promise<import("@contentful/app-sdk").Tag>;
193
+ createTag: (id: string, name: string, visibility?: "private" | "public" | undefined) => Promise<import("@contentful/app-sdk").Tag>;
194
194
  readTags: (skip: number, limit: number) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Tag>>;
195
195
  updateTag: (id: string, name: string, version: number) => Promise<import("@contentful/app-sdk").Tag>;
196
196
  deleteTag: (id: string, version: number) => Promise<boolean>;
@@ -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;
@@ -2314,7 +2314,7 @@ function useEditorPermissions(props) {
2314
2314
  switch (_context2.prev = _context2.next) {
2315
2315
  case 0:
2316
2316
  if (!(entityType === 'Asset')) {
2317
- _context2.next = 5;
2317
+ _context2.next = 8;
2318
2318
  break;
2319
2319
  }
2320
2320
 
@@ -2322,15 +2322,25 @@ function useEditorPermissions(props) {
2322
2322
  return canPerformAction('read', 'Asset');
2323
2323
 
2324
2324
  case 3:
2325
- canRead = _context2.sent;
2325
+ _context2.t0 = _context2.sent;
2326
+
2327
+ if (_context2.t0) {
2328
+ _context2.next = 6;
2329
+ break;
2330
+ }
2331
+
2332
+ _context2.t0 = true;
2333
+
2334
+ case 6:
2335
+ canRead = _context2.t0;
2326
2336
  setCanLinkEntity(canRead);
2327
2337
 
2328
- case 5:
2338
+ case 8:
2329
2339
  if (entityType === 'Entry') {
2330
2340
  setCanLinkEntity(readableContentTypes.length > 0);
2331
2341
  }
2332
2342
 
2333
- case 6:
2343
+ case 9:
2334
2344
  case "end":
2335
2345
  return _context2.stop();
2336
2346
  }
@@ -2528,6 +2538,7 @@ function WrappedEntryCard(props) {
2528
2538
  onClick: function onClick(e) {
2529
2539
  e.preventDefault();
2530
2540
  if (!props.isClickable) return;
2541
+ if (props.onClick) return props.onClick(e);
2531
2542
  props.onEdit && props.onEdit();
2532
2543
  }
2533
2544
  });