@micromag/screen-quiz 0.3.829 → 0.4.4
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/assets/css/styles.css +5 -5
- package/es/index.d.ts +503 -0
- package/es/index.js +516 -604
- package/es/styles.css +5 -0
- package/package.json +27 -27
package/es/index.js
CHANGED
|
@@ -4,9 +4,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
4
4
|
import { faRedo } from '@fortawesome/free-solid-svg-icons/faRedo';
|
|
5
5
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
7
|
import React, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
|
|
9
|
-
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
10
8
|
import { ScreenElement, Transitions, Button } from '@micromag/core/components';
|
|
11
9
|
import { useScreenRenderContext, useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useScreenState } from '@micromag/core/contexts';
|
|
12
10
|
import { useTrackScreenEvent, useDimensionObserver } from '@micromag/core/hooks';
|
|
@@ -25,86 +23,58 @@ import Visual from '@micromag/element-visual';
|
|
|
25
23
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
26
24
|
import { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';
|
|
27
25
|
import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
|
|
28
|
-
import { animated } from '@react-spring/web';
|
|
26
|
+
import { animated, useTransition, easings } from '@react-spring/web';
|
|
29
27
|
import Button$1, { RichButton } from '@micromag/element-button';
|
|
30
28
|
import Keypad from '@micromag/element-keypad';
|
|
31
|
-
import { TransitionGroup, CSSTransition } from 'react-transition-group';
|
|
32
29
|
|
|
33
|
-
var styles$4 = {"
|
|
30
|
+
var styles$4 = {"container":"container","items":"items","emptyAnswer":"emptyAnswer","item":"item","isPlaceholder":"isPlaceholder","userAnswer":"userAnswer","otherAnswer":"otherAnswer","withoutOpacity":"withoutOpacity","button":"button","withIcon":"withIcon","withSquareItems":"withSquareItems","resultIcon":"resultIcon","answered":"answered","rightAnswer":"rightAnswer","faIcon":"faIcon","itemContent":"itemContent"};
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
items: PropTypes$1.quizAnswers.isRequired,
|
|
37
|
-
keypadLayout: PropTypes.shape({}),
|
|
38
|
-
answeredIndex: PropTypes.number,
|
|
39
|
-
answersCollapseDelay: PropTypes.number,
|
|
40
|
-
buttonsStyle: PropTypes$1.boxStyle,
|
|
41
|
-
buttonsLayout: PropTypes$1.buttonLayout,
|
|
42
|
-
inactiveButtonsStyle: PropTypes$1.boxStyle,
|
|
43
|
-
buttonsTextStyle: PropTypes$1.textStyle,
|
|
44
|
-
inactiveButtonsTextStyle: PropTypes$1.textStyle,
|
|
45
|
-
goodAnswerColor: PropTypes$1.color,
|
|
46
|
-
badAnswerColor: PropTypes$1.color,
|
|
47
|
-
showUserAnswer: PropTypes.bool,
|
|
48
|
-
withoutGoodAnswer: PropTypes.bool,
|
|
49
|
-
withoutIcon: PropTypes.bool,
|
|
50
|
-
focusable: PropTypes.bool,
|
|
51
|
-
animated: PropTypes.bool,
|
|
52
|
-
collapsed: PropTypes.bool,
|
|
53
|
-
onClick: PropTypes.func,
|
|
54
|
-
onCollapse: PropTypes.func,
|
|
55
|
-
onCollapsed: PropTypes.func,
|
|
56
|
-
onTransitionEnd: PropTypes.func,
|
|
57
|
-
withoutCollapse: PropTypes.bool,
|
|
58
|
-
className: PropTypes.string
|
|
59
|
-
};
|
|
60
|
-
var defaultProps$5 = {
|
|
61
|
-
keypadLayout: null,
|
|
62
|
-
answeredIndex: null,
|
|
63
|
-
answersCollapseDelay: 1000,
|
|
64
|
-
buttonsStyle: null,
|
|
65
|
-
buttonsLayout: null,
|
|
66
|
-
inactiveButtonsStyle: null,
|
|
67
|
-
buttonsTextStyle: null,
|
|
68
|
-
inactiveButtonsTextStyle: null,
|
|
69
|
-
goodAnswerColor: null,
|
|
70
|
-
badAnswerColor: null,
|
|
71
|
-
showUserAnswer: false,
|
|
72
|
-
withoutGoodAnswer: false,
|
|
73
|
-
withoutIcon: false,
|
|
74
|
-
focusable: false,
|
|
75
|
-
animated: false,
|
|
76
|
-
collapsed: false,
|
|
77
|
-
onClick: null,
|
|
78
|
-
onCollapse: null,
|
|
79
|
-
onCollapsed: null,
|
|
80
|
-
onTransitionEnd: null,
|
|
81
|
-
withoutCollapse: false,
|
|
82
|
-
className: null
|
|
83
|
-
};
|
|
84
|
-
var Answers = function Answers(_ref) {
|
|
32
|
+
function Answers(_ref) {
|
|
85
33
|
var items = _ref.items,
|
|
86
|
-
keypadLayout = _ref.keypadLayout,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
34
|
+
_ref$keypadLayout = _ref.keypadLayout,
|
|
35
|
+
keypadLayout = _ref$keypadLayout === void 0 ? null : _ref$keypadLayout,
|
|
36
|
+
_ref$answeredIndex = _ref.answeredIndex,
|
|
37
|
+
answeredIndex = _ref$answeredIndex === void 0 ? null : _ref$answeredIndex,
|
|
38
|
+
_ref$answersCollapseD = _ref.answersCollapseDelay,
|
|
39
|
+
answersCollapseDelay = _ref$answersCollapseD === void 0 ? 1000 : _ref$answersCollapseD,
|
|
40
|
+
_ref$buttonsStyle = _ref.buttonsStyle,
|
|
41
|
+
buttonsStyle = _ref$buttonsStyle === void 0 ? null : _ref$buttonsStyle,
|
|
42
|
+
_ref$buttonsLayout = _ref.buttonsLayout,
|
|
43
|
+
buttonsLayout = _ref$buttonsLayout === void 0 ? null : _ref$buttonsLayout,
|
|
44
|
+
_ref$inactiveButtonsS = _ref.inactiveButtonsStyle,
|
|
45
|
+
inactiveButtonsStyle = _ref$inactiveButtonsS === void 0 ? null : _ref$inactiveButtonsS,
|
|
46
|
+
_ref$buttonsTextStyle = _ref.buttonsTextStyle,
|
|
47
|
+
buttonsTextStyle = _ref$buttonsTextStyle === void 0 ? null : _ref$buttonsTextStyle,
|
|
48
|
+
_ref$inactiveButtonsT = _ref.inactiveButtonsTextStyle,
|
|
49
|
+
inactiveButtonsTextStyle = _ref$inactiveButtonsT === void 0 ? null : _ref$inactiveButtonsT,
|
|
50
|
+
_ref$goodAnswerColor = _ref.goodAnswerColor,
|
|
51
|
+
goodAnswerColor = _ref$goodAnswerColor === void 0 ? null : _ref$goodAnswerColor,
|
|
52
|
+
_ref$badAnswerColor = _ref.badAnswerColor,
|
|
53
|
+
badAnswerColor = _ref$badAnswerColor === void 0 ? null : _ref$badAnswerColor,
|
|
54
|
+
_ref$showUserAnswer = _ref.showUserAnswer,
|
|
55
|
+
showUserAnswer = _ref$showUserAnswer === void 0 ? false : _ref$showUserAnswer,
|
|
56
|
+
_ref$withoutGoodAnswe = _ref.withoutGoodAnswer,
|
|
57
|
+
withoutGoodAnswer = _ref$withoutGoodAnswe === void 0 ? false : _ref$withoutGoodAnswe,
|
|
58
|
+
_ref$withoutIcon = _ref.withoutIcon,
|
|
59
|
+
withoutIcon = _ref$withoutIcon === void 0 ? false : _ref$withoutIcon,
|
|
60
|
+
_ref$focusable = _ref.focusable,
|
|
61
|
+
focusable = _ref$focusable === void 0 ? false : _ref$focusable,
|
|
62
|
+
_ref$animated = _ref.animated,
|
|
63
|
+
collapseAnimated = _ref$animated === void 0 ? false : _ref$animated,
|
|
64
|
+
_ref$collapsed = _ref.collapsed,
|
|
65
|
+
initialCollapsed = _ref$collapsed === void 0 ? false : _ref$collapsed,
|
|
66
|
+
_ref$onClick = _ref.onClick,
|
|
67
|
+
onClick = _ref$onClick === void 0 ? null : _ref$onClick,
|
|
68
|
+
_ref$onCollapse = _ref.onCollapse,
|
|
69
|
+
onCollapse = _ref$onCollapse === void 0 ? null : _ref$onCollapse,
|
|
70
|
+
_ref$onCollapsed = _ref.onCollapsed,
|
|
71
|
+
onCollapsed = _ref$onCollapsed === void 0 ? null : _ref$onCollapsed,
|
|
72
|
+
_ref$onTransitionEnd = _ref.onTransitionEnd,
|
|
73
|
+
onTransitionEnd = _ref$onTransitionEnd === void 0 ? null : _ref$onTransitionEnd,
|
|
74
|
+
_ref$withoutCollapse = _ref.withoutCollapse,
|
|
75
|
+
withoutCollapse = _ref$withoutCollapse === void 0 ? false : _ref$withoutCollapse,
|
|
76
|
+
_ref$className = _ref.className,
|
|
77
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
108
78
|
var _useScreenRenderConte = useScreenRenderContext(),
|
|
109
79
|
isView = _useScreenRenderConte.isView,
|
|
110
80
|
isPreview = _useScreenRenderConte.isPreview,
|
|
@@ -437,125 +407,81 @@ var Answers = function Answers(_ref) {
|
|
|
437
407
|
columns: columns,
|
|
438
408
|
spacing: spacing
|
|
439
409
|
}) : null);
|
|
440
|
-
}
|
|
441
|
-
Answers.propTypes = propTypes$5;
|
|
442
|
-
Answers.defaultProps = defaultProps$5;
|
|
410
|
+
}
|
|
443
411
|
|
|
444
|
-
var styles$3 = {"container":"
|
|
412
|
+
var styles$3 = {"container":"container","question":"question","index":"index","resultContent":"resultContent","result":"result","emptyQuestion":"emptyQuestion","emptyResult":"emptyResult","resultVisible":"resultVisible","resultHidden":"resultHidden","isPlaceholder":"isPlaceholder"};
|
|
445
413
|
|
|
446
|
-
|
|
447
|
-
question
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
onAnswerClick: null,
|
|
518
|
-
onAnswerTransitionEnd: null,
|
|
519
|
-
withoutCollapse: false,
|
|
520
|
-
className: null,
|
|
521
|
-
style: null
|
|
522
|
-
};
|
|
523
|
-
var Question = function Question(_ref) {
|
|
524
|
-
var question = _ref.question,
|
|
525
|
-
answers = _ref.answers,
|
|
526
|
-
keypadLayout = _ref.keypadLayout,
|
|
527
|
-
result = _ref.result,
|
|
528
|
-
resultImage = _ref.resultImage,
|
|
529
|
-
index = _ref.index,
|
|
530
|
-
totalCount = _ref.totalCount,
|
|
531
|
-
answeredIndex = _ref.answeredIndex,
|
|
532
|
-
buttonsLayout = _ref.buttonsLayout,
|
|
533
|
-
buttonsStyle = _ref.buttonsStyle,
|
|
534
|
-
inactiveButtonsStyle = _ref.inactiveButtonsStyle,
|
|
535
|
-
buttonsTextStyle = _ref.buttonsTextStyle,
|
|
536
|
-
inactiveButtonsTextStyle = _ref.inactiveButtonsTextStyle,
|
|
537
|
-
questionsHeadingStyle = _ref.questionsHeadingStyle,
|
|
538
|
-
feedbackTextStyle = _ref.feedbackTextStyle,
|
|
539
|
-
numbersTextStyle = _ref.numbersTextStyle,
|
|
540
|
-
goodAnswerColor = _ref.goodAnswerColor,
|
|
541
|
-
badAnswerColor = _ref.badAnswerColor,
|
|
542
|
-
focusable = _ref.focusable,
|
|
543
|
-
animated = _ref.animated,
|
|
544
|
-
showInstantAnswer = _ref.showInstantAnswer,
|
|
545
|
-
withResult = _ref.withResult,
|
|
546
|
-
withoutGoodAnswer = _ref.withoutGoodAnswer,
|
|
547
|
-
withoutTrueFalse = _ref.withoutTrueFalse,
|
|
548
|
-
withoutIndex = _ref.withoutIndex,
|
|
549
|
-
layout = _ref.layout,
|
|
550
|
-
transitions = _ref.transitions,
|
|
551
|
-
transitionPlaying = _ref.transitionPlaying,
|
|
552
|
-
transitionStagger = _ref.transitionStagger,
|
|
553
|
-
transitionDisabled = _ref.transitionDisabled,
|
|
554
|
-
onAnswerClick = _ref.onAnswerClick,
|
|
555
|
-
onAnswerTransitionEnd = _ref.onAnswerTransitionEnd,
|
|
556
|
-
withoutCollapse = _ref.withoutCollapse,
|
|
557
|
-
className = _ref.className,
|
|
558
|
-
style = _ref.style;
|
|
414
|
+
function Question(_ref) {
|
|
415
|
+
var _ref$question = _ref.question,
|
|
416
|
+
question = _ref$question === void 0 ? null : _ref$question,
|
|
417
|
+
_ref$answers = _ref.answers,
|
|
418
|
+
answers = _ref$answers === void 0 ? null : _ref$answers,
|
|
419
|
+
_ref$keypadLayout = _ref.keypadLayout,
|
|
420
|
+
keypadLayout = _ref$keypadLayout === void 0 ? null : _ref$keypadLayout,
|
|
421
|
+
_ref$result = _ref.result,
|
|
422
|
+
result = _ref$result === void 0 ? null : _ref$result,
|
|
423
|
+
_ref$resultImage = _ref.resultImage,
|
|
424
|
+
resultImage = _ref$resultImage === void 0 ? null : _ref$resultImage,
|
|
425
|
+
_ref$index = _ref.index,
|
|
426
|
+
index = _ref$index === void 0 ? null : _ref$index,
|
|
427
|
+
_ref$totalCount = _ref.totalCount,
|
|
428
|
+
totalCount = _ref$totalCount === void 0 ? null : _ref$totalCount,
|
|
429
|
+
_ref$answeredIndex = _ref.answeredIndex,
|
|
430
|
+
answeredIndex = _ref$answeredIndex === void 0 ? null : _ref$answeredIndex,
|
|
431
|
+
_ref$buttonsLayout = _ref.buttonsLayout,
|
|
432
|
+
buttonsLayout = _ref$buttonsLayout === void 0 ? null : _ref$buttonsLayout,
|
|
433
|
+
_ref$buttonsStyle = _ref.buttonsStyle,
|
|
434
|
+
buttonsStyle = _ref$buttonsStyle === void 0 ? null : _ref$buttonsStyle,
|
|
435
|
+
_ref$inactiveButtonsS = _ref.inactiveButtonsStyle,
|
|
436
|
+
inactiveButtonsStyle = _ref$inactiveButtonsS === void 0 ? null : _ref$inactiveButtonsS,
|
|
437
|
+
_ref$buttonsTextStyle = _ref.buttonsTextStyle,
|
|
438
|
+
buttonsTextStyle = _ref$buttonsTextStyle === void 0 ? null : _ref$buttonsTextStyle,
|
|
439
|
+
_ref$inactiveButtonsT = _ref.inactiveButtonsTextStyle,
|
|
440
|
+
inactiveButtonsTextStyle = _ref$inactiveButtonsT === void 0 ? null : _ref$inactiveButtonsT,
|
|
441
|
+
_ref$questionsHeading = _ref.questionsHeadingStyle,
|
|
442
|
+
questionsHeadingStyle = _ref$questionsHeading === void 0 ? null : _ref$questionsHeading,
|
|
443
|
+
_ref$feedbackTextStyl = _ref.feedbackTextStyle,
|
|
444
|
+
feedbackTextStyle = _ref$feedbackTextStyl === void 0 ? null : _ref$feedbackTextStyl,
|
|
445
|
+
_ref$numbersTextStyle = _ref.numbersTextStyle,
|
|
446
|
+
numbersTextStyle = _ref$numbersTextStyle === void 0 ? null : _ref$numbersTextStyle,
|
|
447
|
+
_ref$goodAnswerColor = _ref.goodAnswerColor,
|
|
448
|
+
goodAnswerColor = _ref$goodAnswerColor === void 0 ? null : _ref$goodAnswerColor,
|
|
449
|
+
_ref$badAnswerColor = _ref.badAnswerColor,
|
|
450
|
+
badAnswerColor = _ref$badAnswerColor === void 0 ? null : _ref$badAnswerColor,
|
|
451
|
+
_ref$focusable = _ref.focusable,
|
|
452
|
+
focusable = _ref$focusable === void 0 ? false : _ref$focusable,
|
|
453
|
+
_ref$animated = _ref.animated,
|
|
454
|
+
animated = _ref$animated === void 0 ? false : _ref$animated,
|
|
455
|
+
_ref$showInstantAnswe = _ref.showInstantAnswer,
|
|
456
|
+
showInstantAnswer = _ref$showInstantAnswe === void 0 ? false : _ref$showInstantAnswe,
|
|
457
|
+
_ref$withResult = _ref.withResult,
|
|
458
|
+
withResult = _ref$withResult === void 0 ? false : _ref$withResult,
|
|
459
|
+
_ref$withoutGoodAnswe = _ref.withoutGoodAnswer,
|
|
460
|
+
withoutGoodAnswer = _ref$withoutGoodAnswe === void 0 ? false : _ref$withoutGoodAnswe,
|
|
461
|
+
_ref$withoutTrueFalse = _ref.withoutTrueFalse,
|
|
462
|
+
withoutTrueFalse = _ref$withoutTrueFalse === void 0 ? false : _ref$withoutTrueFalse,
|
|
463
|
+
_ref$withoutIndex = _ref.withoutIndex,
|
|
464
|
+
withoutIndex = _ref$withoutIndex === void 0 ? false : _ref$withoutIndex,
|
|
465
|
+
_ref$layout = _ref.layout,
|
|
466
|
+
layout = _ref$layout === void 0 ? null : _ref$layout,
|
|
467
|
+
_ref$transitions = _ref.transitions,
|
|
468
|
+
transitions = _ref$transitions === void 0 ? null : _ref$transitions,
|
|
469
|
+
_ref$transitionPlayin = _ref.transitionPlaying,
|
|
470
|
+
transitionPlaying = _ref$transitionPlayin === void 0 ? false : _ref$transitionPlayin,
|
|
471
|
+
_ref$transitionStagge = _ref.transitionStagger,
|
|
472
|
+
transitionStagger = _ref$transitionStagge === void 0 ? 100 : _ref$transitionStagge,
|
|
473
|
+
_ref$transitionDisabl = _ref.transitionDisabled,
|
|
474
|
+
transitionDisabled = _ref$transitionDisabl === void 0 ? false : _ref$transitionDisabl,
|
|
475
|
+
_ref$onAnswerClick = _ref.onAnswerClick,
|
|
476
|
+
onAnswerClick = _ref$onAnswerClick === void 0 ? null : _ref$onAnswerClick,
|
|
477
|
+
_ref$onAnswerTransiti = _ref.onAnswerTransitionEnd,
|
|
478
|
+
onAnswerTransitionEnd = _ref$onAnswerTransiti === void 0 ? null : _ref$onAnswerTransiti,
|
|
479
|
+
_ref$withoutCollapse = _ref.withoutCollapse,
|
|
480
|
+
withoutCollapse = _ref$withoutCollapse === void 0 ? false : _ref$withoutCollapse,
|
|
481
|
+
_ref$className = _ref.className,
|
|
482
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
483
|
+
_ref$style = _ref.style,
|
|
484
|
+
style = _ref$style === void 0 ? null : _ref$style;
|
|
559
485
|
var _useScreenRenderConte = useScreenRenderContext(),
|
|
560
486
|
isPlaceholder = _useScreenRenderConte.isPlaceholder;
|
|
561
487
|
var isSplitted = layout === 'split';
|
|
@@ -678,104 +604,67 @@ var Question = function Question(_ref) {
|
|
|
678
604
|
width: "100%",
|
|
679
605
|
height: "auto"
|
|
680
606
|
}) : null) : null))) : null]);
|
|
681
|
-
}
|
|
682
|
-
Question.propTypes = propTypes$4;
|
|
683
|
-
Question.defaultProps = defaultProps$4;
|
|
607
|
+
}
|
|
684
608
|
|
|
685
|
-
var styles$2 = {"container":"
|
|
609
|
+
var styles$2 = {"container":"container","background":"background","content":"content","disabled":"disabled","reset":"reset","points":"points","header":"header","footer":"footer","nextButton":"nextButton","question":"question","results":"results","intro":"intro"};
|
|
686
610
|
|
|
687
|
-
|
|
688
|
-
id
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
ready: true,
|
|
745
|
-
transitions: null,
|
|
746
|
-
transitionStagger: 100,
|
|
747
|
-
type: null,
|
|
748
|
-
className: null
|
|
749
|
-
};
|
|
750
|
-
var QuizScreen = function QuizScreen(_ref) {
|
|
751
|
-
var id = _ref.id,
|
|
752
|
-
layout = _ref.layout,
|
|
753
|
-
keypadLayout = _ref.keypadLayout,
|
|
754
|
-
question = _ref.question,
|
|
755
|
-
answers = _ref.answers,
|
|
756
|
-
result = _ref.result,
|
|
757
|
-
resultImage = _ref.resultImage,
|
|
758
|
-
buttonsLayout = _ref.buttonsLayout,
|
|
759
|
-
buttonsStyle = _ref.buttonsStyle,
|
|
760
|
-
inactiveButtonsStyle = _ref.inactiveButtonsStyle,
|
|
761
|
-
buttonsTextStyle = _ref.buttonsTextStyle,
|
|
762
|
-
inactiveButtonsTextStyle = _ref.inactiveButtonsTextStyle,
|
|
763
|
-
feedbackTextStyle = _ref.feedbackTextStyle,
|
|
764
|
-
numbersTextStyle = _ref.numbersTextStyle,
|
|
765
|
-
goodAnswerColor = _ref.goodAnswerColor,
|
|
766
|
-
badAnswerColor = _ref.badAnswerColor,
|
|
767
|
-
withoutTrueFalse = _ref.withoutTrueFalse,
|
|
768
|
-
spacing = _ref.spacing,
|
|
769
|
-
header = _ref.header,
|
|
770
|
-
footer = _ref.footer,
|
|
771
|
-
background = _ref.background,
|
|
772
|
-
current = _ref.current,
|
|
773
|
-
preload = _ref.preload,
|
|
774
|
-
ready = _ref.ready,
|
|
775
|
-
transitions = _ref.transitions,
|
|
776
|
-
transitionStagger = _ref.transitionStagger,
|
|
777
|
-
type = _ref.type,
|
|
778
|
-
className = _ref.className;
|
|
611
|
+
function QuizScreen(_ref) {
|
|
612
|
+
var _ref$id = _ref.id,
|
|
613
|
+
id = _ref$id === void 0 ? null : _ref$id,
|
|
614
|
+
_ref$layout = _ref.layout,
|
|
615
|
+
layout = _ref$layout === void 0 ? 'middle' : _ref$layout,
|
|
616
|
+
_ref$keypadLayout = _ref.keypadLayout,
|
|
617
|
+
keypadLayout = _ref$keypadLayout === void 0 ? null : _ref$keypadLayout,
|
|
618
|
+
_ref$question = _ref.question,
|
|
619
|
+
question = _ref$question === void 0 ? null : _ref$question,
|
|
620
|
+
_ref$answers = _ref.answers,
|
|
621
|
+
answers = _ref$answers === void 0 ? null : _ref$answers,
|
|
622
|
+
_ref$result = _ref.result,
|
|
623
|
+
result = _ref$result === void 0 ? null : _ref$result,
|
|
624
|
+
_ref$resultImage = _ref.resultImage,
|
|
625
|
+
resultImage = _ref$resultImage === void 0 ? null : _ref$resultImage,
|
|
626
|
+
_ref$buttonsLayout = _ref.buttonsLayout,
|
|
627
|
+
buttonsLayout = _ref$buttonsLayout === void 0 ? null : _ref$buttonsLayout,
|
|
628
|
+
_ref$buttonsStyle = _ref.buttonsStyle,
|
|
629
|
+
buttonsStyle = _ref$buttonsStyle === void 0 ? null : _ref$buttonsStyle,
|
|
630
|
+
_ref$inactiveButtonsS = _ref.inactiveButtonsStyle,
|
|
631
|
+
inactiveButtonsStyle = _ref$inactiveButtonsS === void 0 ? null : _ref$inactiveButtonsS,
|
|
632
|
+
_ref$buttonsTextStyle = _ref.buttonsTextStyle,
|
|
633
|
+
buttonsTextStyle = _ref$buttonsTextStyle === void 0 ? null : _ref$buttonsTextStyle,
|
|
634
|
+
_ref$inactiveButtonsT = _ref.inactiveButtonsTextStyle,
|
|
635
|
+
inactiveButtonsTextStyle = _ref$inactiveButtonsT === void 0 ? null : _ref$inactiveButtonsT,
|
|
636
|
+
_ref$feedbackTextStyl = _ref.feedbackTextStyle,
|
|
637
|
+
feedbackTextStyle = _ref$feedbackTextStyl === void 0 ? null : _ref$feedbackTextStyl,
|
|
638
|
+
_ref$numbersTextStyle = _ref.numbersTextStyle,
|
|
639
|
+
numbersTextStyle = _ref$numbersTextStyle === void 0 ? null : _ref$numbersTextStyle,
|
|
640
|
+
_ref$goodAnswerColor = _ref.goodAnswerColor,
|
|
641
|
+
goodAnswerColor = _ref$goodAnswerColor === void 0 ? null : _ref$goodAnswerColor,
|
|
642
|
+
_ref$badAnswerColor = _ref.badAnswerColor,
|
|
643
|
+
badAnswerColor = _ref$badAnswerColor === void 0 ? null : _ref$badAnswerColor,
|
|
644
|
+
_ref$withoutTrueFalse = _ref.withoutTrueFalse,
|
|
645
|
+
withoutTrueFalse = _ref$withoutTrueFalse === void 0 ? false : _ref$withoutTrueFalse,
|
|
646
|
+
_ref$spacing = _ref.spacing,
|
|
647
|
+
spacing = _ref$spacing === void 0 ? 20 : _ref$spacing,
|
|
648
|
+
_ref$header = _ref.header,
|
|
649
|
+
header = _ref$header === void 0 ? null : _ref$header,
|
|
650
|
+
_ref$footer = _ref.footer,
|
|
651
|
+
footer = _ref$footer === void 0 ? null : _ref$footer,
|
|
652
|
+
_ref$background = _ref.background,
|
|
653
|
+
background = _ref$background === void 0 ? null : _ref$background,
|
|
654
|
+
_ref$current = _ref.current,
|
|
655
|
+
current = _ref$current === void 0 ? true : _ref$current,
|
|
656
|
+
_ref$preload = _ref.preload,
|
|
657
|
+
preload = _ref$preload === void 0 ? true : _ref$preload,
|
|
658
|
+
_ref$ready = _ref.ready,
|
|
659
|
+
ready = _ref$ready === void 0 ? true : _ref$ready,
|
|
660
|
+
_ref$transitions = _ref.transitions,
|
|
661
|
+
transitions = _ref$transitions === void 0 ? null : _ref$transitions,
|
|
662
|
+
_ref$transitionStagge = _ref.transitionStagger,
|
|
663
|
+
transitionStagger = _ref$transitionStagge === void 0 ? 100 : _ref$transitionStagge,
|
|
664
|
+
_ref$type = _ref.type,
|
|
665
|
+
type = _ref$type === void 0 ? null : _ref$type,
|
|
666
|
+
_ref$className = _ref.className,
|
|
667
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
779
668
|
var screenId = id || 'screen-id';
|
|
780
669
|
var trackScreenEvent = useTrackScreenEvent(type);
|
|
781
670
|
var _useScreenSize = useScreenSize(),
|
|
@@ -1004,50 +893,33 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
1004
893
|
withoutVideo: isPreview,
|
|
1005
894
|
className: styles$2.background
|
|
1006
895
|
}) : null);
|
|
1007
|
-
}
|
|
1008
|
-
QuizScreen.propTypes = propTypes$3;
|
|
1009
|
-
QuizScreen.defaultProps = defaultProps$3;
|
|
896
|
+
}
|
|
1010
897
|
|
|
1011
|
-
var styles$1 = {"container":"
|
|
898
|
+
var styles$1 = {"container":"container","title":"title","emptyTitle":"emptyTitle","emptyDescription":"emptyDescription"};
|
|
1012
899
|
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
className: null,
|
|
1037
|
-
style: null
|
|
1038
|
-
};
|
|
1039
|
-
var Results = function Results(_ref) {
|
|
1040
|
-
var layout = _ref.layout,
|
|
1041
|
-
title = _ref.title,
|
|
1042
|
-
description = _ref.description,
|
|
1043
|
-
resultsHeadingStyle = _ref.resultsHeadingStyle,
|
|
1044
|
-
resultsTextStyle = _ref.resultsTextStyle,
|
|
1045
|
-
transitions = _ref.transitions,
|
|
1046
|
-
transitionPlaying = _ref.transitionPlaying,
|
|
1047
|
-
transitionStagger = _ref.transitionStagger,
|
|
1048
|
-
transitionDisabled = _ref.transitionDisabled,
|
|
1049
|
-
className = _ref.className,
|
|
1050
|
-
style = _ref.style;
|
|
900
|
+
function Results(_ref) {
|
|
901
|
+
var _ref$layout = _ref.layout,
|
|
902
|
+
layout = _ref$layout === void 0 ? null : _ref$layout,
|
|
903
|
+
_ref$title = _ref.title,
|
|
904
|
+
title = _ref$title === void 0 ? null : _ref$title,
|
|
905
|
+
_ref$description = _ref.description,
|
|
906
|
+
description = _ref$description === void 0 ? null : _ref$description,
|
|
907
|
+
_ref$resultsHeadingSt = _ref.resultsHeadingStyle,
|
|
908
|
+
resultsHeadingStyle = _ref$resultsHeadingSt === void 0 ? null : _ref$resultsHeadingSt,
|
|
909
|
+
_ref$resultsTextStyle = _ref.resultsTextStyle,
|
|
910
|
+
resultsTextStyle = _ref$resultsTextStyle === void 0 ? null : _ref$resultsTextStyle,
|
|
911
|
+
_ref$transitions = _ref.transitions,
|
|
912
|
+
transitions = _ref$transitions === void 0 ? null : _ref$transitions,
|
|
913
|
+
_ref$transitionPlayin = _ref.transitionPlaying,
|
|
914
|
+
transitionPlaying = _ref$transitionPlayin === void 0 ? false : _ref$transitionPlayin,
|
|
915
|
+
_ref$transitionStagge = _ref.transitionStagger,
|
|
916
|
+
transitionStagger = _ref$transitionStagge === void 0 ? 100 : _ref$transitionStagge,
|
|
917
|
+
_ref$transitionDisabl = _ref.transitionDisabled,
|
|
918
|
+
transitionDisabled = _ref$transitionDisabl === void 0 ? false : _ref$transitionDisabl,
|
|
919
|
+
_ref$className = _ref.className,
|
|
920
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
921
|
+
_ref$style = _ref.style,
|
|
922
|
+
style = _ref$style === void 0 ? null : _ref$style;
|
|
1051
923
|
var isSplitted = layout === 'split';
|
|
1052
924
|
var verticalAlign = isSplitted ? null : layout;
|
|
1053
925
|
var hasTitle = isTextFilled(title);
|
|
@@ -1105,44 +977,29 @@ var Results = function Results(_ref) {
|
|
|
1105
977
|
className: styles$1.description,
|
|
1106
978
|
textStyle: _objectSpread(_objectSpread({}, resultsTextStyle), descriptionTextStyle)
|
|
1107
979
|
}))) : null)]);
|
|
1108
|
-
}
|
|
1109
|
-
Results.propTypes = propTypes$2;
|
|
1110
|
-
Results.defaultProps = defaultProps$2;
|
|
980
|
+
}
|
|
1111
981
|
|
|
1112
|
-
var styles = {"container":"
|
|
982
|
+
var styles = {"container":"container","title":"title","description":"description","emptyTitle":"emptyTitle","emptyDescription":"emptyDescription"};
|
|
1113
983
|
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
style: null,
|
|
1134
|
-
onClickButton: null
|
|
1135
|
-
};
|
|
1136
|
-
var Title = function Title(_ref) {
|
|
1137
|
-
var layout = _ref.layout,
|
|
1138
|
-
title = _ref.title,
|
|
1139
|
-
description = _ref.description,
|
|
1140
|
-
button = _ref.button,
|
|
1141
|
-
buttonDisabled = _ref.buttonDisabled,
|
|
1142
|
-
focusable = _ref.focusable,
|
|
1143
|
-
className = _ref.className,
|
|
1144
|
-
style = _ref.style,
|
|
1145
|
-
onClickButton = _ref.onClickButton;
|
|
984
|
+
function Title(_ref) {
|
|
985
|
+
var _ref$layout = _ref.layout,
|
|
986
|
+
layout = _ref$layout === void 0 ? null : _ref$layout,
|
|
987
|
+
_ref$title = _ref.title,
|
|
988
|
+
title = _ref$title === void 0 ? null : _ref$title,
|
|
989
|
+
_ref$description = _ref.description,
|
|
990
|
+
description = _ref$description === void 0 ? null : _ref$description,
|
|
991
|
+
_ref$button = _ref.button,
|
|
992
|
+
button = _ref$button === void 0 ? null : _ref$button,
|
|
993
|
+
_ref$buttonDisabled = _ref.buttonDisabled,
|
|
994
|
+
buttonDisabled = _ref$buttonDisabled === void 0 ? false : _ref$buttonDisabled,
|
|
995
|
+
_ref$focusable = _ref.focusable,
|
|
996
|
+
focusable = _ref$focusable === void 0 ? false : _ref$focusable,
|
|
997
|
+
_ref$className = _ref.className,
|
|
998
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
999
|
+
_ref$style = _ref.style,
|
|
1000
|
+
style = _ref$style === void 0 ? null : _ref$style,
|
|
1001
|
+
_ref$onClickButton = _ref.onClickButton,
|
|
1002
|
+
onClickButton = _ref$onClickButton === void 0 ? null : _ref$onClickButton;
|
|
1146
1003
|
// const { isPreview, isEdit } = useScreenRenderContext();
|
|
1147
1004
|
var isSplitted = layout === 'split';
|
|
1148
1005
|
var verticalAlign = isSplitted ? null : layout;
|
|
@@ -1202,114 +1059,71 @@ var Title = function Title(_ref) {
|
|
|
1202
1059
|
"value": "Start"
|
|
1203
1060
|
}]
|
|
1204
1061
|
})))]);
|
|
1205
|
-
}
|
|
1206
|
-
Title.propTypes = propTypes$1;
|
|
1207
|
-
Title.defaultProps = defaultProps$1;
|
|
1062
|
+
}
|
|
1208
1063
|
|
|
1209
|
-
|
|
1210
|
-
id
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
header: null,
|
|
1273
|
-
footer: null,
|
|
1274
|
-
current: true,
|
|
1275
|
-
active: true,
|
|
1276
|
-
transitions: null,
|
|
1277
|
-
transitionStagger: 100,
|
|
1278
|
-
type: null,
|
|
1279
|
-
className: null
|
|
1280
|
-
};
|
|
1281
|
-
var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
|
|
1282
|
-
var id = _ref.id,
|
|
1283
|
-
layout = _ref.layout,
|
|
1284
|
-
introLayout = _ref.introLayout,
|
|
1285
|
-
title = _ref.title,
|
|
1286
|
-
description = _ref.description,
|
|
1287
|
-
questions = _ref.questions,
|
|
1288
|
-
results = _ref.results,
|
|
1289
|
-
buttonsStyle = _ref.buttonsStyle,
|
|
1290
|
-
inactiveButtonsStyle = _ref.inactiveButtonsStyle,
|
|
1291
|
-
buttonsTextStyle = _ref.buttonsTextStyle,
|
|
1292
|
-
inactiveButtonsTextStyle = _ref.inactiveButtonsTextStyle,
|
|
1293
|
-
questionsHeadingStyle = _ref.questionsHeadingStyle,
|
|
1294
|
-
resultsHeadingStyle = _ref.resultsHeadingStyle,
|
|
1295
|
-
resultsTextStyle = _ref.resultsTextStyle,
|
|
1296
|
-
feedbackTextStyle = _ref.feedbackTextStyle,
|
|
1297
|
-
numbersTextStyle = _ref.numbersTextStyle,
|
|
1298
|
-
goodAnswerColor = _ref.goodAnswerColor,
|
|
1299
|
-
badAnswerColor = _ref.badAnswerColor,
|
|
1300
|
-
spacing = _ref.spacing,
|
|
1301
|
-
background = _ref.background,
|
|
1302
|
-
introBackground = _ref.introBackground,
|
|
1303
|
-
introButton = _ref.introButton,
|
|
1304
|
-
nextButton = _ref.nextButton,
|
|
1305
|
-
header = _ref.header,
|
|
1306
|
-
footer = _ref.footer,
|
|
1307
|
-
current = _ref.current,
|
|
1308
|
-
active = _ref.active,
|
|
1309
|
-
transitions = _ref.transitions,
|
|
1310
|
-
transitionStagger = _ref.transitionStagger,
|
|
1311
|
-
type = _ref.type,
|
|
1312
|
-
className = _ref.className;
|
|
1064
|
+
function QuizMultipleScreen(_ref) {
|
|
1065
|
+
var _ref$id = _ref.id,
|
|
1066
|
+
id = _ref$id === void 0 ? null : _ref$id,
|
|
1067
|
+
_ref$layout = _ref.layout,
|
|
1068
|
+
layout = _ref$layout === void 0 ? 'middle' : _ref$layout,
|
|
1069
|
+
_ref$introLayout = _ref.introLayout,
|
|
1070
|
+
introLayout = _ref$introLayout === void 0 ? null : _ref$introLayout,
|
|
1071
|
+
_ref$title = _ref.title,
|
|
1072
|
+
title = _ref$title === void 0 ? null : _ref$title,
|
|
1073
|
+
_ref$description = _ref.description,
|
|
1074
|
+
description = _ref$description === void 0 ? null : _ref$description,
|
|
1075
|
+
_ref$questions = _ref.questions,
|
|
1076
|
+
questions = _ref$questions === void 0 ? null : _ref$questions,
|
|
1077
|
+
_ref$results = _ref.results,
|
|
1078
|
+
results = _ref$results === void 0 ? null : _ref$results,
|
|
1079
|
+
_ref$buttonsStyle = _ref.buttonsStyle,
|
|
1080
|
+
buttonsStyle = _ref$buttonsStyle === void 0 ? null : _ref$buttonsStyle,
|
|
1081
|
+
_ref$inactiveButtonsS = _ref.inactiveButtonsStyle,
|
|
1082
|
+
inactiveButtonsStyle = _ref$inactiveButtonsS === void 0 ? null : _ref$inactiveButtonsS,
|
|
1083
|
+
_ref$buttonsTextStyle = _ref.buttonsTextStyle,
|
|
1084
|
+
buttonsTextStyle = _ref$buttonsTextStyle === void 0 ? null : _ref$buttonsTextStyle,
|
|
1085
|
+
_ref$inactiveButtonsT = _ref.inactiveButtonsTextStyle,
|
|
1086
|
+
inactiveButtonsTextStyle = _ref$inactiveButtonsT === void 0 ? null : _ref$inactiveButtonsT,
|
|
1087
|
+
_ref$questionsHeading = _ref.questionsHeadingStyle,
|
|
1088
|
+
questionsHeadingStyle = _ref$questionsHeading === void 0 ? null : _ref$questionsHeading,
|
|
1089
|
+
_ref$resultsHeadingSt = _ref.resultsHeadingStyle,
|
|
1090
|
+
resultsHeadingStyle = _ref$resultsHeadingSt === void 0 ? null : _ref$resultsHeadingSt,
|
|
1091
|
+
_ref$resultsTextStyle = _ref.resultsTextStyle,
|
|
1092
|
+
resultsTextStyle = _ref$resultsTextStyle === void 0 ? null : _ref$resultsTextStyle,
|
|
1093
|
+
_ref$feedbackTextStyl = _ref.feedbackTextStyle,
|
|
1094
|
+
feedbackTextStyle = _ref$feedbackTextStyl === void 0 ? null : _ref$feedbackTextStyl,
|
|
1095
|
+
_ref$numbersTextStyle = _ref.numbersTextStyle,
|
|
1096
|
+
numbersTextStyle = _ref$numbersTextStyle === void 0 ? null : _ref$numbersTextStyle,
|
|
1097
|
+
_ref$goodAnswerColor = _ref.goodAnswerColor,
|
|
1098
|
+
goodAnswerColor = _ref$goodAnswerColor === void 0 ? null : _ref$goodAnswerColor,
|
|
1099
|
+
_ref$badAnswerColor = _ref.badAnswerColor,
|
|
1100
|
+
badAnswerColor = _ref$badAnswerColor === void 0 ? null : _ref$badAnswerColor,
|
|
1101
|
+
_ref$spacing = _ref.spacing,
|
|
1102
|
+
spacing = _ref$spacing === void 0 ? 20 : _ref$spacing,
|
|
1103
|
+
_ref$background = _ref.background,
|
|
1104
|
+
background = _ref$background === void 0 ? null : _ref$background,
|
|
1105
|
+
_ref$introBackground = _ref.introBackground,
|
|
1106
|
+
introBackground = _ref$introBackground === void 0 ? null : _ref$introBackground,
|
|
1107
|
+
_ref$introButton = _ref.introButton,
|
|
1108
|
+
introButton = _ref$introButton === void 0 ? null : _ref$introButton,
|
|
1109
|
+
_ref$nextButton = _ref.nextButton,
|
|
1110
|
+
nextButton = _ref$nextButton === void 0 ? null : _ref$nextButton,
|
|
1111
|
+
_ref$header = _ref.header,
|
|
1112
|
+
header = _ref$header === void 0 ? null : _ref$header,
|
|
1113
|
+
_ref$footer = _ref.footer,
|
|
1114
|
+
footer = _ref$footer === void 0 ? null : _ref$footer,
|
|
1115
|
+
_ref$current = _ref.current,
|
|
1116
|
+
current = _ref$current === void 0 ? true : _ref$current,
|
|
1117
|
+
_ref$active = _ref.active,
|
|
1118
|
+
active = _ref$active === void 0 ? true : _ref$active,
|
|
1119
|
+
_ref$transitions = _ref.transitions,
|
|
1120
|
+
transitions = _ref$transitions === void 0 ? null : _ref$transitions,
|
|
1121
|
+
_ref$transitionStagge = _ref.transitionStagger,
|
|
1122
|
+
transitionStagger = _ref$transitionStagge === void 0 ? 100 : _ref$transitionStagge,
|
|
1123
|
+
_ref$type = _ref.type,
|
|
1124
|
+
type = _ref$type === void 0 ? null : _ref$type,
|
|
1125
|
+
_ref$className = _ref.className,
|
|
1126
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
1313
1127
|
var screenId = id || 'screen-id';
|
|
1314
1128
|
var trackScreenEvent = useTrackScreenEvent(type);
|
|
1315
1129
|
var _useScreenSize = useScreenSize(),
|
|
@@ -1609,8 +1423,184 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
|
|
|
1609
1423
|
}
|
|
1610
1424
|
var showPoints = isEdit;
|
|
1611
1425
|
var showReset = isEdit && currentAnsweredIndex !== null;
|
|
1426
|
+
|
|
1427
|
+
// Content transition items (captured for leaving animations)
|
|
1428
|
+
var contentItems = [];
|
|
1429
|
+
if (isIntro) {
|
|
1430
|
+
contentItems.push({
|
|
1431
|
+
key: 'intro',
|
|
1432
|
+
element: /*#__PURE__*/React.createElement(Title, {
|
|
1433
|
+
title: title,
|
|
1434
|
+
description: description,
|
|
1435
|
+
layout: introLayout || layout,
|
|
1436
|
+
button: introButton,
|
|
1437
|
+
buttonDisabled: (questions || []).length < 1 || isEdit || isPreview,
|
|
1438
|
+
focusable: current && isView,
|
|
1439
|
+
transitions: transitions,
|
|
1440
|
+
transitionPlaying: transitionPlaying,
|
|
1441
|
+
transitionStagger: transitionStagger,
|
|
1442
|
+
transitionDisabled: transitionDisabled,
|
|
1443
|
+
className: styles$2.intro,
|
|
1444
|
+
style: !isPlaceholder ? {
|
|
1445
|
+
paddingLeft: spacing,
|
|
1446
|
+
paddingRight: spacing,
|
|
1447
|
+
paddingTop: (!isPreview ? viewerTopHeight : 0) + spacing,
|
|
1448
|
+
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (callToActionHeight || spacing)
|
|
1449
|
+
} : null,
|
|
1450
|
+
onClickButton: onClickIntroButton
|
|
1451
|
+
})
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
if (isQuestion) {
|
|
1455
|
+
contentItems.push({
|
|
1456
|
+
key: "question-".concat(questionIndex),
|
|
1457
|
+
element: /*#__PURE__*/React.createElement(Question, {
|
|
1458
|
+
index: questionIndex,
|
|
1459
|
+
totalCount: (questions || []).length,
|
|
1460
|
+
question: text,
|
|
1461
|
+
answers: answers,
|
|
1462
|
+
keypadLayout: keypadLayout,
|
|
1463
|
+
answeredIndex: currentAnsweredIndex,
|
|
1464
|
+
buttonsStyle: buttonsStyle,
|
|
1465
|
+
inactiveButtonsStyle: inactiveButtonsStyle,
|
|
1466
|
+
buttonsTextStyle: buttonsTextStyle,
|
|
1467
|
+
inactiveButtonsTextStyle: inactiveButtonsTextStyle,
|
|
1468
|
+
questionsHeadingStyle: questionsHeadingStyle,
|
|
1469
|
+
feedbackTextStyle: feedbackTextStyle,
|
|
1470
|
+
numbersTextStyle: numbersTextStyle,
|
|
1471
|
+
goodAnswerColor: goodAnswerColor,
|
|
1472
|
+
badAnswerColor: badAnswerColor,
|
|
1473
|
+
focusable: current && isView,
|
|
1474
|
+
showInstantAnswer: showInstantAnswer,
|
|
1475
|
+
layout: questionLayout || layout,
|
|
1476
|
+
result: questionResult,
|
|
1477
|
+
resultImage: questionResultImage,
|
|
1478
|
+
withResult: hasResult,
|
|
1479
|
+
withoutGoodAnswer: withoutGoodAnswer,
|
|
1480
|
+
withoutTrueFalse: !hasTrueFalse,
|
|
1481
|
+
withoutCollapse: hasTrueFalse,
|
|
1482
|
+
transitions: transitions,
|
|
1483
|
+
transitionPlaying: transitionPlaying,
|
|
1484
|
+
transitionStagger: transitionStagger,
|
|
1485
|
+
transitionDisabled: transitionDisabled,
|
|
1486
|
+
onAnswerClick: onAnswerClick,
|
|
1487
|
+
onAnswerTransitionEnd: hasResult ? null : onNextSlide,
|
|
1488
|
+
className: styles$2.question,
|
|
1489
|
+
style: !isPlaceholder ? {
|
|
1490
|
+
padding: spacing,
|
|
1491
|
+
paddingTop: (current && !isPreview ? viewerTopHeight : 0) + (headerHeight || spacing),
|
|
1492
|
+
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (callToActionHeight || spacing)
|
|
1493
|
+
} : null
|
|
1494
|
+
})
|
|
1495
|
+
});
|
|
1496
|
+
}
|
|
1497
|
+
if (hasResult && currentAnsweredIndex !== null) {
|
|
1498
|
+
contentItems.push({
|
|
1499
|
+
key: 'next',
|
|
1500
|
+
element: /*#__PURE__*/React.createElement("div", {
|
|
1501
|
+
className: styles$2.next,
|
|
1502
|
+
style: !isPlaceholder ? {
|
|
1503
|
+
padding: spacing,
|
|
1504
|
+
paddingTop: (current && !isPreview ? viewerTopHeight : 0) + (headerHeight || spacing),
|
|
1505
|
+
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (callToActionHeight || spacing)
|
|
1506
|
+
} : null
|
|
1507
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
1508
|
+
disabled: currentAnsweredIndex === null,
|
|
1509
|
+
focusable: true,
|
|
1510
|
+
buttonStyle: nextButton !== null ? nextButton.buttonStyle : null,
|
|
1511
|
+
className: styles$2.nextButton,
|
|
1512
|
+
onClick: onNextSlide
|
|
1513
|
+
}, hasButtonText ? /*#__PURE__*/React.createElement(Text, Object.assign({}, nextButton, {
|
|
1514
|
+
className: styles$2.label
|
|
1515
|
+
})) : /*#__PURE__*/React.createElement("span", {
|
|
1516
|
+
className: styles$2.label
|
|
1517
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
1518
|
+
id: "SVLGTA",
|
|
1519
|
+
defaultMessage: [{
|
|
1520
|
+
"type": 0,
|
|
1521
|
+
"value": "Next"
|
|
1522
|
+
}]
|
|
1523
|
+
}))))
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
if (isResults) {
|
|
1527
|
+
contentItems.push({
|
|
1528
|
+
key: 'results',
|
|
1529
|
+
element: /*#__PURE__*/React.createElement(Results, Object.assign({}, currentResult, {
|
|
1530
|
+
resultsHeadingStyle: resultsHeadingStyle,
|
|
1531
|
+
resultsTextStyle: resultsTextStyle,
|
|
1532
|
+
layout: resultLayout || layout,
|
|
1533
|
+
transitions: transitions,
|
|
1534
|
+
transitionPlaying: transitionPlaying,
|
|
1535
|
+
transitionStagger: transitionStagger,
|
|
1536
|
+
transitionDisabled: transitionDisabled,
|
|
1537
|
+
className: styles$2.results,
|
|
1538
|
+
style: !isPlaceholder ? {
|
|
1539
|
+
padding: spacing,
|
|
1540
|
+
paddingTop: (current && !isPreview ? viewerTopHeight : 0) + (headerHeight || spacing),
|
|
1541
|
+
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (callToActionHeight || spacing)
|
|
1542
|
+
} : null
|
|
1543
|
+
}))
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
var contentTransitions = useTransition(contentItems, {
|
|
1547
|
+
keys: function keys(item) {
|
|
1548
|
+
return item.key;
|
|
1549
|
+
},
|
|
1550
|
+
from: function from(item) {
|
|
1551
|
+
return item.key === 'next' ? {
|
|
1552
|
+
transform: 'translateX(0%)'
|
|
1553
|
+
} : {
|
|
1554
|
+
transform: direction === 'left' ? 'translateX(-100%)' : 'translateX(100%)'
|
|
1555
|
+
};
|
|
1556
|
+
},
|
|
1557
|
+
enter: {
|
|
1558
|
+
transform: 'translateX(0%)'
|
|
1559
|
+
},
|
|
1560
|
+
leave: function leave(item) {
|
|
1561
|
+
return item.key === 'next' ? {
|
|
1562
|
+
transform: 'translateX(0%)'
|
|
1563
|
+
} : {
|
|
1564
|
+
transform: direction === 'left' ? 'translateX(100%)' : 'translateX(-100%)'
|
|
1565
|
+
};
|
|
1566
|
+
},
|
|
1567
|
+
config: function config(item) {
|
|
1568
|
+
return item.key === 'next' ? {
|
|
1569
|
+
duration: 0
|
|
1570
|
+
} : {
|
|
1571
|
+
duration: 1000,
|
|
1572
|
+
easing: easings.easeInOutSine
|
|
1573
|
+
};
|
|
1574
|
+
}
|
|
1575
|
+
});
|
|
1576
|
+
|
|
1577
|
+
// Background transition
|
|
1578
|
+
var bgItem = useMemo(function () {
|
|
1579
|
+
return {
|
|
1580
|
+
key: backgroundKey,
|
|
1581
|
+
background: finalBackground
|
|
1582
|
+
};
|
|
1583
|
+
}, [backgroundKey, finalBackground]);
|
|
1584
|
+
var bgTransitions = useTransition(bgItem, {
|
|
1585
|
+
keys: function keys(item) {
|
|
1586
|
+
return item.key;
|
|
1587
|
+
},
|
|
1588
|
+
from: {
|
|
1589
|
+
opacity: 0
|
|
1590
|
+
},
|
|
1591
|
+
enter: {
|
|
1592
|
+
opacity: 1
|
|
1593
|
+
},
|
|
1594
|
+
leave: {
|
|
1595
|
+
opacity: 0
|
|
1596
|
+
},
|
|
1597
|
+
config: {
|
|
1598
|
+
duration: 1000,
|
|
1599
|
+
easing: easings.easeInOutSine
|
|
1600
|
+
}
|
|
1601
|
+
});
|
|
1612
1602
|
return /*#__PURE__*/React.createElement("div", {
|
|
1613
|
-
className: classNames([styles$2.container, _defineProperty(
|
|
1603
|
+
className: classNames([styles$2.container, _defineProperty({}, className, className !== null)]),
|
|
1614
1604
|
"data-screen-ready": true
|
|
1615
1605
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
1616
1606
|
width: width,
|
|
@@ -1649,116 +1639,33 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
|
|
|
1649
1639
|
onScrolledNotBottom: onScrolledNotBottom,
|
|
1650
1640
|
onScrollHeightChange: onScrollHeightChange,
|
|
1651
1641
|
withShadow: true
|
|
1652
|
-
}, /*#__PURE__*/React.createElement(TransitionGroup, null, [isIntro ? /*#__PURE__*/React.createElement(CSSTransition, {
|
|
1653
|
-
key: "intro",
|
|
1654
|
-
classNames: styles$2,
|
|
1655
|
-
timeout: 1000
|
|
1656
|
-
}, /*#__PURE__*/React.createElement(Title, {
|
|
1657
|
-
title: title,
|
|
1658
|
-
description: description,
|
|
1659
|
-
layout: introLayout || layout,
|
|
1660
|
-
button: introButton,
|
|
1661
|
-
buttonDisabled: (questions || []).length < 1 || isEdit || isPreview,
|
|
1662
|
-
focusable: current && isView,
|
|
1663
|
-
transitions: transitions,
|
|
1664
|
-
transitionPlaying: transitionPlaying,
|
|
1665
|
-
transitionStagger: transitionStagger,
|
|
1666
|
-
transitionDisabled: transitionDisabled,
|
|
1667
|
-
className: styles$2.intro,
|
|
1668
|
-
style: !isPlaceholder ? {
|
|
1669
|
-
paddingLeft: spacing,
|
|
1670
|
-
paddingRight: spacing,
|
|
1671
|
-
paddingTop: (!isPreview ? viewerTopHeight : 0) + spacing,
|
|
1672
|
-
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (callToActionHeight || spacing)
|
|
1673
|
-
} : null,
|
|
1674
|
-
onClickButton: onClickIntroButton
|
|
1675
|
-
})) : null, isQuestion ? /*#__PURE__*/React.createElement(CSSTransition, {
|
|
1676
|
-
key: "question-".concat(questionIndex),
|
|
1677
|
-
classNames: styles$2,
|
|
1678
|
-
timeout: 1000
|
|
1679
|
-
}, /*#__PURE__*/React.createElement(Question, {
|
|
1680
|
-
index: questionIndex,
|
|
1681
|
-
totalCount: (questions || []).length,
|
|
1682
|
-
question: text,
|
|
1683
|
-
answers: answers,
|
|
1684
|
-
keypadLayout: keypadLayout,
|
|
1685
|
-
answeredIndex: currentAnsweredIndex,
|
|
1686
|
-
buttonsStyle: buttonsStyle,
|
|
1687
|
-
inactiveButtonsStyle: inactiveButtonsStyle,
|
|
1688
|
-
buttonsTextStyle: buttonsTextStyle,
|
|
1689
|
-
inactiveButtonsTextStyle: inactiveButtonsTextStyle,
|
|
1690
|
-
questionsHeadingStyle: questionsHeadingStyle,
|
|
1691
|
-
feedbackTextStyle: feedbackTextStyle,
|
|
1692
|
-
numbersTextStyle: numbersTextStyle,
|
|
1693
|
-
goodAnswerColor: goodAnswerColor,
|
|
1694
|
-
badAnswerColor: badAnswerColor,
|
|
1695
|
-
focusable: current && isView,
|
|
1696
|
-
showInstantAnswer: showInstantAnswer,
|
|
1697
|
-
layout: questionLayout || layout,
|
|
1698
|
-
result: questionResult,
|
|
1699
|
-
resultImage: questionResultImage,
|
|
1700
|
-
withResult: hasResult,
|
|
1701
|
-
withoutGoodAnswer: withoutGoodAnswer,
|
|
1702
|
-
withoutTrueFalse: !hasTrueFalse,
|
|
1703
|
-
withoutCollapse: hasTrueFalse,
|
|
1704
|
-
transitions: transitions,
|
|
1705
|
-
transitionPlaying: transitionPlaying,
|
|
1706
|
-
transitionStagger: transitionStagger,
|
|
1707
|
-
transitionDisabled: transitionDisabled,
|
|
1708
|
-
onAnswerClick: onAnswerClick,
|
|
1709
|
-
onAnswerTransitionEnd: hasResult ? null : onNextSlide,
|
|
1710
|
-
className: styles$2.question,
|
|
1711
|
-
style: !isPlaceholder ? {
|
|
1712
|
-
padding: spacing,
|
|
1713
|
-
paddingTop: (current && !isPreview ? viewerTopHeight : 0) + (headerHeight || spacing),
|
|
1714
|
-
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (callToActionHeight || spacing)
|
|
1715
|
-
} : null
|
|
1716
|
-
})) : null, hasResult && currentAnsweredIndex !== null ? /*#__PURE__*/React.createElement(CSSTransition, {
|
|
1717
|
-
key: "next",
|
|
1718
|
-
classNames: styles$2,
|
|
1719
|
-
timeout: 0
|
|
1720
1642
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
}, /*#__PURE__*/React.createElement(Results, Object.assign({}, currentResult, {
|
|
1748
|
-
resultsHeadingStyle: resultsHeadingStyle,
|
|
1749
|
-
resultsTextStyle: resultsTextStyle,
|
|
1750
|
-
layout: resultLayout || layout,
|
|
1751
|
-
transitions: transitions,
|
|
1752
|
-
transitionPlaying: transitionPlaying,
|
|
1753
|
-
transitionStagger: transitionStagger,
|
|
1754
|
-
transitionDisabled: transitionDisabled,
|
|
1755
|
-
className: styles$2.results,
|
|
1756
|
-
style: !isPlaceholder ? {
|
|
1757
|
-
padding: spacing,
|
|
1758
|
-
paddingTop: (current && !isPreview ? viewerTopHeight : 0) + (headerHeight || spacing),
|
|
1759
|
-
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (callToActionHeight || spacing)
|
|
1760
|
-
} : null
|
|
1761
|
-
}))) : null])), !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
|
|
1643
|
+
style: {
|
|
1644
|
+
position: 'absolute',
|
|
1645
|
+
inset: '0'
|
|
1646
|
+
}
|
|
1647
|
+
}, contentTransitions(function (springStyle, item) {
|
|
1648
|
+
var isActive = contentItems.some(function (ci) {
|
|
1649
|
+
return ci.key === item.key;
|
|
1650
|
+
});
|
|
1651
|
+
return /*#__PURE__*/React.createElement(animated.div, {
|
|
1652
|
+
style: _objectSpread(_objectSpread({}, springStyle), !isActive ? {
|
|
1653
|
+
position: 'absolute',
|
|
1654
|
+
top: 0,
|
|
1655
|
+
left: 0,
|
|
1656
|
+
width: '100%',
|
|
1657
|
+
minHeight: '100%',
|
|
1658
|
+
zIndex: 0
|
|
1659
|
+
} : {
|
|
1660
|
+
position: 'relative',
|
|
1661
|
+
zIndex: 1,
|
|
1662
|
+
top: 0,
|
|
1663
|
+
left: 0,
|
|
1664
|
+
width: '100%',
|
|
1665
|
+
minHeight: '100%'
|
|
1666
|
+
})
|
|
1667
|
+
}, item.element);
|
|
1668
|
+
}))), !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
|
|
1762
1669
|
ref: footerRef,
|
|
1763
1670
|
className: classNames([styles$2.footer, _defineProperty({}, styles$2.disabled, !scrolledBottom)]),
|
|
1764
1671
|
style: {
|
|
@@ -1768,25 +1675,30 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
|
|
|
1768
1675
|
paddingBottom: spacing / 2,
|
|
1769
1676
|
transform: !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null
|
|
1770
1677
|
}
|
|
1771
|
-
}, /*#__PURE__*/React.createElement(Footer, footerProps)) : null), !isPlaceholder ?
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1678
|
+
}, /*#__PURE__*/React.createElement(Footer, footerProps)) : null), !isPlaceholder ? bgTransitions(function (springStyle, item) {
|
|
1679
|
+
return /*#__PURE__*/React.createElement(animated.div, {
|
|
1680
|
+
style: _objectSpread(_objectSpread({}, springStyle), {}, {
|
|
1681
|
+
position: 'absolute',
|
|
1682
|
+
top: 0,
|
|
1683
|
+
left: 0,
|
|
1684
|
+
width: '100%',
|
|
1685
|
+
height: '100%',
|
|
1686
|
+
zIndex: item.key === bgItem.key ? 1 : 0
|
|
1687
|
+
})
|
|
1688
|
+
}, /*#__PURE__*/React.createElement(Background, {
|
|
1689
|
+
background: item.background,
|
|
1690
|
+
width: width,
|
|
1691
|
+
height: height,
|
|
1692
|
+
resolution: resolution,
|
|
1693
|
+
playing: backgroundPlaying,
|
|
1694
|
+
muted: muted,
|
|
1695
|
+
shouldLoad: backgroundShouldLoad,
|
|
1696
|
+
mediaRef: mediaRef,
|
|
1697
|
+
className: styles$2.background,
|
|
1698
|
+
withoutVideo: isPreview
|
|
1699
|
+
}));
|
|
1700
|
+
}) : null);
|
|
1701
|
+
}
|
|
1790
1702
|
|
|
1791
1703
|
var definition = [{
|
|
1792
1704
|
id: 'quiz',
|