@coorpacademy/components 10.22.14 → 10.22.15-alpha.8

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 (41) hide show
  1. package/es/atom/provider/index.js +2 -0
  2. package/es/atom/provider/index.js.map +1 -1
  3. package/es/atom/provider/web-context.js +27 -0
  4. package/es/atom/provider/web-context.js.map +1 -0
  5. package/es/atom/select/index.js +5 -5
  6. package/es/atom/select/index.js.map +1 -1
  7. package/es/molecule/questions/free-text/index.js +8 -3
  8. package/es/molecule/questions/free-text/index.js.map +1 -1
  9. package/es/molecule/questions/qcm/index.js +5 -5
  10. package/es/molecule/questions/qcm/index.js.map +1 -1
  11. package/es/molecule/questions/qcm-drag/index.js +7 -8
  12. package/es/molecule/questions/qcm-drag/index.js.map +1 -1
  13. package/es/molecule/questions/qcm-graphic/index.js +7 -5
  14. package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
  15. package/es/molecule/questions/question-range/index.js +7 -5
  16. package/es/molecule/questions/question-range/index.js.map +1 -1
  17. package/es/organism/review-slide/index.js +5 -7
  18. package/es/organism/review-slide/index.js.map +1 -1
  19. package/es/template/app-review/template-context.js +3 -7
  20. package/es/template/app-review/template-context.js.map +1 -1
  21. package/lib/atom/provider/index.js +9 -0
  22. package/lib/atom/provider/index.js.map +1 -1
  23. package/lib/atom/provider/web-context.js +40 -0
  24. package/lib/atom/provider/web-context.js.map +1 -0
  25. package/lib/atom/select/index.js +5 -5
  26. package/lib/atom/select/index.js.map +1 -1
  27. package/lib/molecule/questions/free-text/index.js +6 -3
  28. package/lib/molecule/questions/free-text/index.js.map +1 -1
  29. package/lib/molecule/questions/qcm/index.js +5 -5
  30. package/lib/molecule/questions/qcm/index.js.map +1 -1
  31. package/lib/molecule/questions/qcm-drag/index.js +9 -8
  32. package/lib/molecule/questions/qcm-drag/index.js.map +1 -1
  33. package/lib/molecule/questions/qcm-graphic/index.js +9 -5
  34. package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
  35. package/lib/molecule/questions/question-range/index.js +9 -5
  36. package/lib/molecule/questions/question-range/index.js.map +1 -1
  37. package/lib/organism/review-slide/index.js +6 -8
  38. package/lib/organism/review-slide/index.js.map +1 -1
  39. package/lib/template/app-review/template-context.js +3 -6
  40. package/lib/template/app-review/template-context.js.map +1 -1
  41. package/package.json +2 -2
@@ -11,19 +11,23 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
- var _provider = _interopRequireDefault(require("../../../atom/provider"));
14
+ var _provider = _interopRequireWildcard(require("../../../atom/provider"));
15
15
 
16
16
  var _range = _interopRequireDefault(require("../../../atom/range"));
17
17
 
18
18
  var _style = _interopRequireDefault(require("./style.css"));
19
19
 
20
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
21
+
22
+ 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; }
23
+
20
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
25
 
22
26
  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); }
23
27
 
24
28
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
25
29
 
