@micromag/element-author 0.3.420 → 0.3.429
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 +1 -1
- package/es/index.js +1 -2
- package/lib/index.js +31 -42
- package/package.json +12 -6
package/assets/css/styles.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
.micromag-element-author-avatar-container{display:inline-block;position:relative;width:100%;z-index:1}.micromag-element-author-avatar-container.micromag-element-author-avatar-shapeCircle .micromag-element-author-avatar-shape{background-color:#fff;background-position:top;border-radius:50%;overflow:hidden}.micromag-element-author-avatar-container .micromag-element-author-avatar-shape{background-color:#fff;background-position:50%;background-repeat:no-repeat;background-size:cover;-webkit-box-shadow:0 0 4px rgba(0,0,0,.2);box-shadow:0 0 4px rgba(0,0,0,.2);display:block;height:0;padding-bottom:100%;width:100%}
|
|
2
|
-
.micromag-element-author-container{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;vertical-align:center}.micromag-element-author-container .micromag-element-author-image{margin-right:10px;max-width:35px}.micromag-element-author-container .micromag-element-author-link{text-decoration:none}.micromag-element-author-container .micromag-element-author-right{display:block}.micromag-element-author-container .micromag-element-author-name p{display:inline;margin:0}.micromag-element-author-container .micromag-element-author-collaborator{background-color:transparent}.micromag-element-author-container .micromag-element-author-collaborator .micromag-element-author-collaboratorText{font-size:inherit}.micromag-element-author-container .micromag-element-author-collaborator .micromag-element-author-collaboratorText p{display:inline}
|
|
2
|
+
.micromag-element-author-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;vertical-align:center}.micromag-element-author-container .micromag-element-author-image{margin-right:10px;max-width:35px}.micromag-element-author-container .micromag-element-author-link{text-decoration:none}.micromag-element-author-container .micromag-element-author-right{display:block}.micromag-element-author-container .micromag-element-author-name p{display:inline;margin:0}.micromag-element-author-container .micromag-element-author-collaborator{background-color:transparent}.micromag-element-author-container .micromag-element-author-collaborator .micromag-element-author-collaboratorText{font-size:inherit}.micromag-element-author-container .micromag-element-author-collaborator .micromag-element-author-collaboratorText p{display:inline}
|
package/es/index.js
CHANGED
|
@@ -31,7 +31,6 @@ var defaultProps$1 = {
|
|
|
31
31
|
shouldLoad: true
|
|
32
32
|
};
|
|
33
33
|
var Avatar = function Avatar(_ref) {
|
|
34
|
-
var _ref2;
|
|
35
34
|
var image = _ref.image,
|
|
36
35
|
width = _ref.width,
|
|
37
36
|
height = _ref.height,
|
|
@@ -45,7 +44,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
45
44
|
});
|
|
46
45
|
var finalShape = shape !== null ? pascalCase(shape) : null;
|
|
47
46
|
return /*#__PURE__*/React.createElement("span", {
|
|
48
|
-
className: classNames([styles$1.container, (
|
|
47
|
+
className: classNames([styles$1.container, _defineProperty(_defineProperty(_defineProperty({}, styles$1["shape".concat(finalShape)], finalShape !== null), styles$1.isTag, isTag), className, className !== null)])
|
|
49
48
|
}, /*#__PURE__*/React.createElement("span", {
|
|
50
49
|
className: styles$1.shape,
|
|
51
50
|
style: {
|
package/lib/index.js
CHANGED
|
@@ -10,27 +10,17 @@ var utils = require('@micromag/core/utils');
|
|
|
10
10
|
var Link = require('@micromag/element-link');
|
|
11
11
|
var Text = require('@micromag/element-text');
|
|
12
12
|
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
17
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
18
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
19
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
|
-
var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
|
|
21
|
-
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
|
|
22
|
-
|
|
23
13
|
var styles$1 = {"container":"micromag-element-author-avatar-container","shapeCircle":"micromag-element-author-avatar-shapeCircle","shape":"micromag-element-author-avatar-shape"};
|
|
24
14
|
|
|
25
15
|
var propTypes$1 = {
|
|
26
16
|
image: core.PropTypes.imageElement,
|
|
27
|
-
width:
|
|
28
|
-
height:
|
|
29
|
-
resolution:
|
|
30
|
-
isTag:
|
|
31
|
-
shape:
|
|
32
|
-
className:
|
|
33
|
-
shouldLoad:
|
|
17
|
+
width: PropTypes.number,
|
|
18
|
+
height: PropTypes.number,
|
|
19
|
+
resolution: PropTypes.number,
|
|
20
|
+
isTag: PropTypes.bool,
|
|
21
|
+
shape: PropTypes.oneOf([null, 'tag', 'circle']),
|
|
22
|
+
className: PropTypes.string,
|
|
23
|
+
shouldLoad: PropTypes.bool
|
|
34
24
|
};
|
|
35
25
|
var defaultProps$1 = {
|
|
36
26
|
image: null,
|
|
@@ -43,7 +33,6 @@ var defaultProps$1 = {
|
|
|
43
33
|
shouldLoad: true
|
|
44
34
|
};
|
|
45
35
|
var Avatar = function Avatar(_ref) {
|
|
46
|
-
var _ref2;
|
|
47
36
|
var image = _ref.image,
|
|
48
37
|
width = _ref.width,
|
|
49
38
|
height = _ref.height,
|
|
@@ -56,9 +45,9 @@ var Avatar = function Avatar(_ref) {
|
|
|
56
45
|
resolution: resolution
|
|
57
46
|
});
|
|
58
47
|
var finalShape = shape !== null ? utils.pascalCase(shape) : null;
|
|
59
|
-
return /*#__PURE__*/
|
|
60
|
-
className:
|
|
61
|
-
}, /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
49
|
+
className: classNames([styles$1.container, _defineProperty(_defineProperty(_defineProperty({}, styles$1["shape".concat(finalShape)], finalShape !== null), styles$1.isTag, isTag), className, className !== null)])
|
|
50
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
62
51
|
className: styles$1.shape,
|
|
63
52
|
style: {
|
|
64
53
|
backgroundImage: shouldLoad ? "url(\"".concat(imageAtSize, "\")") : null
|
|
@@ -72,20 +61,20 @@ var styles = {"container":"micromag-element-author-container","image":"micromag-
|
|
|
72
61
|
|
|
73
62
|
var _excluded = ["author", "withImage", "withoutLink", "linkUnderlineColor", "className", "backgroundClassName", "collaboratorClassName", "shouldLoad"];
|
|
74
63
|
var propTypes = {
|
|
75
|
-
author:
|
|
76
|
-
slug:
|
|
64
|
+
author: PropTypes.shape({
|
|
65
|
+
slug: PropTypes.string,
|
|
77
66
|
name: core.PropTypes.textElement,
|
|
78
67
|
image: core.PropTypes.imageElement,
|
|
79
|
-
url:
|
|
68
|
+
url: PropTypes.string,
|
|
80
69
|
collaborator: core.PropTypes.textElement
|
|
81
70
|
}),
|
|
82
|
-
withImage:
|
|
83
|
-
withoutLink:
|
|
84
|
-
linkUnderlineColor:
|
|
85
|
-
className:
|
|
86
|
-
backgroundClassName:
|
|
87
|
-
collaboratorClassName:
|
|
88
|
-
shouldLoad:
|
|
71
|
+
withImage: PropTypes.bool,
|
|
72
|
+
withoutLink: PropTypes.bool,
|
|
73
|
+
linkUnderlineColor: PropTypes.string,
|
|
74
|
+
className: PropTypes.string,
|
|
75
|
+
backgroundClassName: PropTypes.string,
|
|
76
|
+
collaboratorClassName: PropTypes.string,
|
|
77
|
+
shouldLoad: PropTypes.bool
|
|
89
78
|
};
|
|
90
79
|
var defaultProps = {
|
|
91
80
|
author: null,
|
|
@@ -106,7 +95,7 @@ var Author = function Author(_ref) {
|
|
|
106
95
|
backgroundClassName = _ref.backgroundClassName,
|
|
107
96
|
collaboratorClassName = _ref.collaboratorClassName,
|
|
108
97
|
shouldLoad = _ref.shouldLoad,
|
|
109
|
-
otherProps =
|
|
98
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
110
99
|
var _ref2 = author || {},
|
|
111
100
|
_ref2$name = _ref2.name,
|
|
112
101
|
name = _ref2$name === void 0 ? null : _ref2$name,
|
|
@@ -117,31 +106,31 @@ var Author = function Author(_ref) {
|
|
|
117
106
|
_ref2$collaborator = _ref2.collaborator,
|
|
118
107
|
collaborator = _ref2$collaborator === void 0 ? null : _ref2$collaborator;
|
|
119
108
|
var withAvatar = withImage && image !== null;
|
|
120
|
-
var authorText = utils.isTextFilled(name) ? /*#__PURE__*/
|
|
121
|
-
className:
|
|
109
|
+
var authorText = utils.isTextFilled(name) ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
110
|
+
className: classNames([styles.name, _defineProperty({}, backgroundClassName, backgroundClassName)])
|
|
122
111
|
}, name)) : null;
|
|
123
|
-
var collaboratorText = utils.isTextFilled(collaborator) ? /*#__PURE__*/
|
|
112
|
+
var collaboratorText = utils.isTextFilled(collaborator) ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
124
113
|
className: styles.collaboratorText
|
|
125
114
|
}, collaborator, {
|
|
126
115
|
inline: true
|
|
127
116
|
})) : null;
|
|
128
|
-
return /*#__PURE__*/
|
|
129
|
-
className:
|
|
130
|
-
}, otherProps), withAvatar ? /*#__PURE__*/
|
|
117
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
118
|
+
className: classNames([styles.container, _defineProperty({}, className, className !== null)])
|
|
119
|
+
}, otherProps), withAvatar ? /*#__PURE__*/React.createElement(Avatar, {
|
|
131
120
|
className: styles.image,
|
|
132
121
|
image: image,
|
|
133
122
|
shouldLoad: shouldLoad
|
|
134
|
-
}) : null, /*#__PURE__*/
|
|
123
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
135
124
|
className: styles.right
|
|
136
|
-
}, url !== null && !withoutLink ? /*#__PURE__*/
|
|
125
|
+
}, url !== null && !withoutLink ? /*#__PURE__*/React.createElement(Link, {
|
|
137
126
|
className: styles.link,
|
|
138
127
|
url: url,
|
|
139
128
|
external: true,
|
|
140
129
|
style: {
|
|
141
130
|
backgroundImage: linkUnderlineColor !== null ? "linear-gradient(0deg, ".concat(linkUnderlineColor, " 0, ").concat(linkUnderlineColor, ")") : null
|
|
142
131
|
}
|
|
143
|
-
}, authorText) : /*#__PURE__*/
|
|
144
|
-
className:
|
|
132
|
+
}, authorText) : /*#__PURE__*/React.createElement("div", null, authorText), collaboratorText !== null ? /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
className: classNames([styles.collaborator, _defineProperty({}, collaboratorClassName, collaboratorClassName)])
|
|
145
134
|
}, collaboratorText !== null ? collaboratorText : null) : null));
|
|
146
135
|
};
|
|
147
136
|
Author.propTypes = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-author",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.429",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
"license": "ISC",
|
|
33
33
|
"main": "lib/index.js",
|
|
34
34
|
"module": "es/index.js",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"require": "./lib/index.js",
|
|
38
|
+
"import": "./es/index.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
35
41
|
"files": [
|
|
36
42
|
"lib",
|
|
37
43
|
"es",
|
|
@@ -50,10 +56,10 @@
|
|
|
50
56
|
},
|
|
51
57
|
"dependencies": {
|
|
52
58
|
"@babel/runtime": "^7.13.10",
|
|
53
|
-
"@micromag/core": "^0.3.
|
|
54
|
-
"@micromag/element-button": "^0.3.
|
|
55
|
-
"@micromag/element-link": "^0.3.
|
|
56
|
-
"@micromag/element-text": "^0.3.
|
|
59
|
+
"@micromag/core": "^0.3.429",
|
|
60
|
+
"@micromag/element-button": "^0.3.429",
|
|
61
|
+
"@micromag/element-link": "^0.3.429",
|
|
62
|
+
"@micromag/element-text": "^0.3.429",
|
|
57
63
|
"classnames": "^2.2.6",
|
|
58
64
|
"lodash": "^4.17.21",
|
|
59
65
|
"prop-types": "^15.7.2",
|
|
@@ -64,5 +70,5 @@
|
|
|
64
70
|
"access": "public",
|
|
65
71
|
"registry": "https://registry.npmjs.org/"
|
|
66
72
|
},
|
|
67
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "f15e72b88ecfda4c54b87626513149b58572c52b"
|
|
68
74
|
}
|