@micromag/element-author 0.4.37 → 0.4.40
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 +16 -14
- package/es/styles.css +1 -1
- package/package.json +6 -6
package/assets/css/styles.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.micromag-element-author-avatar-container{display:inline-block;position:relative;width:100%;z-index:1}.micromag-element-author-avatar-container
|
|
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-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%}.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}
|
|
2
2
|
.micromag-element-author-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;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{-webkit-text-decoration:none;text-decoration:none}.micromag-element-author-container .micromag-element-author-right{display:block;-ms-flex-positive:1;flex-grow:1}.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
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
1
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
|
-
import React from 'react';
|
|
3
|
+
import React$1 from 'react';
|
|
5
4
|
import { getOptimalImageUrl, pascalCase, isTextFilled } from '@micromag/core/utils';
|
|
6
5
|
import Link from '@micromag/element-link';
|
|
7
6
|
import Text from '@micromag/element-text';
|
|
7
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
8
8
|
import { useSetting } from '@micromag/core/contexts';
|
|
9
9
|
|
|
10
|
-
var styles$1 = {"container":"micromag-element-author-avatar-container","
|
|
10
|
+
var styles$1 = {"container":"micromag-element-author-avatar-container","shape":"micromag-element-author-avatar-shape","shapeCircle":"micromag-element-author-avatar-shapeCircle"};
|
|
11
11
|
|
|
12
12
|
function Avatar(_ref) {
|
|
13
13
|
var _ref$image = _ref.image,
|
|
@@ -34,7 +34,9 @@ function Avatar(_ref) {
|
|
|
34
34
|
});
|
|
35
35
|
var finalShape = shape !== null ? pascalCase(shape) : null;
|
|
36
36
|
return /*#__PURE__*/React.createElement("span", {
|
|
37
|
-
className: classNames([styles$1.container, _defineProperty(_defineProperty(
|
|
37
|
+
className: classNames([styles$1.container, _defineProperty(_defineProperty({
|
|
38
|
+
className: className
|
|
39
|
+
}, styles$1["shape".concat(finalShape)], finalShape !== null), styles$1.isTag, isTag)])
|
|
38
40
|
}, /*#__PURE__*/React.createElement("span", {
|
|
39
41
|
className: styles$1.shape,
|
|
40
42
|
style: {
|
|
@@ -74,31 +76,31 @@ function Author(_ref) {
|
|
|
74
76
|
_ref2$collaborator = _ref2.collaborator,
|
|
75
77
|
collaborator = _ref2$collaborator === void 0 ? null : _ref2$collaborator;
|
|
76
78
|
var withAvatar = withImage && image !== null;
|
|
77
|
-
var authorText = isTextFilled(name) ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
78
|
-
className: classNames([styles.name,
|
|
79
|
+
var authorText = isTextFilled(name) ? /*#__PURE__*/React$1.createElement(Text, Object.assign({
|
|
80
|
+
className: classNames([styles.name, backgroundClassName])
|
|
79
81
|
}, name)) : null;
|
|
80
|
-
var collaboratorText = isTextFilled(collaborator) ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
82
|
+
var collaboratorText = isTextFilled(collaborator) ? /*#__PURE__*/React$1.createElement(Text, Object.assign({
|
|
81
83
|
className: styles.collaboratorText
|
|
82
84
|
}, collaborator, {
|
|
83
85
|
inline: true
|
|
84
86
|
})) : null;
|
|
85
|
-
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
86
|
-
className: classNames([styles.container,
|
|
87
|
-
}, otherProps), withAvatar ? /*#__PURE__*/React.createElement(Avatar, {
|
|
87
|
+
return /*#__PURE__*/React$1.createElement("div", Object.assign({
|
|
88
|
+
className: classNames([styles.container, className])
|
|
89
|
+
}, otherProps), withAvatar ? /*#__PURE__*/React$1.createElement(Avatar, {
|
|
88
90
|
className: styles.image,
|
|
89
91
|
image: image,
|
|
90
92
|
shouldLoad: shouldLoad
|
|
91
|
-
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
}) : null, /*#__PURE__*/React$1.createElement("div", {
|
|
92
94
|
className: styles.right
|
|
93
|
-
}, url !== null && !withoutLink ? /*#__PURE__*/React.createElement(Link, {
|
|
95
|
+
}, url !== null && !withoutLink ? /*#__PURE__*/React$1.createElement(Link, {
|
|
94
96
|
className: styles.link,
|
|
95
97
|
url: url,
|
|
96
98
|
external: true,
|
|
97
99
|
style: {
|
|
98
100
|
backgroundImage: linkUnderlineColor !== null ? "linear-gradient(0deg, ".concat(linkUnderlineColor, " 0, ").concat(linkUnderlineColor, ")") : null
|
|
99
101
|
}
|
|
100
|
-
}, authorText) : /*#__PURE__*/React.createElement("div", null, authorText), collaboratorText !== null ? /*#__PURE__*/React.createElement("div", {
|
|
101
|
-
className: classNames([styles.collaborator,
|
|
102
|
+
}, authorText) : /*#__PURE__*/React$1.createElement("div", null, authorText), collaboratorText !== null ? /*#__PURE__*/React$1.createElement("div", {
|
|
103
|
+
className: classNames([styles.collaborator, collaboratorClassName])
|
|
102
104
|
}, collaboratorText !== null ? collaboratorText : null) : null));
|
|
103
105
|
}
|
|
104
106
|
|
package/es/styles.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.micromag-element-author-avatar-container{display:inline-block;position:relative;width:100%;z-index:1}.micromag-element-author-avatar-container
|
|
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-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%}.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}
|
|
2
2
|
.micromag-element-author-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;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{-webkit-text-decoration:none;text-decoration:none}.micromag-element-author-container .micromag-element-author-right{display:block;-ms-flex-positive:1;flex-grow:1}.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-author",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.40",
|
|
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.40",
|
|
65
|
+
"@micromag/element-button": "^0.4.40",
|
|
66
|
+
"@micromag/element-link": "^0.4.40",
|
|
67
|
+
"@micromag/element-text": "^0.4.40",
|
|
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": "6a9ff6e196a972abfd617f49353862cf445b0e83"
|
|
78
78
|
}
|