@micromag/element-urbania-author 0.4.48 → 0.4.50
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 +41 -32
- package/package.json +6 -6
package/es/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
|
-
import React from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import { getOptimalImageUrl, pascalCase, isTextFilled } from '@micromag/core/utils';
|
|
7
7
|
import Link from '@micromag/element-link';
|
|
8
8
|
import Text from '@micromag/element-text';
|
|
9
9
|
import { useSetting } from '@micromag/core/contexts';
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
11
|
|
|
11
12
|
var styles$1 = {"container":"micromag-element-urbania-author-avatar-container","shapeCircle":"micromag-element-urbania-author-avatar-shapeCircle","shape":"micromag-element-urbania-author-avatar-shape"};
|
|
12
13
|
|
|
@@ -34,16 +35,17 @@ function Avatar(_ref) {
|
|
|
34
35
|
supportsWebp: supportsWebp
|
|
35
36
|
});
|
|
36
37
|
var finalShape = shape !== null ? pascalCase(shape) : null;
|
|
37
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/jsx("span", {
|
|
38
39
|
className: classNames([styles$1.container, _defineProperty(_defineProperty({
|
|
39
40
|
className: className
|
|
40
|
-
}, styles$1["shape".concat(finalShape)], finalShape !== null), styles$1.isTag, isTag)])
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
}, styles$1["shape".concat(finalShape)], finalShape !== null), styles$1.isTag, isTag)]),
|
|
42
|
+
children: /*#__PURE__*/jsx("span", {
|
|
43
|
+
className: styles$1.shape,
|
|
44
|
+
style: {
|
|
45
|
+
backgroundImage: shouldLoad ? "url(\"".concat(imageAtSize, "\")") : null
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
});
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
var styles = {"container":"micromag-element-urbania-author-container","image":"micromag-element-urbania-author-image","link":"micromag-element-urbania-author-link","right":"micromag-element-urbania-author-right","name":"micromag-element-urbania-author-name","prefix":"micromag-element-urbania-author-prefix","collaborator":"micromag-element-urbania-author-collaborator","collaboratorText":"micromag-element-urbania-author-collaboratorText","isSmall":"micromag-element-urbania-author-isSmall","withoutImage":"micromag-element-urbania-author-withoutImage","withoutBackground":"micromag-element-urbania-author-withoutBackground"};
|
|
@@ -91,35 +93,42 @@ function UrbaniaAuthor(_ref) {
|
|
|
91
93
|
"value": "By"
|
|
92
94
|
}]
|
|
93
95
|
});
|
|
94
|
-
var authorText = isTextFilled(name) ? /*#__PURE__*/
|
|
96
|
+
var authorText = isTextFilled(name) ? /*#__PURE__*/jsx(Text, _objectSpread({
|
|
95
97
|
className: classNames([styles.name, backgroundClassName])
|
|
96
98
|
}, name)) : null;
|
|
97
|
-
var collaboratorText = isTextFilled(collaborator) ? /*#__PURE__*/
|
|
99
|
+
var collaboratorText = isTextFilled(collaborator) ? /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({
|
|
98
100
|
className: styles.collaboratorText
|
|
99
|
-
}, collaborator, {
|
|
101
|
+
}, collaborator), {}, {
|
|
100
102
|
inline: true
|
|
101
103
|
})) : null;
|
|
102
|
-
return /*#__PURE__*/
|
|
104
|
+
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
103
105
|
className: classNames([styles.container, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles.isSmall, isSmall), styles.withoutAvatar, withAvatar), styles.withoutImage, !withImage || image === null), styles.withoutBackground, withoutBackground)])
|
|
104
|
-
}, otherProps),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
106
|
+
}, otherProps), {}, {
|
|
107
|
+
children: [!withoutPrefix ? /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({}, name), {}, {
|
|
108
|
+
className: classNames([styles.prefix, backgroundClassName]),
|
|
109
|
+
body: "<span>".concat(prefix, "<span>")
|
|
110
|
+
})) : null, withAvatar ? /*#__PURE__*/jsx(Avatar, {
|
|
111
|
+
className: styles.image,
|
|
112
|
+
image: image,
|
|
113
|
+
shouldLoad: shouldLoad
|
|
114
|
+
}) : null, /*#__PURE__*/jsxs("div", {
|
|
115
|
+
className: styles.right,
|
|
116
|
+
children: [url !== null && !withoutLink ? /*#__PURE__*/jsx(Link, {
|
|
117
|
+
className: styles.link,
|
|
118
|
+
url: url,
|
|
119
|
+
external: true,
|
|
120
|
+
style: {
|
|
121
|
+
backgroundImage: linkUnderlineColor !== null ? "linear-gradient(0deg, ".concat(linkUnderlineColor, " 0, ").concat(linkUnderlineColor, ")") : null
|
|
122
|
+
},
|
|
123
|
+
children: authorText
|
|
124
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
125
|
+
children: authorText
|
|
126
|
+
}), collaboratorText !== null ? /*#__PURE__*/jsx("div", {
|
|
127
|
+
className: classNames([styles.collaborator, collaboratorClassName]),
|
|
128
|
+
children: collaboratorText !== null ? collaboratorText : null
|
|
129
|
+
}) : null]
|
|
130
|
+
})]
|
|
131
|
+
}));
|
|
123
132
|
}
|
|
124
133
|
|
|
125
134
|
export { UrbaniaAuthor as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-urbania-author",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.50",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@babel/runtime": "^7.28.6",
|
|
63
|
-
"@micromag/core": "^0.4.
|
|
64
|
-
"@micromag/element-button": "^0.4.
|
|
65
|
-
"@micromag/element-link": "^0.4.
|
|
66
|
-
"@micromag/element-text": "^0.4.
|
|
63
|
+
"@micromag/core": "^0.4.50",
|
|
64
|
+
"@micromag/element-button": "^0.4.50",
|
|
65
|
+
"@micromag/element-link": "^0.4.50",
|
|
66
|
+
"@micromag/element-text": "^0.4.50",
|
|
67
67
|
"classnames": "^2.2.6",
|
|
68
68
|
"lodash": "^4.17.23",
|
|
69
69
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"access": "public",
|
|
74
74
|
"registry": "https://registry.npmjs.org/"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
|
|
77
77
|
"types": "es/index.d.ts"
|
|
78
78
|
}
|