@contentful/field-editor-reference 4.1.2 → 4.2.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.
- package/CHANGELOG.md +18 -0
- package/dist/entries/WrappedEntryCard/WrappedEntryCard.d.ts +2 -1
- package/dist/field-editor-reference.cjs.development.js +18 -7
- package/dist/field-editor-reference.cjs.development.js.map +1 -1
- package/dist/field-editor-reference.cjs.production.min.js +1 -1
- package/dist/field-editor-reference.cjs.production.min.js.map +1 -1
- package/dist/field-editor-reference.esm.js +18 -7
- package/dist/field-editor-reference.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -2307,7 +2307,7 @@ function useEditorPermissions(props) {
|
|
|
2307
2307
|
switch (_context2.prev = _context2.next) {
|
|
2308
2308
|
case 0:
|
|
2309
2309
|
if (!(entityType === 'Asset')) {
|
|
2310
|
-
_context2.next =
|
|
2310
|
+
_context2.next = 8;
|
|
2311
2311
|
break;
|
|
2312
2312
|
}
|
|
2313
2313
|
|
|
@@ -2315,15 +2315,25 @@ function useEditorPermissions(props) {
|
|
|
2315
2315
|
return canPerformAction('read', 'Asset');
|
|
2316
2316
|
|
|
2317
2317
|
case 3:
|
|
2318
|
-
|
|
2318
|
+
_context2.t0 = _context2.sent;
|
|
2319
|
+
|
|
2320
|
+
if (_context2.t0) {
|
|
2321
|
+
_context2.next = 6;
|
|
2322
|
+
break;
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
_context2.t0 = true;
|
|
2326
|
+
|
|
2327
|
+
case 6:
|
|
2328
|
+
canRead = _context2.t0;
|
|
2319
2329
|
setCanLinkEntity(canRead);
|
|
2320
2330
|
|
|
2321
|
-
case
|
|
2331
|
+
case 8:
|
|
2322
2332
|
if (entityType === 'Entry') {
|
|
2323
2333
|
setCanLinkEntity(readableContentTypes.length > 0);
|
|
2324
2334
|
}
|
|
2325
2335
|
|
|
2326
|
-
case
|
|
2336
|
+
case 9:
|
|
2327
2337
|
case "end":
|
|
2328
2338
|
return _context2.stop();
|
|
2329
2339
|
}
|
|
@@ -2521,6 +2531,7 @@ function WrappedEntryCard(props) {
|
|
|
2521
2531
|
onClick: function onClick(e) {
|
|
2522
2532
|
e.preventDefault();
|
|
2523
2533
|
if (!props.isClickable) return;
|
|
2534
|
+
if (props.onClick) return props.onClick(e);
|
|
2524
2535
|
props.onEdit && props.onEdit();
|
|
2525
2536
|
}
|
|
2526
2537
|
});
|
|
@@ -2604,7 +2615,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2604
2615
|
switch (_context.prev = _context.next) {
|
|
2605
2616
|
case 0:
|
|
2606
2617
|
_context.next = 2;
|
|
2607
|
-
return openEntry(props.sdk,
|
|
2618
|
+
return openEntry(props.sdk, props.entryId, {
|
|
2608
2619
|
bulkEditing: props.parameters.instance.bulkEditing,
|
|
2609
2620
|
index: props.index
|
|
2610
2621
|
});
|
|
@@ -2614,7 +2625,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2614
2625
|
props.onAction && props.onAction({
|
|
2615
2626
|
entity: 'Entry',
|
|
2616
2627
|
type: 'edit',
|
|
2617
|
-
id:
|
|
2628
|
+
id: props.entryId,
|
|
2618
2629
|
contentTypeId: get(entry, 'sys.contentType.sys.id'),
|
|
2619
2630
|
slide: slide
|
|
2620
2631
|
});
|
|
@@ -2637,7 +2648,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2637
2648
|
props.onAction && props.onAction({
|
|
2638
2649
|
entity: 'Entry',
|
|
2639
2650
|
type: 'delete',
|
|
2640
|
-
id:
|
|
2651
|
+
id: props.entryId,
|
|
2641
2652
|
contentTypeId: get(entry, 'sys.contentType.sys.id')
|
|
2642
2653
|
});
|
|
2643
2654
|
};
|