@micromag/screen-quiz 0.4.49 → 0.4.50

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 +481 -454
  2. package/package.json +16 -16
package/es/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import { FormattedMessage, defineMessage } from 'react-intl';
2
+ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
5
  import { faRedo } from '@fortawesome/free-solid-svg-icons/faRedo';
5
6
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
6
7
  import classNames from 'classnames';
7
- import React, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
8
+ import { useState, useEffect, useRef, useMemo, useCallback } from 'react';
8
9
  import { ScreenElement, Transitions, Button } from '@micromag/core/components';
9
10
  import { useScreenRenderContext, useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useScreenState } from '@micromag/core/contexts';
10
11
  import { useTrackScreenEvent, useDimensionObserver } from '@micromag/core/hooks';
@@ -15,7 +16,6 @@ import Container from '@micromag/element-container';
15
16
  import Footer from '@micromag/element-footer';
16
17
  import Header from '@micromag/element-header';
17
18
  import Scroll from '@micromag/element-scroll';
18
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
19
19
  import Heading from '@micromag/element-heading';
20
20
  import Layout, { Spacer } from '@micromag/element-layout';
21
21
  import Text from '@micromag/element-text';
@@ -25,6 +25,7 @@ import { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';
25
25
  import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
26
26
  import Button$1, { RichButton } from '@micromag/element-button';
27
27
  import Keypad from '@micromag/element-keypad';
28
+ import { jsx, jsxs } from 'react/jsx-runtime';
28
29
  import { useTransition, easings, animated } from '@react-spring/web';
29
30
  import isArray from 'lodash/isArray';
30
31
 
@@ -335,60 +336,65 @@ function Answers(_ref) {
335
336
  }
336
337
  return acc;
337
338
  }, {})), inactiveButtonTextStyle), answerButtonTextStyle);
338
- return /*#__PURE__*/React.createElement("div", {
339
- key: "answer-".concat(answerI),
339
+ return /*#__PURE__*/jsx("div", {
340
340
  className: classNames([styles$4.item, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$4.rightAnswer, !withoutGoodAnswer && rightAnswer === true), styles$4.userAnswer, isUserAnswer), styles$4.otherAnswer, isOtherAnswer), styles$4.withoutOpacity, !hasOpacity)])
341
341
  // onTransitionEnd={onAnswerTransitionEnd}
342
342
  ,
343
- style: _objectSpread({}, style)
344
- }, /*#__PURE__*/React.createElement("div", {
345
- className: styles$4.itemContent,
346
- ref: function ref(el) {
347
- itemsRefs.current[answerI] = el;
348
- }
349
- }, /*#__PURE__*/React.createElement(ScreenElement, {
350
- placeholder: "quizAnswer",
351
- placeholderProps: {
352
- good: answerI === 0
353
- },
354
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
355
- id: "+Ok+7S",
356
- defaultMessage: [{
357
- "type": 0,
358
- "value": "Answer"
359
- }]
360
- }),
361
- emptyClassName: styles$4.emptyAnswer,
362
- isEmpty: !hasAnswer
363
- }, hasAnswer ? /*#__PURE__*/React.createElement(RichButton, {
364
- className: styles$4.button,
365
- onPointerUp: function onPointerUp(e) {
366
- if (e.pointerType !== 'mouse' || e.button === 0) {
367
- onClick(answer, answerI);
368
- }
369
- },
370
- disabled: !visible || isPreview || answered,
371
- focusable: focusable,
372
- buttonStyle: finalButtonStyle,
373
- textStyle: finalTextStyle,
374
- label: label,
375
- visual: visual,
376
- visualClassName: styles$4.optionVisual,
377
- imageClassName: styles$4.optionImage,
378
- layout: buttonLayout || buttonsLayout || (hasVisual ? 'label-right' : null)
379
- }, answered && !withoutIcon && rightAnswer === true ? /*#__PURE__*/React.createElement("span", {
380
- className: styles$4.resultIcon,
381
- style: getStyleFromColor(goodAnswerColor, 'backgroundColor')
382
- }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
383
- className: styles$4.faIcon,
384
- icon: faCheck
385
- })) : null, !withoutIcon && answered && rightAnswer === false ? /*#__PURE__*/React.createElement("span", {
386
- className: styles$4.resultIcon,
387
- style: getStyleFromColor(badAnswerColor, 'backgroundColor')
388
- }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
389
- className: styles$4.faIcon,
390
- icon: faTimes
391
- })) : null) : null)));
343
+ style: _objectSpread({}, style),
344
+ children: /*#__PURE__*/jsx("div", {
345
+ className: styles$4.itemContent,
346
+ ref: function ref(el) {
347
+ itemsRefs.current[answerI] = el;
348
+ },
349
+ children: /*#__PURE__*/jsx(ScreenElement, {
350
+ placeholder: "quizAnswer",
351
+ placeholderProps: {
352
+ good: answerI === 0
353
+ },
354
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
355
+ id: "+Ok+7S",
356
+ defaultMessage: [{
357
+ "type": 0,
358
+ "value": "Answer"
359
+ }]
360
+ }),
361
+ emptyClassName: styles$4.emptyAnswer,
362
+ isEmpty: !hasAnswer,
363
+ children: hasAnswer ? /*#__PURE__*/jsxs(RichButton, {
364
+ className: styles$4.button,
365
+ onPointerUp: function onPointerUp(e) {
366
+ if (e.pointerType !== 'mouse' || e.button === 0) {
367
+ onClick(answer, answerI);
368
+ }
369
+ },
370
+ disabled: !visible || isPreview || answered,
371
+ focusable: focusable,
372
+ buttonStyle: finalButtonStyle,
373
+ textStyle: finalTextStyle,
374
+ label: label,
375
+ visual: visual,
376
+ visualClassName: styles$4.optionVisual,
377
+ imageClassName: styles$4.optionImage,
378
+ layout: buttonLayout || buttonsLayout || (hasVisual ? 'label-right' : null),
379
+ children: [answered && !withoutIcon && rightAnswer === true ? /*#__PURE__*/jsx("span", {
380
+ className: styles$4.resultIcon,
381
+ style: getStyleFromColor(goodAnswerColor, 'backgroundColor'),
382
+ children: /*#__PURE__*/jsx(FontAwesomeIcon, {
383
+ className: styles$4.faIcon,
384
+ icon: faCheck
385
+ })
386
+ }) : null, !withoutIcon && answered && rightAnswer === false ? /*#__PURE__*/jsx("span", {
387
+ className: styles$4.resultIcon,
388
+ style: getStyleFromColor(badAnswerColor, 'backgroundColor'),
389
+ children: /*#__PURE__*/jsx(FontAwesomeIcon, {
390
+ className: styles$4.faIcon,
391
+ icon: faTimes
392
+ })
393
+ }) : null]
394
+ }) : null
395
+ })
396
+ })
397
+ }, "answer-".concat(answerI));
392
398
  });
