@micromag/screen-quiz 0.2.404 → 0.2.408
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 +9 -4
- package/lib/index.js +9 -4
- package/package.json +12 -12
package/es/index.js
CHANGED
|
@@ -41,6 +41,7 @@ var propTypes = {
|
|
|
41
41
|
background: PropTypes$1.backgroundElement,
|
|
42
42
|
callToAction: PropTypes$1.callToAction,
|
|
43
43
|
current: PropTypes.bool,
|
|
44
|
+
active: PropTypes.bool,
|
|
44
45
|
transitions: PropTypes$1.transitions,
|
|
45
46
|
transitionStagger: PropTypes.number,
|
|
46
47
|
resultsTransitionDuration: PropTypes.number,
|
|
@@ -61,6 +62,7 @@ var defaultProps = {
|
|
|
61
62
|
background: null,
|
|
62
63
|
callToAction: null,
|
|
63
64
|
current: true,
|
|
65
|
+
active: true,
|
|
64
66
|
transitions: null,
|
|
65
67
|
transitionStagger: 100,
|
|
66
68
|
resultsTransitionDuration: 500,
|
|
@@ -84,6 +86,7 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
84
86
|
background = _ref.background,
|
|
85
87
|
callToAction = _ref.callToAction,
|
|
86
88
|
current = _ref.current,
|
|
89
|
+
active = _ref.active,
|
|
87
90
|
transitions = _ref.transitions,
|
|
88
91
|
transitionStagger = _ref.transitionStagger,
|
|
89
92
|
resultsTransitionDuration = _ref.resultsTransitionDuration,
|
|
@@ -141,7 +144,8 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
141
144
|
var verticalAlign = isSplitted ? null : layout;
|
|
142
145
|
var transitionPlaying = current;
|
|
143
146
|
var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
|
|
144
|
-
var backgroundPlaying = current && (isView || isEdit);
|
|
147
|
+
var backgroundPlaying = current && (isView || isEdit);
|
|
148
|
+
var backgroundShouldLoad = current || active || !isView; // Call to Action
|
|
145
149
|
|
|
146
150
|
var hasCallToAction = callToAction !== null && callToAction.active === true;
|
|
147
151
|
|
|
@@ -377,7 +381,7 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
377
381
|
}) : null,
|
|
378
382
|
isEmpty: answered && !hasResult,
|
|
379
383
|
emptyClassName: styles.emptyResult
|
|
380
|
-
}, hasResult && answers !== null ? /*#__PURE__*/React.createElement(
|
|
384
|
+
}, hasResult && answers !== null ? /*#__PURE__*/React.createElement(Transitions, {
|
|
381
385
|
transitions: transitions,
|
|
382
386
|
playing: transitionPlaying,
|
|
383
387
|
delay: (1 + answers.length) * transitionStagger,
|
|
@@ -388,7 +392,7 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
388
392
|
style: {
|
|
389
393
|
height: callToActionHeight
|
|
390
394
|
}
|
|
391
|
-
}) : null)
|
|
395
|
+
}) : null) : null)))));
|
|
392
396
|
return /*#__PURE__*/React.createElement("div", {
|
|
393
397
|
className: classNames([styles.container, (_ref13 = {}, _defineProperty(_ref13, className, className !== null), _defineProperty(_ref13, styles.isPlaceholder, isPlaceholder), _defineProperty(_ref13, styles.answered, answered), _defineProperty(_ref13, styles.showResults, showResults), _defineProperty(_ref13, styles.answerTransitionComplete, answerTransitionComplete), _ref13)]),
|
|
394
398
|
"data-screen-ready": true
|
|
@@ -396,7 +400,8 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
396
400
|
background: background,
|
|
397
401
|
width: width,
|
|
398
402
|
height: height,
|
|
399
|
-
playing: backgroundPlaying
|
|
403
|
+
playing: backgroundPlaying,
|
|
404
|
+
shouldLoad: backgroundShouldLoad
|
|
400
405
|
}) : null, /*#__PURE__*/React.createElement(Container, {
|
|
401
406
|
width: width,
|
|
402
407
|
height: height
|
package/lib/index.js
CHANGED
|
@@ -62,6 +62,7 @@ var propTypes = {
|
|
|
62
62
|
background: core.PropTypes.backgroundElement,
|
|
63
63
|
callToAction: core.PropTypes.callToAction,
|
|
64
64
|
current: PropTypes__default["default"].bool,
|
|
65
|
+
active: PropTypes__default["default"].bool,
|
|
65
66
|
transitions: core.PropTypes.transitions,
|
|
66
67
|
transitionStagger: PropTypes__default["default"].number,
|
|
67
68
|
resultsTransitionDuration: PropTypes__default["default"].number,
|
|
@@ -82,6 +83,7 @@ var defaultProps = {
|
|
|
82
83
|
background: null,
|
|
83
84
|
callToAction: null,
|
|
84
85
|
current: true,
|
|
86
|
+
active: true,
|
|
85
87
|
transitions: null,
|
|
86
88
|
transitionStagger: 100,
|
|
87
89
|
resultsTransitionDuration: 500,
|
|
@@ -105,6 +107,7 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
105
107
|
background = _ref.background,
|
|
106
108
|
callToAction = _ref.callToAction,
|
|
107
109
|
current = _ref.current,
|
|
110
|
+
active = _ref.active,
|
|
108
111
|
transitions = _ref.transitions,
|
|
109
112
|
transitionStagger = _ref.transitionStagger,
|
|
110
113
|
resultsTransitionDuration = _ref.resultsTransitionDuration,
|
|
@@ -162,7 +165,8 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
162
165
|
var verticalAlign = isSplitted ? null : layout;
|
|
163
166
|
var transitionPlaying = current;
|
|
164
167
|
var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
|
|
165
|
-
var backgroundPlaying = current && (isView || isEdit);
|
|
168
|
+
var backgroundPlaying = current && (isView || isEdit);
|
|
169
|
+
var backgroundShouldLoad = current || active || !isView; // Call to Action
|
|
166
170
|
|
|
167
171
|
var hasCallToAction = callToAction !== null && callToAction.active === true;
|
|
168
172
|
|
|
@@ -398,7 +402,7 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
398
402
|
}) : null,
|
|
399
403
|
isEmpty: answered && !hasResult,
|
|
400
404
|
emptyClassName: styles.emptyResult
|
|
401
|
-
}, hasResult && answers !== null ? /*#__PURE__*/React__default["default"].createElement(
|
|
405
|
+
}, hasResult && answers !== null ? /*#__PURE__*/React__default["default"].createElement(components.Transitions, {
|
|
402
406
|
transitions: transitions,
|
|
403
407
|
playing: transitionPlaying,
|
|
404
408
|
delay: (1 + answers.length) * transitionStagger,
|
|
@@ -409,7 +413,7 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
409
413
|
style: {
|
|
410
414
|
height: callToActionHeight
|
|
411
415
|
}
|
|
412
|
-
}) : null)
|
|
416
|
+
}) : null) : null)))));
|
|
413
417
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
414
418
|
className: classNames__default["default"]([styles.container, (_ref13 = {}, _defineProperty__default["default"](_ref13, className, className !== null), _defineProperty__default["default"](_ref13, styles.isPlaceholder, isPlaceholder), _defineProperty__default["default"](_ref13, styles.answered, answered), _defineProperty__default["default"](_ref13, styles.showResults, showResults), _defineProperty__default["default"](_ref13, styles.answerTransitionComplete, answerTransitionComplete), _ref13)]),
|
|
415
419
|
"data-screen-ready": true
|
|
@@ -417,7 +421,8 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
417
421
|
background: background,
|
|
418
422
|
width: width,
|
|
419
423
|
height: height,
|
|
420
|
-
playing: backgroundPlaying
|
|
424
|
+
playing: backgroundPlaying,
|
|
425
|
+
shouldLoad: backgroundShouldLoad
|
|
421
426
|
}) : null, /*#__PURE__*/React__default["default"].createElement(Container__default["default"], {
|
|
422
427
|
width: width,
|
|
423
428
|
height: height
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-quiz",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.408",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
|
53
53
|
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
|
54
54
|
"@fortawesome/react-fontawesome": "^0.1.13",
|
|
55
|
-
"@micromag/core": "^0.2.
|
|
56
|
-
"@micromag/data": "^0.2.
|
|
57
|
-
"@micromag/element-background": "^0.2.
|
|
58
|
-
"@micromag/element-button": "^0.2.
|
|
59
|
-
"@micromag/element-call-to-action": "^0.2.
|
|
60
|
-
"@micromag/element-container": "^0.2.
|
|
61
|
-
"@micromag/element-heading": "^0.2.
|
|
62
|
-
"@micromag/element-layout": "^0.2.
|
|
63
|
-
"@micromag/element-text": "^0.2.
|
|
64
|
-
"@micromag/transforms": "^0.2.
|
|
55
|
+
"@micromag/core": "^0.2.405",
|
|
56
|
+
"@micromag/data": "^0.2.405",
|
|
57
|
+
"@micromag/element-background": "^0.2.407",
|
|
58
|
+
"@micromag/element-button": "^0.2.405",
|
|
59
|
+
"@micromag/element-call-to-action": "^0.2.405",
|
|
60
|
+
"@micromag/element-container": "^0.2.405",
|
|
61
|
+
"@micromag/element-heading": "^0.2.405",
|
|
62
|
+
"@micromag/element-layout": "^0.2.405",
|
|
63
|
+
"@micromag/element-text": "^0.2.405",
|
|
64
|
+
"@micromag/transforms": "^0.2.405",
|
|
65
65
|
"classnames": "^2.2.6",
|
|
66
66
|
"lodash": "^4.17.21",
|
|
67
67
|
"prop-types": "^15.7.2",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "4bc2ba99622adef74bd0da42cb52d1a575c1a544"
|
|
75
75
|
}
|