@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/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 = {"emptyAnswer":"micromag-screen-quiz-answers-emptyAnswer","button":"micromag-screen-quiz-answers-button","container":"micromag-screen-quiz-answers-container","items":"micromag-screen-quiz-answers-items","item":"micromag-screen-quiz-answers-item","isPlaceholder":"micromag-screen-quiz-answers-isPlaceholder","userAnswer":"micromag-screen-quiz-answers-userAnswer","otherAnswer":"micromag-screen-quiz-answers-otherAnswer","withoutOpacity":"micromag-screen-quiz-answers-withoutOpacity","withIcon":"micromag-screen-quiz-answers-withIcon","withSquareItems":"micromag-screen-quiz-answers-withSquareItems","resultIcon":"micromag-screen-quiz-answers-resultIcon","answered":"micromag-screen-quiz-answers-answered","rightAnswer":"micromag-screen-quiz-answers-rightAnswer","faIcon":"micromag-screen-quiz-answers-faIcon","itemContent":"micromag-screen-quiz-answers-itemContent"};
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
- var propTypes$5 = {
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
- answeredIndex = _ref.answeredIndex,
88
- answersCollapseDelay = _ref.answersCollapseDelay,
89
- buttonsStyle = _ref.buttonsStyle,
90
- buttonsLayout = _ref.buttonsLayout,
91
- inactiveButtonsStyle = _ref.inactiveButtonsStyle,
92
- buttonsTextStyle = _ref.buttonsTextStyle,
93
- inactiveButtonsTextStyle = _ref.inactiveButtonsTextStyle,
94
- goodAnswerColor = _ref.goodAnswerColor,
95
- badAnswerColor = _ref.badAnswerColor,
96
- showUserAnswer = _ref.showUserAnswer,
97
- withoutGoodAnswer = _ref.withoutGoodAnswer,
98
- withoutIcon = _ref.withoutIcon,
99
- focusable = _ref.focusable,
100
- collapseAnimated = _ref.animated,
101
- initialCollapsed = _ref.collapsed,
102
- onClick = _ref.onClick,
103
- onCollapse = _ref.onCollapse,
104
- onCollapsed = _ref.onCollapsed,
105
- onTransitionEnd = _ref.onTransitionEnd,
106
- withoutCollapse = _ref.withoutCollapse,
107
- className = _ref.className;
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":"micromag-screen-quiz-question-container","emptyQuestion":"micromag-screen-quiz-question-emptyQuestion","emptyResult":"micromag-screen-quiz-question-emptyResult","question":"micromag-screen-quiz-question-question","index":"micromag-screen-quiz-question-index","resultContent":"micromag-screen-quiz-question-resultContent","result":"micromag-screen-quiz-question-result","resultVisible":"micromag-screen-quiz-question-resultVisible","resultHidden":"micromag-screen-quiz-question-resultHidden","isPlaceholder":"micromag-screen-quiz-question-isPlaceholder"};
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
- var propTypes$4 = {
447
- question: PropTypes$1.textElement,
448
- answers: PropTypes$1.quizAnswers,
449
- keypadLayout: PropTypes.shape({}),
450
- result: PropTypes.shape({
451
- image: PropTypes$1.imageElement,
452
- text: PropTypes$1.textElement
453
- }),
454
- resultImage: PropTypes$1.visualElement,
455
- index: PropTypes.number,
456
- totalCount: PropTypes.number,
457
- answeredIndex: PropTypes.number,
458
- buttonsLayout: PropTypes$1.buttonLayout,
459
- buttonsStyle: PropTypes$1.boxStyle,
460
- inactiveButtonsStyle: PropTypes$1.boxStyle,
461
- buttonsTextStyle: PropTypes$1.textStyle,
462
- inactiveButtonsTextStyle: PropTypes$1.textStyle,
463
- questionsHeadingStyle: PropTypes$1.textStyle,
464
- feedbackTextStyle: PropTypes$1.textStyle,
465
- numbersTextStyle: PropTypes$1.textStyle,
466
- goodAnswerColor: PropTypes$1.color,
467
- badAnswerColor: PropTypes$1.color,
468
- focusable: PropTypes.bool,
469
- animated: PropTypes.bool,
470
- layout: PropTypes.string,
471
- showInstantAnswer: PropTypes.bool,
472
- withResult: PropTypes.bool,
473
- withoutGoodAnswer: PropTypes.bool,
474
- withoutTrueFalse: PropTypes.bool,
475
- withoutIndex: PropTypes.bool,
476
- transitions: PropTypes$1.transitions,
477
- transitionPlaying: PropTypes.bool,
478
- transitionStagger: PropTypes.number,
479
- transitionDisabled: PropTypes.bool,
480
- onAnswerClick: PropTypes.func,
481
- onAnswerTransitionEnd: PropTypes.func,
482
- withoutCollapse: PropTypes.bool,
483
- className: PropTypes.string,
484
- style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
485
- };
486
- var defaultProps$4 = {
487
- question: null,
488
- answers: null,
489
- keypadLayout: null,
490
- result: null,
491
- resultImage: null,
492
- index: null,
493
- totalCount: null,
494
- answeredIndex: null,
495
- buttonsLayout: null,
496
- buttonsStyle: null,
497
- inactiveButtonsStyle: null,
498
- buttonsTextStyle: null,
499
- inactiveButtonsTextStyle: null,
500
- questionsHeadingStyle: null,
501
- feedbackTextStyle: null,
502
- numbersTextStyle: null,
503
- goodAnswerColor: null,
504
- badAnswerColor: null,
505
- focusable: false,
506
- animated: false,
507
- layout: null,
508
- showInstantAnswer: false,
509
- withResult: false,
510
- withoutGoodAnswer: false,
511
- withoutTrueFalse: false,
512
- withoutIndex: false,
513
- transitions: null,
514
- transitionPlaying: false,
515
- transitionStagger: 100,
516
- transitionDisabled: false,
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":"micromag-screen-quiz-container","background":"micromag-screen-quiz-background","disabled":"micromag-screen-quiz-disabled","hidden":"micromag-screen-quiz-hidden","placeholder":"micromag-screen-quiz-placeholder","content":"micromag-screen-quiz-content","nextButton":"micromag-screen-quiz-nextButton","reset":"micromag-screen-quiz-reset","points":"micromag-screen-quiz-points","layout":"micromag-screen-quiz-layout","header":"micromag-screen-quiz-header","footer":"micromag-screen-quiz-footer","transition":"micromag-screen-quiz-transition","question":"micromag-screen-quiz-question","results":"micromag-screen-quiz-results","intro":"micromag-screen-quiz-intro","enter":"micromag-screen-quiz-enter","left":"micromag-screen-quiz-left","enterActive":"micromag-screen-quiz-enterActive","exit":"micromag-screen-quiz-exit","exitActive":"micromag-screen-quiz-exitActive","withIcon":"micromag-screen-quiz-withIcon"};
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
- var propTypes$3 = {
688
- id: PropTypes.string,
689
- layout: PropTypes.oneOf(['top', 'middle', 'bottom', 'split']),
690
- keypadLayout: PropTypes.shape({}),
691
- question: PropTypes$1.textElement,
692
- answers: PropTypes$1.quizAnswers,
693
- result: PropTypes.shape({
694
- image: PropTypes$1.imageElement,
695
- text: PropTypes$1.textElement
696
- }),
697
- resultImage: PropTypes$1.visualElement,
698
- buttonsLayout: PropTypes$1.buttonLayout,
699
- buttonsStyle: PropTypes$1.boxStyle,
700
- inactiveButtonsStyle: PropTypes$1.boxStyle,
701
- buttonsTextStyle: PropTypes$1.textStyle,
702
- inactiveButtonsTextStyle: PropTypes$1.textStyle,
703
- feedbackTextStyle: PropTypes$1.textStyle,
704
- numbersTextStyle: PropTypes$1.textStyle,
705
- goodAnswerColor: PropTypes$1.color,
706
- badAnswerColor: PropTypes$1.color,
707
- withoutTrueFalse: PropTypes.bool,
708
- spacing: PropTypes.number,
709
- background: PropTypes$1.backgroundElement,
710
- header: PropTypes$1.header,
711
- footer: PropTypes$1.footer,
712
- current: PropTypes.bool,
713
- preload: PropTypes.bool,
714
- ready: PropTypes.bool,
715
- transitions: PropTypes$1.transitions,
716
- transitionStagger: PropTypes.number,
717
- type: PropTypes.string,
718
- className: PropTypes.string
719
- };
720
- var defaultProps$3 = {
721
- id: null,
722
- layout: 'middle',
723
- keypadLayout: null,
724
- question: null,
725
- answers: null,
726
- result: null,
727
- resultImage: null,
728
- buttonsLayout: null,
729
- buttonsStyle: null,
730
- inactiveButtonsStyle: null,
731
- buttonsTextStyle: null,
732
- inactiveButtonsTextStyle: null,
733
- feedbackTextStyle: null,
734
- numbersTextStyle: null,
735
- goodAnswerColor: null,
736
- badAnswerColor: null,
737
- withoutTrueFalse: false,
738
- spacing: 20,
739
- header: null,
740
- footer: null,
741
- background: null,
742
- current: true,
743
- preload: true,
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":"micromag-screen-quiz-results-container","emptyTitle":"micromag-screen-quiz-results-emptyTitle","emptyDescription":"micromag-screen-quiz-results-emptyDescription","title":"micromag-screen-quiz-results-title"};
898
+ var styles$1 = {"container":"container","title":"title","emptyTitle":"emptyTitle","emptyDescription":"emptyDescription"};
1012
899
 
1013
- var propTypes$2 = {
1014
- title: PropTypes$1.textElement,
1015
- description: PropTypes$1.textElement,
1016
- resultsHeadingStyle: PropTypes$1.textStyle,
1017
- resultsTextStyle: PropTypes$1.textStyle,
1018
- layout: PropTypes.string,
1019
- transitions: PropTypes$1.transitions,
1020
- transitionPlaying: PropTypes.bool,
1021
- transitionStagger: PropTypes.number,
1022
- transitionDisabled: PropTypes.bool,
1023
- className: PropTypes.string,
1024
- style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
1025
- };
1026
- var defaultProps$2 = {
1027
- title: null,
1028
- description: null,
1029
- resultsHeadingStyle: null,
1030
- resultsTextStyle: null,
1031
- layout: null,
1032
- transitions: null,
1033
- transitionPlaying: false,
1034
- transitionStagger: 100,
1035
- transitionDisabled: false,
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":"micromag-screen-quiz-title-container","emptyTitle":"micromag-screen-quiz-title-emptyTitle","emptyDescription":"micromag-screen-quiz-title-emptyDescription","title":"micromag-screen-quiz-title-title","description":"micromag-screen-quiz-title-description"};
982
+ var styles = {"container":"container","title":"title","description":"description","emptyTitle":"emptyTitle","emptyDescription":"emptyDescription"};
1113
983
 
1114
- var propTypes$1 = {
1115
- title: PropTypes$1.textElement,
1116
- description: PropTypes$1.textElement,
1117
- button: PropTypes$1.textElement,
1118
- layout: PropTypes.string,
1119
- focusable: PropTypes.bool,
1120
- buttonDisabled: PropTypes.bool,
1121
- className: PropTypes.string,
1122
- style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
1123
- onClickButton: PropTypes.func
1124
- };
1125
- var defaultProps$1 = {
1126
- title: null,
1127
- description: null,
1128
- layout: null,
1129
- button: null,
1130
- buttonDisabled: false,
1131
- focusable: false,
1132
- className: null,
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
- var propTypes = {
1210
- id: PropTypes.string,
1211
- layout: PropTypes.oneOf(['top', 'middle', 'bottom', 'split']),
1212
- introLayout: PropTypes.oneOf(['top', 'middle', 'bottom', 'split']),
1213
- title: PropTypes$1.textElement,
1214
- description: PropTypes$1.textElement,
1215
- questions: PropTypes.arrayOf(PropTypes.shape({
1216
- text: PropTypes$1.textElement,
1217
- answers: PropTypes$1.quizAnswers
1218
- })),
1219
- results: PropTypes.arrayOf(PropTypes.shape({
1220
- title: PropTypes$1.textElement,
1221
- description: PropTypes$1.textElement
1222
- })),
1223
- buttonsStyle: PropTypes$1.boxStyle,
1224
- inactiveButtonsStyle: PropTypes$1.boxStyle,
1225
- buttonsTextStyle: PropTypes$1.textStyle,
1226
- inactiveButtonsTextStyle: PropTypes$1.textStyle,
1227
- questionsHeadingStyle: PropTypes$1.textStyle,
1228
- resultsHeadingStyle: PropTypes$1.textStyle,
1229
- resultsTextStyle: PropTypes$1.textStyle,
1230
- feedbackTextStyle: PropTypes$1.textStyle,
1231
- numbersTextStyle: PropTypes$1.textStyle,
1232
- goodAnswerColor: PropTypes$1.color,
1233
- badAnswerColor: PropTypes$1.color,
1234
- spacing: PropTypes.number,
1235
- background: PropTypes$1.backgroundElement,
1236
- introButton: PropTypes$1.textElement,
1237
- introBackground: PropTypes$1.backgroundElement,
1238
- nextButton: PropTypes$1.textElement,
1239
- header: PropTypes$1.header,
1240
- footer: PropTypes$1.footer,
1241
- current: PropTypes.bool,
1242
- active: PropTypes.bool,
1243
- transitions: PropTypes$1.transitions,
1244
- transitionStagger: PropTypes.number,
1245
- type: PropTypes.string,
1246
- className: PropTypes.string
1247
- };
1248
- var defaultProps = {
1249
- id: null,
1250
- layout: 'middle',
1251
- introLayout: null,
1252
- title: null,
1253
- description: null,
1254
- questions: null,
1255
- results: null,
1256
- buttonsStyle: null,
1257
- inactiveButtonsStyle: null,
1258
- buttonsTextStyle: null,
1259
- inactiveButtonsTextStyle: null,
1260
- questionsHeadingStyle: null,
1261
- resultsHeadingStyle: null,
1262
- resultsTextStyle: null,
1263
- feedbackTextStyle: null,
1264
- numbersTextStyle: null,
1265
- goodAnswerColor: null,
1266
- badAnswerColor: null,
1267
- spacing: 20,
1268
- background: null,
1269
- introButton: null,
1270
- introBackground: null,
1271
- nextButton: null,
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(_defineProperty({}, styles$2[direction], direction !== null), className, className !== null)]),
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
- className: styles$2.next,
1722
- style: !isPlaceholder ? {
1723
- padding: spacing,
1724
- paddingTop: (current && !isPreview ? viewerTopHeight : 0) + (headerHeight || spacing),
1725
- paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (callToActionHeight || spacing)
1726
- } : null
1727
- }, /*#__PURE__*/React.createElement(Button$1, {
1728
- disabled: currentAnsweredIndex === null,
1729
- focusable: true,
1730
- buttonStyle: nextButton !== null ? nextButton.buttonStyle : null,
1731
- className: styles$2.nextButton,
1732
- onClick: onNextSlide
1733
- }, hasButtonText ? /*#__PURE__*/React.createElement(Text, Object.assign({}, nextButton, {
1734
- className: styles$2.label
1735
- })) : /*#__PURE__*/React.createElement("span", {
1736
- className: styles$2.label
1737
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
1738
- id: "SVLGTA",
1739
- defaultMessage: [{
1740
- "type": 0,
1741
- "value": "Next"
1742
- }]
1743
- }))))) : null, isResults ? /*#__PURE__*/React.createElement(CSSTransition, {
1744
- key: "results",
1745
- classNames: styles$2,
1746
- timeout: 2000
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 ? /*#__PURE__*/React.createElement(TransitionGroup, null, /*#__PURE__*/React.createElement(CSSTransition, {
1772
- key: backgroundKey,
1773
- classNames: styles$2,
1774
- timeout: 1000
1775
- }, /*#__PURE__*/React.createElement(Background, {
1776
- background: finalBackground,
1777
- width: width,
1778
- height: height,
1779
- resolution: resolution,
1780
- playing: backgroundPlaying,
1781
- muted: muted,
1782
- shouldLoad: backgroundShouldLoad,
1783
- mediaRef: mediaRef,
1784
- className: styles$2.background,
1785
- withoutVideo: isPreview
1786
- }))) : null);
1787
- };
1788
- QuizMultipleScreen.propTypes = propTypes;
1789
- QuizMultipleScreen.defaultProps = defaultProps;
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',