393
399
  var _ref10 = keypadLayout || {},
394
400
  _ref10$columnAlign = _ref10.columnAlign,
@@ -399,15 +405,16 @@ function Answers(_ref) {
399
405
  spacing = _ref10$spacing === void 0 ? null : _ref10$spacing,
400
406
  _ref10$withSquareItem = _ref10.withSquareItems,
401
407
  withSquareItems = _ref10$withSquareItem === void 0 ? false : _ref10$withSquareItem;
402
- return /*#__PURE__*/React.createElement("div", {
403
- className: classNames([styles$4.container, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$4.answered, answered), styles$4.withIcon, !withoutIcon && hasGoodOrBadAnswerInList), styles$4.withSquareItems, withSquareItems === true), styles$4.isPlaceholder, isPlaceholder)])
404
- }, filteredListOfItems !== null || isPlaceholder ? /*#__PURE__*/React.createElement(Keypad, {
405
- className: styles$4.items,
406
- items: keypadItems,
407
- align: align,
408
- columns: columns,
409
- spacing: spacing
410
- }) : null);
408
+ return /*#__PURE__*/jsx("div", {
409
+ className: classNames([styles$4.container, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$4.answered, answered), styles$4.withIcon, !withoutIcon && hasGoodOrBadAnswerInList), styles$4.withSquareItems, withSquareItems === true), styles$4.isPlaceholder, isPlaceholder)]),
410
+ children: filteredListOfItems !== null || isPlaceholder ? /*#__PURE__*/jsx(Keypad, {
411
+ className: styles$4.items,
412
+ items: keypadItems,
413
+ align: align,
414
+ columns: columns,
415
+ spacing: spacing
416
+ }) : null
417
+ });
411
418
  }
412
419
 
413
420
  var styles$3 = {"container":"micromag-screen-quiz-question-container","question":"micromag-screen-quiz-question-question","index":"micromag-screen-quiz-question-index","resultContent":"micromag-screen-quiz-question-resultContent","result":"micromag-screen-quiz-question-result","emptyQuestion":"micromag-screen-quiz-question-emptyQuestion","emptyResult":"micromag-screen-quiz-question-emptyResult","resultVisible":"micromag-screen-quiz-question-resultVisible","resultHidden":"micromag-screen-quiz-question-resultHidden","isPlaceholder":"micromag-screen-quiz-question-isPlaceholder"};
@@ -514,97 +521,101 @@ function Question(_ref) {
514
521
  setResultVisible(true);
515
522
  }, [setResultVisible]);
516
523
  var hasIndex = index !== null && totalCount !== null;
