@micromag/element-urbania-author 0.3.124 → 0.3.133
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/assets/css/styles.css +2 -2
- package/es/index.js +24 -11
- package/lib/index.js +24 -11
- package/package.json +6 -6
package/assets/css/styles.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.micromag-element-urbania-author-avatar-container{display:inline-block;position:relative;z-index:1;width:100%}.micromag-element-urbania-author-avatar-container .micromag-element-urbania-author-avatar-shape{display:block;width:100%;height:0;padding-bottom:100%;background-color:#222;background-repeat:no-repeat;background-position:50%;background-size:cover;-webkit-box-shadow:0 0 4px rgba(0,0,0,.2);box-shadow:0 0 4px rgba(0,0,0,.2)}.micromag-element-urbania-author-avatar-container.micromag-element-urbania-author-avatar-
|
|
2
|
-
.micromag-element-urbania-author-container{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-ms-flex-align:center;align-items:center;color:#222;font-family:Agrandir;vertical-align:center}.micromag-element-urbania-author-container .micromag-element-urbania-author-image{min-width:2.2em;max-width:
|
|
1
|
+
.micromag-element-urbania-author-avatar-container{display:inline-block;position:relative;z-index:1;width:100%}.micromag-element-urbania-author-avatar-container .micromag-element-urbania-author-avatar-shape{display:block;width:100%;height:0;padding-bottom:100%;background-color:#222;background-repeat:no-repeat;background-position:50%;background-size:cover;-webkit-box-shadow:0 0 4px rgba(0,0,0,.2);box-shadow:0 0 4px rgba(0,0,0,.2)}.micromag-element-urbania-author-avatar-container.micromag-element-urbania-author-avatar-shape-circle .micromag-element-urbania-author-avatar-shape{overflow:hidden;border-radius:50%;background-color:rgba(0,0,0,0);background-position:top}
|
|
2
|
+
.micromag-element-urbania-author-container{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-ms-flex-align:center;align-items:center;color:#222;font-family:Agrandir;vertical-align:center}.micromag-element-urbania-author-container .micromag-element-urbania-author-image{min-width:2.2em;max-width:4em}.micromag-element-urbania-author-container .micromag-element-urbania-author-link{display:inline-block;color:#222;text-decoration:none}.micromag-element-urbania-author-container .micromag-element-urbania-author-right{display:block}.micromag-element-urbania-author-container .micromag-element-urbania-author-name,.micromag-element-urbania-author-container .micromag-element-urbania-author-prefix{min-height:20px}.micromag-element-urbania-author-container .micromag-element-urbania-author-collaborator,.micromag-element-urbania-author-container .micromag-element-urbania-author-name,.micromag-element-urbania-author-container .micromag-element-urbania-author-prefix{display:block;background-color:#efefef;font-family:Agrandir;font-size:10px;letter-spacing:.04em;line-height:1;white-space:nowrap}.micromag-element-urbania-author-container .micromag-element-urbania-author-name{margin-left:-7px;padding:3px 8px 3px 13px;border-top-right-radius:40px;border-bottom-right-radius:40px}.micromag-element-urbania-author-container .micromag-element-urbania-author-name p{display:inline-block;margin:0;padding:3px 0 0;font-size:inherit;font-weight:700;line-height:1;text-transform:uppercase}.micromag-element-urbania-author-container .micromag-element-urbania-author-collaborator{position:absolute;padding-top:2px;background-color:rgba(0,0,0,0);color:#fff}.micromag-element-urbania-author-container .micromag-element-urbania-author-collaborator .micromag-element-urbania-author-collaboratorText{padding-left:7.3px;font-size:inherit}.micromag-element-urbania-author-container .micromag-element-urbania-author-collaborator .micromag-element-urbania-author-collaboratorText p{display:inline;font-size:.9em;line-height:1}.micromag-element-urbania-author-container .micromag-element-urbania-author-prefix{margin-right:-5px;padding:3px 12px 3px 8px;border-top-left-radius:40px;border-bottom-left-radius:40px}.micromag-element-urbania-author-container .micromag-element-urbania-author-prefix span{display:inline-block;padding:3px 0 0;font-size:inherit;line-height:1}.micromag-element-urbania-author-container.micromag-element-urbania-author-isSmall{font-size:9px}.micromag-element-urbania-author-container.micromag-element-urbania-author-isSmall .micromag-element-urbania-author-name,.micromag-element-urbania-author-container.micromag-element-urbania-author-isSmall .micromag-element-urbania-author-prefix{font-size:9px;white-space:normal}.micromag-element-urbania-author-container.micromag-element-urbania-author-isSmall .micromag-element-urbania-author-image{max-width:30px}.micromag-element-urbania-author-container.micromag-element-urbania-author-withoutImage .micromag-element-urbania-author-name{margin-left:0;padding-left:0}.micromag-element-urbania-author-container.micromag-element-urbania-author-withoutImage .micromag-element-urbania-author-prefix{margin-right:0;padding-right:.4em}
|
package/es/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { getOptimalImageUrl, isTextFilled } from '@micromag/core/utils';
|
|
|
8
8
|
import Link from '@micromag/element-link';
|
|
9
9
|
import Text from '@micromag/element-text';
|
|
10
10
|
|
|
11
|
-
var styles$1 = {"container":"micromag-element-urbania-author-avatar-container","shape":"micromag-element-urbania-author-avatar-shape","
|
|
11
|
+
var styles$1 = {"container":"micromag-element-urbania-author-avatar-container","shape":"micromag-element-urbania-author-avatar-shape","shape-circle":"micromag-element-urbania-author-avatar-shape-circle"};
|
|
12
12
|
|
|
13
13
|
var propTypes$1 = {
|
|
14
14
|
image: PropTypes.imageElement,
|
|
@@ -26,7 +26,7 @@ var defaultProps$1 = {
|
|
|
26
26
|
height: 100,
|
|
27
27
|
resolution: 1,
|
|
28
28
|
isTag: false,
|
|
29
|
-
shape: '
|
|
29
|
+
shape: 'circle',
|
|
30
30
|
className: null,
|
|
31
31
|
shouldLoad: true
|
|
32
32
|
};
|
|
@@ -46,7 +46,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
46
46
|
resolution: resolution
|
|
47
47
|
});
|
|
48
48
|
return /*#__PURE__*/React.createElement("span", {
|
|
49
|
-
className: classNames([styles$1.container, (_ref2 = {}, _defineProperty(_ref2, styles$1["shape".concat(shape)], shape !== null), _defineProperty(_ref2, styles$1.isTag, isTag), _defineProperty(_ref2, className, className !== null), _ref2)])
|
|
49
|
+
className: classNames([styles$1.container, (_ref2 = {}, _defineProperty(_ref2, styles$1["shape-".concat(shape)], shape !== null), _defineProperty(_ref2, styles$1.isTag, isTag), _defineProperty(_ref2, className, className !== null), _ref2)])
|
|
50
50
|
}, /*#__PURE__*/React.createElement("span", {
|
|
51
51
|
className: styles$1.shape,
|
|
52
52
|
style: {
|
|
@@ -58,14 +58,15 @@ var Avatar = function Avatar(_ref) {
|
|
|
58
58
|
Avatar.propTypes = propTypes$1;
|
|
59
59
|
Avatar.defaultProps = defaultProps$1;
|
|
60
60
|
|
|
61
|
-
var styles = {"container":"micromag-element-urbania-author-container","image":"micromag-element-urbania-author-image","link":"micromag-element-urbania-author-link","name":"micromag-element-urbania-author-name","prefix":"micromag-element-urbania-author-prefix","isSmall":"micromag-element-urbania-author-isSmall","withoutImage":"micromag-element-urbania-author-withoutImage"};
|
|
61
|
+
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"};
|
|
62
62
|
|
|
63
63
|
var propTypes = {
|
|
64
64
|
author: PropTypes$1.shape({
|
|
65
65
|
slug: PropTypes$1.string,
|
|
66
66
|
name: PropTypes.textElement,
|
|
67
67
|
image: PropTypes.imageElement,
|
|
68
|
-
url: PropTypes$1.string
|
|
68
|
+
url: PropTypes$1.string,
|
|
69
|
+
collaborator: PropTypes.textElement
|
|
69
70
|
}),
|
|
70
71
|
withImage: PropTypes$1.bool,
|
|
71
72
|
withoutLink: PropTypes$1.bool,
|
|
@@ -105,8 +106,11 @@ var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
|
|
|
105
106
|
_ref2$image = _ref2.image,
|
|
106
107
|
image = _ref2$image === void 0 ? null : _ref2$image,
|
|
107
108
|
_ref2$url = _ref2.url,
|
|
108
|
-
url = _ref2$url === void 0 ? null : _ref2$url
|
|
109
|
+
url = _ref2$url === void 0 ? null : _ref2$url,
|
|
110
|
+
_ref2$collaborator = _ref2.collaborator,
|
|
111
|
+
collaborator = _ref2$collaborator === void 0 ? null : _ref2$collaborator;
|
|
109
112
|
|
|
113
|
+
var withAvatar = withImage && image !== null;
|
|
110
114
|
var prefix = intl.formatMessage({
|
|
111
115
|
id: "jEK6B8",
|
|
112
116
|
defaultMessage: [{
|
|
@@ -114,26 +118,35 @@ var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
|
|
|
114
118
|
"value": "By"
|
|
115
119
|
}]
|
|
116
120
|
});
|
|
117
|
-
var
|
|
121
|
+
var authorText = isTextFilled(name) ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
118
122
|
className: styles.name
|
|
119
123
|
}, name)) : null;
|
|
124
|
+
var collaboratorText = isTextFilled(collaborator) ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
125
|
+
className: styles.collaboratorText
|
|
126
|
+
}, collaborator, {
|
|
127
|
+
inline: true
|
|
128
|
+
})) : null;
|
|
120
129
|
return /*#__PURE__*/React.createElement("div", {
|
|
121
|
-
className: classNames([styles.container, (_ref3 = {}, _defineProperty(_ref3, styles.isSmall, isSmall), _defineProperty(_ref3, styles.withoutImage, !withImage || image === null), _defineProperty(_ref3, className, className !== null), _ref3)])
|
|
130
|
+
className: classNames([styles.container, (_ref3 = {}, _defineProperty(_ref3, styles.isSmall, isSmall), _defineProperty(_ref3, styles.withoutAvatar, withAvatar), _defineProperty(_ref3, styles.withoutImage, !withImage || image === null), _defineProperty(_ref3, className, className !== null), _ref3)])
|
|
122
131
|
}, !withoutPrefix ? /*#__PURE__*/React.createElement(Text, Object.assign({}, name, {
|
|
123
132
|
className: styles.prefix,
|
|
124
133
|
body: "<span>".concat(prefix, "<span>")
|
|
125
|
-
})) : null,
|
|
134
|
+
})) : null, withAvatar ? /*#__PURE__*/React.createElement(Avatar, {
|
|
126
135
|
className: styles.image,
|
|
127
136
|
image: image,
|
|
128
137
|
shouldLoad: shouldLoad
|
|
129
|
-
}) : null,
|
|
138
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
className: styles.right
|
|
140
|
+
}, url !== null && !withoutLink ? /*#__PURE__*/React.createElement(Link, {
|
|
130
141
|
className: styles.link,
|
|
131
142
|
url: url,
|
|
132
143
|
external: true,
|
|
133
144
|
style: {
|
|
134
145
|
backgroundImage: linkUnderlineColor !== null ? "linear-gradient(0deg, ".concat(linkUnderlineColor, " 0, ").concat(linkUnderlineColor, ")") : null
|
|
135
146
|
}
|
|
136
|
-
},
|
|
147
|
+
}, authorText) : /*#__PURE__*/React.createElement("div", null, authorText), collaboratorText !== null ? /*#__PURE__*/React.createElement("div", {
|
|
148
|
+
className: styles.collaborator
|
|
149
|
+
}, collaboratorText !== null ? collaboratorText : null) : null));
|
|
137
150
|
};
|
|
138
151
|
|
|
139
152
|
UrbaniaAuthor.propTypes = propTypes;
|
package/lib/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
19
19
|
var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
|
|
20
20
|
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
|
|
21
21
|
|
|
22
|
-
var styles$1 = {"container":"micromag-element-urbania-author-avatar-container","shape":"micromag-element-urbania-author-avatar-shape","
|
|
22
|
+
var styles$1 = {"container":"micromag-element-urbania-author-avatar-container","shape":"micromag-element-urbania-author-avatar-shape","shape-circle":"micromag-element-urbania-author-avatar-shape-circle"};
|
|
23
23
|
|
|
24
24
|
var propTypes$1 = {
|
|
25
25
|
image: core.PropTypes.imageElement,
|
|
@@ -37,7 +37,7 @@ var defaultProps$1 = {
|
|
|
37
37
|
height: 100,
|
|
38
38
|
resolution: 1,
|
|
39
39
|
isTag: false,
|
|
40
|
-
shape: '
|
|
40
|
+
shape: 'circle',
|
|
41
41
|
className: null,
|
|
42
42
|
shouldLoad: true
|
|
43
43
|
};
|
|
@@ -57,7 +57,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
57
57
|
resolution: resolution
|
|
58
58
|
});
|
|
59
59
|
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
60
|
-
className: classNames__default["default"]([styles$1.container, (_ref2 = {}, _defineProperty__default["default"](_ref2, styles$1["shape".concat(shape)], shape !== null), _defineProperty__default["default"](_ref2, styles$1.isTag, isTag), _defineProperty__default["default"](_ref2, className, className !== null), _ref2)])
|
|
60
|
+
className: classNames__default["default"]([styles$1.container, (_ref2 = {}, _defineProperty__default["default"](_ref2, styles$1["shape-".concat(shape)], shape !== null), _defineProperty__default["default"](_ref2, styles$1.isTag, isTag), _defineProperty__default["default"](_ref2, className, className !== null), _ref2)])
|
|
61
61
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
62
62
|
className: styles$1.shape,
|
|
63
63
|
style: {
|
|
@@ -69,14 +69,15 @@ var Avatar = function Avatar(_ref) {
|
|
|
69
69
|
Avatar.propTypes = propTypes$1;
|
|
70
70
|
Avatar.defaultProps = defaultProps$1;
|
|
71
71
|
|
|
72
|
-
var styles = {"container":"micromag-element-urbania-author-container","image":"micromag-element-urbania-author-image","link":"micromag-element-urbania-author-link","name":"micromag-element-urbania-author-name","prefix":"micromag-element-urbania-author-prefix","isSmall":"micromag-element-urbania-author-isSmall","withoutImage":"micromag-element-urbania-author-withoutImage"};
|
|
72
|
+
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"};
|
|
73
73
|
|
|
74
74
|
var propTypes = {
|
|
75
75
|
author: PropTypes__default["default"].shape({
|
|
76
76
|
slug: PropTypes__default["default"].string,
|
|
77
77
|
name: core.PropTypes.textElement,
|
|
78
78
|
image: core.PropTypes.imageElement,
|
|
79
|
-
url: PropTypes__default["default"].string
|
|
79
|
+
url: PropTypes__default["default"].string,
|
|
80
|
+
collaborator: core.PropTypes.textElement
|
|
80
81
|
}),
|
|
81
82
|
withImage: PropTypes__default["default"].bool,
|
|
82
83
|
withoutLink: PropTypes__default["default"].bool,
|
|
@@ -116,8 +117,11 @@ var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
|
|
|
116
117
|
_ref2$image = _ref2.image,
|
|
117
118
|
image = _ref2$image === void 0 ? null : _ref2$image,
|
|
118
119
|
_ref2$url = _ref2.url,
|
|
119
|
-
url = _ref2$url === void 0 ? null : _ref2$url
|
|
120
|
+
url = _ref2$url === void 0 ? null : _ref2$url,
|
|
121
|
+
_ref2$collaborator = _ref2.collaborator,
|
|
122
|
+
collaborator = _ref2$collaborator === void 0 ? null : _ref2$collaborator;
|
|
120
123
|
|
|
124
|
+
var withAvatar = withImage && image !== null;
|
|
121
125
|
var prefix = intl.formatMessage({
|
|
122
126
|
id: "jEK6B8",
|
|
123
127
|
defaultMessage: [{
|
|
@@ -125,26 +129,35 @@ var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
|
|
|
125
129
|
"value": "By"
|
|
126
130
|
}]
|
|
127
131
|
});
|
|
128
|
-
var
|
|
132
|
+
var authorText = utils.isTextFilled(name) ? /*#__PURE__*/React__default["default"].createElement(Text__default["default"], Object.assign({
|
|
129
133
|
className: styles.name
|
|
130
134
|
}, name)) : null;
|
|
135
|
+
var collaboratorText = utils.isTextFilled(collaborator) ? /*#__PURE__*/React__default["default"].createElement(Text__default["default"], Object.assign({
|
|
136
|
+
className: styles.collaboratorText
|
|
137
|
+
}, collaborator, {
|
|
138
|
+
inline: true
|
|
139
|
+
})) : null;
|
|
131
140
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
132
|
-
className: classNames__default["default"]([styles.container, (_ref3 = {}, _defineProperty__default["default"](_ref3, styles.isSmall, isSmall), _defineProperty__default["default"](_ref3, styles.withoutImage, !withImage || image === null), _defineProperty__default["default"](_ref3, className, className !== null), _ref3)])
|
|
141
|
+
className: classNames__default["default"]([styles.container, (_ref3 = {}, _defineProperty__default["default"](_ref3, styles.isSmall, isSmall), _defineProperty__default["default"](_ref3, styles.withoutAvatar, withAvatar), _defineProperty__default["default"](_ref3, styles.withoutImage, !withImage || image === null), _defineProperty__default["default"](_ref3, className, className !== null), _ref3)])
|
|
133
142
|
}, !withoutPrefix ? /*#__PURE__*/React__default["default"].createElement(Text__default["default"], Object.assign({}, name, {
|
|
134
143
|
className: styles.prefix,
|
|
135
144
|
body: "<span>".concat(prefix, "<span>")
|
|
136
|
-
})) : null,
|
|
145
|
+
})) : null, withAvatar ? /*#__PURE__*/React__default["default"].createElement(Avatar, {
|
|
137
146
|
className: styles.image,
|
|
138
147
|
image: image,
|
|
139
148
|
shouldLoad: shouldLoad
|
|
140
|
-
}) : null,
|
|
149
|
+
}) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
150
|
+
className: styles.right
|
|
151
|
+
}, url !== null && !withoutLink ? /*#__PURE__*/React__default["default"].createElement(Link__default["default"], {
|
|
141
152
|
className: styles.link,
|
|
142
153
|
url: url,
|
|
143
154
|
external: true,
|
|
144
155
|
style: {
|
|
145
156
|
backgroundImage: linkUnderlineColor !== null ? "linear-gradient(0deg, ".concat(linkUnderlineColor, " 0, ").concat(linkUnderlineColor, ")") : null
|
|
146
157
|
}
|
|
147
|
-
},
|
|
158
|
+
}, authorText) : /*#__PURE__*/React__default["default"].createElement("div", null, authorText), collaboratorText !== null ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
159
|
+
className: styles.collaborator
|
|
160
|
+
}, collaboratorText !== null ? collaboratorText : null) : null));
|
|
148
161
|
};
|
|
149
162
|
|
|
150
163
|
UrbaniaAuthor.propTypes = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-urbania-author",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.133",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.3.
|
|
53
|
-
"@micromag/element-button": "^0.3.
|
|
54
|
-
"@micromag/element-link": "^0.3.
|
|
55
|
-
"@micromag/element-text": "^0.3.
|
|
52
|
+
"@micromag/core": "^0.3.126",
|
|
53
|
+
"@micromag/element-button": "^0.3.126",
|
|
54
|
+
"@micromag/element-link": "^0.3.126",
|
|
55
|
+
"@micromag/element-text": "^0.3.126",
|
|
56
56
|
"classnames": "^2.2.6",
|
|
57
57
|
"lodash": "^4.17.21",
|
|
58
58
|
"prop-types": "^15.7.2",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "c09ca637ad389fc48b2671eaab3cc747a09d7abd"
|
|
66
66
|
}
|