@contentful/field-editor-reference 5.17.0 → 5.18.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.
|
@@ -18,7 +18,9 @@ _export(exports, {
|
|
|
18
18
|
});
|
|
19
19
|
const _react = _interop_require_wildcard(require("react"));
|
|
20
20
|
const _f36components = require("@contentful/f36-components");
|
|
21
|
+
const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
|
|
21
22
|
const _fieldeditorshared = require("@contentful/field-editor-shared");
|
|
23
|
+
const _emotion = require("emotion");
|
|
22
24
|
const _get = _interop_require_default(require("lodash/get"));
|
|
23
25
|
function _interop_require_default(obj) {
|
|
24
26
|
return obj && obj.__esModule ? obj : {
|
|
@@ -64,6 +66,40 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
64
66
|
}
|
|
65
67
|
return newObj;
|
|
66
68
|
}
|
|
69
|
+
const styles = {
|
|
70
|
+
dragHandle: (0, _emotion.css)({
|
|
71
|
+
alignSelf: 'stretch'
|
|
72
|
+
}),
|
|
73
|
+
fileInformation: {
|
|
74
|
+
menuItem: (0, _emotion.css)({
|
|
75
|
+
opacity: 1
|
|
76
|
+
}),
|
|
77
|
+
dl: (0, _emotion.css)({
|
|
78
|
+
backgroundColor: _f36tokens.default.gray100,
|
|
79
|
+
borderRadius: _f36tokens.default.borderRadiusMedium,
|
|
80
|
+
padding: _f36tokens.default.spacingXs,
|
|
81
|
+
width: '200px',
|
|
82
|
+
lineHeight: _f36tokens.default.lineHeightS,
|
|
83
|
+
fontSize: _f36tokens.default.fontSizeS,
|
|
84
|
+
dt: {
|
|
85
|
+
font: 'inherit',
|
|
86
|
+
color: _f36tokens.default.gray700,
|
|
87
|
+
marginRight: _f36tokens.default.spacingXs,
|
|
88
|
+
paddingTop: _f36tokens.default.spacing2Xs,
|
|
89
|
+
paddingBottom: _f36tokens.default.spacing2Xs,
|
|
90
|
+
float: 'left',
|
|
91
|
+
clear: 'left'
|
|
92
|
+
},
|
|
93
|
+
dd: {
|
|
94
|
+
font: 'inherit',
|
|
95
|
+
marginLeft: 0,
|
|
96
|
+
color: _f36tokens.default.gray900,
|
|
97
|
+
paddingTop: _f36tokens.default.spacing2Xs,
|
|
98
|
+
paddingBottom: _f36tokens.default.spacing2Xs
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
};
|
|
67
103
|
function downloadAsset(url) {
|
|
68
104
|
window.open(url, '_blank', 'noopener,noreferrer');
|
|
69
105
|
}
|
|
@@ -77,23 +113,20 @@ function renderAssetInfo(props) {
|
|
|
77
113
|
_react.createElement(_f36components.Menu.SectionTitle, {
|
|
78
114
|
key: "file-section"
|
|
79
115
|
}, "File info"),
|
|
80
|
-
|
|
81
|
-
key: "file-
|
|
82
|
-
|
|
116
|
+
_react.createElement(_f36components.Menu.Item, {
|
|
117
|
+
key: "file-information",
|
|
118
|
+
className: styles.fileInformation.menuItem,
|
|
119
|
+
isDisabled: true
|
|
120
|
+
}, _react.createElement("dl", {
|
|
121
|
+
className: styles.fileInformation.dl
|
|
122
|
+
}, fileName && _react.createElement(_react.Fragment, null, _react.createElement("dt", null, "File Name:"), _react.createElement(_f36components.Text, {
|
|
123
|
+
as: "dd",
|
|
83
124
|
isTruncated: true
|
|
84
|
-
}, fileName)),
|
|
85
|
-
|
|
86
|
-
key: "file-type"
|
|
87
|
-
}, _react.createElement(_f36components.Text, {
|
|
125
|
+
}, fileName)), mimeType && _react.createElement(_react.Fragment, null, _react.createElement("dt", null, "File Type:"), _react.createElement(_f36components.Text, {
|
|
126
|
+
as: "dd",
|
|
88
127
|
isTruncated: true
|
|
89
|
-
}, mimeType)),
|
|
90
|
-
|
|
91
|
-
key: "file-size"
|
|
92
|
-
}, (0, _fieldeditorshared.shortenStorageUnit)(fileSize, 'B')),
|
|
93
|
-
image && _react.createElement(_f36components.Menu.Item, {
|
|
94
|
-
key: "file-dimentions"
|
|
95
|
-
}, `${image.width} × ${image.height}`)
|
|
96
|
-
].filter((item)=>item);
|
|
128
|
+
}, mimeType)), fileSize && _react.createElement(_react.Fragment, null, _react.createElement("dt", null, "Size:"), _react.createElement("dd", null, (0, _fieldeditorshared.shortenStorageUnit)(fileSize, 'B'))), image && _react.createElement(_react.Fragment, null, _react.createElement("dt", null, "Dimensions:"), _react.createElement("dd", null, `${image.width} × ${image.height}`))))
|
|
129
|
+
];
|
|
97
130
|
}
|
|
98
131
|
function renderActions(props) {
|
|
99
132
|
const { entityFile , isDisabled , onEdit , onRemove } = props;
|
|
@@ -1,7 +1,43 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Menu, Text } from '@contentful/f36-components';
|
|
3
|
+
import tokens from '@contentful/f36-tokens';
|
|
3
4
|
import { shortenStorageUnit } from '@contentful/field-editor-shared';
|
|
5
|
+
import { css } from 'emotion';
|
|
4
6
|
import get from 'lodash/get';
|
|
7
|
+
const styles = {
|
|
8
|
+
dragHandle: css({
|
|
9
|
+
alignSelf: 'stretch'
|
|
10
|
+
}),
|
|
11
|
+
fileInformation: {
|
|
12
|
+
menuItem: css({
|
|
13
|
+
opacity: 1
|
|
14
|
+
}),
|
|
15
|
+
dl: css({
|
|
16
|
+
backgroundColor: tokens.gray100,
|
|
17
|
+
borderRadius: tokens.borderRadiusMedium,
|
|
18
|
+
padding: tokens.spacingXs,
|
|
19
|
+
width: '200px',
|
|
20
|
+
lineHeight: tokens.lineHeightS,
|
|
21
|
+
fontSize: tokens.fontSizeS,
|
|
22
|
+
dt: {
|
|
23
|
+
font: 'inherit',
|
|
24
|
+
color: tokens.gray700,
|
|
25
|
+
marginRight: tokens.spacingXs,
|
|
26
|
+
paddingTop: tokens.spacing2Xs,
|
|
27
|
+
paddingBottom: tokens.spacing2Xs,
|
|
28
|
+
float: 'left',
|
|
29
|
+
clear: 'left'
|
|
30
|
+
},
|
|
31
|
+
dd: {
|
|
32
|
+
font: 'inherit',
|
|
33
|
+
marginLeft: 0,
|
|
34
|
+
color: tokens.gray900,
|
|
35
|
+
paddingTop: tokens.spacing2Xs,
|
|
36
|
+
paddingBottom: tokens.spacing2Xs
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
};
|
|
5
41
|
function downloadAsset(url) {
|
|
6
42
|
window.open(url, '_blank', 'noopener,noreferrer');
|
|
7
43
|
}
|
|
@@ -15,23 +51,20 @@ export function renderAssetInfo(props) {
|
|
|
15
51
|
React.createElement(Menu.SectionTitle, {
|
|
16
52
|
key: "file-section"
|
|
17
53
|
}, "File info"),
|
|
18
|
-
|
|
19
|
-
key: "file-
|
|
20
|
-
|
|
54
|
+
React.createElement(Menu.Item, {
|
|
55
|
+
key: "file-information",
|
|
56
|
+
className: styles.fileInformation.menuItem,
|
|
57
|
+
isDisabled: true
|
|
58
|
+
}, React.createElement("dl", {
|
|
59
|
+
className: styles.fileInformation.dl
|
|
60
|
+
}, fileName && React.createElement(React.Fragment, null, React.createElement("dt", null, "File Name:"), React.createElement(Text, {
|
|
61
|
+
as: "dd",
|
|
21
62
|
isTruncated: true
|
|
22
|
-
}, fileName)),
|
|
23
|
-
|
|
24
|
-
key: "file-type"
|
|
25
|
-
}, React.createElement(Text, {
|
|
63
|
+
}, fileName)), mimeType && React.createElement(React.Fragment, null, React.createElement("dt", null, "File Type:"), React.createElement(Text, {
|
|
64
|
+
as: "dd",
|
|
26
65
|
isTruncated: true
|
|
27
|
-
}, mimeType)),
|
|
28
|
-
|
|
29
|
-
key: "file-size"
|
|
30
|
-
}, shortenStorageUnit(fileSize, 'B')),
|
|
31
|
-
image && React.createElement(Menu.Item, {
|
|
32
|
-
key: "file-dimentions"
|
|
33
|
-
}, `${image.width} × ${image.height}`)
|
|
34
|
-
].filter((item)=>item);
|
|
66
|
+
}, mimeType)), fileSize && React.createElement(React.Fragment, null, React.createElement("dt", null, "Size:"), React.createElement("dd", null, shortenStorageUnit(fileSize, 'B'))), image && React.createElement(React.Fragment, null, React.createElement("dt", null, "Dimensions:"), React.createElement("dd", null, `${image.width} × ${image.height}`))))
|
|
67
|
+
];
|
|
35
68
|
}
|
|
36
69
|
export function renderActions(props) {
|
|
37
70
|
const { entityFile , isDisabled , onEdit , onRemove } = props;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { File } from '../../types';
|
|
3
3
|
export declare function renderAssetInfo(props: {
|
|
4
4
|
entityFile: File;
|
|
5
|
-
}):
|
|
5
|
+
}): React.JSX.Element[];
|
|
6
6
|
export declare function renderActions(props: {
|
|
7
7
|
onEdit?: () => void;
|
|
8
8
|
onRemove?: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-reference",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.18.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"@contentful/app-sdk": "^4.17.1",
|
|
65
65
|
"react": ">=16.8.0"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "ed5a4c379ae53144fc8b9f68d86d48ff4009a784"
|
|
68
68
|
}
|