@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.
@@ -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, (_ref2 = {}, _defineProperty(_ref2, styles$1["shape".concat(finalShape)], finalShape !== null), _defineProperty(_ref2, styles$1.isTag, isTag), _defineProperty(_ref2, className, className !== null), _ref2)])
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: PropTypes__default["default"].number,
28
- height: PropTypes__default["default"].number,
29
- resolution: PropTypes__default["default"].number,
30
- isTag: PropTypes__default["default"].bool,
31
- shape: PropTypes__default["default"].oneOf([null, 'tag', 'circle']),
32
- className: PropTypes__default["default"].string,
33
- shouldLoad: PropTypes__default["default"].bool
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__*/React__default["default"].createElement("span", {
60
- className: classNames__default["default"]([styles$1.container, (_ref2 = {}, _defineProperty__default["default"](_ref2, styles$1["shape".concat(finalShape)], finalShape !== null), _defineProperty__default["default"](_ref2, styles$1.isTag, isTag), _defineProperty__default["default"](_ref2, className, className !== null), _ref2)])
61
- }, /*#__PURE__*/React__default["default"].createElement("span", {
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: PropTypes__default["default"].shape({
76
- slug: PropTypes__default["default"].string,
64
+ author: PropTypes.shape({
65
+ slug: PropTypes.string,
77
66
  name: core.PropTypes.textElement,
78
67
  image: core.PropTypes.imageElement,
79
- url: PropTypes__default["default"].string,
68
+ url: PropTypes.string,
80
69
  collaborator: core.PropTypes.textElement
81
70
  }),
82
- withImage: PropTypes__default["default"].bool,
83
- withoutLink: PropTypes__default["default"].bool,
84
- linkUnderlineColor: PropTypes__default["default"].string,
85
- className: PropTypes__default["default"].string,
86
- backgroundClassName: PropTypes__default["default"].string,
87
- collaboratorClassName: PropTypes__default["default"].string,
88
- shouldLoad: PropTypes__default["default"].bool
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 = _objectWithoutProperties__default["default"](_ref, _excluded);
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__*/React__default["default"].createElement(Text__default["default"], Object.assign({
121
- className: classNames__default["default"]([styles.name, _defineProperty__default["default"]({}, backgroundClassName, backgroundClassName)])
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__*/React__default["default"].createElement(Text__default["default"], Object.assign({
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__*/React__default["default"].createElement("div", Object.assign({
129
- className: classNames__default["default"]([styles.container, _defineProperty__default["default"]({}, className, className !== null)])
130
- }, otherProps), withAvatar ? /*#__PURE__*/React__default["default"].createElement(Avatar, {
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__*/React__default["default"].createElement("div", {
123
+ }) : null, /*#__PURE__*/React.createElement("div", {
135
124
  className: styles.right
136
- }, url !== null && !withoutLink ? /*#__PURE__*/React__default["default"].createElement(Link__default["default"], {
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__*/React__default["default"].createElement("div", null, authorText), collaboratorText !== null ? /*#__PURE__*/React__default["default"].createElement("div", {
144
- className: classNames__default["default"]([styles.collaborator, _defineProperty__default["default"]({}, collaboratorClassName, collaboratorClassName)])
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.420",
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.420",
54
- "@micromag/element-button": "^0.3.420",
55
- "@micromag/element-link": "^0.3.420",
56
- "@micromag/element-text": "^0.3.420",
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": "5b0f037a41c3bca07a5bce8f0dce205242f7ad17"
73
+ "gitHead": "f15e72b88ecfda4c54b87626513149b58572c52b"
68
74
  }