@coorpacademy/player-web 4.22.52 → 4.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +1 -8
- package/es/index.js.map +1 -1
- package/es/map-state-to-props/answer.js +0 -35
- package/es/map-state-to-props/answer.js.map +1 -1
- package/es/map-state-to-props/error-popin.js +0 -4
- package/es/map-state-to-props/error-popin.js.map +1 -1
- package/es/map-state-to-props/header.js +3 -14
- package/es/map-state-to-props/header.js.map +1 -1
- package/es/map-state-to-props/index.js +0 -6
- package/es/map-state-to-props/index.js.map +1 -1
- package/es/map-state-to-props/loading.js +0 -1
- package/es/map-state-to-props/loading.js.map +1 -1
- package/es/map-state-to-props/player.js +0 -13
- package/es/map-state-to-props/player.js.map +1 -1
- package/es/map-state-to-props/popin-correction.js +0 -25
- package/es/map-state-to-props/popin-correction.js.map +1 -1
- package/es/map-state-to-props/popin-end.js +6 -35
- package/es/map-state-to-props/popin-end.js.map +1 -1
- package/es/map-state-to-props/resources.js +4 -10
- package/es/map-state-to-props/resources.js.map +1 -1
- package/es/map-state-to-props/slide.js +0 -2
- package/es/map-state-to-props/slide.js.map +1 -1
- package/es/map-state-to-props/test/answer.js +0 -21
- package/es/map-state-to-props/test/answer.js.map +1 -1
- package/es/map-state-to-props/test/header.js +0 -2
- package/es/map-state-to-props/test/header.js.map +1 -1
- package/es/map-state-to-props/test/index.js +22 -29
- package/es/map-state-to-props/test/index.js.map +1 -1
- package/es/map-state-to-props/test/player.js +6 -19
- package/es/map-state-to-props/test/player.js.map +1 -1
- package/es/map-state-to-props/test/popin-correction.create-header-cta.js +0 -15
- package/es/map-state-to-props/test/popin-correction.create-header-cta.js.map +1 -1
- package/es/map-state-to-props/test/popin-correction.js +0 -8
- package/es/map-state-to-props/test/popin-correction.js.map +1 -1
- package/es/map-state-to-props/test/popin-end.js +0 -13
- package/es/map-state-to-props/test/popin-end.js.map +1 -1
- package/es/map-state-to-props/test/popin-error.js.map +1 -1
- package/es/map-state-to-props/test/resources.js +0 -2
- package/es/map-state-to-props/test/resources.js.map +1 -1
- package/es/run-app.js +0 -2
- package/es/run-app.js.map +1 -1
- package/es/store.js +0 -4
- package/es/store.js.map +1 -1
- package/es/test/add-timeout.js.map +1 -1
- package/es/test/helpers/css-register.js.map +1 -1
- package/es/test/helpers/macro.js +0 -1
- package/es/test/helpers/macro.js.map +1 -1
- package/es/test/index.js.map +1 -1
- package/es/test/init-reducers.js.map +1 -1
- package/es/test/locales.js.map +1 -1
- package/es/test/run-app.js.map +1 -1
- package/es/test/store.js.map +1 -1
- package/es/views/index.js.map +1 -1
- package/es/views/test/helpers/render.js +0 -2
- package/es/views/test/helpers/render.js.map +1 -1
- package/es/views/test/helpers/state-to-vnode.js +0 -2
- package/es/views/test/helpers/state-to-vnode.js.map +1 -1
- package/es/views/test/loading.js.map +1 -1
- package/es/views/test/popin-correction.js +0 -6
- package/es/views/test/popin-correction.js.map +1 -1
- package/es/views/test/popin-end.js.map +1 -1
- package/es/views/test/router.js.map +1 -1
- package/es/views/test/slide.js +0 -1
- package/es/views/test/slide.js.map +1 -1
- package/lib/index.js +2 -18
- package/lib/index.js.map +1 -1
- package/lib/map-state-to-props/answer.js +1 -47
- package/lib/map-state-to-props/answer.js.map +1 -1
- package/lib/map-state-to-props/error-popin.js +2 -10
- package/lib/map-state-to-props/error-popin.js.map +1 -1
- package/lib/map-state-to-props/header.js +5 -19
- package/lib/map-state-to-props/header.js.map +1 -1
- package/lib/map-state-to-props/index.js +1 -19
- package/lib/map-state-to-props/index.js.map +1 -1
- package/lib/map-state-to-props/loading.js +1 -4
- package/lib/map-state-to-props/loading.js.map +1 -1
- package/lib/map-state-to-props/player.js +2 -22
- package/lib/map-state-to-props/player.js.map +1 -1
- package/lib/map-state-to-props/popin-correction.js +1 -32
- package/lib/map-state-to-props/popin-correction.js.map +1 -1
- package/lib/map-state-to-props/popin-end.js +8 -47
- package/lib/map-state-to-props/popin-end.js.map +1 -1
- package/lib/map-state-to-props/resources.js +6 -20
- package/lib/map-state-to-props/resources.js.map +1 -1
- package/lib/map-state-to-props/slide.js +2 -11
- package/lib/map-state-to-props/slide.js.map +1 -1
- package/lib/map-state-to-props/test/answer.js +1 -37
- package/lib/map-state-to-props/test/answer.js.map +1 -1
- package/lib/map-state-to-props/test/header.js +1 -12
- package/lib/map-state-to-props/test/header.js.map +1 -1
- package/lib/map-state-to-props/test/index.js +23 -20
- package/lib/map-state-to-props/test/index.js.map +1 -1
- package/lib/map-state-to-props/test/player.js +12 -52
- package/lib/map-state-to-props/test/player.js.map +1 -1
- package/lib/map-state-to-props/test/popin-correction.create-header-cta.js +1 -27
- package/lib/map-state-to-props/test/popin-correction.create-header-cta.js.map +1 -1
- package/lib/map-state-to-props/test/popin-correction.js +1 -11
- package/lib/map-state-to-props/test/popin-correction.js.map +1 -1
- package/lib/map-state-to-props/test/popin-end.js +1 -26
- package/lib/map-state-to-props/test/popin-end.js.map +1 -1
- package/lib/map-state-to-props/test/popin-error.js +1 -6
- package/lib/map-state-to-props/test/popin-error.js.map +1 -1
- package/lib/map-state-to-props/test/resources.js +1 -11
- package/lib/map-state-to-props/test/resources.js.map +1 -1
- package/lib/run-app.js +1 -5
- package/lib/run-app.js.map +1 -1
- package/lib/store.js +1 -11
- package/lib/store.js.map +1 -1
- package/lib/test/add-timeout.js +1 -4
- package/lib/test/add-timeout.js.map +1 -1
- package/lib/test/helpers/css-register.js +1 -3
- package/lib/test/helpers/css-register.js.map +1 -1
- package/lib/test/helpers/macro.js +1 -4
- package/lib/test/helpers/macro.js.map +1 -1
- package/lib/test/index.js +3 -12
- package/lib/test/index.js.map +1 -1
- package/lib/test/init-reducers.js +1 -5
- package/lib/test/init-reducers.js.map +1 -1
- package/lib/test/locales.js +1 -8
- package/lib/test/locales.js.map +1 -1
- package/lib/test/run-app.js +1 -5
- package/lib/test/run-app.js.map +1 -1
- package/lib/test/store.js +1 -5
- package/lib/test/store.js.map +1 -1
- package/lib/views/index.js +2 -9
- package/lib/views/index.js.map +1 -1
- package/lib/views/test/helpers/render.js +2 -10
- package/lib/views/test/helpers/render.js.map +1 -1
- package/lib/views/test/helpers/state-to-vnode.js +1 -6
- package/lib/views/test/helpers/state-to-vnode.js.map +1 -1
- package/lib/views/test/loading.js +1 -5
- package/lib/views/test/loading.js.map +1 -1
- package/lib/views/test/popin-correction.js +1 -18
- package/lib/views/test/popin-correction.js.map +1 -1
- package/lib/views/test/popin-end.js +1 -10
- package/lib/views/test/popin-end.js.map +1 -1
- package/lib/views/test/router.js +1 -8
- package/lib/views/test/router.js.map +1 -1
- package/lib/views/test/slide.js +3 -23
- package/lib/views/test/slide.js.map +1 -1
- package/package.json +13 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-popin.js","names":["mapStateToErrorPopinProps","dispatch","state","isFailure","isContentFailure","content","icon","mode","descriptionText","firstButton","largeButton","label","type","handleOnclick","window","location","reload"],"sources":["../../src/map-state-to-props/error-popin.js"],"sourcesContent":["import {some, get, pipe, values} from 'lodash/fp';\n\nconst mapStateToErrorPopinProps = ({dispatch}) => {\n return state => {\n const isFailure = pipe(get('data'), values, some('isFailure'))(state);\n const isContentFailure = pipe(get('data.contents'), values, some('isFailure'))(state);\n if (isFailure || isContentFailure)\n return {\n content: 'An unexpected error has occurred',\n icon: 'AlertDiamond',\n mode: 'alert',\n descriptionText: 'Please reload the page and try again',\n firstButton: {\n largeButton: true,\n label: 'Reload',\n type: 'primary',\n 'aria-label': 'Reload',\n handleOnclick: () => window.location.reload()\n }\n };\n return;\n };\n};\n\nexport default mapStateToErrorPopinProps;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-popin.js","names":["mapStateToErrorPopinProps","dispatch","state","isFailure","_pipe2","default","_get2","_values2","_some2","isContentFailure","content","icon","mode","descriptionText","firstButton","largeButton","label","type","handleOnclick","window","location","reload","_default","exports"],"sources":["../../src/map-state-to-props/error-popin.js"],"sourcesContent":["import {some, get, pipe, values} from 'lodash/fp';\n\nconst mapStateToErrorPopinProps = ({dispatch}) => {\n return state => {\n const isFailure = pipe(get('data'), values, some('isFailure'))(state);\n const isContentFailure = pipe(get('data.contents'), values, some('isFailure'))(state);\n if (isFailure || isContentFailure)\n return {\n content: 'An unexpected error has occurred',\n icon: 'AlertDiamond',\n mode: 'alert',\n descriptionText: 'Please reload the page and try again',\n firstButton: {\n largeButton: true,\n label: 'Reload',\n type: 'primary',\n 'aria-label': 'Reload',\n handleOnclick: () => window.location.reload()\n }\n };\n return;\n };\n};\n\nexport default mapStateToErrorPopinProps;\n"],"mappings":";;;;;;;;;AAEA,MAAMA,yBAAyB,GAAGA,CAAC;EAACC;AAAQ,CAAC,KAAK;EAChD,OAAOC,KAAK,IAAI;IACd,MAAMC,SAAS,GAAG,IAAAC,MAAA,CAAAC,OAAA,EAAK,IAAAC,KAAA,CAAAD,OAAA,EAAI,MAAM,CAAC,EAAAE,QAAA,CAAAF,OAAA,EAAU,IAAAG,MAAA,CAAAH,OAAA,EAAK,WAAW,CAAC,CAAC,CAACH,KAAK,CAAC;IACrE,MAAMO,gBAAgB,GAAG,IAAAL,MAAA,CAAAC,OAAA,EAAK,IAAAC,KAAA,CAAAD,OAAA,EAAI,eAAe,CAAC,EAAAE,QAAA,CAAAF,OAAA,EAAU,IAAAG,MAAA,CAAAH,OAAA,EAAK,WAAW,CAAC,CAAC,CAACH,KAAK,CAAC;IACrF,IAAIC,SAAS,IAAIM,gBAAgB,EAC/B,OAAO;MACLC,OAAO,EAAE,kCAAkC;MAC3CC,IAAI,EAAE,cAAc;MACpBC,IAAI,EAAE,OAAO;MACbC,eAAe,EAAE,sCAAsC;MACvDC,WAAW,EAAE;QACXC,WAAW,EAAE,IAAI;QACjBC,KAAK,EAAE,QAAQ;QACfC,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,QAAQ;QACtBC,aAAa,EAAEA,CAAA,KAAMC,MAAM,CAACC,QAAQ,CAACC,MAAM,CAAC;MAC9C;IACF,CAAC;IACH;EACF,CAAC;AACH,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlB,OAAA,GAEaL,yBAAyB","ignoreList":[]}
|
|
@@ -2,29 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
-
|
|
6
5
|
var _indexOf2 = _interopRequireDefault(require("lodash/fp/indexOf"));
|
|
7
|
-
|
|
8
6
|
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
9
|
-
|
|
10
7
|
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
|
|
11
|
-
|
|
12
8
|
var _playerStore = require("@coorpacademy/player-store");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
10
|
const headerContent = (engineRef, state) => {
|
|
19
11
|
const content = (0, _playerStore.getCurrentContent)(state);
|
|
20
|
-
|
|
21
12
|
switch (engineRef) {
|
|
22
13
|
case 'learner':
|
|
23
14
|
return {
|
|
24
15
|
title: (0, _getOr2.default)('', 'name')(content),
|
|
25
16
|
details: (0, _get2.default)('levelTranslation')(content)
|
|
26
17
|
};
|
|
27
|
-
|
|
28
18
|
case 'microlearning':
|
|
29
19
|
default:
|
|
30
20
|
return {
|
|
@@ -32,7 +22,6 @@ const headerContent = (engineRef, state) => {
|
|
|
32
22
|
};
|
|
33
23
|
}
|
|
34
24
|
};
|
|
35
|
-
|
|
36
25
|
const headerSubcontent = (engineRef, state) => {
|
|
37
26
|
switch (engineRef) {
|
|
38
27
|
case 'learner':
|
|
@@ -46,13 +35,11 @@ const headerSubcontent = (engineRef, state) => {
|
|
|
46
35
|
details
|
|
47
36
|
};
|
|
48
37
|
}
|
|
49
|
-
|
|
50
38
|
case 'microlearning':
|
|
51
39
|
default:
|
|
52
40
|
return null;
|
|
53
41
|
}
|
|
54
42
|
};
|
|
55
|
-
|
|
56
43
|
const headerProps = (options, {
|
|
57
44
|
dispatch
|
|
58
45
|
}) => state => {
|
|
@@ -66,9 +53,10 @@ const headerProps = (options, {
|
|
|
66
53
|
} = (0, _playerStore.getLives)(state);
|
|
67
54
|
return {
|
|
68
55
|
type: engineRef,
|
|
69
|
-
content:
|
|
56
|
+
content: {
|
|
57
|
+
...headerContent(engineRef, state),
|
|
70
58
|
onClick: () => dispatch(_playerStore.back)
|
|
71
|
-
}
|
|
59
|
+
},
|
|
72
60
|
subcontent: headerSubcontent(engineRef, state),
|
|
73
61
|
lives: hide ? false : {
|
|
74
62
|
count
|
|
@@ -76,7 +64,5 @@ const headerProps = (options, {
|
|
|
76
64
|
mode: options.mode || 'default'
|
|
77
65
|
};
|
|
78
66
|
};
|
|
79
|
-
|
|
80
|
-
var _default = headerProps;
|
|
81
|
-
exports.default = _default;
|
|
67
|
+
var _default = exports.default = headerProps;
|
|
82
68
|
//# sourceMappingURL=header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","names":["headerContent","engineRef","state","content","getCurrentContent","title","details","headerSubcontent","chapter","getCurrentChapter","level","chapterIds","_id","length","headerProps","options","dispatch","engine","getEngine","ref","hide","count","getLives","type","onClick","back","subcontent","lives","mode"],"sources":["../../src/map-state-to-props/header.js"],"sourcesContent":["import {get, getOr, indexOf} from 'lodash/fp';\nimport {\n getCurrentChapter,\n getEngine,\n getLives,\n getCurrentContent,\n back\n} from '@coorpacademy/player-store';\n\nconst headerContent = (engineRef, state) => {\n const content = getCurrentContent(state);\n\n switch (engineRef) {\n case 'learner':\n return {\n title: getOr('', 'name')(content),\n details: get('levelTranslation')(content)\n };\n case 'microlearning':\n default:\n return {\n title: getOr('', 'name')(content)\n };\n }\n};\n\nconst headerSubcontent = (engineRef, state) => {\n switch (engineRef) {\n case 'learner': {\n const chapter = getCurrentChapter(state);\n const level = getCurrentContent(state);\n const chapterIds = get('chapterIds', level);\n const details =\n chapter && chapterIds\n ? `${1 + indexOf(chapter._id, chapterIds)}/${chapterIds.length}`\n : null;\n\n return {\n title: getOr('', 'name', chapter),\n details\n };\n }\n case 'microlearning':\n default:\n return null;\n }\n};\n\nconst headerProps =\n (options, {dispatch}) =>\n state => {\n const engine = getEngine(state);\n const {ref: engineRef} = engine;\n const {hide, count} = getLives(state);\n\n return {\n type: engineRef,\n content: {\n ...headerContent(engineRef, state),\n onClick: () => dispatch(back)\n },\n subcontent: headerSubcontent(engineRef, state),\n lives: hide ? false : {count},\n mode: options.mode || 'default'\n };\n };\n\nexport default headerProps;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"header.js","names":["_playerStore","require","_interopRequireDefault","e","__esModule","default","headerContent","engineRef","state","content","getCurrentContent","title","_getOr2","details","_get2","headerSubcontent","chapter","getCurrentChapter","level","chapterIds","_indexOf2","_id","length","headerProps","options","dispatch","engine","getEngine","ref","hide","count","getLives","type","onClick","back","subcontent","lives","mode","_default","exports"],"sources":["../../src/map-state-to-props/header.js"],"sourcesContent":["import {get, getOr, indexOf} from 'lodash/fp';\nimport {\n getCurrentChapter,\n getEngine,\n getLives,\n getCurrentContent,\n back\n} from '@coorpacademy/player-store';\n\nconst headerContent = (engineRef, state) => {\n const content = getCurrentContent(state);\n\n switch (engineRef) {\n case 'learner':\n return {\n title: getOr('', 'name')(content),\n details: get('levelTranslation')(content)\n };\n case 'microlearning':\n default:\n return {\n title: getOr('', 'name')(content)\n };\n }\n};\n\nconst headerSubcontent = (engineRef, state) => {\n switch (engineRef) {\n case 'learner': {\n const chapter = getCurrentChapter(state);\n const level = getCurrentContent(state);\n const chapterIds = get('chapterIds', level);\n const details =\n chapter && chapterIds\n ? `${1 + indexOf(chapter._id, chapterIds)}/${chapterIds.length}`\n : null;\n\n return {\n title: getOr('', 'name', chapter),\n details\n };\n }\n case 'microlearning':\n default:\n return null;\n }\n};\n\nconst headerProps =\n (options, {dispatch}) =>\n state => {\n const engine = getEngine(state);\n const {ref: engineRef} = engine;\n const {hide, count} = getLives(state);\n\n return {\n type: engineRef,\n content: {\n ...headerContent(engineRef, state),\n onClick: () => dispatch(back)\n },\n subcontent: headerSubcontent(engineRef, state),\n lives: hide ? false : {count},\n mode: options.mode || 'default'\n };\n };\n\nexport default headerProps;\n"],"mappings":";;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAMoC,SAAAC,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,MAAMG,aAAa,GAAGA,CAACC,SAAS,EAAEC,KAAK,KAAK;EAC1C,MAAMC,OAAO,GAAG,IAAAC,8BAAiB,EAACF,KAAK,CAAC;EAExC,QAAQD,SAAS;IACf,KAAK,SAAS;MACZ,OAAO;QACLI,KAAK,EAAE,IAAAC,OAAA,CAAAP,OAAA,EAAM,EAAE,EAAE,MAAM,CAAC,CAACI,OAAO,CAAC;QACjCI,OAAO,EAAE,IAAAC,KAAA,CAAAT,OAAA,EAAI,kBAAkB,CAAC,CAACI,OAAO;MAC1C,CAAC;IACH,KAAK,eAAe;IACpB;MACE,OAAO;QACLE,KAAK,EAAE,IAAAC,OAAA,CAAAP,OAAA,EAAM,EAAE,EAAE,MAAM,CAAC,CAACI,OAAO;MAClC,CAAC;EACL;AACF,CAAC;AAED,MAAMM,gBAAgB,GAAGA,CAACR,SAAS,EAAEC,KAAK,KAAK;EAC7C,QAAQD,SAAS;IACf,KAAK,SAAS;MAAE;QACd,MAAMS,OAAO,GAAG,IAAAC,8BAAiB,EAACT,KAAK,CAAC;QACxC,MAAMU,KAAK,GAAG,IAAAR,8BAAiB,EAACF,KAAK,CAAC;QAC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true;
|
|
4
4
|
exports.selectMapStateToVNode = void 0;
|
|
5
|
-
|
|
6
5
|
var _pipe2 = _interopRequireDefault(require("lodash/fp/pipe"));
|
|
7
|
-
|
|
8
6
|
var _isEqual2 = _interopRequireDefault(require("lodash/fp/isEqual"));
|
|
9
|
-
|
|
10
7
|
var _isNil2 = _interopRequireDefault(require("lodash/fp/isNil"));
|
|
11
|
-
|
|
12
8
|
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
|
|
13
|
-
|
|
14
9
|
var _constant2 = _interopRequireDefault(require("lodash/fp/constant"));
|
|
15
|
-
|
|
16
10
|
var _cond2 = _interopRequireDefault(require("lodash/fp/cond"));
|
|
17
|
-
|
|
18
11
|
var _playerStore = require("@coorpacademy/player-store");
|
|
19
|
-
|
|
20
12
|
var _popinCorrection = require("./popin-correction");
|
|
21
|
-
|
|
22
13
|
var _popinEnd = _interopRequireDefault(require("./popin-end"));
|
|
23
|
-
|
|
24
14
|
var _loading = _interopRequireDefault(require("./loading"));
|
|
25
|
-
|
|
26
15
|
var _slide = _interopRequireDefault(require("./slide"));
|
|
27
|
-
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
17
|
const hasNotProgression = (0, _pipe2.default)(_playerStore.getCurrentProgression, _isNil2.default);
|
|
31
18
|
const hasNoContent = (0, _pipe2.default)(_playerStore.getStepContent, _isNil2.default);
|
|
32
|
-
|
|
33
19
|
const matchRoute = route => (0, _pipe2.default)(_playerStore.getRoute, (0, _isEqual2.default)(route));
|
|
34
|
-
|
|
35
20
|
const matchContentType = contentType => (0, _pipe2.default)(_playerStore.getStepContent, (0, _get2.default)('type'), (0, _isEqual2.default)(contentType));
|
|
36
|
-
|
|
37
21
|
const matchContentRef = contentType => (0, _pipe2.default)(_playerStore.getStepContent, (0, _get2.default)('ref'), (0, _isEqual2.default)(contentType));
|
|
38
|
-
|
|
39
22
|
const selectMapStateToVNode = (options, store, views, createStateToVNode) => (0, _cond2.default)([[hasNotProgression, createStateToVNode(views.loading, _loading.default)], [hasNoContent, createStateToVNode(views.loading, _loading.default)], [matchRoute('correction'), createStateToVNode(views.popinCorrection, (0, _popinCorrection.popinCorrectionStateToProps)(options, store))], [matchContentRef('extraLife'), createStateToVNode(views.popinCorrection, (0, _popinCorrection.popinCorrectionStateToProps)(options, store))], [matchContentType('slide'), createStateToVNode(views.player, (0, _slide.default)(options, store))], [matchContentType('success'), createStateToVNode(views.popinEnd, (0, _popinEnd.default)(options, store))], [matchContentType('failure'), createStateToVNode(views.popinEnd, (0, _popinEnd.default)(options, store))], [(0, _constant2.default)(true), createStateToVNode(views.loading, _loading.default)]]);
|
|
40
|
-
|
|
41
23
|
exports.selectMapStateToVNode = selectMapStateToVNode;
|
|
42
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["hasNotProgression","getCurrentProgression","hasNoContent","getStepContent","matchRoute","route","getRoute","matchContentType","contentType","matchContentRef","selectMapStateToVNode","options","store","views","createStateToVNode","loading","loadingStateToProps","popinCorrection","popinCorrectionStateToProps","player","createSlideStateToProps","popinEnd","popinEndStateToProps"],"sources":["../../src/map-state-to-props/index.js"],"sourcesContent":["import {cond, constant, get, isNil, isEqual, pipe} from 'lodash/fp';\nimport {getStepContent, getCurrentProgression, getRoute} from '@coorpacademy/player-store';\nimport {popinCorrectionStateToProps} from './popin-correction';\nimport popinEndStateToProps from './popin-end';\nimport loadingStateToProps from './loading';\nimport createSlideStateToProps from './slide';\n\nconst hasNotProgression = pipe(getCurrentProgression, isNil);\nconst hasNoContent = pipe(getStepContent, isNil);\nconst matchRoute = route => pipe(getRoute, isEqual(route));\nconst matchContentType = contentType => pipe(getStepContent, get('type'), isEqual(contentType));\nconst matchContentRef = contentType => pipe(getStepContent, get('ref'), isEqual(contentType));\n\nexport const selectMapStateToVNode = (options, store, views, createStateToVNode) =>\n cond([\n [hasNotProgression, createStateToVNode(views.loading, loadingStateToProps)],\n [hasNoContent, createStateToVNode(views.loading, loadingStateToProps)],\n [\n matchRoute('correction'),\n createStateToVNode(views.popinCorrection, popinCorrectionStateToProps(options, store))\n ],\n [\n matchContentRef('extraLife'),\n createStateToVNode(views.popinCorrection, popinCorrectionStateToProps(options, store))\n ],\n [\n matchContentType('slide'),\n createStateToVNode(views.player, createSlideStateToProps(options, store))\n ],\n [\n matchContentType('success'),\n createStateToVNode(views.popinEnd, popinEndStateToProps(options, store))\n ],\n [\n matchContentType('failure'),\n createStateToVNode(views.popinEnd, popinEndStateToProps(options, store))\n ],\n [constant(true), createStateToVNode(views.loading, loadingStateToProps)]\n ]);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_playerStore","require","_popinCorrection","_popinEnd","_interopRequireDefault","_loading","_slide","e","__esModule","default","hasNotProgression","_pipe2","getCurrentProgression","_isNil2","hasNoContent","getStepContent","matchRoute","route","getRoute","_isEqual2","matchContentType","contentType","_get2","matchContentRef","selectMapStateToVNode","options","store","views","createStateToVNode","_cond2","loading","loadingStateToProps","popinCorrection","popinCorrectionStateToProps","player","createSlideStateToProps","popinEnd","popinEndStateToProps","_constant2","exports"],"sources":["../../src/map-state-to-props/index.js"],"sourcesContent":["import {cond, constant, get, isNil, isEqual, pipe} from 'lodash/fp';\nimport {getStepContent, getCurrentProgression, getRoute} from '@coorpacademy/player-store';\nimport {popinCorrectionStateToProps} from './popin-correction';\nimport popinEndStateToProps from './popin-end';\nimport loadingStateToProps from './loading';\nimport createSlideStateToProps from './slide';\n\nconst hasNotProgression = pipe(getCurrentProgression, isNil);\nconst hasNoContent = pipe(getStepContent, isNil);\nconst matchRoute = route => pipe(getRoute, isEqual(route));\nconst matchContentType = contentType => pipe(getStepContent, get('type'), isEqual(contentType));\nconst matchContentRef = contentType => pipe(getStepContent, get('ref'), isEqual(contentType));\n\nexport const selectMapStateToVNode = (options, store, views, createStateToVNode) =>\n cond([\n [hasNotProgression, createStateToVNode(views.loading, loadingStateToProps)],\n [hasNoContent, createStateToVNode(views.loading, loadingStateToProps)],\n [\n matchRoute('correction'),\n createStateToVNode(views.popinCorrection, popinCorrectionStateToProps(options, store))\n ],\n [\n matchContentRef('extraLife'),\n createStateToVNode(views.popinCorrection, popinCorrectionStateToProps(options, store))\n ],\n [\n matchContentType('slide'),\n createStateToVNode(views.player, createSlideStateToProps(options, store))\n ],\n [\n matchContentType('success'),\n createStateToVNode(views.popinEnd, popinEndStateToProps(options, store))\n ],\n [\n matchContentType('failure'),\n createStateToVNode(views.popinEnd, popinEndStateToProps(options, store))\n ],\n [constant(true), createStateToVNode(views.loading, loadingStateToProps)]\n ]);\n"],"mappings":";;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,MAAA,GAAAF,sBAAA,CAAAH,OAAA;AAA8C,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C,MAAMG,iBAAiB,GAAG,IAAAC,MAAA,CAAAF,OAAA,EAAKG,kCAAqB,EAAAC,OAAA,CAAAJ,OAAO,CAAC;AAC5D,MAAMK,YAAY,GAAG,IAAAH,MAAA,CAAAF,OAAA,EAAKM,2BAAc,EAAAF,OAAA,CAAAJ,OAAO,CAAC;AAChD,MAAMO,UAAU,GAAGC,KAAK,IAAI,IAAAN,MAAA,CAAAF,OAAA,EAAKS,qBAAQ,EAAE,IAAAC,SAAA,CAAAV,OAAA,EAAQQ,KAAK,CAAC,CAAC;AAC1D,MAAMG,gBAAgB,GAAGC,WAAW,IAAI,IAAAV,MAAA,CAAAF,OAAA,EAAKM,2BAAc,EAAE,IAAA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AQ,EAAE,IAAAC,iBAAoB,EAACZ,OAAO,EAAEC,KAAK,CAAC,CAAC,CACzE,EACD,CAAC,IAAAY,UAAA,CAAA7B,OAAA,EAAS,IAAI,CAAC,EAAEmB,kBAAkB,CAACD,KAAK,CAACG,OAAO,EAAEC,gBAAmB,CAAC,CAAC,CACzE,CAAC;AAACQ,OAAA,CAAAf,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.js","names":["mapStateToProps","state"],"sources":["../../src/map-state-to-props/loading.js"],"sourcesContent":["const mapStateToProps = state => ({});\nexport default mapStateToProps;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"loading.js","names":["mapStateToProps","state","_default","exports","default"],"sources":["../../src/map-state-to-props/loading.js"],"sourcesContent":["const mapStateToProps = state => ({});\nexport default mapStateToProps;\n"],"mappings":";;;;AAAA,MAAMA,eAAe,GAAGC,KAAK,KAAK,CAAC,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACvBJ,eAAe","ignoreList":[]}
|
|
@@ -2,31 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
-
|
|
6
5
|
var _isNil2 = _interopRequireDefault(require("lodash/fp/isNil"));
|
|
7
|
-
|
|
8
6
|
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
|
|
9
|
-
|
|
10
7
|
var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
11
|
-
|
|
12
8
|
var _includes2 = _interopRequireDefault(require("lodash/fp/includes"));
|
|
13
|
-
|
|
14
9
|
var _playerStore = require("@coorpacademy/player-store");
|
|
15
|
-
|
|
16
10
|
var _answer = require("./answer");
|
|
17
|
-
|
|
18
11
|
var _header = _interopRequireDefault(require("./header"));
|
|
19
|
-
|
|
20
12
|
var _resources = _interopRequireDefault(require("./resources"));
|
|
21
|
-
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
14
|
const ROUTES = ['media', 'clue', 'context', 'answer'];
|
|
25
15
|
const STARS_DIFF = {
|
|
26
16
|
media: 'starsPerResourceViewed',
|
|
27
17
|
clue: 'starsPerAskingClue'
|
|
28
18
|
};
|
|
29
|
-
|
|
30
19
|
const playerProps = (options, store) => {
|
|
31
20
|
const createGetAnswerProps_ = (0, _answer.createGetAnswerProps)(options, store);
|
|
32
21
|
const getResourcesProps_ = (0, _resources.default)(options, store);
|
|
@@ -51,15 +40,10 @@ const playerProps = (options, store) => {
|
|
|
51
40
|
const resources = getResourcesProps_(state, slide);
|
|
52
41
|
const help = createGetHelp_(slide);
|
|
53
42
|
const starsDiff = (0, _get2.default)(STARS_DIFF[route], engineConfig) || 0;
|
|
54
|
-
|
|
55
43
|
const clickClueHandler = () => dispatch(_playerStore.selectClue);
|
|
56
|
-
|
|
57
44
|
const clickSeeClueHandler = () => dispatch(_playerStore.getClue);
|
|
58
|
-
|
|
59
45
|
const clickBackToAnswerHandler = () => dispatch((0, _playerStore.selectRoute)('answer'));
|
|
60
|
-
|
|
61
46
|
const clickCTAHandler = () => dispatch((0, _playerStore.validateAnswer)());
|
|
62
|
-
|
|
63
47
|
const hasClue = (0, _get2.default)('hasClue', slide);
|
|
64
48
|
const slideLessons = (0, _get2.default)('lessons', slide);
|
|
65
49
|
const notifyNewMedia = !(0, _isEmpty2.default)(slideLessons) && !(0, _playerStore.hasSeenLesson)(state);
|
|
@@ -99,11 +83,9 @@ const playerProps = (options, store) => {
|
|
|
99
83
|
onClick: () => dispatch((0, _playerStore.startChat)())
|
|
100
84
|
});
|
|
101
85
|
const headerProps = createHeaderStateToProps_(state);
|
|
102
|
-
|
|
103
86
|
if (!(0, _includes2.default)(route, ROUTES)) {
|
|
104
87
|
return {};
|
|
105
88
|
}
|
|
106
|
-
|
|
107
89
|
const ctaButtonValidate = {
|
|
108
90
|
submitValue: translate('Validate'),
|
|
109
91
|
'aria-label': `${translate('Validate')}. ${translate('Submit your Answer')}`,
|
|
@@ -148,7 +130,5 @@ const playerProps = (options, store) => {
|
|
|
148
130
|
};
|
|
149
131
|
};
|
|
150
132
|
};
|
|
151
|
-
|
|
152
|
-
var _default = playerProps;
|
|
153
|
-
exports.default = _default;
|
|
133
|
+
var _default = exports.default = playerProps;
|
|
154
134
|
//# sourceMappingURL=player.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"player.js","names":["ROUTES","STARS_DIFF","media","clue","playerProps","options","store","createGetAnswerProps_","createGetAnswerProps","getResourcesProps_","getResourcesProps","createGetHelp_","createGetHelp","createHeaderStateToProps_","createHeaderStateToProps","state","translate","services","dispatch","engineConfig","getEngineConfig","slide","getCurrentSlide","slideContext","currentContent","getCurrentContent","answer","mediaQuestion","getQuestionMedia","getCurrentClue","route","getRoute","resources","help","starsDiff","clickClueHandler","selectClue","clickSeeClueHandler","getClue","clickBackToAnswerHandler","selectRoute","clickCTAHandler","validateAnswer","hasClue","slideLessons","notifyNewMedia","hasSeenLesson","notifyReviewLesson","contextButton","title","type","selected","onClick","availableCoaches","getCoaches","buttons","disabled","notify","Coach","push","startChat","headerProps","ctaButtonValidate","submitValue","light","small","name","secondary","isQuestionCtaDisabled","useButtonTag","ctaButtonBackToQuestion","typeClue","text","onClickSeeClue","question","step","getProgressionSteps","backgroundUrl","verticalMargin","cta","answerType","model","showNewMedia","showReviewLesson","header"],"sources":["../../src/map-state-to-props/player.js"],"sourcesContent":["import {includes, isEmpty, get, isNil} from 'lodash/fp';\nimport {\n getClue,\n getCoaches,\n getCurrentClue,\n getCurrentContent,\n getCurrentSlide,\n getEngineConfig,\n getQuestionMedia,\n getRoute,\n hasSeenLesson,\n selectClue,\n selectRoute,\n startChat,\n validateAnswer,\n isQuestionCtaDisabled,\n getProgressionSteps\n} from '@coorpacademy/player-store';\nimport {createGetAnswerProps, createGetHelp} from './answer';\nimport createHeaderStateToProps from './header';\nimport getResourcesProps from './resources';\n\nconst ROUTES = ['media', 'clue', 'context', 'answer'];\n\nconst STARS_DIFF = {\n media: 'starsPerResourceViewed',\n clue: 'starsPerAskingClue'\n};\n\nconst playerProps = (options, store) => {\n const createGetAnswerProps_ = createGetAnswerProps(options, store);\n const getResourcesProps_ = getResourcesProps(options, store);\n const createGetHelp_ = createGetHelp(options, store);\n const createHeaderStateToProps_ = createHeaderStateToProps(options, store);\n\n return state => {\n const {translate, services} = options;\n const {dispatch} = store;\n\n const engineConfig = getEngineConfig(state);\n const slide = getCurrentSlide(state);\n const slideContext = get('context', slide);\n const currentContent = getCurrentContent(state);\n const answer = createGetAnswerProps_(state, slide);\n const mediaQuestion = getQuestionMedia(state);\n const clue = getCurrentClue(state) || null;\n const route = getRoute(state);\n const resources = getResourcesProps_(state, slide);\n const help = createGetHelp_(slide);\n const starsDiff = get(STARS_DIFF[route], engineConfig) || 0;\n const clickClueHandler = () => dispatch(selectClue);\n const clickSeeClueHandler = () => dispatch(getClue);\n const clickBackToAnswerHandler = () => dispatch(selectRoute('answer'));\n const clickCTAHandler = () => dispatch(validateAnswer());\n\n const hasClue = get('hasClue', slide);\n const slideLessons = get('lessons', slide);\n\n const notifyNewMedia = !isEmpty(slideLessons) && !hasSeenLesson(state);\n const notifyReviewLesson = !isEmpty(slideLessons) && hasSeenLesson(state);\n\n const contextButton = get('title', slideContext)\n ? [\n {\n title: translate('Context'),\n type: 'context',\n selected: route === 'context',\n onClick: () => {\n return dispatch(selectRoute('context'));\n }\n }\n ]\n : [];\n\n const availableCoaches = getCoaches(state);\n const buttons = [\n ...contextButton,\n {\n title: translate('Question'),\n type: 'question',\n selected: route === 'answer',\n onClick: clickBackToAnswerHandler\n },\n {\n title: translate('Media'),\n type: 'media',\n selected: route === 'media',\n disabled: isEmpty(slideLessons),\n onClick: () => dispatch(selectRoute('media')),\n notify: notifyNewMedia\n },\n {\n title: translate('Clue'),\n type: 'clue',\n selected: route === 'clue',\n disabled: !hasClue,\n onClick: clickClueHandler\n }\n ];\n services?.Coach &&\n buttons.push({\n title: translate('Coach'),\n type: 'coach',\n disabled: availableCoaches === 0,\n onClick: () => dispatch(startChat())\n });\n const headerProps = createHeaderStateToProps_(state);\n\n if (!includes(route, ROUTES)) {\n return {};\n }\n\n const ctaButtonValidate = {\n submitValue: translate('Validate'),\n 'aria-label': `${translate('Validate')}. ${translate('Submit your Answer')}`,\n onClick: clickCTAHandler,\n light: false,\n small: false,\n name: 'validateAnswerCTA',\n secondary: false,\n disabled: isQuestionCtaDisabled(state),\n useButtonTag: true\n };\n\n const ctaButtonBackToQuestion = {\n submitValue: translate(route === 'context' ? 'Go to question' : 'Back to question'),\n onClick: clickBackToAnswerHandler,\n light: false,\n small: false,\n name: 'backToQuestionCTA',\n secondary: true,\n disabled: false\n };\n\n return {\n typeClue: route,\n text: clue,\n onClickSeeClue: clickSeeClueHandler,\n question: get('question.header')(slide),\n step: getProgressionSteps(state),\n slideContext,\n backgroundUrl: get('backgroundUrl')(currentContent),\n verticalMargin: 260,\n starsDiff,\n resources,\n cta: route === 'answer' ? ctaButtonValidate : ctaButtonBackToQuestion,\n help,\n answerType: {\n model: answer,\n media: mediaQuestion\n },\n showNewMedia: (isNil(route) || route === 'answer') && notifyNewMedia,\n showReviewLesson: (isNil(route) || route === 'answer') && notifyReviewLesson,\n buttons,\n header: headerProps\n };\n };\n};\n\nexport default playerProps;\n"],"mappings":";;;;;;;;;;;;;AACA;;AAiBA;;AACA;;AACA;;;;AAEA,MAAMA,MAAM,GAAG,CAAC,OAAD,EAAU,MAAV,EAAkB,SAAlB,EAA6B,QAA7B,CAAf;AAEA,MAAMC,UAAU,GAAG;EACjBC,KAAK,EAAE,wBADU;EAEjBC,IAAI,EAAE;AAFW,CAAnB;;AAKA,MAAMC,WAAW,GAAG,CAACC,OAAD,EAAUC,KAAV,KAAoB;EACtC,MAAMC,qBAAq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qB;MAG9ByB,KAAK,EAAE,KAHuB;MAI9BC,KAAK,EAAE,KAJuB;MAK9BC,IAAI,EAAE,mBALwB;MAM9BC,SAAS,EAAE,IANmB;MAO9BX,QAAQ,EAAE;IAPoB,CAAhC;IAUA,OAAO;MACLe,QAAQ,EAAEzC,KADL;MAEL0C,IAAI,EAAErE,IAFD;MAGLsE,cAAc,EAAEpC,mBAHX;MAILqC,QAAQ,EAAE,mBAAI,iBAAJ,EAAuBrD,KAAvB,CAJL;MAKLsD,IAAI,EAAE,IAAAC,gCAAA,EAAoB7D,KAApB,CALD;MAMLQ,YANK;MAOLsD,aAAa,EAAE,mBAAI,eAAJ,EAAqBrD,cAArB,CAPV;MAQLsD,cAAc,EAAE,GARX;MASL5C,SATK;MAULF,SAVK;MAWL+C,GAAG,EAAEjD,KAAK,KAAK,QAAV,GAAqBgC,iBAArB,GAAyCQ,uBAXzC;MAYLrC,IAZK;MAaL+C,UAAU,EAAE;QACVC,KAAK,EAAEvD,MADG;QAEVxB,KAAK,EAAEyB;MAFG,CAbP;MAiBLuD,YAAY,EAAE,CAAC,qBAAMpD,KAAN,KAAgBA,KAAK,KAAK,QAA3B,KAAwCe,cAjBjD;MAkBLsC,gBAAgB,EAAE,CAAC,qBAAMrD,KAAN,KAAgBA,KAAK,KAAK,QAA3B,KAAwCiB,kBAlBrD;MAmBLQ,OAnBK;MAoBL6B,MAAM,EAAEvB;IApBH,CAAP;EAsBD,CAzHD;AA0HD,CAhID;;eAkIezD,W"}
|
|
1
|
+
{"version":3,"file":"player.js","names":["_playerStore","require","_answer","_header","_interopRequireDefault","_resources","e","__esModule","default","ROUTES","STARS_DIFF","media","clue","playerProps","options","store","createGetAnswerProps_","createGetAnswerProps","getResourcesProps_","getResourcesProps","createGetHelp_","createGetHelp","createHeaderStateToProps_","createHeaderStateToProps","state","translate","services","dispatch","engineConfig","getEngineConfig","slide","getCurrentSlide","slideContext","_get2","currentContent","getCurrentContent","answer","mediaQuestion","getQuestionMedia","getCurrentClue","route","getRoute","resources","help","starsDiff","clickClueHandler","selectClue","clickSeeClueHandler","getClue","clickBackToAnswerHandler","selectRoute","clickCTAHandler","validateAnswer","hasClue","slideLessons","notifyNewMedia","_isEmpty2","hasSeenLesson","notifyReviewLesson","contextButton","title","type","selected","onClick","availableCoaches","getCoaches","buttons","disabled","notify","Coach","push","startChat","headerProps","_includes2","ctaButtonValidate","submitValue","light","small","name","secondary","isQuestionCtaDisabled","useButtonTag","ctaButtonBackToQuestion","typeClue","text","onClickSeeClue","question","step","getProgressionSteps","backgroundUrl","verticalMargin","cta","answerType","model","showNewMedia","_isNil2","showReviewLesson","header","_default","exports"],"sources":["../../src/map-state-to-props/player.js"],"sourcesContent":["import {includes, isEmpty, get, isNil} from 'lodash/fp';\nimport {\n getClue,\n getCoaches,\n getCurrentClue,\n getCurrentContent,\n getCurrentSlide,\n getEngineConfig,\n getQuestionMedia,\n getRoute,\n hasSeenLesson,\n selectClue,\n selectRoute,\n startChat,\n validateAnswer,\n isQuestionCtaDisabled,\n getProgressionSteps\n} from '@coorpacademy/player-store';\nimport {createGetAnswerProps, createGetHelp} from './answer';\nimport createHeaderStateToProps from './header';\nimport getResourcesProps from './resources';\n\nconst ROUTES = ['media', 'clue', 'context', 'answer'];\n\nconst STARS_DIFF = {\n media: 'starsPerResourceViewed',\n clue: 'starsPerAskingClue'\n};\n\nconst playerProps = (options, store) => {\n const createGetAnswerProps_ = createGetAnswerProps(options, store);\n const getResourcesProps_ = getResourcesProps(options, store);\n const createGetHelp_ = createGetHelp(options, store);\n const createHeaderStateToProps_ = createHeaderStateToProps(options, store);\n\n return state => {\n const {translate, services} = options;\n const {dispatch} = store;\n\n const engineConfig = getEngineConfig(state);\n const slide = getCurrentSlide(state);\n const slideContext = get('context', slide);\n const currentContent = getCurrentContent(state);\n const answer = createGetAnswerProps_(state, slide);\n const mediaQuestion = getQuestionMedia(state);\n const clue = getCurrentClue(state) || null;\n const route = getRoute(state);\n const resources = getResourcesProps_(state, slide);\n const help = createGetHelp_(slide);\n const starsDiff = get(STARS_DIFF[route], engineConfig) || 0;\n const clickClueHandler = () => dispatch(selectClue);\n const clickSeeClueHandler = () => dispatch(getClue);\n const clickBackToAnswerHandler = () => dispatch(selectRoute('answer'));\n const clickCTAHandler = () => dispatch(validateAnswer());\n\n const hasClue = get('hasClue', slide);\n const slideLessons = get('lessons', slide);\n\n const notifyNewMedia = !isEmpty(slideLessons) && !hasSeenLesson(state);\n const notifyReviewLesson = !isEmpty(slideLessons) && hasSeenLesson(state);\n\n const contextButton = get('title', slideContext)\n ? [\n {\n title: translate('Context'),\n type: 'context',\n selected: route === 'context',\n onClick: () => {\n return dispatch(selectRoute('context'));\n }\n }\n ]\n : [];\n\n const availableCoaches = getCoaches(state);\n const buttons = [\n ...contextButton,\n {\n title: translate('Question'),\n type: 'question',\n selected: route === 'answer',\n onClick: clickBackToAnswerHandler\n },\n {\n title: translate('Media'),\n type: 'media',\n selected: route === 'media',\n disabled: isEmpty(slideLessons),\n onClick: () => dispatch(selectRoute('media')),\n notify: notifyNewMedia\n },\n {\n title: translate('Clue'),\n type: 'clue',\n selected: route === 'clue',\n disabled: !hasClue,\n onClick: clickClueHandler\n }\n ];\n services?.Coach &&\n buttons.push({\n title: translate('Coach'),\n type: 'coach',\n disabled: availableCoaches === 0,\n onClick: () => dispatch(startChat())\n });\n const headerProps = createHeaderStateToProps_(state);\n\n if (!includes(route, ROUTES)) {\n return {};\n }\n\n const ctaButtonValidate = {\n submitValue: translate('Validate'),\n 'aria-label': `${translate('Validate')}. ${translate('Submit your Answer')}`,\n onClick: clickCTAHandler,\n light: false,\n small: false,\n name: 'validateAnswerCTA',\n secondary: false,\n disabled: isQuestionCtaDisabled(state),\n useButtonTag: true\n };\n\n const ctaButtonBackToQuestion = {\n submitValue: translate(route === 'context' ? 'Go to question' : 'Back to question'),\n onClick: clickBackToAnswerHandler,\n light: false,\n small: false,\n name: 'backToQuestionCTA',\n secondary: true,\n disabled: false\n };\n\n return {\n typeClue: route,\n text: clue,\n onClickSeeClue: clickSeeClueHandler,\n question: get('question.header')(slide),\n step: getProgressionSteps(state),\n slideContext,\n backgroundUrl: get('backgroundUrl')(currentContent),\n verticalMargin: 260,\n starsDiff,\n resources,\n cta: route === 'answer' ? ctaButtonValidate : ctaButtonBackToQuestion,\n help,\n answerType: {\n model: answer,\n media: mediaQuestion\n },\n showNewMedia: (isNil(route) || route === 'answer') && notifyNewMedia,\n showReviewLesson: (isNil(route) || route === 'answer') && notifyReviewLesson,\n buttons,\n header: headerProps\n };\n };\n};\n\nexport default playerProps;\n"],"mappings":";;;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAiBA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA4C,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5C,MAAMG,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;AAErD,MAAMC,UAAU,GAAG;EACjBC,KAAK,EAAE,wBAAwB;EAC/BC,IAAI,EAAE;AACR,CAAC;AAED,MAAMC,WAAW,GAAGA,CAACC,OAAO,EAAEC,KAAK,KAAK;EACtC,MAAMC,qBAAqB,GAAG,IAAAC,4BAAoB,EAACH,OAAO,EAAEC,KAAK,CAAC;EAClE,MAAMG,kBAAkB,GAAG,IAAAC,kBAAiB,EAACL,OAAO,EAAEC,KAAK,CAAC;EAC5D,MAAMK,cAAc,GAAG,IAAAC,qBAAa,EAACP,OAAO,EAAEC,KAAK,CAAC;EACpD,MAAMO,yBAAyB,GAAG,IAAAC,eAAwB,EAACT,OAAO,EAAEC,KAAK,CAAC;EAE1E,OAAOS,KAAK,IAAI;IACd,MAAM;MAACC,SAAS;MAAEC;IAAQ,CAAC,GAAGZ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MACZC,IAAI,EAAE,mBAAmB;MACzBC,SAAS,EAAE,IAAI;MACfZ,QAAQ,EAAE;IACZ,CAAC;IAED,OAAO;MACLgB,QAAQ,EAAE3C,KAAK;MACf4C,IAAI,EAAExE,IAAI;MACVyE,cAAc,EAAEtC,mBAAmB;MACnCuC,QAAQ,EAAE,IAAArD,KAAA,CAAAzB,OAAA,EAAI,iBAAiB,CAAC,CAACsB,KAAK,CAAC;MACvCyD,IAAI,EAAE,IAAAC,gCAAmB,EAAChE,KAAK,CAAC;MAChCQ,YAAY;MACZyD,aAAa,EAAE,IAAAxD,KAAA,CAAAzB,OAAA,EAAI,eAAe,CAAC,CAAC0B,cAAc,CAAC;MACnDwD,cAAc,EAAE,GAAG;MACnB9C,SAAS;MACTF,SAAS;MACTiD,GAAG,EAAEnD,KAAK,KAAK,QAAQ,GAAGkC,iBAAiB,GAAGQ,uBAAuB;MACrEvC,IAAI;MACJiD,UAAU,EAAE;QACVC,KAAK,EAAEzD,MAAM;QACbzB,KAAK,EAAE0B;MACT,CAAC;MACDyD,YAAY,EAAE,CAAC,IAAAC,OAAA,CAAAvF,OAAA,EAAMgC,KAAK,CAAC,IAAIA,KAAK,KAAK,QAAQ,KAAKe,cAAc;MACpEyC,gBAAgB,EAAE,CAAC,IAAAD,OAAA,CAAAvF,OAAA,EAAMgC,KAAK,CAAC,IAAIA,KAAK,KAAK,QAAQ,KAAKkB,kBAAkB;MAC5EQ,OAAO;MACP+B,MAAM,EAAEzB;IACV,CAAC;EACH,CAAC;AACH,CAAC;AAAC,IAAA0B,QAAA,GAAAC,OAAA,CAAA3F,OAAA,GAEaK,WAAW","ignoreList":[]}
|
|
@@ -2,70 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.popinCorrectionStateToProps = exports.openPopinAssistance = exports.createHeaderCTA = void 0;
|
|
5
|
-
|
|
6
5
|
var _includes2 = _interopRequireDefault(require("lodash/fp/includes"));
|
|
7
|
-
|
|
8
6
|
var _isUndefined2 = _interopRequireDefault(require("lodash/fp/isUndefined"));
|
|
9
|
-
|
|
10
7
|
var _omitBy2 = _interopRequireDefault(require("lodash/fp/omitBy"));
|
|
11
|
-
|
|
12
8
|
var _indexOf2 = _interopRequireDefault(require("lodash/fp/indexOf"));
|
|
13
|
-
|
|
14
9
|
var _join2 = _interopRequireDefault(require("lodash/fp/join"));
|
|
15
|
-
|
|
16
10
|
var _isNil2 = _interopRequireDefault(require("lodash/fp/isNil"));
|
|
17
|
-
|
|
18
11
|
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
|
|
19
|
-
|
|
20
12
|
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
21
|
-
|
|
22
13
|
var _assign2 = _interopRequireDefault(require("lodash/fp/assign"));
|
|
23
|
-
|
|
24
14
|
var _playerStore = require("@coorpacademy/player-store");
|
|
25
|
-
|
|
26
15
|
var _resources = _interopRequireDefault(require("./resources"));
|
|
27
|
-
|
|
28
16
|
var _errorPopin = _interopRequireDefault(require("./error-popin"));
|
|
29
|
-
|
|
30
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
-
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
32
18
|
const isNewChapter = (state, progression) => {
|
|
33
19
|
if (progression.content.type !== 'level' || (0, _includes2.default)(progression.state.nextContent.type, ['success', 'failure'])) {
|
|
34
20
|
return false;
|
|
35
21
|
}
|
|
36
|
-
|
|
37
22
|
const currentSlide = (0, _playerStore.getCurrentSlide)(state);
|
|
38
23
|
const currentChapterId = (0, _get2.default)('chapter_id', currentSlide);
|
|
39
24
|
const previousSlide = (0, _playerStore.getPreviousSlide)(state);
|
|
40
25
|
const previousChapterId = (0, _get2.default)('chapter_id', previousSlide);
|
|
41
26
|
return previousChapterId !== currentChapterId;
|
|
42
27
|
};
|
|
43
|
-
|
|
44
28
|
const getNextChapterTitle = (state, progression) => {
|
|
45
29
|
const levelId = (0, _get2.default)('content.ref', progression);
|
|
46
30
|
const chapterIds = (0, _get2.default)(['data', 'contents', 'level', 'entities', levelId, 'chapterIds'], state);
|
|
47
|
-
|
|
48
31
|
if (!chapterIds) {
|
|
49
32
|
return undefined;
|
|
50
33
|
}
|
|
51
|
-
|
|
52
34
|
const currentSlide = (0, _playerStore.getCurrentSlide)(state);
|
|
53
35
|
const currentChapterId = (0, _get2.default)('chapter_id', currentSlide);
|
|
54
36
|
const currentChapterName = (0, _get2.default)(['data', 'contents', 'chapter', 'entities', currentChapterId, 'name'], state);
|
|
55
|
-
|
|
56
37
|
if (!currentChapterName) {
|
|
57
38
|
return undefined;
|
|
58
39
|
}
|
|
59
|
-
|
|
60
40
|
const indexChapter = (0, _indexOf2.default)(currentChapterId, chapterIds) + 1;
|
|
61
41
|
return `${indexChapter}/${chapterIds.length} ${currentChapterName}`;
|
|
62
42
|
};
|
|
63
|
-
|
|
64
43
|
const getNextStepTitle = state => {
|
|
65
44
|
const progression = (0, _playerStore.getCurrentProgression)(state);
|
|
66
45
|
return isNewChapter(state, progression) ? getNextChapterTitle(state, progression) : undefined;
|
|
67
46
|
};
|
|
68
|
-
|
|
69
47
|
const extraLifeCTAProps = ({
|
|
70
48
|
translate
|
|
71
49
|
}, {
|
|
@@ -79,7 +57,6 @@ const extraLifeCTAProps = ({
|
|
|
79
57
|
onClick: () => dispatch(updateProgression(progressionId))
|
|
80
58
|
};
|
|
81
59
|
};
|
|
82
|
-
|
|
83
60
|
const noExtraLifeCTAProps = ({
|
|
84
61
|
translate
|
|
85
62
|
}, {
|
|
@@ -96,7 +73,6 @@ const noExtraLifeCTAProps = ({
|
|
|
96
73
|
};
|
|
97
74
|
return (0, _omitBy2.default)(_isUndefined2.default, ctaProps);
|
|
98
75
|
};
|
|
99
|
-
|
|
100
76
|
const createHeaderCTA = (options, store) => {
|
|
101
77
|
const extraLifeCTAProps_ = extraLifeCTAProps(options, store);
|
|
102
78
|
const noExtraLifeCTAProps_ = noExtraLifeCTAProps(options, store);
|
|
@@ -116,13 +92,9 @@ const createHeaderCTA = (options, store) => {
|
|
|
116
92
|
});
|
|
117
93
|
};
|
|
118
94
|
};
|
|
119
|
-
|
|
120
95
|
exports.createHeaderCTA = createHeaderCTA;
|
|
121
|
-
|
|
122
96
|
const openPopinAssistance = (dispatch, progression) => () => dispatch((0, _playerStore.openAssistance)(progression));
|
|
123
|
-
|
|
124
97
|
exports.openPopinAssistance = openPopinAssistance;
|
|
125
|
-
|
|
126
98
|
const popinCorrectionStateToProps = (options, store) => {
|
|
127
99
|
const getResourcesProps_ = (0, _resources.default)(options, store);
|
|
128
100
|
const createHeaderCTA_ = createHeaderCTA(options, store);
|
|
@@ -133,9 +105,7 @@ const popinCorrectionStateToProps = (options, store) => {
|
|
|
133
105
|
const {
|
|
134
106
|
dispatch
|
|
135
107
|
} = store;
|
|
136
|
-
|
|
137
108
|
const toggleAccordionSection = sectionId => dispatch((0, _playerStore.toggleAccordion)(sectionId));
|
|
138
|
-
|
|
139
109
|
const slide = (0, _playerStore.getPreviousSlide)(state);
|
|
140
110
|
const engineConfig = (0, _playerStore.getEngineConfig)(state);
|
|
141
111
|
const progression = (0, _playerStore.getCurrentProgression)(state);
|
|
@@ -213,6 +183,5 @@ const popinCorrectionStateToProps = (options, store) => {
|
|
|
213
183
|
};
|
|
214
184
|
};
|
|
215
185
|
};
|
|
216
|
-
|
|
217
186
|
exports.popinCorrectionStateToProps = popinCorrectionStateToProps;
|
|
218
187
|
//# sourceMappingURL=popin-correction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popin-correction.js","names":["isNewChapter","state","progression","content","type","nextContent","currentSlide","getCurrentSlide","currentChapterId","previousSlide","getPreviousSlide","previousChapterId","getNextChapterTitle","levelId","chapterIds","undefined","currentChapterName","indexChapter","length","getNextStepTitle","getCurrentProgression","extraLifeCTAProps","translate","dispatch","progressionId","getCurrentProgressionId","isRevival","hasViewedAResourceAtThisStep","updateProgression","acceptExtraLife","refuseExtraLife","title","onClick","noExtraLifeCTAProps","isDead","lives","chapterTitle","ctaProps","selectProgression","nextStepTitle","createHeaderCTA","options","store","extraLifeCTAProps_","noExtraLifeCTAProps_","isExtraLifeActive","openPopinAssistance","openAssistance","popinCorrectionStateToProps","getResourcesProps_","getResourcesProps","createHeaderCTA_","toggleAccordionSection","sectionId","toggleAccordion","slide","engineConfig","getEngineConfig","isExtraLifeAvailable","remainingLifeRequests","accordion","correction","getCurrentCorrection","correctAnswer","corrections","isCorrect","isLoading","extraLifeGranted","mayAcceptExtraLife","noMoreExtraLife","hide","count","getLives","header","subtitle","failed","question","answerPrefix","answer","resources","cta","gameOver","popinError","mapStateToErrorPopinProps","overlay","text","lifeAmount","quit","value","open","klf","tips","assistanceLink"],"sources":["../../src/map-state-to-props/popin-correction.js"],"sourcesContent":["import {assign, getOr, get, isNil, join, indexOf, omitBy, isUndefined, includes} from 'lodash/fp';\n\nimport {\n acceptExtraLife,\n getCurrentCorrection,\n getCurrentProgression,\n getCurrentProgressionId,\n getCurrentSlide,\n getEngineConfig,\n getLives,\n getPreviousSlide,\n hasViewedAResourceAtThisStep,\n openAssistance,\n refuseExtraLife,\n selectProgression,\n toggleAccordion\n} from '@coorpacademy/player-store';\n\nimport getResourcesProps from './resources';\nimport mapStateToErrorPopinProps from './error-popin';\n\nconst isNewChapter = (state, progression) => {\n if (\n progression.content.type !== 'level' ||\n includes(progression.state.nextContent.type, ['success', 'failure'])\n ) {\n return false;\n }\n const currentSlide = getCurrentSlide(state);\n const currentChapterId = get('chapter_id', currentSlide);\n const previousSlide = getPreviousSlide(state);\n const previousChapterId = get('chapter_id', previousSlide);\n return previousChapterId !== currentChapterId;\n};\n\nconst getNextChapterTitle = (state, progression) => {\n const levelId = get('content.ref', progression);\n const chapterIds = get(['data', 'contents', 'level', 'entities', levelId, 'chapterIds'], state);\n if (!chapterIds) {\n return undefined;\n }\n const currentSlide = getCurrentSlide(state);\n const currentChapterId = get('chapter_id', currentSlide);\n const currentChapterName = get(\n ['data', 'contents', 'chapter', 'entities', currentChapterId, 'name'],\n state\n );\n if (!currentChapterName) {\n return undefined;\n }\n const indexChapter = indexOf(currentChapterId, chapterIds) + 1;\n return `${indexChapter}/${chapterIds.length} ${currentChapterName}`;\n};\n\nconst getNextStepTitle = state => {\n const progression = getCurrentProgression(state);\n return isNewChapter(state, progression) ? getNextChapterTitle(state, progression) : undefined;\n};\n\nconst extraLifeCTAProps =\n ({translate}, {dispatch}) =>\n state => {\n const progressionId = getCurrentProgressionId(state);\n const isRevival = hasViewedAResourceAtThisStep(state);\n const updateProgression = isRevival ? acceptExtraLife : refuseExtraLife;\n\n return {\n title: translate(isRevival ? 'Next' : 'Quit'),\n onClick: () => dispatch(updateProgression(progressionId))\n };\n };\n\nconst noExtraLifeCTAProps =\n ({translate}, {dispatch}) =>\n state => {\n const progression = getCurrentProgression(state);\n const progressionId = getCurrentProgressionId(state);\n const isDead = progression.state.lives === 0;\n const chapterTitle = isNewChapter(state, progression)\n ? translate('Next chapter')\n : translate('Next');\n\n const ctaProps = {\n title: isDead ? translate('Game over') : chapterTitle,\n onClick: () => dispatch(selectProgression(progressionId)),\n nextStepTitle: isDead ? translate('Click to continue') : getNextStepTitle(state)\n };\n\n return omitBy(isUndefined, ctaProps);\n };\n\nexport const createHeaderCTA = (options, store) => {\n const extraLifeCTAProps_ = extraLifeCTAProps(options, store);\n const noExtraLifeCTAProps_ = noExtraLifeCTAProps(options, store);\n\n return state => {\n const progression = getCurrentProgression(state);\n const isExtraLifeActive = get('state.nextContent.ref', progression) === 'extraLife';\n const ctaProps = isExtraLifeActive ? extraLifeCTAProps_ : noExtraLifeCTAProps_;\n const {title, onClick, nextStepTitle} = ctaProps(state);\n\n return omitBy(isUndefined, {\n title,\n onClick,\n nextStepTitle\n });\n };\n};\n\nexport const openPopinAssistance = (dispatch, progression) => () =>\n dispatch(openAssistance(progression));\n\nexport const popinCorrectionStateToProps = (options, store) => {\n const getResourcesProps_ = getResourcesProps(options, store);\n const createHeaderCTA_ = createHeaderCTA(options, store);\n\n return state => {\n const {translate} = options;\n const {dispatch} = store;\n const toggleAccordionSection = sectionId => dispatch(toggleAccordion(sectionId));\n const slide = getPreviousSlide(state);\n const engineConfig = getEngineConfig(state);\n const progression = getCurrentProgression(state);\n const isExtraLifeAvailable = get('remainingLifeRequests', engineConfig) > 0;\n const remainingLifeRequests = get('state.remainingLifeRequests', progression);\n const accordion = get('ui.corrections.accordion', state);\n const correction = getCurrentCorrection(state);\n const correctAnswer = correction.correctAnswer;\n const corrections = correction.corrections;\n const isCorrect = corrections.length === 0 ? null : get('state.isCorrect')(progression);\n const isLoading = isNil(isCorrect);\n\n const isExtraLifeActive = get('state.nextContent.ref', progression) === 'extraLife';\n const extraLifeGranted = isExtraLifeActive && hasViewedAResourceAtThisStep(state);\n const mayAcceptExtraLife = isExtraLifeActive && !extraLifeGranted;\n const noMoreExtraLife = isExtraLifeAvailable && !isCorrect && remainingLifeRequests === 0;\n const {hide, count: lives} = getLives(state);\n const header = isLoading\n ? {}\n : {\n title: translate(isCorrect ? 'Good job' : 'Ouch'),\n subtitle: translate(isCorrect ? 'Good answer' : 'Wrong answer'),\n failed: !isCorrect,\n lives: hide ? null : lives\n };\n const question = {\n header: getOr('', 'question.header', slide),\n answerPrefix: translate('Correct answer'),\n answer: join(', ', correctAnswer)\n };\n\n const resources = getResourcesProps_(state, slide);\n\n return {\n header: isLoading\n ? {type: 'popinCorrection'}\n : assign(\n {\n type: 'popinCorrection',\n lives: 1,\n title: '',\n subtitle: '',\n corrections,\n cta: !mayAcceptExtraLife ? createHeaderCTA_(state) : undefined\n },\n header\n ),\n gameOver: noMoreExtraLife,\n popinError: mapStateToErrorPopinProps(dispatch)(state),\n overlay: mayAcceptExtraLife\n ? {\n title: translate('Bonus!'),\n text: translate('Get an extra life by viewing the lesson'),\n lifeAmount: 1\n }\n : undefined,\n extraLifeGranted,\n quit: mayAcceptExtraLife\n ? {\n cta: createHeaderCTA_(state)\n }\n : undefined,\n question,\n resources: {\n title: translate('Access the lesson'),\n value: resources,\n open: getOr(false, '0', accordion)\n },\n klf: {\n title: translate('Key point'),\n value: getOr('', 'klf', slide),\n open: getOr(false, '1', accordion)\n },\n tips: {\n title: translate('Did you know that?'),\n value: getOr('', 'tips', slide),\n open: getOr(false, '2', accordion)\n },\n onClick: toggleAccordionSection,\n assistanceLink: {\n title: translate('Need help? Found a bug? Report it here'),\n onClick: openPopinAssistance(dispatch, progression)\n }\n };\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;;AAgBA;;AACA;;;;AAEA,MAAMA,YAAY,GAAG,CAACC,KAAD,EAAQC,WAAR,KAAwB;EAC3C,IACEA,WAAW,CAACC,OAAZ,CAAoBC,IAApB,KAA6B,OAA7B,IACA,wBAASF,WAAW,CAACD,KAAZ,CAAkBI,WAAlB,CAA8BD,IAAvC,EAA6C,CAAC,SAAD,EAAY,SAAZ,CAA7C,CAFF,EAGE;IACA,OAAO,KAAP;EACD;;EACD,MAAME,YAAY,GAAG,IAAAC,4BAAA,EAAgBN,KAAhB,CAArB;EACA,MAAMO,gBAAgB,GAAG,mBAAI,YAAJ,EAAkBF,YAAlB,CAAzB;EACA,MAAMG,aAAa,GAAG,IAAAC,6BAAA,EAAiBT,KAAjB,CAAtB;EACA,MAAMU,iBAAiB,GAAG,mBAAI,YAAJ,EAAkBF,aAAlB,CAA1B;EACA,OAAOE,iBAAiB,KAAKH,gBAA7B;AACD,CAZD;;AAcA,MAAMI,mBAAmB,GAAG,CAACX,KAAD,EAAQC,WAAR,KAAwB;EAClD,MAAMW,OAAO,GAAG,mBAAI,aAAJ,EAAmBX,WAAnB,CAAhB;EACA,MAAMY,UAAU,GAAG,mBAAI,CAAC,MAAD,EAAS,UAAT,EAAqB,OAArB,EAA8B,UAA9B,EAA0CD,OAA1C,EAAmD,YAAnD,CAAJ,EAAsEZ,KAAtE,CAAnB;;EACA,IAAI,CAACa,UAAL,EAAiB;IACf,OA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A7CJ;MA8CLwC,cAAc,EAAE;QACd7D,KAAK,EAAET,SAAS,CAAC,wCAAD,CADF;QAEdU,OAAO,EAAEc,mBAAmB,CAACvB,QAAD,EAAWrB,WAAX;MAFd;IA9CX,CAAP;EAmDD,CAxFD;AAyFD,CA7FM"}
|
|
1
|
+
{"version":3,"file":"popin-correction.js","names":["_playerStore","require","_resources","_interopRequireDefault","_errorPopin","e","__esModule","default","isNewChapter","state","progression","content","type","_includes2","nextContent","currentSlide","getCurrentSlide","currentChapterId","_get2","previousSlide","getPreviousSlide","previousChapterId","getNextChapterTitle","levelId","chapterIds","undefined","currentChapterName","indexChapter","_indexOf2","length","getNextStepTitle","getCurrentProgression","extraLifeCTAProps","translate","dispatch","progressionId","getCurrentProgressionId","isRevival","hasViewedAResourceAtThisStep","updateProgression","acceptExtraLife","refuseExtraLife","title","onClick","noExtraLifeCTAProps","isDead","lives","chapterTitle","ctaProps","selectProgression","nextStepTitle","_omitBy2","_isUndefined2","createHeaderCTA","options","store","extraLifeCTAProps_","noExtraLifeCTAProps_","isExtraLifeActive","exports","openPopinAssistance","openAssistance","popinCorrectionStateToProps","getResourcesProps_","getResourcesProps","createHeaderCTA_","toggleAccordionSection","sectionId","toggleAccordion","slide","engineConfig","getEngineConfig","isExtraLifeAvailable","remainingLifeRequests","accordion","correction","getCurrentCorrection","correctAnswer","corrections","isCorrect","isLoading","_isNil2","extraLifeGranted","mayAcceptExtraLife","noMoreExtraLife","hide","count","getLives","header","subtitle","failed","question","_getOr2","answerPrefix","answer","_join2","resources","_assign2","cta","gameOver","popinError","mapStateToErrorPopinProps","overlay","text","lifeAmount","quit","value","open","klf","tips","assistanceLink"],"sources":["../../src/map-state-to-props/popin-correction.js"],"sourcesContent":["import {assign, getOr, get, isNil, join, indexOf, omitBy, isUndefined, includes} from 'lodash/fp';\n\nimport {\n acceptExtraLife,\n getCurrentCorrection,\n getCurrentProgression,\n getCurrentProgressionId,\n getCurrentSlide,\n getEngineConfig,\n getLives,\n getPreviousSlide,\n hasViewedAResourceAtThisStep,\n openAssistance,\n refuseExtraLife,\n selectProgression,\n toggleAccordion\n} from '@coorpacademy/player-store';\n\nimport getResourcesProps from './resources';\nimport mapStateToErrorPopinProps from './error-popin';\n\nconst isNewChapter = (state, progression) => {\n if (\n progression.content.type !== 'level' ||\n includes(progression.state.nextContent.type, ['success', 'failure'])\n ) {\n return false;\n }\n const currentSlide = getCurrentSlide(state);\n const currentChapterId = get('chapter_id', currentSlide);\n const previousSlide = getPreviousSlide(state);\n const previousChapterId = get('chapter_id', previousSlide);\n return previousChapterId !== currentChapterId;\n};\n\nconst getNextChapterTitle = (state, progression) => {\n const levelId = get('content.ref', progression);\n const chapterIds = get(['data', 'contents', 'level', 'entities', levelId, 'chapterIds'], state);\n if (!chapterIds) {\n return undefined;\n }\n const currentSlide = getCurrentSlide(state);\n const currentChapterId = get('chapter_id', currentSlide);\n const currentChapterName = get(\n ['data', 'contents', 'chapter', 'entities', currentChapterId, 'name'],\n state\n );\n if (!currentChapterName) {\n return undefined;\n }\n const indexChapter = indexOf(currentChapterId, chapterIds) + 1;\n return `${indexChapter}/${chapterIds.length} ${currentChapterName}`;\n};\n\nconst getNextStepTitle = state => {\n const progression = getCurrentProgression(state);\n return isNewChapter(state, progression) ? getNextChapterTitle(state, progression) : undefined;\n};\n\nconst extraLifeCTAProps =\n ({translate}, {dispatch}) =>\n state => {\n const progressionId = getCurrentProgressionId(state);\n const isRevival = hasViewedAResourceAtThisStep(state);\n const updateProgression = isRevival ? acceptExtraLife : refuseExtraLife;\n\n return {\n title: translate(isRevival ? 'Next' : 'Quit'),\n onClick: () => dispatch(updateProgression(progressionId))\n };\n };\n\nconst noExtraLifeCTAProps =\n ({translate}, {dispatch}) =>\n state => {\n const progression = getCurrentProgression(state);\n const progressionId = getCurrentProgressionId(state);\n const isDead = progression.state.lives === 0;\n const chapterTitle = isNewChapter(state, progression)\n ? translate('Next chapter')\n : translate('Next');\n\n const ctaProps = {\n title: isDead ? translate('Game over') : chapterTitle,\n onClick: () => dispatch(selectProgression(progressionId)),\n nextStepTitle: isDead ? translate('Click to continue') : getNextStepTitle(state)\n };\n\n return omitBy(isUndefined, ctaProps);\n };\n\nexport const createHeaderCTA = (options, store) => {\n const extraLifeCTAProps_ = extraLifeCTAProps(options, store);\n const noExtraLifeCTAProps_ = noExtraLifeCTAProps(options, store);\n\n return state => {\n const progression = getCurrentProgression(state);\n const isExtraLifeActive = get('state.nextContent.ref', progression) === 'extraLife';\n const ctaProps = isExtraLifeActive ? extraLifeCTAProps_ : noExtraLifeCTAProps_;\n const {title, onClick, nextStepTitle} = ctaProps(state);\n\n return omitBy(isUndefined, {\n title,\n onClick,\n nextStepTitle\n });\n };\n};\n\nexport const openPopinAssistance = (dispatch, progression) => () =>\n dispatch(openAssistance(progression));\n\nexport const popinCorrectionStateToProps = (options, store) => {\n const getResourcesProps_ = getResourcesProps(options, store);\n const createHeaderCTA_ = createHeaderCTA(options, store);\n\n return state => {\n const {translate} = options;\n const {dispatch} = store;\n const toggleAccordionSection = sectionId => dispatch(toggleAccordion(sectionId));\n const slide = getPreviousSlide(state);\n const engineConfig = getEngineConfig(state);\n const progression = getCurrentProgression(state);\n const isExtraLifeAvailable = get('remainingLifeRequests', engineConfig) > 0;\n const remainingLifeRequests = get('state.remainingLifeRequests', progression);\n const accordion = get('ui.corrections.accordion', state);\n const correction = getCurrentCorrection(state);\n const correctAnswer = correction.correctAnswer;\n const corrections = correction.corrections;\n const isCorrect = corrections.length === 0 ? null : get('state.isCorrect')(progression);\n const isLoading = isNil(isCorrect);\n\n const isExtraLifeActive = get('state.nextContent.ref', progression) === 'extraLife';\n const extraLifeGranted = isExtraLifeActive && hasViewedAResourceAtThisStep(state);\n const mayAcceptExtraLife = isExtraLifeActive && !extraLifeGranted;\n const noMoreExtraLife = isExtraLifeAvailable && !isCorrect && remainingLifeRequests === 0;\n const {hide, count: lives} = getLives(state);\n const header = isLoading\n ? {}\n : {\n title: translate(isCorrect ? 'Good job' : 'Ouch'),\n subtitle: translate(isCorrect ? 'Good answer' : 'Wrong answer'),\n failed: !isCorrect,\n lives: hide ? null : lives\n };\n const question = {\n header: getOr('', 'question.header', slide),\n answerPrefix: translate('Correct answer'),\n answer: join(', ', correctAnswer)\n };\n\n const resources = getResourcesProps_(state, slide);\n\n return {\n header: isLoading\n ? {type: 'popinCorrection'}\n : assign(\n {\n type: 'popinCorrection',\n lives: 1,\n title: '',\n subtitle: '',\n corrections,\n cta: !mayAcceptExtraLife ? createHeaderCTA_(state) : undefined\n },\n header\n ),\n gameOver: noMoreExtraLife,\n popinError: mapStateToErrorPopinProps(dispatch)(state),\n overlay: mayAcceptExtraLife\n ? {\n title: translate('Bonus!'),\n text: translate('Get an extra life by viewing the lesson'),\n lifeAmount: 1\n }\n : undefined,\n extraLifeGranted,\n quit: mayAcceptExtraLife\n ? {\n cta: createHeaderCTA_(state)\n }\n : undefined,\n question,\n resources: {\n title: translate('Access the lesson'),\n value: resources,\n open: getOr(false, '0', accordion)\n },\n klf: {\n title: translate('Key point'),\n value: getOr('', 'klf', slide),\n open: getOr(false, '1', accordion)\n },\n tips: {\n title: translate('Did you know that?'),\n value: getOr('', 'tips', slide),\n open: getOr(false, '2', accordion)\n },\n onClick: toggleAccordionSection,\n assistanceLink: {\n title: translate('Need help? Found a bug? Report it here'),\n onClick: openPopinAssistance(dispatch, progression)\n }\n };\n };\n};\n"],"mappings":";;;;;;;;;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AAgBA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAsD,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtD,MAAMG,YAAY,GAAGA,CAACC,KAAK,EAAEC,WAAW,KAAK;EAC3C,IACEA,WAAW,CAACC,OAAO,CAACC,IAAI,KAAK,OA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