26
- const QuestionRange = (props, context) => {
30
+ const QuestionRange = (props, legacyContext) => {
27
31
  const {
28
32
  title,
29
33
  minLabel,
@@ -31,9 +35,9 @@ const QuestionRange = (props, context) => {
31
35
  } = props,
32
36
  rangeProps = _objectWithoutPropertiesLoose(props, ["title", "minLabel", "maxLabel"]);
33
37
 
34
- const {
35
- skin
36
- } = context;
38
+ const context = (0, _provider.useWebContext)();
39
+ const skin = (0, _getOr2.default)(legacyContext.skin, 'skin', context);
40
+ console.log(skin);
37
41
  const defaultColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
38
42
  const titleStyle = {
39
43
  color: defaultColor
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/questions/question-range/index.js"],"names":["QuestionRange","props","context","title","minLabel","maxLabel","rangeProps","skin","defaultColor","titleStyle","color","style","wrapper","innerHTML","__html","labelWrapper","label","contextTypes","Provider","childContextTypes","propTypes","Range","PropTypes","string"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,aAAa,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACxC,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA;AAAlB,MAA6CJ,KAAnD;AAAA,QAAqCK,UAArC,iCAAmDL,KAAnD;;AAEA,QAAM;AAACM,IAAAA;AAAD,MAASL,OAAf;AACA,QAAMM,YAAY,GAAG,qBAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAArB;AAEA,QAAME,UAAU,GAAG;AACjBC,IAAAA,KAAK,EAAEF;AADU,GAAnB;AAIA,sBACE;AAAK,IAAA,SAAS,EAAEG,eAAMC;AAAtB,kBACE;AACE,IAAA,KAAK,EAAEH,UADT;AAEE,IAAA,SAAS,EAAE,yBAAWE,eAAMR,KAAjB,EAAwBQ,eAAME,SAA9B,CAFb,CAGE;AAHF;AAIE,IAAA,uBAAuB,EAAE;AAACC,MAAAA,MAAM,EAAEX;AAAT;AAJ3B,IADF,eAOE,6BAAC,cAAD,EAAWG,UAAX,CAPF,eAQE;AAAK,IAAA,SAAS,EAAEK,eAAMI;AAAtB,kBACE;AACE,IAAA,SAAS,EAAE,yBAAWJ,eAAMK,KAAjB,EAAwBL,eAAME,SAA9B,CADb,CAEE;AAFF;AAGE,IAAA,uBAAuB,EAAE;AAACC,MAAAA,MAAM,EAAEV;AAAT;AAH3B,IADF,eAME;AACE,IAAA,SAAS,EAAE,yBAAWO,eAAMK,KAAjB,EAAwBL,eAAME,SAA9B,CADb,CAEE;AAFF;AAGE,IAAA,uBAAuB,EAAE;AAACC,MAAAA,MAAM,EAAET;AAAT;AAH3B,IANF,CARF,CADF;AAuBD,CAjCD;;AAmCAL,aAAa,CAACiB,YAAd,GAA6B;AAC3BV,EAAAA,IAAI,EAAEW,kBAASC,iBAAT,CAA2BZ;AADN,CAA7B;AAIAP,aAAa,CAACoB,SAAd,iEACKC,eAAMD,SADX;AAEEjB,EAAAA,KAAK,EAAEmB,mBAAUC,MAFnB;AAGEnB,EAAAA,QAAQ,EAAEkB,mBAAUC,MAHtB;AAIElB,EAAAA,QAAQ,EAAEiB,mBAAUC;AAJtB;eAOevB,a","sourcesContent":["import React from 'react';\nimport {getOr} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider from '../../../atom/provider';\nimport Range from '../../../atom/range';\nimport style from './style.css';\n\nconst QuestionRange = (props, context) => {\n const {title, minLabel, maxLabel, ...rangeProps} = props;\n\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const titleStyle = {\n color: defaultColor\n };\n\n return (\n <div className={style.wrapper}>\n <span\n style={titleStyle}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <Range {...rangeProps} />\n <div className={style.labelWrapper}>\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: minLabel}}\n />\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: maxLabel}}\n />\n </div>\n </div>\n );\n};\n\nQuestionRange.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQuestionRange.propTypes = {\n ...Range.propTypes,\n title: PropTypes.string,\n minLabel: PropTypes.string,\n maxLabel: PropTypes.string\n};\n\nexport default QuestionRange;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/molecule/questions/question-range/index.js"],"names":["QuestionRange","props","legacyContext","title","minLabel","maxLabel","rangeProps","context","skin","console","log","defaultColor","titleStyle","color","style","wrapper","innerHTML","__html","labelWrapper","label","contextTypes","Provider","childContextTypes","propTypes","Range","PropTypes","string"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,MAAMA,aAAa,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;AAC9C,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA;AAAlB,MAA6CJ,KAAnD;AAAA,QAAqCK,UAArC,iCAAmDL,KAAnD;;AAEA,QAAMM,OAAO,GAAG,8BAAhB;AACA,QAAMC,IAAI,GAAG,qBAAMN,aAAa,CAACM,IAApB,EAA0B,MAA1B,EAAkCD,OAAlC,CAAb;AACAE,EAAAA,OAAO,CAACC,GAAR,CAAYF,IAAZ;AACA,QAAMG,YAAY,GAAG,qBAAM,SAAN,EAAiB,gBAAjB,EAAmCH,IAAnC,CAArB;AAEA,QAAMI,UAAU,GAAG;AACjBC,IAAAA,KAAK,EAAEF;AADU,GAAnB;AAIA,sBACE;AAAK,IAAA,SAAS,EAAEG,eAAMC;AAAtB,kBACE;AACE,IAAA,KAAK,EAAEH,UADT;AAEE,IAAA,SAAS,EAAE,yBAAWE,eAAMX,KAAjB,EAAwBW,eAAME,SAA9B,CAFb,CAGE;AAHF;AAIE,IAAA,uBAAuB,EAAE;AAACC,MAAAA,MAAM,EAAEd;AAAT;AAJ3B,IADF,eAOE,6BAAC,cAAD,EAAWG,UAAX,CAPF,eAQE;AAAK,IAAA,SAAS,EAAEQ,eAAMI;AAAtB,kBACE;AACE,IAAA,SAAS,EAAE,yBAAWJ,eAAMK,KAAjB,EAAwBL,eAAME,SAA9B,CADb,CAEE;AAFF;AAGE,IAAA,uBAAuB,EAAE;AAACC,MAAAA,MAAM,EAAEb;AAAT;AAH3B,IADF,eAME;AACE,IAAA,SAAS,EAAE,yBAAWU,eAAMK,KAAjB,EAAwBL,eAAME,SAA9B,CADb,CAEE;AAFF;AAGE,IAAA,uBAAuB,EAAE;AAACC,MAAAA,MAAM,EAAEZ;AAAT;AAH3B,IANF,CARF,CADF;AAuBD,CAnCD;;AAqCAL,aAAa,CAACoB,YAAd,GAA6B;AAC3BZ,EAAAA,IAAI,EAAEa,kBAASC,iBAAT,CAA2Bd;AADN,CAA7B;AAIAR,aAAa,CAACuB,SAAd,iEACKC,eAAMD,SADX;AAEEpB,EAAAA,KAAK,EAAEsB,mBAAUC,MAFnB;AAGEtB,EAAAA,QAAQ,EAAEqB,mBAAUC,MAHtB;AAIErB,EAAAA,QAAQ,EAAEoB,mBAAUC;AAJtB;eAOe1B,a","sourcesContent":["import React from 'react';\nimport {getOr} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {useWebContext} from '../../../atom/provider';\nimport Range from '../../../atom/range';\nimport style from './style.css';\n\nconst QuestionRange = (props, legacyContext) => {\n const {title, minLabel, maxLabel, ...rangeProps} = props;\n\n const context = useWebContext();\n const skin = getOr(legacyContext.skin, 'skin', context);\n console.log(skin);\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const titleStyle = {\n color: defaultColor\n };\n\n return (\n <div className={style.wrapper}>\n <span\n style={titleStyle}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <Range {...rangeProps} />\n <div className={style.labelWrapper}>\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: minLabel}}\n />\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: maxLabel}}\n />\n </div>\n </div>\n );\n};\n\nQuestionRange.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQuestionRange.propTypes = {\n ...Range.propTypes,\n title: PropTypes.string,\n minLabel: PropTypes.string,\n maxLabel: PropTypes.string\n};\n\nexport default QuestionRange;\n"],"file":"index.js"}
@@ -19,10 +19,10 @@ var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
19
19
 
20
20
  var _loader = _interopRequireDefault(require("../../atom/loader"));
21
21
 
22
- var _provider = _interopRequireDefault(require("../../atom/provider"));
23
-
24
22
  var _reviewCorrectionPopin = _interopRequireDefault(require("../../molecule/review-correction-popin"));
25
23
 
24
+ var _provider = require("../../atom/provider");
25
+
26
26
  var _propTypes2 = _interopRequireDefault(require("./prop-types"));
27
27
 
28
28
  var _style = _interopRequireDefault(require("./style.css"));
@@ -162,13 +162,14 @@ QuestionContainer.propTypes = process.env.NODE_ENV !== "production" ? {
162
162
  questionOrigin: _propTypes.default.string
163
163
  } : {};
164
164
 
165
- const Slide = (props, context) => {
165
+ const ReviewSlide = props => {
166
166
  const {
167
167
  slide,
168
168
  validateButton,
169
169
  correctionPopinProps,
170
170
  slideIndex = '0'
171
171
  } = props;
172
+ const context = (0, _provider.useWebContext)();
172
173
  const {
173
174
  skin
174
175
  } = context;
@@ -208,10 +209,7 @@ const Slide = (props, context) => {
208
209
  })]);
