@contentful/field-editor-reference 5.18.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 +10 -8
- 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 +5 -5
- 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,13 +8,13 @@ Object.defineProperty(exports, "CombinedLinkActions", {
|
|
|
8
8
|
return CombinedLinkActions;
|
|
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
14
|
const _CreateEntryLinkButton = require("../CreateEntryLinkButton/CreateEntryLinkButton");
|
|
15
15
|
const _LinkActions = require("./LinkActions");
|
|
16
16
|
const _NoLinkPermissionsInfo = require("./NoLinkPermissionsInfo");
|
|
17
|
-
const _redesignStyles = _interop_require_wildcard(require("./redesignStyles"));
|
|
17
|
+
const _redesignStyles = /*#__PURE__*/ _interop_require_wildcard(require("./redesignStyles"));
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) {
|
|
19
19
|
if (typeof WeakMap !== "function") return null;
|
|
20
20
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -36,7 +36,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
36
36
|
if (cache && cache.has(obj)) {
|
|
37
37
|
return cache.get(obj);
|
|
38
38
|
}
|
|
39
|
-
var newObj = {
|
|
39
|
+
var newObj = {
|
|
40
|
+
__proto__: null
|
|
41
|
+
};
|
|
40
42
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
41
43
|
for(var key in obj){
|
|
42
44
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -60,16 +62,19 @@ const testIds = {
|
|
|
60
62
|
};
|
|
61
63
|
function CombinedLinkActions(props) {
|
|
62
64
|
if (props.isFull) {
|
|
63
|
-
return null;
|
|
65
|
+
return null; // Don't render link actions if we reached max allowed links.
|
|
64
66
|
}
|
|
67
|
+
// We don't want to render a spacious container in case there are are already
|
|
68
|
+
// assets linked (in case of entries, always show it) as the border wouldn't be
|
|
69
|
+
// nicely aligned with asset cards.
|
|
65
70
|
const hideEmptyCard = props.entityType === 'Asset' && !props.isEmpty;
|
|
66
|
-
return _react.createElement("div", {
|
|
71
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
67
72
|
className: hideEmptyCard ? '' : _redesignStyles.container
|
|
68
|
-
}, !props.canCreateEntity && !props.canLinkEntity && _react.createElement(_NoLinkPermissionsInfo.NoLinkPermissionsInfo, null), props.entityType === 'Entry' && _react.createElement(CombinedEntryLinkActions, props), props.entityType === 'Asset' && _react.createElement(CombinedAssetLinkActions, props));
|
|
73
|
+
}, !props.canCreateEntity && !props.canLinkEntity && /*#__PURE__*/ _react.createElement(_NoLinkPermissionsInfo.NoLinkPermissionsInfo, null), props.entityType === 'Entry' && /*#__PURE__*/ _react.createElement(CombinedEntryLinkActions, props), props.entityType === 'Asset' && /*#__PURE__*/ _react.createElement(CombinedAssetLinkActions, props));
|
|
69
74
|
}
|
|
70
75
|
function CombinedEntryLinkActions(props) {
|
|
71
76
|
if (props.canCreateEntity) {
|
|
72
|
-
return _react.createElement(_CreateEntryLinkButton.CreateEntryLinkButton, {
|
|
77
|
+
return /*#__PURE__*/ _react.createElement(_CreateEntryLinkButton.CreateEntryLinkButton, {
|
|
73
78
|
testId: testIds.actionsWrapper,
|
|
74
79
|
disabled: props.isDisabled,
|
|
75
80
|
text: props.combinedActionsLabel || 'Add content',
|
|
@@ -82,7 +87,7 @@ function CombinedEntryLinkActions(props) {
|
|
|
82
87
|
onSelect: (contentTypeId)=>{
|
|
83
88
|
return contentTypeId ? props.onCreate(contentTypeId) : Promise.resolve();
|
|
84
89
|
},
|
|
85
|
-
customDropdownItems: props.canLinkEntity ? _react.createElement(_f36components.Menu.Item, {
|
|
90
|
+
customDropdownItems: props.canLinkEntity ? /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
|
|
86
91
|
testId: testIds.linkExisting,
|
|
87
92
|
onClick: ()=>{
|
|
88
93
|
props.onLinkExisting();
|
|
@@ -90,7 +95,7 @@ function CombinedEntryLinkActions(props) {
|
|
|
90
95
|
}, "Add existing content") : undefined
|
|
91
96
|
});
|
|
92
97
|
} else if (props.canLinkEntity) {
|
|
93
|
-
return _react.createElement(_f36components.Button, {
|
|
98
|
+
return /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
94
99
|
isDisabled: props.isDisabled,
|
|
95
100
|
testId: testIds.linkExisting,
|
|
96
101
|
className: _redesignStyles.action,
|
|
@@ -98,7 +103,7 @@ function CombinedEntryLinkActions(props) {
|
|
|
98
103
|
props.onLinkExisting();
|
|
99
104
|
},
|
|
100
105
|
variant: "secondary",
|
|
101
|
-
startIcon: _react.createElement(_f36icons.LinkIcon, null),
|
|
106
|
+
startIcon: /*#__PURE__*/ _react.createElement(_f36icons.LinkIcon, null),
|
|
102
107
|
size: "small"
|
|
103
108
|
}, "Add existing content");
|
|
104
109
|
}
|
|
@@ -108,7 +113,7 @@ function CombinedAssetLinkActions(props) {
|
|
|
108
113
|
const [isOpen, setOpen] = _react.useState(false);
|
|
109
114
|
if (!props.canLinkEntity || !props.canCreateEntity) {
|
|
110
115
|
if (props.canLinkEntity) {
|
|
111
|
-
return _react.createElement(_f36components.Button, {
|
|
116
|
+
return /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
112
117
|
isDisabled: props.isDisabled,
|
|
113
118
|
testId: testIds.linkExisting,
|
|
114
119
|
className: _redesignStyles.action,
|
|
@@ -116,12 +121,12 @@ function CombinedAssetLinkActions(props) {
|
|
|
116
121
|
props.onLinkExisting();
|
|
117
122
|
},
|
|
118
123
|
variant: "secondary",
|
|
119
|
-
startIcon: _react.createElement(_f36icons.PlusIcon, null),
|
|
124
|
+
startIcon: /*#__PURE__*/ _react.createElement(_f36icons.PlusIcon, null),
|
|
120
125
|
size: "small"
|
|
121
126
|
}, "Add existing media");
|
|
122
127
|
}
|
|
123
128
|
if (props.canCreateEntity) {
|
|
124
|
-
return _react.createElement(_f36components.Button, {
|
|
129
|
+
return /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
125
130
|
isDisabled: props.isDisabled,
|
|
126
131
|
testId: testIds.createAndLink,
|
|
127
132
|
className: _redesignStyles.action,
|
|
@@ -129,13 +134,15 @@ function CombinedAssetLinkActions(props) {
|
|
|
129
134
|
props.onCreate();
|
|
130
135
|
},
|
|
131
136
|
variant: "secondary",
|
|
132
|
-
startIcon: _react.createElement(_f36icons.PlusIcon, null),
|
|
137
|
+
startIcon: /*#__PURE__*/ _react.createElement(_f36icons.PlusIcon, null),
|
|
133
138
|
size: "small"
|
|
134
139
|
}, "Add media");
|
|
135
140
|
}
|
|
136
141
|
return null;
|
|
137
142
|
}
|
|
138
|
-
|
|
143
|
+
// TODO: If we fully switch to this new layout, make a more generic `CreateEntityLinkButton`
|
|
144
|
+
// that works without content types to cover asset use-case.
|
|
145
|
+
return /*#__PURE__*/ _react.createElement(_f36components.Menu, {
|
|
139
146
|
isOpen: isOpen,
|
|
140
147
|
onClose: ()=>{
|
|
141
148
|
setOpen(false);
|
|
@@ -143,22 +150,22 @@ function CombinedAssetLinkActions(props) {
|
|
|
143
150
|
onOpen: ()=>{
|
|
144
151
|
setOpen(true);
|
|
145
152
|
}
|
|
146
|
-
}, _react.createElement(_f36components.Menu.Trigger, null, _react.createElement(_f36components.Button, {
|
|
147
|
-
endIcon: _react.createElement(_f36icons.ChevronDownIcon, null),
|
|
153
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.Menu.Trigger, null, /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
154
|
+
endIcon: /*#__PURE__*/ _react.createElement(_f36icons.ChevronDownIcon, null),
|
|
148
155
|
isDisabled: props.isDisabled,
|
|
149
156
|
testId: testIds.actionsWrapper,
|
|
150
157
|
className: _redesignStyles.action,
|
|
151
158
|
variant: "secondary",
|
|
152
|
-
startIcon: _react.createElement(_f36icons.PlusIcon, null),
|
|
159
|
+
startIcon: /*#__PURE__*/ _react.createElement(_f36icons.PlusIcon, null),
|
|
153
160
|
size: "small"
|
|
154
|
-
}, "Add media")), isOpen && _react.createElement(_f36components.Menu.List, {
|
|
161
|
+
}, "Add media")), isOpen && /*#__PURE__*/ _react.createElement(_f36components.Menu.List, {
|
|
155
162
|
testId: testIds.dropdown
|
|
156
|
-
}, _react.createElement(_f36components.Menu.Item, {
|
|
163
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
|
|
157
164
|
testId: testIds.linkExisting,
|
|
158
165
|
onClick: ()=>{
|
|
159
166
|
props.onLinkExisting();
|
|
160
167
|
}
|
|
161
|
-
}, "Add existing media"), _react.createElement(_f36components.Menu.Item, {
|
|
168
|
+
}, "Add existing media"), /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
|
|
162
169
|
testId: testIds.createAndLink,
|
|
163
170
|
onClick: ()=>{
|
|
164
171
|
props.onCreate();
|
|
@@ -9,19 +9,19 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
testIds: function() {
|
|
13
|
-
return testIds;
|
|
14
|
-
},
|
|
15
12
|
LinkActions: function() {
|
|
16
13
|
return LinkActions;
|
|
14
|
+
},
|
|
15
|
+
testIds: function() {
|
|
16
|
+
return testIds;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
const _react = _interop_require_wildcard(require("react"));
|
|
19
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
20
20
|
const _f36components = require("@contentful/f36-components");
|
|
21
21
|
const _f36icons = require("@contentful/f36-icons");
|
|
22
22
|
const _CreateEntryLinkButton = require("../CreateEntryLinkButton/CreateEntryLinkButton");
|
|
23
23
|
const _NoLinkPermissionsInfo = require("./NoLinkPermissionsInfo");
|
|
24
|
-
const _styles = _interop_require_wildcard(require("./styles"));
|
|
24
|
+
const _styles = /*#__PURE__*/ _interop_require_wildcard(require("./styles"));
|
|
25
25
|
function _getRequireWildcardCache(nodeInterop) {
|
|
26
26
|
if (typeof WeakMap !== "function") return null;
|
|
27
27
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -43,7 +43,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
43
43
|
if (cache && cache.has(obj)) {
|
|
44
44
|
return cache.get(obj);
|
|
45
45
|
}
|
|
46
|
-
var newObj = {
|
|
46
|
+
var newObj = {
|
|
47
|
+
__proto__: null
|
|
48
|
+
};
|
|
47
49
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
48
50
|
for(var key in obj){
|
|
49
51
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -77,16 +79,16 @@ const testIds = {
|
|
|
77
79
|
};
|
|
78
80
|
function LinkActions(props) {
|
|
79
81
|
if (props.isFull) {
|
|
80
|
-
return null;
|
|
82
|
+
return null; // Don't render link actions if we reached max allowed links.
|
|
81
83
|
}
|
|
82
84
|
const defaultLabels = props.entityType === 'Entry' ? defaultEntryLabels : defaultAssetLabels;
|
|
83
85
|
const labels = {
|
|
84
86
|
...defaultLabels,
|
|
85
87
|
...props.actionLabels
|
|
86
88
|
};
|
|
87
|
-
return _react.createElement("div", {
|
|
89
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
88
90
|
className: _styles.container
|
|
89
|
-
}, props.canCreateEntity && _react.createElement(_react.Fragment, null, props.entityType === 'Entry' && _react.createElement(_CreateEntryLinkButton.CreateEntryLinkButton, {
|
|
91
|
+
}, props.canCreateEntity && /*#__PURE__*/ _react.createElement(_react.Fragment, null, props.entityType === 'Entry' && /*#__PURE__*/ _react.createElement(_CreateEntryLinkButton.CreateEntryLinkButton, {
|
|
90
92
|
testId: testIds.createAndLink,
|
|
91
93
|
disabled: props.isDisabled,
|
|
92
94
|
text: labels.createNew({
|
|
@@ -97,27 +99,27 @@ function LinkActions(props) {
|
|
|
97
99
|
onSelect: (contentTypeId)=>{
|
|
98
100
|
return contentTypeId ? props.onCreate(contentTypeId, props.itemsLength) : Promise.resolve();
|
|
99
101
|
}
|
|
100
|
-
}), props.entityType === 'Asset' && _react.createElement(_f36components.Button, {
|
|
102
|
+
}), props.entityType === 'Asset' && /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
101
103
|
isDisabled: props.isDisabled,
|
|
102
104
|
testId: testIds.createAndLink,
|
|
103
105
|
onClick: ()=>{
|
|
104
106
|
props.onCreate(undefined, props.itemsLength);
|
|
105
107
|
},
|
|
106
108
|
variant: "secondary",
|
|
107
|
-
startIcon: _react.createElement(_f36icons.PlusIcon, null),
|
|
109
|
+
startIcon: /*#__PURE__*/ _react.createElement(_f36icons.PlusIcon, null),
|
|
108
110
|
size: "small"
|
|
109
|
-
}, labels.createNew()), _react.createElement("span", {
|
|
111
|
+
}, labels.createNew()), /*#__PURE__*/ _react.createElement("span", {
|
|
110
112
|
className: _styles.separator
|
|
111
|
-
})), props.canLinkEntity && _react.createElement(_f36components.Button, {
|
|
113
|
+
})), props.canLinkEntity && /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
112
114
|
isDisabled: props.isDisabled,
|
|
113
115
|
testId: testIds.linkExisting,
|
|
114
116
|
onClick: ()=>{
|
|
115
117
|
props.onLinkExisting();
|
|
116
118
|
},
|
|
117
119
|
variant: "secondary",
|
|
118
|
-
startIcon: _react.createElement(_f36icons.LinkIcon, null),
|
|
120
|
+
startIcon: /*#__PURE__*/ _react.createElement(_f36icons.LinkIcon, null),
|
|
119
121
|
size: "small"
|
|
120
122
|
}, labels.linkExisting({
|
|
121
123
|
canLinkMultiple: props.canLinkMultiple
|
|
122
|
-
})), !props.canCreateEntity && !props.canLinkEntity && _react.createElement(_NoLinkPermissionsInfo.NoLinkPermissionsInfo, null));
|
|
124
|
+
})), !props.canCreateEntity && !props.canLinkEntity && /*#__PURE__*/ _react.createElement(_NoLinkPermissionsInfo.NoLinkPermissionsInfo, null));
|
|
123
125
|
}
|
|
@@ -9,17 +9,17 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
12
|
+
CombinedLinkEntityActions: function() {
|
|
13
|
+
return CombinedLinkEntityActions;
|
|
14
14
|
},
|
|
15
15
|
LinkEntityActions: function() {
|
|
16
16
|
return LinkEntityActions;
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
return
|
|
18
|
+
useLinkActionsProps: function() {
|
|
19
|
+
return useLinkActionsProps;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
const _react = _interop_require_wildcard(require("react"));
|
|
22
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
23
23
|
const _CombinedLinkActions = require("./CombinedLinkActions");
|
|
24
24
|
const _helpers = require("./helpers");
|
|
25
25
|
const _LinkActions = require("./LinkActions");
|
|
@@ -44,7 +44,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
44
44
|
if (cache && cache.has(obj)) {
|
|
45
45
|
return cache.get(obj);
|
|
46
46
|
}
|
|
47
|
-
var newObj = {
|
|
47
|
+
var newObj = {
|
|
48
|
+
__proto__: null
|
|
49
|
+
};
|
|
48
50
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
49
51
|
for(var key in obj){
|
|
50
52
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -63,7 +65,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
63
65
|
return newObj;
|
|
64
66
|
}
|
|
65
67
|
function useLinkActionsProps(props) {
|
|
66
|
-
const { sdk
|
|
68
|
+
const { sdk, editorPermissions, entityType, canLinkMultiple, isDisabled, actionLabels, itemsLength } = props;
|
|
67
69
|
const maxLinksCount = editorPermissions.validations.numberOfLinks?.max;
|
|
68
70
|
const value = sdk.field.getValue();
|
|
69
71
|
const linkCount = Array.isArray(value) ? value.length : value ? 1 : 0;
|
|
@@ -78,7 +80,8 @@ function useLinkActionsProps(props) {
|
|
|
78
80
|
slide,
|
|
79
81
|
index
|
|
80
82
|
});
|
|
81
|
-
},
|
|
83
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
84
|
+
[
|
|
82
85
|
entityType,
|
|
83
86
|
props.onCreate,
|
|
84
87
|
props.onAction
|
|
@@ -93,13 +96,14 @@ function useLinkActionsProps(props) {
|
|
|
93
96
|
index: index === undefined ? undefined : index + i
|
|
94
97
|
});
|
|
95
98
|
});
|
|
96
|
-
},
|
|
99
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
100
|
+
[
|
|
97
101
|
entityType,
|
|
98
102
|
props.onLink,
|
|
99
103
|
props.onAction
|
|
100
104
|
]);
|
|
101
105
|
const onCreate = _react.useCallback(async (contentTypeId, index)=>{
|
|
102
|
-
const { entity
|
|
106
|
+
const { entity, slide } = await (0, _helpers.createEntity)({
|
|
103
107
|
sdk,
|
|
104
108
|
entityType,
|
|
105
109
|
contentTypeId
|
|
@@ -125,7 +129,8 @@ function useLinkActionsProps(props) {
|
|
|
125
129
|
onLinkedExisting([
|
|
126
130
|
entity
|
|
127
131
|
], index);
|
|
128
|
-
},
|
|
132
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
133
|
+
[
|
|
129
134
|
sdk,
|
|
130
135
|
entityType,
|
|
131
136
|
onLinkedExisting
|
|
@@ -140,11 +145,13 @@ function useLinkActionsProps(props) {
|
|
|
140
145
|
return;
|
|
141
146
|
}
|
|
142
147
|
onLinkedExisting(entities, index);
|
|
143
|
-
},
|
|
148
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
149
|
+
[
|
|
144
150
|
sdk,
|
|
145
151
|
entityType,
|
|
146
152
|
onLinkedExisting
|
|
147
153
|
]);
|
|
154
|
+
// FIXME: The memoization might rerun every time due to the always changing callback identities above
|
|
148
155
|
return (0, _react.useMemo)(()=>({
|
|
149
156
|
entityType,
|
|
150
157
|
canLinkMultiple,
|
|
@@ -160,7 +167,8 @@ function useLinkActionsProps(props) {
|
|
|
160
167
|
onCreated,
|
|
161
168
|
onLinkedExisting,
|
|
162
169
|
itemsLength
|
|
163
|
-
}),
|
|
170
|
+
}), // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
171
|
+
[
|
|
164
172
|
entityType,
|
|
165
173
|
canLinkMultiple,
|
|
166
174
|
isDisabled,
|
|
@@ -169,6 +177,7 @@ function useLinkActionsProps(props) {
|
|
|
169
177
|
editorPermissions.canCreateEntity,
|
|
170
178
|
editorPermissions.canLinkEntity,
|
|
171
179
|
actionLabels,
|
|
180
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
172
181
|
editorPermissions.creatableContentTypes.map((ct)=>ct.sys.id).join(':'),
|
|
173
182
|
onCreate,
|
|
174
183
|
onLinkExisting,
|
|
@@ -178,9 +187,9 @@ function useLinkActionsProps(props) {
|
|
|
178
187
|
itemsLength
|
|
179
188
|
]);
|
|
180
189
|
}
|
|
181
|
-
function LinkEntityActions({ renderCustomActions
|
|
182
|
-
return renderCustomActions ? renderCustomActions(props) : _react.createElement(_LinkActions.LinkActions, props);
|
|
190
|
+
function LinkEntityActions({ renderCustomActions, ...props }) {
|
|
191
|
+
return renderCustomActions ? renderCustomActions(props) : /*#__PURE__*/ _react.createElement(_LinkActions.LinkActions, props);
|
|
183
192
|
}
|
|
184
|
-
function CombinedLinkEntityActions({ renderCustomActions
|
|
185
|
-
return renderCustomActions ? renderCustomActions(props) : _react.createElement(_CombinedLinkActions.CombinedLinkActions, props);
|
|
193
|
+
function CombinedLinkEntityActions({ renderCustomActions, ...props }) {
|
|
194
|
+
return renderCustomActions ? renderCustomActions(props) : /*#__PURE__*/ _react.createElement(_CombinedLinkActions.CombinedLinkActions, props);
|
|
186
195
|
}
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "NoLinkPermissionsInfo", {
|
|
|
8
8
|
return NoLinkPermissionsInfo;
|
|
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
|
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)) {
|
|
@@ -50,5 +52,5 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
50
52
|
return newObj;
|
|
51
53
|
}
|
|
52
54
|
function NoLinkPermissionsInfo() {
|
|
53
|
-
return _react.createElement(_f36components.Paragraph, null, "You don't have permission to view this content or this field is not correctly configured. Contact your administrator for help.");
|
|
55
|
+
return /*#__PURE__*/ _react.createElement(_f36components.Paragraph, null, "You don't have permission to view this content or this field is not correctly configured. Contact your administrator for help.");
|
|
54
56
|
}
|
|
@@ -12,11 +12,11 @@ _export(exports, {
|
|
|
12
12
|
createEntity: function() {
|
|
13
13
|
return createEntity;
|
|
14
14
|
},
|
|
15
|
-
selectSingleEntity: function() {
|
|
16
|
-
return selectSingleEntity;
|
|
17
|
-
},
|
|
18
15
|
selectMultipleEntities: function() {
|
|
19
16
|
return selectMultipleEntities;
|
|
17
|
+
},
|
|
18
|
+
selectSingleEntity: function() {
|
|
19
|
+
return selectSingleEntity;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
const getContentTypeIds = (contentTypes)=>contentTypes.map((ct)=>ct.sys.id);
|
|
@@ -25,7 +25,7 @@ async function createEntity(props) {
|
|
|
25
25
|
if (!props.contentTypeId) {
|
|
26
26
|
return {};
|
|
27
27
|
}
|
|
28
|
-
const { entity
|
|
28
|
+
const { entity, slide } = await props.sdk.navigator.openNewEntry(props.contentTypeId, {
|
|
29
29
|
slideIn: true
|
|
30
30
|
});
|
|
31
31
|
return {
|
|
@@ -33,7 +33,7 @@ async function createEntity(props) {
|
|
|
33
33
|
slide
|
|
34
34
|
};
|
|
35
35
|
} else {
|
|
36
|
-
const { entity
|
|
36
|
+
const { entity, slide } = await props.sdk.navigator.openNewAsset({
|
|
37
37
|
slideIn: true
|
|
38
38
|
});
|
|
39
39
|
return {
|
|
@@ -58,7 +58,12 @@ async function selectSingleEntity(props) {
|
|
|
58
58
|
async function selectMultipleEntities(props) {
|
|
59
59
|
const value = props.sdk.field.getValue();
|
|
60
60
|
const linkCount = Array.isArray(value) ? value.length : value ? 1 : 0;
|
|
61
|
+
// TODO: Why not always set `min: 1` by default? Does it make sense to enforce
|
|
62
|
+
// user to select as many entities as the field's "min" requires? What if e.g.
|
|
63
|
+
// "min" is 4 and the user wants to insert 2 entities first, then create 2 new ones?
|
|
61
64
|
const min = Math.max((props.editorPermissions.validations.numberOfLinks?.min || 1) - linkCount, 1);
|
|
65
|
+
// TODO: Consider same for max. If e.g. "max" is 4, we disable the button if the
|
|
66
|
+
// user wants to select 5 but we show no information why the button is disabled.
|
|
62
67
|
const max = (props.editorPermissions.validations.numberOfLinks?.max || +Infinity) - linkCount;
|
|
63
68
|
if (props.entityType === 'Entry') {
|
|
64
69
|
return await props.sdk.dialogs.selectMultipleEntries({
|
|
@@ -9,17 +9,17 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
container: function() {
|
|
13
|
-
return container;
|
|
14
|
-
},
|
|
15
12
|
action: function() {
|
|
16
13
|
return action;
|
|
17
14
|
},
|
|
18
15
|
chevronIcon: function() {
|
|
19
16
|
return chevronIcon;
|
|
17
|
+
},
|
|
18
|
+
container: function() {
|
|
19
|
+
return container;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
|
|
22
|
+
const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
|
|
23
23
|
const _emotion = require("emotion");
|
|
24
24
|
function _interop_require_default(obj) {
|
|
25
25
|
return obj && obj.__esModule ? obj : {
|
|
@@ -16,7 +16,7 @@ _export(exports, {
|
|
|
16
16
|
return separator;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
|
|
19
|
+
const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
|
|
20
20
|
const _emotion = require("emotion");
|
|
21
21
|
function _interop_require_default(obj) {
|
|
22
22
|
return obj && obj.__esModule ? obj : {
|
|
@@ -8,10 +8,10 @@ Object.defineProperty(exports, "MissingEntityCard", {
|
|
|
8
8
|
return MissingEntityCard;
|
|
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 _styles = _interop_require_wildcard(require("./styles"));
|
|
14
|
+
const _styles = /*#__PURE__*/ _interop_require_wildcard(require("./styles"));
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) {
|
|
16
16
|
if (typeof WeakMap !== "function") return null;
|
|
17
17
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -33,7 +33,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
33
33
|
if (cache && cache.has(obj)) {
|
|
34
34
|
return cache.get(obj);
|
|
35
35
|
}
|
|
36
|
-
var newObj = {
|
|
36
|
+
var newObj = {
|
|
37
|
+
__proto__: null
|
|
38
|
+
};
|
|
37
39
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
38
40
|
for(var key in obj){
|
|
39
41
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -52,20 +54,20 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
52
54
|
return newObj;
|
|
53
55
|
}
|
|
54
56
|
function MissingEntityCard(props) {
|
|
55
|
-
return _react.createElement(_f36components.Card, {
|
|
57
|
+
return /*#__PURE__*/ _react.createElement(_f36components.Card, {
|
|
56
58
|
className: _styles.card,
|
|
57
59
|
testId: "cf-ui-missing-entry-card",
|
|
58
60
|
isSelected: props.isSelected
|
|
59
|
-
}, _react.createElement(_f36components.Flex, {
|
|
61
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.Flex, {
|
|
60
62
|
alignItems: "center",
|
|
61
63
|
justifyContent: "space-between"
|
|
62
|
-
}, _react.createElement("div", {
|
|
64
|
+
}, /*#__PURE__*/ _react.createElement("div", {
|
|
63
65
|
className: props.asSquare ? _styles.squareCard : ''
|
|
64
|
-
}, _react.createElement(_f36components.SectionHeading, {
|
|
66
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.SectionHeading, {
|
|
65
67
|
marginBottom: "none"
|
|
66
|
-
}, props.entityType, " is missing or inaccessible")), !props.isDisabled && props.onRemove && _react.createElement(_f36components.IconButton, {
|
|
68
|
+
}, props.entityType, " is missing or inaccessible")), !props.isDisabled && props.onRemove && /*#__PURE__*/ _react.createElement(_f36components.IconButton, {
|
|
67
69
|
variant: "transparent",
|
|
68
|
-
icon: _react.createElement(_f36icons.CloseIcon, {
|
|
70
|
+
icon: /*#__PURE__*/ _react.createElement(_f36icons.CloseIcon, {
|
|
69
71
|
variant: "muted"
|
|
70
72
|
}),
|
|
71
73
|
"aria-label": "Delete",
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "ResourceEntityErrorCard", {
|
|
|
8
8
|
return ResourceEntityErrorCard;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _react = _interop_require_wildcard(require("react"));
|
|
11
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
12
12
|
const _EntityStore = require("../../common/EntityStore");
|
|
13
13
|
const _MissingEntityCard = require("../MissingEntityCard/MissingEntityCard");
|
|
14
14
|
const _UnsupportedEntityCard = require("./UnsupportedEntityCard");
|
|
@@ -33,7 +33,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
33
33
|
if (cache && cache.has(obj)) {
|
|
34
34
|
return cache.get(obj);
|
|
35
35
|
}
|
|
36
|
-
var newObj = {
|
|
36
|
+
var newObj = {
|
|
37
|
+
__proto__: null
|
|
38
|
+
};
|
|
37
39
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
38
40
|
for(var key in obj){
|
|
39
41
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -53,12 +55,12 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
53
55
|
}
|
|
54
56
|
function ResourceEntityErrorCard(props) {
|
|
55
57
|
if ((0, _EntityStore.isUnsupportedError)(props.error)) {
|
|
56
|
-
return _react.createElement(_UnsupportedEntityCard.UnsupportedEntityCard, {
|
|
58
|
+
return /*#__PURE__*/ _react.createElement(_UnsupportedEntityCard.UnsupportedEntityCard, {
|
|
57
59
|
linkType: props.linkType,
|
|
58
60
|
isSelected: props.isSelected
|
|
59
61
|
});
|
|
60
62
|
}
|
|
61
|
-
return _react.createElement(_MissingEntityCard.MissingEntityCard, {
|
|
63
|
+
return /*#__PURE__*/ _react.createElement(_MissingEntityCard.MissingEntityCard, {
|
|
62
64
|
entityType: "Entry",
|
|
63
65
|
isDisabled: props.isDisabled,
|
|
64
66
|
isSelected: props.isSelected,
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "UnsupportedEntityCard", {
|
|
|
8
8
|
return UnsupportedEntityCard;
|
|
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 _emotion = require("emotion");
|
|
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)) {
|
|
@@ -56,10 +58,10 @@ const styles = {
|
|
|
56
58
|
})
|
|
57
59
|
};
|
|
58
60
|
function UnsupportedEntityCard(props) {
|
|
59
|
-
return _react.createElement(_f36components.Card, {
|
|
61
|
+
return /*#__PURE__*/ _react.createElement(_f36components.Card, {
|
|
60
62
|
className: styles.card,
|
|
61
63
|
isSelected: props.isSelected
|
|
62
|
-
}, _react.createElement(_f36components.SectionHeading, {
|
|
64
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.SectionHeading, {
|
|
63
65
|
marginBottom: "none"
|
|
64
66
|
}, "Resource type ", props.linkType, " is currently not supported"));
|
|
65
67
|
}
|
|
@@ -9,14 +9,14 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
getScheduleTooltipContent: function() {
|
|
13
|
-
return getScheduleTooltipContent;
|
|
14
|
-
},
|
|
15
12
|
ScheduleTooltip: function() {
|
|
16
13
|
return ScheduleTooltip;
|
|
14
|
+
},
|
|
15
|
+
getScheduleTooltipContent: function() {
|
|
16
|
+
return getScheduleTooltipContent;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
const _react = _interop_require_wildcard(require("react"));
|
|
19
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
20
20
|
const _f36components = require("@contentful/f36-components");
|
|
21
21
|
const _formatDateAndTime = require("./formatDateAndTime");
|
|
22
22
|
function _getRequireWildcardCache(nodeInterop) {
|
|
@@ -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)) {
|
|
@@ -58,12 +60,12 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
58
60
|
}
|
|
59
61
|
return newObj;
|
|
60
62
|
}
|
|
61
|
-
const getScheduleTooltipContent = ({ job
|
|
63
|
+
const getScheduleTooltipContent = ({ job, jobsCount })=>{
|
|
62
64
|
return `Will ${job.action.toLowerCase()} ${(0, _formatDateAndTime.formatDateAndTime)(job.scheduledFor.datetime).toLowerCase()}
|
|
63
65
|
${jobsCount > 1 ? `+ ${jobsCount - 1} more` : ''}`;
|
|
64
66
|
};
|
|
65
|
-
const ScheduleTooltip = ({ job
|
|
66
|
-
return _react.createElement(_f36components.Tooltip, {
|
|
67
|
+
const ScheduleTooltip = ({ job, jobsCount, children })=>{
|
|
68
|
+
return /*#__PURE__*/ _react.createElement(_f36components.Tooltip, {
|
|
67
69
|
placement: "top",
|
|
68
70
|
testId: job.sys.id,
|
|
69
71
|
as: "div",
|