@micromag/screen-survey 0.2.405 → 0.2.409

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
@@ -37,6 +37,7 @@ var propTypes = {
37
37
  callToAction: PropTypes$1.callToAction,
38
38
  withPercentLabels: PropTypes.bool,
39
39
  current: PropTypes.bool,
40
+ active: PropTypes.bool,
40
41
  transitions: PropTypes$1.transitions,
41
42
  transitionStagger: PropTypes.number,
42
43
  resultTransitionDuration: PropTypes.number,
@@ -55,6 +56,7 @@ var defaultProps = {
55
56
  callToAction: null,
56
57
  withPercentLabels: true,
57
58
  current: true,
59
+ active: true,
58
60
  transitions: null,
59
61
  transitionStagger: 100,
60
62
  resultTransitionDuration: 500,
@@ -76,6 +78,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
76
78
  callToAction = _ref.callToAction,
77
79
  withPercentLabels = _ref.withPercentLabels,
78
80
  current = _ref.current,
81
+ active = _ref.active,
79
82
  transitions = _ref.transitions,
80
83
  transitionStagger = _ref.transitionStagger,
81
84
  resultTransitionDuration = _ref.resultTransitionDuration,
@@ -174,6 +177,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
174
177
  var transitionPlaying = current;
175
178
  var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
176
179
  var backgroundPlaying = current && (isView || isEdit);
180
+ var backgroundShouldLoad = current || active || !isView;
177
181
  var onAnswerClick = useCallback(function (answerIndex) {
178
182
  if (userAnswerIndex === null) {
179
183
  setUserAnswerIndex(answerIndex);
@@ -402,7 +406,8 @@ var SurveyScreen = function SurveyScreen(_ref) {
402
406
  background: background,
403
407
  width: width,
404
408
  height: height,
405
- playing: backgroundPlaying
409
+ playing: backgroundPlaying,
410
+ shouldLoad: backgroundShouldLoad
406
411
  }) : null, /*#__PURE__*/React.createElement(Container, {
407
412
  width: width,
408
413
  height: height
package/lib/index.js CHANGED
@@ -58,6 +58,7 @@ var propTypes = {
58
58
  callToAction: core.PropTypes.callToAction,
59
59
  withPercentLabels: PropTypes__default["default"].bool,
60
60
  current: PropTypes__default["default"].bool,
61
+ active: PropTypes__default["default"].bool,
61
62
  transitions: core.PropTypes.transitions,
62
63
  transitionStagger: PropTypes__default["default"].number,
63
64
  resultTransitionDuration: PropTypes__default["default"].number,
@@ -76,6 +77,7 @@ var defaultProps = {
76
77
  callToAction: null,
77
78
  withPercentLabels: true,
78
79
  current: true,
80
+ active: true,
79
81
  transitions: null,
80
82
  transitionStagger: 100,
81
83
  resultTransitionDuration: 500,
@@ -97,6 +99,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
97
99
  callToAction = _ref.callToAction,
98
100
  withPercentLabels = _ref.withPercentLabels,
99
101
  current = _ref.current,
102
+ active = _ref.active,
100
103
  transitions = _ref.transitions,
101
104
  transitionStagger = _ref.transitionStagger,
102
105
  resultTransitionDuration = _ref.resultTransitionDuration,
@@ -195,6 +198,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
195
198
  var transitionPlaying = current;
196
199
  var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
197
200
  var backgroundPlaying = current && (isView || isEdit);
201
+ var backgroundShouldLoad = current || active || !isView;
198
202
  var onAnswerClick = React.useCallback(function (answerIndex) {
199
203
  if (userAnswerIndex === null) {
200
204
  setUserAnswerIndex(answerIndex);
@@ -423,7 +427,8 @@ var SurveyScreen = function SurveyScreen(_ref) {
423
427
  background: background,
424
428
  width: width,
425
429
  height: height,
426
- playing: backgroundPlaying
430
+ playing: backgroundPlaying,
431
+ shouldLoad: backgroundShouldLoad
427
432
  }) : null, /*#__PURE__*/React__default["default"].createElement(Container__default["default"], {
428
433
  width: width,
429
434
  height: height
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-survey",
3
- "version": "0.2.405",
3
+ "version": "0.2.409",
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.2.405",
53
- "@micromag/data": "^0.2.405",
54
- "@micromag/element-background": "^0.2.405",
55
- "@micromag/element-button": "^0.2.405",
56
- "@micromag/element-call-to-action": "^0.2.405",
57
- "@micromag/element-container": "^0.2.405",
58
- "@micromag/element-heading": "^0.2.405",
59
- "@micromag/element-layout": "^0.2.405",
60
- "@micromag/element-text": "^0.2.405",
61
- "@micromag/transforms": "^0.2.405",
52
+ "@micromag/core": "^0.2.409",
53
+ "@micromag/data": "^0.2.409",
54
+ "@micromag/element-background": "^0.2.409",
55
+ "@micromag/element-button": "^0.2.409",
56
+ "@micromag/element-call-to-action": "^0.2.409",
57
+ "@micromag/element-container": "^0.2.409",
58
+ "@micromag/element-heading": "^0.2.409",
59
+ "@micromag/element-layout": "^0.2.409",
60
+ "@micromag/element-text": "^0.2.409",
61
+ "@micromag/transforms": "^0.2.409",
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": "e3d172d92d78222d5307cc1513fee7eef9f28402"
71
+ "gitHead": "4c16c3bb63644d1bd5b7d50086098337317ee3f6"
72
72
  }