@contentful/field-editor-reference 5.21.1 → 5.21.4
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/dist/cjs/__fixtures__/FakeSdk.js +3 -3
- package/dist/cjs/__fixtures__/asset/index.js +10 -10
- package/dist/cjs/__fixtures__/content-type/index.js +1 -1
- package/dist/cjs/__fixtures__/entry/index.js +7 -7
- package/dist/cjs/__fixtures__/fixtures.js +6 -8
- package/dist/cjs/__fixtures__/locale/index.js +2 -2
- package/dist/cjs/__fixtures__/space/index.js +1 -1
- package/dist/cjs/assets/MultipleMediaEditor.js +5 -7
- package/dist/cjs/assets/SingleMediaEditor.js +4 -6
- package/dist/cjs/assets/WrappedAssetCard/AssetCardActions.js +19 -21
- package/dist/cjs/assets/WrappedAssetCard/FetchingWrappedAssetCard.js +11 -18
- package/dist/cjs/assets/WrappedAssetCard/WrappedAssetCard.js +11 -20
- package/dist/cjs/assets/WrappedAssetCard/WrappedAssetLink.js +9 -12
- package/dist/cjs/assets/index.js +3 -3
- package/dist/cjs/common/EntityStore.js +32 -51
- package/dist/cjs/common/MultipleReferenceEditor.js +11 -20
- package/dist/cjs/common/ReferenceEditor.js +5 -7
- package/dist/cjs/common/SingleReferenceEditor.js +7 -11
- package/dist/cjs/common/SortableLinkList.js +14 -14
- package/dist/cjs/common/customCardTypes.js +2 -4
- package/dist/cjs/common/queryClient.js +9 -14
- package/dist/cjs/common/useContentTypePermissions.js +1 -3
- package/dist/cjs/common/useEditorPermissions.js +3 -15
- package/dist/cjs/common/useEditorPermissions.spec.js +11 -12
- package/dist/cjs/components/AssetThumbnail/AssetThumbnail.js +3 -5
- package/dist/cjs/components/CreateEntryLinkButton/CreateEntryLinkButton.js +9 -13
- package/dist/cjs/components/CreateEntryLinkButton/CreateEntryLinkButton.spec.js +15 -17
- package/dist/cjs/components/CreateEntryLinkButton/CreateEntryMenuTrigger.js +19 -29
- package/dist/cjs/components/CreateEntryLinkButton/CreateEntryMenuTrigger.spec.js +12 -14
- package/dist/cjs/components/LinkActions/CombinedLinkActions.js +21 -28
- package/dist/cjs/components/LinkActions/LinkActions.js +15 -17
- package/dist/cjs/components/LinkActions/LinkEntityActions.js +17 -26
- package/dist/cjs/components/LinkActions/NoLinkPermissionsInfo.js +3 -5
- package/dist/cjs/components/LinkActions/helpers.js +5 -14
- package/dist/cjs/components/LinkActions/redesignStyles.js +4 -4
- package/dist/cjs/components/LinkActions/styles.js +1 -1
- package/dist/cjs/components/MissingEntityCard/MissingEntityCard.js +9 -11
- package/dist/cjs/components/ResourceEntityErrorCard/ResourceEntityErrorCard.js +4 -6
- package/dist/cjs/components/ResourceEntityErrorCard/UnsupportedEntityCard.js +4 -6
- package/dist/cjs/components/ScheduledIconWithTooltip/ScheduleTooltip.js +8 -10
- package/dist/cjs/components/ScheduledIconWithTooltip/ScheduledIconWithTooltip.js +4 -9
- package/dist/cjs/components/ScheduledIconWithTooltip/formatDateAndTime.js +4 -5
- package/dist/cjs/components/SpaceName/SpaceName.js +8 -11
- package/dist/cjs/components/index.js +12 -12
- package/dist/cjs/entries/MultipleEntryReferenceEditor.js +7 -9
- package/dist/cjs/entries/SingleEntryReferenceEditor.js +5 -7
- package/dist/cjs/entries/WrappedEntryCard/FetchingWrappedEntryCard.js +11 -20
- package/dist/cjs/entries/WrappedEntryCard/WrappedEntryCard.js +17 -23
- package/dist/cjs/entries/index.js +3 -3
- package/dist/cjs/index.js +37 -37
- package/dist/cjs/resources/Cards/ContentfulEntryCard.js +4 -13
- package/dist/cjs/resources/Cards/ResourceCard.js +12 -16
- package/dist/cjs/resources/Cards/ResourceCard.spec.js +17 -20
- package/dist/cjs/resources/MultipleResourceReferenceEditor.js +17 -20
- package/dist/cjs/resources/MultipleResourceReferenceEditor.spec.js +13 -34
- package/dist/cjs/resources/SingleResourceReferenceEditor.js +9 -11
- package/dist/cjs/resources/SingleResourceReferenceEditor.spec.js +6 -13
- package/dist/cjs/resources/testHelpers/resourceEditorHelpers.js +5 -12
- package/dist/cjs/resources/useResourceLinkActions.js +2 -11
- package/dist/cjs/types.js +3 -3
- package/dist/cjs/utils/fromFieldValidations.js +1 -2
- package/dist/cjs/utils/useSortIDs.js +4 -6
- package/dist/esm/__fixtures__/FakeSdk.js +3 -3
- package/dist/esm/assets/MultipleMediaEditor.js +3 -3
- package/dist/esm/assets/SingleMediaEditor.js +2 -2
- package/dist/esm/assets/WrappedAssetCard/AssetCardActions.js +12 -12
- package/dist/esm/assets/WrappedAssetCard/FetchingWrappedAssetCard.js +9 -14
- package/dist/esm/assets/WrappedAssetCard/WrappedAssetCard.js +7 -15
- package/dist/esm/assets/WrappedAssetCard/WrappedAssetLink.js +6 -7
- package/dist/esm/common/EntityStore.js +22 -39
- package/dist/esm/common/MultipleReferenceEditor.js +9 -16
- package/dist/esm/common/ReferenceEditor.js +2 -2
- package/dist/esm/common/SingleReferenceEditor.js +5 -7
- package/dist/esm/common/SortableLinkList.js +12 -12
- package/dist/esm/common/queryClient.js +3 -10
- package/dist/esm/common/useContentTypePermissions.js +1 -3
- package/dist/esm/common/useEditorPermissions.js +3 -15
- package/dist/esm/common/useEditorPermissions.spec.js +11 -12
- package/dist/esm/components/AssetThumbnail/AssetThumbnail.js +1 -1
- package/dist/esm/components/CreateEntryLinkButton/CreateEntryLinkButton.js +5 -7
- package/dist/esm/components/CreateEntryLinkButton/CreateEntryLinkButton.spec.js +12 -12
- package/dist/esm/components/CreateEntryLinkButton/CreateEntryMenuTrigger.js +15 -23
- package/dist/esm/components/CreateEntryLinkButton/CreateEntryMenuTrigger.spec.js +8 -9
- package/dist/esm/components/LinkActions/CombinedLinkActions.js +19 -30
- package/dist/esm/components/LinkActions/LinkActions.js +9 -9
- package/dist/esm/components/LinkActions/LinkEntityActions.js +11 -18
- package/dist/esm/components/LinkActions/NoLinkPermissionsInfo.js +1 -1
- package/dist/esm/components/LinkActions/helpers.js +2 -11
- package/dist/esm/components/MissingEntityCard/MissingEntityCard.js +6 -6
- package/dist/esm/components/ResourceEntityErrorCard/ResourceEntityErrorCard.js +2 -2
- package/dist/esm/components/ResourceEntityErrorCard/UnsupportedEntityCard.js +2 -2
- package/dist/esm/components/ScheduledIconWithTooltip/ScheduleTooltip.js +3 -3
- package/dist/esm/components/ScheduledIconWithTooltip/ScheduledIconWithTooltip.js +2 -5
- package/dist/esm/components/ScheduledIconWithTooltip/formatDateAndTime.js +2 -11
- package/dist/esm/components/SpaceName/SpaceName.js +5 -6
- package/dist/esm/entries/MultipleEntryReferenceEditor.js +5 -5
- package/dist/esm/entries/SingleEntryReferenceEditor.js +3 -3
- package/dist/esm/entries/WrappedEntryCard/FetchingWrappedEntryCard.js +8 -15
- package/dist/esm/entries/WrappedEntryCard/WrappedEntryCard.js +14 -18
- package/dist/esm/resources/Cards/ContentfulEntryCard.js +2 -9
- package/dist/esm/resources/Cards/ResourceCard.js +10 -12
- package/dist/esm/resources/Cards/ResourceCard.spec.js +11 -12
- package/dist/esm/resources/MultipleResourceReferenceEditor.js +13 -14
- package/dist/esm/resources/MultipleResourceReferenceEditor.spec.js +11 -30
- package/dist/esm/resources/SingleResourceReferenceEditor.js +6 -6
- package/dist/esm/resources/SingleResourceReferenceEditor.spec.js +4 -9
- package/dist/esm/resources/testHelpers/resourceEditorHelpers.js +2 -9
- package/dist/esm/resources/useResourceLinkActions.js +2 -11
- package/dist/esm/utils/fromFieldValidations.js +0 -1
- package/dist/esm/utils/useSortIDs.js +2 -2
- package/dist/types/assets/MultipleMediaEditor.d.ts +2 -2
- package/dist/types/assets/SingleMediaEditor.d.ts +2 -2
- package/dist/types/assets/WrappedAssetCard/AssetCardActions.d.ts +3 -3
- package/dist/types/assets/WrappedAssetCard/FetchingWrappedAssetCard.d.ts +2 -2
- package/dist/types/assets/WrappedAssetCard/WrappedAssetCard.d.ts +2 -2
- package/dist/types/assets/WrappedAssetCard/WrappedAssetLink.d.ts +2 -2
- package/dist/types/common/EntityStore.d.ts +1 -1
- package/dist/types/common/MultipleReferenceEditor.d.ts +1 -1
- package/dist/types/common/ReferenceEditor.d.ts +1 -1
- package/dist/types/common/SingleReferenceEditor.d.ts +1 -1
- package/dist/types/common/SortableLinkList.d.ts +1 -1
- package/dist/types/common/queryClient.d.ts +1 -1
- package/dist/types/components/AssetThumbnail/AssetThumbnail.d.ts +2 -2
- package/dist/types/components/CreateEntryLinkButton/CreateEntryLinkButton.d.ts +1 -1
- package/dist/types/components/CreateEntryLinkButton/CreateEntryMenuTrigger.d.ts +1 -1
- package/dist/types/components/LinkActions/CombinedLinkActions.d.ts +2 -2
- package/dist/types/components/LinkActions/LinkActions.d.ts +1 -1
- package/dist/types/components/LinkActions/LinkEntityActions.d.ts +2 -2
- package/dist/types/components/LinkActions/NoLinkPermissionsInfo.d.ts +2 -2
- package/dist/types/components/MissingEntityCard/MissingEntityCard.d.ts +2 -2
- package/dist/types/components/ResourceEntityErrorCard/ResourceEntityErrorCard.d.ts +2 -2
- package/dist/types/components/ResourceEntityErrorCard/UnsupportedEntityCard.d.ts +2 -2
- package/dist/types/components/ScheduledIconWithTooltip/ScheduleTooltip.d.ts +1 -1
- package/dist/types/components/ScheduledIconWithTooltip/ScheduledIconWithTooltip.d.ts +1 -1
- package/dist/types/components/SpaceName/SpaceName.d.ts +2 -2
- package/dist/types/entries/MultipleEntryReferenceEditor.d.ts +2 -2
- package/dist/types/entries/SingleEntryReferenceEditor.d.ts +2 -2
- package/dist/types/entries/WrappedEntryCard/FetchingWrappedEntryCard.d.ts +2 -2
- package/dist/types/entries/WrappedEntryCard/WrappedEntryCard.d.ts +1 -1
- package/dist/types/resources/Cards/ContentfulEntryCard.d.ts +2 -2
- package/dist/types/resources/Cards/ResourceCard.d.ts +2 -2
- package/dist/types/resources/MultipleResourceReferenceEditor.d.ts +2 -2
- package/dist/types/resources/SingleResourceReferenceEditor.d.ts +2 -2
- package/package.json +7 -4
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "ScheduledIconWithTooltip", {
|
|
|
8
8
|
return ScheduledIconWithTooltip;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _react =
|
|
11
|
+
const _react = _interop_require_wildcard(require("react"));
|
|
12
12
|
const _ScheduleTooltip = require("./ScheduleTooltip");
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) {
|
|
14
14
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -31,9 +31,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
31
31
|
if (cache && cache.has(obj)) {
|
|
32
32
|
return cache.get(obj);
|
|
33
33
|
}
|
|
34
|
-
var newObj = {
|
|
35
|
-
__proto__: null
|
|
36
|
-
};
|
|
34
|
+
var newObj = {};
|
|
37
35
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
38
36
|
for(var key in obj){
|
|
39
37
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -51,7 +49,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
51
49
|
}
|
|
52
50
|
return newObj;
|
|
53
51
|
}
|
|
54
|
-
const ScheduledIconWithTooltip = ({ entityType, entityId, getEntityScheduledActions, children
|
|
52
|
+
const ScheduledIconWithTooltip = ({ entityType , entityId , getEntityScheduledActions , children })=>{
|
|
55
53
|
const [status, setStatus] = _react.useState({
|
|
56
54
|
type: 'loading'
|
|
57
55
|
});
|
|
@@ -67,9 +65,6 @@ const ScheduledIconWithTooltip = ({ entityType, entityId, getEntityScheduledActi
|
|
|
67
65
|
error: e
|
|
68
66
|
});
|
|
69
67
|
});
|
|
70
|
-
// This should only be ever called once. Following the eslint hint to add used
|
|
71
|
-
// dependencies will cause page freeze (infinite loop)
|
|
72
|
-
// eslint-disable-next-line -- TODO: describe this disable
|
|
73
68
|
}, []);
|
|
74
69
|
if (status.type === 'loading' || status.type === 'error') {
|
|
75
70
|
return null;
|
|
@@ -79,7 +74,7 @@ const ScheduledIconWithTooltip = ({ entityType, entityId, getEntityScheduledActi
|
|
|
79
74
|
return null;
|
|
80
75
|
}
|
|
81
76
|
const mostRelevantJob = jobs[0];
|
|
82
|
-
return
|
|
77
|
+
return _react.createElement(_ScheduleTooltip.ScheduleTooltip, {
|
|
83
78
|
job: mostRelevantJob,
|
|
84
79
|
jobsCount: jobs.length
|
|
85
80
|
}, children);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// eslint-disable-next-line -- TODO: describe this disable no-restricted-imports
|
|
2
1
|
"use strict";
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
3
|
value: true
|
|
@@ -13,14 +12,14 @@ _export(exports, {
|
|
|
13
12
|
formatDate: function() {
|
|
14
13
|
return formatDate;
|
|
15
14
|
},
|
|
16
|
-
formatDateAndTime: function() {
|
|
17
|
-
return formatDateAndTime;
|
|
18
|
-
},
|
|
19
15
|
formatTime: function() {
|
|
20
16
|
return formatTime;
|
|
17
|
+
},
|
|
18
|
+
formatDateAndTime: function() {
|
|
19
|
+
return formatDateAndTime;
|
|
21
20
|
}
|
|
22
21
|
});
|
|
23
|
-
const _moment =
|
|
22
|
+
const _moment = _interop_require_default(require("moment"));
|
|
24
23
|
function _interop_require_default(obj) {
|
|
25
24
|
return obj && obj.__esModule ? obj : {
|
|
26
25
|
default: obj
|
|
@@ -8,10 +8,10 @@ Object.defineProperty(exports, "SpaceName", {
|
|
|
8
8
|
return SpaceName;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _react =
|
|
11
|
+
const _react = _interop_require_wildcard(require("react"));
|
|
12
12
|
const _f36components = require("@contentful/f36-components");
|
|
13
13
|
const _f36icons = require("@contentful/f36-icons");
|
|
14
|
-
const _f36tokens =
|
|
14
|
+
const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
|
|
15
15
|
const _emotion = require("emotion");
|
|
16
16
|
function _interop_require_default(obj) {
|
|
17
17
|
return obj && obj.__esModule ? obj : {
|
|
@@ -39,9 +39,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
39
39
|
if (cache && cache.has(obj)) {
|
|
40
40
|
return cache.get(obj);
|
|
41
41
|
}
|
|
42
|
-
var newObj = {
|
|
43
|
-
__proto__: null
|
|
44
|
-
};
|
|
42
|
+
var newObj = {};
|
|
45
43
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
46
44
|
for(var key in obj){
|
|
47
45
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -77,19 +75,18 @@ const styles = {
|
|
|
77
75
|
function SpaceName(props) {
|
|
78
76
|
let content = `Space: ${props.spaceName}`;
|
|
79
77
|
if (props.environmentName) content += ` (Env.: ${props.environmentName})`;
|
|
80
|
-
return
|
|
78
|
+
return _react.createElement(_f36components.Tooltip, {
|
|
81
79
|
placement: "top",
|
|
82
80
|
as: "div",
|
|
83
81
|
content: content
|
|
84
|
-
},
|
|
82
|
+
}, _react.createElement(_f36components.Flex, {
|
|
85
83
|
alignItems: "center",
|
|
86
|
-
gap: "spacingXs"
|
|
87
|
-
|
|
88
|
-
}, /*#__PURE__*/ _react.createElement(_f36icons.FolderOpenTrimmedIcon, {
|
|
84
|
+
gap: "spacingXs"
|
|
85
|
+
}, _react.createElement(_f36icons.FolderOpenTrimmedIcon, {
|
|
89
86
|
className: styles.spaceIcon,
|
|
90
87
|
size: "tiny",
|
|
91
88
|
"aria-label": "Source space"
|
|
92
|
-
}),
|
|
89
|
+
}), _react.createElement(_f36components.Text, {
|
|
93
90
|
className: styles.spaceName
|
|
94
91
|
}, props.spaceName)));
|
|
95
92
|
}
|
|
@@ -9,32 +9,32 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
AssetThumbnail: function() {
|
|
13
|
-
return _AssetThumbnail.AssetThumbnail;
|
|
14
|
-
},
|
|
15
12
|
CombinedLinkActions: function() {
|
|
16
13
|
return _CombinedLinkActions.CombinedLinkActions;
|
|
17
14
|
},
|
|
18
|
-
|
|
19
|
-
return
|
|
20
|
-
},
|
|
21
|
-
CreateEntryMenuTrigger: function() {
|
|
22
|
-
return _CreateEntryMenuTrigger.CreateEntryMenuTrigger;
|
|
15
|
+
MissingEntityCard: function() {
|
|
16
|
+
return _MissingEntityCard.MissingEntityCard;
|
|
23
17
|
},
|
|
24
18
|
LinkEntityActions: function() {
|
|
25
19
|
return _LinkEntityActions.LinkEntityActions;
|
|
26
20
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
21
|
+
CreateEntryLinkButton: function() {
|
|
22
|
+
return _CreateEntryLinkButton.CreateEntryLinkButton;
|
|
29
23
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
24
|
+
CreateEntryMenuTrigger: function() {
|
|
25
|
+
return _CreateEntryMenuTrigger.CreateEntryMenuTrigger;
|
|
32
26
|
},
|
|
33
27
|
ScheduledIconWithTooltip: function() {
|
|
34
28
|
return _ScheduledIconWithTooltip.ScheduledIconWithTooltip;
|
|
35
29
|
},
|
|
36
30
|
getScheduleTooltipContent: function() {
|
|
37
31
|
return _ScheduleTooltip.getScheduleTooltipContent;
|
|
32
|
+
},
|
|
33
|
+
AssetThumbnail: function() {
|
|
34
|
+
return _AssetThumbnail.AssetThumbnail;
|
|
35
|
+
},
|
|
36
|
+
ResourceEntityErrorCard: function() {
|
|
37
|
+
return _ResourceEntityErrorCard.ResourceEntityErrorCard;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
const _CombinedLinkActions = require("./LinkActions/CombinedLinkActions");
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "MultipleEntryReferenceEditor", {
|
|
|
8
8
|
return MultipleEntryReferenceEditor;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _react =
|
|
11
|
+
const _react = _interop_require_wildcard(require("react"));
|
|
12
12
|
const _sortable = require("@dnd-kit/sortable");
|
|
13
13
|
const _MultipleReferenceEditor = require("../common/MultipleReferenceEditor");
|
|
14
14
|
const _SortableLinkList = require("../common/SortableLinkList");
|
|
@@ -34,9 +34,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
34
34
|
if (cache && cache.has(obj)) {
|
|
35
35
|
return cache.get(obj);
|
|
36
36
|
}
|
|
37
|
-
var newObj = {
|
|
38
|
-
__proto__: null
|
|
39
|
-
};
|
|
37
|
+
var newObj = {};
|
|
40
38
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
41
39
|
for(var key in obj){
|
|
42
40
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -56,20 +54,20 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
56
54
|
}
|
|
57
55
|
function MultipleEntryReferenceEditor(props) {
|
|
58
56
|
const [indexToUpdate, setIndexToUpdate] = _react.useState(undefined);
|
|
59
|
-
const updateBeforeSortStart = ({ index
|
|
57
|
+
const updateBeforeSortStart = ({ index })=>{
|
|
60
58
|
setIndexToUpdate(index);
|
|
61
59
|
};
|
|
62
|
-
return
|
|
60
|
+
return _react.createElement(_MultipleReferenceEditor.MultipleReferenceEditor, {
|
|
63
61
|
...props,
|
|
64
62
|
entityType: "Entry",
|
|
65
63
|
setIndexToUpdate: setIndexToUpdate
|
|
66
|
-
}, (childrenProps)
|
|
64
|
+
}, (childrenProps)=>_react.createElement(_SortableLinkList.SortableLinkList, {
|
|
67
65
|
...childrenProps,
|
|
68
66
|
sortingStrategy: _sortable.verticalListSortingStrategy,
|
|
69
67
|
updateBeforeSortStart: updateBeforeSortStart
|
|
70
|
-
}, ({ items, item, index, isDisabled, DragHandle
|
|
68
|
+
}, ({ items , item , index , isDisabled , DragHandle })=>{
|
|
71
69
|
const lastIndex = items.length - 1;
|
|
72
|
-
return
|
|
70
|
+
return _react.createElement(_FetchingWrappedEntryCard.FetchingWrappedEntryCard, {
|
|
73
71
|
...childrenProps,
|
|
74
72
|
key: `${item.sys.id}-${index}`,
|
|
75
73
|
index: index,
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "SingleEntryReferenceEditor", {
|
|
|
8
8
|
return SingleEntryReferenceEditor;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _react =
|
|
11
|
+
const _react = _interop_require_wildcard(require("react"));
|
|
12
12
|
const _SingleReferenceEditor = require("../common/SingleReferenceEditor");
|
|
13
13
|
const _FetchingWrappedEntryCard = require("./WrappedEntryCard/FetchingWrappedEntryCard");
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) {
|
|
@@ -32,9 +32,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
32
32
|
if (cache && cache.has(obj)) {
|
|
33
33
|
return cache.get(obj);
|
|
34
34
|
}
|
|
35
|
-
var newObj = {
|
|
36
|
-
__proto__: null
|
|
37
|
-
};
|
|
35
|
+
var newObj = {};
|
|
38
36
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
37
|
for(var key in obj){
|
|
40
38
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -53,11 +51,11 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
53
51
|
return newObj;
|
|
54
52
|
}
|
|
55
53
|
function SingleEntryReferenceEditor(props) {
|
|
56
|
-
return
|
|
54
|
+
return _react.createElement(_SingleReferenceEditor.SingleReferenceEditor, {
|
|
57
55
|
...props,
|
|
58
56
|
entityType: "Entry"
|
|
59
|
-
}, ({ allContentTypes, isDisabled, entityId, setValue, renderCustomCard, hasCardRemoveActions, hasCardEditActions
|
|
60
|
-
return
|
|
57
|
+
}, ({ allContentTypes , isDisabled , entityId , setValue , renderCustomCard , hasCardRemoveActions , hasCardEditActions })=>{
|
|
58
|
+
return _react.createElement(_FetchingWrappedEntryCard.FetchingWrappedEntryCard, {
|
|
61
59
|
...props,
|
|
62
60
|
allContentTypes: allContentTypes,
|
|
63
61
|
isDisabled: isDisabled,
|
|
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "FetchingWrappedEntryCard", {
|
|
|
8
8
|
return FetchingWrappedEntryCard;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _react =
|
|
11
|
+
const _react = _interop_require_wildcard(require("react"));
|
|
12
12
|
const _f36components = require("@contentful/f36-components");
|
|
13
|
-
const _get =
|
|
13
|
+
const _get = _interop_require_default(require("lodash/get"));
|
|
14
14
|
const _EntityStore = require("../../common/EntityStore");
|
|
15
15
|
const _components = require("../../components");
|
|
16
16
|
const _WrappedEntryCard = require("./WrappedEntryCard");
|
|
@@ -40,9 +40,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
40
40
|
if (cache && cache.has(obj)) {
|
|
41
41
|
return cache.get(obj);
|
|
42
42
|
}
|
|
43
|
-
var newObj = {
|
|
44
|
-
__proto__: null
|
|
45
|
-
};
|
|
43
|
+
var newObj = {};
|
|
46
44
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
47
45
|
for(var key in obj){
|
|
48
46
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -71,10 +69,7 @@ async function openEntry(sdk, entryId, options) {
|
|
|
71
69
|
});
|
|
72
70
|
slide = result.slide;
|
|
73
71
|
return slide;
|
|
74
|
-
} catch (e) {
|
|
75
|
-
// we don't allow to open multiple bulk editors for performance reasons
|
|
76
|
-
// proceed with a default openEntry
|
|
77
|
-
}
|
|
72
|
+
} catch (e) {}
|
|
78
73
|
}
|
|
79
74
|
const result = await sdk.navigator.openEntry(entryId, {
|
|
80
75
|
slideIn: true
|
|
@@ -83,14 +78,14 @@ async function openEntry(sdk, entryId, options) {
|
|
|
83
78
|
return slide;
|
|
84
79
|
}
|
|
85
80
|
function FetchingWrappedEntryCard(props) {
|
|
86
|
-
const { data: entry, status
|
|
87
|
-
const { getEntityScheduledActions
|
|
81
|
+
const { data: entry , status } = (0, _EntityStore.useEntity)('Entry', props.entryId);
|
|
82
|
+
const { getEntityScheduledActions } = (0, _EntityStore.useEntityLoader)();
|
|
88
83
|
const loadEntityScheduledActions = _react.useCallback(()=>getEntityScheduledActions('Entry', props.entryId), [
|
|
89
84
|
getEntityScheduledActions,
|
|
90
85
|
props.entryId
|
|
91
86
|
]);
|
|
92
87
|
const size = props.viewType === 'link' ? 'small' : 'default';
|
|
93
|
-
const { getEntity
|
|
88
|
+
const { getEntity } = (0, _EntityStore.useEntityLoader)();
|
|
94
89
|
const getAsset = (assetId)=>getEntity('Asset', assetId);
|
|
95
90
|
const onEdit = async ()=>{
|
|
96
91
|
const slide = await openEntry(props.sdk, props.entryId, {
|
|
@@ -121,13 +116,12 @@ function FetchingWrappedEntryCard(props) {
|
|
|
121
116
|
entity: 'Entry'
|
|
122
117
|
});
|
|
123
118
|
}
|
|
124
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
125
119
|
}, [
|
|
126
120
|
entry
|
|
127
121
|
]);
|
|
128
122
|
return _react.useMemo(()=>{
|
|
129
123
|
if (status === 'error') {
|
|
130
|
-
const card =
|
|
124
|
+
const card = _react.createElement(_components.MissingEntityCard, {
|
|
131
125
|
entityType: "Entry",
|
|
132
126
|
isDisabled: props.isDisabled,
|
|
133
127
|
onRemove: onRemoveEntry
|
|
@@ -144,7 +138,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
144
138
|
return card;
|
|
145
139
|
}
|
|
146
140
|
if (status === 'loading') {
|
|
147
|
-
return
|
|
141
|
+
return _react.createElement(_f36components.EntryCard, {
|
|
148
142
|
size: size,
|
|
149
143
|
isLoading: true
|
|
150
144
|
});
|
|
@@ -165,7 +159,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
165
159
|
onMoveBottom: props.onMoveBottom,
|
|
166
160
|
isBeingDragged: props.isBeingDragged
|
|
167
161
|
};
|
|
168
|
-
const { hasCardEditActions, hasCardMoveActions, hasCardRemoveActions
|
|
162
|
+
const { hasCardEditActions , hasCardMoveActions , hasCardRemoveActions } = props;
|
|
169
163
|
function renderDefaultCard(props) {
|
|
170
164
|
const builtinCardProps = {
|
|
171
165
|
...sharedCardProps,
|
|
@@ -178,18 +172,15 @@ function FetchingWrappedEntryCard(props) {
|
|
|
178
172
|
entry: (props?.entity) || sharedCardProps.entity,
|
|
179
173
|
entryUrl: props?.entityUrl || sharedCardProps.entityUrl
|
|
180
174
|
};
|
|
181
|
-
return
|
|
175
|
+
return _react.createElement(_WrappedEntryCard.WrappedEntryCard, builtinCardProps);
|
|
182
176
|
}
|
|
183
177
|
if (props.renderCustomCard) {
|
|
184
|
-
// LinkActionsProps are injected higher SingleReferenceEditor/MultipleReferenceEditor
|
|
185
178
|
const renderedCustomCard = props.renderCustomCard(sharedCardProps, {}, renderDefaultCard);
|
|
186
|
-
// Only `false` indicates to render the original card. E.g. `null` would result in no card.
|
|
187
179
|
if (renderedCustomCard !== false) {
|
|
188
180
|
return renderedCustomCard;
|
|
189
181
|
}
|
|
190
182
|
}
|
|
191
183
|
return renderDefaultCard();
|
|
192
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
193
184
|
}, [
|
|
194
185
|
props,
|
|
195
186
|
status,
|
|
@@ -8,10 +8,10 @@ Object.defineProperty(exports, "WrappedEntryCard", {
|
|
|
8
8
|
return WrappedEntryCard;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _react =
|
|
11
|
+
const _react = _interop_require_wildcard(require("react"));
|
|
12
12
|
const _f36components = require("@contentful/f36-components");
|
|
13
13
|
const _f36icons = require("@contentful/f36-icons");
|
|
14
|
-
const _f36tokens =
|
|
14
|
+
const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
|
|
15
15
|
const _fieldeditorshared = require("@contentful/field-editor-shared");
|
|
16
16
|
const _emotion = require("emotion");
|
|
17
17
|
const _components = require("../../components");
|
|
@@ -42,9 +42,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
42
42
|
if (cache && cache.has(obj)) {
|
|
43
43
|
return cache.get(obj);
|
|
44
44
|
}
|
|
45
|
-
var newObj = {
|
|
46
|
-
__proto__: null
|
|
47
|
-
};
|
|
45
|
+
var newObj = {};
|
|
48
46
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
49
47
|
for(var key in obj){
|
|
50
48
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -62,7 +60,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
62
60
|
}
|
|
63
61
|
return newObj;
|
|
64
62
|
}
|
|
65
|
-
const { getEntryTitle, getEntityDescription, getEntryStatus, getEntryImage
|
|
63
|
+
const { getEntryTitle , getEntityDescription , getEntryStatus , getEntryImage } = _fieldeditorshared.entityHelpers;
|
|
66
64
|
const styles = {
|
|
67
65
|
scheduleIcon: (0, _emotion.css)({
|
|
68
66
|
marginRight: _f36tokens.default.spacing2Xs
|
|
@@ -76,7 +74,7 @@ const defaultProps = {
|
|
|
76
74
|
};
|
|
77
75
|
function WrappedEntryCard(props) {
|
|
78
76
|
const [file, setFile] = _react.useState(null);
|
|
79
|
-
const { contentType
|
|
77
|
+
const { contentType } = props;
|
|
80
78
|
_react.useEffect(()=>{
|
|
81
79
|
if (props.entry) {
|
|
82
80
|
getEntryImage({
|
|
@@ -99,7 +97,7 @@ function WrappedEntryCard(props) {
|
|
|
99
97
|
]);
|
|
100
98
|
const status = getEntryStatus(props.entry?.sys);
|
|
101
99
|
if (status === 'deleted') {
|
|
102
|
-
return
|
|
100
|
+
return _react.createElement(_components.MissingEntityCard, {
|
|
103
101
|
entityType: "Entry",
|
|
104
102
|
isDisabled: props.isDisabled,
|
|
105
103
|
onRemove: props.onRemove
|
|
@@ -118,7 +116,7 @@ function WrappedEntryCard(props) {
|
|
|
118
116
|
localeCode: props.localeCode,
|
|
119
117
|
defaultLocaleCode: props.defaultLocaleCode
|
|
120
118
|
});
|
|
121
|
-
return
|
|
119
|
+
return _react.createElement(_f36components.EntryCard, {
|
|
122
120
|
as: props.entryUrl ? 'a' : 'article',
|
|
123
121
|
href: props.entryUrl,
|
|
124
122
|
title: title,
|
|
@@ -127,58 +125,54 @@ function WrappedEntryCard(props) {
|
|
|
127
125
|
size: props.size,
|
|
128
126
|
isSelected: props.isSelected,
|
|
129
127
|
status: status,
|
|
130
|
-
icon: props.spaceName ?
|
|
128
|
+
icon: props.spaceName ? _react.createElement(_SpaceName.SpaceName, {
|
|
131
129
|
spaceName: props.spaceName,
|
|
132
130
|
environmentName: props.entry.sys.environment.sys.id
|
|
133
|
-
}) :
|
|
131
|
+
}) : _react.createElement(_components.ScheduledIconWithTooltip, {
|
|
134
132
|
getEntityScheduledActions: props.getEntityScheduledActions,
|
|
135
133
|
entityType: "Entry",
|
|
136
134
|
entityId: props.entry.sys.id
|
|
137
|
-
},
|
|
135
|
+
}, _react.createElement(_f36icons.ClockIcon, {
|
|
138
136
|
className: styles.scheduleIcon,
|
|
139
137
|
size: "small",
|
|
140
138
|
variant: "muted",
|
|
141
139
|
testId: "schedule-icon"
|
|
142
140
|
})),
|
|
143
|
-
thumbnailElement: file && (0, _fieldeditorshared.isValidImage)(file) ?
|
|
141
|
+
thumbnailElement: file && (0, _fieldeditorshared.isValidImage)(file) ? _react.createElement(_components.AssetThumbnail, {
|
|
144
142
|
file: file
|
|
145
143
|
}) : undefined,
|
|
146
144
|
dragHandleRender: props.renderDragHandle,
|
|
147
145
|
withDragHandle: !!props.renderDragHandle,
|
|
148
146
|
actions: props.onEdit || props.onRemove ? [
|
|
149
|
-
props.hasCardEditActions && props.onEdit ?
|
|
147
|
+
props.hasCardEditActions && props.onEdit ? _react.createElement(_f36components.MenuItem, {
|
|
150
148
|
key: "edit",
|
|
151
149
|
testId: "edit",
|
|
152
150
|
onClick: ()=>{
|
|
153
151
|
props.onEdit && props.onEdit();
|
|
154
152
|
}
|
|
155
153
|
}, "Edit") : null,
|
|
156
|
-
props.hasCardRemoveActions && props.onRemove ?
|
|
154
|
+
props.hasCardRemoveActions && props.onRemove ? _react.createElement(_f36components.MenuItem, {
|
|
157
155
|
key: "delete",
|
|
158
156
|
testId: "delete",
|
|
159
157
|
onClick: ()=>{
|
|
160
158
|
props.onRemove && props.onRemove();
|
|
161
159
|
}
|
|
162
160
|
}, "Remove") : null,
|
|
163
|
-
props.hasCardMoveActions && (props.onMoveTop || props.onMoveBottom) ?
|
|
161
|
+
props.hasCardMoveActions && (props.onMoveTop || props.onMoveBottom) ? _react.createElement(_f36components.MenuDivider, {
|
|
164
162
|
key: "divider"
|
|
165
163
|
}) : null,
|
|
166
|
-
props.hasCardMoveActions && props.onMoveTop ?
|
|
164
|
+
props.hasCardMoveActions && props.onMoveTop ? _react.createElement(_f36components.MenuItem, {
|
|
167
165
|
key: "move-top",
|
|
168
166
|
onClick: ()=>props.onMoveTop && props.onMoveTop(),
|
|
169
167
|
testId: "move-top"
|
|
170
168
|
}, "Move to top") : null,
|
|
171
|
-
props.hasCardMoveActions && props.onMoveBottom ?
|
|
169
|
+
props.hasCardMoveActions && props.onMoveBottom ? _react.createElement(_f36components.MenuItem, {
|
|
172
170
|
key: "move-bottom",
|
|
173
171
|
onClick: ()=>props.onMoveBottom && props.onMoveBottom(),
|
|
174
172
|
testId: "move-bottom"
|
|
175
173
|
}, "Move to bottom") : null
|
|
176
174
|
].filter((item)=>item) : [],
|
|
177
|
-
onClick:
|
|
178
|
-
// features e.g. pressing ENTER on a card to add a new paragraph
|
|
179
|
-
// underneath. It's crucial not to pass a custom handler when
|
|
180
|
-
// isClickable is disabled which in the case of RT it's.
|
|
181
|
-
props.isClickable ? (e)=>{
|
|
175
|
+
onClick: props.isClickable ? (e)=>{
|
|
182
176
|
e.preventDefault();
|
|
183
177
|
if (props.onClick) return props.onClick(e);
|
|
184
178
|
props.onEdit && props.onEdit();
|
|
@@ -9,12 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
MultipleEntryReferenceEditor: function() {
|
|
13
|
-
return _MultipleEntryReferenceEditor.MultipleEntryReferenceEditor;
|
|
14
|
-
},
|
|
15
12
|
SingleEntryReferenceEditor: function() {
|
|
16
13
|
return _SingleEntryReferenceEditor.SingleEntryReferenceEditor;
|
|
17
14
|
},
|
|
15
|
+
MultipleEntryReferenceEditor: function() {
|
|
16
|
+
return _MultipleEntryReferenceEditor.MultipleEntryReferenceEditor;
|
|
17
|
+
},
|
|
18
18
|
WrappedEntryCard: function() {
|
|
19
19
|
return _WrappedEntryCard.WrappedEntryCard;
|
|
20
20
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -9,71 +9,71 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
AssetThumbnail: function() {
|
|
13
|
-
return _components.AssetThumbnail;
|
|
14
|
-
},
|
|
15
|
-
CombinedLinkActions: function() {
|
|
16
|
-
return _components.CombinedLinkActions;
|
|
17
|
-
},
|
|
18
|
-
CreateEntryLinkButton: function() {
|
|
19
|
-
return _components.CreateEntryLinkButton;
|
|
20
|
-
},
|
|
21
12
|
CreateEntryMenuTrigger: function() {
|
|
22
13
|
return _components.CreateEntryMenuTrigger;
|
|
23
14
|
},
|
|
24
|
-
|
|
25
|
-
return
|
|
26
|
-
},
|
|
27
|
-
EntityProvider: function() {
|
|
28
|
-
return _EntityStore.EntityProvider;
|
|
29
|
-
},
|
|
30
|
-
MissingEntityCard: function() {
|
|
31
|
-
return _components.MissingEntityCard;
|
|
15
|
+
CreateEntryLinkButton: function() {
|
|
16
|
+
return _components.CreateEntryLinkButton;
|
|
32
17
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
18
|
+
getScheduleTooltipContent: function() {
|
|
19
|
+
return _components.getScheduleTooltipContent;
|
|
35
20
|
},
|
|
36
|
-
|
|
37
|
-
return
|
|
21
|
+
ScheduledIconWithTooltip: function() {
|
|
22
|
+
return _components.ScheduledIconWithTooltip;
|
|
38
23
|
},
|
|
39
|
-
|
|
40
|
-
return
|
|
24
|
+
AssetThumbnail: function() {
|
|
25
|
+
return _components.AssetThumbnail;
|
|
41
26
|
},
|
|
42
27
|
ResourceEntityErrorCard: function() {
|
|
43
28
|
return _components.ResourceEntityErrorCard;
|
|
44
29
|
},
|
|
45
|
-
|
|
46
|
-
return _components.
|
|
30
|
+
MissingEntityCard: function() {
|
|
31
|
+
return _components.MissingEntityCard;
|
|
32
|
+
},
|
|
33
|
+
CombinedLinkActions: function() {
|
|
34
|
+
return _components.CombinedLinkActions;
|
|
47
35
|
},
|
|
48
36
|
SingleEntryReferenceEditor: function() {
|
|
49
37
|
return _entries.SingleEntryReferenceEditor;
|
|
50
38
|
},
|
|
39
|
+
MultipleEntryReferenceEditor: function() {
|
|
40
|
+
return _entries.MultipleEntryReferenceEditor;
|
|
41
|
+
},
|
|
42
|
+
WrappedEntryCard: function() {
|
|
43
|
+
return _entries.WrappedEntryCard;
|
|
44
|
+
},
|
|
51
45
|
SingleMediaEditor: function() {
|
|
52
46
|
return _assets.SingleMediaEditor;
|
|
53
47
|
},
|
|
54
|
-
|
|
55
|
-
return
|
|
56
|
-
},
|
|
57
|
-
SortableLinkList: function() {
|
|
58
|
-
return _SortableLinkList.SortableLinkList;
|
|
48
|
+
MultipleMediaEditor: function() {
|
|
49
|
+
return _assets.MultipleMediaEditor;
|
|
59
50
|
},
|
|
60
51
|
WrappedAssetCard: function() {
|
|
61
52
|
return _assets.WrappedAssetCard;
|
|
62
53
|
},
|
|
63
|
-
|
|
64
|
-
return
|
|
65
|
-
},
|
|
66
|
-
getScheduleTooltipContent: function() {
|
|
67
|
-
return _components.getScheduleTooltipContent;
|
|
54
|
+
SortableLinkList: function() {
|
|
55
|
+
return _SortableLinkList.SortableLinkList;
|
|
68
56
|
},
|
|
69
|
-
|
|
70
|
-
return _EntityStore.
|
|
57
|
+
EntityProvider: function() {
|
|
58
|
+
return _EntityStore.EntityProvider;
|
|
71
59
|
},
|
|
72
60
|
useEntityLoader: function() {
|
|
73
61
|
return _EntityStore.useEntityLoader;
|
|
74
62
|
},
|
|
63
|
+
useEntity: function() {
|
|
64
|
+
return _EntityStore.useEntity;
|
|
65
|
+
},
|
|
75
66
|
useResource: function() {
|
|
76
67
|
return _EntityStore.useResource;
|
|
68
|
+
},
|
|
69
|
+
EntityCacheProvider: function() {
|
|
70
|
+
return _queryClient.SharedQueryClientProvider;
|
|
71
|
+
},
|
|
72
|
+
SingleResourceReferenceEditor: function() {
|
|
73
|
+
return _resources.SingleResourceReferenceEditor;
|
|
74
|
+
},
|
|
75
|
+
MultipleResourceReferenceEditor: function() {
|
|
76
|
+
return _resources.MultipleResourceReferenceEditor;
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
const _components = require("./components");
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "ContentfulEntryCard", {
|
|
|
8
8
|
return ContentfulEntryCard;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _react =
|
|
11
|
+
const _react = _interop_require_wildcard(require("react"));
|
|
12
12
|
const _entries = require("../../entries");
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) {
|
|
14
14
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -31,9 +31,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
31
31
|
if (cache && cache.has(obj)) {
|
|
32
32
|
return cache.get(obj);
|
|
33
33
|
}
|
|
34
|
-
var newObj = {
|
|
35
|
-
__proto__: null
|
|
36
|
-
};
|
|
34
|
+
var newObj = {};
|
|
37
35
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
38
36
|
for(var key in obj){
|
|
39
37
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -51,11 +49,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
51
49
|
}
|
|
52
50
|
return newObj;
|
|
53
51
|
}
|
|
54
|
-
// assets are not shown for small cards (which we hardcode currently)
|
|
55
52
|
const resolveAsset = ()=>Promise.resolve();
|
|
56
|
-
// we don't want to show scheduled actions for resources
|
|
57
53
|
const resolveScheduledActions = ()=>Promise.resolve([]);
|
|
58
|
-
function ContentfulEntryCard({ info, isDisabled, renderDragHandle, onRemove, onMoveTop, onMoveBottom, getEntryRouteHref
|
|
54
|
+
function ContentfulEntryCard({ info , isDisabled , renderDragHandle , onRemove , onMoveTop , onMoveBottom , getEntryRouteHref }) {
|
|
59
55
|
const resourceSys = info.resource.sys;
|
|
60
56
|
const spaceId = resourceSys.space.sys.id;
|
|
61
57
|
const environmentId = resourceSys.environment.sys.id;
|
|
@@ -65,19 +61,14 @@ function ContentfulEntryCard({ info, isDisabled, renderDragHandle, onRemove, onM
|
|
|
65
61
|
environmentId,
|
|
66
62
|
entryId
|
|
67
63
|
});
|
|
68
|
-
// TODO: move this into `sdk.navigator.openEntry()`, note that it's signature only include the entry id (not a space or environment)
|
|
69
64
|
const openEntryDetail = ()=>{
|
|
70
65
|
window.open(resourceHref, '_blank', 'noopener,noreferrer');
|
|
71
66
|
};
|
|
72
|
-
return
|
|
67
|
+
return _react.createElement(_entries.WrappedEntryCard, {
|
|
73
68
|
entry: info.resource,
|
|
74
69
|
isDisabled: isDisabled,
|
|
75
70
|
hasCardEditActions: false,
|
|
76
71
|
contentType: info.contentType,
|
|
77
|
-
// we use the default locale from the space the entry belongs to
|
|
78
|
-
// as we assume this gives a more consistent behaviour.
|
|
79
|
-
// locales will inevitably differ from space to space, so it's likely
|
|
80
|
-
// that the current locale does not exist in the "remote" space
|
|
81
72
|
localeCode: info.defaultLocaleCode,
|
|
82
73
|
defaultLocaleCode: info.defaultLocaleCode,
|
|
83
74
|
size: "small",
|