517
- return /*#__PURE__*/React.createElement(Layout, {
524
+ return /*#__PURE__*/jsx(Layout, {
518
525
  className: classNames([styles$3.container, className, _defineProperty(_defineProperty(_defineProperty({}, styles$3.isPlaceholder, isPlaceholder), styles$3.resultVisible, resultVisible), styles$3.resultHidden, !hasResult)]),
519
526
  verticalAlign: verticalAlign,
520
- style: style
521
- }, [!withoutIndex && hasIndex ? /*#__PURE__*/React.createElement(ScreenElement, {
522
- key: "stats",
523
- placeholder: /*#__PURE__*/React.createElement("div", {
524
- className: styles$3.index
525
- }, "1 / 10")
526
- }, totalCount > 1 ? /*#__PURE__*/React.createElement(Transitions, {
527
- transitions: transitions,
528
- playing: transitionPlaying,
529
- disabled: transitionDisabled
530
- }, /*#__PURE__*/React.createElement(Text, {
531
- className: styles$3.index,
532
- body: "".concat(index + 1, " / ").concat(totalCount),
533
- textStyle: numbersTextStyle
534
- })) : null) : null, /*#__PURE__*/React.createElement(ScreenElement, {
535
- key: "question",
536
- placeholder: "title",
537
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
538
- id: "FOmgqv",
539
- defaultMessage: [{
540
- "type": 0,
541
- "value": "Question"
542
- }]
543
- }),
544
- emptyClassName: styles$3.emptyQuestion,
545
- isEmpty: !hasQuestion
546
- }, hasQuestion ? /*#__PURE__*/React.createElement(Transitions, {
547
- transitions: transitions,
548
- playing: transitionPlaying,
549
- disabled: transitionDisabled
550
- }, /*#__PURE__*/React.createElement(Heading, Object.assign({}, question, {
551
- className: styles$3.question,
552
- textStyle: _objectSpread(_objectSpread({}, questionsHeadingStyle), questionTextStyle)
553
- }))) : null), isSplitted ? /*#__PURE__*/React.createElement(Spacer, {
554
- key: "spacer"
555
- }) : null, /*#__PURE__*/React.createElement(Answers, {
556
- key: "answers",
557
- items: answers || [],
558
- keypadLayout: keypadLayout,
559
- answeredIndex: answeredIndex,
560
- goodAnswerColor: goodAnswerColor,
561
- badAnswerColor: badAnswerColor,
562
- withoutGoodAnswer: withoutGoodAnswer,
563
- withoutIcon: withoutTrueFalse,
564
- showUserAnswer: withoutTrueFalse,
565
- buttonsLayout: buttonsLayout,
566
- buttonsStyle: buttonsStyle,
567
- inactiveButtonsStyle: inactiveButtonsStyle,
568
- buttonsTextStyle: buttonsTextStyle,
569
- inactiveButtonsTextStyle: inactiveButtonsTextStyle,
570
- focusable: focusable,
571
- animated: animated,
572
- transitions: transitions,
573
- transitionStagger: transitionStagger,
574
- transitionPlaying: transitionPlaying,
575
- transitionDisabled: transitionDisabled,
576
- onClick: onAnswerClick,
577
- onCollapse: onAnswersCollapse,
578
- onTransitionEnd: onAnswerTransitionEnd,
579
- withoutCollapse: withoutCollapse
580
- }), withResult ? /*#__PURE__*/React.createElement("div", {
581
- className: styles$3.result,
582
- key: "results"
583
- }, /*#__PURE__*/React.createElement("div", {
584
- className: styles$3.resultContent
585
- }, /*#__PURE__*/React.createElement(ScreenElement, {
586
- emptyLabel: answered ? /*#__PURE__*/React.createElement(FormattedMessage, {
587
- id: "li7ADr",
588
- defaultMessage: [{
589
- "type": 0,
590
- "value": "Result"
591
- }]
592
- }) : null,
593
- isEmpty: answered && !hasResult,
594
- emptyClassName: styles$3.emptyResult
595
- }, (hasResult || hasResultVisual) && answers !== null ? /*#__PURE__*/React.createElement(Transitions, {
596
- transitions: transitions,
597
- playing: transitionPlaying,
598
- delay: (1 + answers.length) * transitionStagger,
599
- disabled: transitionDisabled
600
- }, hasResult ? /*#__PURE__*/React.createElement(Text, Object.assign({}, finalResult || {}, {
601
- className: styles$3.resultText,
602
- textStyle: _objectSpread(_objectSpread({}, feedbackTextStyle || null), resultTextStyle || null)
603
- })) : null, hasResultVisual ? /*#__PURE__*/React.createElement(Visual, {
604
- media: answerImage || resultImage,
605
- width: "100%",
606
- height: "auto"
607
- }) : null) : null))) : null]);
527
+ style: style,
528
+ children: [!withoutIndex && hasIndex ? /*#__PURE__*/jsx(ScreenElement, {
529
+ placeholder: /*#__PURE__*/jsx("div", {
530
+ className: styles$3.index,
531
+ children: "1 / 10"
532
+ }),
533
+ children: totalCount > 1 ? /*#__PURE__*/jsx(Transitions, {
534
+ transitions: transitions,
535
+ playing: transitionPlaying,
536
+ disabled: transitionDisabled,
537
+ children: /*#__PURE__*/jsx(Text, {
538
+ className: styles$3.index,
539
+ body: "".concat(index + 1, " / ").concat(totalCount),
540
+ textStyle: numbersTextStyle
541
+ })
542
+ }) : null
543
+ }, "stats") : null, /*#__PURE__*/jsx(ScreenElement, {
544
+ placeholder: "title",
545
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
546
+ id: "FOmgqv",
547
+ defaultMessage: [{
548
+ "type": 0,
549
+ "value": "Question"
550
+ }]
551
+ }),
552
+ emptyClassName: styles$3.emptyQuestion,
553
+ isEmpty: !hasQuestion,
554
+ children: hasQuestion ? /*#__PURE__*/jsx(Transitions, {
555
+ transitions: transitions,
556
+ playing: transitionPlaying,
557
+ disabled: transitionDisabled,
558
+ children: /*#__PURE__*/jsx(Heading, _objectSpread(_objectSpread({}, question), {}, {
559
+ className: styles$3.question,
560
+ textStyle: _objectSpread(_objectSpread({}, questionsHeadingStyle), questionTextStyle)
561
+ }))
562
+ }) : null
563
+ }, "question"), isSplitted ? /*#__PURE__*/jsx(Spacer, {}, "spacer") : null, /*#__PURE__*/jsx(Answers, {
564
+ items: answers || [],
565
+ keypadLayout: keypadLayout,
566
+ answeredIndex: answeredIndex,
567
+ goodAnswerColor: goodAnswerColor,
568
+ badAnswerColor: badAnswerColor,
569
+ withoutGoodAnswer: withoutGoodAnswer,
570
+ withoutIcon: withoutTrueFalse,
571
+ showUserAnswer: withoutTrueFalse,
572
+ buttonsLayout: buttonsLayout,
573
+ buttonsStyle: buttonsStyle,
574
+ inactiveButtonsStyle: inactiveButtonsStyle,
575
+ buttonsTextStyle: buttonsTextStyle,
576
+ inactiveButtonsTextStyle: inactiveButtonsTextStyle,
577
+ focusable: focusable,
578
+ animated: animated,
579
+ transitions: transitions,
580
+ transitionStagger: transitionStagger,
581
+ transitionPlaying: transitionPlaying,
582
+ transitionDisabled: transitionDisabled,
583
+ onClick: onAnswerClick,
584
+ onCollapse: onAnswersCollapse,
585
+ onTransitionEnd: onAnswerTransitionEnd,
586
+ withoutCollapse: withoutCollapse
587
+ }, "answers"), withResult ? /*#__PURE__*/jsx("div", {
588
+ className: styles$3.result,
589
+ children: /*#__PURE__*/jsx("div", {
590
+ className: styles$3.resultContent,
591
+ children: /*#__PURE__*/jsx(ScreenElement, {
592
+ emptyLabel: answered ? /*#__PURE__*/jsx(FormattedMessage, {
593
+ id: "li7ADr",
594
+ defaultMessage: [{
595
+ "type": 0,
596
+ "value": "Result"
597
+ }]
598
+ }) : null,
599
+ isEmpty: answered && !hasResult,
600
+ emptyClassName: styles$3.emptyResult,
601
+ children: (hasResult || hasResultVisual) && answers !== null ? /*#__PURE__*/jsxs(Transitions, {
602
+ transitions: transitions,
603
+ playing: transitionPlaying,
604
+ delay: (1 + answers.length) * transitionStagger,
605
+ disabled: transitionDisabled,
606
+ children: [hasResult ? /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({}, finalResult || {}), {}, {
607
+ className: styles$3.resultText,
608
+ textStyle: _objectSpread(_objectSpread({}, feedbackTextStyle || null), resultTextStyle || null)
609
+ })) : null, hasResultVisual ? /*#__PURE__*/jsx(Visual, {
610
+ media: answerImage || resultImage,
611
+ width: "100%",
612
+ height: "auto"
613
+ }) : null]
614
+ }) : null
615
+ })
616
+ })
617
+ }, "results") : null]
618
+ });
608
619
  }
609
620
 
610
621
  var styles$2 = {"container":"micromag-screen-quiz-container","background":"micromag-screen-quiz-background","content":"micromag-screen-quiz-content","disabled":"micromag-screen-quiz-disabled","reset":"micromag-screen-quiz-reset","points":"micromag-screen-quiz-points","header":"micromag-screen-quiz-header","footer":"micromag-screen-quiz-footer","nextButton":"micromag-screen-quiz-nextButton","question":"micromag-screen-quiz-question","results":"micromag-screen-quiz-results","intro":"micromag-screen-quiz-intro"};
