@micromag/screen-quiz 0.3.624 → 0.3.628

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.
Files changed (2) hide show
  1. package/es/index.js +136 -136
  2. package/package.json +15 -15
package/es/index.js CHANGED
@@ -4,9 +4,9 @@ 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$1 from 'prop-types';
7
+ import PropTypes from 'prop-types';
8
8
  import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react';
9
- import { PropTypes } from '@micromag/core';
9
+ import { PropTypes as PropTypes$1 } from '@micromag/core';
10
10
  import { ScreenElement, Transitions, Button as Button$1 } from '@micromag/core/components';
11
11
  import { useScreenRenderContext, useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useScreenState } from '@micromag/core/contexts';
12
12
  import { useTrackScreenEvent, useDimensionObserver } from '@micromag/core/hooks';
@@ -32,26 +32,26 @@ import { TransitionGroup, CSSTransition } from 'react-transition-group';
32
32
  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","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"};
33
33
 
34
34
  var propTypes$5 = {
35
- items: PropTypes.quizAnswers.isRequired,
36
- answeredIndex: PropTypes$1.number,
37
- answersCollapseDelay: PropTypes$1.number,
38
- buttonsStyle: PropTypes.boxStyle,
39
- inactiveButtonsStyle: PropTypes.boxStyle,
40
- buttonsTextStyle: PropTypes.textStyle,
41
- inactiveButtonsTextStyle: PropTypes.textStyle,
42
- goodAnswerColor: PropTypes.color,
43
- badAnswerColor: PropTypes.color,
44
- showUserAnswer: PropTypes$1.bool,
45
- withoutGoodAnswer: PropTypes$1.bool,
46
- withoutIcon: PropTypes$1.bool,
47
- focusable: PropTypes$1.bool,
48
- animated: PropTypes$1.bool,
49
- collapsed: PropTypes$1.bool,
50
- onClick: PropTypes$1.func,
51
- onCollapse: PropTypes$1.func,
52
- onCollapsed: PropTypes$1.func,
53
- onTransitionEnd: PropTypes$1.func,
54
- className: PropTypes$1.string
35
+ items: PropTypes$1.quizAnswers.isRequired,
36
+ answeredIndex: PropTypes.number,
37
+ answersCollapseDelay: PropTypes.number,
38
+ buttonsStyle: PropTypes$1.boxStyle,
39
+ inactiveButtonsStyle: PropTypes$1.boxStyle,
40
+ buttonsTextStyle: PropTypes$1.textStyle,
41
+ inactiveButtonsTextStyle: PropTypes$1.textStyle,
42
+ goodAnswerColor: PropTypes$1.color,
43
+ badAnswerColor: PropTypes$1.color,
44
+ showUserAnswer: PropTypes.bool,
45
+ withoutGoodAnswer: PropTypes.bool,
46
+ withoutIcon: PropTypes.bool,
47
+ focusable: PropTypes.bool,
48
+ animated: PropTypes.bool,
49
+ collapsed: PropTypes.bool,
50
+ onClick: PropTypes.func,
51
+ onCollapse: PropTypes.func,
52
+ onCollapsed: PropTypes.func,
53
+ onTransitionEnd: PropTypes.func,
54
+ className: PropTypes.string
55
55
  };
