@contentful/field-editor-rich-text 4.3.0 → 4.4.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.
- package/dist/cjs/SdkProvider.js +1 -3
- package/dist/cjs/plugins/shared/FetchingWrappedAssetCard.js +10 -3
- package/dist/cjs/plugins/shared/FetchingWrappedEntryCard.js +6 -1
- package/dist/cjs/plugins/shared/FetchingWrappedResourceCard.js +5 -1
- package/dist/esm/SdkProvider.js +1 -3
- package/dist/esm/plugins/shared/FetchingWrappedAssetCard.js +12 -5
- package/dist/esm/plugins/shared/FetchingWrappedEntryCard.js +8 -3
- package/dist/esm/plugins/shared/FetchingWrappedResourceCard.js +6 -2
- package/package.json +4 -4
package/dist/cjs/SdkProvider.js
CHANGED
|
@@ -65,9 +65,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
65
65
|
return newObj;
|
|
66
66
|
}
|
|
67
67
|
function useSdk({ sdk }) {
|
|
68
|
-
const sdkMemo = _react.useMemo(()=>sdk, [
|
|
69
|
-
sdk.parameters.instance.activeLocales
|
|
70
|
-
]);
|
|
68
|
+
const sdkMemo = _react.useMemo(()=>sdk, []);
|
|
71
69
|
return sdkMemo;
|
|
72
70
|
}
|
|
73
71
|
const [SdkProvider, useSdkContext] = (0, _constate.default)(useSdk);
|
|
@@ -59,7 +59,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
59
59
|
}
|
|
60
60
|
return newObj;
|
|
61
61
|
}
|
|
62
|
-
const InternalAssetCard = _react.memo((props)=>
|
|
62
|
+
const InternalAssetCard = _react.memo((props)=>{
|
|
63
|
+
const activeLocales = (0, _fieldeditorshared.useActiveLocales)(props.sdk);
|
|
64
|
+
return _react.createElement(_fieldeditorreference.WrappedAssetCard, {
|
|
63
65
|
getEntityScheduledActions: props.loadEntityScheduledActions,
|
|
64
66
|
size: "small",
|
|
65
67
|
isSelected: props.isSelected,
|
|
@@ -72,8 +74,13 @@ const InternalAssetCard = _react.memo((props)=>_react.createElement(_fieldeditor
|
|
|
72
74
|
isClickable: false,
|
|
73
75
|
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus,
|
|
74
76
|
localesStatusMap: props.localesStatusMap,
|
|
75
|
-
activeLocales:
|
|
76
|
-
|
|
77
|
+
activeLocales: activeLocales,
|
|
78
|
+
renderDragHandle: !props.isDisabled ? (dragHandleProps)=>_react.createElement(_f36components.DragHandle, {
|
|
79
|
+
label: "drag embedded asset",
|
|
80
|
+
...dragHandleProps
|
|
81
|
+
}) : undefined
|
|
82
|
+
});
|
|
83
|
+
}, _fastdeepequal.default);
|
|
77
84
|
InternalAssetCard.displayName = 'InternalAssetCard';
|
|
78
85
|
function FetchingWrappedAssetCard(props) {
|
|
79
86
|
const { onEntityFetchComplete } = props;
|
|
@@ -62,6 +62,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
62
62
|
const InternalEntryCard = _react.memo((props)=>{
|
|
63
63
|
const { entry, sdk, loadEntityScheduledActions } = props;
|
|
64
64
|
const contentType = sdk.space.getCachedContentTypes().find((contentType)=>contentType.sys.id === entry.sys.contentType.sys.id);
|
|
65
|
+
const activeLocales = (0, _fieldeditorshared.useActiveLocales)(props.sdk);
|
|
65
66
|
return _react.createElement(_fieldeditorreference.WrappedEntryCard, {
|
|
66
67
|
size: "default",
|
|
67
68
|
getAsset: props.sdk.space.getAsset,
|
|
@@ -77,7 +78,11 @@ const InternalEntryCard = _react.memo((props)=>{
|
|
|
77
78
|
isClickable: false,
|
|
78
79
|
useLocalizedEntityStatus: sdk.parameters.instance.useLocalizedEntityStatus,
|
|
79
80
|
localesStatusMap: props.localesStatusMap,
|
|
80
|
-
activeLocales:
|
|
81
|
+
activeLocales: activeLocales,
|
|
82
|
+
renderDragHandle: !props.isDisabled ? (dragHandleProps)=>_react.createElement(_f36components.DragHandle, {
|
|
83
|
+
label: "drag embedded entry",
|
|
84
|
+
...dragHandleProps
|
|
85
|
+
}) : undefined
|
|
81
86
|
});
|
|
82
87
|
}, _fastdeepequal.default);
|
|
83
88
|
InternalEntryCard.displayName = 'ReferenceCard';
|
|
@@ -79,7 +79,11 @@ const InternalEntryCard = _react.memo((props)=>{
|
|
|
79
79
|
onRemove: props.isDisabled ? undefined : props.onRemove,
|
|
80
80
|
isClickable: false,
|
|
81
81
|
getEntityScheduledActions: ()=>Promise.resolve([]),
|
|
82
|
-
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus
|
|
82
|
+
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus,
|
|
83
|
+
renderDragHandle: !props.isDisabled ? (dragHandleProps)=>_react.createElement(_f36components.DragHandle, {
|
|
84
|
+
label: "drag resource entry",
|
|
85
|
+
...dragHandleProps
|
|
86
|
+
}) : undefined
|
|
83
87
|
});
|
|
84
88
|
}, _fastdeepequal.default);
|
|
85
89
|
InternalEntryCard.displayName = 'ReferenceCard';
|
package/dist/esm/SdkProvider.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import constate from 'constate';
|
|
3
3
|
function useSdk({ sdk }) {
|
|
4
|
-
const sdkMemo = React.useMemo(()=>sdk, [
|
|
5
|
-
sdk.parameters.instance.activeLocales
|
|
6
|
-
]);
|
|
4
|
+
const sdkMemo = React.useMemo(()=>sdk, []);
|
|
7
5
|
return sdkMemo;
|
|
8
6
|
}
|
|
9
7
|
export const [SdkProvider, useSdkContext] = constate(useSdk);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AssetCard } from '@contentful/f36-components';
|
|
2
|
+
import { AssetCard, DragHandle } from '@contentful/f36-components';
|
|
3
3
|
import { useEntity, useEntityLoader, MissingEntityCard, WrappedAssetCard } from '@contentful/field-editor-reference';
|
|
4
|
-
import { useLocalePublishStatus } from '@contentful/field-editor-shared';
|
|
4
|
+
import { useLocalePublishStatus, useActiveLocales } from '@contentful/field-editor-shared';
|
|
5
5
|
import areEqual from 'fast-deep-equal';
|
|
6
|
-
const InternalAssetCard = React.memo((props)=>
|
|
6
|
+
const InternalAssetCard = React.memo((props)=>{
|
|
7
|
+
const activeLocales = useActiveLocales(props.sdk);
|
|
8
|
+
return React.createElement(WrappedAssetCard, {
|
|
7
9
|
getEntityScheduledActions: props.loadEntityScheduledActions,
|
|
8
10
|
size: "small",
|
|
9
11
|
isSelected: props.isSelected,
|
|
@@ -16,8 +18,13 @@ const InternalAssetCard = React.memo((props)=>React.createElement(WrappedAssetCa
|
|
|
16
18
|
isClickable: false,
|
|
17
19
|
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus,
|
|
18
20
|
localesStatusMap: props.localesStatusMap,
|
|
19
|
-
activeLocales:
|
|
20
|
-
|
|
21
|
+
activeLocales: activeLocales,
|
|
22
|
+
renderDragHandle: !props.isDisabled ? (dragHandleProps)=>React.createElement(DragHandle, {
|
|
23
|
+
label: "drag embedded asset",
|
|
24
|
+
...dragHandleProps
|
|
25
|
+
}) : undefined
|
|
26
|
+
});
|
|
27
|
+
}, areEqual);
|
|
21
28
|
InternalAssetCard.displayName = 'InternalAssetCard';
|
|
22
29
|
export function FetchingWrappedAssetCard(props) {
|
|
23
30
|
const { onEntityFetchComplete } = props;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { EntryCard } from '@contentful/f36-components';
|
|
2
|
+
import { DragHandle, EntryCard } from '@contentful/f36-components';
|
|
3
3
|
import { useEntity, MissingEntityCard, WrappedEntryCard, useEntityLoader } from '@contentful/field-editor-reference';
|
|
4
|
-
import { useLocalePublishStatus } from '@contentful/field-editor-shared';
|
|
4
|
+
import { useLocalePublishStatus, useActiveLocales } from '@contentful/field-editor-shared';
|
|
5
5
|
import areEqual from 'fast-deep-equal';
|
|
6
6
|
const InternalEntryCard = React.memo((props)=>{
|
|
7
7
|
const { entry, sdk, loadEntityScheduledActions } = props;
|
|
8
8
|
const contentType = sdk.space.getCachedContentTypes().find((contentType)=>contentType.sys.id === entry.sys.contentType.sys.id);
|
|
9
|
+
const activeLocales = useActiveLocales(props.sdk);
|
|
9
10
|
return React.createElement(WrappedEntryCard, {
|
|
10
11
|
size: "default",
|
|
11
12
|
getAsset: props.sdk.space.getAsset,
|
|
@@ -21,7 +22,11 @@ const InternalEntryCard = React.memo((props)=>{
|
|
|
21
22
|
isClickable: false,
|
|
22
23
|
useLocalizedEntityStatus: sdk.parameters.instance.useLocalizedEntityStatus,
|
|
23
24
|
localesStatusMap: props.localesStatusMap,
|
|
24
|
-
activeLocales:
|
|
25
|
+
activeLocales: activeLocales,
|
|
26
|
+
renderDragHandle: !props.isDisabled ? (dragHandleProps)=>React.createElement(DragHandle, {
|
|
27
|
+
label: "drag embedded entry",
|
|
28
|
+
...dragHandleProps
|
|
29
|
+
}) : undefined
|
|
25
30
|
});
|
|
26
31
|
}, areEqual);
|
|
27
32
|
InternalEntryCard.displayName = 'ReferenceCard';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { EntryCard } from '@contentful/f36-components';
|
|
2
|
+
import { DragHandle, EntryCard } from '@contentful/f36-components';
|
|
3
3
|
import { ResourceEntityErrorCard, WrappedEntryCard, useResource } from '@contentful/field-editor-reference';
|
|
4
4
|
import areEqual from 'fast-deep-equal';
|
|
5
5
|
const InternalEntryCard = React.memo((props)=>{
|
|
@@ -23,7 +23,11 @@ const InternalEntryCard = React.memo((props)=>{
|
|
|
23
23
|
onRemove: props.isDisabled ? undefined : props.onRemove,
|
|
24
24
|
isClickable: false,
|
|
25
25
|
getEntityScheduledActions: ()=>Promise.resolve([]),
|
|
26
|
-
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus
|
|
26
|
+
useLocalizedEntityStatus: props.sdk.parameters.instance.useLocalizedEntityStatus,
|
|
27
|
+
renderDragHandle: !props.isDisabled ? (dragHandleProps)=>React.createElement(DragHandle, {
|
|
28
|
+
label: "drag resource entry",
|
|
29
|
+
...dragHandleProps
|
|
30
|
+
}) : undefined
|
|
27
31
|
});
|
|
28
32
|
}, areEqual);
|
|
29
33
|
InternalEntryCard.displayName = 'ReferenceCard';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-rich-text",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.1",
|
|
4
4
|
"source": "./src/index.tsx",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -44,8 +44,8 @@
|
|
|
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": "^6.
|
|
48
|
-
"@contentful/field-editor-shared": "^2.
|
|
47
|
+
"@contentful/field-editor-reference": "^6.6.1",
|
|
48
|
+
"@contentful/field-editor-shared": "^2.4.0",
|
|
49
49
|
"@contentful/rich-text-plain-text-renderer": "^17.0.0",
|
|
50
50
|
"@contentful/rich-text-types": "^17.0.0",
|
|
51
51
|
"@popperjs/core": "^2.11.5",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"registry": "https://npm.pkg.github.com/"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "a92c11aaf9967c63fe3f8b30a0566b15d7430f43"
|
|
90
90
|
}
|