@@ -804,96 +815,101 @@ function QuizScreen(_ref) {
804
815
  var isSplitted = layout === 'split';
805
816
  var verticalAlign = isSplitted ? null : layout;
806
817
  var showReset = isEdit && userAnswerIndex !== null;
807
- return /*#__PURE__*/React.createElement("div", {
818
+ return /*#__PURE__*/jsxs("div", {
808
819
  className: classNames([styles$2.container, className, _defineProperty({}, styles$2.disabled, clickDisabled)]),
809
- "data-screen-ready": true
810
- }, /*#__PURE__*/React.createElement(Container, {
811
- width: width,
812
- height: height,
813
- className: styles$2.content
814
- }, showReset ? /*#__PURE__*/React.createElement(Button, {
815
- className: styles$2.reset,
816
- icon: /*#__PURE__*/React.createElement(FontAwesomeIcon, {
817
- icon: faRedo,
818
- size: "md"
819
- }),
820
- onClick: onQuizReset
821
- }) : null, /*#__PURE__*/React.createElement(Scroll, {
822
- verticalAlign: verticalAlign
823
- // disabled={scrollingDisabled || userAnswerIndex !== null}
824
- ,
825
- disabled: scrollingDisabled,
826
- onScrolledTrigger: onScrolledTrigger,
827
- onScrolledBottom: onScrolledBottom,
828
- onScrolledNotBottom: onScrolledNotBottom,
829
- onScrollHeightChange: onScrollHeightChange,
830
- withShadow: true
831
- }, !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
832
- className: classNames([styles$2.header, _defineProperty({}, styles$2.disabled, userAnswerIndex !== null || scrolledBottom && !scrollingDisabled && hasScroll)]),
833
- ref: headerRef,
834
- style: {
835
- paddingTop: spacing / 2,
836
- paddingLeft: spacing,
837
- paddingRight: spacing,
838
- paddingBottom: spacing,
839
- transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
840
- }
841
- }, /*#__PURE__*/React.createElement(Header, header)) : null, /*#__PURE__*/React.createElement(Question, {
842
- question: question,
843
- answers: answers,
844
- keypadLayout: keypadLayout,
845
- result: result,
846
- resultImage: resultImage,
847
- answeredIndex: userAnswerIndex,
848
- buttonsLayout: buttonsLayout,
849
- buttonsStyle: buttonsStyle,
850
- buttonsTextStyle: buttonsTextStyle,
851
- inactiveButtonsStyle: inactiveButtonsStyle,
852
- inactiveButtonsTextStyle: inactiveButtonsTextStyle,
853
- feedbackTextStyle: feedbackTextStyle,
854
- numbersTextStyle: numbersTextStyle,
855
- goodAnswerColor: goodAnswerColor,
856
- badAnswerColor: badAnswerColor,
857
- withoutTrueFalse: withoutTrueFalse,
858
- withoutGoodAnswer: withoutGoodAnswer,
859
- focusable: current && isView,
860
- animated: isView,
861
- showInstantAnswer: showInstantAnswer,
862
- withResult: true,
863
- layout: layout,
864
- transitions: transitions,
865
- transitionPlaying: transitionPlaying,
866
- transitionStagger: transitionStagger,
867
- transitionDisabled: transitionDisabled,
868
- onAnswerClick: onAnswerClick,
869
- className: styles$2.question,
870
- style: !isPlaceholder ? {
871
- padding: spacing,
872
- paddingTop: (!isPreview ? viewerTopHeight : 0) + (headerHeight || spacing),
873
- paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (footerHeight || spacing)
874
- } : null
875
- })), !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
876
- ref: footerRef,
877
- className: classNames([styles$2.footer, _defineProperty({}, styles$2.disabled, !scrolledBottom && hasScroll)]),
878
- style: {
879
- transform: current && !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null,
880
- paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
881
- paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
882
- paddingTop: spacing / 2,
883
- paddingBottom: spacing / 2
884
- }
885
- }, /*#__PURE__*/React.createElement(Footer, footerProps)) : null), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
886
- background: background,
887
- width: width,
888
- height: height,
889
- resolution: resolution,
890
- playing: backgroundPlaying,
891
- muted: muted,
892
- shouldLoad: mediaShouldLoad,
893
- mediaRef: mediaRef,
894
- withoutVideo: isPreview,
895
- className: styles$2.background
896
- }) : null);
820
+ "data-screen-ready": true,
821
+ children: [/*#__PURE__*/jsxs(Container, {
822
+ width: width,
823
+ height: height,
824
+ className: styles$2.content,
825
+ children: [showReset ? /*#__PURE__*/jsx(Button, {
826
+ className: styles$2.reset,
827
+ icon: /*#__PURE__*/jsx(FontAwesomeIcon, {
828
+ icon: faRedo,
829
+ size: "md"
830
+ }),
831
+ onClick: onQuizReset
832
+ }) : null, /*#__PURE__*/jsxs(Scroll, {
833
+ verticalAlign: verticalAlign
834
+ // disabled={scrollingDisabled || userAnswerIndex !== null}
835
+ ,
836
+ disabled: scrollingDisabled,
837
+ onScrolledTrigger: onScrolledTrigger,
838
+ onScrolledBottom: onScrolledBottom,
839
+ onScrolledNotBottom: onScrolledNotBottom,
840
+ onScrollHeightChange: onScrollHeightChange,
841
+ withShadow: true,
842
+ children: [!isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
843
+ className: classNames([styles$2.header, _defineProperty({}, styles$2.disabled, userAnswerIndex !== null || scrolledBottom && !scrollingDisabled && hasScroll)]),
844
+ ref: headerRef,
845
+ style: {
846
+ paddingTop: spacing / 2,
847
+ paddingLeft: spacing,
848
+ paddingRight: spacing,
849
+ paddingBottom: spacing,
850
+ transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
851
+ },
852
+ children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
853
+ }) : null, /*#__PURE__*/jsx(Question, {
854
+ question: question,
855
+ answers: answers,
856
+ keypadLayout: keypadLayout,
857
+ result: result,
858
+ resultImage: resultImage,
859
+ answeredIndex: userAnswerIndex,
860
+ buttonsLayout: buttonsLayout,
861
+ buttonsStyle: buttonsStyle,
862
+ buttonsTextStyle: buttonsTextStyle,
863
+ inactiveButtonsStyle: inactiveButtonsStyle,
864
+ inactiveButtonsTextStyle: inactiveButtonsTextStyle,
865
+ feedbackTextStyle: feedbackTextStyle,
866
+ numbersTextStyle: numbersTextStyle,
867
+ goodAnswerColor: goodAnswerColor,
868
+ badAnswerColor: badAnswerColor,
869
+ withoutTrueFalse: withoutTrueFalse,
870
+ withoutGoodAnswer: withoutGoodAnswer,
871
+ focusable: current && isView,
872
+ animated: isView,
873
+ showInstantAnswer: showInstantAnswer,
874
+ withResult: true,
875
+ layout: layout,
876
+ transitions: transitions,
877
+ transitionPlaying: transitionPlaying,
878
+ transitionStagger: transitionStagger,
879
+ transitionDisabled: transitionDisabled,
880
+ onAnswerClick: onAnswerClick,
881
+ className: styles$2.question,
882
+ style: !isPlaceholder ? {
883
+ padding: spacing,
884
+ paddingTop: (!isPreview ? viewerTopHeight : 0) + (headerHeight || spacing),
885
+ paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (footerHeight || spacing)
886
+ } : null
887
+ })]
888
+ }), !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
889
+ ref: footerRef,
890
+ className: classNames([styles$2.footer, _defineProperty({}, styles$2.disabled, !scrolledBottom && hasScroll)]),
891
+ style: {
892
+ transform: current && !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null,
893
+ paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
894
+ paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
895
+ paddingTop: spacing / 2,
896
+ paddingBottom: spacing / 2
897
+ },
898
+ children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
899
+ }) : null]
900
+ }), !isPlaceholder ? /*#__PURE__*/jsx(Background, {
901
+ background: background,
902
+ width: width,
903
+ height: height,
904
+ resolution: resolution,
905
+ playing: backgroundPlaying,
906
+ muted: muted,
907
+ shouldLoad: mediaShouldLoad,
908
+ mediaRef: mediaRef,
909
+ withoutVideo: isPreview,
910
+ className: styles$2.background
911
+ }) : null]
912
+ });
897
913
  }
