@contentful/field-editor-reference 5.28.2 → 5.28.3
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 +5 -0
- package/dist/cjs/assets/WrappedAssetCard/FetchingWrappedAssetCard.js +2 -1
- package/dist/cjs/assets/WrappedAssetCard/WrappedAssetCard.js +1 -1
- package/dist/cjs/assets/WrappedAssetCard/WrappedAssetLink.js +1 -1
- package/dist/cjs/entries/WrappedEntryCard/FetchingWrappedEntryCard.js +2 -1
- package/dist/cjs/entries/WrappedEntryCard/WrappedEntryCard.js +2 -2
- package/dist/esm/__fixtures__/FakeSdk.js +5 -0
- package/dist/esm/assets/WrappedAssetCard/FetchingWrappedAssetCard.js +2 -1
- package/dist/esm/assets/WrappedAssetCard/WrappedAssetCard.js +1 -1
- package/dist/esm/assets/WrappedAssetCard/WrappedAssetLink.js +1 -1
- package/dist/esm/entries/WrappedEntryCard/FetchingWrappedEntryCard.js +2 -1
- package/dist/esm/entries/WrappedEntryCard/WrappedEntryCard.js +2 -2
- package/dist/types/assets/WrappedAssetCard/WrappedAssetCard.d.ts +1 -0
- package/dist/types/assets/WrappedAssetCard/WrappedAssetLink.d.ts +1 -0
- package/dist/types/common/customCardTypes.d.ts +1 -0
- package/dist/types/entries/WrappedEntryCard/WrappedEntryCard.d.ts +1 -0
- package/package.json +3 -3
|
@@ -122,7 +122,8 @@ function FetchingWrappedAssetCard(props) {
|
|
|
122
122
|
defaultLocaleCode: props.sdk.locales.default,
|
|
123
123
|
renderDragHandle: props.renderDragHandle,
|
|
124
124
|
onEdit,
|
|
125
|
-
onRemove
|
|
125
|
+
onRemove,
|
|
126
|
+
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus
|
|
126
127
|
};
|
|
127
128
|
if (props.viewType === 'link') {
|
|
128
129
|
if (status === 'loading') {
|
|
@@ -96,7 +96,7 @@ function getFileType(file) {
|
|
|
96
96
|
}
|
|
97
97
|
const WrappedAssetCard = (props)=>{
|
|
98
98
|
const { className, onEdit, getAssetUrl, onRemove, size, isDisabled, isSelected, isClickable } = props;
|
|
99
|
-
const status = _fieldeditorshared.entityHelpers.
|
|
99
|
+
const status = _fieldeditorshared.entityHelpers.getEntityStatus(props.asset.sys, props.useLocalizedEntityStatus ? props.localeCode : undefined);
|
|
100
100
|
if (status === 'deleted') {
|
|
101
101
|
return _react.createElement(_components.MissingAssetCard, {
|
|
102
102
|
asSquare: true,
|
|
@@ -69,7 +69,7 @@ const styles = {
|
|
|
69
69
|
};
|
|
70
70
|
const WrappedAssetLink = (props)=>{
|
|
71
71
|
const { className, href, onEdit, onRemove, isDisabled } = props;
|
|
72
|
-
const status = _fieldeditorshared.entityHelpers.
|
|
72
|
+
const status = _fieldeditorshared.entityHelpers.getEntityStatus(props.asset.sys, props.useLocalizedEntityStatus ? props.localeCode : undefined);
|
|
73
73
|
if (status === 'deleted') {
|
|
74
74
|
return _react.createElement(_components.MissingAssetCard, {
|
|
75
75
|
isDisabled: props.isDisabled,
|
|
@@ -159,7 +159,8 @@ function FetchingWrappedEntryCard(props) {
|
|
|
159
159
|
onRemove: onRemoveEntry,
|
|
160
160
|
onMoveTop: props.onMoveTop,
|
|
161
161
|
onMoveBottom: props.onMoveBottom,
|
|
162
|
-
isBeingDragged: props.isBeingDragged
|
|
162
|
+
isBeingDragged: props.isBeingDragged,
|
|
163
|
+
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus
|
|
163
164
|
};
|
|
164
165
|
const { hasCardEditActions, hasCardMoveActions, hasCardRemoveActions } = props;
|
|
165
166
|
function renderDefaultCard(props) {
|
|
@@ -62,7 +62,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
62
62
|
}
|
|
63
63
|
return newObj;
|
|
64
64
|
}
|
|
65
|
-
const { getEntryTitle, getEntityDescription,
|
|
65
|
+
const { getEntryTitle, getEntityDescription, getEntityStatus, getEntryImage } = _fieldeditorshared.entityHelpers;
|
|
66
66
|
const styles = {
|
|
67
67
|
scheduleIcon: (0, _emotion.css)({
|
|
68
68
|
marginRight: _f36tokens.default.spacing2Xs
|
|
@@ -97,7 +97,7 @@ function WrappedEntryCard(props) {
|
|
|
97
97
|
props.localeCode,
|
|
98
98
|
props.defaultLocaleCode
|
|
99
99
|
]);
|
|
100
|
-
const status =
|
|
100
|
+
const status = getEntityStatus(props.entry?.sys, props.useLocalizedEntityStatus ? props.localeCode : undefined);
|
|
101
101
|
if (status === 'deleted') {
|
|
102
102
|
return _react.createElement(_components.MissingEntityCard, {
|
|
103
103
|
isDisabled: props.isDisabled,
|
|
@@ -71,7 +71,8 @@ export function FetchingWrappedAssetCard(props) {
|
|
|
71
71
|
defaultLocaleCode: props.sdk.locales.default,
|
|
72
72
|
renderDragHandle: props.renderDragHandle,
|
|
73
73
|
onEdit,
|
|
74
|
-
onRemove
|
|
74
|
+
onRemove,
|
|
75
|
+
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus
|
|
75
76
|
};
|
|
76
77
|
if (props.viewType === 'link') {
|
|
77
78
|
if (status === 'loading') {
|
|
@@ -40,7 +40,7 @@ function getFileType(file) {
|
|
|
40
40
|
}
|
|
41
41
|
export const WrappedAssetCard = (props)=>{
|
|
42
42
|
const { className, onEdit, getAssetUrl, onRemove, size, isDisabled, isSelected, isClickable } = props;
|
|
43
|
-
const status = entityHelpers.
|
|
43
|
+
const status = entityHelpers.getEntityStatus(props.asset.sys, props.useLocalizedEntityStatus ? props.localeCode : undefined);
|
|
44
44
|
if (status === 'deleted') {
|
|
45
45
|
return React.createElement(MissingAssetCard, {
|
|
46
46
|
asSquare: true,
|
|
@@ -13,7 +13,7 @@ const styles = {
|
|
|
13
13
|
};
|
|
14
14
|
export const WrappedAssetLink = (props)=>{
|
|
15
15
|
const { className, href, onEdit, onRemove, isDisabled } = props;
|
|
16
|
-
const status = entityHelpers.
|
|
16
|
+
const status = entityHelpers.getEntityStatus(props.asset.sys, props.useLocalizedEntityStatus ? props.localeCode : undefined);
|
|
17
17
|
if (status === 'deleted') {
|
|
18
18
|
return React.createElement(MissingAssetCard, {
|
|
19
19
|
isDisabled: props.isDisabled,
|
|
@@ -103,7 +103,8 @@ export function FetchingWrappedEntryCard(props) {
|
|
|
103
103
|
onRemove: onRemoveEntry,
|
|
104
104
|
onMoveTop: props.onMoveTop,
|
|
105
105
|
onMoveBottom: props.onMoveBottom,
|
|
106
|
-
isBeingDragged: props.isBeingDragged
|
|
106
|
+
isBeingDragged: props.isBeingDragged,
|
|
107
|
+
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus
|
|
107
108
|
};
|
|
108
109
|
const { hasCardEditActions, hasCardMoveActions, hasCardRemoveActions } = props;
|
|
109
110
|
function renderDefaultCard(props) {
|
|
@@ -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,
|
|
9
|
+
const { getEntryTitle, getEntityDescription, getEntityStatus, getEntryImage } = entityHelpers;
|
|
10
10
|
const styles = {
|
|
11
11
|
scheduleIcon: css({
|
|
12
12
|
marginRight: tokens.spacing2Xs
|
|
@@ -41,7 +41,7 @@ export function WrappedEntryCard(props) {
|
|
|
41
41
|
props.localeCode,
|
|
42
42
|
props.defaultLocaleCode
|
|
43
43
|
]);
|
|
44
|
-
const status =
|
|
44
|
+
const status = getEntityStatus(props.entry?.sys, props.useLocalizedEntityStatus ? props.localeCode : undefined);
|
|
45
45
|
if (status === 'deleted') {
|
|
46
46
|
return React.createElement(MissingEntityCard, {
|
|
47
47
|
isDisabled: props.isDisabled,
|
|
@@ -15,6 +15,7 @@ export interface WrappedAssetCardProps {
|
|
|
15
15
|
size: 'default' | 'small';
|
|
16
16
|
renderDragHandle?: RenderDragFn;
|
|
17
17
|
isClickable: boolean;
|
|
18
|
+
useLocalizedEntityStatus: boolean;
|
|
18
19
|
}
|
|
19
20
|
export declare const WrappedAssetCard: {
|
|
20
21
|
(props: WrappedAssetCardProps): JSX.Element;
|
|
@@ -23,6 +23,7 @@ export interface WrappedEntryCardProps {
|
|
|
23
23
|
hasCardEditActions: boolean;
|
|
24
24
|
hasCardMoveActions?: boolean;
|
|
25
25
|
hasCardRemoveActions?: boolean;
|
|
26
|
+
useLocalizedEntityStatus?: boolean;
|
|
26
27
|
}
|
|
27
28
|
export declare function WrappedEntryCard(props: WrappedEntryCardProps): JSX.Element;
|
|
28
29
|
export declare namespace WrappedEntryCard {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-reference",
|
|
3
|
-
"version": "5.28.
|
|
3
|
+
"version": "5.28.3",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@contentful/f36-components": "^4.60.0",
|
|
39
39
|
"@contentful/f36-icons": "^4.27.0",
|
|
40
40
|
"@contentful/f36-tokens": "^4.0.4",
|
|
41
|
-
"@contentful/field-editor-shared": "^1.5.
|
|
41
|
+
"@contentful/field-editor-shared": "^1.5.3",
|
|
42
42
|
"@contentful/mimetype": "^2.2.29",
|
|
43
43
|
"@dnd-kit/core": "^6.0.8",
|
|
44
44
|
"@dnd-kit/modifiers": "^6.0.1",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"registry": "https://npm.pkg.github.com/"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "6287e6c00cd65f5f3625526707551c213d58d3e3"
|
|
71
71
|
}
|