@coorpacademy/components 10.22.24 → 10.22.25

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 (91) hide show
  1. package/es/atom/choice/index.native.js +4 -4
  2. package/es/atom/choice/index.native.js.map +1 -1
  3. package/es/atom/select-modal/index.native.js +1 -1
  4. package/es/atom/select-modal/index.native.js.map +1 -1
  5. package/es/hoc/modal/select/index.native.js.map +1 -1
  6. package/es/molecule/answer/index.native.js +85 -0
  7. package/es/molecule/answer/index.native.js.map +1 -0
  8. package/es/molecule/answer/prop-types.js +22 -3
  9. package/es/molecule/answer/prop-types.js.map +1 -1
  10. package/es/molecule/questions/mobile/draggable/index.native.js +8 -29
  11. package/es/molecule/questions/mobile/draggable/index.native.js.map +1 -1
  12. package/es/molecule/questions/mobile/switch/index.native.js +57 -54
  13. package/es/molecule/questions/mobile/switch/index.native.js.map +1 -1
  14. package/es/molecule/questions/mobile/template/index.native.js +18 -23
  15. package/es/molecule/questions/mobile/template/index.native.js.map +1 -1
  16. package/es/molecule/questions/types.js +2 -0
  17. package/{lib/types/styles.d.js.map → es/molecule/questions/types.js.map} +1 -1
  18. package/es/organism/review-congrats/index.js +3 -1
  19. package/es/organism/review-congrats/index.js.map +1 -1
  20. package/es/organism/review-congrats/style.css +5 -0
  21. package/es/organism/review-slide/index.js +7 -11
  22. package/es/organism/review-slide/index.js.map +1 -1
  23. package/es/organism/review-slide/index.native.js +213 -0
  24. package/es/organism/review-slide/index.native.js.map +1 -0
  25. package/es/organism/review-slide/prop-types.js +4 -3
  26. package/es/organism/review-slide/prop-types.js.map +1 -1
  27. package/es/organism/review-slide/style.css +4 -0
  28. package/es/organism/review-stacked-slides/index.native.js +34 -0
  29. package/es/organism/review-stacked-slides/index.native.js.map +1 -0
  30. package/es/organism/review-stacked-slides/prop-types.js +3 -2
  31. package/es/organism/review-stacked-slides/prop-types.js.map +1 -1
  32. package/es/template/app-review/player/index.native.js +33 -230
  33. package/es/template/app-review/player/index.native.js.map +1 -1
  34. package/es/template/app-review/player/prop-types.js.map +1 -1
  35. package/es/template/app-review/player/style.css +7 -0
  36. package/es/template/app-review/template-context.js +3 -1
  37. package/es/template/app-review/template-context.js.map +1 -1
  38. package/es/types/styles.js +2 -0
  39. package/es/types/{styles.d.js.map → styles.js.map} +1 -1
  40. package/lib/atom/choice/index.native.js +4 -4
  41. package/lib/atom/choice/index.native.js.map +1 -1
  42. package/lib/atom/select-modal/index.native.js +1 -1
  43. package/lib/atom/select-modal/index.native.js.map +1 -1
  44. package/lib/hoc/modal/select/index.native.js.map +1 -1
  45. package/lib/molecule/answer/index.native.js +94 -0
  46. package/lib/molecule/answer/index.native.js.map +1 -0
  47. package/lib/molecule/answer/prop-types.js +25 -3
  48. package/lib/molecule/answer/prop-types.js.map +1 -1
  49. package/lib/molecule/questions/mobile/draggable/index.native.js +8 -31
  50. package/lib/molecule/questions/mobile/draggable/index.native.js.map +1 -1
  51. package/lib/molecule/questions/mobile/switch/index.native.js +64 -62
  52. package/lib/molecule/questions/mobile/switch/index.native.js.map +1 -1
  53. package/lib/molecule/questions/mobile/template/index.native.js +18 -23
  54. package/lib/molecule/questions/mobile/template/index.native.js.map +1 -1
  55. package/lib/molecule/questions/types.js +2 -0
  56. package/lib/{types/app-review.d.js.map → molecule/questions/types.js.map} +1 -1
  57. package/lib/organism/review-congrats/index.js +3 -1
  58. package/lib/organism/review-congrats/index.js.map +1 -1
  59. package/lib/organism/review-congrats/style.css +5 -0
  60. package/lib/organism/review-slide/index.js +7 -11
  61. package/lib/organism/review-slide/index.js.map +1 -1
  62. package/lib/organism/review-slide/index.native.js +232 -0
  63. package/lib/organism/review-slide/index.native.js.map +1 -0
  64. package/lib/organism/review-slide/prop-types.js +6 -5
  65. package/lib/organism/review-slide/prop-types.js.map +1 -1
  66. package/lib/organism/review-slide/style.css +4 -0
  67. package/lib/organism/review-stacked-slides/index.native.js +47 -0
  68. package/lib/organism/review-stacked-slides/index.native.js.map +1 -0
  69. package/lib/organism/review-stacked-slides/prop-types.js +3 -2
  70. package/lib/organism/review-stacked-slides/prop-types.js.map +1 -1
  71. package/lib/template/app-review/player/index.native.js +36 -233
  72. package/lib/template/app-review/player/index.native.js.map +1 -1
  73. package/lib/template/app-review/player/prop-types.js.map +1 -1
  74. package/lib/template/app-review/player/style.css +7 -0
  75. package/lib/template/app-review/template-context.js +3 -1
  76. package/lib/template/app-review/template-context.js.map +1 -1
  77. package/lib/types/styles.js +2 -0
  78. package/{es/types/app-review.d.js.map → lib/types/styles.js.map} +1 -1
  79. package/package.json +2 -2
  80. package/es/molecule/questions/qcm/index.native.js +0 -50
  81. package/es/molecule/questions/qcm/index.native.js.map +0 -1
  82. package/es/types/app-review.d.js +0 -2
  83. package/es/types/progression-engine.d.js +0 -2
  84. package/es/types/progression-engine.d.js.map +0 -1
  85. package/es/types/styles.d.js +0 -2
  86. package/lib/molecule/questions/qcm/index.native.js +0 -62
  87. package/lib/molecule/questions/qcm/index.native.js.map +0 -1
  88. package/lib/types/app-review.d.js +0 -2
  89. package/lib/types/progression-engine.d.js +0 -2
  90. package/lib/types/progression-engine.d.js.map +0 -1
  91. package/lib/types/styles.d.js +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/organism/review-slide/index.native.tsx"],"names":["CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","klf","information","label","message","next","_correctionPopinProps","onClick","console","log","type","resultLabel","createQuestionStyle","theme","brandTheme","StyleSheet","create","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","width","validateButton","backgroundColor","borderRadius","validateButtonText","white","Question","props","answerUI","style","setStyle","questionStyle","creatSlideStyle","num","screenWidth","screenHeight","slideWidth","slideHeight","slide","position","top","left","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","slideSty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P;AAoBD,CAxBD;;AA0BA,MAAM2B,KAAK,GAAIvB,KAAD,IAAkB;AAC9B,QAAM;AAACW,IAAAA,KAAD;AAAQjB,IAAAA,cAAR;AAAwB3C,IAAAA,oBAAxB;AAA8CuD,IAAAA,GAA9C;AAAmDtD,IAAAA,UAAU,GAAG;AAAhE,MAAuEgD,KAA7E;AAEA,QAAM;AAACP,IAAAA,KAAD;AAAQsB,IAAAA;AAAR,MAAkB,uCAAxB;AACA,QAAMS,UAAU,GAAGnB,eAAe,CAACC,GAAD,EAAMb,KAAN,EAAasB,MAAb,CAAlC;AAEA,QAAM;AACJU,IAAAA,OADI;AAEJC,IAAAA,kBAFI;AAGJxC,IAAAA,YAHI;AAIJe,IAAAA,QAJI;AAKJhD,IAAAA,mBALI;AAMJC,IAAAA;AANI,MAOFyD,KAPJ;AASA,sBACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEa,UAAU,CAACb;AAAxB,KACGc,OAAO;AAAA;AACN;AACA,+BAAC,cAAD,yBAAoBnB,GAApB,CAFM,GAIN,cACE,6BAAC,QAAD;AACE,IAAA,cAAc,EAAEoB,kBADlB;AAEE,IAAA,YAAY,EAAExC,YAFhB;AAGE,IAAA,QAAQ,EAAEe,QAHZ;AAIE,IAAA,GAAG,EAAC;AAJN,IADF,eAOE,6BAAC,eAAD;AACE,IAAA,oBAAoB,EAAElD,oBADxB;AAEE,IAAA,UAAU,EAAEC,UAFd;AAGE,IAAA,mBAAmB,EAAEC,mBAHvB;AAIE,IAAA,sBAAsB,EAAEC,sBAJ1B;AAKE,IAAA,GAAG,EAAC;AALN,IAPF,CALJ,CADF;AAwBD,CAvCD;;eAyCeqE,K","sourcesContent":["import React, {useEffect, useMemo, useState} from 'react';\nimport {StyleSheet, useWindowDimensions, View} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\n// import Loader from '../../atom/loader';\n// import ReviewCorrectionPopin from '../../molecule/review-correction-popin';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Props, SlideProps} from './prop-types';\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}) => {\n if (!showCorrectionPopin) return null;\n\n const klf = getOr({}, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick: () => {\n // eslint-disable-next-line no-console\n console.log('Next Slide');\n },\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n return (\n <Text>ReviewCorrectionPopin</Text>\n // <ReviewCorrectionPopin {..._correctionPopinProps} />\n );\n};\n\n// const ValidateButton = ({slideIndex, validateButton, primarySkinColor}) => {\n// const {label, onClick, disabled} = validateButton;\n// const validateButtonProps = {\n// type: 'primary',\n// label,\n// 'aria-label': label,\n// 'data-name': `slide-validate-button-${slideIndex}`,\n// onClick,\n// disabled,\n// customStyle: {\n// backgroundColor: primarySkinColor\n// }\n// };\n\n// return <Button title=\"validate todo\" />;\n// };\n\nconst createQuestionStyle = (theme: Theme, brandTheme: any) =>\n StyleSheet.create({\n questionHeading: {\n // backgroundColor: '#f00', // flex-debug\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n // backgroundColor: '#38295b', // flex-debug\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n // backgroundColor: '#ff0', // flex-debug\n justifyContent: 'center'\n },\n validateButton: {\n backgroundColor: brandTheme?.colors.primary || theme.colors.text.primary,\n borderRadius: 7,\n width: '100%'\n },\n validateButtonText: {\n fontSize: 14,\n lineHeight: 20,\n fontWeight: '700',\n color: theme.colors.white,\n marginBottom: 16,\n marginTop: 16,\n textAlign: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme, brandTheme} = useTemplateContext();\n const [style, setStyle] = useState<any | null>(null);\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme, brandTheme);\n setStyle(questionStyle);\n }, [theme, brandTheme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n <Touchable style={style.validateButton}>\n <Text style={style.validateButtonText}>@todo validate</Text>\n </Touchable>\n </>\n );\n};\n\nconst creatSlideStyle = (num: number, screenWidth: number, screenHeight: number) => {\n const slideWidth = screenWidth - 40 - num * 8;\n const slideHeight = screenHeight * 0.75;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n top: num * -5,\n left: -slideWidth / 2,\n flex: 1,\n backgroundColor: '#fff', // theme.colors.white\n height: slideHeight,\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: Props) => {\n const {slide, validateButton, correctionPopinProps, num, slideIndex = '0'} = props;\n\n const {width, height} = useWindowDimensions();\n const slideStyle = creatSlideStyle(num, width, height);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <View style={slideStyle.slide}>\n {loading ? (\n // <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n <Text>@todo loader {num}</Text>\n ) : (\n [\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />,\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ]\n )}\n </View>\n );\n};\n\nexport default Slide;\n"],"file":"index.native.js"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.default = exports.SlideProp = void 0;
