@micromag/element-urbania-author 0.3.108 → 0.3.112

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/es/index.js CHANGED
@@ -17,7 +17,8 @@ var propTypes$1 = {
17
17
  resolution: PropTypes$1.number,
18
18
  isTag: PropTypes$1.bool,
19
19
  shape: PropTypes$1.oneOf([null, 'tag', 'circle']),
20
- className: PropTypes$1.string
20
+ className: PropTypes$1.string,
21
+ shouldLoad: PropTypes$1.bool
21
22
  };
22
23
  var defaultProps$1 = {
23
24
  image: null,
@@ -26,7 +27,8 @@ var defaultProps$1 = {
26
27
  resolution: 1,
27
28
  isTag: false,
28
29
  shape: 'Circle',
29
- className: null
30
+ className: null,
31
+ shouldLoad: true
30
32
  };
31
33
 
32
34
  var Avatar = function Avatar(_ref) {
@@ -38,7 +40,8 @@ var Avatar = function Avatar(_ref) {
38
40
  resolution = _ref.resolution,
39
41
  shape = _ref.shape,
40
42
  isTag = _ref.isTag,
41
- className = _ref.className;
43
+ className = _ref.className,
44
+ shouldLoad = _ref.shouldLoad;
42
45
  var imageAtSize = getOptimalImageUrl(image, width, height, {
43
46
  resolution: resolution
44
47
  });
@@ -47,7 +50,7 @@ var Avatar = function Avatar(_ref) {
47
50
  }, /*#__PURE__*/React.createElement("span", {
48
51
  className: styles$1.shape,
49
52
  style: {
50
- backgroundImage: "url(\"".concat(imageAtSize, "\")")
53
+ backgroundImage: shouldLoad ? "url(\"".concat(imageAtSize, "\")") : null
51
54
  }
52
55
  }));
53
56
  };
@@ -69,7 +72,8 @@ var propTypes = {
69
72
  withoutPrefix: PropTypes$1.bool,
70
73
  isSmall: PropTypes$1.bool,
71
74
  linkUnderlineColor: PropTypes$1.string,
72
- className: PropTypes$1.string
75
+ className: PropTypes$1.string,
76
+ shouldLoad: PropTypes$1.bool
73
77
  };
74
78
  var defaultProps = {
75
79
  author: null,
@@ -78,7 +82,8 @@ var defaultProps = {
78
82
  withoutPrefix: false,
79
83
  isSmall: false,
80
84
  linkUnderlineColor: null,
81
- className: null
85
+ className: null,
86
+ shouldLoad: true
82
87
  };
83
88
 
84
89
  var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
@@ -90,7 +95,8 @@ var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
90
95
  withoutPrefix = _ref.withoutPrefix,
91
96
  isSmall = _ref.isSmall,
92
97
  linkUnderlineColor = _ref.linkUnderlineColor,
93
- className = _ref.className;
98
+ className = _ref.className,
99
+ shouldLoad = _ref.shouldLoad;
94
100
  var intl = useIntl();
95
101
 
96
102
  var _ref2 = author || {},
@@ -118,7 +124,8 @@ var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
118
124
  body: "<span>".concat(prefix, "<span>")
119
125
  })) : null, withImage && image !== null ? /*#__PURE__*/React.createElement(Avatar, {
120
126
  className: styles.image,
121
- image: image
127
+ image: image,
128
+ shouldLoad: shouldLoad
122
129
  }) : null, url !== null && !withoutLink ? /*#__PURE__*/React.createElement(Link, {
123
130
  className: styles.link,
124
131
  url: url,
package/lib/index.js CHANGED
@@ -28,7 +28,8 @@ var propTypes$1 = {
28
28
  resolution: PropTypes__default["default"].number,
29
29
  isTag: PropTypes__default["default"].bool,
30
30
  shape: PropTypes__default["default"].oneOf([null, 'tag', 'circle']),
31
- className: PropTypes__default["default"].string
31
+ className: PropTypes__default["default"].string,
32
+ shouldLoad: PropTypes__default["default"].bool
32
33
  };
33
34
  var defaultProps$1 = {
34
35
  image: null,
@@ -37,7 +38,8 @@ var defaultProps$1 = {
37
38
  resolution: 1,
38
39
  isTag: false,
39
40
  shape: 'Circle',
40
- className: null
41
+ className: null,
42
+ shouldLoad: true
41
43
  };
42
44
 
43
45
  var Avatar = function Avatar(_ref) {
@@ -49,7 +51,8 @@ var Avatar = function Avatar(_ref) {
49
51
  resolution = _ref.resolution,
50
52
  shape = _ref.shape,
51
53
  isTag = _ref.isTag,
52
- className = _ref.className;
54
+ className = _ref.className,
55
+ shouldLoad = _ref.shouldLoad;
53
56
  var imageAtSize = utils.getOptimalImageUrl(image, width, height, {
54
57
  resolution: resolution
55
58
  });
@@ -58,7 +61,7 @@ var Avatar = function Avatar(_ref) {
58
61
  }, /*#__PURE__*/React__default["default"].createElement("span", {
59
62
  className: styles$1.shape,
60
63
  style: {
61
- backgroundImage: "url(\"".concat(imageAtSize, "\")")
64
+ backgroundImage: shouldLoad ? "url(\"".concat(imageAtSize, "\")") : null
62
65
  }
63
66
  }));
64
67
  };
@@ -80,7 +83,8 @@ var propTypes = {
80
83
  withoutPrefix: PropTypes__default["default"].bool,
81
84
  isSmall: PropTypes__default["default"].bool,
82
85
  linkUnderlineColor: PropTypes__default["default"].string,
83
- className: PropTypes__default["default"].string
86
+ className: PropTypes__default["default"].string,
87
+ shouldLoad: PropTypes__default["default"].bool
84
88
  };
85
89
  var defaultProps = {
86
90
  author: null,
@@ -89,7 +93,8 @@ var defaultProps = {
89
93
  withoutPrefix: false,
90
94
  isSmall: false,
91
95
  linkUnderlineColor: null,
92
- className: null
96
+ className: null,
97
+ shouldLoad: true
93
98
  };
94
99
 
95
100
  var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
@@ -101,7 +106,8 @@ var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
101
106
  withoutPrefix = _ref.withoutPrefix,
102
107
  isSmall = _ref.isSmall,
103
108
  linkUnderlineColor = _ref.linkUnderlineColor,
104
- className = _ref.className;
109
+ className = _ref.className,
110
+ shouldLoad = _ref.shouldLoad;
105
111
  var intl = reactIntl.useIntl();
106
112
 
107
113
  var _ref2 = author || {},
@@ -129,7 +135,8 @@ var UrbaniaAuthor = function UrbaniaAuthor(_ref) {
129
135
  body: "<span>".concat(prefix, "<span>")
130
136
  })) : null, withImage && image !== null ? /*#__PURE__*/React__default["default"].createElement(Avatar, {
131
137
  className: styles.image,
132
- image: image
138
+ image: image,
139
+ shouldLoad: shouldLoad
133
140
  }) : null, url !== null && !withoutLink ? /*#__PURE__*/React__default["default"].createElement(Link__default["default"], {
134
141
  className: styles.link,
135
142
  url: url,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-urbania-author",
3
- "version": "0.3.108",
3
+ "version": "0.3.112",
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.108",
53
- "@micromag/element-button": "^0.3.108",
54
- "@micromag/element-link": "^0.3.108",
55
- "@micromag/element-text": "^0.3.108",
52
+ "@micromag/core": "^0.3.112",
53
+ "@micromag/element-button": "^0.3.112",
54
+ "@micromag/element-link": "^0.3.112",
55
+ "@micromag/element-text": "^0.3.112",
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": "d7681b84be82b08eff5ed444f910ed367f235f4e"
65
+ "gitHead": "f85362071b76115397f9a77537ac6e66b91f59f3"
66
66
  }