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