209
210
  };
210
211
 
211
- Slide.propTypes = process.env.NODE_ENV !== "production" ? _propTypes2.default : {};
212
- Slide.contextTypes = {
213
- skin: _provider.default.childContextTypes.skin
214
- };
215
- var _default = Slide;
212
+ ReviewSlide.propTypes = process.env.NODE_ENV !== "production" ? _propTypes2.default : {};
213
+ var _default = ReviewSlide;
216
214
  exports.default = _default;
217
215
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/organism/review-slide/index.js"],"names":["CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","klf","information","label","message","next","_correctionPopinProps","onClick","console","log","type","resultLabel","style","correctionPopinWrapper","popinAnimation","propTypes","PropTypes","string","bool","ValidateButton","validateButton","primarySkinColor","disabled","validateButtonProps","className","customStyle","backgroundColor","validateButtonWrapper","QuestionContainer","props","answerUI","questionText","questionOrigin","answerProps","model","answers","choices","slideContentContainer","question","help","answerContainer","shape","slide","Slide","context","skin","loading","loadingAriaLabel","parentContentTitle","loader","contextTypes","Provider","childContextTypes"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,eAAe,GAAG,CAAC;AACvBC,EAAAA,oBADuB;AAEvBC,EAAAA,UAFuB;AAGvBC,EAAAA,mBAHuB;AAIvBC,EAAAA;AAJuB,CAAD,KAKlB;AACJ,MAAI,CAACD,mBAAL,EAA0B,OAAO,IAAP;AAE1B,QAAME,GAAG,GAAG,oBAAM,EAAN,EAAU,KAAV,EAAiBJ,oBAAjB,CAAZ;AACA,QAAMK,WAAW,GAAG,oBAAM;AAACC,IAAAA,KAAK,EAAE,EAAR;AAAYC,IAAAA,OAAO,EAAE;AAArB,GAAN,EAAgC,aAAhC,EAA+CP,oBAA/C,CAApB;AACA,QAAMQ,IAAI,GAAG,kBAAI,MAAJ,EAAYR,oBAAZ,CAAb;AAEA,QAAMS,qBAAqB,GAAG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IAAA,cAAc,EAAEC,kBADlB;AAEE,IAAA,YAAY,EAAEjB,YAFhB;AAGE,IAAA,QAAQ,EAAED,QAHZ;AAIE,IAAA,GAAG,EAAC;AAJN,IADF,eAOE,6BAAC,cAAD;AACE,IAAA,UAAU,EAAEhC,UADd;AAEE,IAAA,cAAc,EAAEsB,cAFlB;AAGE,IAAA,gBAAgB,EAAEC,gBAHpB;AAIE,IAAA,GAAG,EAAC;AAJN,IAPF,eAaE,6BAAC,eAAD;AACE,IAAA,oBAAoB,EAAExB,oBADxB;AAEE,IAAA,UAAU,EAAEC,UAFd;AAGE,IAAA,mBAAmB,EAAEC,mBAHvB;AAIE,IAAA,sBAAsB,EAAEC,sBAJ1B;AAKE,IAAA,GAAG,EAAC;AALN,IAbF,CAJJ,CADF;AA6BD,CA5CD;;AA8CA2C,KAAK,CAAC5B,SAAN,2CAAkBA,mBAAlB;AAEA4B,KAAK,CAACO,YAAN,GAAqB;AACnBL,EAAAA,IAAI,EAAEM,kBAASC,iBAAT,CAA2BP;AADd,CAArB;eAIeF,K","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Answer from '../../molecule/answer';\nimport ButtonLink from '../../atom/button-link';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin';\nimport propTypes from './prop-types';\nimport style from './style.css';\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 <div\n className={classnames(\n style.correctionPopinWrapper,\n animateCorrectionPopin ? style.popinAnimation : null\n )}\n >\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </div>\n );\n};\n\nCorrectionPopin.propTypes = {\n slideIndex: PropTypes.string,\n showCorrectionPopin: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n correctionPopinProps: propTypes.correctionPopinProps\n};\n\nconst 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 className: style.validateButton,\n customStyle: {\n backgroundColor: primarySkinColor\n }\n /*\n slide validation action, this will trigger the correction popin\n (with the useEffect that fires the dispatchers, if there is a nextContent content,\n it will be loaded here) but will not trigger any animations unless the endReview\n signal is received (all slide will disappear, also fired in a useEffect),\n\n if it is the last slide and the content needs to be different, then that update will\n be handled on the next slide logic but the content will be carried from here.\n onClick: async () => {\n // endReview based on nextContent ref exit node values: 'successExitNode' : 'failExitNode'\n await validateSlide();\n },\n */\n };\n\n return (\n <div key=\"button-wrapper\" className={style.validateButtonWrapper}>\n <ButtonLink {...validateButtonProps} />\n </div>\n );\n};\n\nValidateButton.propTypes = {\n slideIndex: PropTypes.string,\n validateButton: propTypes.validateButton,\n primarySkinColor: PropTypes.string\n};\n\nconst QuestionContainer = props => {\n const {answerUI, questionText, questionOrigin} = props;\n if (!answerUI || !questionText) return null;\n\n const answerProps = get(['model', 'choices'], answerUI)\n ? /* istanbul ignore next */ {\n ...answerUI,\n model: {\n ...answerUI.model,\n answers: answerUI.model.choices\n }\n }\n : answerUI;\n\n return (\n <div key=\"content-container\" className={style.slideContentContainer}>\n <div key=\"from-course\" className={style.questionOrigin}>\n {questionOrigin}\n </div>\n <div key=\"title\" className={style.question}>\n {questionText}\n </div>\n <div key=\"help\" className={style.help}>\n {get('help', answerUI)}\n </div>\n <div key=\"answer-container\" className={style.answerContainer}>\n <Answer {...answerProps} key=\"answer\" />\n </div>\n </div>\n );\n};\n\nQuestionContainer.propTypes = {\n answerUI: PropTypes.shape(propTypes.slide.answerUI),\n questionText: PropTypes.string,\n questionOrigin: PropTypes.string\n};\n\nconst Slide = (props, context) => {\n const {slide, validateButton, correctionPopinProps, slideIndex = '0'} = props;\n\n const {skin} = context;\n const primarySkinColor = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const {\n loading,\n loadingAriaLabel,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <div data-name={`slide-container`} className={style.slide}>\n {loading ? (\n <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n ) : (\n [\n <QuestionContainer\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />,\n <ValidateButton\n slideIndex={slideIndex}\n validateButton={validateButton}\n primarySkinColor={primarySkinColor}\n key=\"validate-button\"\n />,\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ]\n )}\n </div>\n );\n};\n\nSlide.propTypes = propTypes;\n\nSlide.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default Slide;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/organism/review-slide/index.js"],"names":["CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","klf","information","label","message","next","_correctionPopinProps","onClick","console","log","type","resultLabel","style","correctionPopinWrapper","popinAnimation","propTypes","PropTypes","string","bool","ValidateButton","validateButton","primarySkinColor","disabled","validateButtonProps","className","customStyle","backgroundColor","validateButtonWrapper","QuestionContainer","props","answerUI","questionText","questionOrigin","answerProps","model","answers","choices","slideContentContainer","question","help","answerContainer","shape","slide","ReviewSlide","context","skin","loading","loadingAriaLabel","parentContentTitle","loader"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,eAAe,GAAG,CAAC;AACvBC,EAAAA,oBADuB;AAEvBC,EAAAA,UAFuB;AAGvBC,EAAAA,mBAHuB;AAIvBC,EAAAA;AAJuB,CAAD,KAKlB;AACJ,MAAI,CAACD,mBAAL,EAA0B,OAAO,IAAP;AAE1B,QAAME,GAAG,GAAG,oBAAM,EAAN,EAAU,KAAV,EAAiBJ,oBAAjB,CAAZ;AACA,QAAMK,WAAW,GAAG,oBAAM;AAACC,IAAAA,KAAK,EAAE,EAAR;AAAYC,IAAAA,OAAO,EAAE;AAArB,GAAN,EAAgC,aAAhC,EAA+CP,oBAA/C,CAApB;AACA,QAAMQ,IAAI,GAAG,kBAAI,MAAJ,EAAYR,oBAAZ,CAAb;AAEA,QAAMS,qBAAqB,GAAG;AAC5BD,IAAAA,IAAI,EAAE;AACJE,MAAAA,OAAO,EAAE,MAAM;AACb;AACAC,QAAAA,OAAO,CAACC,GAAR,CAAY,YAAZ;AACD,OAJG;AAKJN,MAAAA,KAAK,EAAEE,IAAI,IAAIA,IAAI,CAACF,KALhB;AAMJ,mBAAc,wBAAuBL,UAAW,EAN5C;AAOJ,oBAAcO,IAAI,IAAIA,IAAI,CAAC,YAAD;AAPtB,KADsB;AAU5BJ,IAAAA,GAV4B;AAW5BC,IAAAA,WAX4B;AAY5BQ,IAAAA,IAAI,EAAEb,oBAAoB,CAACa,IAZC;AAa5BC,IAAAA,WAAW,EAAEd,oBAAoB,CAACc;AAbN,GAA9B;AAgBA,sBACE;AACE,IAAA,SAAS,EAAE,yBACTC,eAAMC,sBADG,EAETb,sBAAsB,GAAGY,eAAME,cAAT,GAA0B,IAFvC;AAD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B,SAAZ,2CAAwBA,mBAAxB;eAEe4B,W","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Answer from '../../molecule/answer';\nimport ButtonLink from '../../atom/button-link';\nimport Loader from '../../atom/loader';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin';\nimport {useWebContext} from '../../atom/provider';\nimport propTypes from './prop-types';\nimport style from './style.css';\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 <div\n className={classnames(\n style.correctionPopinWrapper,\n animateCorrectionPopin ? style.popinAnimation : null\n )}\n >\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </div>\n );\n};\n\nCorrectionPopin.propTypes = {\n slideIndex: PropTypes.string,\n showCorrectionPopin: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n correctionPopinProps: propTypes.correctionPopinProps\n};\n\nconst 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 className: style.validateButton,\n customStyle: {\n backgroundColor: primarySkinColor\n }\n /*\n slide validation action, this will trigger the correction popin\n (with the useEffect that fires the dispatchers, if there is a nextContent content,\n it will be loaded here) but will not trigger any animations unless the endReview\n signal is received (all slide will disappear, also fired in a useEffect),\n\n if it is the last slide and the content needs to be different, then that update will\n be handled on the next slide logic but the content will be carried from here.\n onClick: async () => {\n // endReview based on nextContent ref exit node values: 'successExitNode' : 'failExitNode'\n await validateSlide();\n },\n */\n };\n\n return (\n <div key=\"button-wrapper\" className={style.validateButtonWrapper}>\n <ButtonLink {...validateButtonProps} />\n </div>\n );\n};\n\nValidateButton.propTypes = {\n slideIndex: PropTypes.string,\n validateButton: propTypes.validateButton,\n primarySkinColor: PropTypes.string\n};\n\nconst QuestionContainer = props => {\n const {answerUI, questionText, questionOrigin} = props;\n if (!answerUI || !questionText) return null;\n\n const answerProps = get(['model', 'choices'], answerUI)\n ? /* istanbul ignore next */ {\n ...answerUI,\n model: {\n ...answerUI.model,\n answers: answerUI.model.choices\n }\n }\n : answerUI;\n\n return (\n <div key=\"content-container\" className={style.slideContentContainer}>\n <div key=\"from-course\" className={style.questionOrigin}>\n {questionOrigin}\n </div>\n <div key=\"title\" className={style.question}>\n {questionText}\n </div>\n <div key=\"help\" className={style.help}>\n {get('help', answerUI)}\n </div>\n <div key=\"answer-container\" className={style.answerContainer}>\n <Answer {...answerProps} key=\"answer\" />\n </div>\n </div>\n );\n};\n\nQuestionContainer.propTypes = {\n answerUI: PropTypes.shape(propTypes.slide.answerUI),\n questionText: PropTypes.string,\n questionOrigin: PropTypes.string\n};\n\nconst ReviewSlide = props => {\n const {slide, validateButton, correctionPopinProps, slideIndex = '0'} = props;\n\n const context = useWebContext();\n const {skin} = context;\n const primarySkinColor = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const {\n loading,\n loadingAriaLabel,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <div data-name={`slide-container`} className={style.slide}>\n {loading ? (\n <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n ) : (\n [\n <QuestionContainer\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />,\n <ValidateButton\n slideIndex={slideIndex}\n validateButton={validateButton}\n primarySkinColor={primarySkinColor}\n key=\"validate-button\"\n />,\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ]\n )}\n </div>\n );\n};\n\nReviewSlide.propTypes = propTypes;\n\nexport default ReviewSlide;\n"],"file":"index.js"}
@@ -15,14 +15,13 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
15
15
 
16
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
17
 
18
- // -----------------------------------------------------------------------------
19
18
  const Context = (0, _react.createContext)({
20
19
  theme: _theme.default,
21
20
  translations: {},
22
21
  display: {
23
22
  statusBarHeight: 42
24
23
  }
25
- }); // -----------------------------------------------------------------------------
24
+ });
26
25
 
