@contentful/field-editor-rich-text 3.19.7 → 3.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/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +2 -2
- package/dist/cjs/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +1 -1
- package/dist/cjs/plugins/Hyperlink/useResourceEntityInfo.js +1 -1
- package/dist/cjs/plugins/shared/FetchingWrappedAssetCard.js +2 -2
- package/dist/cjs/plugins/shared/FetchingWrappedEntryCard.js +2 -2
- package/dist/cjs/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +2 -2
- package/dist/esm/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +2 -2
- package/dist/esm/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +1 -1
- package/dist/esm/plugins/Hyperlink/useResourceEntityInfo.js +1 -1
- package/dist/esm/plugins/shared/FetchingWrappedAssetCard.js +2 -2
- package/dist/esm/plugins/shared/FetchingWrappedEntryCard.js +2 -2
- package/dist/esm/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +2 -2
- package/package.json +3 -3
|
@@ -106,7 +106,7 @@ function FetchingWrappedInlineEntryCard(props) {
|
|
|
106
106
|
]);
|
|
107
107
|
if (requestStatus === 'error') {
|
|
108
108
|
return _react.createElement(_f36components.InlineEntryCard, {
|
|
109
|
-
title: "
|
|
109
|
+
title: "Content missing or inaccessible",
|
|
110
110
|
testId: _richtexttypes.INLINES.EMBEDDED_ENTRY,
|
|
111
111
|
isSelected: props.isSelected
|
|
112
112
|
});
|
|
@@ -119,7 +119,7 @@ function FetchingWrappedInlineEntryCard(props) {
|
|
|
119
119
|
const entryStatus = getEntryStatus(entry.sys);
|
|
120
120
|
if (entryStatus === 'deleted') {
|
|
121
121
|
return _react.createElement(_f36components.InlineEntryCard, {
|
|
122
|
-
title: "
|
|
122
|
+
title: "Content missing or inaccessible",
|
|
123
123
|
testId: _richtexttypes.INLINES.EMBEDDED_ENTRY,
|
|
124
124
|
isSelected: props.isSelected,
|
|
125
125
|
actions: [
|
|
@@ -69,7 +69,7 @@ function FetchingWrappedResourceInlineCard(props) {
|
|
|
69
69
|
]);
|
|
70
70
|
if (requestStatus === 'error') {
|
|
71
71
|
return _react.createElement(_f36components.InlineEntryCard, {
|
|
72
|
-
title: "
|
|
72
|
+
title: "Content missing or inaccessible",
|
|
73
73
|
testId: _richtexttypes.INLINES.EMBEDDED_RESOURCE,
|
|
74
74
|
isSelected: props.isSelected
|
|
75
75
|
});
|
|
@@ -66,7 +66,7 @@ function useResourceEntityInfo({ onEntityFetchComplete, target }) {
|
|
|
66
66
|
return `Loading entry...`;
|
|
67
67
|
}
|
|
68
68
|
if (!data || error) {
|
|
69
|
-
return `
|
|
69
|
+
return `Content missing or inaccessible`;
|
|
70
70
|
}
|
|
71
71
|
const title = (0, _utils.truncateTitle)(data.resource.fields[data.contentType.displayField]?.[data.defaultLocaleCode], 40) || 'Untitled';
|
|
72
72
|
return `${data.contentType.name}: ${title} (Space: ${data.space.name} – Env.: ${data.resource.sys.environment.sys.id})`;
|
|
@@ -67,9 +67,9 @@ const InternalAssetCard = _react.memo((props)=>{
|
|
|
67
67
|
}
|
|
68
68
|
if (props.asset === 'failed') {
|
|
69
69
|
return _react.createElement(_fieldeditorreference.MissingEntityCard, {
|
|
70
|
-
entityType: "Asset",
|
|
71
70
|
isDisabled: props.isDisabled,
|
|
72
|
-
onRemove: props.onRemove
|
|
71
|
+
onRemove: props.onRemove,
|
|
72
|
+
providerName: "Contentful"
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
return _react.createElement(_fieldeditorreference.WrappedAssetCard, {
|
|
@@ -67,9 +67,9 @@ const InternalEntryCard = _react.memo((props)=>{
|
|
|
67
67
|
}
|
|
68
68
|
if (entry === 'failed') {
|
|
69
69
|
return _react.createElement(_fieldeditorreference.MissingEntityCard, {
|
|
70
|
-
entityType: "Entry",
|
|
71
70
|
isDisabled: props.isDisabled,
|
|
72
|
-
onRemove: props.onRemove
|
|
71
|
+
onRemove: props.onRemove,
|
|
72
|
+
providerName: "Contentful"
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
const contentType = sdk.space.getCachedContentTypes().find((contentType)=>contentType.sys.id === entry.sys.contentType.sys.id);
|
|
@@ -138,11 +138,11 @@ test('renders unsupported entity card when unsupported link is passed', async ()
|
|
|
138
138
|
const { getByText } = renderResourceCard({
|
|
139
139
|
linkType: 'Contentful:UnsupportedLink'
|
|
140
140
|
});
|
|
141
|
-
await (0, _react1.waitFor)(()=>expect(getByText('
|
|
141
|
+
await (0, _react1.waitFor)(()=>expect(getByText('Unsupported API information')).toBeDefined());
|
|
142
142
|
});
|
|
143
143
|
test('renders missing entity card when unknown error is returned', async ()=>{
|
|
144
144
|
const { getByTestId } = renderResourceCard({
|
|
145
145
|
entryUrn: unknownEntryUrn
|
|
146
146
|
});
|
|
147
|
-
await (0, _react1.waitFor)(()=>expect(getByTestId('cf-ui-missing-
|
|
147
|
+
await (0, _react1.waitFor)(()=>expect(getByTestId('cf-ui-missing-entity-card')).toBeDefined());
|
|
148
148
|
});
|
|
@@ -50,7 +50,7 @@ export function FetchingWrappedInlineEntryCard(props) {
|
|
|
50
50
|
]);
|
|
51
51
|
if (requestStatus === 'error') {
|
|
52
52
|
return React.createElement(InlineEntryCard, {
|
|
53
|
-
title: "
|
|
53
|
+
title: "Content missing or inaccessible",
|
|
54
54
|
testId: INLINES.EMBEDDED_ENTRY,
|
|
55
55
|
isSelected: props.isSelected
|
|
56
56
|
});
|
|
@@ -63,7 +63,7 @@ export function FetchingWrappedInlineEntryCard(props) {
|
|
|
63
63
|
const entryStatus = getEntryStatus(entry.sys);
|
|
64
64
|
if (entryStatus === 'deleted') {
|
|
65
65
|
return React.createElement(InlineEntryCard, {
|
|
66
|
-
title: "
|
|
66
|
+
title: "Content missing or inaccessible",
|
|
67
67
|
testId: INLINES.EMBEDDED_ENTRY,
|
|
68
68
|
isSelected: props.isSelected,
|
|
69
69
|
actions: [
|
|
@@ -18,7 +18,7 @@ export function FetchingWrappedResourceInlineCard(props) {
|
|
|
18
18
|
]);
|
|
19
19
|
if (requestStatus === 'error') {
|
|
20
20
|
return React.createElement(InlineEntryCard, {
|
|
21
|
-
title: "
|
|
21
|
+
title: "Content missing or inaccessible",
|
|
22
22
|
testId: INLINES.EMBEDDED_RESOURCE,
|
|
23
23
|
isSelected: props.isSelected
|
|
24
24
|
});
|
|
@@ -15,7 +15,7 @@ export function useResourceEntityInfo({ onEntityFetchComplete, target }) {
|
|
|
15
15
|
return `Loading entry...`;
|
|
16
16
|
}
|
|
17
17
|
if (!data || error) {
|
|
18
|
-
return `
|
|
18
|
+
return `Content missing or inaccessible`;
|
|
19
19
|
}
|
|
20
20
|
const title = truncateTitle(data.resource.fields[data.contentType.displayField]?.[data.defaultLocaleCode], 40) || 'Untitled';
|
|
21
21
|
return `${data.contentType.name}: ${title} (Space: ${data.space.name} – Env.: ${data.resource.sys.environment.sys.id})`;
|
|
@@ -11,9 +11,9 @@ const InternalAssetCard = React.memo((props)=>{
|
|
|
11
11
|
}
|
|
12
12
|
if (props.asset === 'failed') {
|
|
13
13
|
return React.createElement(MissingEntityCard, {
|
|
14
|
-
entityType: "Asset",
|
|
15
14
|
isDisabled: props.isDisabled,
|
|
16
|
-
onRemove: props.onRemove
|
|
15
|
+
onRemove: props.onRemove,
|
|
16
|
+
providerName: "Contentful"
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
return React.createElement(WrappedAssetCard, {
|
|
@@ -11,9 +11,9 @@ const InternalEntryCard = React.memo((props)=>{
|
|
|
11
11
|
}
|
|
12
12
|
if (entry === 'failed') {
|
|
13
13
|
return React.createElement(MissingEntityCard, {
|
|
14
|
-
entityType: "Entry",
|
|
15
14
|
isDisabled: props.isDisabled,
|
|
16
|
-
onRemove: props.onRemove
|
|
15
|
+
onRemove: props.onRemove,
|
|
16
|
+
providerName: "Contentful"
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
const contentType = sdk.space.getCachedContentTypes().find((contentType)=>contentType.sys.id === entry.sys.contentType.sys.id);
|
|
@@ -88,11 +88,11 @@ test('renders unsupported entity card when unsupported link is passed', async ()
|
|
|
88
88
|
const { getByText } = renderResourceCard({
|
|
89
89
|
linkType: 'Contentful:UnsupportedLink'
|
|
90
90
|
});
|
|
91
|
-
await waitFor(()=>expect(getByText('
|
|
91
|
+
await waitFor(()=>expect(getByText('Unsupported API information')).toBeDefined());
|
|
92
92
|
});
|
|
93
93
|
test('renders missing entity card when unknown error is returned', async ()=>{
|
|
94
94
|
const { getByTestId } = renderResourceCard({
|
|
95
95
|
entryUrn: unknownEntryUrn
|
|
96
96
|
});
|
|
97
|
-
await waitFor(()=>expect(getByTestId('cf-ui-missing-
|
|
97
|
+
await waitFor(()=>expect(getByTestId('cf-ui-missing-entity-card')).toBeDefined());
|
|
98
98
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-rich-text",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.0",
|
|
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.1.1",
|
|
45
45
|
"@contentful/f36-tokens": "^4.0.0",
|
|
46
46
|
"@contentful/f36-utils": "^4.19.0",
|
|
47
|
-
"@contentful/field-editor-reference": "^5.
|
|
47
|
+
"@contentful/field-editor-reference": "^5.27.0",
|
|
48
48
|
"@contentful/field-editor-shared": "^1.4.7",
|
|
49
49
|
"@contentful/rich-text-plain-text-renderer": "^16.0.4",
|
|
50
50
|
"@contentful/rich-text-types": "16.3.0",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"registry": "https://npm.pkg.github.com/"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "08064d010b8a3195cf194bbdf3ce2e07d5f6b37c"
|
|
90
90
|
}
|