@contentful/field-editor-rich-text 3.27.13 → 3.28.1
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.
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "FetchingWrappedAssetCard", {
|
|
|
11
11
|
const _react = _interop_require_wildcard(require("react"));
|
|
12
12
|
const _f36components = require("@contentful/f36-components");
|
|
13
13
|
const _fieldeditorreference = require("@contentful/field-editor-reference");
|
|
14
|
+
const _fieldeditorshared = require("@contentful/field-editor-shared");
|
|
14
15
|
const _fastdeepequal = _interop_require_default(require("fast-deep-equal"));
|
|
15
16
|
function _interop_require_default(obj) {
|
|
16
17
|
return obj && obj.__esModule ? obj : {
|
|
@@ -70,7 +71,9 @@ const InternalAssetCard = _react.memo((props)=>_react.createElement(_fieldeditor
|
|
|
70
71
|
onRemove: props.isDisabled ? undefined : props.onRemove,
|
|
71
72
|
isClickable: false,
|
|
72
73
|
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus,
|
|
73
|
-
isLocalized: !!('localized' in props.sdk.field && props.sdk.field.localized)
|
|
74
|
+
isLocalized: !!('localized' in props.sdk.field && props.sdk.field.localized),
|
|
75
|
+
localesStatusMap: props.localesStatusMap,
|
|
76
|
+
activeLocales: props.sdk.parameters.instance.activeLocales
|
|
74
77
|
}), _fastdeepequal.default);
|
|
75
78
|
InternalAssetCard.displayName = 'InternalAssetCard';
|
|
76
79
|
function FetchingWrappedAssetCard(props) {
|
|
@@ -81,6 +84,7 @@ function FetchingWrappedAssetCard(props) {
|
|
|
81
84
|
getEntityScheduledActions,
|
|
82
85
|
props.assetId
|
|
83
86
|
]);
|
|
87
|
+
const localesStatusMap = (0, _fieldeditorshared.useAsyncLocalePublishStatus)(asset, props.sdk.parameters.instance.privateLocales);
|
|
84
88
|
_react.useEffect(()=>{
|
|
85
89
|
if (status === 'success') {
|
|
86
90
|
onEntityFetchComplete?.();
|
|
@@ -110,6 +114,7 @@ function FetchingWrappedAssetCard(props) {
|
|
|
110
114
|
loadEntityScheduledActions: loadEntityScheduledActions,
|
|
111
115
|
locale: props.locale,
|
|
112
116
|
onEdit: props.onEdit,
|
|
113
|
-
onRemove: props.onRemove
|
|
117
|
+
onRemove: props.onRemove,
|
|
118
|
+
localesStatusMap: localesStatusMap
|
|
114
119
|
});
|
|
115
120
|
}
|
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "FetchingWrappedEntryCard", {
|
|
|
11
11
|
const _react = _interop_require_wildcard(require("react"));
|
|
12
12
|
const _f36components = require("@contentful/f36-components");
|
|
13
13
|
const _fieldeditorreference = require("@contentful/field-editor-reference");
|
|
14
|
+
const _fieldeditorshared = require("@contentful/field-editor-shared");
|
|
14
15
|
const _fastdeepequal = _interop_require_default(require("fast-deep-equal"));
|
|
15
16
|
function _interop_require_default(obj) {
|
|
16
17
|
return obj && obj.__esModule ? obj : {
|
|
@@ -75,7 +76,9 @@ const InternalEntryCard = _react.memo((props)=>{
|
|
|
75
76
|
onRemove: props.isDisabled ? undefined : props.onRemove,
|
|
76
77
|
isClickable: false,
|
|
77
78
|
useLocalizedEntityStatus: sdk.parameters.instance.useLocalizedEntityStatus,
|
|
78
|
-
isLocalized: !!('localized' in props.sdk.field && props.sdk.field.localized)
|
|
79
|
+
isLocalized: !!('localized' in props.sdk.field && props.sdk.field.localized),
|
|
80
|
+
localesStatusMap: props.localesStatusMap,
|
|
81
|
+
activeLocales: props.sdk.parameters.instance.activeLocales
|
|
79
82
|
});
|
|
80
83
|
}, _fastdeepequal.default);
|
|
81
84
|
InternalEntryCard.displayName = 'ReferenceCard';
|
|
@@ -87,6 +90,7 @@ const FetchingWrappedEntryCard = (props)=>{
|
|
|
87
90
|
getEntityScheduledActions,
|
|
88
91
|
entryId
|
|
89
92
|
]);
|
|
93
|
+
const localesStatusMap = (0, _fieldeditorshared.useAsyncLocalePublishStatus)(entry, props.sdk.parameters.instance.privateLocales);
|
|
90
94
|
_react.useEffect(()=>{
|
|
91
95
|
if (status === 'success') {
|
|
92
96
|
onEntityFetchComplete?.();
|
|
@@ -115,6 +119,7 @@ const FetchingWrappedEntryCard = (props)=>{
|
|
|
115
119
|
isSelected: props.isSelected,
|
|
116
120
|
onEdit: props.onEdit,
|
|
117
121
|
onRemove: props.onRemove,
|
|
118
|
-
loadEntityScheduledActions: loadEntityScheduledActions
|
|
122
|
+
loadEntityScheduledActions: loadEntityScheduledActions,
|
|
123
|
+
localesStatusMap: localesStatusMap
|
|
119
124
|
});
|
|
120
125
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AssetCard } from '@contentful/f36-components';
|
|
3
3
|
import { useEntity, useEntityLoader, MissingEntityCard, WrappedAssetCard } from '@contentful/field-editor-reference';
|
|
4
|
+
import { useAsyncLocalePublishStatus } from '@contentful/field-editor-shared';
|
|
4
5
|
import areEqual from 'fast-deep-equal';
|
|
5
6
|
const InternalAssetCard = React.memo((props)=>React.createElement(WrappedAssetCard, {
|
|
6
7
|
getEntityScheduledActions: props.loadEntityScheduledActions,
|
|
@@ -14,7 +15,9 @@ const InternalAssetCard = React.memo((props)=>React.createElement(WrappedAssetCa
|
|
|
14
15
|
onRemove: props.isDisabled ? undefined : props.onRemove,
|
|
15
16
|
isClickable: false,
|
|
16
17
|
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus,
|
|
17
|
-
isLocalized: !!('localized' in props.sdk.field && props.sdk.field.localized)
|
|
18
|
+
isLocalized: !!('localized' in props.sdk.field && props.sdk.field.localized),
|
|
19
|
+
localesStatusMap: props.localesStatusMap,
|
|
20
|
+
activeLocales: props.sdk.parameters.instance.activeLocales
|
|
18
21
|
}), areEqual);
|
|
19
22
|
InternalAssetCard.displayName = 'InternalAssetCard';
|
|
20
23
|
export function FetchingWrappedAssetCard(props) {
|
|
@@ -25,6 +28,7 @@ export function FetchingWrappedAssetCard(props) {
|
|
|
25
28
|
getEntityScheduledActions,
|
|
26
29
|
props.assetId
|
|
27
30
|
]);
|
|
31
|
+
const localesStatusMap = useAsyncLocalePublishStatus(asset, props.sdk.parameters.instance.privateLocales);
|
|
28
32
|
React.useEffect(()=>{
|
|
29
33
|
if (status === 'success') {
|
|
30
34
|
onEntityFetchComplete?.();
|
|
@@ -54,6 +58,7 @@ export function FetchingWrappedAssetCard(props) {
|
|
|
54
58
|
loadEntityScheduledActions: loadEntityScheduledActions,
|
|
55
59
|
locale: props.locale,
|
|
56
60
|
onEdit: props.onEdit,
|
|
57
|
-
onRemove: props.onRemove
|
|
61
|
+
onRemove: props.onRemove,
|
|
62
|
+
localesStatusMap: localesStatusMap
|
|
58
63
|
});
|
|
59
64
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { EntryCard } from '@contentful/f36-components';
|
|
3
3
|
import { useEntity, MissingEntityCard, WrappedEntryCard, useEntityLoader } from '@contentful/field-editor-reference';
|
|
4
|
+
import { useAsyncLocalePublishStatus } from '@contentful/field-editor-shared';
|
|
4
5
|
import areEqual from 'fast-deep-equal';
|
|
5
6
|
const InternalEntryCard = React.memo((props)=>{
|
|
6
7
|
const { entry, sdk, loadEntityScheduledActions } = props;
|
|
@@ -19,7 +20,9 @@ const InternalEntryCard = React.memo((props)=>{
|
|
|
19
20
|
onRemove: props.isDisabled ? undefined : props.onRemove,
|
|
20
21
|
isClickable: false,
|
|
21
22
|
useLocalizedEntityStatus: sdk.parameters.instance.useLocalizedEntityStatus,
|
|
22
|
-
isLocalized: !!('localized' in props.sdk.field && props.sdk.field.localized)
|
|
23
|
+
isLocalized: !!('localized' in props.sdk.field && props.sdk.field.localized),
|
|
24
|
+
localesStatusMap: props.localesStatusMap,
|
|
25
|
+
activeLocales: props.sdk.parameters.instance.activeLocales
|
|
23
26
|
});
|
|
24
27
|
}, areEqual);
|
|
25
28
|
InternalEntryCard.displayName = 'ReferenceCard';
|
|
@@ -31,6 +34,7 @@ export const FetchingWrappedEntryCard = (props)=>{
|
|
|
31
34
|
getEntityScheduledActions,
|
|
32
35
|
entryId
|
|
33
36
|
]);
|
|
37
|
+
const localesStatusMap = useAsyncLocalePublishStatus(entry, props.sdk.parameters.instance.privateLocales);
|
|
34
38
|
React.useEffect(()=>{
|
|
35
39
|
if (status === 'success') {
|
|
36
40
|
onEntityFetchComplete?.();
|
|
@@ -59,6 +63,7 @@ export const FetchingWrappedEntryCard = (props)=>{
|
|
|
59
63
|
isSelected: props.isSelected,
|
|
60
64
|
onEdit: props.onEdit,
|
|
61
65
|
onRemove: props.onRemove,
|
|
62
|
-
loadEntityScheduledActions: loadEntityScheduledActions
|
|
66
|
+
loadEntityScheduledActions: loadEntityScheduledActions,
|
|
67
|
+
localesStatusMap: localesStatusMap
|
|
63
68
|
});
|
|
64
69
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-rich-text",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.28.1",
|
|
4
4
|
"source": "./src/index.tsx",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@contentful/f36-icons": "^4.29.0",
|
|
45
45
|
"@contentful/f36-tokens": "^4.0.5",
|
|
46
46
|
"@contentful/f36-utils": "^4.24.3",
|
|
47
|
-
"@contentful/field-editor-reference": "^5.31.
|
|
47
|
+
"@contentful/field-editor-reference": "^5.31.1",
|
|
48
48
|
"@contentful/field-editor-shared": "^1.8.0",
|
|
49
49
|
"@contentful/rich-text-plain-text-renderer": "^16.0.4",
|
|
50
50
|
"@contentful/rich-text-types": "16.7.0",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"registry": "https://npm.pkg.github.com/"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "05beff8083e711ec10c00a95e49ce0ea6135db08"
|
|
90
90
|
}
|