@micromag/element-urbania-author 0.3.423 → 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-urbania-author-avatar-container{display:inline-block;position:relative;width:100%;z-index:1}.micromag-element-urbania-author-avatar-container.micromag-element-urbania-author-avatar-shapeCircle .micromag-element-urbania-author-avatar-shape{background-color:#fff;background-position:top;border-radius:50%;overflow:hidden}.micromag-element-urbania-author-avatar-container .micromag-element-urbania-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-urbania-author-container{-ms-flex-align:center;align-items:center;color:#222;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-family:Agrandir;vertical-align:center}.micromag-element-urbania-author-container .micromag-element-urbania-author-image{max-width:4em;min-width:2.2em}.micromag-element-urbania-author-container .micromag-element-urbania-author-link{color:#222;display:inline-block;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{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{border-bottom-right-radius:40px;border-top-right-radius:40px;font-weight:700;line-height:1;margin-left:-7px;padding:6px 8px 3px 13px;text-transform:uppercase}.micromag-element-urbania-author-container .micromag-element-urbania-author-name p{display:inline;font-size:inherit;font-weight:inherit;margin:0;text-transform:inherit}.micromag-element-urbania-author-container .micromag-element-urbania-author-collaborator{background-color:transparent;color:#fff;padding-top:2px;position:absolute}.micromag-element-urbania-author-container .micromag-element-urbania-author-collaborator .micromag-element-urbania-author-collaboratorText{font-size:.9em;line-height:1;padding-left:7.3px}.micromag-element-urbania-author-container .micromag-element-urbania-author-collaborator .micromag-element-urbania-author-collaboratorText p{display:inline;font-size:inherit;line-height:inherit}.micromag-element-urbania-author-container .micromag-element-urbania-author-prefix{border-bottom-left-radius:40px;border-top-left-radius:40px;margin-right:-5px;padding:6px 12px 3px 8px}.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}
2
+ .micromag-element-urbania-author-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#222;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-family:Agrandir;vertical-align:center}.micromag-element-urbania-author-container .micromag-element-urbania-author-image{max-width:4em;min-width:2.2em}.micromag-element-urbania-author-container .micromag-element-urbania-author-link{color:#222;display:inline-block;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{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{border-bottom-right-radius:40px;border-top-right-radius:40px;font-weight:700;line-height:1;margin-left:-7px;padding:6px 8px 3px 13px;text-transform:uppercase}.micromag-element-urbania-author-container .micromag-element-urbania-author-name p{display:inline;font-size:inherit;font-weight:inherit;margin:0;text-transform:inherit}.micromag-element-urbania-author-container .micromag-element-urbania-author-collaborator{background-color:transparent;color:#fff;padding-top:2px;position:absolute}.micromag-element-urbania-author-container .micromag-element-urbania-author-collaborator .micromag-element-urbania-author-collaboratorText{font-size:.9em;line-height:1;padding-left:7.3px}.micromag-element-urbania-author-container .micromag-element-urbania-author-collaborator .micromag-element-urbania-author-collaboratorText p{display:inline;font-size:inherit;line-height:inherit}.micromag-element-urbania-author-container .micromag-element-urbania-author-prefix{border-bottom-left-radius:40px;border-top-left-radius:40px;margin-right:-5px;padding:6px 12px 3px 8px}.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
@@ -32,7 +32,6 @@ var defaultProps$1 = {
32
32
  shouldLoad: true
33
33
  };
34
34
  var Avatar = function Avatar(_ref) {
35
- var _ref2;
36
35
  var image = _ref.image,
37
36
  width = _ref.width,
38
37
  height = _ref.height,
@@ -46,7 +45,7 @@ var Avatar = function Avatar(_ref) {
46
45
  });
47
46
  var finalShape = shape !== null ? pascalCase(shape) : null;
48
47
  return /*#__PURE__*/React.createElement("span", {
49
- 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)])
48
+ className: classNames([styles$1.container, _defineProperty(_defineProperty(_defineProperty({}, styles$1["shape".concat(finalShape)], finalShape !== null), styles$1.isTag, isTag), className, className !== null)])
50
49
  }, /*#__PURE__*/React.createElement("span", {
51
50
  className: styles$1.shape,
52
51
  style: {
@@ -91,7 +90,6 @@ var defaultProps = {
91
90
  shouldLoad: true
92
91
  };
93
92
  var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
94
- var _ref4;
95
93
  var author = _ref.author,
96
94
  withImage = _ref.withImage,
97
95
  withoutLink = _ref.withoutLink,
@@ -130,7 +128,7 @@ var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
130
128
  inline: true
131
129
  })) : null;
