@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.
- package/es/index.js +481 -454
- 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
|
|
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__*/
|
|
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
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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__*/
|
|
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
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
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__*/
|
|
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
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
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__*/
|
|
818
|
+
return /*#__PURE__*/jsxs("div", {
|
|
808
819
|
className: classNames([styles$2.container, className, _defineProperty({}, styles$2.disabled, clickDisabled)]),
|
|
809
|
-
"data-screen-ready": true
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
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__*/
|
|
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
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
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__*/
|
|
1027
|
+
return /*#__PURE__*/jsx(Layout, {
|
|
1013
1028
|
className: classNames([styles.container, className]),
|
|
1014
1029
|
fullscreen: true,
|
|
1015
1030
|
verticalAlign: verticalAlign,
|
|
1016
|
-
style: style
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
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__*/
|
|
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__*/
|
|
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__*/
|
|
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
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
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__*/
|
|
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__*/
|
|
1627
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1610
1628
|
className: classNames([styles$2.container, className]),
|
|
1611
|
-
"data-screen-ready": true
|
|
1612
|
-
|
|
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
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
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.
|
|
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.
|
|
68
|
-
"@micromag/data": "^0.4.
|
|
69
|
-
"@micromag/element-background": "^0.4.
|
|
70
|
-
"@micromag/element-button": "^0.4.
|
|
71
|
-
"@micromag/element-container": "^0.4.
|
|
72
|
-
"@micromag/element-footer": "^0.4.
|
|
73
|
-
"@micromag/element-header": "^0.4.
|
|
74
|
-
"@micromag/element-heading": "^0.4.
|
|
75
|
-
"@micromag/element-keypad": "^0.4.
|
|
76
|
-
"@micromag/element-layout": "^0.4.
|
|
77
|
-
"@micromag/element-scroll": "^0.4.
|
|
78
|
-
"@micromag/element-text": "^0.4.
|
|
79
|
-
"@micromag/element-visual": "^0.4.
|
|
80
|
-
"@micromag/transforms": "^0.4.
|
|
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": "
|
|
92
|
+
"gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
|
|
93
93
|
"types": "es/index.d.ts"
|
|
94
94
|
}
|