4
+ exports.default = exports.SlidePropsTypes = void 0;
5
5
 
6
6
  var _propTypes = _interopRequireDefault(require("prop-types"));
7
7
 
@@ -11,7 +11,7 @@ var _propTypes3 = _interopRequireDefault(require("../../molecule/answer/prop-typ
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- const SlideProp = _propTypes.default.shape({
14
+ const SlidePropsTypes = _propTypes.default.shape({
15
15
  hidden: _propTypes.default.bool,
16
16
  position: _propTypes.default.number,
17
17
  loading: _propTypes.default.bool,
@@ -26,10 +26,10 @@ const SlideProp = _propTypes.default.shape({
26
26
  answerUI: _propTypes.default.shape(_propTypes3.default)
27
27
  });
28
28
 
29
- exports.SlideProp = SlideProp;
30
- var _default = {
29
+ exports.SlidePropsTypes = SlidePropsTypes;
30
+ const propTypes = {
31
31
  slideIndex: _propTypes.default.string,
32
- slide: SlideProp,
32
+ slide: SlidePropsTypes,
33
33
  validateButton: _propTypes.default.shape({
34
34
  label: _propTypes.default.string.isRequired,
35
35
  onClick: _propTypes.default.func.isRequired,
@@ -48,5 +48,6 @@ var _default = {
48
48
  type: _propTypes2.default.type
49
49
  })
50
50
  };
51
+ var _default = propTypes;
51
52
  exports.default = _default;
52
53
  //# sourceMappingURL=prop-types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/organism/review-slide/prop-types.js"],"names":["SlideProp","PropTypes","shape","hidden","bool","position","number","loading","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","parentContentTitle","questionText","answerUI","AnswerPropTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAEO,MAAMA,SAAS,GAAGC,mBAAUC,KAAV,CAAgB;AACvCC,EAAAA,MAAM,EAAEF,mBAAUG,IADqB;AAEvCC,EAAAA,QAAQ,EAAEJ,mBAAUK,MAFmB;AAGvCC,EAAAA,OAAO,EAAEN,mBAAUG,IAHoB;AAIvCI,EAAAA,gBAAgB,EAAEP,mBAAUQ,MAJW;AAKvCC,EAAAA,aAAa,EAAET,mBAAUQ,MALc;AAKN;AACjCE,EAAAA,SAAS,EAAEV,mBAAUG,IANkB;AAOvCQ,EAAAA,sBAAsB,EAAEX,mBAAUG,IAPK;AAQvCS,EAAAA,mBAAmB,EAAEZ,mBAAUG,IARQ;AASvCU,EAAAA,kBAAkB,EAAEb,mBAAUQ,MATS;AAUvCM,EAAAA,YAAY,EAAEd,mBAAUQ,MAVe;AAWvCO,EAAAA,QAAQ,EAAEf,mBAAUC,KAAV,CAAgBe,mBAAhB;AAX6B,CAAhB,CAAlB;;;eAcQ;AACbC,EAAAA,UAAU,EAAEjB,mBAAUQ,MADT;AAEbU,EAAAA,KAAK,EAAEnB,SAFM;AAGboB,EAAAA,cAAc,EAAEnB,mBAAUC,KAAV,CAAgB;AAC9BmB,IAAAA,KAAK,EAAEpB,mBAAUQ,MAAV,CAAiBa,UADM;AAE9BC,IAAAA,OAAO,EAAEtB,mBAAUuB,IAAV,CAAeF,UAFM;AAG9BG,IAAAA,QAAQ,EAAExB,mBAAUG;AAHU,GAAhB,CAHH;AAQbsB,EAAAA,oBAAoB,EAAEzB,mBAAUC,KAAV,CAAgB;AACpCyB,IAAAA,GAAG,EAAEC,oBAA+BD,GADA;AAEpCE,IAAAA,WAAW,EAAED,oBAA+BC,WAFR;AAGpCC,IAAAA,IAAI,EAAE7B,mBAAUC,KAAV,CAAgB;AACpBmB,MAAAA,KAAK,EAAEpB,mBAAUQ,MADG;AAEpB,oBAAcR,mBAAUQ,MAFJ,CAEW;AAC/B;;AAHoB,KAAhB,CAH8B;AAQpCsB,IAAAA,WAAW,EAAEH,oBAA+BG,WARR;AASpCC,IAAAA,IAAI,EAAEJ,oBAA+BI;AATD,GAAhB;AART,C","sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewCorrectionPopinPropTypes from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes from '../../molecule/answer/prop-types';\n\nexport const SlideProp = PropTypes.shape({\n hidden: PropTypes.bool,\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nexport default {\n slideIndex: PropTypes.string,\n slide: SlideProp,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n"],"file":"prop-types.js"}
1
+ {"version":3,"sources":["../../../src/organism/review-slide/prop-types.ts"],"names":["SlidePropsTypes","PropTypes","shape","hidden","bool","position","number","loading","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","parentContentTitle","questionText","answerUI","AnswerPropTypes","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAEO,MAAMA,eAAe,GAAGC,mBAAUC,KAAV,CAAgB;AAC7CC,EAAAA,MAAM,EAAEF,mBAAUG,IAD2B;AAE7CC,EAAAA,QAAQ,EAAEJ,mBAAUK,MAFyB;AAG7CC,EAAAA,OAAO,EAAEN,mBAAUG,IAH0B;AAI7CI,EAAAA,gBAAgB,EAAEP,mBAAUQ,MAJiB;AAK7CC,EAAAA,aAAa,EAAET,mBAAUQ,MALoB;AAKZ;AACjCE,EAAAA,SAAS,EAAEV,mBAAUG,IANwB;AAO7CQ,EAAAA,sBAAsB,EAAEX,mBAAUG,IAPW;AAQ7CS,EAAAA,mBAAmB,EAAEZ,mBAAUG,IARc;AAS7CU,EAAAA,kBAAkB,EAAEb,mBAAUQ,MATe;AAU7CM,EAAAA,YAAY,EAAEd,mBAAUQ,MAVqB;AAW7CO,EAAAA,QAAQ,EAAEf,mBAAUC,KAAV,CAAgBe,mBAAhB;AAXmC,CAAhB,CAAxB;;;AAcP,MAAMC,SAAS,GAAG;AAChBC,EAAAA,UAAU,EAAElB,mBAAUQ,MADN;AAEhBW,EAAAA,KAAK,EAAEpB,eAFS;AAGhBqB,EAAAA,cAAc,EAAEpB,mBAAUC,KAAV,CAAgB;AAC9BoB,IAAAA,KAAK,EAAErB,mBAAUQ,MAAV,CAAiBc,UADM;AAE9BC,IAAAA,OAAO,EAAEvB,mBAAUwB,IAAV,CAAeF,UAFM;AAG9BG,IAAAA,QAAQ,EAAEzB,mBAAUG;AAHU,GAAhB,CAHA;AAQhBuB,EAAAA,oBAAoB,EAAE1B,mBAAUC,KAAV,CAAgB;AACpC0B,IAAAA,GAAG,EAAEC,oBAA+BD,GADA;AAEpCE,IAAAA,WAAW,EAAED,oBAA+BC,WAFR;AAGpCC,IAAAA,IAAI,EAAE9B,mBAAUC,KAAV,CAAgB;AACpBoB,MAAAA,KAAK,EAAErB,mBAAUQ,MADG;AAEpB,oBAAcR,mBAAUQ,MAFJ,CAEW;AAC/B;;AAHoB,KAAhB,CAH8B;AAQpCuB,IAAAA,WAAW,EAAEH,oBAA+BG,WARR;AASpCC,IAAAA,IAAI,EAAEJ,oBAA+BI;AATD,GAAhB;AARN,CAAlB;eAqBef,S","sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewCorrectionPopinPropTypes from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {Props as AnswerProps} from '../../molecule/answer/prop-types';\n\nexport const SlidePropsTypes = PropTypes.shape({\n hidden: PropTypes.bool,\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type Props = PropTypes.InferProps<typeof propTypes> & {\n num: number;\n};\n\nexport type SlideProps = {\n hidden: boolean;\n position: number;\n loading: boolean;\n loadingAriaLabel: string;\n animationType: 'unstack' | 'restack';\n isCorrect: boolean;\n animateCorrectionPopin: boolean;\n showCorrectionPopin: boolean;\n parentContentTitle: string;\n questionText: string;\n answerUI: AnswerProps;\n};\n"],"file":"prop-types.js"}
@@ -138,6 +138,10 @@ _:-ms-fullscreen, :root .correctionPopinWrapper {
138
138
  width: 60px;
139
139
  }
140
140
 
141
+ .disabledSlideContent {
142
+ pointer-events: none;
143
+ }
144
+
141
145
  @media tablet {
142
146
  @keyframes popInAnimation {
143
147
  from {
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = exports.TOTAL_SLIDES_STACK = void 0;
5
+
6
+ var _react = _interopRequireDefault(require("react"));
7
+
8
+ var _reactNative = require("react-native");
9
+
10
+ var _keys = _interopRequireDefault(require("lodash/fp/keys"));
11
+
12
+ var _index = _interopRequireDefault(require("../review-slide/index.native"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+
18
+ const TOTAL_SLIDES_STACK = 5;
19
+ exports.TOTAL_SLIDES_STACK = TOTAL_SLIDES_STACK;
20
+
21
+ const StackedSlides = props => {
22
+ const {
23
+ slides = {},
24
+ endReview,
25
+ validateButton,
26
+ correctionPopinProps
27
+ } = props;
28
+ const indexes = (0, _keys.default)(slides).reverse();
29
+ const stackedSlides = indexes.map(slideIndex => {
30
+ const slide = slides[slideIndex]; // const {animationType, hidden, position} = slide;
31
+
32
+ return /*#__PURE__*/_react.default.createElement(_index.default, _extends({
33
+ num: Number.parseInt(slideIndex),
34
+ slideIndex,
35
+ slide,
36
+ validateButton,
37
+ correctionPopinProps
38
+ }, {
39
+ key: slideIndex
40
+ }));
41
+ });
42
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, null, stackedSlides);
43
+ };
44
+
45
+ var _default = StackedSlides;
46
+ exports.default = _default;
47
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":["TOTAL_SLIDES_STACK","StackedSlides","props","slides","endReview","validateButton","correctionPopinProps","indexes","reverse","stackedSlides","map","slideIndex","slide","num","Number","parseInt"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAGO,MAAMA,kBAAkB,GAAG,CAA3B;;;AAEP,MAAMC,aAAa,GAAIC,KAAD,IAAkB;AACtC,QAAM;AAACC,IAAAA,MAAM,GAAG,EAAV;AAAcC,IAAAA,SAAd;AAAyBC,IAAAA,cAAzB;AAAyCC,IAAAA;AAAzC,MAAiEJ,KAAvE;AAEA,QAAMK,OAAO,GAAG,mBAAKJ,MAAL,EAAaK,OAAb,EAAhB;AACA,QAAMC,aAAa,GAAGF,OAAO,CAACG,GAAR,CAAYC,UAAU,IAAI;AAC9C,UAAMC,KAAK,GAAGT,MAAM,CAACQ,UAAD,CAApB,CAD8C,CAE9C;;AAEA,wBACE,6BAAC,cAAD,WACM;AACFE,MAAAA,GAAG,EAAEC,MAAM,CAACC,QAAP,CAAgBJ,UAAhB,CADH;AAEFA,MAAAA,UAFE;AAGFC,MAAAA,KAHE;AAIFP,MAAAA,cAJE;AAKFC,MAAAA;AALE,KADN;AAQE,MAAA,GAAG,EAAEK;AARP,OADF;AAYD,GAhBqB,CAAtB;AAkBA,sBAAO,6BAAC,iBAAD,QAAOF,aAAP,CAAP;AACD,CAvBD;;eAyBeR,a","sourcesContent":["import React from 'react';\nimport {View} from 'react-native';\nimport keys from 'lodash/fp/keys';\nimport Slide from '../review-slide/index.native';\nimport {Props} from './prop-types';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst StackedSlides = (props: Props) => {\n const {slides = {}, endReview, validateButton, correctionPopinProps} = props;\n\n const indexes = keys(slides).reverse();\n const stackedSlides = indexes.map(slideIndex => {\n const slide = slides[slideIndex];\n // const {animationType, hidden, position} = slide;\n\n return (\n <Slide\n {...{\n num: Number.parseInt(slideIndex),\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n return <View>{stackedSlides}</View>;\n};\n\nexport default StackedSlides;\n"],"file":"index.native.js"}
@@ -13,7 +13,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- var _default = {
16
+ const propTypes = {
17
17
  validateButton: _propTypes2.default.validateButton,
18
18
  correctionPopinProps: _propTypes2.default.correctionPopinProps,
19
19
  slides: _propTypes.default.shape({
@@ -22,8 +22,9 @@ var _default = {
22
22
  '2': _propTypes2.SlideProp,
23
23
  '3': _propTypes2.SlideProp,
24
24
  '4': _propTypes2.SlideProp
25
- }),
25
+ }).isRequired,
26
26
  endReview: _propTypes.default.bool
27
27
  };
28
+ var _default = propTypes;
28
29
  exports.default = _default;
29
30
  //# sourceMappingURL=prop-types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/organism/review-stacked-slides/prop-types.js"],"names":["validateButton","ReviewSlideProps","correctionPopinProps","slides","PropTypes","shape","SlideProp","endReview","bool"],"mappings":";;;;;AAAA;;AACA;;;;;;;;eAEe;AACbA,EAAAA,cAAc,EAAEC,oBAAiBD,cADpB;AAEbE,EAAAA,oBAAoB,EAAED,oBAAiBC,oBAF1B;AAGbC,EAAAA,MAAM,EAAEC,mBAAUC,KAAV,CAAgB;AACtB,SAAKC,qBADiB;AAEtB,SAAKA,qBAFiB;AAGtB,SAAKA,qBAHiB;AAItB,SAAKA,qBAJiB;AAKtB,SAAKA;AALiB,GAAhB,CAHK;AAUbC,EAAAA,SAAS,EAAEH,mBAAUI;AAVR,C","sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewSlideProps, {SlideProp} from '../review-slide/prop-types';\n\nexport default {\n validateButton: ReviewSlideProps.validateButton,\n correctionPopinProps: ReviewSlideProps.correctionPopinProps,\n slides: PropTypes.shape({\n '0': SlideProp,\n '1': SlideProp,\n '2': SlideProp,\n '3': SlideProp,\n '4': SlideProp\n }),\n endReview: PropTypes.bool\n};\n"],"file":"prop-types.js"}
1
+ {"version":3,"sources":["../../../src/organism/review-stacked-slides/prop-types.ts"],"names":["propTypes","validateButton","ReviewSlideProps","correctionPopinProps","slides","PropTypes","shape","SlideProp","isRequired","endReview","bool"],"mappings":";;;;;AAAA;;AACA;;;;;;;;AAEA,MAAMA,SAAS,GAAG;AAChBC,EAAAA,cAAc,EAAEC,oBAAiBD,cADjB;AAEhBE,EAAAA,oBAAoB,EAAED,oBAAiBC,oBAFvB;AAGhBC,EAAAA,MAAM,EAAEC,mBAAUC,KAAV,CAAgB;AACtB,SAAKC,qBADiB;AAEtB,SAAKA,qBAFiB;AAGtB,SAAKA,qBAHiB;AAItB,SAAKA,qBAJiB;AAKtB,SAAKA;AALiB,GAAhB,EAMLC,UATa;AAUhBC,EAAAA,SAAS,EAAEJ,mBAAUK;AAVL,CAAlB;eAaeV,S","sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewSlideProps, {SlideProp} from '../review-slide/prop-types';\n\nconst propTypes = {\n validateButton: ReviewSlideProps.validateButton,\n correctionPopinProps: ReviewSlideProps.correctionPopinProps,\n slides: PropTypes.shape({\n '0': SlideProp,\n '1': SlideProp,\n '2': SlideProp,\n '3': SlideProp,\n '4': SlideProp\n }).isRequired,\n endReview: PropTypes.bool\n};\n\nexport default propTypes;\n\nexport type Props = PropTypes.InferProps<typeof propTypes>;\n"],"file":"prop-types.js"}
@@ -3,267 +3,70 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
- var _react = _interopRequireDefault(require("react"));
7
-
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
6
+ var _react = _interopRequireWildcard(require("react"));
9
7
 
10
8
  var _reactNative = require("react-native");
11
9
 
12
- var _freeText = _interopRequireDefault(require("../../../molecule/questions/free-text"));
10
+ var _index = _interopRequireDefault(require("../../../organism/review-stacked-slides/index.native"));
13
11
 
14
12
  var _templateContext = require("../template-context");
15
13
 
16
- var _propTypes2 = require("./prop-types");
17
-
18
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
15
 
20
- // import theme from '../../../modules/theme';
21
- // import translations from '../../../translations';
22
- // import {BrandThemeContext} from '../../../app-shared/components/brand-theme-provider';
23
- // import Button from '../../../app-shared/components/button';
24
- // import {HEADER_HEIGHT} from '../../../app-shared/components/header-v2';
25
- // export type _Choice_ = {
26
- // text?: string,
27
- // selected: boolean
28
- // };
29
- // export type _Slide_ = {
30
- // category: string,
31
- // question: string,
32
- // instruction: string,
33
- // type: 'multiSelection' | 'singleSelection' | 'trueOrFalse',
34
- // choices?: _Choice_[]
35
- // };
36
- // interface Props {
37
- // slide: _Slide_;
38
- // num: number;
39
- // }
40
- const quizzerStyle = _reactNative.StyleSheet.create({
41
- container: {
42
- flex: 1,
43
- padding: 20,
44
- // paddingTop: HEADER_HEIGHT + 20, @todo with props
45
- // backgroundColor: theme.colors.white, @todo with props
46
- justifyContent: 'space-between',
47
- alignItems: 'center'
48
- }
49
- });
50
-
51
- const SLIDE_HEIGHT = () => (0, _reactNative.useWindowDimensions)().height * 0.75; // const creatSlideStyle = (num: number) =>
52
-
53
-
54
- const creatSlideStyle = (num, width, height) => _reactNative.StyleSheet.create({
55
- slide: {
56
- position: 'absolute',
57
- top: height / 2 - SLIDE_HEIGHT() / 2 - num * 4,
58
- flex: 1,
59
- backgroundColor: '#fff',
60
- // backgroundColor: theme.colors.white, @todo with props and useEffect
61
- height: SLIDE_HEIGHT(),
62
- width: width - 40 - num * 8,
63
- justifyContent: 'space-between',
64
- alignItems: 'center',
65
- padding: 25,
66
- shadowColor: '#000',
67
- shadowOffset: {
68
- width: 0,
69
- height: -1
70
- },
71
- shadowOpacity: 0.05,
72
- shadowRadius: 16,
73
- elevation: 10 - num * 1,
74
- borderRadius: 16
75
- },
76
- category: {
77
- fontSize: 12,
78
- lineHeight: 16,
79
- // color: theme.colors.text.primary, @todo with props
80
- // marginBottom: theme.spacing.tiny, @todo with props
81
- // marginTop: theme.spacing.small, @todo with props
82
- textAlign: 'center'
83
- },
84
- question: {
85
- fontSize: 16,
86
- lineHeight: 22,
87
- fontWeight: '700',
88
- // color: theme.colors.text.primary, @todo with props
89
- textAlign: 'center'
90
- },
91
- instruction: {
92
- fontSize: 12,
93
- lineHeight: 16,
94
- // color: theme.colors.gray.medium, @todo with props
95
- // marginBottom: theme.spacing.base, @todo with props
96
- // marginTop: theme.spacing.small, @todo with props
97
- textAlign: 'center'
98
- },
99
- button: {
100
- width: 287,
101
- height: 52,
102
- borderRadius: 7 // marginTop: theme.spacing.base @todo with props
16
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
103
17
 
104
- }
105
- });
106
-
107
- const createOptionStyle = selected => {
108
- // const brandTheme = React.useContext(BrandThemeContext); @todo with props
109
- return _reactNative.StyleSheet.create({
110
- box: {
111
- width: '100%',
112
- // https://stackoverflow.com/a/66561995/959219
113
- shadowColor: '#000',
114
- shadowOffset: {
115
- width: 0,
116
- height: -1
117
- },
118
- shadowOpacity: 0.2,
119
- shadowRadius: 16,
120
- elevation: 8,
121
- // backgroundColor: selected ? brandTheme.colors.primary : theme.colors.white, @todo with props
122
- padding: 12,
123
- marginTop: 4,
124
- marginBottom: 4,
125
- borderRadius: 8
126
- },
127
- text: {
128
- fontSize: 15,
129
- fontWeight: 'bold',
130
- lineHeight: 24,
131
- // color: selected ? theme.colors.white : theme.colors.text.primary, @todo with props
132
- textAlign: 'center'
133
- }
134
- });
135
- };
18
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
136
19
 
137
- const choicesStyle = _reactNative.StyleSheet.create({
20
+ const createStyleSheet = (theme, headerHeight) => _reactNative.StyleSheet.create({
138
21
  container: {
139
22
  flex: 1,
140
- width: '100%',
141
- justifyContent: 'center',
23
+ paddingTop: headerHeight,
24
+ backgroundColor: theme.colors.white,
25
+ // justifyContent: 'space-between',
142
26
  alignItems: 'center'
27
+ },
28
+ header: {
29
+ width: '100%',
30
+ backgroundColor: '#ded',
31
+ height: 70
143
32
  }
144
33
  });
145
- /* {choices.map(({text, selected = false}: _Choice_) => { */
146
-
147
-
148
- const Choices = ({
149
- choices = []
150
- }) => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
151
- style: choicesStyle.container
152
- }, choices.map(({
153
- text,
154
- selected = false
155
- }, index) => {
156
- const optionStyle = createOptionStyle(selected);
157
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
158
- style: optionStyle.box,
159
- key: `choice-${index}`
160
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
161
- style: optionStyle.text
162
- }, text, " ", selected));
163
- }));
164
34
 
165
- Choices.propTypes = process.env.NODE_ENV !== "production" ? {
166
- choices: _propTypes.default.arrayOf({
167
- text: _propTypes.default.text,
168
- selected: _propTypes.default.bool
169
- })
170
- } : {};
35
+ const ReviewHeader = ({
36
+ style
37
+ }) => /*#__PURE__*/_react.default.createElement(_reactNative.View, style, /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, "review header @todo"));
171
38
 
172
- const Slide = props => {
39
+ const Slides = props => {
173
40
  const {
174
- validateSlide,
175
- slide,
176
- num
41
+ header,
42
+ stack,
43
+ reviewBackgroundAriaLabel,
44
+ congratsProps
177
45
  } = props;
178
46
  const {
179
- width,
180
- height
181
- } = (0, _reactNative.useWindowDimensions)();
182
- const slideStyle = creatSlideStyle(num, width, height);
183
- const validateLabel = '__validate'; // translations.validate
184
-
185
- const templateContext = (0, _templateContext.useTemplateContext)();
186
- const {
187
- analytics
188
- } = templateContext;
189
- const {
190
- answerUI: {
191
- isDisabled = false,
192
- value = '',
193
- model: {
194
- type,
195
- onChange
196
- }
197
- } = {
198
- isDisabled: false,
199
- value: '',
200
- model: {
201
- type: 'freeText',
202
- onChange: () => null
203
- }
47
+ theme,
48
+ display: {
49
+ headerHeight
204
50
  }
205
- } = slide;
51
+ } = (0, _templateContext.useTemplateContext)();
52
+ const [styleSheet, setStylesheet] = (0, _react.useState)(null);
53
+ (0, _react.useEffect)(() => {
54
+ const _stylesheet = createStyleSheet(theme, headerHeight);
206
55
 
207
- switch (type) {
208
- case 'freeText':
209
- {
210
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
211
- style: slideStyle.slide
212
- }, /*#__PURE__*/_react.default.createElement(_freeText.default, {
213
- isDisabled: isDisabled,
214
- onChange: onChange,
215
- value: value,
216
- testID: "free-text",
217
- questionType: "basic",
218
- analytics: analytics
219
- }));
220
- }
221
-
222
- default:
223
- }
224
-
225
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
226
- style: slideStyle.slide
227
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
228
- style: slideStyle.category
229
- }, num), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
230
- style: slideStyle.question
231
- }, slide.question), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
232
- style: slideStyle.instruction
233
- }, slide.instruction), /*#__PURE__*/_react.default.createElement(Choices, {
234
- choices: slide.choices
235
- }), /*#__PURE__*/_react.default.createElement(_reactNative.Button, {
236
- style: slideStyle.button,
237
- onPress: validateSlide,
238
- testID: `button-quizzer-validate`
239
- }, validateLabel));
240
- }; // const Slides = ({slide}: Props) => {
241
-
242
-
243
- const Slides = props => {
244
- const {
245
- stack
246
- } = props;
247
- const {
248
- slides,
249
- validateButton: validateSlide
250
- } = stack;
56
+ setStylesheet(_stylesheet);
57
+ }, [theme, headerHeight]);
251
58
 
