@contentful/field-editor-reference 6.11.2 → 6.12.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/assets/WrappedAssetCard/AssetCardActions.js +8 -12
- package/dist/cjs/entries/WrappedEntryCard/WrappedEntryCard.js +5 -7
- package/dist/esm/assets/WrappedAssetCard/AssetCardActions.js +9 -13
- package/dist/esm/entries/WrappedEntryCard/WrappedEntryCard.js +6 -8
- package/dist/types/assets/WrappedAssetCard/AssetCardActions.d.ts +1 -1
- package/package.json +5 -5
|
@@ -114,10 +114,10 @@ function renderAssetInfo(props) {
|
|
|
114
114
|
const fileSize = (0, _get.default)(entityFile, 'details.size');
|
|
115
115
|
const image = (0, _get.default)(entityFile, 'details.image');
|
|
116
116
|
return [
|
|
117
|
-
/*#__PURE__*/ _react.createElement(_f36components.
|
|
117
|
+
/*#__PURE__*/ _react.createElement(_f36components.MenuSectionTitle, {
|
|
118
118
|
key: "file-section"
|
|
119
119
|
}, "File info"),
|
|
120
|
-
/*#__PURE__*/ _react.createElement(_f36components.
|
|
120
|
+
/*#__PURE__*/ _react.createElement(_f36components.MenuItem, {
|
|
121
121
|
key: "file-information",
|
|
122
122
|
className: styles.fileInformation.menuItem,
|
|
123
123
|
isDisabled: true,
|
|
@@ -131,22 +131,20 @@ 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
|
-
]
|
|
135
|
-
key: i
|
|
136
|
-
}, item));
|
|
134
|
+
];
|
|
137
135
|
}
|
|
138
136
|
function renderActions(props) {
|
|
139
137
|
const { entityFile, isDisabled, onEdit, onRemove } = props;
|
|
140
138
|
return [
|
|
141
|
-
/*#__PURE__*/ _react.createElement(_f36components.
|
|
139
|
+
/*#__PURE__*/ _react.createElement(_f36components.MenuSectionTitle, {
|
|
142
140
|
key: "section-title"
|
|
143
141
|
}, "Actions"),
|
|
144
|
-
onEdit ? /*#__PURE__*/ _react.createElement(_f36components.
|
|
142
|
+
onEdit ? /*#__PURE__*/ _react.createElement(_f36components.MenuItem, {
|
|
145
143
|
key: "edit",
|
|
146
144
|
onClick: onEdit,
|
|
147
145
|
testId: "card-action-edit"
|
|
148
146
|
}, "Edit") : null,
|
|
149
|
-
entityFile ? /*#__PURE__*/ _react.createElement(_f36components.
|
|
147
|
+
entityFile ? /*#__PURE__*/ _react.createElement(_f36components.MenuItem, {
|
|
150
148
|
key: "download",
|
|
151
149
|
onClick: ()=>{
|
|
152
150
|
if (typeof entityFile.url === 'string') {
|
|
@@ -155,12 +153,10 @@ function renderActions(props) {
|
|
|
155
153
|
},
|
|
156
154
|
testId: "card-action-download"
|
|
157
155
|
}, "Download") : null,
|
|
158
|
-
onRemove && !isDisabled ? /*#__PURE__*/ _react.createElement(_f36components.
|
|
156
|
+
onRemove && !isDisabled ? /*#__PURE__*/ _react.createElement(_f36components.MenuItem, {
|
|
159
157
|
key: "remove",
|
|
160
158
|
onClick: onRemove,
|
|
161
159
|
testId: "card-action-remove"
|
|
162
160
|
}, "Remove") : null
|
|
163
|
-
].filter((item)=>item)
|
|
164
|
-
key: i
|
|
165
|
-
}, item));
|
|
161
|
+
].filter((item)=>item);
|
|
166
162
|
}
|
|
@@ -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.MenuItem, {
|
|
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.MenuItem, {
|
|
155
155
|
key: "delete",
|
|
156
156
|
testId: "delete",
|
|
157
157
|
onClick: ()=>{
|
|
@@ -161,19 +161,17 @@ 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.MenuItem, {
|
|
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.MenuItem, {
|
|
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)
|
|
175
|
-
key: i
|
|
176
|
-
}, item)) : [],
|
|
174
|
+
].filter((item)=>item) : [],
|
|
177
175
|
onClick: isClickable ? (e)=>{
|
|
178
176
|
e.preventDefault();
|
|
179
177
|
if (onClick) return onClick(e);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { MenuItem, Text, MenuSectionTitle } from '@contentful/f36-components';
|
|
3
3
|
import tokens from '@contentful/f36-tokens';
|
|
4
4
|
import { shortenStorageUnit } from '@contentful/field-editor-shared';
|
|
5
5
|
import { css } from 'emotion';
|
|
@@ -50,10 +50,10 @@ export function renderAssetInfo(props) {
|
|
|
50
50
|
const fileSize = get(entityFile, 'details.size');
|
|
51
51
|
const image = get(entityFile, 'details.image');
|
|
52
52
|
return [
|
|
53
|
-
/*#__PURE__*/ React.createElement(
|
|
53
|
+
/*#__PURE__*/ React.createElement(MenuSectionTitle, {
|
|
54
54
|
key: "file-section"
|
|
55
55
|
}, "File info"),
|
|
56
|
-
/*#__PURE__*/ React.createElement(
|
|
56
|
+
/*#__PURE__*/ React.createElement(MenuItem, {
|
|
57
57
|
key: "file-information",
|
|
58
58
|
className: styles.fileInformation.menuItem,
|
|
59
59
|
isDisabled: true,
|
|
@@ -67,22 +67,20 @@ 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
|
-
]
|
|
71
|
-
key: i
|
|
72
|
-
}, item));
|
|
70
|
+
];
|
|
73
71
|
}
|
|
74
72
|
export function renderActions(props) {
|
|
75
73
|
const { entityFile, isDisabled, onEdit, onRemove } = props;
|
|
76
74
|
return [
|
|
77
|
-
/*#__PURE__*/ React.createElement(
|
|
75
|
+
/*#__PURE__*/ React.createElement(MenuSectionTitle, {
|
|
78
76
|
key: "section-title"
|
|
79
77
|
}, "Actions"),
|
|
80
|
-
onEdit ? /*#__PURE__*/ React.createElement(
|
|
78
|
+
onEdit ? /*#__PURE__*/ React.createElement(MenuItem, {
|
|
81
79
|
key: "edit",
|
|
82
80
|
onClick: onEdit,
|
|
83
81
|
testId: "card-action-edit"
|
|
84
82
|
}, "Edit") : null,
|
|
85
|
-
entityFile ? /*#__PURE__*/ React.createElement(
|
|
83
|
+
entityFile ? /*#__PURE__*/ React.createElement(MenuItem, {
|
|
86
84
|
key: "download",
|
|
87
85
|
onClick: ()=>{
|
|
88
86
|
if (typeof entityFile.url === 'string') {
|
|
@@ -91,12 +89,10 @@ export function renderActions(props) {
|
|
|
91
89
|
},
|
|
92
90
|
testId: "card-action-download"
|
|
93
91
|
}, "Download") : null,
|
|
94
|
-
onRemove && !isDisabled ? /*#__PURE__*/ React.createElement(
|
|
92
|
+
onRemove && !isDisabled ? /*#__PURE__*/ React.createElement(MenuItem, {
|
|
95
93
|
key: "remove",
|
|
96
94
|
onClick: onRemove,
|
|
97
95
|
testId: "card-action-remove"
|
|
98
96
|
}, "Remove") : null
|
|
99
|
-
].filter((item)=>item)
|
|
100
|
-
key: i
|
|
101
|
-
}, item));
|
|
97
|
+
].filter((item)=>item);
|
|
102
98
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { EntryCard,
|
|
2
|
+
import { EntryCard, MenuDivider, MenuItem } 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(MenuItem, {
|
|
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(MenuItem, {
|
|
104
104
|
key: "delete",
|
|
105
105
|
testId: "delete",
|
|
106
106
|
onClick: ()=>{
|
|
@@ -110,19 +110,17 @@ 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(MenuItem, {
|
|
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(MenuItem, {
|
|
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)
|
|
124
|
-
key: i
|
|
125
|
-
}, item)) : [],
|
|
123
|
+
].filter((item)=>item) : [],
|
|
126
124
|
onClick: isClickable ? (e)=>{
|
|
127
125
|
e.preventDefault();
|
|
128
126
|
if (onClick) return onClick(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-reference",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.12.1",
|
|
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": "^5.
|
|
40
|
-
"@contentful/f36-icons": "^5.4.
|
|
39
|
+
"@contentful/f36-components": "^5.4.1",
|
|
40
|
+
"@contentful/f36-icons": "^5.4.1",
|
|
41
41
|
"@contentful/f36-tokens": "^5.1.0",
|
|
42
|
-
"@contentful/field-editor-shared": "^2.12.
|
|
42
|
+
"@contentful/field-editor-shared": "^2.12.3",
|
|
43
43
|
"@contentful/mimetype": "^2.2.29",
|
|
44
44
|
"@dnd-kit/core": "^6.0.8",
|
|
45
45
|
"@dnd-kit/modifiers": "^7.0.0",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"registry": "https://npm.pkg.github.com/"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "72fc78dc2c8b5431b6740852965a1ce3ccb4c997"
|
|
71
71
|
}
|