@micromag/screen-conversation 0.3.105 → 0.3.108

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.
Files changed (3) hide show
  1. package/es/index.js +10 -4
  2. package/lib/index.js +10 -4
  3. package/package.json +12 -12
package/es/index.js CHANGED
@@ -35,6 +35,7 @@ var propTypes$1 = {
35
35
  onChange: PropTypes$1.func,
36
36
  withAnimation: PropTypes$1.bool,
37
37
  isPlaying: PropTypes$1.bool,
38
+ shouldLoad: PropTypes$1.bool,
38
39
  speakerStyle: PropTypes.textStyle,
39
40
  messageStyle: PropTypes.textStyle,
40
41
  className: PropTypes$1.string
@@ -50,6 +51,7 @@ var defaultProps$1 = {
50
51
  onChange: null,
51
52
  withAnimation: false,
52
53
  isPlaying: false,
54
+ shouldLoad: true,
53
55
  messageStyle: null,
54
56
  speakerStyle: null,
55
57
  className: null
@@ -68,6 +70,7 @@ var ConversationMessage = function ConversationMessage(_ref) {
68
70
  onChange = _ref.onChange,
69
71
  withAnimation = _ref.withAnimation,
70
72
  isPlaying = _ref.isPlaying,
73
+ shouldLoad = _ref.shouldLoad,
71
74
  messageStyle = _ref.messageStyle,
72
75
  speakerStyle = _ref.speakerStyle,
73
76
  className = _ref.className;
@@ -152,7 +155,8 @@ var ConversationMessage = function ConversationMessage(_ref) {
152
155
  }, /*#__PURE__*/React.createElement("img", {
153
156
  className: styles.avatar,
154
157
  src: avatarUrl,
155
- alt: speakerName
158
+ alt: speakerName,
159
+ loading: "lazy"
156
160
  })) : null, /*#__PURE__*/React.createElement(Text, {
157
161
  body: speakerName,
158
162
  textStyle: speakerStyle
@@ -163,7 +167,8 @@ var ConversationMessage = function ConversationMessage(_ref) {
163
167
  }, /*#__PURE__*/React.createElement(Visual, {
164
168
  media: image,
165
169
  width: "100%",
166
- playing: isPlaying
170
+ playing: isPlaying,
171
+ shouldLoad: shouldLoad
167
172
  })) : null, /*#__PURE__*/React.createElement(Text, {
168
173
  className: styles.messageBody,
169
174
  body: messageBody,
@@ -245,7 +250,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
245
250
  isCapture = _useScreenRenderConte.isCapture;
246
251
 
247
252
  var backgroundPlaying = current && (isView || isEdit);
248
- var backgroundShouldLoad = current || active || !isView;
253
+ var mediaShouldLoad = current || active;
249
254
  var withAnimation = isView && !isStatic && timingMode === 'sequence';
250
255
 
251
256
  var _ref2 = conversation || {},
@@ -366,7 +371,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
366
371
  height: height,
367
372
  resolution: resolution,
368
373
  playing: backgroundPlaying,
369
- shouldLoad: backgroundShouldLoad
374
+ shouldLoad: mediaShouldLoad
370
375
  }) : null, /*#__PURE__*/React.createElement(Container, {
371
376
  width: width,
372
377
  height: height
@@ -425,6 +430,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
425
430
  onChange: conversationStateChange,
426
431
  withAnimation: withAnimation,
427
432
  isPlaying: current && shouldPlay,
433
+ shouldLoad: mediaShouldLoad,
428
434
  messageStyle: messageStyle,
429
435
  speakerStyle: speakerStyle
430
436
  });
package/lib/index.js CHANGED
@@ -57,6 +57,7 @@ var propTypes$1 = {
57
57
  onChange: PropTypes__default["default"].func,
58
58
  withAnimation: PropTypes__default["default"].bool,
59
59
  isPlaying: PropTypes__default["default"].bool,
60
+ shouldLoad: PropTypes__default["default"].bool,
60
61
  speakerStyle: core.PropTypes.textStyle,
61
62
  messageStyle: core.PropTypes.textStyle,
62
63
  className: PropTypes__default["default"].string
@@ -72,6 +73,7 @@ var defaultProps$1 = {
72
73
  onChange: null,
73
74
  withAnimation: false,
74
75
  isPlaying: false,
76
+ shouldLoad: true,
75
77
  messageStyle: null,
76
78
  speakerStyle: null,
77
79
  className: null
@@ -90,6 +92,7 @@ var ConversationMessage = function ConversationMessage(_ref) {
90
92
  onChange = _ref.onChange,
91
93
  withAnimation = _ref.withAnimation,
92
94
  isPlaying = _ref.isPlaying,
95
+ shouldLoad = _ref.shouldLoad,
93
96
  messageStyle = _ref.messageStyle,
94
97
  speakerStyle = _ref.speakerStyle,
95
98
  className = _ref.className;
@@ -174,7 +177,8 @@ var ConversationMessage = function ConversationMessage(_ref) {
174
177
  }, /*#__PURE__*/React__default["default"].createElement("img", {
175
178
  className: styles.avatar,
176
179
  src: avatarUrl,
177
- alt: speakerName
180
+ alt: speakerName,
181
+ loading: "lazy"
178
182
  })) : null, /*#__PURE__*/React__default["default"].createElement(Text__default["default"], {
179
183
  body: speakerName,
180
184
  textStyle: speakerStyle
@@ -185,7 +189,8 @@ var ConversationMessage = function ConversationMessage(_ref) {
185
189
  }, /*#__PURE__*/React__default["default"].createElement(Visual__default["default"], {
186
190
  media: image,
187
191
  width: "100%",
188
- playing: isPlaying
192
+ playing: isPlaying,
193
+ shouldLoad: shouldLoad
189
194
  })) : null, /*#__PURE__*/React__default["default"].createElement(Text__default["default"], {
190
195
  className: styles.messageBody,
191
196
  body: messageBody,
@@ -267,7 +272,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
267
272
  isCapture = _useScreenRenderConte.isCapture;
268
273
 
269
274
  var backgroundPlaying = current && (isView || isEdit);
270
- var backgroundShouldLoad = current || active || !isView;
275
+ var mediaShouldLoad = current || active;
271
276
  var withAnimation = isView && !isStatic && timingMode === 'sequence';
272
277
 
273
278
  var _ref2 = conversation || {},
@@ -388,7 +393,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
388
393
  height: height,
389
394
  resolution: resolution,
390
395
  playing: backgroundPlaying,
391
- shouldLoad: backgroundShouldLoad
396
+ shouldLoad: mediaShouldLoad
392
397
  }) : null, /*#__PURE__*/React__default["default"].createElement(Container__default["default"], {
393
398
  width: width,
394
399
  height: height
@@ -447,6 +452,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
447
452
  onChange: conversationStateChange,
448
453
  withAnimation: withAnimation,
449
454
  isPlaying: current && shouldPlay,
455
+ shouldLoad: mediaShouldLoad,
450
456
  messageStyle: messageStyle,
451
457
  speakerStyle: speakerStyle
452
458
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-conversation",
3
- "version": "0.3.105",
3
+ "version": "0.3.108",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -49,16 +49,16 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.13.10",
52
- "@micromag/core": "^0.3.105",
53
- "@micromag/element-background": "^0.3.105",
54
- "@micromag/element-call-to-action": "^0.3.105",
55
- "@micromag/element-container": "^0.3.105",
56
- "@micromag/element-heading": "^0.3.105",
57
- "@micromag/element-layout": "^0.3.105",
58
- "@micromag/element-scroll": "^0.3.105",
59
- "@micromag/element-text": "^0.3.105",
60
- "@micromag/element-visual": "^0.3.105",
61
- "@micromag/transforms": "^0.3.105",
52
+ "@micromag/core": "^0.3.108",
53
+ "@micromag/element-background": "^0.3.108",
54
+ "@micromag/element-call-to-action": "^0.3.108",
55
+ "@micromag/element-container": "^0.3.108",
56
+ "@micromag/element-heading": "^0.3.108",
57
+ "@micromag/element-layout": "^0.3.108",
58
+ "@micromag/element-scroll": "^0.3.108",
59
+ "@micromag/element-text": "^0.3.108",
60
+ "@micromag/element-visual": "^0.3.108",
61
+ "@micromag/transforms": "^0.3.108",
62
62
  "classnames": "^2.2.6",
63
63
  "lodash": "^4.17.21",
64
64
  "prop-types": "^15.7.2",
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "fb6c28846c08f30c035ebbc162a4135b8b4d42a5"
71
+ "gitHead": "d7681b84be82b08eff5ed444f910ed367f235f4e"
72
72
  }