56
56
  var defaultProps$5 = {
57
57
  answeredIndex: null,
@@ -335,40 +335,40 @@ Answers.defaultProps = defaultProps$5;
335
335
  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","result":"micromag-screen-quiz-question-result","resultContent":"micromag-screen-quiz-question-resultContent","resultVisible":"micromag-screen-quiz-question-resultVisible","isPlaceholder":"micromag-screen-quiz-question-isPlaceholder"};
336
336
 
337
337
  var propTypes$4 = {
338
- question: PropTypes.textElement,
339
- answers: PropTypes.quizAnswers,
340
- result: PropTypes$1.shape({
341
- image: PropTypes.imageElement,
342
- text: PropTypes.textElement
338
+ question: PropTypes$1.textElement,
339
+ answers: PropTypes$1.quizAnswers,
340
+ result: PropTypes.shape({
341
+ image: PropTypes$1.imageElement,
342
+ text: PropTypes$1.textElement
343
343
  }),
344
- resultImage: PropTypes.visualElement,
345
- index: PropTypes$1.number,
346
- totalCount: PropTypes$1.number,
347
- answeredIndex: PropTypes$1.number,
348
- buttonsStyle: PropTypes.boxStyle,
349
- inactiveButtonsStyle: PropTypes.boxStyle,
350
- buttonsTextStyle: PropTypes.textStyle,
351
- inactiveButtonsTextStyle: PropTypes.textStyle,
352
- questionsHeadingStyle: PropTypes.textStyle,
353
- feedbackTextStyle: PropTypes.textStyle,
354
- goodAnswerColor: PropTypes.color,
355
- badAnswerColor: PropTypes.color,
356
- focusable: PropTypes$1.bool,
357
- animated: PropTypes$1.bool,
358
- layout: PropTypes$1.string,
359
- showInstantAnswer: PropTypes$1.bool,
360
- withResult: PropTypes$1.bool,
361
- withoutGoodAnswer: PropTypes$1.bool,
362
- withoutTrueFalse: PropTypes$1.bool,
363
- withoutIndex: PropTypes$1.bool,
364
- transitions: PropTypes.transitions,
365
- transitionPlaying: PropTypes$1.bool,
366
- transitionStagger: PropTypes$1.number,
367
- transitionDisabled: PropTypes$1.bool,
368
- onAnswerClick: PropTypes$1.func,
369
- onAnswerTransitionEnd: PropTypes$1.func,
370
- className: PropTypes$1.string,
371
- style: PropTypes$1.objectOf(PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]))
344
+ resultImage: PropTypes$1.visualElement,
345
+ index: PropTypes.number,
346
+ totalCount: PropTypes.number,
347
+ answeredIndex: PropTypes.number,
348
+ buttonsStyle: PropTypes$1.boxStyle,
349
+ inactiveButtonsStyle: PropTypes$1.boxStyle,
350
+ buttonsTextStyle: PropTypes$1.textStyle,
351
+ inactiveButtonsTextStyle: PropTypes$1.textStyle,
352
+ questionsHeadingStyle: PropTypes$1.textStyle,
353
+ feedbackTextStyle: PropTypes$1.textStyle,
354
+ goodAnswerColor: PropTypes$1.color,
355
+ badAnswerColor: PropTypes$1.color,
356
+ focusable: PropTypes.bool,
357
+ animated: PropTypes.bool,
358
+ layout: PropTypes.string,
359
+ showInstantAnswer: PropTypes.bool,
360
+ withResult: PropTypes.bool,
361
+ withoutGoodAnswer: PropTypes.bool,
362
+ withoutTrueFalse: PropTypes.bool,
363
+ withoutIndex: PropTypes.bool,
364
+ transitions: PropTypes$1.transitions,
365
+ transitionPlaying: PropTypes.bool,
366
+ transitionStagger: PropTypes.number,
367
+ transitionDisabled: PropTypes.bool,
368
+ onAnswerClick: PropTypes.func,
369
+ onAnswerTransitionEnd: PropTypes.func,
370
+ className: PropTypes.string,
371
+ style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
372
372
  };
373
373
  var defaultProps$4 = {
374
374
  question: null,
@@ -559,34 +559,34 @@ Question.defaultProps = defaultProps$4;
559
559
  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","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"};
560
560
 
561
561
  var propTypes$3 = {
562
- id: PropTypes$1.string,
563
- layout: PropTypes$1.oneOf(['top', 'middle', 'bottom', 'split']),
564
- question: PropTypes.textElement,
565
- answers: PropTypes.quizAnswers,
566
- result: PropTypes$1.shape({
567
- image: PropTypes.imageElement,
568
- text: PropTypes.textElement
562
+ id: PropTypes.string,
563
+ layout: PropTypes.oneOf(['top', 'middle', 'bottom', 'split']),
564
+ question: PropTypes$1.textElement,
565
+ answers: PropTypes$1.quizAnswers,
566
+ result: PropTypes.shape({
567
+ image: PropTypes$1.imageElement,
568
+ text: PropTypes$1.textElement
569
569
  }),
570
- resultImage: PropTypes.visualElement,
571
- buttonsStyle: PropTypes.boxStyle,
572
- inactiveButtonsStyle: PropTypes.boxStyle,
573
- buttonsTextStyle: PropTypes.textStyle,
574
- inactiveButtonsTextStyle: PropTypes.textStyle,
575
- feedbackTextStyle: PropTypes.textStyle,
576
- goodAnswerColor: PropTypes.color,
577
- badAnswerColor: PropTypes.color,
578
- withoutTrueFalse: PropTypes$1.bool,
579
- spacing: PropTypes$1.number,
580
- background: PropTypes.backgroundElement,
581
- header: PropTypes.header,
582
- footer: PropTypes.footer,
583
- current: PropTypes$1.bool,
584
- preload: PropTypes$1.bool,
585
- ready: PropTypes$1.bool,
586
- transitions: PropTypes.transitions,
587
- transitionStagger: PropTypes$1.number,
588
- type: PropTypes$1.string,
589
- className: PropTypes$1.string
570
+ resultImage: PropTypes$1.visualElement,
571
+ buttonsStyle: PropTypes$1.boxStyle,
572
+ inactiveButtonsStyle: PropTypes$1.boxStyle,
573
+ buttonsTextStyle: PropTypes$1.textStyle,
574
+ inactiveButtonsTextStyle: PropTypes$1.textStyle,
575
+ feedbackTextStyle: PropTypes$1.textStyle,
576
+ goodAnswerColor: PropTypes$1.color,
577
+ badAnswerColor: PropTypes$1.color,
578
+ withoutTrueFalse: PropTypes.bool,
579
+ spacing: PropTypes.number,
580
+ background: PropTypes$1.backgroundElement,
581
+ header: PropTypes$1.header,
582
+ footer: PropTypes$1.footer,
583
+ current: PropTypes.bool,
584
+ preload: PropTypes.bool,
585
+ ready: PropTypes.bool,
586
+ transitions: PropTypes$1.transitions,
587
+ transitionStagger: PropTypes.number,
588
+ type: PropTypes.string,
589
+ className: PropTypes.string
590
590
  };
591
591
  var defaultProps$3 = {
592
592
  id: null,
@@ -855,20 +855,20 @@ var QuizScreen = function QuizScreen(_ref) {
855
855
  QuizScreen.propTypes = propTypes$3;
856
856
  QuizScreen.defaultProps = defaultProps$3;
857
857
 
858
- 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","isPlaceholder":"micromag-screen-quiz-results-isPlaceholder"};
858
+ 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"};
859
859
 
860
860
  var propTypes$2 = {
861
- title: PropTypes.textElement,
862
- description: PropTypes.textElement,
863
- resultsHeadingStyle: PropTypes.textStyle,
864
- resultsTextStyle: PropTypes.textStyle,
865
- layout: PropTypes$1.string,
866
- transitions: PropTypes.transitions,
867
- transitionPlaying: PropTypes$1.bool,
868
- transitionStagger: PropTypes$1.number,
869
- transitionDisabled: PropTypes$1.bool,
870
- className: PropTypes$1.string,
871
- style: PropTypes$1.objectOf(PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]))
861
+ title: PropTypes$1.textElement,
862
+ description: PropTypes$1.textElement,
863
+ resultsHeadingStyle: PropTypes$1.textStyle,
864
+ resultsTextStyle: PropTypes$1.textStyle,
865
+ layout: PropTypes.string,
866
+ transitions: PropTypes$1.transitions,
867
+ transitionPlaying: PropTypes.bool,
868
+ transitionStagger: PropTypes.number,
869
+ transitionDisabled: PropTypes.bool,
870
+ className: PropTypes.string,
871
+ style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
872
872
  };
873
873
  var defaultProps$2 = {
874
874
  title: null,
@@ -956,18 +956,18 @@ var Results = function Results(_ref) {
956
956
  Results.propTypes = propTypes$2;
957
957
  Results.defaultProps = defaultProps$2;
958
958
 
959
- 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","isPlaceholder":"micromag-screen-quiz-title-isPlaceholder"};
959
+ 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"};
960
960
 
961
961
  var propTypes$1 = {
962
- title: PropTypes.textElement,
963
- description: PropTypes.textElement,
964
- button: PropTypes.textElement,
965
- layout: PropTypes$1.string,
966
- focusable: PropTypes$1.bool,
967
- buttonDisabled: PropTypes$1.bool,
968
- className: PropTypes$1.string,
969
- style: PropTypes$1.objectOf(PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number])),
970
- onClickButton: PropTypes$1.func
962
+ title: PropTypes$1.textElement,
963
+ description: PropTypes$1.textElement,
964
+ button: PropTypes$1.textElement,
965
+ layout: PropTypes.string,
966
+ focusable: PropTypes.bool,
967
+ buttonDisabled: PropTypes.bool,
968
+ className: PropTypes.string,
969
+ style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
970
+ onClickButton: PropTypes.func
971
971
  };
972
972
  var defaultProps$1 = {
973
973
  title: null,
@@ -1054,40 +1054,40 @@ Title.propTypes = propTypes$1;
1054
1054
  Title.defaultProps = defaultProps$1;
1055
1055
 
1056
1056
  var propTypes = {
1057
- id: PropTypes$1.string,
1058
- layout: PropTypes$1.oneOf(['top', 'middle', 'bottom', 'split']),
1059
- introLayout: PropTypes$1.oneOf(['top', 'middle', 'bottom', 'split']),
1060
- title: PropTypes.textElement,
1061
- description: PropTypes.textElement,
1062
- questions: PropTypes$1.arrayOf(PropTypes$1.shape({
1063
- text: PropTypes.textElement,
1064
- answers: PropTypes.quizAnswers
1057
+ id: PropTypes.string,
1058
+ layout: PropTypes.oneOf(['top', 'middle', 'bottom', 'split']),
1059
+ introLayout: PropTypes.oneOf(['top', 'middle', 'bottom', 'split']),
1060
+ title: PropTypes$1.textElement,
1061
+ description: PropTypes$1.textElement,
1062
+ questions: PropTypes.arrayOf(PropTypes.shape({
1063
+ text: PropTypes$1.textElement,
1064
+ answers: PropTypes$1.quizAnswers
1065
1065
  })),
1066
- results: PropTypes$1.arrayOf(PropTypes$1.shape({
1067
- title: PropTypes.textElement,
1068
- description: PropTypes.textElement
1066
+ results: PropTypes.arrayOf(PropTypes.shape({
1067
+ title: PropTypes$1.textElement,
1068
+ description: PropTypes$1.textElement
1069
1069
  })),
1070
- buttonsStyle: PropTypes.boxStyle,
1071
- inactiveButtonsStyle: PropTypes.boxStyle,
1072
- buttonsTextStyle: PropTypes.textStyle,
1073
- inactiveButtonsTextStyle: PropTypes.textStyle,
1074
- questionsHeadingStyle: PropTypes.textStyle,
1075
- resultsHeadingStyle: PropTypes.textStyle,
1076
- resultsTextStyle: PropTypes.textStyle,
1077
- goodAnswerColor: PropTypes.color,
1078
- badAnswerColor: PropTypes.color,
1079
- spacing: PropTypes$1.number,
1080
- background: PropTypes.backgroundElement,
1081
- introButton: PropTypes.textElement,
1082
- introBackground: PropTypes.backgroundElement,
1083
- header: PropTypes.header,
1084
- footer: PropTypes.footer,
1085
- current: PropTypes$1.bool,
1086
- active: PropTypes$1.bool,
1087
- transitions: PropTypes.transitions,
1088
- transitionStagger: PropTypes$1.number,
1089
- type: PropTypes$1.string,
1090
- className: PropTypes$1.string
1070
+ buttonsStyle: PropTypes$1.boxStyle,
1071
+ inactiveButtonsStyle: PropTypes$1.boxStyle,
1072
+ buttonsTextStyle: PropTypes$1.textStyle,
1073
+ inactiveButtonsTextStyle: PropTypes$1.textStyle,
1074
+ questionsHeadingStyle: PropTypes$1.textStyle,
1075
+ resultsHeadingStyle: PropTypes$1.textStyle,
1076
+ resultsTextStyle: PropTypes$1.textStyle,
1077
+ goodAnswerColor: PropTypes$1.color,
1078
+ badAnswerColor: PropTypes$1.color,
1079
+ spacing: PropTypes.number,
1080
+ background: PropTypes$1.backgroundElement,
1081
+ introButton: PropTypes$1.textElement,
1082
+ introBackground: PropTypes$1.backgroundElement,
1083
+ header: PropTypes$1.header,
1084
+ footer: PropTypes$1.footer,
1085
+ current: PropTypes.bool,
1086
+ active: PropTypes.bool,
1087
+ transitions: PropTypes$1.transitions,
1088
+ transitionStagger: PropTypes.number,
1089
+ type: PropTypes.string,
1090
+ className: PropTypes.string
1091
1091
  };
1092
1092
  var defaultProps = {
1093
1093
  id: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-quiz",
3
- "version": "0.3.624",
3
+ "version": "0.3.628",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -63,19 +63,19 @@
63
63
  "@fortawesome/fontawesome-svg-core": "^6.5.2",
64
64
  "@fortawesome/free-solid-svg-icons": "^6.5.2",
65
65
  "@fortawesome/react-fontawesome": "^0.2.0",
66
- "@micromag/core": "^0.3.619",
67
- "@micromag/data": "^0.3.619",
68
- "@micromag/element-background": "^0.3.619",
69
- "@micromag/element-button": "^0.3.619",
70
- "@micromag/element-container": "^0.3.619",
71
- "@micromag/element-footer": "^0.3.619",
72
- "@micromag/element-header": "^0.3.619",
73
- "@micromag/element-heading": "^0.3.619",
74
- "@micromag/element-layout": "^0.3.619",
75
- "@micromag/element-scroll": "^0.3.619",
76
- "@micromag/element-text": "^0.3.619",
77
- "@micromag/element-visual": "^0.3.619",
78
- "@micromag/transforms": "^0.3.619",
66
+ "@micromag/core": "^0.3.628",
67
+ "@micromag/data": "^0.3.628",
68
+ "@micromag/element-background": "^0.3.628",
69
+ "@micromag/element-button": "^0.3.628",
70
+ "@micromag/element-container": "^0.3.628",
71
+ "@micromag/element-footer": "^0.3.628",
72
+ "@micromag/element-header": "^0.3.628",
73
+ "@micromag/element-heading": "^0.3.628",
74
+ "@micromag/element-layout": "^0.3.628",
75
+ "@micromag/element-scroll": "^0.3.628",
76
+ "@micromag/element-text": "^0.3.628",
77
+ "@micromag/element-visual": "^0.3.628",
78
+ "@micromag/transforms": "^0.3.628",
79
79
  "@react-spring/core": "^9.6.1",
80
80
  "@react-spring/web": "^9.6.1",
81
81
  "classnames": "^2.2.6",
@@ -89,5 +89,5 @@
89
89
  "access": "public",
90
90
  "registry": "https://registry.npmjs.org/"
91
91
  },
92
- "gitHead": "dae93d8ee83abe0aa8f51a31a94e32f7b5ad9104"
92
+ "gitHead": "6f1230244a2966c16e85b7d44583276421a38cca"
93
93
  }