@coorpacademy/components 10.22.16-alpha.12 → 10.22.17
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/atom/input-switch/index.js +4 -2
- package/es/atom/input-switch/index.js.map +1 -1
- package/es/atom/provider/index.js +0 -15
- package/es/atom/provider/index.js.map +1 -1
- package/es/atom/range/handle.js +59 -59
- package/es/atom/range/handle.js.map +1 -1
- package/es/atom/range/index.js +43 -55
- package/es/atom/range/index.js.map +1 -1
- package/es/atom/select/index.js +5 -3
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +1 -1
- package/es/molecule/questions/free-text/index.js +3 -4
- package/es/molecule/questions/free-text/index.js.map +1 -1
- package/es/molecule/questions/qcm/index.js +5 -3
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm-drag/index.js +8 -3
- package/es/molecule/questions/qcm-drag/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.js +5 -3
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/question-range/index.js +5 -3
- package/es/molecule/questions/question-range/index.js.map +1 -1
- package/es/organism/review-slide/index.js +10 -5
- package/es/organism/review-slide/index.js.map +1 -1
- package/es/template/app-review/template-context.js +7 -3
- package/es/template/app-review/template-context.js.map +1 -1
- package/lib/atom/input-switch/index.js +4 -2
- package/lib/atom/input-switch/index.js.map +1 -1
- package/lib/atom/provider/index.js +1 -23
- package/lib/atom/provider/index.js.map +1 -1
- package/lib/atom/range/handle.js +57 -61
- package/lib/atom/range/handle.js.map +1 -1
- package/lib/atom/range/index.js +43 -55
- package/lib/atom/range/index.js.map +1 -1
- package/lib/atom/select/index.js +5 -3
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +1 -1
- package/lib/molecule/questions/free-text/index.js +3 -4
- package/lib/molecule/questions/free-text/index.js.map +1 -1
- package/lib/molecule/questions/qcm/index.js +5 -3
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.js +8 -7
- package/lib/molecule/questions/qcm-drag/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.js +5 -7
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/question-range/index.js +5 -7
- package/lib/molecule/questions/question-range/index.js.map +1 -1
- package/lib/organism/review-slide/index.js +11 -6
- package/lib/organism/review-slide/index.js.map +1 -1
- package/lib/template/app-review/template-context.js +6 -3
- package/lib/template/app-review/template-context.js.map +1 -1
- package/package.json +2 -2
- package/es/atom/provider/web-context.js +0 -27
- package/es/atom/provider/web-context.js.map +0 -1
- package/lib/atom/provider/web-context.js +0 -40
- package/lib/atom/provider/web-context.js.map +0 -1
|
@@ -17,16 +17,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
17
17
|
|
|
18
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
19
|
|
|
20
|
-
var _provider =
|
|
20
|
+
var _provider = _interopRequireDefault(require("../../../atom/provider"));
|
|
21
21
|
|
|
22
22
|
var _getShadowBoxColorFromPrimary = require("../../../util/get-shadow-box-color-from-primary");
|
|
23
23
|
|
|
24
24
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
25
25
|
|
|
26
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
27
|
-
|
|
28
|
-
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; }
|
|
29
|
-
|
|
30
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
27
|
|
|
32
28
|
const AnswersPropTypes = process.env.NODE_ENV !== "production" ? _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
@@ -43,6 +39,9 @@ const EmptyView = ({
|
|
|
43
39
|
className: _style.default.emptySpan
|
|
44
40
|
}, help);
|
|
45
41
|
|
|
42
|
+
EmptyView.contextTypes = {
|
|
43
|
+
translate: _provider.default.childContextTypes.translate
|
|
44
|
+
};
|
|
46
45
|
EmptyView.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
47
46
|
help: _propTypes.default.string
|
|
48
47
|
} : {};
|
|
@@ -137,8 +136,10 @@ SelectedAnswerSections.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
137
136
|
const QcmDrag = ({
|
|
138
137
|
answers,
|
|
139
138
|
help
|
|
140
|
-
},
|
|
141
|
-
const
|
|
139
|
+
}, context) => {
|
|
140
|
+
const {
|
|
141
|
+
skin
|
|
142
|
+
} = context;
|
|
142
143
|
const primarySkinColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
|
|
143
144
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
144
145
|
className: _style.default.wrapper
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/questions/qcm-drag/index.js"],"names":["AnswersPropTypes","PropTypes","arrayOf","shape","onClick","func","order","number","selected","bool","title","string","help","EmptyView","style","emptySpan","propTypes","Choices","answers","answersViews","map","answer","key","invisibleAnswer","unselected","innerHTML","__html","choices","SelectedAnswerSections","backgroundColor","selectedAnswers","selectedAnswersViews","boxShadow","background","content","selectedAnswerText","length","emptyAnswers","QcmDrag","
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/questions/qcm-drag/index.js"],"names":["AnswersPropTypes","PropTypes","arrayOf","shape","onClick","func","order","number","selected","bool","title","string","help","EmptyView","style","emptySpan","contextTypes","translate","Provider","childContextTypes","propTypes","Choices","answers","answersViews","map","answer","key","invisibleAnswer","unselected","innerHTML","__html","choices","SelectedAnswerSections","backgroundColor","selectedAnswers","selectedAnswersViews","boxShadow","background","content","selectedAnswerText","length","emptyAnswers","QcmDrag","context","skin","primarySkinColor","wrapper"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,gBAAN,2CAAyBC,mBAAUC,OAAV,CACvBD,mBAAUE,KAAV,CAAgB;AACdC,EAAAA,OAAO,EAAEH,mBAAUI,IADL;AAEdC,EAAAA,KAAK,EAAEL,mBAAUM,MAFH;AAGdC,EAAAA,QAAQ,EAAEP,mBAAUQ,IAHN;AAIdC,EAAAA,KAAK,EAAET,mBAAUU,MAJH;AAKdC,EAAAA,IAAI,EAAEX,mBAAUU;AALF,CAAhB,CADuB,CAAzB;;AAUA,MAAME,SAAS,GAAG,CAAC;AAACD,EAAAA;AAAD,CAAD,kBAAY;AAAM,EAAA,SAAS,EAAEE,eAAMC;AAAvB,GAAmCH,IAAnC,CAA9B;;AAEAC,SAAS,CAACG,YAAV,GAAyB;AACvBC,EAAAA,SAAS,EAAEC,kBAASC,iBAAT,CAA2BF;AADf,CAAzB;AAIAJ,SAAS,CAACO,SAAV,2CAAsB;AACpBR,EAAAA,IAAI,EAAEX,mBAAUU;AADI,CAAtB;;AAIA,MAAMU,OAAO,GAAG,CAAC;AAACC,EAAAA;AAAD,CAAD,KAAe;AAC7B,QAAMC,YAAY,GAAGD,OAAO,CAACE,GAAR,CAAY,CAACC,MAAD,EAASC,GAAT,KAAiB;AAChD,UAAM;AAACtB,MAAAA,OAAD;AAAUM,MAAAA,KAAV;AAAiBF,MAAAA;AAAjB,QAA6BiB,MAAnC;AACA,wBACE;AACE,MAAA,SAAS,EAAE,yBAAWjB,QAA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S,IAAA,OAAO,EAAEA;AAAlB,IADF,CAFF,CADF;AAQD,CAZD;;AAcAoB,OAAO,CAACtB,SAAR,2CAAoB;AAClBE,EAAAA,OAAO,EAAEtB,gBADS;AAElBY,EAAAA,IAAI,EAAEoB,sBAAsB,CAACZ,SAAvB,CAAiCR;AAFrB,CAApB;AAKA8B,OAAO,CAAC1B,YAAR,GAAuB;AACrB4B,EAAAA,IAAI,EAAE1B,kBAASC,iBAAT,CAA2ByB;AADZ,CAAvB;eAIeF,O","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {pipe, filter, orderBy, getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst AnswersPropTypes = PropTypes.arrayOf(\n PropTypes.shape({\n onClick: PropTypes.func,\n order: PropTypes.number,\n selected: PropTypes.bool,\n title: PropTypes.string,\n help: PropTypes.string\n })\n);\n\nconst EmptyView = ({help}) => <span className={style.emptySpan}>{help}</span>;\n\nEmptyView.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nEmptyView.propTypes = {\n help: PropTypes.string\n};\n\nconst Choices = ({answers}) => {\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected} = answer;\n return (\n <div\n className={classnames(selected ? style.invisibleAnswer : style.unselected, style.innerHTML)}\n data-name=\"answer\"\n onClick={onClick}\n key={key}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n );\n });\n\n return <div className={style.choices}>{answersViews}</div>;\n};\n\nChoices.propTypes = {\n answers: AnswersPropTypes\n};\n\nconst SelectedAnswerSections = ({answers, help, backgroundColor}) => {\n const selectedAnswers = pipe(filter('selected'), orderBy('order', 'asc'))(answers);\n const selectedAnswersViews = selectedAnswers.map((answer, key) => {\n const {onClick, title} = answer;\n return (\n <div\n data-selected=\"true\"\n onClick={onClick}\n key={key}\n data-name=\"selectedAnswer\"\n className={style.selected}\n style={{\n boxShadow: `0px 4px 16px ${getShadowBoxColorFromPrimary(backgroundColor)}`\n }}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor\n }}\n className={style.background}\n />\n <div className={style.content}>\n <span\n data-name=\"answerContent\"\n className={classnames(style.selectedAnswerText, style.innerHTML)}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n </div>\n );\n });\n\n if (selectedAnswersViews.length > 0) {\n return <div className={style.selectedAnswers}>{selectedAnswersViews}</div>;\n } else {\n return (\n <div className={style.emptyAnswers}>\n <EmptyView help={help} />\n </div>\n );\n }\n};\n\nSelectedAnswerSections.propTypes = {\n answers: AnswersPropTypes,\n help: EmptyView.propTypes.help,\n backgroundColor: PropTypes.string\n};\n\nconst QcmDrag = ({answers, help}, context) => {\n const {skin} = context;\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n return (\n <div className={style.wrapper}>\n <SelectedAnswerSections answers={answers} help={help} backgroundColor={primarySkinColor} />\n <div data-name=\"qcm-drag-answers\" className={style.answers}>\n <Choices answers={answers} />\n </div>\n </div>\n );\n};\n\nQcmDrag.propTypes = {\n answers: AnswersPropTypes,\n help: SelectedAnswerSections.propTypes.help\n};\n\nQcmDrag.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default QcmDrag;\n"],"file":"index.js"}
|
|
@@ -11,25 +11,23 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var _provider =
|
|
14
|
+
var _provider = _interopRequireDefault(require("../../../atom/provider"));
|
|
15
15
|
|
|
16
16
|
var _getShadowBoxColorFromPrimary = require("../../../util/get-shadow-box-color-from-primary");
|
|
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
|
-
|
|
24
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
21
|
|
|
26
22
|
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); }
|
|
27
23
|
|
|
28
|
-
const QCMImage = (props,
|
|
24
|
+
const QCMImage = (props, context) => {
|
|
29
25
|
const {
|
|
30
26
|
answers
|
|
31
27
|
} = props;
|
|
32
|
-
const
|
|
28
|
+
const {
|
|
29
|
+
skin
|
|
30
|
+
} = context;
|
|
33
31
|
const primarySkinColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
|
|
34
32
|
const answersViews = answers.map((answer, key) => {
|
|
35
33
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"names":["QCMImage","props","
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"names":["QCMImage","props","context","answers","skin","primarySkinColor","answersViews","map","answer","key","onClick","title","selected","image","ariaLabel","boxShadow","style","backgroundColor","background","content","imageWrapper","backgroundImage","titleWrapper","innerHTML","__html","wrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","bool","func"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,QAAQ,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACnC,QAAM;AAACC,IAAAA;AAAD,MAAYF,KAAlB;AACA,QAAM;AAACG,IAAAA;AAAD,MAASF,OAAf;AACA,QAAMG,gBAAgB,GAAG,qBAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAAzB;AAEA,QAAME,YAAY,GAAGH,OAAO,CAACI,GAAR,CAAY,CAACC,MAAD,EAASC,GAAT,KAAiB;AAChD,UAAM;AAACC,MAAAA,OAAD;AAAUC,MAAAA,KAAV;AAAiBC,MAAAA,QAAjB;AAA2BC,MAAAA,KAA3B;AAAkCC,MAAAA;AAAlC,QAA+CN,MAArD;AAEA,wBACE;AACE,MAAA,OAAO,EAAEE,OADX;AAEE,uBAAeE,QAFjB;AAGE,mBAAU,eAHZ;AAIE,MAAA,KAAK,eACCA,QAAQ,IAAI;AACdG,QAAAA,SAAS,EAAG,cAAa,gEAA6BV,gBAA7B,CAA+C;AAD1D,OADb,CAJP;AASE,MAAA,SAAS,EAAEO,QAAQ,GAAGI,eAAMJ,QAAT,GAAoBI,eAAMR,MAT/C;AAUE,MAAA,GAAG,EAAEC;AAVP,oBAYE;AACE,mBAAU,kBADZ;AAEE,MAAA,KAAK,EAAE;AACLQ,QAAAA,eAAe,EAAEL,QAAQ,GAAGP,gBAAH,GAAsB;AAD1C,OAFT;AAKE,MAAA,SAAS,EAAEW,eAAME;AALnB,MAZF,eAmBE;AAAK,mBAAU,eAAf;AAA+B,MAAA,SAAS,EAAEF,eAAMG;AAAhD,oBACE;AACE,MAAA,SAAS,EAAEH,eAAMI,YADnB;AAEE,mBAAU,aAFZ;AAGE,oBAAYN,SAAS,IAAIH,KAH3B;AAIE,MAAA,KAAK,EAAE;AACLU,QAAAA,eAAe,EAAG,OAAMR,KAAM;AADzB;AAJT,MADF,eASE;AAAK,mBAAU,YAAf;AAA4B,MAAA,SAAS,EAAEG,eAAMM;AAA7C,oBACE;AACE,MAAA,KAAK,EAAEX,KADT;AAEE,MAAA,SAAS,EAAE,yBAAWK,eAAML,KAAjB,EAAwBK,eAAMO,SAA9B,CAFb,CAGE;AAHF;AAIE,MAAA,uBAAuB,EAAE;AAACC,QAAAA,MAAM,EAAEb;AAAT;AAJ3B,MADF,CATF,CAnBF,CADF;AAwCD,GA3CoB,CAArB;AA6CA,sBACE;AAAK,iBAAU,qBAAf;AAAqC,IAAA,SAAS,EAAEK,eAAMS;AAAtD,KACGnB,YADH,CADF;AAKD,CAvDD;;AAyDAN,QAAQ,CAAC0B,YAAT,GAAwB;AACtBtB,EAAAA,IAAI,EAAEuB,kBAASC,iBAAT,CAA2BxB;AADX,CAAxB;AAIAJ,QAAQ,CAAC6B,SAAT,2CAAqB;AACnB1B,EAAAA,OAAO,EAAE2B,mBAAUC,OAAV,CACPD,mBAAUE,KAAV,CAAgB;AACdrB,IAAAA,KAAK,EAAEmB,mBAAUG,MADH;AAEdrB,IAAAA,QAAQ,EAAEkB,mBAAUI,IAFN;AAGdxB,IAAAA,OAAO,EAAEoB,mBAAUK,IAHL;AAIdtB,IAAAA,KAAK,EAAEiB,mBAAUG,MAJH;AAKdnB,IAAAA,SAAS,EAAEgB,mBAAUG;AALP,GAAhB,CADO;AADU,CAArB;eAYejC,Q","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCMImage = (props, context) => {\n const {answers} = props;\n const {skin} = context;\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected, image, ariaLabel} = answer;\n\n return (\n <div\n onClick={onClick}\n data-selected={selected}\n data-name=\"answerGraphic\"\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n className={selected ? style.selected : style.answer}\n key={key}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor: selected ? primarySkinColor : '#F4F4F5'\n }}\n className={style.background}\n />\n <div data-name=\"answerContent\" className={style.content}>\n <div\n className={style.imageWrapper}\n data-name=\"answerImage\"\n aria-label={ariaLabel || title}\n style={{\n backgroundImage: `url(${image})`\n }}\n />\n <div data-name=\"answerText\" className={style.titleWrapper}>\n <div\n title={title}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n </div>\n </div>\n );\n });\n\n return (\n <div data-name=\"qcm-graphic-wrapper\" className={style.wrapper}>\n {answersViews}\n </div>\n );\n};\n\nQCMImage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCMImage.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func,\n image: PropTypes.string,\n ariaLabel: PropTypes.string\n })\n )\n};\n\nexport default QCMImage;\n"],"file":"index.js"}
|
|
@@ -11,23 +11,19 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var _provider =
|
|
14
|
+
var _provider = _interopRequireDefault(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
|
-
|
|
24
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
21
|
|
|
26
22
|
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); }
|
|
27
23
|
|
|
28
24
|
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; }
|
|
29
25
|
|
|
30
|
-
const QuestionRange = (props,
|
|
26
|
+
const QuestionRange = (props, context) => {
|
|
31
27
|
const {
|
|
32
28
|
title,
|
|
33
29
|
minLabel,
|
|
@@ -35,7 +31,9 @@ const QuestionRange = (props, legacyContext) => {
|
|
|
35
31
|
} = props,
|
|
36
32
|
rangeProps = _objectWithoutPropertiesLoose(props, ["title", "minLabel", "maxLabel"]);
|
|
37
33
|
|
|
38
|
-
const
|
|
34
|
+
const {
|
|
35
|
+
skin
|
|
36
|
+
} = context;
|
|
39
37
|
const defaultColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
|
|
40
38
|
const titleStyle = {
|
|
41
39
|
color: defaultColor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/questions/question-range/index.js"],"names":["QuestionRange","props","
|
|
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"}
|
|
@@ -19,9 +19,9 @@ var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
|
19
19
|
|
|
20
20
|
var _loader = _interopRequireDefault(require("../../atom/loader"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _provider = _interopRequireDefault(require("../../atom/provider"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _reviewCorrectionPopin = _interopRequireDefault(require("../../molecule/review-correction-popin"));
|
|
25
25
|
|
|
26
26
|
var _propTypes2 = _interopRequireDefault(require("./prop-types"));
|
|
27
27
|
|
|
@@ -162,14 +162,16 @@ QuestionContainer.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
162
162
|
questionOrigin: _propTypes.default.string
|
|
163
163
|
} : {};
|
|
164
164
|
|
|
165
|
-
const
|
|
165
|
+
const Slide = (props, context) => {
|
|
166
166
|
const {
|
|
167
167
|
slide,
|
|
168
168
|
validateButton,
|
|
169
169
|
correctionPopinProps,
|
|
170
170
|
slideIndex = '0'
|
|
171
171
|
} = props;
|
|
172
|
-
const
|
|
172
|
+
const {
|
|
173
|
+
skin
|
|
174
|
+
} = context;
|
|
173
175
|
const primarySkinColor = (0, _react.useMemo)(() => (0, _getOr.default)('#00B0FF', 'common.primary', skin), [skin]);
|
|
174
176
|
const {
|
|
175
177
|
loading,
|
|
@@ -206,7 +208,10 @@ const ReviewSlide = props => {
|
|
|
206
208
|
})]);
|
|
207
209
|
};
|
|
208
210
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
Slide.propTypes = process.env.NODE_ENV !== "production" ? _propTypes2.default : {};
|
|
212
|
+
Slide.contextTypes = {
|
|
213
|
+
skin: _provider.default.childContextTypes.skin
|
|
214
|
+
};
|
|
215
|
+
var _default = Slide;
|
|
211
216
|
exports.default = _default;
|
|
212
217
|
//# 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","ReviewSlide","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;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AC,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,WAAW,CAAC5B,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 {GetSkinFromContext} 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 skin = GetSkinFromContext();\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"}
|
|
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,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KJD,IAAAA,QALI;AAMJ/B,IAAAA,mBANI;AAOJC,IAAAA;AAPI,MAQF0C,KARJ;AAUA,sBACE;AAAK,iBAAY,iBAAjB;AAAmC,IAAA,SAAS,EAAE9B,eAAM8B;AAApD,KACGI,OAAO,gBACN,6BAAC,eAAD;AAAQ,IAAA,SAAS,EAAElC,eAAMqC,MAAzB;AAAiC,IAAA,KAAK,EAAC,SAAvC;AAAiD,kBAAYF;AAA7D,IADM,GAGN,cACE,6BAAC,iBAAD;AACE,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"}
|
|
@@ -15,13 +15,14 @@ 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
|
+
// -----------------------------------------------------------------------------
|
|
18
19
|
const Context = (0, _react.createContext)({
|
|
19
20
|
theme: _theme.default,
|
|
20
21
|
translations: {},
|
|
21
22
|
display: {
|
|
22
23
|
statusBarHeight: 42
|
|
23
24
|
}
|
|
24
|
-
});
|
|
25
|
+
}); // -----------------------------------------------------------------------------
|
|
25
26
|
|
|
26
27
|
const useTemplateContext = () => {
|
|
27
28
|
const context = (0, _react.useContext)(Context);
|
|
@@ -31,7 +32,8 @@ const useTemplateContext = () => {
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
return context;
|
|
34
|
-
};
|
|
35
|
+
}; // -----------------------------------------------------------------------------
|
|
36
|
+
|
|
35
37
|
|
|
36
38
|
exports.useTemplateContext = useTemplateContext;
|
|
37
39
|
|
|
@@ -42,7 +44,8 @@ const TemplateContext = ({
|
|
|
42
44
|
return /*#__PURE__*/_react.default.createElement(Context.Provider, {
|
|
43
45
|
value: _extends({}, values)
|
|
44
46
|
}, children);
|
|
45
|
-
};
|
|
47
|
+
}; // -----------------------------------------------------------------------------
|
|
48
|
+
|
|
46
49
|
|
|
47
50
|
exports.TemplateContext = TemplateContext;
|
|
48
51
|
//# 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":";;;;;
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.22.
|
|
3
|
+
"version": "10.22.17",
|
|
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": "
|
|
142
|
+
"gitHead": "7166339db687fdaec68f846acfbd27f96b5b531e"
|
|
143
143
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
|
|
3
|
-
import React, { createContext, useContext } from 'react';
|
|
4
|
-
const Context = createContext({
|
|
5
|
-
translate: key => key
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
const WebContext = ({
|
|
9
|
-
values,
|
|
10
|
-
children
|
|
11
|
-
}) => {
|
|
12
|
-
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
13
|
-
value: _extends({}, values)
|
|
14
|
-
}, children);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const useWebContext = () => {
|
|
18
|
-
const context = useContext(Context);
|
|
19
|
-
|
|
20
|
-
if (!context) {
|
|
21
|
-
throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return context;
|
|
25
|
-
};
|
|
26
|
-
export default WebContext;
|
|
27
|
-
//# sourceMappingURL=web-context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/provider/web-context.tsx"],"names":["React","createContext","useContext","Context","translate","key","WebContext","values","children","useWebContext","context","Error"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,aAAf,EAA8BC,UAA9B,QAA+C,OAA/C;AAaA,MAAMC,OAAO,GAAGF,aAAa,CAAC;AAC5BG,EAAAA,SAAS,EAAGC,GAAD,IAAiBA;AADA,CAAD,CAA7B;;AAMA,MAAMC,UAAU,GAAG,CAAC;AAACC,EAAAA,MAAD;AAASC,EAAAA;AAAT,CAAD,KAA+B;AAChD,sBAAO,oBAAC,OAAD,CAAS,QAAT;AAAkB,IAAA,KAAK,eAAMD,MAAN;AAAvB,KAAuCC,QAAvC,CAAP;AACD,CAFD;;AAIA,OAAO,MAAMC,aAAa,GAAG,MAAwB;AACnD,QAAMC,OAAO,GAAGR,UAAU,CAACC,OAAD,CAA1B;;AAEA,MAAI,CAACO,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CAAU,0EAAV,CAAN;AACD;;AAED,SAAOD,OAAP;AACD,CARM;AAUP,eAAeJ,UAAf","sourcesContent":["import React, {createContext, useContext} from 'react';\n\ntype Skin = {\n common: {\n primary: string;\n };\n};\n\ntype WebContextValues = {\n skin?: Skin;\n translate: (key: string) => string;\n};\n\nconst Context = createContext({\n translate: (key: string) => key\n});\n\ntype Props = {values: WebContextValues; children: any};\n\nconst WebContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport const useWebContext = (): WebContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');\n }\n\n return context;\n};\n\nexport default WebContext;\n"],"file":"web-context.js"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.useWebContext = void 0;
|
|
5
|
-
|
|
6
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
-
|
|
8
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
9
|
-
|
|
10
|
-
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; }
|
|
11
|
-
|
|
12
|
-
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); }
|
|
13
|
-
|
|
14
|
-
const Context = (0, _react.createContext)({
|
|
15
|
-
translate: key => key
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const WebContext = ({
|
|
19
|
-
values,
|
|
20
|
-
children
|
|
21
|
-
}) => {
|
|
22
|
-
return /*#__PURE__*/_react.default.createElement(Context.Provider, {
|
|
23
|
-
value: _extends({}, values)
|
|
24
|
-
}, children);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const useWebContext = () => {
|
|
28
|
-
const context = (0, _react.useContext)(Context);
|
|
29
|
-
|
|
30
|
-
if (!context) {
|
|
31
|
-
throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return context;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
exports.useWebContext = useWebContext;
|
|
38
|
-
var _default = WebContext;
|
|
39
|
-
exports.default = _default;
|
|
40
|
-
//# sourceMappingURL=web-context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/provider/web-context.tsx"],"names":["Context","translate","key","WebContext","values","children","useWebContext","context","Error"],"mappings":";;;;;AAAA;;;;;;;;AAaA,MAAMA,OAAO,GAAG,0BAAc;AAC5BC,EAAAA,SAAS,EAAGC,GAAD,IAAiBA;AADA,CAAd,CAAhB;;AAMA,MAAMC,UAAU,GAAG,CAAC;AAACC,EAAAA,MAAD;AAASC,EAAAA;AAAT,CAAD,KAA+B;AAChD,sBAAO,6BAAC,OAAD,CAAS,QAAT;AAAkB,IAAA,KAAK,eAAMD,MAAN;AAAvB,KAAuCC,QAAvC,CAAP;AACD,CAFD;;AAIO,MAAMC,aAAa,GAAG,MAAwB;AACnD,QAAMC,OAAO,GAAG,uBAAWP,OAAX,CAAhB;;AAEA,MAAI,CAACO,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CAAU,0EAAV,CAAN;AACD;;AAED,SAAOD,OAAP;AACD,CARM;;;eAUQJ,U","sourcesContent":["import React, {createContext, useContext} from 'react';\n\ntype Skin = {\n common: {\n primary: string;\n };\n};\n\ntype WebContextValues = {\n skin?: Skin;\n translate: (key: string) => string;\n};\n\nconst Context = createContext({\n translate: (key: string) => key\n});\n\ntype Props = {values: WebContextValues; children: any};\n\nconst WebContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport const useWebContext = (): WebContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');\n }\n\n return context;\n};\n\nexport default WebContext;\n"],"file":"web-context.js"}
|