252
- if (!slides) {
253
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, null);
59
+ if (!styleSheet) {
60
+ return null;
254
61
  }
255
62
 
256
63
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
257
- style: quizzerStyle.container
258
- }, /*#__PURE__*/_react.default.createElement(Slide, {
259
- validateSlide: validateSlide,
260
- slide: slides[0],
261
- num: 0,
262
- key: `slide-${0}`
263
- }));
64
+ style: styleSheet.container
65
+ }, /*#__PURE__*/_react.default.createElement(ReviewHeader, {
66
+ style: styleSheet.header
67
+ }), stack ? /*#__PURE__*/_react.default.createElement(_index.default, stack) : null);
264
68
  };
265
69
 
266
- Slides.propTypes = process.env.NODE_ENV !== "production" ? _propTypes2.PlayerReviewPropTypes : {};
267
70
  var _default = Slides;
268
71
  exports.default = _default;
269
72
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/template/app-review/player/index.native.tsx"],"names":["quizzerStyle","StyleSheet","create","container","flex","padding","justifyContent","alignItems","SLIDE_HEIGHT","height","creatSlideStyle","num","width","slide","position","top","backgroundColor","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","category","fontSize","lineHeight","textAlign","question","fontWeight","instruction","button","createOptionStyle","selected","box","marginTop","marginBottom","text","choicesStyle","Choices","choices","map","index","optionStyle","propTypes","PropTypes","arrayOf","bool","Slide","props","validateSlide","slideStyle","validateLabel","templateContext","analytics","answerUI","isDisabled","value","model","type","onChange","Slides","stack","slides","validateButton","PlayerReviewPropTypes"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA,MAAMA,YAAY,GAAGC,wBAAWC,MAAX,CAAkB;AACrCC,EAAAA,SAAS,EAAE;AACTC,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,OAAO,EAAE,EAFA;AAGT;AACA;AACAC,IAAAA,cAAc,EAAE,eALP;AAMTC,IAAAA,UAAU,EAAE;AANH;AAD0B,CAAlB,CAArB;;AAWA,MAAMC,YAAY,GAAG,MAAM,wCAAsBC,MAAtB,GAA+B,IAA1D,C,CAEA;;;AACA,MAAMC,eAAe,GAAG,CAACC,GAAD,EAAMC,KAAN,EAAaH,MAAb,KACtBR,wBAAWC,MAAX,CAAkB;AAChBW,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE,UADL;AAELC,IAAAA,GAAG,EAAEN,MAAM,GAAG,CAAT,GAAaD,YAAY,KAAK,CAA9B,GAAkCG,GAAG,GAAG,CAFxC;AAGLP,IAAAA,IAAI,EAAE,CAHD;AAILY,IAAAA,eAAe,EAAE,MAJZ;AAKL;AACAP,IAAAA,MAAM,EAAED,YAAY,EANf;AAOLI,IAAAA,KAAK,EAAEA,KAAK,GAAG,EAAR,GAAaD,GAAG,GAAG,CAPrB;AAQLL,IAAAA,cAAc,EAAE,eARX;AASLC,IAAAA,UAAU,EAAE,QATP;AAULF,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BqB,iCAAnB;eAEeJ,M","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {View, StyleSheet, Text, useWindowDimensions, Button} from 'react-native';\n\nimport FreeText from '../../../molecule/questions/free-text';\nimport {useTemplateContext} from '../template-context';\nimport {PlayerReviewPropTypes} from './prop-types';\n\n// import theme from '../../../modules/theme';\n// import translations from '../../../translations';\n// import {BrandThemeContext} from '../../../app-shared/components/brand-theme-provider';\n// import Button from '../../../app-shared/components/button';\n// import {HEADER_HEIGHT} from '../../../app-shared/components/header-v2';\n\n// export type _Choice_ = {\n// text?: string,\n// selected: boolean\n// };\n\n// export type _Slide_ = {\n// category: string,\n// question: string,\n// instruction: string,\n// type: 'multiSelection' | 'singleSelection' | 'trueOrFalse',\n// choices?: _Choice_[]\n// };\n\n// interface Props {\n// slide: _Slide_;\n// num: number;\n// }\n\nconst quizzerStyle = StyleSheet.create({\n container: {\n flex: 1,\n padding: 20,\n // paddingTop: HEADER_HEIGHT + 20, @todo with props\n // backgroundColor: theme.colors.white, @todo with props\n justifyContent: 'space-between',\n alignItems: 'center'\n }\n});\n\nconst SLIDE_HEIGHT = () => useWindowDimensions().height * 0.75;\n\n// const creatSlideStyle = (num: number) =>\nconst creatSlideStyle = (num, width, height) =>\n StyleSheet.create({\n slide: {\n position: 'absolute',\n top: height / 2 - SLIDE_HEIGHT() / 2 - num * 4,\n flex: 1,\n backgroundColor: '#fff',\n // backgroundColor: theme.colors.white, @todo with props and useEffect\n height: SLIDE_HEIGHT(),\n width: width - 40 - num * 8,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n },\n category: {\n fontSize: 12,\n lineHeight: 16,\n // color: theme.colors.text.primary, @todo with props\n // marginBottom: theme.spacing.tiny, @todo with props\n // marginTop: theme.spacing.small, @todo with props\n textAlign: 'center'\n },\n question: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n // color: theme.colors.text.primary, @todo with props\n textAlign: 'center'\n },\n instruction: {\n fontSize: 12,\n lineHeight: 16,\n // color: theme.colors.gray.medium, @todo with props\n // marginBottom: theme.spacing.base, @todo with props\n // marginTop: theme.spacing.small, @todo with props\n textAlign: 'center'\n },\n button: {\n width: 287,\n height: 52,\n borderRadius: 7\n // marginTop: theme.spacing.base @todo with props\n }\n });\n\nconst createOptionStyle = selected => {\n // const brandTheme = React.useContext(BrandThemeContext); @todo with props\n\n return StyleSheet.create({\n box: {\n width: '100%',\n // https://stackoverflow.com/a/66561995/959219\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.2,\n shadowRadius: 16,\n elevation: 8,\n // backgroundColor: selected ? brandTheme.colors.primary : theme.colors.white, @todo with props\n padding: 12,\n marginTop: 4,\n marginBottom: 4,\n borderRadius: 8\n },\n text: {\n fontSize: 15,\n fontWeight: 'bold',\n lineHeight: 24,\n // color: selected ? theme.colors.white : theme.colors.text.primary, @todo with props\n textAlign: 'center'\n }\n });\n};\n\nconst choicesStyle = StyleSheet.create({\n container: {\n flex: 1,\n width: '100%',\n justifyContent: 'center',\n alignItems: 'center'\n }\n});\n\n/* {choices.map(({text, selected = false}: _Choice_) => { */\nconst Choices = ({choices = []}) => (\n <View style={choicesStyle.container}>\n {choices.map(({text, selected = false}, index) => {\n const optionStyle = createOptionStyle(selected);\n return (\n <View style={optionStyle.box} key={`choice-${index}`}>\n <Text style={optionStyle.text}>\n {text} {selected}\n </Text>\n </View>\n );\n })}\n </View>\n);\n\nChoices.propTypes = {\n choices: PropTypes.arrayOf({\n text: PropTypes.text,\n selected: PropTypes.bool\n })\n};\n\nconst Slide = props => {\n const {validateSlide, slide, num} = props;\n const {width, height} = useWindowDimensions();\n\n const slideStyle = creatSlideStyle(num, width, height);\n const validateLabel = '__validate'; // translations.validate\n\n const templateContext = useTemplateContext();\n const {analytics} = templateContext;\n\n const {\n answerUI: {isDisabled = false, value = '', model: {type, onChange}} = {\n isDisabled: false,\n value: '',\n model: {type: 'freeText', onChange: () => null}\n }\n } = slide;\n\n switch (type) {\n case 'freeText': {\n return (\n <View style={slideStyle.slide}>\n <FreeText\n isDisabled={isDisabled}\n onChange={onChange}\n value={value}\n testID=\"free-text\"\n questionType=\"basic\"\n analytics={analytics}\n />\n </View>\n );\n }\n default:\n }\n\n return (\n <View style={slideStyle.slide}>\n <Text style={slideStyle.category}>{num}</Text>\n <Text style={slideStyle.question}>{slide.question}</Text>\n <Text style={slideStyle.instruction}>{slide.instruction}</Text>\n\n <Choices choices={slide.choices} />\n\n <Button style={slideStyle.button} onPress={validateSlide} testID={`button-quizzer-validate`}>\n {validateLabel}\n </Button>\n </View>\n );\n};\n\n// const Slides = ({slide}: Props) => {\nconst Slides = props => {\n const {stack} = props;\n const {slides, validateButton: validateSlide} = stack;\n if (!slides) {\n return <View />;\n }\n\n return (\n <View style={quizzerStyle.container}>\n <Slide validateSlide={validateSlide} slide={slides[0]} num={0} key={`slide-${0}`} />\n {/* {slides.reverse().map((_slide, index) => (\n <Slide\n validateSlide={validateSlide}\n slide={_slide}\n num={slides.length - index}\n key={`slide-${index}`}\n />\n ))} */}\n </View>\n );\n};\n\nSlides.propTypes = PlayerReviewPropTypes;\n\nexport default Slides;\n"],"file":"index.native.js"}
1
+ {"version":3,"sources":["../../../../src/template/app-review/player/index.native.tsx"],"names":["createStyleSheet","theme","headerHeight","StyleSheet","create","container","flex","paddingTop","backgroundColor","colors","white","alignItems","header","width","height","ReviewHeader","style","Slides","props","stack","reviewBackgroundAriaLabel","congratsProps","display","styleSheet","setStylesheet","_stylesheet"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAEA;;;;;;;;AAGA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,YAAf,KACvBC,wBAAWC,MAAX,CAAkB;AAChBC,EAAAA,SAAS,EAAE;AACTC,IAAAA,IAAI,EAAE,CADG;AAETC,IAAA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 'react-native';\nimport StackedSlides from '../../../organism/review-stacked-slides/index.native';\nimport {Theme} from '../../../variables/theme.native';\nimport {useTemplateContext} from '../template-context';\nimport {Props} from './prop-types';\n\nconst createStyleSheet = (theme: Theme, headerHeight: number) =>\n StyleSheet.create({\n container: {\n flex: 1,\n paddingTop: headerHeight,\n backgroundColor: theme.colors.white,\n // justifyContent: 'space-between',\n alignItems: 'center'\n },\n header: {\n width: '100%',\n backgroundColor: '#ded',\n height: 70\n }\n });\n\nconst ReviewHeader = ({style}) => (\n <View {...style}>\n <Text>review header @todo</Text>\n </View>\n);\n\nconst Slides = (props: Props) => {\n const {header, stack, reviewBackgroundAriaLabel, congratsProps} = props;\n\n const {\n theme,\n display: {headerHeight}\n } = useTemplateContext();\n\n const [styleSheet, setStylesheet] = useState<any | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, headerHeight);\n setStylesheet(_stylesheet);\n }, [theme, headerHeight]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.container}>\n <ReviewHeader style={styleSheet.header} />\n {stack ? <StackedSlides {...stack} /> : null}\n </View>\n );\n};\n\nexport default Slides;\n"],"file":"index.native.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/template/app-review/player/prop-types.js"],"names":["PlayerReviewPropTypes","header","PropTypes","shape","ReviewHeaderPropTypes","stack","StackedSlidesPropTypes","reviewBackgroundAriaLabel","ReviewBackgroundPropTypes","congratsProps","ReviewCongratsPropTypes"],"mappings":";;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,qBAAqB,GAAG;AACnCC,EAAAA,MAAM,EAAEC,mBAAUC,KAAV,CAAgBC,mBAAhB,CAD2B;AAEnCC,EAAAA,KAAK,EAAEH,mBAAUC,KAAV,CAAgBG,mBAAhB,CAF4B;AAGnCC,EAAAA,yBAAyB,EAAEC,oBAA0B,YAA1B,CAHQ;AAInCC,EAAAA,aAAa,EAAEP,mBAAUC,KAAV,CAAgBO,mBAAhB;AAJoB,CAA9B","sourcesContent":["import PropTypes from 'prop-types';\n\nimport ReviewCongratsPropTypes from '../../../organism/review-congrats/prop-types';\nimport ReviewBackgroundPropTypes from '../../../atom/review-background/prop-types';\nimport ReviewHeaderPropTypes from '../../../organism/review-header/prop-types';\nimport StackedSlidesPropTypes from '../../../organism/review-stacked-slides/prop-types';\n\nexport const PlayerReviewPropTypes = {\n header: PropTypes.shape(ReviewHeaderPropTypes),\n stack: PropTypes.shape(StackedSlidesPropTypes),\n reviewBackgroundAriaLabel: ReviewBackgroundPropTypes['aria-label'],\n congratsProps: PropTypes.shape(ReviewCongratsPropTypes)\n};\n"],"file":"prop-types.js"}
1
+ {"version":3,"sources":["../../../../src/template/app-review/player/prop-types.ts"],"names":["PlayerReviewPropTypes","header","PropTypes","shape","ReviewHeaderPropTypes","stack","StackedSlidesPropTypes","reviewBackgroundAriaLabel","ReviewBackgroundPropTypes","congratsProps","ReviewCongratsPropTypes"],"mappings":";;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,qBAAqB,GAAG;AACnCC,EAAAA,MAAM,EAAEC,mBAAUC,KAAV,CAAgBC,mBAAhB,CAD2B;AAEnCC,EAAAA,KAAK,EAAEH,mBAAUC,KAAV,CAAgBG,mBAAhB,CAF4B;AAGnCC,EAAAA,yBAAyB,EAAEC,oBAA0B,YAA1B,CAHQ;AAInCC,EAAAA,aAAa,EAAEP,mBAAUC,KAAV,CAAgBO,mBAAhB;AAJoB,CAA9B","sourcesContent":["import PropTypes from 'prop-types';\n\nimport ReviewCongratsPropTypes from '../../../organism/review-congrats/prop-types';\nimport ReviewBackgroundPropTypes from '../../../atom/review-background/prop-types';\nimport ReviewHeaderPropTypes from '../../../organism/review-header/prop-types';\nimport StackedSlidesPropTypes from '../../../organism/review-stacked-slides/prop-types';\n\nexport const PlayerReviewPropTypes = {\n header: PropTypes.shape(ReviewHeaderPropTypes),\n stack: PropTypes.shape(StackedSlidesPropTypes),\n reviewBackgroundAriaLabel: ReviewBackgroundPropTypes['aria-label'],\n congratsProps: PropTypes.shape(ReviewCongratsPropTypes)\n};\n\nexport type Props = PropTypes.InferProps<typeof PlayerReviewPropTypes>;\n"],"file":"prop-types.js"}
@@ -39,3 +39,10 @@
39
39
  top: 0;
40
40
  left: 0;
41
41
  }
42
+
43
+ /* ie fallback */
44
+ :-ms-fullscreen,
45
+ :root .congrats {
46
+ position: relative;
47
+ bottom: 20%;
48
+ }
@@ -19,8 +19,10 @@ const Context = (0, _react.createContext)({
19
19
  theme: _theme.default,
20
20
  translations: {},
21
21
  display: {
22
+ headerHeight: 67,
22
23
  statusBarHeight: 42
23
- }
24
+ },
25
+ store: {}
24
26
  });
25
27
 
26
28
  const useTemplateContext = () => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/template/app-review/template-context.tsx"],"names":["Context","theme","defaultTheme","translations","display","statusBarHeight","useTemplateContext","context","Error","TemplateContext","values","children"],"mappings":";;;;;AAAA;;AAGA;;;;;;;;;;AAgBA,MAAMA,OAAO,GAAG,0BAAc;AAC5BC,EAAAA,KAAK,EAAEC,cADqB;AAE5BC,EAAAA,YAAY,EAAE,EAFc;AAG5BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,eAAe,EAAE;AADV;AAHmB,CAAd,CAAhB;;AAQA,MAAMC,kBAAkB,GAAG,MAA6B;AACtD,QAAMC,OAAO,GAAG,uBAAWP,OAAX,CAAhB;;AAEA,MAAI,CAACO,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CACH,yFADG,CAAN;AAGD;;AAED,SAAOD,OAAP;AACD,CAVD;;;;AAYA,MAAME,eAAe,GAAG,CAAC;AAACC,EAAAA,MAAD;AAASC,EAAAA;AAAT,CAAD,KAA+B;AACrD,sBAAO,6BAAC,OAAD,CAAS,QAAT;AAAkB,IAAA,KAAK,eAAMD,MAAN;AAAvB,KAAuCC,QAAvC,CAAP;AACD,CAFD","sourcesContent":["import React, {createContext, useContext} from 'react';\nimport {Translations} from '../../types/translations';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n statusBarHeight: number;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n statusBarHeight: 42\n }\n});\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport {TemplateContext, useTemplateContext};\n"],"file":"template-context.js"}