898
914
 
899
915
  var styles$1 = {"container":"micromag-screen-quiz-results-container","title":"micromag-screen-quiz-results-title","emptyTitle":"micromag-screen-quiz-results-emptyTitle","emptyDescription":"micromag-screen-quiz-results-emptyDescription"};
@@ -931,59 +947,58 @@ function Results(_ref) {
931
947
  var _ref3 = description || {},
932
948
  _ref3$textStyle = _ref3.textStyle,
933
949
  descriptionTextStyle = _ref3$textStyle === void 0 ? null : _ref3$textStyle;
934
- return /*#__PURE__*/React.createElement(Layout, {
950
+ return /*#__PURE__*/jsx(Layout, {
935
951
  className: classNames([styles$1.container, className]),
936
952
  fullscreen: true,
937
953
  verticalAlign: verticalAlign,
938
- style: style
939
- }, [/*#__PURE__*/React.createElement(ScreenElement, {
940
- key: "title",
941
- placeholder: "title",
942
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
943
- id: "BSTWf8",
944
- defaultMessage: [{
945
- "type": 0,
946
- "value": "Title"
947
- }]
948
- }),
949
- emptyClassName: styles$1.emptyTitle,
950
- isEmpty: !hasTitle
951
- }, hasTitle ? /*#__PURE__*/React.createElement(Transitions, {
952
- transitions: transitions,
953
- playing: transitionPlaying,
954
- disabled: transitionDisabled
955
- }, /*#__PURE__*/React.createElement(Heading, Object.assign({}, title, {
956
- className: styles$1.title,
957
- textStyle: _objectSpread(_objectSpread({}, resultsHeadingStyle), titleTextStyle)
958
- }))) : null), isSplitted ? /*#__PURE__*/React.createElement(Spacer, {
959
- key: "spacer"
960
- }) : null, /*#__PURE__*/React.createElement(ScreenElement, {
961
- key: "description",
962
- placeholder: "text",
963
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
964
- id: "hoDz0O",
965
- defaultMessage: [{
966
- "type": 0,
967
- "value": "Description"
968
- }]
969
- }),
970
- emptyClassName: styles$1.emptyDescription,
971
- isEmpty: !hasDescription
972
- }, hasTitle ? /*#__PURE__*/React.createElement(Transitions, {
973
- transitions: transitions,
974
- playing: transitionPlaying,
975
- disabled: transitionDisabled,
976
- delay: transitionStagger
977
- }, /*#__PURE__*/React.createElement(Text, Object.assign({}, description, {
978
- className: styles$1.description,
979
- textStyle: _objectSpread(_objectSpread({}, resultsTextStyle), descriptionTextStyle)
980
- }))) : null)]);
954
+ style: style,
955
+ children: [/*#__PURE__*/jsx(ScreenElement, {
956
+ placeholder: "title",
957
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
958
+ id: "BSTWf8",
959
+ defaultMessage: [{
960
+ "type": 0,
961
+ "value": "Title"
962
+ }]
963
+ }),
964
+ emptyClassName: styles$1.emptyTitle,
965
+ isEmpty: !hasTitle,
966
+ children: hasTitle ? /*#__PURE__*/jsx(Transitions, {
967
+ transitions: transitions,
968
+ playing: transitionPlaying,
969
+ disabled: transitionDisabled,
970
+ children: /*#__PURE__*/jsx(Heading, _objectSpread(_objectSpread({}, title), {}, {
971
+ className: styles$1.title,
972
+ textStyle: _objectSpread(_objectSpread({}, resultsHeadingStyle), titleTextStyle)
973
+ }))
974
+ }) : null
975
+ }, "title"), isSplitted ? /*#__PURE__*/jsx(Spacer, {}, "spacer") : null, /*#__PURE__*/jsx(ScreenElement, {
976
+ placeholder: "text",
977
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
978
+ id: "hoDz0O",
979
+ defaultMessage: [{
980
+ "type": 0,
981
+ "value": "Description"
982
+ }]
983
+ }),
984
+ emptyClassName: styles$1.emptyDescription,
985
+ isEmpty: !hasDescription,
986
+ children: hasTitle ? /*#__PURE__*/jsx(Transitions, {
987
+ transitions: transitions,
988
+ playing: transitionPlaying,
989
+ disabled: transitionDisabled,
990
+ delay: transitionStagger,
991
+ children: /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({}, description), {}, {
992
+ className: styles$1.description,
993
+ textStyle: _objectSpread(_objectSpread({}, resultsTextStyle), descriptionTextStyle)
994
+ }))
995
+ }) : null
996
+ }, "description")]
997
+ });
981
998
  }
982
999
 
983
1000
  var styles = {"container":"micromag-screen-quiz-title-container","title":"micromag-screen-quiz-title-title","description":"micromag-screen-quiz-title-description","emptyTitle":"micromag-screen-quiz-title-emptyTitle","emptyDescription":"micromag-screen-quiz-title-emptyDescription"};
984
1001
 
