@contentful/field-editor-reference 6.10.7 → 6.10.8
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/assets/WrappedAssetCard/AssetCardActions.js +6 -2
- package/dist/cjs/components/CreateEntryLinkButton/CreateEntryLinkButton.js +1 -1
- package/dist/cjs/components/CreateEntryLinkButton/CreateEntryMenuTrigger.js +1 -1
- package/dist/cjs/components/LinkActions/CombinedLinkActions.js +4 -4
- package/dist/cjs/components/LinkActions/LinkActions.js +1 -1
- package/dist/cjs/components/MissingAssetCard/MissingAssetCard.js +8 -2
- package/dist/cjs/components/MissingEntityCard/MissingEntityCard.js +3 -2
- package/dist/cjs/components/ResourceEntityErrorCard/FunctionInvocationErrorCard.js +9 -3
- package/dist/cjs/components/SpaceName/SpaceName.js +1 -1
- package/dist/cjs/entries/WrappedEntryCard/WrappedEntryCard.js +7 -5
- package/dist/esm/assets/WrappedAssetCard/AssetCardActions.js +6 -2
- package/dist/esm/components/CreateEntryLinkButton/CreateEntryLinkButton.js +2 -2
- package/dist/esm/components/CreateEntryLinkButton/CreateEntryMenuTrigger.js +2 -2
- package/dist/esm/components/LinkActions/CombinedLinkActions.js +5 -5
- package/dist/esm/components/LinkActions/LinkActions.js +2 -2
- package/dist/esm/components/MissingAssetCard/MissingAssetCard.js +4 -3
- package/dist/esm/components/MissingEntityCard/MissingEntityCard.js +4 -3
- package/dist/esm/components/ResourceEntityErrorCard/FunctionInvocationErrorCard.js +5 -4
- package/dist/esm/components/SpaceName/SpaceName.js +2 -2
- package/dist/esm/entries/WrappedEntryCard/WrappedEntryCard.js +8 -6
- package/dist/types/assets/WrappedAssetCard/AssetCardActions.d.ts +1 -1
- package/dist/types/components/CreateEntryLinkButton/CreateEntryLinkButton.d.ts +1 -1
- package/dist/types/components/CreateEntryLinkButton/CreateEntryMenuTrigger.d.ts +2 -2
- package/dist/types/components/ResourceEntityErrorCard/FunctionInvocationErrorCard.d.ts +1 -1
- package/package.json +7 -7
|
@@ -131,7 +131,9 @@ function renderAssetInfo(props) {
|
|
|
131
131
|
as: "dd",
|
|
132
132
|
isTruncated: true
|
|
133
133
|
}, mimeType)), fileSize && /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("dt", null, "Size:"), /*#__PURE__*/ _react.createElement("dd", null, (0, _fieldeditorshared.shortenStorageUnit)(fileSize, 'B'))), image && /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("dt", null, "Dimensions:"), /*#__PURE__*/ _react.createElement("dd", null, `${image.width} × ${image.height}`))))
|
|
134
|
-
]
|
|
134
|
+
].map((item, i)=>/*#__PURE__*/ _react.createElement(_f36components.Menu, {
|
|
135
|
+
key: i
|
|
136
|
+
}, item));
|
|
135
137
|
}
|
|
136
138
|
function renderActions(props) {
|
|
137
139
|
const { entityFile, isDisabled, onEdit, onRemove } = props;
|
|
@@ -158,5 +160,7 @@ function renderActions(props) {
|
|
|
158
160
|
onClick: onRemove,
|
|
159
161
|
testId: "card-action-remove"
|
|
160
162
|
}, "Remove") : null
|
|
161
|
-
].filter((item)=>item)
|
|
163
|
+
].filter((item)=>item).map((item, i)=>/*#__PURE__*/ _react.createElement(_f36components.Menu, {
|
|
164
|
+
key: i
|
|
165
|
+
}, item));
|
|
162
166
|
}
|
|
@@ -92,7 +92,7 @@ const CreateEntryLinkButton = ({ contentTypes, onSelect, customDropdownItems, te
|
|
|
92
92
|
dropdownSettings: dropdownSettings,
|
|
93
93
|
customDropdownItems: customDropdownItems
|
|
94
94
|
}, ({ isSelecting })=>/*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
95
|
-
endIcon: hasDropdown ? /*#__PURE__*/ _react.createElement(_f36icons.
|
|
95
|
+
endIcon: hasDropdown ? /*#__PURE__*/ _react.createElement(_f36icons.CaretDownIcon, null) : undefined,
|
|
96
96
|
variant: "secondary",
|
|
97
97
|
className: styles.action,
|
|
98
98
|
isDisabled: disabled || isSelecting,
|
|
@@ -190,7 +190,7 @@ const CreateEntryMenuTrigger = ({ contentTypes, suggestedContentTypeId, contentT
|
|
|
190
190
|
testId: "add-entry-menu-search",
|
|
191
191
|
value: searchInput,
|
|
192
192
|
onChange: (e)=>setSearchInput(e.target.value)
|
|
193
|
-
}), /*#__PURE__*/ _react.default.createElement(_f36icons.
|
|
193
|
+
}), /*#__PURE__*/ _react.default.createElement(_f36icons.MagnifyingGlassIcon, {
|
|
194
194
|
className: styles.searchIcon
|
|
195
195
|
})), /*#__PURE__*/ _react.default.createElement(_f36components.Menu.Divider, null)), searchInput && renderSearchResultsCount(searchFilteredContentTypes.length), suggestedContentType && !searchInput && /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_f36components.Menu.SectionTitle, null, "Suggested Content Type"), /*#__PURE__*/ _react.default.createElement(_f36components.Menu.Item, {
|
|
196
196
|
testId: "suggested",
|
|
@@ -84,12 +84,12 @@ function CombinedEntryLinkActions(props) {
|
|
|
84
84
|
onSelect: (contentTypeId)=>{
|
|
85
85
|
return contentTypeId ? props.onCreate(contentTypeId) : Promise.resolve();
|
|
86
86
|
},
|
|
87
|
-
customDropdownItems: props.canLinkEntity ? /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
|
|
87
|
+
customDropdownItems: props.canLinkEntity ? /*#__PURE__*/ _react.createElement(_f36components.Menu, null, /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
|
|
88
88
|
testId: testIds.linkExisting,
|
|
89
89
|
onClick: ()=>{
|
|
90
90
|
props.onLinkExisting();
|
|
91
91
|
}
|
|
92
|
-
}, "Add existing content") : undefined
|
|
92
|
+
}, "Add existing content")) : undefined
|
|
93
93
|
});
|
|
94
94
|
} else if (props.canLinkEntity) {
|
|
95
95
|
return /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
@@ -100,7 +100,7 @@ function CombinedEntryLinkActions(props) {
|
|
|
100
100
|
props.onLinkExisting();
|
|
101
101
|
},
|
|
102
102
|
variant: "secondary",
|
|
103
|
-
startIcon: /*#__PURE__*/ _react.createElement(_f36icons.
|
|
103
|
+
startIcon: /*#__PURE__*/ _react.createElement(_f36icons.LinkSimpleIcon, null),
|
|
104
104
|
size: "small"
|
|
105
105
|
}, "Add existing content");
|
|
106
106
|
}
|
|
@@ -146,7 +146,7 @@ function CombinedAssetLinkActions(props) {
|
|
|
146
146
|
setOpen(true);
|
|
147
147
|
}
|
|
148
148
|
}, /*#__PURE__*/ _react.createElement(_f36components.Menu.Trigger, null, /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
149
|
-
endIcon: /*#__PURE__*/ _react.createElement(_f36icons.
|
|
149
|
+
endIcon: /*#__PURE__*/ _react.createElement(_f36icons.CaretDownIcon, null),
|
|
150
150
|
isDisabled: props.isDisabled,
|
|
151
151
|
testId: testIds.actionsWrapper,
|
|
152
152
|
className: _redesignStyles.action,
|
|
@@ -145,7 +145,7 @@ function LinkActions(props) {
|
|
|
145
145
|
props.onLinkExisting();
|
|
146
146
|
},
|
|
147
147
|
variant: "secondary",
|
|
148
|
-
startIcon: /*#__PURE__*/ _react.createElement(_f36icons.
|
|
148
|
+
startIcon: /*#__PURE__*/ _react.createElement(_f36icons.LinkSimpleIcon, null),
|
|
149
149
|
size: "small"
|
|
150
150
|
}, labels.linkExisting({
|
|
151
151
|
canLinkMultiple: props.canLinkMultiple
|
|
@@ -11,7 +11,13 @@ Object.defineProperty(exports, "MissingAssetCard", {
|
|
|
11
11
|
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
12
12
|
const _f36components = require("@contentful/f36-components");
|
|
13
13
|
const _f36icons = require("@contentful/f36-icons");
|
|
14
|
+
const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
|
|
14
15
|
const _styles = /*#__PURE__*/ _interop_require_wildcard(require("./styles"));
|
|
16
|
+
function _interop_require_default(obj) {
|
|
17
|
+
return obj && obj.__esModule ? obj : {
|
|
18
|
+
default: obj
|
|
19
|
+
};
|
|
20
|
+
}
|
|
15
21
|
function _getRequireWildcardCache(nodeInterop) {
|
|
16
22
|
if (typeof WeakMap !== "function") return null;
|
|
17
23
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -67,8 +73,8 @@ function MissingAssetCard(props) {
|
|
|
67
73
|
marginBottom: "none"
|
|
68
74
|
}, "Asset is missing or inaccessible")), !props.isDisabled && props.onRemove && /*#__PURE__*/ _react.createElement(_f36components.IconButton, {
|
|
69
75
|
variant: "transparent",
|
|
70
|
-
icon: /*#__PURE__*/ _react.createElement(_f36icons.
|
|
71
|
-
|
|
76
|
+
icon: /*#__PURE__*/ _react.createElement(_f36icons.XIcon, {
|
|
77
|
+
color: _f36tokens.default.gray600
|
|
72
78
|
}),
|
|
73
79
|
"aria-label": "Delete",
|
|
74
80
|
onClick: ()=>{
|
|
@@ -11,6 +11,7 @@ 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 _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
|
|
14
15
|
const _core = require("@lingui/core");
|
|
15
16
|
function _interop_require_default(obj) {
|
|
16
17
|
return obj && obj.__esModule ? obj : {
|
|
@@ -26,8 +27,8 @@ function MissingEntityCard({ as = 'a', providerName = 'Source', customMessage, i
|
|
|
26
27
|
if (isDisabled || !onRemove) return null;
|
|
27
28
|
return /*#__PURE__*/ _react.default.createElement(_f36components.IconButton, {
|
|
28
29
|
"aria-label": "Actions",
|
|
29
|
-
icon: /*#__PURE__*/ _react.default.createElement(_f36icons.
|
|
30
|
-
|
|
30
|
+
icon: /*#__PURE__*/ _react.default.createElement(_f36icons.XIcon, {
|
|
31
|
+
color: _f36tokens.default.gray600
|
|
31
32
|
}),
|
|
32
33
|
size: "small",
|
|
33
34
|
variant: "transparent",
|
|
@@ -11,9 +11,15 @@ Object.defineProperty(exports, "FunctionInvocationErrorCard", {
|
|
|
11
11
|
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
12
12
|
const _f36components = require("@contentful/f36-components");
|
|
13
13
|
const _f36icons = require("@contentful/f36-icons");
|
|
14
|
+
const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
|
|
14
15
|
const _core = require("@lingui/core");
|
|
15
16
|
const _ = require("..");
|
|
16
17
|
const _EntityStore = require("../../common/EntityStore");
|
|
18
|
+
function _interop_require_default(obj) {
|
|
19
|
+
return obj && obj.__esModule ? obj : {
|
|
20
|
+
default: obj
|
|
21
|
+
};
|
|
22
|
+
}
|
|
17
23
|
function _getRequireWildcardCache(nodeInterop) {
|
|
18
24
|
if (typeof WeakMap !== "function") return null;
|
|
19
25
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -70,8 +76,8 @@ function FunctionInvocationErrorCard({ providerName = 'Source', organizationId,
|
|
|
70
76
|
}, /*#__PURE__*/ _react.createElement(_f36components.Flex, {
|
|
71
77
|
justifyContent: "left",
|
|
72
78
|
alignItems: "center"
|
|
73
|
-
}, /*#__PURE__*/ _react.createElement(_f36icons.
|
|
74
|
-
|
|
79
|
+
}, /*#__PURE__*/ _react.createElement(_f36icons.WarningOctagonIcon, {
|
|
80
|
+
color: _f36tokens.default.colorNegative
|
|
75
81
|
}), /*#__PURE__*/ _react.createElement(_f36components.Text, {
|
|
76
82
|
fontColor: "colorNegative"
|
|
77
83
|
}, " ", _core.i18n._({
|
|
@@ -84,7 +90,7 @@ function FunctionInvocationErrorCard({ providerName = 'Source', organizationId,
|
|
|
84
90
|
message: "For more information, go to"
|
|
85
91
|
}), " ", /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
|
|
86
92
|
testId: "cf-ui-function-invocation-log-link",
|
|
87
|
-
icon: /*#__PURE__*/ _react.createElement(_f36icons.
|
|
93
|
+
icon: /*#__PURE__*/ _react.createElement(_f36icons.ArrowSquareOutIcon, null),
|
|
88
94
|
target: "_blank",
|
|
89
95
|
alignIcon: "end",
|
|
90
96
|
href: functionLink
|
|
@@ -84,7 +84,7 @@ function SpaceName(props) {
|
|
|
84
84
|
}, /*#__PURE__*/ _react.createElement(_f36components.Flex, {
|
|
85
85
|
alignItems: "center",
|
|
86
86
|
gap: "spacingXs"
|
|
87
|
-
}, /*#__PURE__*/ _react.createElement(_f36icons.
|
|
87
|
+
}, /*#__PURE__*/ _react.createElement(_f36icons.FolderOpenIcon, {
|
|
88
88
|
className: styles.spaceIcon,
|
|
89
89
|
size: "tiny",
|
|
90
90
|
"aria-label": "Source space"
|
|
@@ -144,14 +144,14 @@ function WrappedEntryCard({ entry, entryUrl, contentType, activeLocales, localeC
|
|
|
144
144
|
withDragHandle: !!renderDragHandle && !isDisabled,
|
|
145
145
|
draggable: !!renderDragHandle && !isDisabled,
|
|
146
146
|
actions: onEdit || onRemove ? [
|
|
147
|
-
hasCardEditActions && onEdit ? /*#__PURE__*/ _react.createElement(_f36components.
|
|
147
|
+
hasCardEditActions && onEdit ? /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
|
|
148
148
|
key: "edit",
|
|
149
149
|
testId: "edit",
|
|
150
150
|
onClick: ()=>{
|
|
151
151
|
onEdit && onEdit();
|
|
152
152
|
}
|
|
153
153
|
}, "Edit") : null,
|
|
154
|
-
hasCardRemoveActions && onRemove && !isDisabled ? /*#__PURE__*/ _react.createElement(_f36components.
|
|
154
|
+
hasCardRemoveActions && onRemove && !isDisabled ? /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
|
|
155
155
|
key: "delete",
|
|
156
156
|
testId: "delete",
|
|
157
157
|
onClick: ()=>{
|
|
@@ -161,17 +161,19 @@ function WrappedEntryCard({ entry, entryUrl, contentType, activeLocales, localeC
|
|
|
161
161
|
hasCardMoveActions && (onMoveTop || onMoveBottom) && !isDisabled ? /*#__PURE__*/ _react.createElement(_f36components.MenuDivider, {
|
|
162
162
|
key: "divider"
|
|
163
163
|
}) : null,
|
|
164
|
-
hasCardMoveActions && onMoveTop && !isDisabled ? /*#__PURE__*/ _react.createElement(_f36components.
|
|
164
|
+
hasCardMoveActions && onMoveTop && !isDisabled ? /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
|
|
165
165
|
key: "move-top",
|
|
166
166
|
onClick: ()=>onMoveTop && onMoveTop(),
|
|
167
167
|
testId: "move-top"
|
|
168
168
|
}, "Move to top") : null,
|
|
169
|
-
hasCardMoveActions && onMoveBottom && !isDisabled ? /*#__PURE__*/ _react.createElement(_f36components.
|
|
169
|
+
hasCardMoveActions && onMoveBottom && !isDisabled ? /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
|
|
170
170
|
key: "move-bottom",
|
|
171
171
|
onClick: ()=>onMoveBottom && onMoveBottom(),
|
|
172
172
|
testId: "move-bottom"
|
|
173
173
|
}, "Move to bottom") : null
|
|
174
|
-
].filter((item)=>item)
|
|
174
|
+
].filter((item)=>item).map((item, i)=>/*#__PURE__*/ _react.createElement(_f36components.Menu, {
|
|
175
|
+
key: i
|
|
176
|
+
}, item)) : [],
|
|
175
177
|
onClick: isClickable ? (e)=>{
|
|
176
178
|
e.preventDefault();
|
|
177
179
|
if (onClick) return onClick(e);
|
|
@@ -67,7 +67,9 @@ export function renderAssetInfo(props) {
|
|
|
67
67
|
as: "dd",
|
|
68
68
|
isTruncated: true
|
|
69
69
|
}, mimeType)), fileSize && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("dt", null, "Size:"), /*#__PURE__*/ React.createElement("dd", null, shortenStorageUnit(fileSize, 'B'))), image && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("dt", null, "Dimensions:"), /*#__PURE__*/ React.createElement("dd", null, `${image.width} × ${image.height}`))))
|
|
70
|
-
]
|
|
70
|
+
].map((item, i)=>/*#__PURE__*/ React.createElement(Menu, {
|
|
71
|
+
key: i
|
|
72
|
+
}, item));
|
|
71
73
|
}
|
|
72
74
|
export function renderActions(props) {
|
|
73
75
|
const { entityFile, isDisabled, onEdit, onRemove } = props;
|
|
@@ -94,5 +96,7 @@ export function renderActions(props) {
|
|
|
94
96
|
onClick: onRemove,
|
|
95
97
|
testId: "card-action-remove"
|
|
96
98
|
}, "Remove") : null
|
|
97
|
-
].filter((item)=>item)
|
|
99
|
+
].filter((item)=>item).map((item, i)=>/*#__PURE__*/ React.createElement(Menu, {
|
|
100
|
+
key: i
|
|
101
|
+
}, item));
|
|
98
102
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Button } from '@contentful/f36-components';
|
|
3
|
-
import {
|
|
3
|
+
import { CaretDownIcon, PlusIcon } from '@contentful/f36-icons';
|
|
4
4
|
import tokens from '@contentful/f36-tokens';
|
|
5
5
|
import { css } from 'emotion';
|
|
6
6
|
import get from 'lodash/get';
|
|
@@ -36,7 +36,7 @@ export const CreateEntryLinkButton = ({ contentTypes, onSelect, customDropdownIt
|
|
|
36
36
|
dropdownSettings: dropdownSettings,
|
|
37
37
|
customDropdownItems: customDropdownItems
|
|
38
38
|
}, ({ isSelecting })=>/*#__PURE__*/ React.createElement(Button, {
|
|
39
|
-
endIcon: hasDropdown ? /*#__PURE__*/ React.createElement(
|
|
39
|
+
endIcon: hasDropdown ? /*#__PURE__*/ React.createElement(CaretDownIcon, null) : undefined,
|
|
40
40
|
variant: "secondary",
|
|
41
41
|
className: styles.action,
|
|
42
42
|
isDisabled: disabled || isSelecting,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect, useMemo } from 'react';
|
|
2
2
|
import { TextInput, Menu } from '@contentful/f36-components';
|
|
3
|
-
import {
|
|
3
|
+
import { MagnifyingGlassIcon } from '@contentful/f36-icons';
|
|
4
4
|
import tokens from '@contentful/f36-tokens';
|
|
5
5
|
import { css } from 'emotion';
|
|
6
6
|
import get from 'lodash/get';
|
|
@@ -134,7 +134,7 @@ export const CreateEntryMenuTrigger = ({ contentTypes, suggestedContentTypeId, c
|
|
|
134
134
|
testId: "add-entry-menu-search",
|
|
135
135
|
value: searchInput,
|
|
136
136
|
onChange: (e)=>setSearchInput(e.target.value)
|
|
137
|
-
}), /*#__PURE__*/ React.createElement(
|
|
137
|
+
}), /*#__PURE__*/ React.createElement(MagnifyingGlassIcon, {
|
|
138
138
|
className: styles.searchIcon
|
|
139
139
|
})), /*#__PURE__*/ React.createElement(Menu.Divider, null)), searchInput && renderSearchResultsCount(searchFilteredContentTypes.length), suggestedContentType && !searchInput && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Menu.SectionTitle, null, "Suggested Content Type"), /*#__PURE__*/ React.createElement(Menu.Item, {
|
|
140
140
|
testId: "suggested",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Button, Menu } from '@contentful/f36-components';
|
|
3
|
-
import {
|
|
3
|
+
import { CaretDownIcon, LinkSimpleIcon, PlusIcon } from '@contentful/f36-icons';
|
|
4
4
|
import { CreateEntryLinkButton } from '../CreateEntryLinkButton/CreateEntryLinkButton';
|
|
5
5
|
import { testIds as sharedTextIds } from './LinkActions';
|
|
6
6
|
import { NoLinkPermissionsInfo } from './NoLinkPermissionsInfo';
|
|
@@ -33,12 +33,12 @@ function CombinedEntryLinkActions(props) {
|
|
|
33
33
|
onSelect: (contentTypeId)=>{
|
|
34
34
|
return contentTypeId ? props.onCreate(contentTypeId) : Promise.resolve();
|
|
35
35
|
},
|
|
36
|
-
customDropdownItems: props.canLinkEntity ? /*#__PURE__*/ React.createElement(Menu.Item, {
|
|
36
|
+
customDropdownItems: props.canLinkEntity ? /*#__PURE__*/ React.createElement(Menu, null, /*#__PURE__*/ React.createElement(Menu.Item, {
|
|
37
37
|
testId: testIds.linkExisting,
|
|
38
38
|
onClick: ()=>{
|
|
39
39
|
props.onLinkExisting();
|
|
40
40
|
}
|
|
41
|
-
}, "Add existing content") : undefined
|
|
41
|
+
}, "Add existing content")) : undefined
|
|
42
42
|
});
|
|
43
43
|
} else if (props.canLinkEntity) {
|
|
44
44
|
return /*#__PURE__*/ React.createElement(Button, {
|
|
@@ -49,7 +49,7 @@ function CombinedEntryLinkActions(props) {
|
|
|
49
49
|
props.onLinkExisting();
|
|
50
50
|
},
|
|
51
51
|
variant: "secondary",
|
|
52
|
-
startIcon: /*#__PURE__*/ React.createElement(
|
|
52
|
+
startIcon: /*#__PURE__*/ React.createElement(LinkSimpleIcon, null),
|
|
53
53
|
size: "small"
|
|
54
54
|
}, "Add existing content");
|
|
55
55
|
}
|
|
@@ -95,7 +95,7 @@ function CombinedAssetLinkActions(props) {
|
|
|
95
95
|
setOpen(true);
|
|
96
96
|
}
|
|
97
97
|
}, /*#__PURE__*/ React.createElement(Menu.Trigger, null, /*#__PURE__*/ React.createElement(Button, {
|
|
98
|
-
endIcon: /*#__PURE__*/ React.createElement(
|
|
98
|
+
endIcon: /*#__PURE__*/ React.createElement(CaretDownIcon, null),
|
|
99
99
|
isDisabled: props.isDisabled,
|
|
100
100
|
testId: testIds.actionsWrapper,
|
|
101
101
|
className: styles.action,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Button } from '@contentful/f36-components';
|
|
3
|
-
import {
|
|
3
|
+
import { LinkSimpleIcon, PlusIcon } from '@contentful/f36-icons';
|
|
4
4
|
import { i18n as $_i18n } from "@lingui/core";
|
|
5
5
|
import { CreateEntryLinkButton } from '../CreateEntryLinkButton/CreateEntryLinkButton';
|
|
6
6
|
import { NoLinkPermissionsInfo } from './NoLinkPermissionsInfo';
|
|
@@ -86,7 +86,7 @@ export function LinkActions(props) {
|
|
|
86
86
|
props.onLinkExisting();
|
|
87
87
|
},
|
|
88
88
|
variant: "secondary",
|
|
89
|
-
startIcon: /*#__PURE__*/ React.createElement(
|
|
89
|
+
startIcon: /*#__PURE__*/ React.createElement(LinkSimpleIcon, null),
|
|
90
90
|
size: "small"
|
|
91
91
|
}, labels.linkExisting({
|
|
92
92
|
canLinkMultiple: props.canLinkMultiple
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Card, Flex, IconButton, SectionHeading } from '@contentful/f36-components';
|
|
3
|
-
import {
|
|
3
|
+
import { XIcon } from '@contentful/f36-icons';
|
|
4
|
+
import tokens from '@contentful/f36-tokens';
|
|
4
5
|
import * as styles from './styles';
|
|
5
6
|
export function MissingAssetCard(props) {
|
|
6
7
|
return /*#__PURE__*/ React.createElement(Card, {
|
|
@@ -16,8 +17,8 @@ export function MissingAssetCard(props) {
|
|
|
16
17
|
marginBottom: "none"
|
|
17
18
|
}, "Asset is missing or inaccessible")), !props.isDisabled && props.onRemove && /*#__PURE__*/ React.createElement(IconButton, {
|
|
18
19
|
variant: "transparent",
|
|
19
|
-
icon: /*#__PURE__*/ React.createElement(
|
|
20
|
-
|
|
20
|
+
icon: /*#__PURE__*/ React.createElement(XIcon, {
|
|
21
|
+
color: tokens.gray600
|
|
21
22
|
}),
|
|
22
23
|
"aria-label": "Delete",
|
|
23
24
|
onClick: ()=>{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EntryCard, IconButton } from '@contentful/f36-components';
|
|
3
|
-
import {
|
|
3
|
+
import { XIcon } from '@contentful/f36-icons';
|
|
4
|
+
import tokens from '@contentful/f36-tokens';
|
|
4
5
|
import { i18n as $_i18n } from "@lingui/core";
|
|
5
6
|
export function MissingEntityCard({ as = 'a', providerName = 'Source', customMessage, isDisabled, isSelected, onRemove, testId = 'cf-ui-missing-entity-card', children }) {
|
|
6
7
|
const description = customMessage ?? $_i18n._({
|
|
@@ -11,8 +12,8 @@ export function MissingEntityCard({ as = 'a', providerName = 'Source', customMes
|
|
|
11
12
|
if (isDisabled || !onRemove) return null;
|
|
12
13
|
return /*#__PURE__*/ React.createElement(IconButton, {
|
|
13
14
|
"aria-label": "Actions",
|
|
14
|
-
icon: /*#__PURE__*/ React.createElement(
|
|
15
|
-
|
|
15
|
+
icon: /*#__PURE__*/ React.createElement(XIcon, {
|
|
16
|
+
color: tokens.gray600
|
|
16
17
|
}),
|
|
17
18
|
size: "small",
|
|
18
19
|
variant: "transparent",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Flex, Text, TextLink } from '@contentful/f36-components';
|
|
3
|
-
import {
|
|
3
|
+
import { WarningOctagonIcon, ArrowSquareOutIcon } from '@contentful/f36-icons';
|
|
4
|
+
import tokens from '@contentful/f36-tokens';
|
|
4
5
|
import { i18n as $_i18n } from "@lingui/core";
|
|
5
6
|
import { MissingEntityCard } from '..';
|
|
6
7
|
import { useResourceProvider } from '../../common/EntityStore';
|
|
@@ -19,8 +20,8 @@ export function FunctionInvocationErrorCard({ providerName = 'Source', organizat
|
|
|
19
20
|
}, /*#__PURE__*/ React.createElement(Flex, {
|
|
20
21
|
justifyContent: "left",
|
|
21
22
|
alignItems: "center"
|
|
22
|
-
}, /*#__PURE__*/ React.createElement(
|
|
23
|
-
|
|
23
|
+
}, /*#__PURE__*/ React.createElement(WarningOctagonIcon, {
|
|
24
|
+
color: tokens.colorNegative
|
|
24
25
|
}), /*#__PURE__*/ React.createElement(Text, {
|
|
25
26
|
fontColor: "colorNegative"
|
|
26
27
|
}, " ", $_i18n._({
|
|
@@ -33,7 +34,7 @@ export function FunctionInvocationErrorCard({ providerName = 'Source', organizat
|
|
|
33
34
|
message: "For more information, go to"
|
|
34
35
|
}), " ", /*#__PURE__*/ React.createElement(TextLink, {
|
|
35
36
|
testId: "cf-ui-function-invocation-log-link",
|
|
36
|
-
icon: /*#__PURE__*/ React.createElement(
|
|
37
|
+
icon: /*#__PURE__*/ React.createElement(ArrowSquareOutIcon, null),
|
|
37
38
|
target: "_blank",
|
|
38
39
|
alignIcon: "end",
|
|
39
40
|
href: functionLink
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Flex, Text, Tooltip } from '@contentful/f36-components';
|
|
3
|
-
import {
|
|
3
|
+
import { FolderOpenIcon } from '@contentful/f36-icons';
|
|
4
4
|
import tokens from '@contentful/f36-tokens';
|
|
5
5
|
import { css } from 'emotion';
|
|
6
6
|
const styles = {
|
|
@@ -28,7 +28,7 @@ export function SpaceName(props) {
|
|
|
28
28
|
}, /*#__PURE__*/ React.createElement(Flex, {
|
|
29
29
|
alignItems: "center",
|
|
30
30
|
gap: "spacingXs"
|
|
31
|
-
}, /*#__PURE__*/ React.createElement(
|
|
31
|
+
}, /*#__PURE__*/ React.createElement(FolderOpenIcon, {
|
|
32
32
|
className: styles.spaceIcon,
|
|
33
33
|
size: "tiny",
|
|
34
34
|
"aria-label": "Source space"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { EntryCard,
|
|
2
|
+
import { EntryCard, Menu, MenuDivider } from '@contentful/f36-components';
|
|
3
3
|
import { entityHelpers, isValidImage } from '@contentful/field-editor-shared';
|
|
4
4
|
import { AssetThumbnail, MissingEntityCard, EntityStatusBadge } from '../../components';
|
|
5
5
|
import { SpaceName } from '../../components/SpaceName/SpaceName';
|
|
@@ -93,14 +93,14 @@ export function WrappedEntryCard({ entry, entryUrl, contentType, activeLocales,
|
|
|
93
93
|
withDragHandle: !!renderDragHandle && !isDisabled,
|
|
94
94
|
draggable: !!renderDragHandle && !isDisabled,
|
|
95
95
|
actions: onEdit || onRemove ? [
|
|
96
|
-
hasCardEditActions && onEdit ? /*#__PURE__*/ React.createElement(
|
|
96
|
+
hasCardEditActions && onEdit ? /*#__PURE__*/ React.createElement(Menu.Item, {
|
|
97
97
|
key: "edit",
|
|
98
98
|
testId: "edit",
|
|
99
99
|
onClick: ()=>{
|
|
100
100
|
onEdit && onEdit();
|
|
101
101
|
}
|
|
102
102
|
}, "Edit") : null,
|
|
103
|
-
hasCardRemoveActions && onRemove && !isDisabled ? /*#__PURE__*/ React.createElement(
|
|
103
|
+
hasCardRemoveActions && onRemove && !isDisabled ? /*#__PURE__*/ React.createElement(Menu.Item, {
|
|
104
104
|
key: "delete",
|
|
105
105
|
testId: "delete",
|
|
106
106
|
onClick: ()=>{
|
|
@@ -110,17 +110,19 @@ export function WrappedEntryCard({ entry, entryUrl, contentType, activeLocales,
|
|
|
110
110
|
hasCardMoveActions && (onMoveTop || onMoveBottom) && !isDisabled ? /*#__PURE__*/ React.createElement(MenuDivider, {
|
|
111
111
|
key: "divider"
|
|
112
112
|
}) : null,
|
|
113
|
-
hasCardMoveActions && onMoveTop && !isDisabled ? /*#__PURE__*/ React.createElement(
|
|
113
|
+
hasCardMoveActions && onMoveTop && !isDisabled ? /*#__PURE__*/ React.createElement(Menu.Item, {
|
|
114
114
|
key: "move-top",
|
|
115
115
|
onClick: ()=>onMoveTop && onMoveTop(),
|
|
116
116
|
testId: "move-top"
|
|
117
117
|
}, "Move to top") : null,
|
|
118
|
-
hasCardMoveActions && onMoveBottom && !isDisabled ? /*#__PURE__*/ React.createElement(
|
|
118
|
+
hasCardMoveActions && onMoveBottom && !isDisabled ? /*#__PURE__*/ React.createElement(Menu.Item, {
|
|
119
119
|
key: "move-bottom",
|
|
120
120
|
onClick: ()=>onMoveBottom && onMoveBottom(),
|
|
121
121
|
testId: "move-bottom"
|
|
122
122
|
}, "Move to bottom") : null
|
|
123
|
-
].filter((item)=>item)
|
|
123
|
+
].filter((item)=>item).map((item, i)=>/*#__PURE__*/ React.createElement(Menu, {
|
|
124
|
+
key: i
|
|
125
|
+
}, item)) : [],
|
|
124
126
|
onClick: isClickable ? (e)=>{
|
|
125
127
|
e.preventDefault();
|
|
126
128
|
if (onClick) return onClick(e);
|
|
@@ -15,5 +15,5 @@ interface CreateEntryLinkButtonProps {
|
|
|
15
15
|
position: 'bottom-left' | 'bottom-right';
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
export declare const CreateEntryLinkButton: ({ contentTypes, onSelect, customDropdownItems, text, testId, hasPlusIcon, useExperimentalStyles, suggestedContentTypeId, dropdownSettings, disabled
|
|
18
|
+
export declare const CreateEntryLinkButton: ({ contentTypes, onSelect, customDropdownItems, text, testId, hasPlusIcon, useExperimentalStyles, suggestedContentTypeId, dropdownSettings, disabled }: CreateEntryLinkButtonProps) => React.JSX.Element;
|
|
19
19
|
export {};
|
|
@@ -6,7 +6,7 @@ type CreateEntryMenuTriggerChildProps = {
|
|
|
6
6
|
isSelecting: boolean;
|
|
7
7
|
};
|
|
8
8
|
export type CreateEntryMenuTriggerChild = (props: CreateEntryMenuTriggerChildProps) => React.ReactElement;
|
|
9
|
-
export type CreateCustomEntryMenuItems = ({ closeMenu
|
|
9
|
+
export type CreateCustomEntryMenuItems = ({ closeMenu }: {
|
|
10
10
|
closeMenu: Function;
|
|
11
11
|
}) => React.ReactElement;
|
|
12
12
|
interface CreateEntryMenuTrigger {
|
|
@@ -25,7 +25,7 @@ interface CreateEntryMenuTrigger {
|
|
|
25
25
|
filterExperienceTypes?: boolean;
|
|
26
26
|
}
|
|
27
27
|
export declare const CreateEntryMenuTrigger: {
|
|
28
|
-
({ contentTypes, suggestedContentTypeId, contentTypesLabel, onSelect, testId, dropdownSettings, customDropdownItems, children, menuProps, filterExperienceTypes
|
|
28
|
+
({ contentTypes, suggestedContentTypeId, contentTypesLabel, onSelect, testId, dropdownSettings, customDropdownItems, children, menuProps, filterExperienceTypes }: CreateEntryMenuTrigger): React.JSX.Element;
|
|
29
29
|
defaultProps: {
|
|
30
30
|
testId: string;
|
|
31
31
|
contentTypesLabel: string;
|
|
@@ -7,5 +7,5 @@ type FunctionInvocationErrorCardProps = {
|
|
|
7
7
|
onRemove?: Function;
|
|
8
8
|
providerName?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function FunctionInvocationErrorCard({ providerName, organizationId, appDefinitionId, isDisabled, isSelected, onRemove
|
|
10
|
+
export declare function FunctionInvocationErrorCard({ providerName, organizationId, appDefinitionId, isDisabled, isSelected, onRemove }: FunctionInvocationErrorCardProps): React.JSX.Element;
|
|
11
11
|
export {};
|
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.8",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"tsc": "tsc -p ./ --noEmit"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@contentful/f36-components": "
|
|
40
|
-
"@contentful/f36-icons": "
|
|
41
|
-
"@contentful/f36-tokens": "
|
|
42
|
-
"@contentful/field-editor-shared": "^2.11.
|
|
39
|
+
"@contentful/f36-components": "5.1.1",
|
|
40
|
+
"@contentful/f36-icons": "5.1.1",
|
|
41
|
+
"@contentful/f36-tokens": "5.1.0",
|
|
42
|
+
"@contentful/field-editor-shared": "^2.11.2",
|
|
43
43
|
"@contentful/mimetype": "^2.2.29",
|
|
44
44
|
"@dnd-kit/core": "^6.0.8",
|
|
45
45
|
"@dnd-kit/modifiers": "^7.0.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@contentful/app-sdk": "^4.29.0",
|
|
58
|
-
"@contentful/field-editor-test-utils": "^1.6.
|
|
58
|
+
"@contentful/field-editor-test-utils": "^1.6.1",
|
|
59
59
|
"@lingui/core": "5.3.0",
|
|
60
60
|
"@testing-library/react-hooks": "^8.0.1"
|
|
61
61
|
},
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"registry": "https://npm.pkg.github.com/"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "8ab6bd7a3ce2979634ab53673c6b122a6b1b5efb"
|
|
71
71
|
}
|