@contentful/field-editor-reference 5.21.2 → 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 +7 -9
- 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 +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 +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
|
@@ -4,12 +4,12 @@ import { MissingEntityCard } from '../MissingEntityCard/MissingEntityCard';
|
|
|
4
4
|
import { UnsupportedEntityCard } from './UnsupportedEntityCard';
|
|
5
5
|
export function ResourceEntityErrorCard(props) {
|
|
6
6
|
if (isUnsupportedError(props.error)) {
|
|
7
|
-
return
|
|
7
|
+
return React.createElement(UnsupportedEntityCard, {
|
|
8
8
|
linkType: props.linkType,
|
|
9
9
|
isSelected: props.isSelected
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return React.createElement(MissingEntityCard, {
|
|
13
13
|
entityType: "Entry",
|
|
14
14
|
isDisabled: props.isDisabled,
|
|
15
15
|
isSelected: props.isSelected,
|
|
@@ -7,10 +7,10 @@ const styles = {
|
|
|
7
7
|
})
|
|
8
8
|
};
|
|
9
9
|
export function UnsupportedEntityCard(props) {
|
|
10
|
-
return
|
|
10
|
+
return React.createElement(Card, {
|
|
11
11
|
className: styles.card,
|
|
12
12
|
isSelected: props.isSelected
|
|
13
|
-
},
|
|
13
|
+
}, React.createElement(SectionHeading, {
|
|
14
14
|
marginBottom: "none"
|
|
15
15
|
}, "Resource type ", props.linkType, " is currently not supported"));
|
|
16
16
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Tooltip } from '@contentful/f36-components';
|
|
3
3
|
import { formatDateAndTime } from './formatDateAndTime';
|
|
4
|
-
export const getScheduleTooltipContent = ({ job, jobsCount
|
|
4
|
+
export const getScheduleTooltipContent = ({ job , jobsCount })=>{
|
|
5
5
|
return `Will ${job.action.toLowerCase()} ${formatDateAndTime(job.scheduledFor.datetime).toLowerCase()}
|
|
6
6
|
${jobsCount > 1 ? `+ ${jobsCount - 1} more` : ''}`;
|
|
7
7
|
};
|
|
8
|
-
export const ScheduleTooltip = ({ job, jobsCount, children
|
|
9
|
-
return
|
|
8
|
+
export const ScheduleTooltip = ({ job , jobsCount , children })=>{
|
|
9
|
+
return React.createElement(Tooltip, {
|
|
10
10
|
placement: "top",
|
|
11
11
|
testId: job.sys.id,
|
|
12
12
|
as: "div",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ScheduleTooltip } from './ScheduleTooltip';
|
|
3
|
-
export const ScheduledIconWithTooltip = ({ entityType, entityId, getEntityScheduledActions, children
|
|
3
|
+
export const ScheduledIconWithTooltip = ({ entityType , entityId , getEntityScheduledActions , children })=>{
|
|
4
4
|
const [status, setStatus] = React.useState({
|
|
5
5
|
type: 'loading'
|
|
6
6
|
});
|
|
@@ -16,9 +16,6 @@ export const ScheduledIconWithTooltip = ({ entityType, entityId, getEntitySchedu
|
|
|
16
16
|
error: e
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
|
-
// This should only be ever called once. Following the eslint hint to add used
|
|
20
|
-
// dependencies will cause page freeze (infinite loop)
|
|
21
|
-
// eslint-disable-next-line -- TODO: describe this disable
|
|
22
19
|
}, []);
|
|
23
20
|
if (status.type === 'loading' || status.type === 'error') {
|
|
24
21
|
return null;
|
|
@@ -28,7 +25,7 @@ export const ScheduledIconWithTooltip = ({ entityType, entityId, getEntitySchedu
|
|
|
28
25
|
return null;
|
|
29
26
|
}
|
|
30
27
|
const mostRelevantJob = jobs[0];
|
|
31
|
-
return
|
|
28
|
+
return React.createElement(ScheduleTooltip, {
|
|
32
29
|
job: mostRelevantJob,
|
|
33
30
|
jobsCount: jobs.length
|
|
34
31
|
}, children);
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
// eslint-disable-next-line -- TODO: describe this disable no-restricted-imports
|
|
2
1
|
import moment from 'moment';
|
|
3
|
-
|
|
4
|
-
* @param {Date|string} date A valid constructor argument for moment()
|
|
5
|
-
* @param {boolean=} short Render only Today/Tomorrow/Yesterday if valid. Defaults to false
|
|
6
|
-
*/ export const formatDate = (date, short)=>{
|
|
2
|
+
export const formatDate = (date, short)=>{
|
|
7
3
|
switch(moment().startOf('day').diff(moment(date).startOf('day'), 'days')){
|
|
8
4
|
case 0:
|
|
9
5
|
return short ? 'Today' : `Today, ${moment(date).format('DD MMM YYYY')}`;
|
|
@@ -15,12 +11,7 @@ import moment from 'moment';
|
|
|
15
11
|
return moment(date).format('ddd, DD MMM YYYY');
|
|
16
12
|
}
|
|
17
13
|
};
|
|
18
|
-
|
|
19
|
-
* Returns the time portion of a date in the local time in the format H:MM AM/PM
|
|
20
|
-
*
|
|
21
|
-
* == Examples
|
|
22
|
-
* * `T15:36:45.000Z` => 3:36 PM (if in +0:00 offset)
|
|
23
|
-
*/ export const formatTime = (date)=>{
|
|
14
|
+
export const formatTime = (date)=>{
|
|
24
15
|
return moment.utc(date).local().format('h:mm A');
|
|
25
16
|
};
|
|
26
17
|
export const formatDateAndTime = (date, short)=>{
|
|
@@ -21,18 +21,18 @@ const styles = {
|
|
|
21
21
|
export function SpaceName(props) {
|
|
22
22
|
let content = `Space: ${props.spaceName}`;
|
|
23
23
|
if (props.environmentName) content += ` (Env.: ${props.environmentName})`;
|
|
24
|
-
return
|
|
24
|
+
return React.createElement(Tooltip, {
|
|
25
25
|
placement: "top",
|
|
26
26
|
as: "div",
|
|
27
27
|
content: content
|
|
28
|
-
},
|
|
28
|
+
}, React.createElement(Flex, {
|
|
29
29
|
alignItems: "center",
|
|
30
30
|
gap: "spacingXs"
|
|
31
|
-
},
|
|
31
|
+
}, React.createElement(FolderOpenTrimmedIcon, {
|
|
32
32
|
className: styles.spaceIcon,
|
|
33
33
|
size: "tiny",
|
|
34
34
|
"aria-label": "Source space"
|
|
35
|
-
}),
|
|
35
|
+
}), React.createElement(Text, {
|
|
36
36
|
className: styles.spaceName
|
|
37
37
|
}, props.spaceName)));
|
|
38
38
|
}
|
|
@@ -5,20 +5,20 @@ import { SortableLinkList } from '../common/SortableLinkList';
|
|
|
5
5
|
import { FetchingWrappedEntryCard } from './WrappedEntryCard/FetchingWrappedEntryCard';
|
|
6
6
|
export function MultipleEntryReferenceEditor(props) {
|
|
7
7
|
const [indexToUpdate, setIndexToUpdate] = React.useState(undefined);
|
|
8
|
-
const updateBeforeSortStart = ({ index
|
|
8
|
+
const updateBeforeSortStart = ({ index })=>{
|
|
9
9
|
setIndexToUpdate(index);
|
|
10
10
|
};
|
|
11
|
-
return
|
|
11
|
+
return React.createElement(MultipleReferenceEditor, {
|
|
12
12
|
...props,
|
|
13
13
|
entityType: "Entry",
|
|
14
14
|
setIndexToUpdate: setIndexToUpdate
|
|
15
|
-
}, (childrenProps)
|
|
15
|
+
}, (childrenProps)=>React.createElement(SortableLinkList, {
|
|
16
16
|
...childrenProps,
|
|
17
17
|
sortingStrategy: verticalListSortingStrategy,
|
|
18
18
|
updateBeforeSortStart: updateBeforeSortStart
|
|
19
|
-
}, ({ items, item, index, isDisabled, DragHandle
|
|
19
|
+
}, ({ items , item , index , isDisabled , DragHandle })=>{
|
|
20
20
|
const lastIndex = items.length - 1;
|
|
21
|
-
return
|
|
21
|
+
return React.createElement(FetchingWrappedEntryCard, {
|
|
22
22
|
...childrenProps,
|
|
23
23
|
key: `${item.sys.id}-${index}`,
|
|
24
24
|
index: index,
|
|
@@ -2,11 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
import { SingleReferenceEditor } from '../common/SingleReferenceEditor';
|
|
3
3
|
import { FetchingWrappedEntryCard } from './WrappedEntryCard/FetchingWrappedEntryCard';
|
|
4
4
|
export function SingleEntryReferenceEditor(props) {
|
|
5
|
-
return
|
|
5
|
+
return React.createElement(SingleReferenceEditor, {
|
|
6
6
|
...props,
|
|
7
7
|
entityType: "Entry"
|
|
8
|
-
}, ({ allContentTypes, isDisabled, entityId, setValue, renderCustomCard, hasCardRemoveActions, hasCardEditActions
|
|
9
|
-
return
|
|
8
|
+
}, ({ allContentTypes , isDisabled , entityId , setValue , renderCustomCard , hasCardRemoveActions , hasCardEditActions })=>{
|
|
9
|
+
return React.createElement(FetchingWrappedEntryCard, {
|
|
10
10
|
...props,
|
|
11
11
|
allContentTypes: allContentTypes,
|
|
12
12
|
isDisabled: isDisabled,
|
|
@@ -15,10 +15,7 @@ async function openEntry(sdk, entryId, options) {
|
|
|
15
15
|
});
|
|
16
16
|
slide = result.slide;
|
|
17
17
|
return slide;
|
|
18
|
-
} catch (e) {
|
|
19
|
-
// we don't allow to open multiple bulk editors for performance reasons
|
|
20
|
-
// proceed with a default openEntry
|
|
21
|
-
}
|
|
18
|
+
} catch (e) {}
|
|
22
19
|
}
|
|
23
20
|
const result = await sdk.navigator.openEntry(entryId, {
|
|
24
21
|
slideIn: true
|
|
@@ -27,14 +24,14 @@ async function openEntry(sdk, entryId, options) {
|
|
|
27
24
|
return slide;
|
|
28
25
|
}
|
|
29
26
|
export function FetchingWrappedEntryCard(props) {
|
|
30
|
-
const { data: entry, status
|
|
31
|
-
const { getEntityScheduledActions
|
|
27
|
+
const { data: entry , status } = useEntity('Entry', props.entryId);
|
|
28
|
+
const { getEntityScheduledActions } = useEntityLoader();
|
|
32
29
|
const loadEntityScheduledActions = React.useCallback(()=>getEntityScheduledActions('Entry', props.entryId), [
|
|
33
30
|
getEntityScheduledActions,
|
|
34
31
|
props.entryId
|
|
35
32
|
]);
|
|
36
33
|
const size = props.viewType === 'link' ? 'small' : 'default';
|
|
37
|
-
const { getEntity
|
|
34
|
+
const { getEntity } = useEntityLoader();
|
|
38
35
|
const getAsset = (assetId)=>getEntity('Asset', assetId);
|
|
39
36
|
const onEdit = async ()=>{
|
|
40
37
|
const slide = await openEntry(props.sdk, props.entryId, {
|
|
@@ -65,13 +62,12 @@ export function FetchingWrappedEntryCard(props) {
|
|
|
65
62
|
entity: 'Entry'
|
|
66
63
|
});
|
|
67
64
|
}
|
|
68
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
69
65
|
}, [
|
|
70
66
|
entry
|
|
71
67
|
]);
|
|
72
68
|
return React.useMemo(()=>{
|
|
73
69
|
if (status === 'error') {
|
|
74
|
-
const card =
|
|
70
|
+
const card = React.createElement(MissingEntityCard, {
|
|
75
71
|
entityType: "Entry",
|
|
76
72
|
isDisabled: props.isDisabled,
|
|
77
73
|
onRemove: onRemoveEntry
|
|
@@ -88,7 +84,7 @@ export function FetchingWrappedEntryCard(props) {
|
|
|
88
84
|
return card;
|
|
89
85
|
}
|
|
90
86
|
if (status === 'loading') {
|
|
91
|
-
return
|
|
87
|
+
return React.createElement(EntryCard, {
|
|
92
88
|
size: size,
|
|
93
89
|
isLoading: true
|
|
94
90
|
});
|
|
@@ -109,7 +105,7 @@ export function FetchingWrappedEntryCard(props) {
|
|
|
109
105
|
onMoveBottom: props.onMoveBottom,
|
|
110
106
|
isBeingDragged: props.isBeingDragged
|
|
111
107
|
};
|
|
112
|
-
const { hasCardEditActions, hasCardMoveActions, hasCardRemoveActions
|
|
108
|
+
const { hasCardEditActions , hasCardMoveActions , hasCardRemoveActions } = props;
|
|
113
109
|
function renderDefaultCard(props) {
|
|
114
110
|
const builtinCardProps = {
|
|
115
111
|
...sharedCardProps,
|
|
@@ -122,18 +118,15 @@ export function FetchingWrappedEntryCard(props) {
|
|
|
122
118
|
entry: (props?.entity) || sharedCardProps.entity,
|
|
123
119
|
entryUrl: props?.entityUrl || sharedCardProps.entityUrl
|
|
124
120
|
};
|
|
125
|
-
return
|
|
121
|
+
return React.createElement(WrappedEntryCard, builtinCardProps);
|
|
126
122
|
}
|
|
127
123
|
if (props.renderCustomCard) {
|
|
128
|
-
// LinkActionsProps are injected higher SingleReferenceEditor/MultipleReferenceEditor
|
|
129
124
|
const renderedCustomCard = props.renderCustomCard(sharedCardProps, {}, renderDefaultCard);
|
|
130
|
-
// Only `false` indicates to render the original card. E.g. `null` would result in no card.
|
|
131
125
|
if (renderedCustomCard !== false) {
|
|
132
126
|
return renderedCustomCard;
|
|
133
127
|
}
|
|
134
128
|
}
|
|
135
129
|
return renderDefaultCard();
|
|
136
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
137
130
|
}, [
|
|
138
131
|
props,
|
|
139
132
|
status,
|
|
@@ -6,7 +6,7 @@ import { entityHelpers, isValidImage } from '@contentful/field-editor-shared';
|
|
|
6
6
|
import { css } from 'emotion';
|
|
7
7
|
import { AssetThumbnail, MissingEntityCard, ScheduledIconWithTooltip } from '../../components';
|
|
8
8
|
import { SpaceName } from '../../components/SpaceName/SpaceName';
|
|
9
|
-
const { getEntryTitle, getEntityDescription, getEntryStatus, getEntryImage
|
|
9
|
+
const { getEntryTitle , getEntityDescription , getEntryStatus , getEntryImage } = entityHelpers;
|
|
10
10
|
const styles = {
|
|
11
11
|
scheduleIcon: css({
|
|
12
12
|
marginRight: tokens.spacing2Xs
|
|
@@ -20,7 +20,7 @@ const defaultProps = {
|
|
|
20
20
|
};
|
|
21
21
|
export function WrappedEntryCard(props) {
|
|
22
22
|
const [file, setFile] = React.useState(null);
|
|
23
|
-
const { contentType
|
|
23
|
+
const { contentType } = props;
|
|
24
24
|
React.useEffect(()=>{
|
|
25
25
|
if (props.entry) {
|
|
26
26
|
getEntryImage({
|
|
@@ -43,7 +43,7 @@ export function WrappedEntryCard(props) {
|
|
|
43
43
|
]);
|
|
44
44
|
const status = getEntryStatus(props.entry?.sys);
|
|
45
45
|
if (status === 'deleted') {
|
|
46
|
-
return
|
|
46
|
+
return React.createElement(MissingEntityCard, {
|
|
47
47
|
entityType: "Entry",
|
|
48
48
|
isDisabled: props.isDisabled,
|
|
49
49
|
onRemove: props.onRemove
|
|
@@ -62,7 +62,7 @@ export function WrappedEntryCard(props) {
|
|
|
62
62
|
localeCode: props.localeCode,
|
|
63
63
|
defaultLocaleCode: props.defaultLocaleCode
|
|
64
64
|
});
|
|
65
|
-
return
|
|
65
|
+
return React.createElement(EntryCard, {
|
|
66
66
|
as: props.entryUrl ? 'a' : 'article',
|
|
67
67
|
href: props.entryUrl,
|
|
68
68
|
title: title,
|
|
@@ -71,58 +71,54 @@ export function WrappedEntryCard(props) {
|
|
|
71
71
|
size: props.size,
|
|
72
72
|
isSelected: props.isSelected,
|
|
73
73
|
status: status,
|
|
74
|
-
icon: props.spaceName ?
|
|
74
|
+
icon: props.spaceName ? React.createElement(SpaceName, {
|
|
75
75
|
spaceName: props.spaceName,
|
|
76
76
|
environmentName: props.entry.sys.environment.sys.id
|
|
77
|
-
}) :
|
|
77
|
+
}) : React.createElement(ScheduledIconWithTooltip, {
|
|
78
78
|
getEntityScheduledActions: props.getEntityScheduledActions,
|
|
79
79
|
entityType: "Entry",
|
|
80
80
|
entityId: props.entry.sys.id
|
|
81
|
-
},
|
|
81
|
+
}, React.createElement(ClockIcon, {
|
|
82
82
|
className: styles.scheduleIcon,
|
|
83
83
|
size: "small",
|
|
84
84
|
variant: "muted",
|
|
85
85
|
testId: "schedule-icon"
|
|
86
86
|
})),
|
|
87
|
-
thumbnailElement: file && isValidImage(file) ?
|
|
87
|
+
thumbnailElement: file && isValidImage(file) ? React.createElement(AssetThumbnail, {
|
|
88
88
|
file: file
|
|
89
89
|
}) : undefined,
|
|
90
90
|
dragHandleRender: props.renderDragHandle,
|
|
91
91
|
withDragHandle: !!props.renderDragHandle,
|
|
92
92
|
actions: props.onEdit || props.onRemove ? [
|
|
93
|
-
props.hasCardEditActions && props.onEdit ?
|
|
93
|
+
props.hasCardEditActions && props.onEdit ? React.createElement(MenuItem, {
|
|
94
94
|
key: "edit",
|
|
95
95
|
testId: "edit",
|
|
96
96
|
onClick: ()=>{
|
|
97
97
|
props.onEdit && props.onEdit();
|
|
98
98
|
}
|
|
99
99
|
}, "Edit") : null,
|
|
100
|
-
props.hasCardRemoveActions && props.onRemove ?
|
|
100
|
+
props.hasCardRemoveActions && props.onRemove ? React.createElement(MenuItem, {
|
|
101
101
|
key: "delete",
|
|
102
102
|
testId: "delete",
|
|
103
103
|
onClick: ()=>{
|
|
104
104
|
props.onRemove && props.onRemove();
|
|
105
105
|
}
|
|
106
106
|
}, "Remove") : null,
|
|
107
|
-
props.hasCardMoveActions && (props.onMoveTop || props.onMoveBottom) ?
|
|
107
|
+
props.hasCardMoveActions && (props.onMoveTop || props.onMoveBottom) ? React.createElement(MenuDivider, {
|
|
108
108
|
key: "divider"
|
|
109
109
|
}) : null,
|
|
110
|
-
props.hasCardMoveActions && props.onMoveTop ?
|
|
110
|
+
props.hasCardMoveActions && props.onMoveTop ? React.createElement(MenuItem, {
|
|
111
111
|
key: "move-top",
|
|
112
112
|
onClick: ()=>props.onMoveTop && props.onMoveTop(),
|
|
113
113
|
testId: "move-top"
|
|
114
114
|
}, "Move to top") : null,
|
|
115
|
-
props.hasCardMoveActions && props.onMoveBottom ?
|
|
115
|
+
props.hasCardMoveActions && props.onMoveBottom ? React.createElement(MenuItem, {
|
|
116
116
|
key: "move-bottom",
|
|
117
117
|
onClick: ()=>props.onMoveBottom && props.onMoveBottom(),
|
|
118
118
|
testId: "move-bottom"
|
|
119
119
|
}, "Move to bottom") : null
|
|
120
120
|
].filter((item)=>item) : [],
|
|
121
|
-
onClick:
|
|
122
|
-
// features e.g. pressing ENTER on a card to add a new paragraph
|
|
123
|
-
// underneath. It's crucial not to pass a custom handler when
|
|
124
|
-
// isClickable is disabled which in the case of RT it's.
|
|
125
|
-
props.isClickable ? (e)=>{
|
|
121
|
+
onClick: props.isClickable ? (e)=>{
|
|
126
122
|
e.preventDefault();
|
|
127
123
|
if (props.onClick) return props.onClick(e);
|
|
128
124
|
props.onEdit && props.onEdit();
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { WrappedEntryCard } from '../../entries';
|
|
3
|
-
// assets are not shown for small cards (which we hardcode currently)
|
|
4
3
|
const resolveAsset = ()=>Promise.resolve();
|
|
5
|
-
// we don't want to show scheduled actions for resources
|
|
6
4
|
const resolveScheduledActions = ()=>Promise.resolve([]);
|
|
7
|
-
export function ContentfulEntryCard({ info, isDisabled, renderDragHandle, onRemove, onMoveTop, onMoveBottom, getEntryRouteHref
|
|
5
|
+
export function ContentfulEntryCard({ info , isDisabled , renderDragHandle , onRemove , onMoveTop , onMoveBottom , getEntryRouteHref }) {
|
|
8
6
|
const resourceSys = info.resource.sys;
|
|
9
7
|
const spaceId = resourceSys.space.sys.id;
|
|
10
8
|
const environmentId = resourceSys.environment.sys.id;
|
|
@@ -14,19 +12,14 @@ export function ContentfulEntryCard({ info, isDisabled, renderDragHandle, onRemo
|
|
|
14
12
|
environmentId,
|
|
15
13
|
entryId
|
|
16
14
|
});
|
|
17
|
-
// TODO: move this into `sdk.navigator.openEntry()`, note that it's signature only include the entry id (not a space or environment)
|
|
18
15
|
const openEntryDetail = ()=>{
|
|
19
16
|
window.open(resourceHref, '_blank', 'noopener,noreferrer');
|
|
20
17
|
};
|
|
21
|
-
return
|
|
18
|
+
return React.createElement(WrappedEntryCard, {
|
|
22
19
|
entry: info.resource,
|
|
23
20
|
isDisabled: isDisabled,
|
|
24
21
|
hasCardEditActions: false,
|
|
25
22
|
contentType: info.contentType,
|
|
26
|
-
// we use the default locale from the space the entry belongs to
|
|
27
|
-
// as we assume this gives a more consistent behaviour.
|
|
28
|
-
// locales will inevitably differ from space to space, so it's likely
|
|
29
|
-
// that the current locale does not exist in the "remote" space
|
|
30
23
|
localeCode: info.defaultLocaleCode,
|
|
31
24
|
defaultLocaleCode: info.defaultLocaleCode,
|
|
32
25
|
size: "small",
|
|
@@ -5,29 +5,28 @@ import { useResource } from '../../common/EntityStore';
|
|
|
5
5
|
import { ResourceEntityErrorCard } from '../../components';
|
|
6
6
|
import { ContentfulEntryCard } from './ContentfulEntryCard';
|
|
7
7
|
function ResourceCardSkeleton() {
|
|
8
|
-
return
|
|
8
|
+
return React.createElement(EntryCard, {
|
|
9
9
|
size: "small",
|
|
10
10
|
isLoading: true
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
function ExistingResourceCard(props) {
|
|
14
|
-
const { resourceLink, inView, index =
|
|
14
|
+
const { resourceLink , inView , index =0 } = props;
|
|
15
15
|
const resourceOptions = {
|
|
16
16
|
priority: index * -1,
|
|
17
17
|
enabled: inView
|
|
18
18
|
};
|
|
19
|
-
const { data, error
|
|
19
|
+
const { data , error } = useResource(resourceLink.sys.linkType, resourceLink.sys.urn, resourceOptions);
|
|
20
20
|
if (!data && !error) {
|
|
21
|
-
return
|
|
21
|
+
return React.createElement(ResourceCardSkeleton, null);
|
|
22
22
|
}
|
|
23
23
|
if (data) {
|
|
24
|
-
|
|
25
|
-
return /*#__PURE__*/ React.createElement(ContentfulEntryCard, {
|
|
24
|
+
return React.createElement(ContentfulEntryCard, {
|
|
26
25
|
info: data,
|
|
27
26
|
...props
|
|
28
27
|
});
|
|
29
28
|
}
|
|
30
|
-
return
|
|
29
|
+
return React.createElement(ResourceEntityErrorCard, {
|
|
31
30
|
linkType: resourceLink.sys.linkType,
|
|
32
31
|
error: error,
|
|
33
32
|
isDisabled: props.isDisabled,
|
|
@@ -38,21 +37,20 @@ function ResourceCardWrapper(props) {
|
|
|
38
37
|
if (!props.resourceLink) {
|
|
39
38
|
return null;
|
|
40
39
|
}
|
|
41
|
-
return
|
|
40
|
+
return React.createElement(ExistingResourceCard, {
|
|
42
41
|
...props,
|
|
43
42
|
resourceLink: props.resourceLink,
|
|
44
43
|
getEntryRouteHref: props.getEntryRouteHref
|
|
45
44
|
});
|
|
46
45
|
}
|
|
47
46
|
export function ResourceCard(props) {
|
|
48
|
-
const { ref, inView
|
|
47
|
+
const { ref , inView } = useInView({
|
|
49
48
|
triggerOnce: true,
|
|
50
49
|
rootMargin: '300px 0px 0px 300px'
|
|
51
50
|
});
|
|
52
|
-
|
|
53
|
-
return /*#__PURE__*/ React.createElement("div", {
|
|
51
|
+
return React.createElement("div", {
|
|
54
52
|
ref: ref
|
|
55
|
-
},
|
|
53
|
+
}, React.createElement(ResourceCardWrapper, {
|
|
56
54
|
...props,
|
|
57
55
|
inView: inView
|
|
58
56
|
}));
|
|
@@ -14,7 +14,6 @@ configure({
|
|
|
14
14
|
jest.mock('react-intersection-observer', ()=>({
|
|
15
15
|
useInView: jest.fn().mockReturnValue({})
|
|
16
16
|
}));
|
|
17
|
-
// explicit master
|
|
18
17
|
const resolvableEntryUrn = 'crn:contentful:::content:spaces/space-id/entries/linked-entry-urn';
|
|
19
18
|
const resolvableEntryUrnWithExplicitMaster = 'crn:contentful:::content:spaces/space-id/environments/master/entries/linked-entry-urn';
|
|
20
19
|
const resolvableEntryUrnWithAnotherEnvironment = 'crn:contentful:::content:spaces/space-id/environments/my-test-environment/entries/linked-entry-urn';
|
|
@@ -28,7 +27,7 @@ const sdk = {
|
|
|
28
27
|
get: jest.fn().mockReturnValue(publishedCT)
|
|
29
28
|
},
|
|
30
29
|
Entry: {
|
|
31
|
-
get: jest.fn().mockImplementation(({ spaceId, environmentId, entryId
|
|
30
|
+
get: jest.fn().mockImplementation(({ spaceId , environmentId , entryId })=>{
|
|
32
31
|
if (spaceId === 'space-id' && environmentId === 'master' && entryId === 'linked-entry-urn') {
|
|
33
32
|
return Promise.resolve(publishedEntry);
|
|
34
33
|
}
|
|
@@ -67,10 +66,10 @@ const sdk = {
|
|
|
67
66
|
environment: 'environment-id'
|
|
68
67
|
}
|
|
69
68
|
};
|
|
70
|
-
function renderResourceCard({ linkType =
|
|
71
|
-
return render(
|
|
69
|
+
function renderResourceCard({ linkType ='Contentful:Entry' , entryUrn =resolvableEntryUrn } = {}) {
|
|
70
|
+
return render(React.createElement(EntityProvider, {
|
|
72
71
|
sdk: sdk
|
|
73
|
-
},
|
|
72
|
+
}, React.createElement(ResourceCard, {
|
|
74
73
|
isDisabled: false,
|
|
75
74
|
getEntryRouteHref: ()=>'',
|
|
76
75
|
resourceLink: {
|
|
@@ -84,7 +83,7 @@ function renderResourceCard({ linkType = 'Contentful:Entry', entryUrn = resolvab
|
|
|
84
83
|
}
|
|
85
84
|
describe('ResourceCard', ()=>{
|
|
86
85
|
it('renders entry card with implicit master crn', async ()=>{
|
|
87
|
-
const { getByTestId, getByText
|
|
86
|
+
const { getByTestId , getByText } = renderResourceCard();
|
|
88
87
|
const tooltipContent = `Space: ${space.name} (Env.: ${publishedEntry.sys.environment.sys.id})`;
|
|
89
88
|
await waitFor(()=>expect(getByTestId('cf-ui-entry-card')).toBeDefined());
|
|
90
89
|
expect(getByText(publishedEntry.fields.exField['en-US'])).toBeDefined();
|
|
@@ -93,7 +92,7 @@ describe('ResourceCard', ()=>{
|
|
|
93
92
|
await waitFor(()=>expect(getByText(tooltipContent)).toBeDefined());
|
|
94
93
|
});
|
|
95
94
|
it('renders entry card with explicit master crn', async ()=>{
|
|
96
|
-
const { getByTestId, getByText
|
|
95
|
+
const { getByTestId , getByText } = renderResourceCard({
|
|
97
96
|
entryUrn: resolvableEntryUrnWithExplicitMaster
|
|
98
97
|
});
|
|
99
98
|
const tooltipContent = `Space: ${space.name} (Env.: ${publishedEntry.sys.environment.sys.id})`;
|
|
@@ -104,7 +103,7 @@ describe('ResourceCard', ()=>{
|
|
|
104
103
|
await waitFor(()=>expect(getByText(tooltipContent)).toBeDefined());
|
|
105
104
|
});
|
|
106
105
|
it('renders entry card with a non master environment', async ()=>{
|
|
107
|
-
const { getByTestId, getByText
|
|
106
|
+
const { getByTestId , getByText } = renderResourceCard({
|
|
108
107
|
entryUrn: resolvableEntryUrnWithAnotherEnvironment
|
|
109
108
|
});
|
|
110
109
|
await waitFor(()=>expect(getByTestId('cf-ui-entry-card')).toBeDefined());
|
|
@@ -115,23 +114,23 @@ describe('ResourceCard', ()=>{
|
|
|
115
114
|
await waitFor(()=>expect(getByText(tooltipContent)).toBeDefined());
|
|
116
115
|
});
|
|
117
116
|
it('renders skeleton when no data is provided', ()=>{
|
|
118
|
-
const { getByTestId
|
|
117
|
+
const { getByTestId } = renderResourceCard();
|
|
119
118
|
expect(getByTestId('cf-ui-skeleton-form')).toBeDefined();
|
|
120
119
|
});
|
|
121
120
|
it('renders unsupported entity card when unsupported link is passed', async ()=>{
|
|
122
|
-
const { getByText
|
|
121
|
+
const { getByText } = renderResourceCard({
|
|
123
122
|
linkType: 'Contentful:UnsupportedLink'
|
|
124
123
|
});
|
|
125
124
|
await waitFor(()=>expect(getByText('Resource type Contentful:UnsupportedLink is currently not supported')).toBeDefined());
|
|
126
125
|
});
|
|
127
126
|
it('renders missing entity card when unknown error is returned', async ()=>{
|
|
128
|
-
const { getByTestId
|
|
127
|
+
const { getByTestId } = renderResourceCard({
|
|
129
128
|
entryUrn: unknownEntryUrn
|
|
130
129
|
});
|
|
131
130
|
await waitFor(()=>expect(getByTestId('cf-ui-missing-entry-card')).toBeDefined());
|
|
132
131
|
});
|
|
133
132
|
it('renders missing entity card when crn is invalid', async ()=>{
|
|
134
|
-
const { getByTestId
|
|
133
|
+
const { getByTestId } = renderResourceCard({
|
|
135
134
|
entryUrn: ''
|
|
136
135
|
});
|
|
137
136
|
await waitFor(()=>expect(getByTestId('cf-ui-missing-entry-card')).toBeDefined());
|
|
@@ -10,9 +10,9 @@ import { CombinedLinkEntityActions } from '../components/LinkActions/LinkEntityA
|
|
|
10
10
|
import { ResourceCard } from './Cards/ResourceCard';
|
|
11
11
|
import { useResourceLinkActions } from './useResourceLinkActions';
|
|
12
12
|
function ResourceEditor(props) {
|
|
13
|
-
const { setValue, items, apiUrl
|
|
13
|
+
const { setValue , items , apiUrl } = props;
|
|
14
14
|
const onSortStart = ()=>noop();
|
|
15
|
-
const onSortEnd = useCallback(({ oldIndex, newIndex
|
|
15
|
+
const onSortEnd = useCallback(({ oldIndex , newIndex })=>{
|
|
16
16
|
const newItems = arrayMove(items, oldIndex, newIndex);
|
|
17
17
|
setValue(newItems);
|
|
18
18
|
}, [
|
|
@@ -32,25 +32,24 @@ function ResourceEditor(props) {
|
|
|
32
32
|
items,
|
|
33
33
|
setValue
|
|
34
34
|
]);
|
|
35
|
-
const { dialogs, field
|
|
35
|
+
const { dialogs , field } = props.sdk;
|
|
36
36
|
const linkActionsProps = useResourceLinkActions({
|
|
37
37
|
dialogs,
|
|
38
38
|
field,
|
|
39
39
|
apiUrl
|
|
40
40
|
});
|
|
41
|
-
return
|
|
41
|
+
return React.createElement(React.Fragment, null, props.children({
|
|
42
42
|
...props,
|
|
43
43
|
onSortStart,
|
|
44
44
|
onSortEnd,
|
|
45
45
|
onMove,
|
|
46
46
|
onRemoteItemAtIndex
|
|
47
|
-
}),
|
|
47
|
+
}), React.createElement(CombinedLinkEntityActions, {
|
|
48
48
|
...linkActionsProps,
|
|
49
49
|
renderCustomActions: props.renderCustomActions
|
|
50
50
|
}));
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
function WithPerItemCallbacks({ listLength, index, onMove, onRemoteItemAtIndex, children }) {
|
|
52
|
+
function WithPerItemCallbacks({ listLength , index , onMove , onRemoteItemAtIndex , children }) {
|
|
54
53
|
const handleMoveTop = React.useMemo(()=>index > 0 ? ()=>onMove(index, 0) : undefined, [
|
|
55
54
|
index,
|
|
56
55
|
onMove
|
|
@@ -64,7 +63,7 @@ function WithPerItemCallbacks({ listLength, index, onMove, onRemoteItemAtIndex,
|
|
|
64
63
|
index,
|
|
65
64
|
onRemoteItemAtIndex
|
|
66
65
|
]);
|
|
67
|
-
return
|
|
66
|
+
return React.createElement(React.Fragment, null, children({
|
|
68
67
|
onMoveBottom: handleMoveBottom,
|
|
69
68
|
onMoveTop: handleMoveTop,
|
|
70
69
|
onRemove: handleRemove
|
|
@@ -72,28 +71,28 @@ function WithPerItemCallbacks({ listLength, index, onMove, onRemoteItemAtIndex,
|
|
|
72
71
|
}
|
|
73
72
|
const EMPTY_ARRAY = [];
|
|
74
73
|
export function MultipleResourceReferenceEditor(props) {
|
|
75
|
-
return
|
|
74
|
+
return React.createElement(EntityProvider, {
|
|
76
75
|
sdk: props.sdk
|
|
77
|
-
},
|
|
76
|
+
}, React.createElement(FieldConnector, {
|
|
78
77
|
debounce: 0,
|
|
79
78
|
field: props.sdk.field,
|
|
80
79
|
isInitiallyDisabled: props.isInitiallyDisabled,
|
|
81
80
|
isEqualValues: deepEqual
|
|
82
|
-
}, ({ value, disabled, setValue, externalReset
|
|
83
|
-
return
|
|
81
|
+
}, ({ value , disabled , setValue , externalReset })=>{
|
|
82
|
+
return React.createElement(ResourceEditor, {
|
|
84
83
|
...props,
|
|
85
84
|
items: value || EMPTY_ARRAY,
|
|
86
85
|
isDisabled: disabled,
|
|
87
86
|
setValue: setValue,
|
|
88
87
|
renderCustomActions: props.renderCustomActions,
|
|
89
88
|
key: `${externalReset}-list`
|
|
90
|
-
}, (editorProps)
|
|
89
|
+
}, (editorProps)=>React.createElement(SortableLinkList, editorProps, ({ item , isDisabled , DragHandle , index })=>React.createElement(WithPerItemCallbacks, {
|
|
91
90
|
key: index,
|
|
92
91
|
index: index,
|
|
93
92
|
onMove: editorProps.onMove,
|
|
94
93
|
onRemoteItemAtIndex: editorProps.onRemoteItemAtIndex,
|
|
95
94
|
listLength: value?.length || 0
|
|
96
|
-
}, ({ onMoveBottom, onMoveTop, onRemove
|
|
95
|
+
}, ({ onMoveBottom , onMoveTop , onRemove })=>React.createElement(ResourceCard, {
|
|
97
96
|
key: index,
|
|
98
97
|
index: index,
|
|
99
98
|
resourceLink: item,
|