1
+ {"version":3,"sources":["../../../src/template/app-review/template-context.tsx"],"names":["Context","theme","defaultTheme","translations","display","headerHeight","statusBarHeight","store","useTemplateContext","context","Error","TemplateContext","values","children"],"mappings":";;;;;AAAA;;AAGA;;;;;;;;;;AA0BA,MAAMA,OAAO,GAAG,0BAAc;AAC5BC,EAAAA,KAAK,EAAEC,cADqB;AAE5BC,EAAAA,YAAY,EAAE,EAFc;AAG5BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,YAAY,EAAE,EADP;AAEPC,IAAAA,eAAe,EAAE;AAFV,GAHmB;AAO5BC,EAAAA,KAAK,EAAE;AAPqB,CAAd,CAAhB;;AAUA,MAAMC,kBAAkB,GAAG,MAA6B;AACtD,QAAMC,OAAO,GAAG,uBAAWT,OAAX,CAAhB;;AAEA,MAAI,CAACS,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CACH,yFADG,CAAN;AAGD;;AAED,SAAOD,OAAP;AACD,CAVD;;;;AAYA,MAAME,eAAe,GAAG,CAAC;AAACC,EAAAA,MAAD;AAASC,EAAAA;AAAT,CAAD,KAA+B;AACrD,sBAAO,6BAAC,OAAD,CAAS,QAAT;AAAkB,IAAA,KAAK,eAAMD,MAAN;AAAvB,KAAuCC,QAAvC,CAAP;AACD,CAFD","sourcesContent":["import React, {createContext, useContext} from 'react';\nimport {Translations} from '../../types/translations';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type HandleBlur = () => void;\nexport type HandleFocus = (id: string) => () => void;\nexport type FocusedSelectId = string | null;\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n headerHeight: number;\n statusBarHeight: number;\n };\n store: {\n focusedSelectId?: FocusedSelectId;\n handleBlur?: HandleBlur;\n handleFocus?: HandleFocus;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n headerHeight: 67,\n statusBarHeight: 42\n },\n store: {}\n});\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport {TemplateContext, useTemplateContext};\n"],"file":"template-context.js"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"app-review.d.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"styles.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "10.22.24",
3
+ "version": "10.22.25",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -140,5 +140,5 @@
140
140
  "webpack": "^4.43.0"
141
141
  },
142
142
  "author": "CoorpAcademy",
143
- "gitHead": "3b2b9c0d9d47e93f89c09351c1f79a20c07cefc3"
143
+ "gitHead": "6e9facb9c3b9b962abe565d779b5a8035e531fa2"
144
144
  }