27
26
  const useTemplateContext = () => {
28
27
  const context = (0, _react.useContext)(Context);
@@ -32,8 +31,7 @@ const useTemplateContext = () => {
32
31
  }
33
32
 
34
33
  return context;
35
- }; // -----------------------------------------------------------------------------
36
-
34
+ };
37
35
 
38
36
  exports.useTemplateContext = useTemplateContext;
39
37
 
@@ -44,8 +42,7 @@ const TemplateContext = ({
44
42
  return /*#__PURE__*/_react.default.createElement(Context.Provider, {
45
43
  value: _extends({}, values)
46
44
  }, children);
47
- }; // -----------------------------------------------------------------------------
48
-
45
+ };
49
46
 
50
47
  exports.TemplateContext = TemplateContext;
51
48
  //# sourceMappingURL=template-context.js.map
@@ -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":";;;;;AAEA;;AAGA;;;;;;;;;;AAgBA;AAEA,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,C,CAQA;;AAEA,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,C,CAYA;;;;;AAEA,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,C,CAIA","sourcesContent":["// -----------------------------------------------------------------------------\n\nimport 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\n// -----------------------------------------------------------------------------\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n statusBarHeight: 42\n }\n});\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\n// -----------------------------------------------------------------------------\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\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","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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "10.22.14",
3
+ "version": "10.22.15-alpha.8+d10426e39",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -139,5 +139,5 @@
139
139
  "webpack": "^4.43.0"
140
140
  },
141
141
  "author": "CoorpAcademy",
142
- "gitHead": "3be3050e700db2d58de6759c1ec7de6869047209"
142
+ "gitHead": "d10426e390835b81b9b692661522c08ead9db231"
143
143
  }