@coorpacademy/components 10.22.8 → 10.22.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/es/molecule/cm-popin/index.js +4 -2
  2. package/es/molecule/cm-popin/index.js.map +1 -1
  3. package/es/molecule/review-correction-popin/prop-types.js +0 -1
  4. package/es/molecule/review-correction-popin/prop-types.js.map +1 -1
  5. package/es/organism/review-congrats/style.css +1 -1
  6. package/es/organism/review-slide/index.js +184 -0
  7. package/es/organism/review-slide/index.js.map +1 -0
  8. package/es/organism/review-slide/prop-types.js +37 -0
  9. package/es/organism/review-slide/prop-types.js.map +1 -0
  10. package/es/organism/review-slide/style.css +171 -0
  11. package/es/organism/review-stacked-slides/index.js +81 -0
  12. package/es/organism/review-stacked-slides/index.js.map +1 -0
  13. package/es/organism/review-stacked-slides/prop-types.js +16 -0
  14. package/es/organism/review-stacked-slides/prop-types.js.map +1 -0
  15. package/es/organism/review-stacked-slides/style.css +179 -0
  16. package/es/template/app-review/index.js +7 -8
  17. package/es/template/app-review/index.js.map +1 -1
  18. package/es/template/app-review/index.native.js +6 -10
  19. package/es/template/app-review/index.native.js.map +1 -1
  20. package/es/template/app-review/player/index.js +36 -0
  21. package/es/template/app-review/player/index.js.map +1 -0
  22. package/es/template/app-review/{slides → player}/index.native.js +15 -13
  23. package/es/template/app-review/player/index.native.js.map +1 -0
  24. package/es/template/app-review/player/prop-types.js +12 -0
  25. package/es/template/app-review/player/prop-types.js.map +1 -0
  26. package/es/template/app-review/player/style.css +41 -0
  27. package/es/template/app-review/prop-types.js +3 -3
  28. package/es/template/app-review/prop-types.js.map +1 -1
  29. package/lib/molecule/cm-popin/index.js +4 -2
  30. package/lib/molecule/cm-popin/index.js.map +1 -1
  31. package/lib/molecule/review-correction-popin/prop-types.js +0 -1
  32. package/lib/molecule/review-correction-popin/prop-types.js.map +1 -1
  33. package/lib/organism/review-congrats/style.css +1 -1
  34. package/lib/organism/review-slide/index.js +206 -0
  35. package/lib/organism/review-slide/index.js.map +1 -0
  36. package/lib/organism/review-slide/prop-types.js +50 -0
  37. package/lib/organism/review-slide/prop-types.js.map +1 -0
  38. package/lib/organism/review-slide/style.css +171 -0
  39. package/lib/organism/review-stacked-slides/index.js +99 -0
  40. package/lib/organism/review-stacked-slides/index.js.map +1 -0
  41. package/lib/organism/review-stacked-slides/prop-types.js +30 -0
  42. package/lib/organism/review-stacked-slides/prop-types.js.map +1 -0
  43. package/lib/organism/review-stacked-slides/style.css +179 -0
  44. package/lib/template/app-review/index.js +6 -8
  45. package/lib/template/app-review/index.js.map +1 -1
  46. package/lib/template/app-review/index.native.js +6 -11
  47. package/lib/template/app-review/index.native.js.map +1 -1
  48. package/lib/template/app-review/player/index.js +51 -0
  49. package/lib/template/app-review/player/index.js.map +1 -0
  50. package/lib/template/app-review/{slides → player}/index.native.js +14 -12
  51. package/lib/template/app-review/player/index.native.js.map +1 -0
  52. package/lib/template/app-review/player/prop-types.js +25 -0
  53. package/lib/template/app-review/player/prop-types.js.map +1 -0
  54. package/lib/template/app-review/player/style.css +41 -0
  55. package/lib/template/app-review/prop-types.js +3 -3
  56. package/lib/template/app-review/prop-types.js.map +1 -1
  57. package/package.json +2 -2
  58. package/es/template/app-review/slides/index.js +0 -352
  59. package/es/template/app-review/slides/index.js.map +0 -1
  60. package/es/template/app-review/slides/index.native.js.map +0 -1
  61. package/es/template/app-review/slides/prop-types.js +0 -111
  62. package/es/template/app-review/slides/prop-types.js.map +0 -1
  63. package/es/template/app-review/slides/style.css +0 -409
  64. package/lib/template/app-review/slides/index.js +0 -385
  65. package/lib/template/app-review/slides/index.js.map +0 -1
  66. package/lib/template/app-review/slides/index.native.js.map +0 -1
  67. package/lib/template/app-review/slides/prop-types.js +0 -131
  68. package/lib/template/app-review/slides/prop-types.js.map +0 -1
  69. package/lib/template/app-review/slides/style.css +0 -409
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/review-correction-popin/prop-types.js"],"names":["type","PropTypes","oneOf","resultLabel","string","information","shape","label","message","next","onClick","func","klf","tooltip"],"mappings":";;;;;AAAA;;;;eAEe;AACbA,EAAAA,IAAI,EAAEC,mBAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,OAAV,CAAhB,CADO;AAEbC,EAAAA,WAAW,EAAEF,mBAAUG,MAFV;AAGbC,EAAAA,WAAW,EAAEJ,mBAAUK,KAAV,CAAgB;AAC3BC,IAAAA,KAAK,EAAEN,mBAAUG,MADU;AAE3BI,IAAAA,OAAO,EAAEP,mBAAUG;AAFQ,GAAhB,CAHA;AAObK,EAAAA,IAAI,EAAER,mBAAUK,KAAV,CAAgB;AACpBC,IAAAA,KAAK,EAAEN,mBAAUG,MADG;AAEpBM,IAAAA,OAAO,EAAET,mBAAUU,IAFC;AAGpB,iBAAaV,mBAAUG,MAHH;AAIpB,kBAAcH,mBAAUG;AAJJ,GAAhB,CAPO;AAabQ,EAAAA,GAAG,EAAEX,mBAAUK,KAAV,CAAgB;AACnBC,IAAAA,KAAK,EAAEN,mBAAUG,MADE;AAEnBM,IAAAA,OAAO,EAAET,mBAAUU,IAFA;AAGnBE,IAAAA,OAAO,EAAEZ,mBAAUG;AAHA,GAAhB;AAbQ,C","sourcesContent":["import PropTypes from 'prop-types';\n\nexport default {\n type: PropTypes.oneOf(['right', 'wrong']),\n resultLabel: PropTypes.string,\n information: PropTypes.shape({\n label: PropTypes.string,\n message: PropTypes.string\n }),\n next: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string\n }),\n klf: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n tooltip: PropTypes.string\n })\n};\n"],"file":"prop-types.js"}
1
+ {"version":3,"sources":["../../../src/molecule/review-correction-popin/prop-types.js"],"names":["type","PropTypes","oneOf","resultLabel","string","information","shape","label","message","next","onClick","func","klf","tooltip"],"mappings":";;;;;AAAA;;;;eAEe;AACbA,EAAAA,IAAI,EAAEC,mBAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,OAAV,CAAhB,CADO;AAEbC,EAAAA,WAAW,EAAEF,mBAAUG,MAFV;AAGbC,EAAAA,WAAW,EAAEJ,mBAAUK,KAAV,CAAgB;AAC3BC,IAAAA,KAAK,EAAEN,mBAAUG,MADU;AAE3BI,IAAAA,OAAO,EAAEP,mBAAUG;AAFQ,GAAhB,CAHA;AAObK,EAAAA,IAAI,EAAER,mBAAUK,KAAV,CAAgB;AACpBC,IAAAA,KAAK,EAAEN,mBAAUG,MADG;AAEpBM,IAAAA,OAAO,EAAET,mBAAUU,IAFC;AAGpB,iBAAaV,mBAAUG,MAHH;AAIpB,kBAAcH,mBAAUG;AAJJ,GAAhB,CAPO;AAabQ,EAAAA,GAAG,EAAEX,mBAAUK,KAAV,CAAgB;AACnBC,IAAAA,KAAK,EAAEN,mBAAUG,MADE;AAEnBS,IAAAA,OAAO,EAAEZ,mBAAUG;AAFA,GAAhB;AAbQ,C","sourcesContent":["import PropTypes from 'prop-types';\n\nexport default {\n type: PropTypes.oneOf(['right', 'wrong']),\n resultLabel: PropTypes.string,\n information: PropTypes.shape({\n label: PropTypes.string,\n message: PropTypes.string\n }),\n next: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string\n }),\n klf: PropTypes.shape({\n label: PropTypes.string,\n tooltip: PropTypes.string\n })\n};\n"],"file":"prop-types.js"}
@@ -277,7 +277,7 @@ _:-ms-fullscreen,
277
277
  display: flex;
