@micromag/element-author 0.4.49 → 0.4.51
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/es/index.js +38 -29
- package/package.json +6 -6
package/es/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
1
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
|
-
import React$1 from 'react';
|
|
4
4
|
import { getOptimalImageUrl, pascalCase, isTextFilled } from '@micromag/core/utils';
|
|
5
5
|
import Link from '@micromag/element-link';
|
|
6
6
|
import Text from '@micromag/element-text';
|
|
7
7
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
8
8
|
import { useSetting } from '@micromag/core/contexts';
|
|
9
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
10
|
|
|
10
11
|
var styles$1 = {"container":"micromag-element-author-avatar-container","shape":"micromag-element-author-avatar-shape","shapeCircle":"micromag-element-author-avatar-shapeCircle"};
|
|
11
12
|
|
|
@@ -33,16 +34,17 @@ function Avatar(_ref) {
|
|
|
33
34
|
supportsWebp: supportsWebp
|
|
34
35
|
});
|
|
35
36
|
var finalShape = shape !== null ? pascalCase(shape) : null;
|
|
36
|
-
return /*#__PURE__*/
|
|
37
|
+
return /*#__PURE__*/jsx("span", {
|
|
37
38
|
className: classNames([styles$1.container, _defineProperty(_defineProperty({
|
|
38
39
|
className: className
|
|
39
|
-
}, styles$1["shape".concat(finalShape)], finalShape !== null), styles$1.isTag, isTag)])
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
}, styles$1["shape".concat(finalShape)], finalShape !== null), styles$1.isTag, isTag)]),
|
|
41
|
+
children: /*#__PURE__*/jsx("span", {
|
|
42
|
+
className: styles$1.shape,
|
|
43
|
+
style: {
|
|
44
|
+
backgroundImage: shouldLoad ? "url(\"".concat(imageAtSize, "\")") : null
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
});
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
var styles = {"container":"micromag-element-author-container","image":"micromag-element-author-image","link":"micromag-element-author-link","right":"micromag-element-author-right","name":"micromag-element-author-name","collaborator":"micromag-element-author-collaborator","collaboratorText":"micromag-element-author-collaboratorText"};
|
|
@@ -76,32 +78,39 @@ function Author(_ref) {
|
|
|
76
78
|
_ref2$collaborator = _ref2.collaborator,
|
|
77
79
|
collaborator = _ref2$collaborator === void 0 ? null : _ref2$collaborator;
|
|
78
80
|
var withAvatar = withImage && image !== null;
|
|
79
|
-
var authorText = isTextFilled(name) ? /*#__PURE__*/
|
|
81
|
+
var authorText = isTextFilled(name) ? /*#__PURE__*/jsx(Text, _objectSpread({
|
|
80
82
|
className: classNames([styles.name, backgroundClassName])
|
|
81
83
|
}, name)) : null;
|
|
82
|
-
var collaboratorText = isTextFilled(collaborator) ? /*#__PURE__*/
|
|
84
|
+
var collaboratorText = isTextFilled(collaborator) ? /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({
|
|
83
85
|
className: styles.collaboratorText
|
|
84
|
-
}, collaborator, {
|
|
86
|
+
}, collaborator), {}, {
|
|
85
87
|
inline: true
|
|
86
88
|
})) : null;
|
|
87
|
-
return /*#__PURE__*/
|
|
89
|
+
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
88
90
|
className: classNames([styles.container, className])
|
|
89
|
-
}, otherProps),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
91
|
+
}, otherProps), {}, {
|
|
92
|
+
children: [withAvatar ? /*#__PURE__*/jsx(Avatar, {
|
|
93
|
+
className: styles.image,
|
|
94
|
+
image: image,
|
|
95
|
+
shouldLoad: shouldLoad
|
|
96
|
+
}) : null, /*#__PURE__*/jsxs("div", {
|
|
97
|
+
className: styles.right,
|
|
98
|
+
children: [url !== null && !withoutLink ? /*#__PURE__*/jsx(Link, {
|
|
99
|
+
className: styles.link,
|
|
100
|
+
url: url,
|
|
101
|
+
external: true,
|
|
102
|
+
style: {
|
|
103
|
+
backgroundImage: linkUnderlineColor !== null ? "linear-gradient(0deg, ".concat(linkUnderlineColor, " 0, ").concat(linkUnderlineColor, ")") : null
|
|
104
|
+
},
|
|
105
|
+
children: authorText
|
|
106
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
107
|
+
children: authorText
|
|
108
|
+
}), collaboratorText !== null ? /*#__PURE__*/jsx("div", {
|
|
109
|
+
className: classNames([styles.collaborator, collaboratorClassName]),
|
|
110
|
+
children: collaboratorText !== null ? collaboratorText : null
|
|
111
|
+
}) : null]
|
|
112
|
+
})]
|
|
113
|
+
}));
|
|
105
114
|
}
|
|
106
115
|
|
|
107
116
|
export { Author as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-author",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.51",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@babel/runtime": "^7.28.6",
|
|
64
|
-
"@micromag/core": "^0.4.
|
|
65
|
-
"@micromag/element-button": "^0.4.
|
|
66
|
-
"@micromag/element-link": "^0.4.
|
|
67
|
-
"@micromag/element-text": "^0.4.
|
|
64
|
+
"@micromag/core": "^0.4.51",
|
|
65
|
+
"@micromag/element-button": "^0.4.51",
|
|
66
|
+
"@micromag/element-link": "^0.4.51",
|
|
67
|
+
"@micromag/element-text": "^0.4.51",
|
|
68
68
|
"classnames": "^2.2.6",
|
|
69
69
|
"lodash": "^4.17.23",
|
|
70
70
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"access": "public",
|
|
75
75
|
"registry": "https://registry.npmjs.org/"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "985a2370829c9ac8901ea97bf20bfc98ab158439"
|
|
78
78
|
}
|