985
- /* eslint-disable react/no-array-index-key */
986
-
987
1002
  function Title(_ref) {
988
1003
  var _ref$layout = _ref.layout,
989
1004
  layout = _ref$layout === void 0 ? null : _ref$layout,
@@ -1009,59 +1024,59 @@ function Title(_ref) {
1009
1024
  var hasTitle = isTextFilled(title);
1010
1025
  var hasDescription = isTextFilled(description);
1011
1026
  var hasButton = isTextFilled(button);
1012
- return /*#__PURE__*/React.createElement(Layout, {
1027
+ return /*#__PURE__*/jsx(Layout, {
1013
1028
  className: classNames([styles.container, className]),
1014
1029
  fullscreen: true,
1015
1030
  verticalAlign: verticalAlign,
1016
- style: style
1017
- }, [/*#__PURE__*/React.createElement(ScreenElement, {
1018
- key: "title",
1019
- placeholder: "title",
1020
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
1021
- id: "BSTWf8",
1022
- defaultMessage: [{
1023
- "type": 0,
1024
- "value": "Title"
1025
- }]
1026
- }),
1027
- emptyClassName: styles.emptyTitle,
1028
- isEmpty: !hasTitle
1029
- }, hasTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({}, title, {
1030
- className: styles.title
1031
- })) : null), /*#__PURE__*/React.createElement(ScreenElement, {
1032
- key: "description",
1033
- placeholder: "text",
1034
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
1035
- id: "hoDz0O",
1036
- defaultMessage: [{
1037
- "type": 0,
1038
- "value": "Description"
1039
- }]
1040
- }),
1041
- emptyClassName: styles.emptyDescription,
1042
- isEmpty: !hasDescription
1043
- }, hasDescription ? /*#__PURE__*/React.createElement(Text, Object.assign({}, description, {
1044
- className: styles.description
1045
- })) : null), isSplitted ? /*#__PURE__*/React.createElement(Spacer, {
1046
- key: "spacer"
1047
- }) : null, /*#__PURE__*/React.createElement(ScreenElement, {
1048
- key: "button",
1049
- placeholder: "button"
1050
- }, /*#__PURE__*/React.createElement(Button$1, {
1051
- disabled: buttonDisabled,
1052
- focusable: focusable,
1053
- buttonStyle: button !== null ? button.buttonStyle : null,
1054
- className: styles.button,
1055
- onClick: onClickButton
1056
- }, hasButton ? /*#__PURE__*/React.createElement(Text, Object.assign({}, button, {
1057
- className: styles.label
1058
- })) : /*#__PURE__*/React.createElement(FormattedMessage, {
1059
- id: "D7LIZQ",
1060
- defaultMessage: [{
1061
- "type": 0,
1062
- "value": "Start"
1063
- }]
1064
- })))]);
1031
+ style: style,
1032
+ children: [/*#__PURE__*/jsx(ScreenElement, {
1033
+ placeholder: "title",
1034
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
1035
+ id: "BSTWf8",
1036
+ defaultMessage: [{
1037
+ "type": 0,
1038
+ "value": "Title"
1039
+ }]
1040
+ }),
1041
+ emptyClassName: styles.emptyTitle,
1042
+ isEmpty: !hasTitle,
1043
+ children: hasTitle ? /*#__PURE__*/jsx(Heading, _objectSpread(_objectSpread({}, title), {}, {
1044
+ className: styles.title
1045
+ })) : null
1046
+ }, "title"), /*#__PURE__*/jsx(ScreenElement, {
1047
+ placeholder: "text",
1048
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
1049
+ id: "hoDz0O",
1050
+ defaultMessage: [{
1051
+ "type": 0,
1052
+ "value": "Description"
1053
+ }]
1054
+ }),
1055
+ emptyClassName: styles.emptyDescription,
1056
+ isEmpty: !hasDescription,
1057
+ children: hasDescription ? /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({}, description), {}, {
1058
+ className: styles.description
1059
+ })) : null
1060
+ }, "description"), isSplitted ? /*#__PURE__*/jsx(Spacer, {}, "spacer") : null, /*#__PURE__*/jsx(ScreenElement, {
1061
+ placeholder: "button",
1062
+ children: /*#__PURE__*/jsx(Button$1, {
1063
+ disabled: buttonDisabled,
1064
+ focusable: focusable,
1065
+ buttonStyle: button !== null ? button.buttonStyle : null,
1066
+ className: styles.button,
1067
+ onClick: onClickButton,
1068
+ children: hasButton ? /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({}, button), {}, {
1069
+ className: styles.label
1070
+ })) : /*#__PURE__*/jsx(FormattedMessage, {
1071
+ id: "D7LIZQ",
1072
+ defaultMessage: [{
1073
+ "type": 0,
1074
+ "value": "Start"
1075
+ }]
1076
+ })
1077
+ })
1078
+ }, "button")]
1079
+ });
1065
1080
  }
1066
1081
 
