@micromag/screen-quiz 0.3.622 → 0.3.624
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 +44 -2
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -350,6 +350,7 @@ var propTypes$4 = {
|
|
|
350
350
|
buttonsTextStyle: PropTypes.textStyle,
|
|
351
351
|
inactiveButtonsTextStyle: PropTypes.textStyle,
|
|
352
352
|
questionsHeadingStyle: PropTypes.textStyle,
|
|
353
|
+
feedbackTextStyle: PropTypes.textStyle,
|
|
353
354
|
goodAnswerColor: PropTypes.color,
|
|
354
355
|
badAnswerColor: PropTypes.color,
|
|
355
356
|
focusable: PropTypes$1.bool,
|
|
@@ -382,6 +383,7 @@ var defaultProps$4 = {
|
|
|
382
383
|
buttonsTextStyle: null,
|
|
383
384
|
inactiveButtonsTextStyle: null,
|
|
384
385
|
questionsHeadingStyle: null,
|
|
386
|
+
feedbackTextStyle: null,
|
|
385
387
|
goodAnswerColor: null,
|
|
386
388
|
badAnswerColor: null,
|
|
387
389
|
focusable: false,
|
|
@@ -414,6 +416,7 @@ var Question = function Question(_ref) {
|
|
|
414
416
|
buttonsTextStyle = _ref.buttonsTextStyle,
|
|
415
417
|
inactiveButtonsTextStyle = _ref.inactiveButtonsTextStyle,
|
|
416
418
|
questionsHeadingStyle = _ref.questionsHeadingStyle,
|
|
419
|
+
feedbackTextStyle = _ref.feedbackTextStyle,
|
|
417
420
|
goodAnswerColor = _ref.goodAnswerColor,
|
|
418
421
|
badAnswerColor = _ref.badAnswerColor,
|
|
419
422
|
focusable = _ref.focusable,
|
|
@@ -455,6 +458,10 @@ var Question = function Question(_ref) {
|
|
|
455
458
|
var hasResultVisual = isImageFilled(answerImage) || isImageFilled(resultImage);
|
|
456
459
|
var defaultResult = isTextFilled(result) ? result : null;
|
|
457
460
|
var customResult = isTextFilled(customAnswerLabel) ? customAnswerLabel : null;
|
|
461
|
+
var finalResult = customResult || defaultResult;
|
|
462
|
+
var _ref4 = finalResult || {},
|
|
463
|
+
_ref4$textStyle = _ref4.textStyle,
|
|
464
|
+
resultTextStyle = _ref4$textStyle === undefined ? null : _ref4$textStyle;
|
|
458
465
|
var onAnswersCollapse = useCallback(function () {
|
|
459
466
|
setResultVisible(true);
|
|
460
467
|
}, [setResultVisible]);
|
|
@@ -537,8 +544,9 @@ var Question = function Question(_ref) {
|
|
|
537
544
|
playing: transitionPlaying,
|
|
538
545
|
delay: (1 + answers.length) * transitionStagger,
|
|
539
546
|
disabled: transitionDisabled
|
|
540
|
-
}, hasResult ? /*#__PURE__*/React.createElement(Text, Object.assign({},
|
|
541
|
-
className: styles$3.resultText
|
|
547
|
+
}, hasResult ? /*#__PURE__*/React.createElement(Text, Object.assign({}, finalResult || {}, {
|
|
548
|
+
className: styles$3.resultText,
|
|
549
|
+
textStyle: _objectSpread(_objectSpread({}, feedbackTextStyle || null), resultTextStyle || null)
|
|
542
550
|
})) : null, hasResultVisual ? /*#__PURE__*/React.createElement(Visual, {
|
|
543
551
|
media: answerImage || resultImage,
|
|
544
552
|
width: "100%",
|
|
@@ -564,6 +572,7 @@ var propTypes$3 = {
|
|
|
564
572
|
inactiveButtonsStyle: PropTypes.boxStyle,
|
|
565
573
|
buttonsTextStyle: PropTypes.textStyle,
|
|
566
574
|
inactiveButtonsTextStyle: PropTypes.textStyle,
|
|
575
|
+
feedbackTextStyle: PropTypes.textStyle,
|
|
567
576
|
goodAnswerColor: PropTypes.color,
|
|
568
577
|
badAnswerColor: PropTypes.color,
|
|
569
578
|
withoutTrueFalse: PropTypes$1.bool,
|
|
@@ -590,6 +599,7 @@ var defaultProps$3 = {
|
|
|
590
599
|
inactiveButtonsStyle: null,
|
|
591
600
|
buttonsTextStyle: null,
|
|
592
601
|
inactiveButtonsTextStyle: null,
|
|
602
|
+
feedbackTextStyle: null,
|
|
593
603
|
goodAnswerColor: null,
|
|
594
604
|
badAnswerColor: null,
|
|
595
605
|
withoutTrueFalse: false,
|
|
@@ -616,6 +626,7 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
616
626
|
inactiveButtonsStyle = _ref.inactiveButtonsStyle,
|
|
617
627
|
buttonsTextStyle = _ref.buttonsTextStyle,
|
|
618
628
|
inactiveButtonsTextStyle = _ref.inactiveButtonsTextStyle,
|
|
629
|
+
feedbackTextStyle = _ref.feedbackTextStyle,
|
|
619
630
|
goodAnswerColor = _ref.goodAnswerColor,
|
|
620
631
|
badAnswerColor = _ref.badAnswerColor,
|
|
621
632
|
withoutTrueFalse = _ref.withoutTrueFalse,
|
|
@@ -797,6 +808,7 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
797
808
|
buttonsTextStyle: buttonsTextStyle,
|
|
798
809
|
inactiveButtonsStyle: inactiveButtonsStyle,
|
|
799
810
|
inactiveButtonsTextStyle: inactiveButtonsTextStyle,
|
|
811
|
+
feedbackTextStyle: feedbackTextStyle,
|
|
800
812
|
goodAnswerColor: goodAnswerColor,
|
|
801
813
|
badAnswerColor: badAnswerColor,
|
|
802
814
|
withoutTrueFalse: withoutTrueFalse,
|
|
@@ -1674,6 +1686,16 @@ var definition = [{
|
|
|
1674
1686
|
"value": "Inactive buttons"
|
|
1675
1687
|
}]
|
|
1676
1688
|
})
|
|
1689
|
+
}, {
|
|
1690
|
+
name: 'feedbackTextStyle',
|
|
1691
|
+
type: 'text-style-form',
|
|
1692
|
+
label: defineMessage({
|
|
1693
|
+
id: "4w7K2K",
|
|
1694
|
+
defaultMessage: [{
|
|
1695
|
+
"type": 0,
|
|
1696
|
+
"value": "Feedback text"
|
|
1697
|
+
}]
|
|
1698
|
+
})
|
|
1677
1699
|
}, {
|
|
1678
1700
|
name: 'goodAnswerColor',
|
|
1679
1701
|
type: 'color',
|
|
@@ -2004,6 +2026,26 @@ var definition = [{
|
|
|
2004
2026
|
"value": "Buttons text"
|
|
2005
2027
|
}]
|
|
2006
2028
|
})
|
|
2029
|
+
}, {
|
|
2030
|
+
name: 'inactiveButtonsTextStyle',
|
|
2031
|
+
type: 'text-style-form',
|
|
2032
|
+
label: defineMessage({
|
|
2033
|
+
id: "my7Kox",
|
|
2034
|
+
defaultMessage: [{
|
|
2035
|
+
"type": 0,
|
|
2036
|
+
"value": "Inactive buttons text"
|
|
2037
|
+
}]
|
|
2038
|
+
})
|
|
2039
|
+
}, {
|
|
2040
|
+
name: 'inactiveButtonsStyle',
|
|
2041
|
+
type: 'box-style-form',
|
|
2042
|
+
label: defineMessage({
|
|
2043
|
+
id: "xlFOg3",
|
|
2044
|
+
defaultMessage: [{
|
|
2045
|
+
"type": 0,
|
|
2046
|
+
"value": "Inactive buttons"
|
|
2047
|
+
}]
|
|
2048
|
+
})
|
|
2007
2049
|
}, {
|
|
2008
2050
|
name: 'questionsHeadingStyle',
|
|
2009
2051
|
type: 'text-style-form',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-quiz",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.624",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"access": "public",
|
|
90
90
|
"registry": "https://registry.npmjs.org/"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "dae93d8ee83abe0aa8f51a31a94e32f7b5ad9104"
|
|
93
93
|
}
|