278
278
  flex-direction: column;
279
279
  margin-top: 25px;
280
- width: 90%;
280
+ max-width: 335px;
281
281
  }
282
282
 
283
283
  .buttonRevise {
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _react = _interopRequireWildcard(require("react"));
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+
12
+ var _get = _interopRequireDefault(require("lodash/fp/get"));
13
+
14
+ var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
15
+
16
+ var _answer = _interopRequireDefault(require("../../molecule/answer"));
17
+
18
+ var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
19
+
20
+ var _provider = _interopRequireDefault(require("../../atom/provider"));
21
+
22
+ var _reviewCorrectionPopin = _interopRequireDefault(require("../../molecule/review-correction-popin"));
23
+
24
+ var _propTypes2 = _interopRequireDefault(require("./prop-types"));
25
+
26
+ var _style = _interopRequireDefault(require("./style.css"));
27
+
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
+
30
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
31
+
32
+ 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; }
33
+
34
+ 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); }
35
+
36
+ const CorrectionPopin = ({
37
+ correctionPopinProps,
38
+ slideIndex,
39
+ showCorrectionPopin,
40
+ animateCorrectionPopin
41
+ }) => {
42
+ if (!showCorrectionPopin) return null;
43
+ const klf = (0, _getOr.default)({}, 'klf', correctionPopinProps);
44
+ const information = (0, _getOr.default)({
45
+ label: '',
46
+ message: ''
47
+ }, 'information', correctionPopinProps);
48
+ const next = (0, _get.default)('next', correctionPopinProps);
49
+ const _correctionPopinProps = {
50
+ next: {
51
+ onClick: () => {
52
+ // eslint-disable-next-line no-console
53
+ console.log('Next Slide');
54
+ },
55
+ label: next && next.label,
56
+ 'data-name': `next-question-button-${slideIndex}`,
57
+ 'aria-label': next && next['aria-label']
58
+ },
59
+ klf,
60
+ information,
61
+ type: correctionPopinProps.type,
62
+ resultLabel: correctionPopinProps.resultLabel
63
+ };
64
+ return /*#__PURE__*/_react.default.createElement("div", {
65
+ className: (0, _classnames.default)(_style.default.correctionPopinWrapper, animateCorrectionPopin ? _style.default.popinAnimation : null)
66
+ }, /*#__PURE__*/_react.default.createElement(_reviewCorrectionPopin.default, _correctionPopinProps));
67
+ };
68
+
69
+ CorrectionPopin.propTypes = process.env.NODE_ENV !== "production" ? {
70
+ slideIndex: _propTypes.default.string,
71
+ showCorrectionPopin: _propTypes.default.bool,
72
+ animateCorrectionPopin: _propTypes.default.bool,
73
+ correctionPopinProps: _propTypes2.default.correctionPopinProps
74
+ } : {};
75
+
76
+ const ValidateButton = ({
77
+ slideIndex,
78
+ validateButton,
79
+ primarySkinColor
80
+ }) => {
81
+ const {
82
+ label,
83
+ onClick,
84
+ disabled
85
+ } = validateButton;
86
+ const validateButtonProps = {
87
+ type: 'primary',
88
+ label,
89
+ 'aria-label': label,
90
+ 'data-name': `slide-validate-button-${slideIndex}`,
91
+ onClick,
92
+ disabled,
93
+ className: _style.default.validateButton,
94
+ customStyle: {
95
+ backgroundColor: primarySkinColor
96
+ }
97
+ /*
98
+ slide validation action, this will trigger the correction popin
99
+ (with the useEffect that fires the dispatchers, if there is a nextContent content,
100
+ it will be loaded here) but will not trigger any animations unless the endReview
101
+ signal is received (all slide will disappear, also fired in a useEffect),
102
+ if it is the last slide and the content needs to be different, then that update will
103
+ be handled on the next slide logic but the content will be carried from here.
104
+ onClick: async () => {
105
+ // endReview based on nextContent ref exit node values: 'successExitNode' : 'failExitNode'
106
+ await validateSlide();
107
+ },
108
+ */
109
+
110
+ };
111
+ return /*#__PURE__*/_react.default.createElement("div", {
112
+ key: "button-wrapper",
113
+ className: _style.default.validateButtonWrapper
114
+ }, /*#__PURE__*/_react.default.createElement(_buttonLink.default, validateButtonProps));
115
+ };
116
+
117
+ ValidateButton.propTypes = process.env.NODE_ENV !== "production" ? {
118
+ slideIndex: _propTypes.default.string,
119
+ validateButton: _propTypes2.default.validateButton,
120
+ primarySkinColor: _propTypes.default.string
121
+ } : {};
122
+
123
+ const QuestionContainer = props => {
124
+ const {
125
+ answerUI,
126
+ questionText,
127
+ questionOrigin
128
+ } = props;
129
+ if (!answerUI || !questionText) return null;
130
+ const answerProps = (0, _get.default)(['model', 'choices'], answerUI) ?
131
+ /* istanbul ignore next */
132
+ _extends(_extends({}, answerUI), {}, {
133
+ model: _extends(_extends({}, answerUI.model), {}, {
134
+ answers: answerUI.model.choices
135
+ })
136
+ }) : answerUI;
137
+ return /*#__PURE__*/_react.default.createElement("div", {
138
+ key: "content-container",
139
+ className: _style.default.slideContentContainer
140
+ }, /*#__PURE__*/_react.default.createElement("div", {
141
+ key: "from-course",
142
+ className: _style.default.questionOrigin
143
+ }, questionOrigin), /*#__PURE__*/_react.default.createElement("div", {
144
+ key: "title",
145
+ className: _style.default.question
146
+ }, questionText), /*#__PURE__*/_react.default.createElement("div", {
147
+ key: "help",
148
+ className: _style.default.help
149
+ }, (0, _get.default)('help', answerUI)), /*#__PURE__*/_react.default.createElement("div", {
150
+ key: "answer-container",
151
+ className: _style.default.answerContainer
152
+ }, /*#__PURE__*/_react.default.createElement(_answer.default, _extends({}, answerProps, {
153
+ key: "answer"
154
+ }))));
155
+ };
156
+
157
+ QuestionContainer.propTypes = process.env.NODE_ENV !== "production" ? {
158
+ answerUI: _propTypes.default.shape(_propTypes2.default.slide.answerUI),
159
+ questionText: _propTypes.default.string,
160
+ questionOrigin: _propTypes.default.string
161
+ } : {};
162
+
163
+ const Slide = (props, context) => {
164
+ const {
165
+ slide,
166
+ validateButton,
167
+ correctionPopinProps,
168
+ slideIndex = '0'
169
+ } = props;
170
+ const {
171
+ skin
172
+ } = context;
173
+ const primarySkinColor = (0, _react.useMemo)(() => (0, _getOr.default)('#00B0FF', 'common.primary', skin), [skin]);
174
+ const {
175
+ parentContentTitle,
176
+ questionText,
177
+ answerUI,
178
+ showCorrectionPopin,
179
+ animateCorrectionPopin
180
+ } = slide;
181
+ return /*#__PURE__*/_react.default.createElement("div", {
182
+ "data-name": `slide-container`,
183
+ className: _style.default.slide
184
+ }, /*#__PURE__*/_react.default.createElement(QuestionContainer, {
185
+ questionOrigin: parentContentTitle,
186
+ questionText: questionText,
187
+ answerUI: answerUI
188
+ }), /*#__PURE__*/_react.default.createElement(ValidateButton, {
189
+ slideIndex: slideIndex,
190
+ validateButton: validateButton,
191
+ primarySkinColor: primarySkinColor
192
+ }), /*#__PURE__*/_react.default.createElement(CorrectionPopin, {
193
+ correctionPopinProps: correctionPopinProps,
194
+ slideIndex: slideIndex,
195
+ showCorrectionPopin: showCorrectionPopin,
196
+ animateCorrectionPopin: animateCorrectionPopin
197
+ }));
198
+ };
199
+
200
+ Slide.propTypes = process.env.NODE_ENV !== "production" ? _propTypes2.default : {};
201
+ Slide.contextTypes = {
202
+ skin: _provider.default.childContextTypes.skin
203
+ };
204
+ var _default = Slide;
205
+ exports.default = _default;
206
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/organism/review-slide/index.js"],"names":["CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","klf","information","label","message","next","_correctionPopinProps","onClick","console","log","type","resultLabel","style","correctionPopinWrapper","popinAnimation","propTypes","PropTypes","string","bool","ValidateButton","validateButton","primarySkinColor","disabled","validateButtonProps","className","customStyle","backgroundColor","validateButtonWrapper","QuestionContainer","props","answerUI","questionText","questionOrigin","answerProps","model","answers","choices","slideContentContainer","question","help","answerContainer","shape","slide","Slide","context","skin","parentContentTitle","contextTypes","Provider","childContextTypes"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,eAAe,GAAG,CAAC;AACvBC,EAAAA,oBADuB;AAEvBC,EAAAA,UAFuB;AAGvBC,EAAAA,mBAHuB;AAIvBC,EAAAA;AAJuB,CAAD,KAKlB;AACJ,MAAI,CAACD,mBAAL,EAA0B,OAAO,IAAP;AAE1B,QAAME,GAAG,GAAG,oBAAM,EAAN,EAAU,KAAV,EAAiBJ,oBAAjB,CAAZ;AACA,QAAMK,WAAW,GAAG,oBAAM;AAACC,IAAAA,KAAK,EAAE,EAAR;AAAYC,IAAAA,OAAO,EAAE;AAArB,GAAN,EAAgC,aAAhC,EAA+CP,oBAA/C,CAApB;AACA,QAAMQ,IAAI,GAAG,kBAAI,MAAJ,EAAYR,oBAAZ,CAAb;AAEA,QAAMS,qBAAqB,GAAG;AAC5BD,IAAAA,IAAI,EAAE;AACJE,MAAAA,OAAO,EAAE,MAAM;AACb;AACAC,QAAAA,OAAO,CAACC,GAAR,CAAY,YAAZ;AACD,OAJG;AAKJN,MAAAA,KAAK,EAAEE,IAAI,IAAIA,IAAI,CAACF,KALhB;AAMJ,mBAAc,wBAAuBL,UAAW,EAN5C;AAOJ,oBAAcO,IAAI,IAAIA,IAAI,CAAC,YAAD;AAPtB,KADsB;AAU5BJ,IAAAA,GAV4B;AAW5BC,IAAAA,WAX4B;AAY5BQ,IAAAA,IAAI,EAAEb,oBAAoB,CAACa,IAZC;AAa5BC,IAAAA,WAAW,EAAEd,oBAAoB,CAACc;AAbN,GAA9B;AAgBA,sBACE;AACE,IAAA,SAAS,EAAE,yBACTC,eAAMC,sBADG,EAETb,sBAAsB,GAAGY,eAAME,cAAT,GAA0B,IAFvC;AADb,kBAME,6BAA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AAAQtB,IAAAA,cAAR;AAAwBvB,IAAAA,oBAAxB;AAA8CC,IAAAA,UAAU,GAAG;AAA3D,MAAkE+B,KAAxE;AAEA,QAAM;AAACgB,IAAAA;AAAD,MAASD,OAAf;AACA,QAAMvB,gBAAgB,GAAG,oBAAQ,MAAM,oBAAM,SAAN,EAAiB,gBAAjB,EAAmCwB,IAAnC,CAAd,EAAwD,CAACA,IAAD,CAAxD,CAAzB;AACA,QAAM;AACJC,IAAAA,kBADI;AAEJf,IAAAA,YAFI;AAGJD,IAAAA,QAHI;AAIJ/B,IAAAA,mBAJI;AAKJC,IAAAA;AALI,MAMF0C,KANJ;AAQA,sBACE;AAAK,iBAAY,iBAAjB;AAAmC,IAAA,SAAS,EAAE9B,eAAM8B;AAApD,kBACE,6BAAC,iBAAD;AACE,IAAA,cAAc,EAAEI,kBADlB;AAEE,IAAA,YAAY,EAAEf,YAFhB;AAGE,IAAA,QAAQ,EAAED;AAHZ,IADF,eAME,6BAAC,cAAD;AACE,IAAA,UAAU,EAAEhC,UADd;AAEE,IAAA,cAAc,EAAEsB,cAFlB;AAGE,IAAA,gBAAgB,EAAEC;AAHpB,IANF,eAWE,6BAAC,eAAD;AACE,IAAA,oBAAoB,EAAExB,oBADxB;AAEE,IAAA,UAAU,EAAEC,UAFd;AAGE,IAAA,mBAAmB,EAAEC,mBAHvB;AAIE,IAAA,sBAAsB,EAAEC;AAJ1B,IAXF,CADF;AAoBD,CAjCD;;AAmCA2C,KAAK,CAAC5B,SAAN,2CAAkBA,mBAAlB;AAEA4B,KAAK,CAACI,YAAN,GAAqB;AACnBF,EAAAA,IAAI,EAAEG,kBAASC,iBAAT,CAA2BJ;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 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 parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <div data-name={`slide-container`} className={style.slide}>\n <QuestionContainer\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n />\n <ValidateButton\n slideIndex={slideIndex}\n validateButton={validateButton}\n primarySkinColor={primarySkinColor}\n />\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\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"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = exports.SlideProp = void 0;
5
+
6
+ var _propTypes = _interopRequireDefault(require("prop-types"));
7
+
8
+ var _propTypes2 = _interopRequireDefault(require("../../molecule/review-correction-popin/prop-types"));
9
+
10
+ var _propTypes3 = _interopRequireDefault(require("../../molecule/answer/prop-types"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ const SlideProp = _propTypes.default.shape({
15
+ hidden: _propTypes.default.bool,
16
+ position: _propTypes.default.number,
17
+ animationType: _propTypes.default.string,
18
+ // 'unstack' | 'restack'
19
+ isCorrect: _propTypes.default.bool,
20
+ animateCorrectionPopin: _propTypes.default.bool,
21
+ showCorrectionPopin: _propTypes.default.bool,
22
+ parentContentTitle: _propTypes.default.string,
23
+ questionText: _propTypes.default.string,
24
+ answerUI: _propTypes.default.shape(_propTypes3.default)
25
+ });
26
+
27
+ exports.SlideProp = SlideProp;
28
+ var _default = {
29
+ slideIndex: _propTypes.default.string,
30
+ slide: SlideProp,
31
+ validateButton: _propTypes.default.shape({
32
+ label: _propTypes.default.string.isRequired,
33
+ onClick: _propTypes.default.func.isRequired,
34
+ disabled: _propTypes.default.bool
35
+ }),
36
+ correctionPopinProps: _propTypes.default.shape({
37
+ klf: _propTypes2.default.klf,
38
+ information: _propTypes2.default.information,
39
+ next: _propTypes.default.shape({
40
+ label: _propTypes.default.string,
41
+ 'aria-label': _propTypes.default.string // Pourquoi le onClick du next n'est pas ici !
42
+ // updateSlidesOnNext: PropTypes.func.isRequired ???
43
+
44
+ }),
45
+ resultLabel: _propTypes2.default.resultLabel,
46
+ type: _propTypes2.default.type
47
+ })
48
+ };
49
+ exports.default = _default;
50
+ //# sourceMappingURL=prop-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/organism/review-slide/prop-types.js"],"names":["SlideProp","PropTypes","shape","hidden","bool","position","number","animationType","string","isCorrect","animateCorrectionPopin","showCorrectionPopin","parentContentTitle","questionText","answerUI","AnswerPropTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAEO,MAAMA,SAAS,GAAGC,mBAAUC,KAAV,CAAgB;AACvCC,EAAAA,MAAM,EAAEF,mBAAUG,IADqB;AAEvCC,EAAAA,QAAQ,EAAEJ,mBAAUK,MAFmB;AAGvCC,EAAAA,aAAa,EAAEN,mBAAUO,MAHc;AAGN;AACjCC,EAAAA,SAAS,EAAER,mBAAUG,IAJkB;AAKvCM,EAAAA,sBAAsB,EAAET,mBAAUG,IALK;AAMvCO,EAAAA,mBAAmB,EAAEV,mBAAUG,IANQ;AAOvCQ,EAAAA,kBAAkB,EAAEX,mBAAUO,MAPS;AAQvCK,EAAAA,YAAY,EAAEZ,mBAAUO,MARe;AASvCM,EAAAA,QAAQ,EAAEb,mBAAUC,KAAV,CAAgBa,mBAAhB;AAT6B,CAAhB,CAAlB;;;eAYQ;AACbC,EAAAA,UAAU,EAAEf,mBAAUO,MADT;AAEbS,EAAAA,KAAK,EAAEjB,SAFM;AAGbkB,EAAAA,cAAc,EAAEjB,mBAAUC,KAAV,CAAgB;AAC9BiB,IAAAA,KAAK,EAAElB,mBAAUO,MAAV,CAAiBY,UADM;AAE9BC,IAAAA,OAAO,EAAEpB,mBAAUqB,IAAV,CAAeF,UAFM;AAG9BG,IAAAA,QAAQ,EAAEtB,mBAAUG;AAHU,GAAhB,CAHH;AAQboB,EAAAA,oBAAoB,EAAEvB,mBAAUC,KAAV,CAAgB;AACpCuB,IAAAA,GAAG,EAAEC,oBAA+BD,GADA;AAEpCE,IAAAA,WAAW,EAAED,oBAA+BC,WAFR;AAGpCC,IAAAA,IAAI,EAAE3B,mBAAUC,KAAV,CAAgB;AACpBiB,MAAAA,KAAK,EAAElB,mBAAUO,MADG;AAEpB,oBAAcP,mBAAUO,MAFJ,CAEW;AAC/B;;AAHoB,KAAhB,CAH8B;AAQpCqB,IAAAA,WAAW,EAAEH,oBAA+BG,WARR;AASpCC,IAAAA,IAAI,EAAEJ,oBAA+BI;AATD,GAAhB;AART,C","sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewCorrectionPopinPropTypes from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes from '../../molecule/answer/prop-types';\n\nexport const SlideProp = PropTypes.shape({\n hidden: PropTypes.bool,\n position: PropTypes.number,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nexport default {\n slideIndex: PropTypes.string,\n slide: SlideProp,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n"],"file":"prop-types.js"}
@@ -0,0 +1,171 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value black from colors;
3
+ @value white from colors;
4
+ @value cm_blue_900 from colors;
5
+ @value cm_grey_400 from colors;
6
+ @value breakpoints: "../../variables/breakpoints.css";
7
+ @value mobile from breakpoints;
8
+ @value tablet from breakpoints;
9
+
10
+ .fontBase {
11
+ font-family: "Gilroy";
12
+ user-select: none;
13
+ }
14
+
15
+ .slide{
16
+ align-items: center;
17
+ display: flex;
18
+ flex-direction: column;
19
+ justify-content: flex-start;
20
+ }
21
+
22
+ .slideContentContainer {
23
+ margin-top: 15px;
24
+ height: 563px;
25
+ display: flex;
26
+ justify-items: center;
27
+ align-items: center;
28
+ flex-direction: column;
29
+ overflow-y: auto;
30
+ position: relative;
31
+ }
32
+
33
+ /* ie fallback */
34
+ _:-ms-fullscreen, :root .slideContentContainer {
35
+ width: 100%;
36
+ }
37
+
38
+ .validateButtonWrapper {
39
+ position: absolute;
40
+ bottom: 64px;
41
+ background-color: black;
42
+ border-radius: 7px;
43
+ min-width: 250px;
44
+ width: min-content;
45
+ }
46
+
47
+ /* ie fallback */
48
+ _:-ms-fullscreen, :root .validateButtonWrapper {
49
+ width: 300px;
50
+ left: 40%;
51
+ right: 40%;
52
+ }
53
+
54
+ .answerContainer {
55
+ width: 95%;
56
+ display: flex;
57
+ justify-content: center;
58
+ height: 100%;
59
+ /*
60
+ To break wrappers layout (to enclose large answers in the scroll bar), works like
61
+ display: contents for this use case but w ie11 support
62
+ */
63
+ display: grid;
64
+ }
65
+
66
+ .question {
67
+ composes: fontBase;
68
+ font-size: 20px;
69
+ font-weight: bold;
70
+ color: cm_blue_900;
71
+ text-align: center;
72
+ margin: 24px 0 4px;
73
+ max-width: 70%;
74
+ width: 100%;
75
+ padding: 0 9px;
76
+ box-sizing: border-box;
77
+ }
78
+
79
+ .questionOrigin {
80
+ composes: fontBase;
81
+ font-size: 15px;
82
+ color: cm_blue_900;
83
+ margin-top: 49px;
84
+ text-align: center;
85
+ width: 85%;
86
+ }
87
+
88
+ .questionOrigin:empty:after {
89
+ content: "\a0";
90
+ }
91
+
92
+ .help {
93
+ composes: fontBase;
94
+ font-size: 15px;
95
+ color: cm_grey_400;
96
+ flex-grow: 0.1;
97
+ margin: 4px 0 10px;
98
+ text-align: center;
99
+ max-width: 70%;
100
+ width: 100%;
101
+ }
102
+
103
+ /* to keep the content space even if the help label is empty */
104
+ .help:empty:after {
105
+ content: "\a0";
106
+ }
107
+
108
+ @keyframes popInAnimation {
109
+ from {
110
+ transform: translate3d(0, 200px, 0);
111
+ }
112
+ to {
113
+ transform: translate3d(0, 0, 0);
114
+ }
115
+ }
116
+
117
+ .correctionPopinWrapper {
118
+ position: absolute;
119
+ bottom: 0px;
120
+ border-radius: 7px;
121
+ margin: 0 15px 40px;
122
+ width: 95%;
123
+ }
124
+
125
+ .popinAnimation {
126
+ animation: popInAnimation 0.5s ease-out forwards;
127
+ }
128
+
129
+ /* ie fallback */
130
+ _:-ms-fullscreen, :root .correctionPopinWrapper {
131
+ left: 15px;
132
+ }
133
+
134
+ .validateButton {
135
+ color: white;
136
+ transition: opacity 0.25s ease-in;
137
+ }
138
+
139
+ .validateButton:hover {
140
+ opacity: 0.8;
141
+ }
142
+
143
+ @media tablet {
144
+ .slideContentContainer {
145
+ height: 473px;
146
+ }
147
+
148
+ @keyframes popInAnimation {
149
+ from {
150
+ transform: translate3d(0, 400px, 0);
151
+ }
152
+ to {
153
+ transform: translate3d(0, 0, 0);
154
+ }
155
+ }
156
+ }
157
+
158
+ @media mobile {
159
+ .slideContentContainer {
160
+ height: 511px;
161
+ }
162
+
163
+ @keyframes popInAnimation {
164
+ from {
165
+ transform: translate3d(0, 500px, 0);
166
+ }
167
+ to {
168
+ transform: translate3d(0, 0, 0);
169
+ }
170
+ }
171
+ }
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = exports.TOTAL_SLIDES_STACK = void 0;
5
+
6
+ var _react = _interopRequireDefault(require("react"));
7
+
8
+ var _classnames = _interopRequireDefault(require("classnames"));
9
+
10
+ var _toString2 = _interopRequireDefault(require("lodash/fp/toString"));
11
+
12
+ var _isNil = _interopRequireDefault(require("lodash/fp/isNil"));
13
+
14
+ var _loader = _interopRequireDefault(require("../../atom/loader"));
15
+
16
+ var _reviewSlide = _interopRequireDefault(require("../review-slide"));
17
+
18
+ var _propTypes = _interopRequireDefault(require("./prop-types"));
19
+
20
+ var _style = _interopRequireDefault(require("./style.css"));
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
+
24
+ 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); }
25
+
26
+ const TOTAL_SLIDES_STACK = 5;
27
+ exports.TOTAL_SLIDES_STACK = TOTAL_SLIDES_STACK;
28
+ const stylesByPosition = {
29
+ 0: _style.default.position0,
30
+ 1: _style.default.position1,
31
+ 2: _style.default.position2,
32
+ 3: _style.default.position3,
33
+ 4: _style.default.position4
34
+ };
35
+
36
+ const getSlideAnimation = (action, position, hidden) => {
37
+ switch (action) {
38
+ case 'unstack':
39
+ return _style.default.slideOutHideAndIn;
40
+
41
+ case 'restack':
42
+ return _style.default.slideOutAndIn;
43
+
44
+ default:
45
+ return hidden ? _style.default.hiddenSlide : stylesByPosition[position];
46
+ }
47
+ };
48
+
49
+ const StackedSlides = ({
50
+ slides,
51
+ endReview,
52
+ validateButton,
53
+ correctionPopinProps,
54
+ loadingAriaLabel
55
+ }) => {
56
+ const stackedSlides = []; // eslint-disable-next-line fp/no-loops
57
+
58
+ for (let slideIndex = 0; slideIndex < TOTAL_SLIDES_STACK; slideIndex++) {
59
+ const slide = slides[(0, _toString2.default)(slideIndex)];
60
+ const {
61
+ animationType,
62
+ hidden,
63
+ position
64
+ } = slide;
65
+
66
+ const slideView = /*#__PURE__*/_react.default.createElement("div", {
67
+ key: `slide-${slideIndex}`,
68
+ "data-name": `slide-${slideIndex}`,
69
+ className: (0, _classnames.default)(_style.default.slideBase, getSlideAnimation(animationType, position, hidden), endReview ? _style.default.endReview : null)
70
+ }, (0, _isNil.default)(slide.answerUI) && slide.position === 0 ? /*#__PURE__*/_react.default.createElement(_loader.default, {
71
+ className: _style.default.loader,
72
+ theme: "default",
73
+ "aria-label": loadingAriaLabel
74
+ }) : /*#__PURE__*/_react.default.createElement(_reviewSlide.default, _extends({
75
+ slideIndex: (0, _toString2.default)(slideIndex),
76
+ slide,
77
+ validateButton,
78
+ correctionPopinProps
79
+ }, {
80
+ key: slideIndex
81
+ })));
82
+
83
+ stackedSlides.push(slideView);
84
+ }
85
+
86
+ return /*#__PURE__*/_react.default.createElement("div", {
87
+ key: "stacked-slides-container-y-overflow",
88
+ className: _style.default.stackedSlidesYAxisOverflowContainer
89
+ }, /*#__PURE__*/_react.default.createElement("div", {
90
+ key: "stacked-slides-container",
91
+ "data-name": "stacked-slides-container",
92
+ className: _style.default.stackedSlidesContainer
93
+ }, stackedSlides));
94
+ };
95
+
96
+ StackedSlides.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
97
+ var _default = StackedSlides;
98
+ exports.default = _default;
99
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/organism/review-stacked-slides/index.js"],"names":["TOTAL_SLIDES_STACK","stylesByPosition","style","position0","position1","position2","position3","position4","getSlideAnimation","action","position","hidden","slideOutHideAndIn","slideOutAndIn","hiddenSlide","StackedSlides","slides","endReview","validateButton","correctionPopinProps","loadingAriaLabel","stackedSlides","slideIndex","slide","animationType","slideView","slideBase","answerUI","loader","push","stackedSlidesYAxisOverflowContainer","stackedSlidesContainer","propTypes"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEO,MAAMA,kBAAkB,GAAG,CAA3B;;AAEP,MAAMC,gBAAgB,GAAG;AACvB,KAAGC,eAAMC,SADc;AAEvB,KAAGD,eAAME,SAFc;AAGvB,KAAGF,eAAMG,SAHc;AAIvB,KAAGH,eAAMI,SAJc;AAKvB,KAAGJ,eAAMK;AALc,CAAzB;;AAQA,MAAMC,iBAAiB,GAAG,CAACC,MAAD,EAASC,QAAT,EAAmBC,MAAnB,KAA8B;AACtD,UAAQF,MAAR;AACE,SAAK,SAAL;AACE,aAAOP,eAAMU,iBAAb;;AACF,SAAK,SAAL;AACE,aAAOV,eA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ACQ,IAAd,CAAmBJ,SAAnB;AACD;;AAED,sBACE;AACE,IAAA,GAAG,EAAC,qCADN;AAEE,IAAA,SAAS,EAAEvB,eAAM4B;AAFnB,kBAIE;AACE,IAAA,GAAG,EAAC,0BADN;AAEE,iBAAU,0BAFZ;AAGE,IAAA,SAAS,EAAE5B,eAAM6B;AAHnB,KAKGV,aALH,CAJF,CADF;AAcD,CAvDD;;AAyDAN,aAAa,CAACiB,SAAd,2CAA0BA,kBAA1B;eAEejB,a","sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport _toString from 'lodash/fp/toString';\nimport isNil from 'lodash/fp/isNil';\nimport Loader from '../../atom/loader';\nimport ReviewSlide from '../review-slide';\nimport propTypes from './prop-types';\nimport style from './style.css';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst stylesByPosition = {\n 0: style.position0,\n 1: style.position1,\n 2: style.position2,\n 3: style.position3,\n 4: style.position4\n};\n\nconst getSlideAnimation = (action, position, hidden) => {\n switch (action) {\n case 'unstack':\n return style.slideOutHideAndIn;\n case 'restack':\n return style.slideOutAndIn;\n default:\n return hidden ? style.hiddenSlide : stylesByPosition[position];\n }\n};\n\nconst StackedSlides = ({\n slides,\n endReview,\n validateButton,\n correctionPopinProps,\n loadingAriaLabel\n}) => {\n const stackedSlides = [];\n // eslint-disable-next-line fp/no-loops\n for (let slideIndex = 0; slideIndex < TOTAL_SLIDES_STACK; slideIndex++) {\n const slide = slides[_toString(slideIndex)];\n const {animationType, hidden, position} = slide;\n\n const slideView = (\n <div\n key={`slide-${slideIndex}`}\n data-name={`slide-${slideIndex}`}\n className={classnames(\n style.slideBase,\n getSlideAnimation(animationType, position, hidden),\n endReview ? style.endReview : null\n )}\n >\n {isNil(slide.answerUI) && slide.position === 0 ? (\n <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n ) : (\n <ReviewSlide\n {...{\n slideIndex: _toString(slideIndex),\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n )}\n </div>\n );\n stackedSlides.push(slideView);\n }\n\n return (\n <div\n key=\"stacked-slides-container-y-overflow\"\n className={style.stackedSlidesYAxisOverflowContainer}\n >\n <div\n key=\"stacked-slides-container\"\n data-name=\"stacked-slides-container\"\n className={style.stackedSlidesContainer}\n >\n {stackedSlides}\n </div>\n </div>\n );\n};\n\nStackedSlides.propTypes = propTypes;\n\nexport default StackedSlides;\n"],"file":"index.js"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _propTypes = _interopRequireDefault(require("prop-types"));
7
+
8
+ var _propTypes2 = _interopRequireWildcard(require("../review-slide/prop-types"));
9
+
10
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
11
+
12
+ 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; }
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ var _default = {
17
+ validateButton: _propTypes2.default.validateButton,
18
+ correctionPopinProps: _propTypes2.default.correctionPopinProps,
19
+ slides: _propTypes.default.shape({
20
+ '0': _propTypes2.SlideProp,
21
+ '1': _propTypes2.SlideProp,
22
+ '2': _propTypes2.SlideProp,
23
+ '3': _propTypes2.SlideProp,
24
+ '4': _propTypes2.SlideProp
25
+ }),
26
+ endReview: _propTypes.default.bool,
27
+ loadingAriaLabel: _propTypes.default.string
28
+ };
29
+ exports.default = _default;
30
+ //# sourceMappingURL=prop-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/organism/review-stacked-slides/prop-types.js"],"names":["validateButton","ReviewSlideProps","correctionPopinProps","slides","PropTypes","shape","SlideProp","endReview","bool","loadingAriaLabel","string"],"mappings":";;;;;AAAA;;AACA;;;;;;;;eAEe;AACbA,EAAAA,cAAc,EAAEC,oBAAiBD,cADpB;AAEbE,EAAAA,oBAAoB,EAAED,oBAAiBC,oBAF1B;AAGbC,EAAAA,MAAM,EAAEC,mBAAUC,KAAV,CAAgB;AACtB,SAAKC,qBADiB;AAEtB,SAAKA,qBAFiB;AAGtB,SAAKA,qBAHiB;AAItB,SAAKA,qBAJiB;AAKtB,SAAKA;AALiB,GAAhB,CAHK;AAUbC,EAAAA,SAAS,EAAEH,mBAAUI,IAVR;AAWbC,EAAAA,gBAAgB,EAAEL,mBAAUM;AAXf,C","sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewSlideProps, {SlideProp} from '../review-slide/prop-types';\n\nexport default {\n validateButton: ReviewSlideProps.validateButton,\n correctionPopinProps: ReviewSlideProps.correctionPopinProps,\n slides: PropTypes.shape({\n '0': SlideProp,\n '1': SlideProp,\n '2': SlideProp,\n '3': SlideProp,\n '4': SlideProp\n }),\n endReview: PropTypes.bool,\n loadingAriaLabel: PropTypes.string\n};\n"],"file":"prop-types.js"}