1067
1082
  function QuizMultipleScreen(_ref) {
@@ -1436,7 +1451,7 @@ function QuizMultipleScreen(_ref) {
1436
1451
  if (isIntro) {
1437
1452
  contentItems.push({
1438
1453
  key: 'intro',
1439
- element: /*#__PURE__*/React.createElement(Title, {
1454
+ element: /*#__PURE__*/jsx(Title, {
1440
1455
  title: title,
1441
1456
  description: description,
1442
1457
  layout: introLayout || layout,
@@ -1461,7 +1476,7 @@ function QuizMultipleScreen(_ref) {
1461
1476
  if (isQuestion) {
1462
1477
  contentItems.push({
1463
1478
  key: "question-".concat(questionIndex),
1464
- element: /*#__PURE__*/React.createElement(Question, {
1479
+ element: /*#__PURE__*/jsx(Question, {
1465
1480
  index: questionIndex,
1466
1481
  totalCount: (questions || []).length,
1467
1482
  question: text,
@@ -1504,36 +1519,39 @@ function QuizMultipleScreen(_ref) {
1504
1519
  if (hasResult && currentAnsweredIndex !== null) {
1505
1520
  contentItems.push({
1506
1521
  key: 'next',
1507
- element: /*#__PURE__*/React.createElement("div", {
1522
+ element: /*#__PURE__*/jsx("div", {
1508
1523
  className: styles$2.next,
1509
1524
  style: !isPlaceholder ? {
1510
1525
  padding: spacing,
1511
1526
  paddingTop: (current && !isPreview ? viewerTopHeight : 0) + (headerHeight || spacing),
1512
1527
  paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (callToActionHeight || spacing)
1513
- } : null
1514
- }, /*#__PURE__*/React.createElement(Button$1, {
1515
- disabled: currentAnsweredIndex === null,
1516
- focusable: true,
1517
- buttonStyle: nextButton !== null ? nextButton.buttonStyle : null,
1518
- className: styles$2.nextButton,
1519
- onClick: onNextSlide
1520
- }, hasButtonText ? /*#__PURE__*/React.createElement(Text, Object.assign({}, nextButton, {
1521
- className: styles$2.label
1522
- })) : /*#__PURE__*/React.createElement("span", {
1523
- className: styles$2.label
1524
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
1525
- id: "SVLGTA",
1526
- defaultMessage: [{
1527
- "type": 0,
1528
- "value": "Next"
1529
- }]
1530
- }))))
1528
+ } : null,
1529
+ children: /*#__PURE__*/jsx(Button$1, {
1530
+ disabled: currentAnsweredIndex === null,
1531
+ focusable: true,
1532
+ buttonStyle: nextButton !== null ? nextButton.buttonStyle : null,
1533
+ className: styles$2.nextButton,
1534
+ onClick: onNextSlide,
1535
+ children: hasButtonText ? /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({}, nextButton), {}, {
1536
+ className: styles$2.label
1537
+ })) : /*#__PURE__*/jsx("span", {
1538
+ className: styles$2.label,
1539
+ children: /*#__PURE__*/jsx(FormattedMessage, {
1540
+ id: "SVLGTA",
1541
+ defaultMessage: [{
1542
+ "type": 0,
1543
+ "value": "Next"
1544
+ }]
1545
+ })
1546
+ })
1547
+ })
1548
+ })
1531
1549
  });
1532
1550
  }
1533
1551
  if (isResults) {
1534
1552
  contentItems.push({
1535
1553
  key: 'results',
1536
- element: /*#__PURE__*/React.createElement(Results, Object.assign({}, currentResult, {
1554
+ element: /*#__PURE__*/jsx(Results, _objectSpread(_objectSpread({}, currentResult), {}, {
1537
1555
  resultsHeadingStyle: resultsHeadingStyle,
1538
1556
  resultsTextStyle: resultsTextStyle,
1539
1557
  layout: resultLayout || layout,
@@ -1606,105 +1624,114 @@ function QuizMultipleScreen(_ref) {
1606
1624
  easing: easings.easeInOutSine
1607
1625
  }
1608
1626
  });
1609
- return /*#__PURE__*/React.createElement("div", {
1627
+ return /*#__PURE__*/jsxs("div", {
1610
1628
  className: classNames([styles$2.container, className]),
1611
- "data-screen-ready": true
1612
- }, /*#__PURE__*/React.createElement(Container, {
1613
- width: width,
1614
- height: height,
1615
- className: styles$2.content
1616
- }, showPoints && currentPoints !== null && currentPoints > 0 ? /*#__PURE__*/React.createElement("div", {
1617
- className: styles$2.points
1618
- }, "".concat(currentPoints, " "), /*#__PURE__*/React.createElement(FormattedMessage, {
1619
- id: "Xr1v8l",
1620
- defaultMessage: [{
1621
- "type": 0,
1622
- "value": "points gained"
1623
- }]
1624
- })) : null, showReset ? /*#__PURE__*/React.createElement(Button$1, {
1625
- className: styles$2.reset,
1626
- icon: /*#__PURE__*/React.createElement(FontAwesomeIcon, {
1627
- icon: faRedo,
1628
- size: "md"
1629
- }),
1630
- onClick: onQuizReset
1631
- }) : null, !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
1632
- className: classNames([styles$2.header, _defineProperty({}, styles$2.disabled, scrolledBottom && !scrollingDisabled && hasScroll)]),
1633
- ref: headerRef,
1634
- style: {
1635
- paddingTop: spacing / 2,
1636
- paddingLeft: spacing,
1637
- paddingRight: spacing,
1638
- paddingBottom: spacing,
1639
- transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
1640
- }
1641
- }, /*#__PURE__*/React.createElement(Header, header)) : null, /*#__PURE__*/React.createElement(Scroll, {
1642
- verticalAlign: verticalAlign,
1643
- disabled: scrollingDisabled,
1644
- onScrolledTrigger: onScrolledTrigger,
1645
- onScrolledBottom: onScrolledBottom,
1646
- onScrolledNotBottom: onScrolledNotBottom,
1647
- onScrollHeightChange: onScrollHeightChange,
1648
- withShadow: true
1649
- }, /*#__PURE__*/React.createElement("div", {
1650
- style: {
1651
- position: 'absolute',
1652
- inset: '0'
1653
- }
1654
- }, contentTransitions(function (springStyle, item) {
1655
- var isActive = contentItems.some(function (ci) {
1656
- return ci.key === item.key;
1657
- });
1658
- return /*#__PURE__*/React.createElement(animated.div, {
1659
- style: _objectSpread(_objectSpread({}, springStyle), !isActive ? {
1660
- position: 'absolute',
1661
- top: 0,
1662
- left: 0,
1663
- width: '100%',
1664
- minHeight: '100%',
1665
- zIndex: 0
1666
- } : {
1667
- position: 'relative',
1668
- zIndex: 1,
1669
- top: 0,
1670
- left: 0,
1671
- width: '100%',
1672
- minHeight: hasResult && currentAnsweredIndex !== null ? 0 : '100%'
1673
- })
1674
- }, item.element);
1675
- }))), !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
1676
- ref: footerRef,
1677
- className: classNames([styles$2.footer, _defineProperty({}, styles$2.disabled, !scrolledBottom)]),
1678
- style: {
1679
- paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
1680
- paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
1681
- paddingTop: spacing / 2,
1682
- paddingBottom: spacing / 2,
1683
- transform: !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null
1684
- }
1685
- }, /*#__PURE__*/React.createElement(Footer, footerProps)) : null), !isPlaceholder ? bgTransitions(function (springStyle, item) {
1686
- return /*#__PURE__*/React.createElement(animated.div, {
1687
- style: _objectSpread(_objectSpread({}, springStyle), {}, {
1688
- position: 'absolute',
1689
- top: 0,
1690
- left: 0,
1691
- width: '100%',
1692
- height: '100%',
1693
- zIndex: item.key === bgItem.key ? 1 : 0
1694
- })
1695
- }, /*#__PURE__*/React.createElement(Background, {
1696
- background: item.background,
1629
+ "data-screen-ready": true,
1630
+ children: [/*#__PURE__*/jsxs(Container, {
1697
1631
  width: width,
1698
1632
  height: height,
1699
- resolution: resolution,
1700
- playing: item.key === bgItem.key && backgroundPlaying,
1701
- muted: muted,
1702
- shouldLoad: backgroundShouldLoad,
1703
- mediaRef: item.key === bgItem.key ? mediaRef : null,
1704
- className: styles$2.background,
1705
- withoutVideo: isPreview
1706
- }));
1707
- }) : null);
1633
+ className: styles$2.content,
1634
+ children: [showPoints && currentPoints !== null && currentPoints > 0 ? /*#__PURE__*/jsxs("div", {
1635
+ className: styles$2.points,
1636
+ children: ["".concat(currentPoints, " "), /*#__PURE__*/jsx(FormattedMessage, {
1637
+ id: "Xr1v8l",
1638
+ defaultMessage: [{
1639
+ "type": 0,
1640
+ "value": "points gained"
1641
+ }]
1642
+ })]
1643
+ }) : null, showReset ? /*#__PURE__*/jsx(Button$1, {
1644
+ className: styles$2.reset,
1645
+ icon: /*#__PURE__*/jsx(FontAwesomeIcon, {
1646
+ icon: faRedo,
1647
+ size: "md"
1648
+ }),
1649
+ onClick: onQuizReset
1650
+ }) : null, !isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
1651
+ className: classNames([styles$2.header, _defineProperty({}, styles$2.disabled, scrolledBottom && !scrollingDisabled && hasScroll)]),
1652
+ ref: headerRef,
1653
+ style: {
1654
+ paddingTop: spacing / 2,
1655
+ paddingLeft: spacing,
1656
+ paddingRight: spacing,
1657
+ paddingBottom: spacing,
1658
+ transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
1659
+ },
1660
+ children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
1661
+ }) : null, /*#__PURE__*/jsx(Scroll, {
1662
+ verticalAlign: verticalAlign,
1663
+ disabled: scrollingDisabled,
1664
+ onScrolledTrigger: onScrolledTrigger,
1665
+ onScrolledBottom: onScrolledBottom,
1666
+ onScrolledNotBottom: onScrolledNotBottom,
1667
+ onScrollHeightChange: onScrollHeightChange,
1668
+ withShadow: true,
1669
+ children: /*#__PURE__*/jsx("div", {
1670
+ style: {
1671
+ position: 'absolute',
1672
+ inset: '0'
1673
+ },
1674
+ children: contentTransitions(function (springStyle, item) {
1675
+ var isActive = contentItems.some(function (ci) {
1676
+ return ci.key === item.key;
1677
+ });
1678
+ return /*#__PURE__*/jsx(animated.div, {
1679
+ style: _objectSpread(_objectSpread({}, springStyle), !isActive ? {
1680
+ position: 'absolute',
1681
+ top: 0,
1682
+ left: 0,
1683
+ width: '100%',
1684
+ minHeight: '100%',
1685
+ zIndex: 0
1686
+ } : {
1687
+ position: 'relative',
1688
+ zIndex: 1,
1689
+ top: 0,
1690
+ left: 0,
1691
+ width: '100%',
1692
+ minHeight: hasResult && currentAnsweredIndex !== null ? 0 : '100%'
1693
+ }),
1694
+ children: item.element
1695
+ });
1696
+ })
1697
+ })
1698
+ }), !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
1699
+ ref: footerRef,
1700
+ className: classNames([styles$2.footer, _defineProperty({}, styles$2.disabled, !scrolledBottom)]),
1701
+ style: {
1702
+ paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
1703
+ paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
1704
+ paddingTop: spacing / 2,
1705
+ paddingBottom: spacing / 2,
1706
+ transform: !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null
1707
+ },
1708
+ children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
1709
+ }) : null]
1710
+ }), !isPlaceholder ? bgTransitions(function (springStyle, item) {
1711
+ return /*#__PURE__*/jsx(animated.div, {
1712
+ style: _objectSpread(_objectSpread({}, springStyle), {}, {
1713
+ position: 'absolute',
1714
+ top: 0,
1715
+ left: 0,
1716
+ width: '100%',
1717
+ height: '100%',
1718
+ zIndex: item.key === bgItem.key ? 1 : 0
1719
+ }),
1720
+ children: /*#__PURE__*/jsx(Background, {
1721
+ background: item.background,
1722
+ width: width,
1723
+ height: height,
1724
+ resolution: resolution,
1725
+ playing: item.key === bgItem.key && backgroundPlaying,
1726
+ muted: muted,
1727
+ shouldLoad: backgroundShouldLoad,
1728
+ mediaRef: item.key === bgItem.key ? mediaRef : null,
1729
+ className: styles$2.background,
1730
+ withoutVideo: isPreview
1731
+ })
1732
+ });
1733
+ }) : null]
1734
+ });
1708
1735
  }
1709
1736
 
1710
1737
  var definition = [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-quiz",
3
- "version": "0.4.49",
3
+ "version": "0.4.50",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -64,20 +64,20 @@
64
64
  "@fortawesome/fontawesome-svg-core": "^7.2.0",
65
65
  "@fortawesome/free-solid-svg-icons": "^7.2.0",
66
66
  "@fortawesome/react-fontawesome": "^3.2.0",
67
- "@micromag/core": "^0.4.49",
68
- "@micromag/data": "^0.4.49",
69
- "@micromag/element-background": "^0.4.49",
70
- "@micromag/element-button": "^0.4.49",
71
- "@micromag/element-container": "^0.4.49",
72
- "@micromag/element-footer": "^0.4.49",
73
- "@micromag/element-header": "^0.4.49",
74
- "@micromag/element-heading": "^0.4.49",
75
- "@micromag/element-keypad": "^0.4.49",
76
- "@micromag/element-layout": "^0.4.49",
77
- "@micromag/element-scroll": "^0.4.49",
78
- "@micromag/element-text": "^0.4.49",
79
- "@micromag/element-visual": "^0.4.49",
80
- "@micromag/transforms": "^0.4.49",
67
+ "@micromag/core": "^0.4.50",
68
+ "@micromag/data": "^0.4.50",
69
+ "@micromag/element-background": "^0.4.50",
70
+ "@micromag/element-button": "^0.4.50",
71
+ "@micromag/element-container": "^0.4.50",
72
+ "@micromag/element-footer": "^0.4.50",
73
+ "@micromag/element-header": "^0.4.50",
74
+ "@micromag/element-heading": "^0.4.50",
75
+ "@micromag/element-keypad": "^0.4.50",
76
+ "@micromag/element-layout": "^0.4.50",
77
+ "@micromag/element-scroll": "^0.4.50",
78
+ "@micromag/element-text": "^0.4.50",
79
+ "@micromag/element-visual": "^0.4.50",
80
+ "@micromag/transforms": "^0.4.50",
81
81
  "@react-spring/core": "^10.0.3",
82
82
  "@react-spring/web": "^10.0.3",
83
83
  "classnames": "^2.2.6",
@@ -89,6 +89,6 @@
89
89
  "access": "public",
90
90
  "registry": "https://registry.npmjs.org/"
91
91
  },
92
- "gitHead": "0a225ff29387217cccb0fcc5a731e23c74bd202e",
92
+ "gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
93
93
  "types": "es/index.d.ts"
94
94
  }