132
130
  return /*#__PURE__*/React.createElement("div", Object.assign({
133
- className: classNames([styles.container, (_ref4 = {}, _defineProperty(_ref4, styles.isSmall, isSmall), _defineProperty(_ref4, styles.withoutAvatar, withAvatar), _defineProperty(_ref4, styles.withoutImage, !withImage || image === null), _defineProperty(_ref4, className, className !== null), _ref4)])
131
+ className: classNames([styles.container, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles.isSmall, isSmall), styles.withoutAvatar, withAvatar), styles.withoutImage, !withImage || image === null), className, className !== null)])
134
132
  }, otherProps), !withoutPrefix ? /*#__PURE__*/React.createElement(Text, Object.assign({}, name, {
135
133
  className: classNames([styles.prefix, _defineProperty({}, backgroundClassName, backgroundClassName)]),
136
134
  body: "<span>".concat(prefix, "<span>")
package/lib/index.js CHANGED
@@ -11,27 +11,17 @@ var utils = require('@micromag/core/utils');
11
11
  var Link = require('@micromag/element-link');
12
12
  var Text = require('@micromag/element-text');
13
13
 
14
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
-
16
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
17
- var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
18
- var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
19
- var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
20
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
- var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
22
- var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
23
-
24
14
  var styles$1 = {"container":"micromag-element-urbania-author-avatar-container","shapeCircle":"micromag-element-urbania-author-avatar-shapeCircle","shape":"micromag-element-urbania-author-avatar-shape"};
25
15
 
26
16
  var propTypes$1 = {
27
17
  image: core.PropTypes.imageElement,
28
- width: PropTypes__default["default"].number,
29
- height: PropTypes__default["default"].number,
30
- resolution: PropTypes__default["default"].number,
31
- isTag: PropTypes__default["default"].bool,
32
- shape: PropTypes__default["default"].oneOf([null, 'tag', 'circle']),
33
- className: PropTypes__default["default"].string,
34
- shouldLoad: PropTypes__default["default"].bool
18
+ width: PropTypes.number,
19
+ height: PropTypes.number,
20
+ resolution: PropTypes.number,
21
+ isTag: PropTypes.bool,
22
+ shape: PropTypes.oneOf([null, 'tag', 'circle']),
23
+ className: PropTypes.string,
24
+ shouldLoad: PropTypes.bool
35
25
  };
36
26
  var defaultProps$1 = {
37
27
  image: null,
@@ -44,7 +34,6 @@ var defaultProps$1 = {
44
34
  shouldLoad: true
45
35
  };
46
36
  var Avatar = function Avatar(_ref) {
47
- var _ref2;
48
37
  var image = _ref.image,
49
38
  width = _ref.width,
50
39
  height = _ref.height,
@@ -57,9 +46,9 @@ var Avatar = function Avatar(_ref) {
57
46
  resolution: resolution
58
47
  });
59
48
  var finalShape = shape !== null ? utils.pascalCase(shape) : null;
60
- return /*#__PURE__*/React__default["default"].createElement("span", {
61
- 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)])
62
- }, /*#__PURE__*/React__default["default"].createElement("span", {
49
+ return /*#__PURE__*/React.createElement("span", {
50
+ className: classNames([styles$1.container, _defineProperty(_defineProperty(_defineProperty({}, styles$1["shape".concat(finalShape)], finalShape !== null), styles$1.isTag, isTag), className, className !== null)])
51
+ }, /*#__PURE__*/React.createElement("span", {
63
52
  className: styles$1.shape,
64
53
  style: {
65
54
  backgroundImage: shouldLoad ? "url(\"".concat(imageAtSize, "\")") : null
@@ -73,22 +62,22 @@ var styles = {"container":"micromag-element-urbania-author-container","image":"m
73
62
 
74
63
  var _excluded = ["author", "withImage", "withoutLink", "withoutPrefix", "isSmall", "linkUnderlineColor", "className", "backgroundClassName", "collaboratorClassName", "shouldLoad"];
75
64
  var propTypes = {
76
- author: PropTypes__default["default"].shape({
77
- slug: PropTypes__default["default"].string,
65
+ author: PropTypes.shape({
66
+ slug: PropTypes.string,
78
67
  name: core.PropTypes.textElement,
79
68
  image: core.PropTypes.imageElement,
80
- url: PropTypes__default["default"].string,
69
+ url: PropTypes.string,
81
70
  collaborator: core.PropTypes.textElement
82
71
  }),
83
- withImage: PropTypes__default["default"].bool,
84
- withoutLink: PropTypes__default["default"].bool,
85
- withoutPrefix: PropTypes__default["default"].bool,
86
- isSmall: PropTypes__default["default"].bool,
87
- linkUnderlineColor: PropTypes__default["default"].string,
88
- className: PropTypes__default["default"].string,
89
- backgroundClassName: PropTypes__default["default"].string,
90
- collaboratorClassName: PropTypes__default["default"].string,
91
- shouldLoad: PropTypes__default["default"].bool
72
+ withImage: PropTypes.bool,
73
+ withoutLink: PropTypes.bool,
74
+ withoutPrefix: PropTypes.bool,
75
+ isSmall: PropTypes.bool,
76
+ linkUnderlineColor: PropTypes.string,
77
+ className: PropTypes.string,
78
+ backgroundClassName: PropTypes.string,
79
+ collaboratorClassName: PropTypes.string,
80
+ shouldLoad: PropTypes.bool
92
81
  };
93
82
  var defaultProps = {
94
83
  author: null,
@@ -103,7 +92,6 @@ var defaultProps = {
103
92
  shouldLoad: true
104
93
  };
105
94
  var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
106
- var _ref4;
107
95
  var author = _ref.author,
108
96
  withImage = _ref.withImage,
109
97
  withoutLink = _ref.withoutLink,
@@ -114,7 +102,7 @@ var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
114
102
  backgroundClassName = _ref.backgroundClassName,
115
103
  collaboratorClassName = _ref.collaboratorClassName,
116
104
  shouldLoad = _ref.shouldLoad,
117
- otherProps = _objectWithoutProperties__default["default"](_ref, _excluded);
105
+ otherProps = _objectWithoutProperties(_ref, _excluded);
118
106
  var intl = reactIntl.useIntl();
119
107
  var _ref2 = author || {},
120
108
  _ref2$name = _ref2.name,
@@ -133,34 +121,34 @@ var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
133
121
  "value": "By"
134
122
  }]
135
123
  });
136
- var authorText = utils.isTextFilled(name) ? /*#__PURE__*/React__default["default"].createElement(Text__default["default"], Object.assign({
137
- className: classNames__default["default"]([styles.name, _defineProperty__default["default"]({}, backgroundClassName, backgroundClassName)])
124
+ var authorText = utils.isTextFilled(name) ? /*#__PURE__*/React.createElement(Text, Object.assign({
125
+ className: classNames([styles.name, _defineProperty({}, backgroundClassName, backgroundClassName)])
138
126
  }, name)) : null;
139
- var collaboratorText = utils.isTextFilled(collaborator) ? /*#__PURE__*/React__default["default"].createElement(Text__default["default"], Object.assign({
127
+ var collaboratorText = utils.isTextFilled(collaborator) ? /*#__PURE__*/React.createElement(Text, Object.assign({
140
128
  className: styles.collaboratorText
141
129
  }, collaborator, {
142
130
  inline: true
143
131
  })) : null;
144
- return /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
145
- className: classNames__default["default"]([styles.container, (_ref4 = {}, _defineProperty__default["default"](_ref4, styles.isSmall, isSmall), _defineProperty__default["default"](_ref4, styles.withoutAvatar, withAvatar), _defineProperty__default["default"](_ref4, styles.withoutImage, !withImage || image === null), _defineProperty__default["default"](_ref4, className, className !== null), _ref4)])
146
- }, otherProps), !withoutPrefix ? /*#__PURE__*/React__default["default"].createElement(Text__default["default"], Object.assign({}, name, {
147
- className: classNames__default["default"]([styles.prefix, _defineProperty__default["default"]({}, backgroundClassName, backgroundClassName)]),
132
+ return /*#__PURE__*/React.createElement("div", Object.assign({
133
+ className: classNames([styles.container, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles.isSmall, isSmall), styles.withoutAvatar, withAvatar), styles.withoutImage, !withImage || image === null), className, className !== null)])
134
+ }, otherProps), !withoutPrefix ? /*#__PURE__*/React.createElement(Text, Object.assign({}, name, {
135
+ className: classNames([styles.prefix, _defineProperty({}, backgroundClassName, backgroundClassName)]),
148
136
  body: "<span>".concat(prefix, "<span>")
149
- })) : null, withAvatar ? /*#__PURE__*/React__default["default"].createElement(Avatar, {
137
+ })) : null, withAvatar ? /*#__PURE__*/React.createElement(Avatar, {
150
138
  className: styles.image,
151
139
  image: image,
152
140
  shouldLoad: shouldLoad
153
- }) : null, /*#__PURE__*/React__default["default"].createElement("div", {
141
+ }) : null, /*#__PURE__*/React.createElement("div", {
154
142
  className: styles.right
155
- }, url !== null && !withoutLink ? /*#__PURE__*/React__default["default"].createElement(Link__default["default"], {
143
+ }, url !== null && !withoutLink ? /*#__PURE__*/React.createElement(Link, {
156
144
  className: styles.link,
157
145
  url: url,
158
146
  external: true,
159
147
  style: {
160
148
  backgroundImage: linkUnderlineColor !== null ? "linear-gradient(0deg, ".concat(linkUnderlineColor, " 0, ").concat(linkUnderlineColor, ")") : null
161
149
  }
162
- }, authorText) : /*#__PURE__*/React__default["default"].createElement("div", null, authorText), collaboratorText !== null ? /*#__PURE__*/React__default["default"].createElement("div", {
163
- className: classNames__default["default"]([styles.collaborator, _defineProperty__default["default"]({}, collaboratorClassName, collaboratorClassName)])
150
+ }, authorText) : /*#__PURE__*/React.createElement("div", null, authorText), collaboratorText !== null ? /*#__PURE__*/React.createElement("div", {
151
+ className: classNames([styles.collaborator, _defineProperty({}, collaboratorClassName, collaboratorClassName)])
164
152
  }, collaboratorText !== null ? collaboratorText : null) : null));
165
153
  };
166
154
  UrbaniaAuthor.propTypes = propTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-urbania-author",
3
- "version": "0.3.423",
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.423",
54
- "@micromag/element-button": "^0.3.423",
55
- "@micromag/element-link": "^0.3.423",
56
- "@micromag/element-text": "^0.3.423",
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": "c02e69c23fd099d5684bc0b69e02f19825cecfd2"
73
+ "gitHead": "f15e72b88ecfda4c54b87626513149b58572c52b"
68
74
  }