@contentful/field-editor-reference 6.10.0 → 6.10.2
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/components/LinkActions/LinkActions.js +32 -4
- package/dist/cjs/components/LinkActions/NoLinkPermissionsInfo.js +5 -1
- package/dist/cjs/components/MissingEntityCard/MissingEntityCard.js +5 -1
- package/dist/cjs/components/ResourceEntityErrorCard/FunctionInvocationErrorCard.js +14 -4
- package/dist/cjs/components/ResourceEntityErrorCard/UnsupportedEntityCard.js +5 -1
- package/dist/cjs/resources/MultipleResourceReferenceEditor.js +1 -0
- package/dist/esm/components/LinkActions/LinkActions.js +32 -4
- package/dist/esm/components/LinkActions/NoLinkPermissionsInfo.js +5 -1
- package/dist/esm/components/MissingEntityCard/MissingEntityCard.js +5 -1
- package/dist/esm/components/ResourceEntityErrorCard/FunctionInvocationErrorCard.js +14 -4
- package/dist/esm/components/ResourceEntityErrorCard/UnsupportedEntityCard.js +5 -1
- package/dist/esm/resources/MultipleResourceReferenceEditor.js +1 -0
- package/package.json +3 -3
|
@@ -19,6 +19,7 @@ _export(exports, {
|
|
|
19
19
|
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
20
20
|
const _f36components = require("@contentful/f36-components");
|
|
21
21
|
const _f36icons = require("@contentful/f36-icons");
|
|
22
|
+
const _core = require("@lingui/core");
|
|
22
23
|
const _CreateEntryLinkButton = require("../CreateEntryLinkButton/CreateEntryLinkButton");
|
|
23
24
|
const _NoLinkPermissionsInfo = require("./NoLinkPermissionsInfo");
|
|
24
25
|
const _styles = /*#__PURE__*/ _interop_require_wildcard(require("./styles"));
|
|
@@ -64,12 +65,39 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
64
65
|
return newObj;
|
|
65
66
|
}
|
|
66
67
|
const defaultEntryLabels = {
|
|
67
|
-
createNew: (props)=>
|
|
68
|
-
|
|
68
|
+
createNew: (props)=>{
|
|
69
|
+
const contentType = props?.contentType;
|
|
70
|
+
return contentType ? _core.i18n._({
|
|
71
|
+
id: "FieldEditors.Reference.LinkActions.CreateNewEntryWithType",
|
|
72
|
+
message: "Create new {contentType} and link",
|
|
73
|
+
values: {
|
|
74
|
+
contentType: contentType
|
|
75
|
+
}
|
|
76
|
+
}) : _core.i18n._({
|
|
77
|
+
id: "FieldEditors.Reference.LinkActions.CreateNewEntry",
|
|
78
|
+
message: "Create new entry and link"
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
linkExisting: (props)=>_core.i18n._({
|
|
82
|
+
id: "FieldEditors.Reference.LinkActions.LinkExistingEntries",
|
|
83
|
+
message: "{0, plural, one {Link existing entry} other {Link existing entries}}",
|
|
84
|
+
values: {
|
|
85
|
+
0: props?.canLinkMultiple ? 0 : 1
|
|
86
|
+
}
|
|
87
|
+
})
|
|
69
88
|
};
|
|
70
89
|
const defaultAssetLabels = {
|
|
71
|
-
createNew: ()
|
|
72
|
-
|
|
90
|
+
createNew: ()=>_core.i18n._({
|
|
91
|
+
id: "FieldEditors.Reference.LinkActions.CreateNewAsset",
|
|
92
|
+
message: "Create new asset and link"
|
|
93
|
+
}),
|
|
94
|
+
linkExisting: (props)=>_core.i18n._({
|
|
95
|
+
id: "FieldEditors.Reference.LinkActions.LinkExistingAssets",
|
|
96
|
+
message: "{0, plural, one {Link existing asset} other {Link existing assets}}",
|
|
97
|
+
values: {
|
|
98
|
+
0: props?.canLinkMultiple ? 0 : 1
|
|
99
|
+
}
|
|
100
|
+
})
|
|
73
101
|
};
|
|
74
102
|
const testIds = {
|
|
75
103
|
dropdown: 'linkEditor.dropdown',
|
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "NoLinkPermissionsInfo", {
|
|
|
10
10
|
});
|
|
11
11
|
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
12
12
|
const _f36components = require("@contentful/f36-components");
|
|
13
|
+
const _core = require("@lingui/core");
|
|
13
14
|
function _getRequireWildcardCache(nodeInterop) {
|
|
14
15
|
if (typeof WeakMap !== "function") return null;
|
|
15
16
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -52,5 +53,8 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
52
53
|
return newObj;
|
|
53
54
|
}
|
|
54
55
|
function NoLinkPermissionsInfo() {
|
|
55
|
-
return /*#__PURE__*/ _react.createElement(_f36components.Paragraph, null,
|
|
56
|
+
return /*#__PURE__*/ _react.createElement(_f36components.Paragraph, null, _core.i18n._({
|
|
57
|
+
id: "FieldEditors.Reference.NoLinkPermissionsInfo.Message",
|
|
58
|
+
message: "You don't have permission to view this content or this field is not correctly configured. Contact your administrator for help."
|
|
59
|
+
}));
|
|
56
60
|
}
|
|
@@ -11,13 +11,17 @@ Object.defineProperty(exports, "MissingEntityCard", {
|
|
|
11
11
|
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
12
12
|
const _f36components = require("@contentful/f36-components");
|
|
13
13
|
const _f36icons = require("@contentful/f36-icons");
|
|
14
|
+
const _core = require("@lingui/core");
|
|
14
15
|
function _interop_require_default(obj) {
|
|
15
16
|
return obj && obj.__esModule ? obj : {
|
|
16
17
|
default: obj
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
20
|
function MissingEntityCard({ as = 'a', providerName = 'Source', customMessage, isDisabled, isSelected, onRemove, testId = 'cf-ui-missing-entity-card', children }) {
|
|
20
|
-
const description = customMessage ??
|
|
21
|
+
const description = customMessage ?? _core.i18n._({
|
|
22
|
+
id: "FieldEditors.Reference.MissingEntityCard.DefaultMessage",
|
|
23
|
+
message: "Content missing or inaccessible"
|
|
24
|
+
});
|
|
21
25
|
function CustomActionButton() {
|
|
22
26
|
if (isDisabled || !onRemove) return null;
|
|
23
27
|
return /*#__PURE__*/ _react.default.createElement(_f36components.IconButton, {
|
|
@@ -10,8 +10,9 @@ Object.defineProperty(exports, "FunctionInvocationErrorCard", {
|
|
|
10
10
|
});
|
|
11
11
|
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
12
12
|
const _f36components = require("@contentful/f36-components");
|
|
13
|
-
const _ = require("..");
|
|
14
13
|
const _f36icons = require("@contentful/f36-icons");
|
|
14
|
+
const _core = require("@lingui/core");
|
|
15
|
+
const _ = require("..");
|
|
15
16
|
const _EntityStore = require("../../common/EntityStore");
|
|
16
17
|
function _getRequireWildcardCache(nodeInterop) {
|
|
17
18
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -73,13 +74,22 @@ function FunctionInvocationErrorCard({ providerName = 'Source', organizationId,
|
|
|
73
74
|
variant: "negative"
|
|
74
75
|
}), /*#__PURE__*/ _react.createElement(_f36components.Text, {
|
|
75
76
|
fontColor: "colorNegative"
|
|
76
|
-
}, "
|
|
77
|
+
}, " ", _core.i18n._({
|
|
78
|
+
id: "FieldEditors.Reference.FunctionInvocationErrorCard.ErrorMessage",
|
|
79
|
+
message: "Function invocation error."
|
|
80
|
+
})), status === 'success' && functionId && /*#__PURE__*/ _react.createElement(_f36components.Text, {
|
|
77
81
|
fontColor: "colorNegative"
|
|
78
|
-
}, "
|
|
82
|
+
}, " ", _core.i18n._({
|
|
83
|
+
id: "FieldEditors.Reference.FunctionInvocationErrorCard.LogsInfo",
|
|
84
|
+
message: "For more information, go to"
|
|
85
|
+
}), " ", /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
|
|
79
86
|
testId: "cf-ui-function-invocation-log-link",
|
|
80
87
|
icon: /*#__PURE__*/ _react.createElement(_f36icons.ExternalLinkIcon, null),
|
|
81
88
|
target: "_blank",
|
|
82
89
|
alignIcon: "end",
|
|
83
90
|
href: functionLink
|
|
84
|
-
},
|
|
91
|
+
}, _core.i18n._({
|
|
92
|
+
id: "FieldEditors.Reference.FunctionInvocationErrorCard.FunctionLogs",
|
|
93
|
+
message: "function logs"
|
|
94
|
+
})))));
|
|
85
95
|
}
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "UnsupportedEntityCard", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
12
|
+
const _core = require("@lingui/core");
|
|
12
13
|
const _MissingEntityCard = require("../MissingEntityCard/MissingEntityCard");
|
|
13
14
|
function _getRequireWildcardCache(nodeInterop) {
|
|
14
15
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -53,7 +54,10 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
53
54
|
}
|
|
54
55
|
function UnsupportedEntityCard(props) {
|
|
55
56
|
return /*#__PURE__*/ _react.createElement(_MissingEntityCard.MissingEntityCard, {
|
|
56
|
-
customMessage:
|
|
57
|
+
customMessage: _core.i18n._({
|
|
58
|
+
id: "FieldEditors.Reference.UnsupportedEntityCard.Message",
|
|
59
|
+
message: "Unsupported API information"
|
|
60
|
+
}),
|
|
57
61
|
isSelected: props.isSelected,
|
|
58
62
|
onRemove: props.onRemove
|
|
59
63
|
});
|
|
@@ -1,16 +1,44 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Button } from '@contentful/f36-components';
|
|
3
3
|
import { PlusIcon, LinkIcon } from '@contentful/f36-icons';
|
|
4
|
+
import { i18n as $_i18n } from "@lingui/core";
|
|
4
5
|
import { CreateEntryLinkButton } from '../CreateEntryLinkButton/CreateEntryLinkButton';
|
|
5
6
|
import { NoLinkPermissionsInfo } from './NoLinkPermissionsInfo';
|
|
6
7
|
import * as styles from './styles';
|
|
7
8
|
const defaultEntryLabels = {
|
|
8
|
-
createNew: (props)=>
|
|
9
|
-
|
|
9
|
+
createNew: (props)=>{
|
|
10
|
+
const contentType = props?.contentType;
|
|
11
|
+
return contentType ? $_i18n._({
|
|
12
|
+
id: "FieldEditors.Reference.LinkActions.CreateNewEntryWithType",
|
|
13
|
+
message: "Create new {contentType} and link",
|
|
14
|
+
values: {
|
|
15
|
+
contentType: contentType
|
|
16
|
+
}
|
|
17
|
+
}) : $_i18n._({
|
|
18
|
+
id: "FieldEditors.Reference.LinkActions.CreateNewEntry",
|
|
19
|
+
message: "Create new entry and link"
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
linkExisting: (props)=>$_i18n._({
|
|
23
|
+
id: "FieldEditors.Reference.LinkActions.LinkExistingEntries",
|
|
24
|
+
message: "{0, plural, one {Link existing entry} other {Link existing entries}}",
|
|
25
|
+
values: {
|
|
26
|
+
0: props?.canLinkMultiple ? 0 : 1
|
|
27
|
+
}
|
|
28
|
+
})
|
|
10
29
|
};
|
|
11
30
|
const defaultAssetLabels = {
|
|
12
|
-
createNew: ()
|
|
13
|
-
|
|
31
|
+
createNew: ()=>$_i18n._({
|
|
32
|
+
id: "FieldEditors.Reference.LinkActions.CreateNewAsset",
|
|
33
|
+
message: "Create new asset and link"
|
|
34
|
+
}),
|
|
35
|
+
linkExisting: (props)=>$_i18n._({
|
|
36
|
+
id: "FieldEditors.Reference.LinkActions.LinkExistingAssets",
|
|
37
|
+
message: "{0, plural, one {Link existing asset} other {Link existing assets}}",
|
|
38
|
+
values: {
|
|
39
|
+
0: props?.canLinkMultiple ? 0 : 1
|
|
40
|
+
}
|
|
41
|
+
})
|
|
14
42
|
};
|
|
15
43
|
export const testIds = {
|
|
16
44
|
dropdown: 'linkEditor.dropdown',
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Paragraph } from '@contentful/f36-components';
|
|
3
|
+
import { i18n as $_i18n } from "@lingui/core";
|
|
3
4
|
export function NoLinkPermissionsInfo() {
|
|
4
|
-
return /*#__PURE__*/ React.createElement(Paragraph, null,
|
|
5
|
+
return /*#__PURE__*/ React.createElement(Paragraph, null, $_i18n._({
|
|
6
|
+
id: "FieldEditors.Reference.NoLinkPermissionsInfo.Message",
|
|
7
|
+
message: "You don't have permission to view this content or this field is not correctly configured. Contact your administrator for help."
|
|
8
|
+
}));
|
|
5
9
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EntryCard, IconButton } from '@contentful/f36-components';
|
|
3
3
|
import { CloseIcon } from '@contentful/f36-icons';
|
|
4
|
+
import { i18n as $_i18n } from "@lingui/core";
|
|
4
5
|
export function MissingEntityCard({ as = 'a', providerName = 'Source', customMessage, isDisabled, isSelected, onRemove, testId = 'cf-ui-missing-entity-card', children }) {
|
|
5
|
-
const description = customMessage ??
|
|
6
|
+
const description = customMessage ?? $_i18n._({
|
|
7
|
+
id: "FieldEditors.Reference.MissingEntityCard.DefaultMessage",
|
|
8
|
+
message: "Content missing or inaccessible"
|
|
9
|
+
});
|
|
6
10
|
function CustomActionButton() {
|
|
7
11
|
if (isDisabled || !onRemove) return null;
|
|
8
12
|
return /*#__PURE__*/ React.createElement(IconButton, {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Flex, Text, TextLink } from '@contentful/f36-components';
|
|
3
|
-
import { MissingEntityCard } from '..';
|
|
4
3
|
import { ErrorCircleOutlineIcon, ExternalLinkIcon } from '@contentful/f36-icons';
|
|
4
|
+
import { i18n as $_i18n } from "@lingui/core";
|
|
5
|
+
import { MissingEntityCard } from '..';
|
|
5
6
|
import { useResourceProvider } from '../../common/EntityStore';
|
|
6
7
|
export function FunctionInvocationErrorCard({ providerName = 'Source', organizationId, appDefinitionId, isDisabled, isSelected, onRemove }) {
|
|
7
8
|
const { status, data } = useResourceProvider(organizationId, appDefinitionId);
|
|
@@ -22,13 +23,22 @@ export function FunctionInvocationErrorCard({ providerName = 'Source', organizat
|
|
|
22
23
|
variant: "negative"
|
|
23
24
|
}), /*#__PURE__*/ React.createElement(Text, {
|
|
24
25
|
fontColor: "colorNegative"
|
|
25
|
-
}, "
|
|
26
|
+
}, " ", $_i18n._({
|
|
27
|
+
id: "FieldEditors.Reference.FunctionInvocationErrorCard.ErrorMessage",
|
|
28
|
+
message: "Function invocation error."
|
|
29
|
+
})), status === 'success' && functionId && /*#__PURE__*/ React.createElement(Text, {
|
|
26
30
|
fontColor: "colorNegative"
|
|
27
|
-
}, "
|
|
31
|
+
}, " ", $_i18n._({
|
|
32
|
+
id: "FieldEditors.Reference.FunctionInvocationErrorCard.LogsInfo",
|
|
33
|
+
message: "For more information, go to"
|
|
34
|
+
}), " ", /*#__PURE__*/ React.createElement(TextLink, {
|
|
28
35
|
testId: "cf-ui-function-invocation-log-link",
|
|
29
36
|
icon: /*#__PURE__*/ React.createElement(ExternalLinkIcon, null),
|
|
30
37
|
target: "_blank",
|
|
31
38
|
alignIcon: "end",
|
|
32
39
|
href: functionLink
|
|
33
|
-
},
|
|
40
|
+
}, $_i18n._({
|
|
41
|
+
id: "FieldEditors.Reference.FunctionInvocationErrorCard.FunctionLogs",
|
|
42
|
+
message: "function logs"
|
|
43
|
+
})))));
|
|
34
44
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { i18n as $_i18n } from "@lingui/core";
|
|
2
3
|
import { MissingEntityCard } from '../MissingEntityCard/MissingEntityCard';
|
|
3
4
|
export function UnsupportedEntityCard(props) {
|
|
4
5
|
return /*#__PURE__*/ React.createElement(MissingEntityCard, {
|
|
5
|
-
customMessage:
|
|
6
|
+
customMessage: $_i18n._({
|
|
7
|
+
id: "FieldEditors.Reference.UnsupportedEntityCard.Message",
|
|
8
|
+
message: "Unsupported API information"
|
|
9
|
+
}),
|
|
6
10
|
isSelected: props.isSelected,
|
|
7
11
|
onRemove: props.onRemove
|
|
8
12
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-reference",
|
|
3
|
-
"version": "6.10.
|
|
3
|
+
"version": "6.10.2",
|
|
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.70.0",
|
|
39
39
|
"@contentful/f36-icons": "^4.29.0",
|
|
40
40
|
"@contentful/f36-tokens": "^4.0.5",
|
|
41
|
-
"@contentful/field-editor-shared": "^2.9.
|
|
41
|
+
"@contentful/field-editor-shared": "^2.9.1",
|
|
42
42
|
"@contentful/mimetype": "^2.2.29",
|
|
43
43
|
"@dnd-kit/core": "^6.0.8",
|
|
44
44
|
"@dnd-kit/modifiers": "^7.0.0",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"registry": "https://npm.pkg.github.com/"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "4fa62eaa25b40c592cc3671df8626dd18013a206"
|
|
70
70
|
}
|