@coorpacademy/components 10.24.0 → 10.24.2

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 (131) hide show
  1. package/es/atom/autocomplete/index.js.map +1 -1
  2. package/es/atom/button-menu/index.js.map +1 -1
  3. package/es/atom/gradient/index.native.js +1 -1
  4. package/es/atom/gradient/index.native.js.map +1 -1
  5. package/es/atom/lottie-wrapper/index.js.map +1 -1
  6. package/es/atom/provider/web-context.js +1 -1
  7. package/es/atom/provider/web-context.js.map +1 -1
  8. package/es/atom/select/index.js.map +1 -1
  9. package/es/atom/select-modal/index.native.js +2 -2
  10. package/es/atom/select-modal/index.native.js.map +1 -1
  11. package/es/hoc/animation-scheduler/index.js +3 -3
  12. package/es/hoc/animation-scheduler/index.js.map +1 -1
  13. package/es/hoc/swapper/index.js +1 -1
  14. package/es/hoc/swapper/index.js.map +1 -1
  15. package/es/hoc/transition/index.js +1 -1
  16. package/es/hoc/transition/index.js.map +1 -1
  17. package/es/molecule/add-to-my-list/index.js +4 -3
  18. package/es/molecule/add-to-my-list/index.js.map +1 -1
  19. package/es/molecule/brand-tabs/index.js +22 -8
  20. package/es/molecule/brand-tabs/index.js.map +1 -1
  21. package/es/molecule/card/index.js +1 -1
  22. package/es/molecule/card/index.js.map +1 -1
  23. package/es/molecule/cm-popin/index.js +3 -3
  24. package/es/molecule/cm-popin/index.js.map +1 -1
  25. package/es/molecule/dashboard/battle-request-list/index.js +1 -1
  26. package/es/molecule/dashboard/battle-request-list/index.js.map +1 -1
  27. package/es/molecule/dashboard/news-list/index.js +1 -1
  28. package/es/molecule/dashboard/news-list/index.js.map +1 -1
  29. package/es/molecule/dashboard/review-banner/index.js +1 -1
  30. package/es/molecule/dashboard/review-banner/index.js.map +1 -1
  31. package/es/molecule/dashboard/start-battle/index.js +1 -1
  32. package/es/molecule/dashboard/start-battle/index.js.map +1 -1
  33. package/es/molecule/discipline-partners/index.js +1 -1
  34. package/es/molecule/discipline-partners/index.js.map +1 -1
  35. package/es/molecule/drag-and-drop/upload-report.js +43 -21
  36. package/es/molecule/drag-and-drop/upload-report.js.map +1 -1
  37. package/es/molecule/draggable/style.css +2 -0
  38. package/es/molecule/feedback/index.js +2 -2
  39. package/es/molecule/feedback/index.js.map +1 -1
  40. package/es/molecule/filters/index.js.map +1 -1
  41. package/es/molecule/menu-list/index.js +2 -1
  42. package/es/molecule/menu-list/index.js.map +1 -1
  43. package/es/molecule/questions/free-text/index.js.map +1 -1
  44. package/es/molecule/questions/free-text/index.native.js +12 -6
  45. package/es/molecule/questions/free-text/index.native.js.map +1 -1
  46. package/es/molecule/questions/mobile/template/index.native.js +42 -67
  47. package/es/molecule/questions/mobile/template/index.native.js.map +1 -1
  48. package/es/molecule/share/index.js +1 -1
  49. package/es/molecule/share/index.js.map +1 -1
  50. package/es/molecule/skill-card/index.js.map +1 -1
  51. package/es/organism/review-stacked-slides/index.js +6 -3
  52. package/es/organism/review-stacked-slides/index.js.map +1 -1
  53. package/es/organism/review-stacked-slides/index.native.js +6 -3
  54. package/es/organism/review-stacked-slides/index.native.js.map +1 -1
  55. package/es/template/app-player/popin-end/summary.js +4 -3
  56. package/es/template/app-player/popin-end/summary.js.map +1 -1
  57. package/es/template/app-review/template-context.js +1 -1
  58. package/es/template/app-review/template-context.js.map +1 -1
  59. package/es/template/common/dashboard/index.js +1 -1
  60. package/es/template/common/dashboard/index.js.map +1 -1
  61. package/es/template/common/discipline/index.js +1 -1
  62. package/es/template/common/discipline/index.js.map +1 -1
  63. package/es/template/teams-dashboard/index.js.map +1 -1
  64. package/es/util/navigation.js.map +1 -1
  65. package/es/util/proptypes.js.map +1 -1
  66. package/lib/atom/autocomplete/index.js.map +1 -1
  67. package/lib/atom/button-menu/index.js.map +1 -1
  68. package/lib/atom/gradient/index.native.js +1 -1
  69. package/lib/atom/gradient/index.native.js.map +1 -1
  70. package/lib/atom/lottie-wrapper/index.js.map +1 -1
  71. package/lib/atom/provider/web-context.js +1 -1
  72. package/lib/atom/provider/web-context.js.map +1 -1
  73. package/lib/atom/select/index.js.map +1 -1
  74. package/lib/atom/select-modal/index.native.js +2 -2
  75. package/lib/atom/select-modal/index.native.js.map +1 -1
  76. package/lib/hoc/animation-scheduler/index.js +3 -3
  77. package/lib/hoc/animation-scheduler/index.js.map +1 -1
  78. package/lib/hoc/swapper/index.js +1 -1
  79. package/lib/hoc/swapper/index.js.map +1 -1
  80. package/lib/hoc/transition/index.js +1 -1
  81. package/lib/hoc/transition/index.js.map +1 -1
  82. package/lib/molecule/add-to-my-list/index.js +3 -2
  83. package/lib/molecule/add-to-my-list/index.js.map +1 -1
  84. package/lib/molecule/brand-tabs/index.js +22 -8
  85. package/lib/molecule/brand-tabs/index.js.map +1 -1
  86. package/lib/molecule/card/index.js +1 -1
  87. package/lib/molecule/card/index.js.map +1 -1
  88. package/lib/molecule/cm-popin/index.js +3 -3
  89. package/lib/molecule/cm-popin/index.js.map +1 -1
  90. package/lib/molecule/dashboard/battle-request-list/index.js +1 -1
  91. package/lib/molecule/dashboard/battle-request-list/index.js.map +1 -1
  92. package/lib/molecule/dashboard/news-list/index.js +1 -1
  93. package/lib/molecule/dashboard/news-list/index.js.map +1 -1
  94. package/lib/molecule/dashboard/review-banner/index.js +1 -1
  95. package/lib/molecule/dashboard/review-banner/index.js.map +1 -1
  96. package/lib/molecule/dashboard/start-battle/index.js +1 -1
  97. package/lib/molecule/dashboard/start-battle/index.js.map +1 -1
  98. package/lib/molecule/discipline-partners/index.js +1 -1
  99. package/lib/molecule/discipline-partners/index.js.map +1 -1
  100. package/lib/molecule/drag-and-drop/upload-report.js +43 -22
  101. package/lib/molecule/drag-and-drop/upload-report.js.map +1 -1
  102. package/lib/molecule/draggable/style.css +2 -0
  103. package/lib/molecule/feedback/index.js +2 -2
  104. package/lib/molecule/feedback/index.js.map +1 -1
  105. package/lib/molecule/filters/index.js.map +1 -1
  106. package/lib/molecule/menu-list/index.js +2 -1
  107. package/lib/molecule/menu-list/index.js.map +1 -1
  108. package/lib/molecule/questions/free-text/index.js.map +1 -1
  109. package/lib/molecule/questions/free-text/index.native.js +13 -6
  110. package/lib/molecule/questions/free-text/index.native.js.map +1 -1
  111. package/lib/molecule/questions/mobile/template/index.native.js +43 -67
  112. package/lib/molecule/questions/mobile/template/index.native.js.map +1 -1
  113. package/lib/molecule/share/index.js +1 -1
  114. package/lib/molecule/share/index.js.map +1 -1
  115. package/lib/molecule/skill-card/index.js.map +1 -1
  116. package/lib/organism/review-stacked-slides/index.js +6 -3
  117. package/lib/organism/review-stacked-slides/index.js.map +1 -1
  118. package/lib/organism/review-stacked-slides/index.native.js +6 -3
  119. package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
  120. package/lib/template/app-player/popin-end/summary.js +4 -3
  121. package/lib/template/app-player/popin-end/summary.js.map +1 -1
  122. package/lib/template/app-review/template-context.js +1 -1
  123. package/lib/template/app-review/template-context.js.map +1 -1
  124. package/lib/template/common/dashboard/index.js +1 -1
  125. package/lib/template/common/dashboard/index.js.map +1 -1
  126. package/lib/template/common/discipline/index.js +1 -1
  127. package/lib/template/common/discipline/index.js.map +1 -1
  128. package/lib/template/teams-dashboard/index.js.map +1 -1
  129. package/lib/util/navigation.js.map +1 -1
  130. package/lib/util/proptypes.js.map +1 -1
  131. package/package.json +6 -5
@@ -21,14 +21,18 @@ var _templateContext = require("../../../../template/app-review/template-context
21
21
 
22
22
  var _parseTemplateString = _interopRequireDefault(require("../../../../util/parse-template-string"));
23
23
 
24
+ var _shadow = require("../../../../variables/shadow");
25
+
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
27
 
26
28
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
29
 
28
30
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
31
 
32
+ 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); }
33
+
30
34
  const createStyleSheet = theme => ({
31
- section: {
35
+ container: {
32
36
  width: '100%',
33
37
  flexDirection: 'row',
34
38
  flexWrap: 'wrap',
@@ -38,21 +42,22 @@ const createStyleSheet = theme => ({
38
42
  spaced: {
39
43
  paddingVertical: theme.spacing.tiny
40
44
  },
41
- input: {
42
- padding: theme.spacing.tiny,
43
- borderWidth: 1,
44
- borderColor: theme.colors.gray.lightMedium,
45
- borderRadius: theme.radius.common,
46
- backgroundColor: theme.colors.white,
47
- minWidth: 175
48
- },
49
45
  htmlText: {
50
- padding: theme.spacing.tiny,
51
46
  color: theme.colors.black,
52
47
  fontWeight: theme.fontWeight.bold,
53
- lineHeight: 30
48
+ lineHeight: 25
54
49
  },
55
- text: {
50
+ // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread
51
+ selectInput: _extends({
52
+ padding: theme.spacing.tiny,
53
+ borderRadius: theme.radius.regular,
54
+ minWidth: 175,
55
+ marginHorizontal: 12,
56
+ paddingVertical: 16
57
+ }, _shadow.BOX_STYLE, {
58
+ backgroundColor: theme.colors.white
59
+ }),
60
+ selectText: {
56
61
  color: theme.colors.gray.medium,
57
62
  fontWeight: theme.fontWeight.bold,
58
63
  fontSize: theme.fontSize.regular,
@@ -60,49 +65,10 @@ const createStyleSheet = theme => ({
60
65
  }
61
66
  });
62
67
 
63
- const Section = ({
64
- section,
65
- choices,
66
- index,
67
- focusedSelectId,
68
- onInputChange,
69
- handleBlur,
70
- handleFocus,
71
- isDisabled,
72
- styles
73
- }) => {
74
- const prefix = `question-section-${index + 1}`;
75
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
76
- style: styles.section,
77
- key: `container-${prefix}`
78
- }, section.map((part, id) => {
79
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
80
- key: `${prefix}-${id}`,
81
- style: {
82
- flexDirection: 'row'
83
- }
84
- }, /*#__PURE__*/_react.default.createElement(Item, {
85
- prefix: prefix,
86
- part: part,
87
- choices: choices,
88
- index: id,
89
- focusedSelectId: focusedSelectId,
90
- isDisabled: isDisabled,
91
- handleBlur: handleBlur,
92
- handleFocus: handleFocus,
93
- onInputChange: onInputChange,
94
- styles: styles
95
- }), /*#__PURE__*/_react.default.createElement(_index3.default, {
96
- type: "micro"
97
- }));
98
- }));
99
- };
100
-
101
68
  const Item = props => {
102
69
  const {
103
70
  part,
104
71
  index,
105
- prefix,
106
72
  isDisabled = false,
107
73
  focusedSelectId,
108
74
  choices,
@@ -118,10 +84,9 @@ const Item = props => {
118
84
  translations
119
85
  } = templateContext;
120
86
  const inputNames = choices.map(choice => choice.name);
121
- const id = `${prefix}-part-${index + 1}`;
87
+ const id = `question-part-${index + 1}`;
122
88
  const isFocused = focusedSelectId === id;
123
- const selectedStyle = brandTheme && {
124
- borderColor: brandTheme.colors.primary,
89
+ const coloredText = brandTheme && {
125
90
  color: brandTheme.colors.primary
126
91
  };
127
92
 
@@ -155,10 +120,16 @@ const Item = props => {
155
120
  }));
156
121
  }
157
122
 
158
- const selectStyle = [styles.input];
123
+ const selectInputStyle = [styles.selectInput];
159
124
 
160
125
  if (value) {
161
- selectStyle.push(selectedStyle);
126
+ selectInputStyle.push(coloredText);
127
+ }
128
+
129
+ const selectTextStyle = [styles.selectText];
130
+
131
+ if (value) {
132
+ selectTextStyle.push(coloredText);
162
133
  }
163
134
 
164
135
  if (choice.type === 'select') {
@@ -175,8 +146,8 @@ const Item = props => {
175
146
  onBlur: handleBlur,
176
147
  onFocus: handleFocus(id),
177
148
  onChange: handleInputChange(choice),
178
- textStyle: styles.text,
179
- style: selectStyle,
149
+ textStyle: selectTextStyle,
150
+ style: selectInputStyle,
180
151
  analyticsID: `${id}-select${selectedSuffix}${disabledSuffix}`,
181
152
  testID: `${id}-select${selectedSuffix}${disabledSuffix}`
182
153
  }));
@@ -217,22 +188,27 @@ const QuestionTemplate = props => {
217
188
  }
218
189
 
219
190
  const parts = (0, _parseTemplateString.default)(template);
220
- const sections = [parts]; // @todo remove useless sections
221
-
222
191
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
192
+ style: styleSheet.container,
223
193
  testID: "question-template"
224
- }, sections.map((section, index) => /*#__PURE__*/_react.default.createElement(Section, {
225
- key: index,
226
- section: section,
194
+ }, parts.map((part, id) => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
195
+ key: `question-part-${id}`,
196
+ style: {
197
+ flexDirection: 'row'
198
+ }
199
+ }, /*#__PURE__*/_react.default.createElement(Item, {
200
+ part: part,
227
201
  choices: choices,
228
- index: index,
202
+ index: id,
203
+ focusedSelectId: focusedSelectId,
204
+ isDisabled: isDisabled,
229
205
  handleBlur: handleBlur,
230
206
  handleFocus: handleFocus,
231
- focusedSelectId: focusedSelectId,
232
207
  onInputChange: onInputChange,
233
- isDisabled: isDisabled,
234
208
  styles: styleSheet
235
- })));
209
+ }), /*#__PURE__*/_react.default.createElement(_index3.default, {
210
+ type: "micro"
211
+ }))));
236
212
  };
237
213
 
238
214
  var _default = QuestionTemplate;
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["createStyleSheet","theme","section","width","flexDirection","flexWrap","justifyContent","alignItems","spaced","paddingVertical","spacing","tiny","input","padding","borderWidth","borderColor","colors","gray","lightMedium","borderRadius","radius","common","backgroundColor","white","minWidth","htmlText","color","black","fontWeight","bold","lineHeight","text","medium","fontSize","regular","textAlign","Section","choices","index","focusedSelectId","onInputChange","handleBlur","handleFocus","isDisabled","styles","prefix","map","part","id","Item","props","templateContext","useTemplateContext","brandTheme","translations","inputNames","choice","name","isFocused","selectedStyle","primary","type","includes","value","choiceIndex","findIndex","disabledSuffix","selectedSuffix","handleInputChange","_item","_value","selectStyle","push","items","selectAnAnswer","trim","QuestionTemplate","template","styleSheet","setStylesheet","useState","useEffect","_stylesheet","parts","parseTemplateString","sections"],"sources":["../../../../../src/molecule/questions/mobile/template/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {TextStyle, View, ViewStyle} from 'react-native';\n\nimport trim from 'lodash/fp/trim';\n\nimport Html from '../../../../atom/html/index.native';\nimport Select from '../../../../atom/select-modal/index.native';\nimport Space from '../../../../atom/space/index.native';\nimport type {TemplateListOfChoices, TemplateTextChoice} from '../../types';\nimport FreeText from '../../free-text/index.native';\nimport {\n FocusedSelectId,\n HandleBlur,\n HandleFocus,\n useTemplateContext\n} from '../../../../template/app-review/template-context';\nimport {Theme} from '../../../../variables/theme.native';\nimport parseTemplateString from '../../../../util/parse-template-string';\n\ntype StyleSheetType = {\n section: ViewStyle;\n spaced: ViewStyle;\n input: ViewStyle;\n htmlText: TextStyle;\n text: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType => ({\n section: {\n width: '100%',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'center',\n alignItems: 'center'\n },\n spaced: {\n paddingVertical: theme.spacing.tiny\n },\n input: {\n padding: theme.spacing.tiny,\n borderWidth: 1,\n borderColor: theme.colors.gray.lightMedium,\n borderRadius: theme.radius.common,\n backgroundColor: theme.colors.white,\n minWidth: 175\n },\n htmlText: {\n padding: theme.spacing.tiny,\n color: theme.colors.black,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 30\n },\n text: {\n color: theme.colors.gray.medium,\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.regular,\n textAlign: 'center'\n }\n});\n\ntype TemplatePart = {\n type: 'string' | 'answerField';\n value: string;\n};\n\ntype SectionProps = {\n isDisabled: boolean;\n section: Array<TemplatePart>;\n choices: Array<TemplateTextChoice | TemplateListOfChoices>;\n index: number;\n onInputChange: (item: TemplateTextChoice | TemplateListOfChoices, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n styles: any;\n};\n\nconst Section = ({\n section,\n choices,\n index,\n focusedSelectId,\n onInputChange,\n handleBlur,\n handleFocus,\n isDisabled,\n styles\n}: SectionProps) => {\n const prefix = `question-section-${index + 1}`;\n\n return (\n <View style={styles.section} key={`container-${prefix}`}>\n {section.map((part, id) => {\n return (\n <View key={`${prefix}-${id}`} style={{flexDirection: 'row'}}>\n <Item\n prefix={prefix}\n part={part}\n choices={choices}\n index={id}\n focusedSelectId={focusedSelectId}\n isDisabled={isDisabled}\n handleBlur={handleBlur}\n handleFocus={handleFocus}\n onInputChange={onInputChange}\n styles={styles}\n />\n <Space type=\"micro\" />\n </View>\n );\n })}\n </View>\n );\n};\n\ntype ItemProps = {\n part: TemplatePart;\n choices: Array<TemplateTextChoice | TemplateListOfChoices>;\n index: number;\n prefix: string;\n isDisabled?: boolean;\n onInputChange: (item: TemplateTextChoice | TemplateListOfChoices, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n styles: any;\n};\n\nconst Item = (props: ItemProps) => {\n const {\n part,\n index,\n prefix,\n isDisabled = false,\n focusedSelectId,\n choices,\n onInputChange,\n handleBlur,\n handleFocus,\n styles\n } = props;\n\n const templateContext = useTemplateContext();\n const {theme, brandTheme, translations} = templateContext;\n\n const inputNames = choices.map(choice => choice.name);\n const id = `${prefix}-part-${index + 1}`;\n const isFocused = focusedSelectId === id;\n\n const selectedStyle = brandTheme && {\n borderColor: brandTheme.colors.primary,\n color: brandTheme.colors.primary\n };\n\n if (part.type === 'answerField' && inputNames.includes(part.value)) {\n const choiceIndex = choices.findIndex(choice => choice.name === part.value);\n const choice = choices[choiceIndex];\n const {value} = choice;\n\n if (!choice || !choice.type || !choice.name) {\n return null;\n }\n\n const disabledSuffix = isDisabled ? '-disabled' : '';\n const selectedSuffix = value ? '-selected' : '';\n\n const handleInputChange = (_item: TemplateTextChoice | TemplateListOfChoices) => (\n _value: string\n ) => onInputChange(_item, _value);\n\n if (choice.type === 'text') {\n return (\n <View style={styles.spaced} testID={id}>\n <FreeText\n key={id}\n isDisabled={isDisabled}\n onChange={handleInputChange(choice)}\n value={value}\n testID={`${id}-text${selectedSuffix}${disabledSuffix}`}\n questionType=\"template\"\n />\n </View>\n );\n }\n\n const selectStyle: ViewStyle[] = [styles.input];\n if (value) {\n selectStyle.push(selectedStyle);\n }\n\n if (choice.type === 'select') {\n return (\n <View style={styles.spaced} testID={id}>\n <Select\n isDisabled={isDisabled}\n questionType=\"template\"\n values={choice.items}\n value={value}\n placeholder={translations.selectAnAnswer}\n isFocused={isFocused}\n onBlur={handleBlur}\n onFocus={handleFocus(id)}\n onChange={handleInputChange(choice)}\n textStyle={styles.text}\n style={selectStyle}\n analyticsID={`${id}-select${selectedSuffix}${disabledSuffix}`}\n testID={`${id}-select${selectedSuffix}${disabledSuffix}`}\n />\n </View>\n );\n }\n }\n\n return (\n <Html key={id} fontSize={theme.fontSize.regular} testID={id} style={styles.htmlText}>\n {trim(part.value || '')}\n </Html>\n );\n};\n\nexport type Props = {\n isDisabled?: boolean;\n template: string;\n choices: Array<TemplateTextChoice | TemplateListOfChoices>;\n onInputChange: (item: TemplateTextChoice | TemplateListOfChoices, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n};\n\nconst QuestionTemplate = (props: Props) => {\n const {\n template,\n onInputChange,\n choices,\n handleBlur,\n handleFocus,\n focusedSelectId,\n isDisabled = false\n } = props;\n\n const templateContext = useTemplateContext();\n const {theme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!template || !styleSheet) {\n return null;\n }\n\n const parts: TemplatePart[] = parseTemplateString(template);\n const sections = [parts]; // @todo remove useless sections\n\n return (\n <View testID=\"question-template\">\n {sections.map((section, index) => (\n <Section\n key={index}\n section={section}\n choices={choices}\n index={index}\n handleBlur={handleBlur}\n handleFocus={handleFocus}\n focusedSelectId={focusedSelectId}\n onInputChange={onInputChange}\n isDisabled={isDisabled}\n styles={styleSheet}\n />\n ))}\n </View>\n );\n};\n\nexport default QuestionTemplate;\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AAOA;;;;;;;;AAUA,MAAMA,gBAAgB,GAAIC,KAAD,KAAmC;EAC1DC,OAAO,EAAE;IACPC,KAAK,EAAE,MADA;IAEPC,aAAa,EAAE,KAFR;IAGPC,QAAQ,EAAE,MAHH;IAIPC,cAAc,EAAE,QAJT;IAKPC,UAAU,EAAE;EALL,CADiD;EAQ1DC,MAAM,EAAE;IACNC,eAAe,EAAER,KAAK,CAACS,OAAN,CAAcC;EADzB,CARkD;EAW1DC,KAAK,EAAE;IACLC,OAAO,EAAEZ,KAAK,CAACS,OAAN,CAAcC,IADlB;IAELG,WAAW,EAAE,CAFR;IAGLC,WAAW,EAAEd,KAAK,CAACe,MAAN,CAAaC,IAAb,CAAkBC,WAH1B;IAILC,YAAY,EAAElB,KAAK,CAACmB,MAAN,CAAaC,MAJtB;IAKLC,eAAe,EAAErB,KAAK,CAACe,MAAN,CAAaO,KALzB;IAMLC,QAAQ,EAAE;EANL,CAXmD;EAmB1DC,QAAQ,EA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,GAAT,CAAa,CAAC5C,OAAD,EAAUoC,KAAV,kBACZ,6BAAC,OAAD;IACE,GAAG,EAAEA,KADP;IAEE,OAAO,EAAEpC,OAFX;IAGE,OAAO,EAAEmC,OAHX;IAIE,KAAK,EAAEC,KAJT;IAKE,UAAU,EAAEG,UALd;IAME,WAAW,EAAEC,WANf;IAOE,eAAe,EAAEH,eAPnB;IAQE,aAAa,EAAEC,aARjB;IASE,UAAU,EAAEG,UATd;IAUE,MAAM,EAAEmC;EAVV,EADD,CADH,CADF;AAkBD,CA9CD;;eAgDeF,gB"}
1
+ {"version":3,"file":"index.native.js","names":["createStyleSheet","theme","container","width","flexDirection","flexWrap","justifyContent","alignItems","spaced","paddingVertical","spacing","tiny","htmlText","color","colors","black","fontWeight","bold","lineHeight","selectInput","padding","borderRadius","radius","regular","minWidth","marginHorizontal","BOX_STYLE","backgroundColor","white","selectText","gray","medium","fontSize","textAlign","Item","props","part","index","isDisabled","focusedSelectId","choices","onInputChange","handleBlur","handleFocus","styles","templateContext","useTemplateContext","brandTheme","translations","inputNames","map","choice","name","id","isFocused","coloredText","primary","type","includes","value","choiceIndex","findIndex","disabledSuffix","selectedSuffix","handleInputChange","_item","_value","selectInputStyle","push","selectTextStyle","items","selectAnAnswer","trim","QuestionTemplate","template","styleSheet","setStylesheet","useState","useEffect","_stylesheet","parts","parseTemplateString"],"sources":["../../../../../src/molecule/questions/mobile/template/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {TextStyle, View, ViewStyle} from 'react-native';\n\nimport trim from 'lodash/fp/trim';\n\nimport Html from '../../../../atom/html/index.native';\nimport Select from '../../../../atom/select-modal/index.native';\nimport Space from '../../../../atom/space/index.native';\nimport type {TemplateListOfChoices, TemplateTextChoice} from '../../types';\nimport FreeText from '../../free-text/index.native';\nimport {\n FocusedSelectId,\n HandleBlur,\n HandleFocus,\n useTemplateContext\n} from '../../../../template/app-review/template-context';\nimport {Theme} from '../../../../variables/theme.native';\nimport parseTemplateString from '../../../../util/parse-template-string';\nimport {BOX_STYLE} from '../../../../variables/shadow';\n\ntype StyleSheetType = {\n container: ViewStyle;\n spaced: ViewStyle;\n htmlText: TextStyle;\n selectInput: ViewStyle;\n selectText: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType => ({\n container: {\n width: '100%',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'center',\n alignItems: 'center'\n },\n spaced: {\n paddingVertical: theme.spacing.tiny\n },\n htmlText: {\n color: theme.colors.black,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 25\n },\n // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread\n selectInput: {\n padding: theme.spacing.tiny,\n borderRadius: theme.radius.regular,\n minWidth: 175,\n marginHorizontal: 12,\n paddingVertical: 16,\n ...BOX_STYLE,\n backgroundColor: theme.colors.white\n },\n selectText: {\n color: theme.colors.gray.medium,\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.regular,\n textAlign: 'center'\n }\n});\n\ntype TemplatePart = {\n type: 'string' | 'answerField';\n value: string;\n};\n\ntype ItemProps = {\n part: TemplatePart;\n choices: Array<TemplateTextChoice | TemplateListOfChoices>;\n index: number;\n isDisabled?: boolean;\n onInputChange: (item: TemplateTextChoice | TemplateListOfChoices, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n styles: StyleSheetType;\n};\n\nconst Item = (props: ItemProps) => {\n const {\n part,\n index,\n isDisabled = false,\n focusedSelectId,\n choices,\n onInputChange,\n handleBlur,\n handleFocus,\n styles\n } = props;\n\n const templateContext = useTemplateContext();\n const {theme, brandTheme, translations} = templateContext;\n\n const inputNames = choices.map(choice => choice.name);\n const id = `question-part-${index + 1}`;\n const isFocused = focusedSelectId === id;\n\n const coloredText = brandTheme && {\n color: brandTheme.colors.primary\n };\n\n if (part.type === 'answerField' && inputNames.includes(part.value)) {\n const choiceIndex = choices.findIndex(choice => choice.name === part.value);\n const choice = choices[choiceIndex];\n const {value} = choice;\n\n if (!choice || !choice.type || !choice.name) {\n return null;\n }\n\n const disabledSuffix = isDisabled ? '-disabled' : '';\n const selectedSuffix = value ? '-selected' : '';\n\n const handleInputChange = (_item: TemplateTextChoice | TemplateListOfChoices) => (\n _value: string\n ) => onInputChange(_item, _value);\n\n if (choice.type === 'text') {\n return (\n <View style={styles.spaced} testID={id}>\n <FreeText\n key={id}\n isDisabled={isDisabled}\n onChange={handleInputChange(choice)}\n value={value}\n testID={`${id}-text${selectedSuffix}${disabledSuffix}`}\n questionType=\"template\"\n />\n </View>\n );\n }\n\n const selectInputStyle: ViewStyle[] = [styles.selectInput];\n if (value) {\n selectInputStyle.push(coloredText);\n }\n\n const selectTextStyle: ViewStyle[] = [styles.selectText];\n if (value) {\n selectTextStyle.push(coloredText);\n }\n\n if (choice.type === 'select') {\n return (\n <View style={styles.spaced} testID={id}>\n <Select\n isDisabled={isDisabled}\n questionType=\"template\"\n values={choice.items}\n value={value}\n placeholder={translations.selectAnAnswer}\n isFocused={isFocused}\n onBlur={handleBlur}\n onFocus={handleFocus(id)}\n onChange={handleInputChange(choice)}\n textStyle={selectTextStyle}\n style={selectInputStyle}\n analyticsID={`${id}-select${selectedSuffix}${disabledSuffix}`}\n testID={`${id}-select${selectedSuffix}${disabledSuffix}`}\n />\n </View>\n );\n }\n }\n\n return (\n <Html key={id} fontSize={theme.fontSize.regular} testID={id} style={styles.htmlText}>\n {trim(part.value || '')}\n </Html>\n );\n};\n\nexport type Props = {\n isDisabled?: boolean;\n template: string;\n choices: Array<TemplateTextChoice | TemplateListOfChoices>;\n onInputChange: (item: TemplateTextChoice | TemplateListOfChoices, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n};\n\nconst QuestionTemplate = (props: Props) => {\n const {\n template,\n onInputChange,\n choices,\n handleBlur,\n handleFocus,\n focusedSelectId,\n isDisabled = false\n } = props;\n\n const templateContext = useTemplateContext();\n const {theme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!template || !styleSheet) {\n return null;\n }\n\n const parts: TemplatePart[] = parseTemplateString(template);\n\n return (\n <View style={styleSheet.container} testID=\"question-template\">\n {parts.map((part, id) => (\n <View key={`question-part-${id}`} style={{flexDirection: 'row'}}>\n <Item\n part={part}\n choices={choices}\n index={id}\n focusedSelectId={focusedSelectId}\n isDisabled={isDisabled}\n handleBlur={handleBlur}\n handleFocus={handleFocus}\n onInputChange={onInputChange}\n styles={styleSheet}\n />\n <Space type=\"micro\" />\n </View>\n ))}\n </View>\n );\n};\n\nexport default QuestionTemplate;\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AAOA;;AACA;;;;;;;;;;AAUA,MAAMA,gBAAgB,GAAIC,KAAD,KAAmC;EAC1DC,SAAS,EAAE;IACTC,KAAK,EAAE,MADE;IAETC,aAAa,EAAE,KAFN;IAGTC,QAAQ,EAAE,MAHD;IAITC,cAAc,EAAE,QAJP;IAKTC,UAAU,EAAE;EALH,CAD+C;EAQ1DC,MAAM,EAAE;IACNC,eAAe,EAAER,KAAK,CAACS,OAAN,CAAcC;EADzB,CARkD;EAW1DC,QAAQ,EAAE;IACRC,KAAK,EAAEZ,KAAK,CAACa,MAAN,CAAaC,KADZ;IAERC,UAAU,EAAEf,KAAK,CAACe,UAAN,CAAiBC,IAFrB;IAGRC,UAAU,EAAE;EAHJ,CAXgD;EAgB1D;EACAC,WAAW;IACTC,OAAO,EAAEnB,KAAK,CAACS,OAAN,CAAcC,IADd;IAETU,YAAY,EAAEpB,KAAK,CAACqB,MAAN,CAAaC,OAFlB;IAGTC,QAAQ,EAAE,GAHD;IAITC,gBAAgB,EAAE,EAJT;IAKThB,eAAe,EAAE;EALR,GAMNiB,iBANM;IAOTC,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AA8B;IAC5B,OAAO,IAAP;EACD;;EAED,MAAMK,KAAqB,GAAG,IAAAC,4BAAA,EAAoBP,QAApB,CAA9B;EAEA,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEC,UAAU,CAACzE,SAAxB;IAAmC,MAAM,EAAC;EAA1C,GACG8E,KAAK,CAAC9B,GAAN,CAAU,CAACd,IAAD,EAAOiB,EAAP,kBACT,6BAAC,iBAAD;IAAM,GAAG,EAAG,iBAAgBA,EAAG,EAA/B;IAAkC,KAAK,EAAE;MAACjD,aAAa,EAAE;IAAhB;EAAzC,gBACE,6BAAC,IAAD;IACE,IAAI,EAAEgC,IADR;IAEE,OAAO,EAAEI,OAFX;IAGE,KAAK,EAAEa,EAHT;IAIE,eAAe,EAAEd,eAJnB;IAKE,UAAU,EAAED,UALd;IAME,UAAU,EAAEI,UANd;IAOE,WAAW,EAAEC,WAPf;IAQE,aAAa,EAAEF,aARjB;IASE,MAAM,EAAEkC;EATV,EADF,eAYE,6BAAC,eAAD;IAAO,IAAI,EAAC;EAAZ,EAZF,CADD,CADH,CADF;AAoBD,CA/CD;;eAiDeF,gB"}
@@ -55,7 +55,7 @@ const copyTextViaExecCommand = text => {
55
55
  return status;
56
56
  };
57
57
 
58
- const StatusContext = /*#__PURE__*/_react.default.createContext(SHARE_STATUS.IDLE);
58
+ const StatusContext = _react.default.createContext(SHARE_STATUS.IDLE);
59
59
 
60
60
  const ShareStatusProvider = ({
61
61
  children
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["SHARE_STATUS","IDLE","ERROR","SUCCESS","copyTextViaExecCommand","text","textarea","document","createElement","style","border","padding","visibility","position","setAttribute","value","body","appendChild","status","select","setSelectionRange","length","execCommand","error","removeChild","StatusContext","React","createContext","ShareStatusProvider","children","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","useMemo","ShareFeedback","successWording","errorWording","useContext","classnames","styles","feedback","errorFeedback","checkIcon","Share","wording","onClick","useCallback","browserSupportsClipboardWriteText","navigator","clipboard","writeText","copyStatus","container","cta","wrapper","shareIcon","propTypes","PropTypes","node","string"],"sources":["../../../src/molecule/share/index.js"],"sourcesContent":["import React, {useState, useMemo, useCallback, useContext, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionCoorpacademyShare as ShareIcon,\n NovaCompositionCoorpacademyAttention as AttentionIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst SHARE_STATUS = {\n IDLE: 'IDLE',\n ERROR: 'ERROR',\n SUCCESS: 'SUCCESS'\n};\n\nconst copyTextViaExecCommand = text => {\n const textarea = document.createElement('textarea');\n\n textarea.style.border = '0';\n textarea.style.padding = '0';\n textarea.style.visibility = 'hidden';\n textarea.style.position = 'absolute';\n textarea.setAttribute('readonly', '');\n textarea.value = text;\n\n // Element.append is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-append\n document.body.appendChild(textarea);\n let status = SHARE_STATUS.IDLE;\n\n try {\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n document.execCommand('copy');\n status = SHARE_STATUS.SUCCESS;\n } catch (error) {\n status = SHARE_STATUS.ERROR;\n }\n\n // Element.remove is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-remove\n document.body.removeChild(textarea);\n\n return status;\n};\n\nconst StatusContext = React.createContext(SHARE_STATUS.IDLE);\n\nexport const ShareStatusProvider = ({children}) => {\n const [status, setStatus] = useState(SHARE_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== SHARE_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(SHARE_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n\n const value = useMemo(() => [status, setStatus], [status]);\n\n return <StatusContext.Provider value={value}>{children}</StatusContext.Provider>;\n};\n\nexport const ShareFeedback = ({successWording, errorWording}) => {\n const [status] = useContext(StatusContext);\n if (status === SHARE_STATUS.IDLE) return null;\n\n return (\n <div\n className={classnames(styles.feedback, status === SHARE_STATUS.ERROR && styles.errorFeedback)}\n >\n {status === SHARE_STATUS.SUCCESS ? (\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n ) : (\n <AttentionIcon className={styles.checkIcon} width={13} height={13} />\n )}\n <p>{status === SHARE_STATUS.SUCCESS ? successWording : errorWording}</p>\n </div>\n );\n};\n\nconst Share = ({style, text, wording}) => {\n const [, setStatus] = useContext(StatusContext);\n const onClick = useCallback(async () => {\n const browserSupportsClipboardWriteText =\n 'clipboard' in navigator && 'writeText' in navigator.clipboard;\n if (browserSupportsClipboardWriteText) {\n try {\n await navigator.clipboard.writeText(text);\n setStatus(SHARE_STATUS.SUCCESS);\n } catch (error) {\n setStatus(SHARE_STATUS.ERROR);\n }\n return;\n } else {\n const copyStatus = copyTextViaExecCommand(text);\n setStatus(copyStatus);\n }\n return;\n }, [setStatus, text]);\n\n return (\n <div className={(styles.container, style)}>\n <Link onClick={onClick} className={styles.cta} data-name={'share-button'}>\n <div className={styles.wrapper}>\n <ShareIcon className={styles.shareIcon} width={18} height={18} />\n <p>{wording}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nShareStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nShareFeedback.propTypes = {\n successWording: PropTypes.string,\n errorWording: PropTypes.string\n};\n\nShare.propTypes = {\n style: PropTypes.string,\n text: PropTypes.string,\n wording: PropTypes.string\n};\n\nexport default Share;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAKA;;AACA;;;;;;;;AAEA,MAAMA,YAAY,GAAG;EACnBC,IAAI,EAAE,MADa;EAEnBC,KAAK,EAAE,OAFY;EAGnBC,OAAO,EAAE;AAHU,CAArB;;AAMA,MAAMC,sBAAsB,GAAGC,IAAI,IAAI;EACrC,MAAMC,QAAQ,GAAGC,QAAQ,CAACC,aAAT,CAAuB,UAAvB,CAAj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AK,CAACa,SAAN,2CAAkB;EAChBnD,KAAK,EAAEoD,kBAAA,CAAUE,MADD;EAEhB1D,IAAI,EAAEwD,kBAAA,CAAUE,MAFA;EAGhBf,OAAO,EAAEa,kBAAA,CAAUE;AAHH,CAAlB;eAMehB,K"}
1
+ {"version":3,"file":"index.js","names":["SHARE_STATUS","IDLE","ERROR","SUCCESS","copyTextViaExecCommand","text","textarea","document","createElement","style","border","padding","visibility","position","setAttribute","value","body","appendChild","status","select","setSelectionRange","length","execCommand","error","removeChild","StatusContext","React","createContext","ShareStatusProvider","children","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","useMemo","ShareFeedback","successWording","errorWording","useContext","classnames","styles","feedback","errorFeedback","checkIcon","Share","wording","onClick","useCallback","browserSupportsClipboardWriteText","navigator","clipboard","writeText","copyStatus","container","cta","wrapper","shareIcon","propTypes","PropTypes","node","string"],"sources":["../../../src/molecule/share/index.js"],"sourcesContent":["import React, {useState, useMemo, useCallback, useContext, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionCoorpacademyShare as ShareIcon,\n NovaCompositionCoorpacademyAttention as AttentionIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst SHARE_STATUS = {\n IDLE: 'IDLE',\n ERROR: 'ERROR',\n SUCCESS: 'SUCCESS'\n};\n\nconst copyTextViaExecCommand = text => {\n const textarea = document.createElement('textarea');\n\n textarea.style.border = '0';\n textarea.style.padding = '0';\n textarea.style.visibility = 'hidden';\n textarea.style.position = 'absolute';\n textarea.setAttribute('readonly', '');\n textarea.value = text;\n\n // Element.append is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-append\n document.body.appendChild(textarea);\n let status = SHARE_STATUS.IDLE;\n\n try {\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n document.execCommand('copy');\n status = SHARE_STATUS.SUCCESS;\n } catch (error) {\n status = SHARE_STATUS.ERROR;\n }\n\n // Element.remove is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-remove\n document.body.removeChild(textarea);\n\n return status;\n};\n\nconst StatusContext = React.createContext(SHARE_STATUS.IDLE);\n\nexport const ShareStatusProvider = ({children}) => {\n const [status, setStatus] = useState(SHARE_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== SHARE_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(SHARE_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n\n const value = useMemo(() => [status, setStatus], [status]);\n\n return <StatusContext.Provider value={value}>{children}</StatusContext.Provider>;\n};\n\nexport const ShareFeedback = ({successWording, errorWording}) => {\n const [status] = useContext(StatusContext);\n if (status === SHARE_STATUS.IDLE) return null;\n\n return (\n <div\n className={classnames(styles.feedback, status === SHARE_STATUS.ERROR && styles.errorFeedback)}\n >\n {status === SHARE_STATUS.SUCCESS ? (\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n ) : (\n <AttentionIcon className={styles.checkIcon} width={13} height={13} />\n )}\n <p>{status === SHARE_STATUS.SUCCESS ? successWording : errorWording}</p>\n </div>\n );\n};\n\nconst Share = ({style, text, wording}) => {\n const [, setStatus] = useContext(StatusContext);\n const onClick = useCallback(async () => {\n const browserSupportsClipboardWriteText =\n 'clipboard' in navigator && 'writeText' in navigator.clipboard;\n if (browserSupportsClipboardWriteText) {\n try {\n await navigator.clipboard.writeText(text);\n setStatus(SHARE_STATUS.SUCCESS);\n } catch (error) {\n setStatus(SHARE_STATUS.ERROR);\n }\n return;\n } else {\n const copyStatus = copyTextViaExecCommand(text);\n setStatus(copyStatus);\n }\n return;\n }, [setStatus, text]);\n\n return (\n <div className={(styles.container, style)}>\n <Link onClick={onClick} className={styles.cta} data-name={'share-button'}>\n <div className={styles.wrapper}>\n <ShareIcon className={styles.shareIcon} width={18} height={18} />\n <p>{wording}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nShareStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nShareFeedback.propTypes = {\n successWording: PropTypes.string,\n errorWording: PropTypes.string\n};\n\nShare.propTypes = {\n style: PropTypes.string,\n text: PropTypes.string,\n wording: PropTypes.string\n};\n\nexport default Share;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAKA;;AACA;;;;;;;;AAEA,MAAMA,YAAY,GAAG;EACnBC,IAAI,EAAE,MADa;EAEnBC,KAAK,EAAE,OAFY;EAGnBC,OAAO,EAAE;AAHU,CAArB;;AAMA,MAAMC,sBAAsB,GAAGC,IAAI,IAAI;EACrC,MAAMC,QAAQ,GAAGC,QAAQ,CAACC,aAAT,CAAuB,UAAvB,CAAjB;EAEAF,QAAQ,CAACG,KAAT,CAAeC,MAAf,GAAwB,GAAxB;EACAJ,QAAQ,CAACG,KAAT,CAAeE,OAAf,GAAyB,GAAzB;EACAL,QAAQ,CAACG,KAAT,CAAeG,UAAf,GAA4B,QAA5B;EACAN,QAAQ,CAACG,KAAT,CAAeI,QAAf,GAA0B,UAA1B;EACAP,QAAQ,CAACQ,YAAT,CAAsB,UAAtB,EAAkC,EAAlC;EACAR,QAAQ,CAACS,KAAT,GAAiBV,IAAjB,CARqC,CAUrC;EACA;;EACAE,QAAQ,CAACS,IAAT,CAAcC,WAAd,CAA0BX,QAA1B;EACA,IAAIY,MAAM,GAAGlB,YAAY,CAACC,IAA1B;;EAEA,IAAI;IACFK,QAAQ,CAACa,MAAT;IACAb,QAAQ,CAACc,iBAAT,CAA2B,CAA3B,EAA8Bd,QAAQ,CAACS,KAAT,CAAeM,MAA7C;IACAd,QAAQ,CAACe,WAAT,CAAqB,MAArB;IACAJ,MAAM,GAAGlB,YAAY,CAACG,OAAtB;EACD,CALD,CAKE,OAAOoB,KAAP,EAAc;IACdL,MAAM,GAAGlB,YAAY,CAACE,KAAtB;EACD,CAtBoC,CAwBrC;EACA;;;EACAK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,CAAOc,GAA1C;IAA+C,aAAW;EAA1D,gBACE;IAAK,SAAS,EAAEd,cAAA,CAAOe;EAAvB,gBACE,6BAAC,2CAAD;IAAW,SAAS,EAAEf,cAAA,CAAOgB,SAA7B;IAAwC,KAAK,EAAE,EAA/C;IAAmD,MAAM,EAAE;EAA3D,EADF,eAEE,wCAAIX,OAAJ,CAFF,CADF,CADF,CADF;AAUD,CA9BD;;AAgCApB,mBAAmB,CAACgC,SAApB,2CAAgC;EAC9B/B,QAAQ,EAAEgC,kBAAA,CAAUC;AADU,CAAhC;AAIAxB,aAAa,CAACsB,SAAd,2CAA0B;EACxBrB,cAAc,EAAEsB,kBAAA,CAAUE,MADF;EAExBvB,YAAY,EAAEqB,kBAAA,CAAUE;AAFA,CAA1B;AAKAhB,KAAK,CAACa,SAAN,2CAAkB;EAChBnD,KAAK,EAAEoD,kBAAA,CAAUE,MADD;EAEhB1D,IAAI,EAAEwD,kBAAA,CAAUE,MAFA;EAGhBf,OAAO,EAAEa,kBAAA,CAAUE;AAHH,CAAlB;eAMehB,K"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["getGradientBackground","baseColor","gradients","convert","SkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","buttonLabel","buttonAriaLabel","reviseLabel","reviseAriaLabel","onClick","isCustom","skin","hovered","setHovered","useState","primarySkinColor","getOr","handleMouseOver","useCallback","handleMouseLeave","buttonProps","customStyle","backgroundColor","color","transition","label","titleBackgroundColor","useMemo","titleBackground","style","skillCardWrapper","background","questionReviseText","questionReviseIcon","buttonWrapper","propTypes"],"sources":["../../../src/molecule/skill-card/index.js"],"sourcesContent":["import React, {useCallback, useState, useMemo} from 'react';\nimport {convert} from 'css-color-function';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport getOr from 'lodash/fp/getOr';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst getGradientBackground = baseColor => {\n const gradients = [\n convert(`color(${baseColor} lightness(30%))`),\n convert(`color(${baseColor} lightness(47%))`),\n convert(`color(${baseColor} lightness(55%))`)\n ];\n\n return `radial-gradient(62.12% 56.45% at 0% 77.29%, ${gradients[0]} 0%, ${convert(\n `color(${gradients[0]} a(0))`\n )} 100%), radial-gradient(113.85% 103.46% at 93.27% 7.88%, ${gradients[1]} 0%, ${convert(\n `color(${gradients[1]} a(0))`\n )} 100%), radial-gradient(49.66% 49.63% at 78.65% 86.26%, ${gradients[2]} 0%, ${convert(\n `color(${gradients[2]} a(0))`\n )} 100%), ${baseColor}`;\n};\n\nconst SkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n skillTitle,\n skillAriaLabel,\n buttonLabel,\n buttonAriaLabel,\n reviseLabel,\n reviseAriaLabel,\n onClick,\n isCustom = false\n } = props;\n const {skin} = context;\n const [hovered, setHovered] = useState(false);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n onClick,\n 'aria-label': buttonAriaLabel,\n label: buttonLabel,\n 'data-name': 'skill-card-button'\n };\n\n const titleBackgroundColor = useMemo(() => (isCustom ? '#128C72' : primarySkinColor), [\n isCustom,\n primarySkinColor\n ]);\n\n const titleBackground = useMemo(() => getGradientBackground(titleBackgroundColor), [\n titleBackgroundColor\n ]);\n\n return (\n <div className={style.skillCardWrapper} data-name=\"skill-card-wrapper\" aria-label={ariaLabel}>\n <div\n data-name=\"skill-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n style={{\n background: titleBackground\n }}\n >\n {skillTitle}\n </div>\n <div data-name=\"card-content-wrapper\">\n <div\n className={style.questionReviseText}\n data-name=\"questions-to-revise-label\"\n aria-label={reviseAriaLabel || reviseLabel}\n >\n <QuestionIcon className={style.questionReviseIcon} width={16} height={16} />\n {reviseLabel}\n </div>\n <div\n className={style.buttonWrapper}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-name=\"button-wrapper\"\n >\n <ButtonLink {...buttonProps} />\n </div>\n </div>\n </div>\n );\n};\n\nSkillCard.propTypes = propTypes;\n\nexport default SkillCard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,qBAAqB,GAAGC,SAAS,IAAI;EACzC,MAAMC,SAAS,GAAG,CAChB,IAAAC,yBAAA,EAAS,SAAQF,SAAU,kBAA3B,CADgB,EAEhB,IAAAE,yBAAA,EAAS,SAAQF,SAAU,kBAA3B,CAFgB,EAGhB,IAAAE,yBAAA,EAAS,SAAQF,SAAU,kBAA3B,CAHgB,CAAlB;EAMA,OAAQ,+CAA8CC,SAAS,CAAC,CAAD,CAAI,QAAO,IAAAC,yBAAA,EACvE,SAAQD,SAAS,CAAC,CAAD,CAAI,QADkD,CAExE,4DAA2DA,SAAS,CAAC,CAAD,CAAI,QAAO,IAAAC,yBAAA,EAC9E,SAAQD,SAAS,CAAC,CAAD,CAAI,QADyD,CAE/E,2DAA0DA,SAAS,CAAC,CAAD,CAAI,QAAO,IAAAC,yBAAA,EAC7E,SAAQD,SAAS,CAAC,CAAD,CAAI,QADwD,CAE9E,WAAUD,SAAU,EANtB;AAOD,CAdD;;AAgBA,MAAMG,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpC,MAAM;IACJ,cAAcC,SADV;IAEJC,UAFI;IAGJC,cAHI;IAIJC,WAJI;IAKJC,eALI;IAMJC,WANI;IAOJC,eAPI;IAQJC,OARI;IASJC,QAAQ,GAAG;EATP,IAUFV,KAVJ;EAWA,MAAM;IAACW;EAAD,IAAS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H,CADF,eAWE;IAAK,aAAU;EAAf,gBACE;IACE,SAAS,EAAE0B,cAAA,CAAMG,kBADnB;IAEE,aAAU,2BAFZ;IAGE,cAAYxB,eAAe,IAAID;EAHjC,gBAKE,6BAAC,0DAAD;IAAc,SAAS,EAAEsB,cAAA,CAAMI,kBAA/B;IAAmD,KAAK,EAAE,EAA1D;IAA8D,MAAM,EAAE;EAAtE,EALF,EAMG1B,WANH,CADF,eASE;IACE,SAAS,EAAEsB,cAAA,CAAMK,aADnB;IAEE,WAAW,EAAEjB,eAFf;IAGE,YAAY,EAAEE,gBAHhB;IAIE,aAAU;EAJZ,gBAME,6BAAC,mBAAD,EAAgBC,WAAhB,CANF,CATF,CAXF,CADF;AAgCD,CAzED;;AA2EArB,SAAS,CAACoC,SAAV,2CAAsBA,kBAAtB;eAEepC,S"}
1
+ {"version":3,"file":"index.js","names":["getGradientBackground","baseColor","gradients","convert","SkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","buttonLabel","buttonAriaLabel","reviseLabel","reviseAriaLabel","onClick","isCustom","skin","hovered","setHovered","useState","primarySkinColor","getOr","handleMouseOver","useCallback","handleMouseLeave","buttonProps","customStyle","backgroundColor","color","transition","label","titleBackgroundColor","useMemo","titleBackground","style","skillCardWrapper","background","questionReviseText","questionReviseIcon","buttonWrapper","propTypes"],"sources":["../../../src/molecule/skill-card/index.js"],"sourcesContent":["import React, {useCallback, useState, useMemo} from 'react';\nimport {convert} from 'css-color-function';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport getOr from 'lodash/fp/getOr';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst getGradientBackground = baseColor => {\n const gradients = [\n convert(`color(${baseColor} lightness(30%))`),\n convert(`color(${baseColor} lightness(47%))`),\n convert(`color(${baseColor} lightness(55%))`)\n ];\n\n return `radial-gradient(62.12% 56.45% at 0% 77.29%, ${gradients[0]} 0%, ${convert(\n `color(${gradients[0]} a(0))`\n )} 100%), radial-gradient(113.85% 103.46% at 93.27% 7.88%, ${gradients[1]} 0%, ${convert(\n `color(${gradients[1]} a(0))`\n )} 100%), radial-gradient(49.66% 49.63% at 78.65% 86.26%, ${gradients[2]} 0%, ${convert(\n `color(${gradients[2]} a(0))`\n )} 100%), ${baseColor}`;\n};\n\nconst SkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n skillTitle,\n skillAriaLabel,\n buttonLabel,\n buttonAriaLabel,\n reviseLabel,\n reviseAriaLabel,\n onClick,\n isCustom = false\n } = props;\n const {skin} = context;\n const [hovered, setHovered] = useState(false);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n onClick,\n 'aria-label': buttonAriaLabel,\n label: buttonLabel,\n 'data-name': 'skill-card-button'\n };\n\n const titleBackgroundColor = useMemo(\n () => (isCustom ? '#128C72' : primarySkinColor),\n [isCustom, primarySkinColor]\n );\n\n const titleBackground = useMemo(\n () => getGradientBackground(titleBackgroundColor),\n [titleBackgroundColor]\n );\n\n return (\n <div className={style.skillCardWrapper} data-name=\"skill-card-wrapper\" aria-label={ariaLabel}>\n <div\n data-name=\"skill-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n style={{\n background: titleBackground\n }}\n >\n {skillTitle}\n </div>\n <div data-name=\"card-content-wrapper\">\n <div\n className={style.questionReviseText}\n data-name=\"questions-to-revise-label\"\n aria-label={reviseAriaLabel || reviseLabel}\n >\n <QuestionIcon className={style.questionReviseIcon} width={16} height={16} />\n {reviseLabel}\n </div>\n <div\n className={style.buttonWrapper}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-name=\"button-wrapper\"\n >\n <ButtonLink {...buttonProps} />\n </div>\n </div>\n </div>\n );\n};\n\nSkillCard.propTypes = propTypes;\n\nexport default SkillCard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,qBAAqB,GAAGC,SAAS,IAAI;EACzC,MAAMC,SAAS,GAAG,CAChB,IAAAC,yBAAA,EAAS,SAAQF,SAAU,kBAA3B,CADgB,EAEhB,IAAAE,yBAAA,EAAS,SAAQF,SAAU,kBAA3B,CAFgB,EAGhB,IAAAE,yBAAA,EAAS,SAAQF,SAAU,kBAA3B,CAHgB,CAAlB;EAMA,OAAQ,+CAA8CC,SAAS,CAAC,CAAD,CAAI,QAAO,IAAAC,yBAAA,EACvE,SAAQD,SAAS,CAAC,CAAD,CAAI,QADkD,CAExE,4DAA2DA,SAAS,CAAC,CAAD,CAAI,QAAO,IAAAC,yBAAA,EAC9E,SAAQD,SAAS,CAAC,CAAD,CAAI,QADyD,CAE/E,2DAA0DA,SAAS,CAAC,CAAD,CAAI,QAAO,IAAAC,yBAAA,EAC7E,SAAQD,SAAS,CAAC,CAAD,CAAI,QADwD,CAE9E,WAAUD,SAAU,EANtB;AAOD,CAdD;;AAgBA,MAAMG,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpC,MAAM;IACJ,cAAcC,SADV;IAEJC,UAFI;IAGJC,cAHI;IAIJC,WAJI;IAKJC,eALI;IAMJC,WANI;IAOJC,eAPI;IAQJC,OARI;IASJC,QAAQ,GAAG;EATP,IAUFV,KAVJ;EAWA,MAAM;IAACW;EAAD,IAASV,OAAf;EACA,MAAM,CAACW,OAAD,EAAUC,UAAV,IAAwB,IAAAC,eAAA,EAAS,KAAT,CAA9B;EACA,MAAMC,gBAAgB,GAAG,IAAAC,cAAA,EAAM,SAAN,EAAiB,gBAAjB,EAAm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AEsB,cAAA,CAAMI,kBAA/B;IAAmD,KAAK,EAAE,EAA1D;IAA8D,MAAM,EAAE;EAAtE,EALF,EAMG1B,WANH,CADF,eASE;IACE,SAAS,EAAEsB,cAAA,CAAMK,aADnB;IAEE,WAAW,EAAEjB,eAFf;IAGE,YAAY,EAAEE,gBAHhB;IAIE,aAAU;EAJZ,gBAME,6BAAC,mBAAD,EAAgBC,WAAhB,CANF,CATF,CAXF,CADF;AAgCD,CA1ED;;AA4EArB,SAAS,CAACoC,SAAV,2CAAsBA,kBAAtB;eAEepC,S"}
@@ -17,6 +17,8 @@ var _style = _interopRequireDefault(require("./style.css"));
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
+ 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); }
21
+
20
22
  const TOTAL_SLIDES_STACK = 5;
21
23
  exports.TOTAL_SLIDES_STACK = TOTAL_SLIDES_STACK;
22
24
  const stylesByPosition = {
@@ -59,13 +61,14 @@ const StackedSlides = ({
59
61
  key: `slide-${slideIndex}`,
60
62
  "data-name": `slide-${slideIndex}`,
61
63
  className: (0, _classnames.default)(_style.default.slideBase, getSlideAnimation(animationType, position), endReview ? _style.default.endReview : null)
62
- }, /*#__PURE__*/_react.default.createElement(_reviewSlide.default, {
64
+ }, /*#__PURE__*/_react.default.createElement(_reviewSlide.default, _extends({
63
65
  slideIndex: (0, _toString2.default)(slideIndex),
64
66
  slide,
65
67
  validateButton,
66
- correctionPopinProps,
68
+ correctionPopinProps
69
+ }, {
67
70
  key: slideIndex
68
- }));
71
+ })));
69
72
 
70
73
  stackedSlides.push(slideView);
71
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["TOTAL_SLIDES_STACK","stylesByPosition","style","position0","position1","position2","position3","position4","getSlideAnimation","action","position","slideOutHideAndIn","slideOutAndIn","hiddenSlide","StackedSlides","slides","endReview","validateButton","correctionPopinProps","stackedSlides","slideIndex","slide","_toString","animationType","slideView","classnames","slideBase","push","stackedSlidesYAxisOverflowContainer","stackedSlidesContainer","propTypes"],"sources":["../../../src/organism/review-stacked-slides/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport _toString from 'lodash/fp/toString';\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) => {\n switch (action) {\n case 'unstack':\n return style.slideOutHideAndIn;\n case 'restack':\n return style.slideOutAndIn;\n default:\n return position < 0 ? style.hiddenSlide : stylesByPosition[position];\n }\n};\n\nconst StackedSlides = ({slides, endReview, validateButton, correctionPopinProps}) => {\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, 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),\n endReview ? style.endReview : null\n )}\n >\n <ReviewSlide\n {...{\n slideIndex: _toString(slideIndex),\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\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"],"mappings":";;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BAAD;MAEII,UAAU,EAAE,IAAAE,kBAAA,EAAUF,UAAV,CAFhB;MAGIC,KAHJ;MAIIJ,cAJJ;MAKIC,oBALJ;MAOE,GAAG,EAAEE;IAPP,EATF,CADF;;IAqBAD,aAAa,CAACQ,IAAd,CAAmBH,SAAnB;EACD;;EAED,oBACE;IACE,GAAG,EAAC,qCADN;IAEE,SAAS,EAAEtB,cAAA,CAAM0B;EAFnB,gBAIE;IACE,GAAG,EAAC,0BADN;IAEE,aAAU,0BAFZ;IAGE,SAAS,EAAE1B,cAAA,CAAM2B;EAHnB,GAKGV,aALH,CAJF,CADF;AAcD,CA7CD;;AA+CAL,aAAa,CAACgB,SAAd,2CAA0BA,kBAA1B;eAEehB,a"}
1
+ {"version":3,"file":"index.js","names":["TOTAL_SLIDES_STACK","stylesByPosition","style","position0","position1","position2","position3","position4","getSlideAnimation","action","position","slideOutHideAndIn","slideOutAndIn","hiddenSlide","StackedSlides","slides","endReview","validateButton","correctionPopinProps","stackedSlides","slideIndex","slide","_toString","animationType","slideView","classnames","slideBase","push","stackedSlidesYAxisOverflowContainer","stackedSlidesContainer","propTypes"],"sources":["../../../src/organism/review-stacked-slides/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport _toString from 'lodash/fp/toString';\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) => {\n switch (action) {\n case 'unstack':\n return style.slideOutHideAndIn;\n case 'restack':\n return style.slideOutAndIn;\n default:\n return position < 0 ? style.hiddenSlide : stylesByPosition[position];\n }\n};\n\nconst StackedSlides = ({slides, endReview, validateButton, correctionPopinProps}) => {\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, 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),\n endReview ? style.endReview : null\n )}\n >\n <ReviewSlide\n {...{\n slideIndex: _toString(slideIndex),\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\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"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEO,MAAMA,kBAAkB,GAAG,CAA3B;;AAEP,MAAMC,gBAAgB,GAAG;EACvB,GAAGC,cAAA,CAAMC,SADc;EAEvB,GAAGD,cAAA,CAAME,SAFc;EAGvB,GAAGF,cAAA,CAAMG,SAHc;EAIvB,GAAGH,cAAA,CAAMI,SAJc;EAKvB,GAAGJ,cAAA,CAAMK;AALc,CAAzB;;AAQA,MAAMC,iBAAiB,GAAG,CAACC,MAAD,EAASC,QAAT,KAAsB;EAC9C,QAAQD,MAAR;IACE,KAAK,SAAL;MACE,OAAOP,cAAA,CAAMS,iBAAb;;IACF,KAAK,SAAL;MACE,OAAOT,cAAA,CAAMU,aAAb;;IACF;MACE,OAAOF,QAAQ,GAAG,CAAX,GAAeR,cAAA,CAAMW,WAArB,GAAmCZ,gBAAgB,CAACS,QAAD,CAA1D;EANJ;AAQD,CATD;;AAWA,MAAMI,aAAa,GAAG,CAAC;EAACC,MAAD;EAASC,SAAT;EAAoBC,cAApB;EAAoCC;AAApC,CAAD,KAA+D;EACnF,MAAMC,aAAa,GAAG,EAAtB,CADmF,CAEnF;;EACA,KAAK,IAAIC,UAAU,GAAG,CAAtB,EAAyBA,UAAU,GAAGpB,kBAAtC,EAA0DoB,UAAU,EAApE,EAAwE;IACtE,MAAMC,KAAK,GAAGN,MAAM,CAAC,IAAAO,kBAAA,EAAUF,UAAV,CAAD,CAApB;IACA,MAAM;MAACG,aAAD;MAAgBb;IAAhB,IAA4BW,KAAlC;;IAEA,MAAMG,SAAS,gBACb;MACE,GAAG,EAAG,SAAQJ,UAAW,EAD3B;MAEE,aAAY,SAAQA,UAAW,EAFjC;MAGE,SAAS,EAAE,IAAAK,mBAAA,EACTvB,cAAA,CAAMwB,SADG,EAETlB,iBAAiB,CAACe,aAAD,EAAgBb,QAAhB,CAFR,EAGTM,SAAS,GAAGd,cAAA,CAAMc,SAAT,GAAqB,IAHrB;IAHb,gBASE,6BAAC,oBAAD,WACM;MACFI,UAAU,EAAE,IAAAE,kBAAA,EAAUF,UAAV,CADV;MAEFC,KAFE;MAGFJ,cAHE;MAIFC;IAJE,CADN;MAOE,GAAG,EAAEE;IAPP,GATF,CADF;;IAqBAD,aAAa,CAACQ,IAAd,CAAmBH,SAAnB;EACD;;EAED,oBACE;IACE,GAAG,EAAC,qCADN;IAEE,SAAS,EAAEtB,cAAA,CAAM0B;EAFnB,gBAIE;IACE,GAAG,EAAC,0BADN;IAEE,aAAU,0BAFZ;IAGE,SAAS,EAAE1B,cAAA,CAAM2B;EAHnB,GAKGV,aALH,CAJF,CADF;AAcD,CA7CD;;AA+CAL,aAAa,CAACgB,SAAd,2CAA0BA,kBAA1B;eAEehB,a"}
@@ -13,6 +13,8 @@ var _index = _interopRequireDefault(require("../review-slide/index.native"));
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
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
+
16
18
  const TOTAL_SLIDES_STACK = 5;
17
19
  exports.TOTAL_SLIDES_STACK = TOTAL_SLIDES_STACK;
18
20
 
@@ -34,14 +36,15 @@ const StackedSlides = props => {
34
36
  const stackedSlides = indexes.map(slideIndex => {
35
37
  const slide = slides[slideIndex]; // const {animationType, hidden, position} = slide;
36
38
 
37
- return /*#__PURE__*/_react.default.createElement(_index.default, {
39
+ return /*#__PURE__*/_react.default.createElement(_index.default, _extends({
38
40
  num: Number.parseInt(slideIndex),
39
41
  slideIndex,
40
42
  slide,
41
43
  validateButton,
42
- correctionPopinProps,
44
+ correctionPopinProps
45
+ }, {
43
46
  key: slideIndex
44
- });
47
+ }));
45
48
  });
46
49
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
47
50
  style: style.slides
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["TOTAL_SLIDES_STACK","style","StyleSheet","create","slides","flex","height","width","StackedSlides","props","validateButton","correctionPopinProps","indexes","keys","reverse","stackedSlides","map","slideIndex","slide","num","Number","parseInt"],"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, View} from 'react-native';\nimport keys from 'lodash/fp/keys';\nimport Slide from '../review-slide/index.native';\nimport {Props} from './prop-types';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst style = StyleSheet.create({\n slides: {\n flex: 1,\n height: '100%',\n width: '100%'\n }\n});\n\nconst StackedSlides = (props: Props) => {\n const {slides, validateButton, correctionPopinProps} = props;\n\n const indexes = keys(slides).reverse();\n const stackedSlides = indexes.map(slideIndex => {\n const slide = slides[slideIndex];\n // const {animationType, hidden, position} = slide;\n\n return (\n <Slide\n {...{\n num: Number.parseInt(slideIndex),\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n return <View style={style.slides}>{stackedSlides}</View>;\n};\n\nexport default StackedSlides;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;AAGO,MAAMA,kBAAkB,GAAG,CAA3B;;;AAEP,MAAMC,KAAK,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC9BC,MAAM,EAAE;IACNC,IAAI,EAAE,CADA;IAENC,MAAM,EAAE,MAFF;IAGNC,KAAK,EAAE;EAHD;AADsB,CAAlB,CAAd;;AAQA,MAAMC,aAAa,GAAIC,KAAD,IAAkB;EACtC,MAAM;IAACL,MAAD;IAASM,cAAT;IAAyBC;EAAzB,IAAiDF,KAAvD;EAEA,MAAMG,OAAO,GAAG,IAAAC,aAAA,EAAKT,MAAL,EAAaU,OAAb,EAAhB;EACA,MAAMC,aAAa,GAAGH,OAAO,CAACI,GAAR,CAAYC,UAAU,IAAI;IAC9C,MAAMC,KAAK,GAAGd,MAAM,CAACa,UAAD,CAApB,CAD8C,CAE9C;;IAEA,oBACE,6BAAC,cAAD;MAEIE,GAAG,EAAEC,MAAM,CAACC,QAAP,CAAgBJ,UAAhB,CAFT;MAGIA,UAHJ;MAIIC,KAJJ;MAKIR,cALJ;MAMIC,oBANJ;MAQE,GAAG,EAAEM;IARP,EADF;EAYD,CAhBqB,CAAtB;EAkBA,oBAAO,6BAAC,iBAAD;IAAM,KAAK,EAAEhB,KAAK,CAACG;EAAnB,GAA4BW,aAA5B,CAAP;AACD,CAvBD;;eAyBeP,a"}
1
+ {"version":3,"file":"index.native.js","names":["TOTAL_SLIDES_STACK","style","StyleSheet","create","slides","flex","height","width","StackedSlides","props","validateButton","correctionPopinProps","indexes","keys","reverse","stackedSlides","map","slideIndex","slide","num","Number","parseInt"],"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, View} from 'react-native';\nimport keys from 'lodash/fp/keys';\nimport Slide from '../review-slide/index.native';\nimport {Props} from './prop-types';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst style = StyleSheet.create({\n slides: {\n flex: 1,\n height: '100%',\n width: '100%'\n }\n});\n\nconst StackedSlides = (props: Props) => {\n const {slides, validateButton, correctionPopinProps} = props;\n\n const indexes = keys(slides).reverse();\n const stackedSlides = indexes.map(slideIndex => {\n const slide = slides[slideIndex];\n // const {animationType, hidden, position} = slide;\n\n return (\n <Slide\n {...{\n num: Number.parseInt(slideIndex),\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n return <View style={style.slides}>{stackedSlides}</View>;\n};\n\nexport default StackedSlides;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAGO,MAAMA,kBAAkB,GAAG,CAA3B;;;AAEP,MAAMC,KAAK,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC9BC,MAAM,EAAE;IACNC,IAAI,EAAE,CADA;IAENC,MAAM,EAAE,MAFF;IAGNC,KAAK,EAAE;EAHD;AADsB,CAAlB,CAAd;;AAQA,MAAMC,aAAa,GAAIC,KAAD,IAAkB;EACtC,MAAM;IAACL,MAAD;IAASM,cAAT;IAAyBC;EAAzB,IAAiDF,KAAvD;EAEA,MAAMG,OAAO,GAAG,IAAAC,aAAA,EAAKT,MAAL,EAAaU,OAAb,EAAhB;EACA,MAAMC,aAAa,GAAGH,OAAO,CAACI,GAAR,CAAYC,UAAU,IAAI;IAC9C,MAAMC,KAAK,GAAGd,MAAM,CAACa,UAAD,CAApB,CAD8C,CAE9C;;IAEA,oBACE,6BAAC,cAAD,WACM;MACFE,GAAG,EAAEC,MAAM,CAACC,QAAP,CAAgBJ,UAAhB,CADH;MAEFA,UAFE;MAGFC,KAHE;MAIFR,cAJE;MAKFC;IALE,CADN;MAQE,GAAG,EAAEM;IARP,GADF;EAYD,CAhBqB,CAAtB;EAkBA,oBAAO,6BAAC,iBAAD;IAAM,KAAK,EAAEhB,KAAK,CAACG;EAAnB,GAA4BW,aAA5B,CAAP;AACD,CAvBD;;eAyBeP,a"}
@@ -331,7 +331,7 @@ const BackgroundScorm = props => {
331
331
  className: _summary.default.organismPlayerResultContainerScorm
332
332
  }, failed === false ? /*#__PURE__*/_react.default.createElement("div", {
333
333
  className: _summary.default.animationContainer
334
- }, /*#__PURE__*/_react.default.createElement(_lottieWrapper.default, {
334
+ }, /*#__PURE__*/_react.default.createElement(_lottieWrapper.default, _extends({
335
335
  'aria-label': 'aria lottie',
336
336
  'data-name': 'default-lottie',
337
337
  className: undefined,
@@ -343,14 +343,15 @@ const BackgroundScorm = props => {
343
343
  animationClassName: ''
344
344
  },
345
345
  ie11ImageBackup: 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg',
346
- animationControl: undefined,
346
+ animationControl: undefined
347
+ }, {
347
348
  loop: false,
348
349
  animationControl: 'play',
349
350
  autoplay: true,
350
351
  "data-name": "lottie-wrapper",
351
352
  className: _summary.default.lottie,
352
353
  backupImageClassName: _summary.default.ie11Backup
353
- })) : null, /*#__PURE__*/_react.default.createElement("div", {
354
+ }))) : null, /*#__PURE__*/_react.default.createElement("div", {
354
355
  className: _summary.default.background
355
356
  }, /*#__PURE__*/_react.default.createElement("div", {
356
357
  className: _summary.default.largeCircle
@@ -1 +1 @@
1
- {"version":3,"file":"summary.js","names":["Header","props","SimpleAction","color","prefix","title","button","buttonTitle","linkProps","style","simpleWrapper","simpleTexts","simplePrefix","classnames","simpleTitle","innerHTML","__html","backgroundColor","simpleButton","propTypes","PropTypes","string","shape","Button","NextCourse","card","nextCourseWrapper","nextCourseTexts","nextCoursePrefix","nextCourseTitle","nextCourseCard","CardsList","Subscribe","description","subscribeWrapper","subscribeTexts","subscribeDescription","subscribeTitle","subscribeButtonWrapper","subscribeButton","submitValue","actions","simple","subscribe","nextCourse","Action","type","actionProps","Type","oneOf","CardsLoader","loaderWrapper","CommentConfirmation","context","onClick","commentSectionTitle","confirmationLinkText","skin","dark","commentSection","commentSectionIconWrapper","commentSectionIcon","commentSectionTexts","commentSectionLink","node","Link","children","contextTypes","Provider","childContextTypes","CommentSection","isSent","edition","confirmation","bool","Discussion","Cards","cards","cardsWrapper","Footer","footer","Summary","header","recommendation","comment","action","feedback","mode","primary","commentView","discussionWrapper","footerView","feedbackView","failed","summaryWrapper","BackgroundScorm","organismPlayerResultContainerScorm","animationContainer","className","undefined","animationSrc","loop","autoplay","rendererSettings","hideOnTransparent","animationClassName","ie11ImageBackup","animationControl","lottie","ie11Backup","background","largeCircle","mediumCircle","smallCircle","content","PopinHeader","href","func","isRequired","Feedback"],"sources":["../../../../src/template/app-player/popin-end/summary.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, keys, isEmpty} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {NovaSolidStatusCheckCircle2 as CheckIcon} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Link from '../../../atom/link';\nimport Discussion from '../../../organism/discussion';\nimport Loader from '../../../atom/loader';\nimport Card from '../../../molecule/card';\nimport Feedback from '../../../molecule/feedback';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport PopinHeader from '../popin-header';\nimport AtomLottieWrapper from '../../../atom/lottie-wrapper';\nimport style from './summary.css';\n\nconst Header = props => <PopinHeader {...props} />;\n\nconst SimpleAction = ({color, prefix, title, button}) => {\n const {title: buttonTitle, ...linkProps} = button;\n return (\n <div data-name=\"simpleAction\" className={style.simpleWrapper}>\n <div className={style.simpleTexts}>\n <span data-name=\"simplePrefix\" className={style.simplePrefix}>\n {prefix}\n </span>\n <span\n data-name=\"simpleTitle\"\n className={classnames(style.simpleTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n <Button\n {...linkProps}\n type=\"link\"\n style={{\n backgroundColor: color\n }}\n className={style.simpleButton}\n submitValue={buttonTitle}\n />\n </div>\n );\n};\nSimpleAction.propTypes = {\n color: PropTypes.string,\n prefix: PropTypes.string,\n title: PropTypes.string,\n button: PropTypes.shape(Button.propTypes)\n};\n\nconst NextCourse = ({title, prefix, card}) => (\n <div data-name=\"nextCourse\" className={style.nextCourseWrapper}>\n <div className={style.nextCourseTexts}>\n <div className={style.nextCoursePrefix}>{prefix}</div>\n <div\n className={classnames(style.nextCourseTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n <div className={style.nextCourseCard}>\n <Card {...card} dataName={'popin-end-next-course'} />\n </div>\n </div>\n);\nNextCourse.propTypes = {\n title: PropTypes.string,\n prefix: PropTypes.string,\n card: PropTypes.shape(CardsList.propTypes)\n};\n\nconst Subscribe = ({title, description, button, card}) => {\n const {title: buttonTitle, ...linkProps} = button;\n return (\n <div className={style.subscribeWrapper}>\n <div className={style.subscribeTexts}>\n <div className={style.subscribeDescription}>{description}</div>\n <div\n className={classnames(style.subscribeTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <div className={style.subscribeButtonWrapper}>\n <Button\n {...linkProps}\n type=\"link\"\n className={style.subscribeButton}\n submitValue={buttonTitle}\n />\n </div>\n </div>\n <div>\n <Card {...card} dataName={'popin-end-subscribe'} />\n </div>\n </div>\n );\n};\n\nSubscribe.propTypes = {\n ...Button.propTypes.propTypes,\n title: Button.propTypes.submitValue\n};\n\nconst actions = {\n simple: SimpleAction,\n subscribe: Subscribe,\n nextCourse: NextCourse\n};\n\nconst Action = props => {\n const {type, ...actionProps} = props;\n const Type = get(type, actions);\n\n return Type ? <Type {...actionProps} /> : null;\n};\n\nAction.propTypes = {\n type: PropTypes.oneOf(keys(actions))\n};\n\nconst CardsLoader = () => (\n <div className={style.loaderWrapper}>\n <Loader />\n </div>\n);\n\nconst CommentConfirmation = (props, context) => {\n const {onClick, commentSectionTitle, confirmationLinkText} = props;\n const {skin} = context;\n const dark = get('common.dark', skin);\n\n return (\n <div className={style.commentSection}>\n <div className={style.commentSectionIconWrapper}>\n <CheckIcon className={style.commentSectionIcon} color={dark} />\n </div>\n <div className={style.commentSectionTexts}>\n <p>{commentSectionTitle}</p>\n <Link onClick={onClick} className={style.commentSectionLink}>\n {confirmationLinkText}\n </Link>\n </div>\n </div>\n );\n};\n\nCommentConfirmation.propTypes = {\n commentSectionTitle: PropTypes.node,\n confirmationLinkText: Link.propTypes.children,\n onClick: Link.propTypes.onClick\n};\n\nCommentConfirmation.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nconst CommentSection = props => {\n const {isSent, edition, confirmation} = props;\n if (isSent) {\n const {onClick, commentSectionTitle, confirmationLinkText} = confirmation;\n return (\n <CommentConfirmation\n onClick={onClick}\n commentSectionTitle={commentSectionTitle}\n confirmationLinkText={confirmationLinkText}\n />\n );\n }\n\n return <Discussion {...edition} />;\n};\n\nCommentSection.propTypes = {\n isSent: PropTypes.bool,\n edition: PropTypes.shape(Discussion.propTypes),\n confirmation: PropTypes.shape(CommentConfirmation.propTypes)\n};\n\nconst Cards = props => {\n const {cards} = props;\n\n return get('cards', props) === null ? (\n <CardsLoader />\n ) : (\n (isEmpty(cards) ? null : (\n <div className={style.cardsWrapper}>\n <CardsList {...props} dataName={'popin-end-recommendation'} />\n </div>\n )) || null\n );\n};\n\nCards.propTypes = CardsList.propTypes;\n\nconst Footer = ({title, color, ...linkProps}) => (\n <Link\n {...linkProps}\n style={{\n color\n }}\n className={style.footer}\n data-name=\"nextLink\"\n data-popin=\"popinEnd\"\n data-next=\"home\"\n >\n {title}\n </Link>\n);\n\nFooter.propTypes = {\n ...Link.propTypes,\n title: Link.propTypes.children,\n color: PropTypes.string\n};\n\nconst Summary = (props, context) => {\n const {header, recommendation, comment, footer, action, feedback, mode} = props;\n const {skin} = context;\n const primary = getOr('#f0f', 'common.primary', skin);\n const commentView =\n mode !== 'scorm' && comment && header ? (\n <div className={style.discussionWrapper}>\n <CommentSection {...comment} />\n </div>\n ) : null;\n const footerView =\n mode !== 'scorm' && footer && header ? <Footer {...footer} color={primary} /> : null;\n const feedbackView = feedback ? <Feedback {...feedback} mode={mode} /> : null;\n\n return (\n <BackgroundScorm mode={mode} failed={header.failed}>\n <div className={mode !== 'scorm' ? style.summaryWrapper : null}>\n <Header {...header} mode={mode} />\n {feedbackView}\n <Action {...action} color={primary} />\n <Cards {...recommendation} />\n {commentView}\n {footerView}\n </div>\n </BackgroundScorm>\n );\n};\n\nconst BackgroundScorm = props => {\n const {mode = 'default', children, failed} = props;\n if (mode === 'scorm')\n return (\n <div className={style.organismPlayerResultContainerScorm}>\n {failed === false ? (\n <div className={style.animationContainer}>\n <AtomLottieWrapper\n {...{\n 'aria-label': 'aria lottie',\n 'data-name': 'default-lottie',\n className: undefined,\n animationSrc:\n 'https://static-staging.coorpacademy.com/animations/review/confetti.json',\n loop: undefined,\n autoplay: true,\n rendererSettings: {\n hideOnTransparent: false,\n animationClassName: ''\n },\n ie11ImageBackup:\n 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg',\n animationControl: undefined\n }}\n loop={false}\n animationControl={'play'}\n autoplay\n data-name=\"lottie-wrapper\"\n className={style.lottie}\n backupImageClassName={style.ie11Backup}\n />\n </div>\n ) : null}\n <div className={style.background}>\n <div className={style.largeCircle} />\n <div className={style.mediumCircle} />\n <div className={style.smallCircle} />\n </div>\n <div className={style.content}>{children}</div>\n </div>\n );\n return children;\n};\n\nSummary.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSummary.propTypes = {\n header: PropTypes.shape(PopinHeader.propTypes),\n footer: PropTypes.shape({\n title: PropTypes.string,\n href: Link.propTypes.href,\n onClick: PropTypes.func\n }),\n comment: PropTypes.shape(CommentSection.propTypes),\n action: PropTypes.shape({\n type: PropTypes.oneOf(keys(actions)).isRequired\n }),\n recommendation: PropTypes.shape(CardsList.propTypes),\n feedback: PropTypes.shape(Feedback.propTypes),\n mode: PropTypes.oneOf(['scorm', 'default'])\n};\n\nexport default Summary;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;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CAAK9C,SAAL,CAAeiG,IAFC;IAGtB9D,OAAO,EAAElC,kBAAA,CAAUiG;EAHG,CAAhB,CAFU;EAOlBjC,OAAO,EAAEhE,kBAAA,CAAUE,KAAV,CAAgBgD,cAAc,CAACnD,SAA/B,CAPS;EAQlBkE,MAAM,EAAEjE,kBAAA,CAAUE,KAAV,CAAgB;IACtBwB,IAAI,EAAE1B,kBAAA,CAAU6B,KAAV,CAAgB,oBAAKR,OAAL,CAAhB,EAA+B6E;EADf,CAAhB,CARU;EAWlBnC,cAAc,EAAE/D,kBAAA,CAAUE,KAAV,CAAgBS,kBAAA,CAAUZ,SAA1B,CAXE;EAYlBmE,QAAQ,EAAElE,kBAAA,CAAUE,KAAV,CAAgBiG,iBAAA,CAASpG,SAAzB,CAZQ;EAalBoE,IAAI,EAAEnE,kBAAA,CAAU6B,KAAV,CAAgB,CAAC,OAAD,EAAU,SAAV,CAAhB;AAbY,CAApB;eAgBegC,O"}
1
+ {"version":3,"file":"summary.js","names":["Header","props","SimpleAction","color","prefix","title","button","buttonTitle","linkProps","style","simpleWrapper","simpleTexts","simplePrefix","classnames","simpleTitle","innerHTML","__html","backgroundColor","simpleButton","propTypes","PropTypes","string","shape","Button","NextCourse","card","nextCourseWrapper","nextCourseTexts","nextCoursePrefix","nextCourseTitle","nextCourseCard","CardsList","Subscribe","description","subscribeWrapper","subscribeTexts","subscribeDescription","subscribeTitle","subscribeButtonWrapper","subscribeButton","submitValue","actions","simple","subscribe","nextCourse","Action","type","actionProps","Type","oneOf","CardsLoader","loaderWrapper","CommentConfirmation","context","onClick","commentSectionTitle","confirmationLinkText","skin","dark","commentSection","commentSectionIconWrapper","commentSectionIcon","commentSectionTexts","commentSectionLink","node","Link","children","contextTypes","Provider","childContextTypes","CommentSection","isSent","edition","confirmation","bool","Discussion","Cards","cards","cardsWrapper","Footer","footer","Summary","header","recommendation","comment","action","feedback","mode","primary","commentView","discussionWrapper","footerView","feedbackView","failed","summaryWrapper","BackgroundScorm","organismPlayerResultContainerScorm","animationContainer","className","undefined","animationSrc","loop","autoplay","rendererSettings","hideOnTransparent","animationClassName","ie11ImageBackup","animationControl","lottie","ie11Backup","background","largeCircle","mediumCircle","smallCircle","content","PopinHeader","href","func","isRequired","Feedback"],"sources":["../../../../src/template/app-player/popin-end/summary.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, keys, isEmpty} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {NovaSolidStatusCheckCircle2 as CheckIcon} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Link from '../../../atom/link';\nimport Discussion from '../../../organism/discussion';\nimport Loader from '../../../atom/loader';\nimport Card from '../../../molecule/card';\nimport Feedback from '../../../molecule/feedback';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport PopinHeader from '../popin-header';\nimport AtomLottieWrapper from '../../../atom/lottie-wrapper';\nimport style from './summary.css';\n\nconst Header = props => <PopinHeader {...props} />;\n\nconst SimpleAction = ({color, prefix, title, button}) => {\n const {title: buttonTitle, ...linkProps} = button;\n return (\n <div data-name=\"simpleAction\" className={style.simpleWrapper}>\n <div className={style.simpleTexts}>\n <span data-name=\"simplePrefix\" className={style.simplePrefix}>\n {prefix}\n </span>\n <span\n data-name=\"simpleTitle\"\n className={classnames(style.simpleTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n <Button\n {...linkProps}\n type=\"link\"\n style={{\n backgroundColor: color\n }}\n className={style.simpleButton}\n submitValue={buttonTitle}\n />\n </div>\n );\n};\nSimpleAction.propTypes = {\n color: PropTypes.string,\n prefix: PropTypes.string,\n title: PropTypes.string,\n button: PropTypes.shape(Button.propTypes)\n};\n\nconst NextCourse = ({title, prefix, card}) => (\n <div data-name=\"nextCourse\" className={style.nextCourseWrapper}>\n <div className={style.nextCourseTexts}>\n <div className={style.nextCoursePrefix}>{prefix}</div>\n <div\n className={classnames(style.nextCourseTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n <div className={style.nextCourseCard}>\n <Card {...card} dataName={'popin-end-next-course'} />\n </div>\n </div>\n);\nNextCourse.propTypes = {\n title: PropTypes.string,\n prefix: PropTypes.string,\n card: PropTypes.shape(CardsList.propTypes)\n};\n\nconst Subscribe = ({title, description, button, card}) => {\n const {title: buttonTitle, ...linkProps} = button;\n return (\n <div className={style.subscribeWrapper}>\n <div className={style.subscribeTexts}>\n <div className={style.subscribeDescription}>{description}</div>\n <div\n className={classnames(style.subscribeTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <div className={style.subscribeButtonWrapper}>\n <Button\n {...linkProps}\n type=\"link\"\n className={style.subscribeButton}\n submitValue={buttonTitle}\n />\n </div>\n </div>\n <div>\n <Card {...card} dataName={'popin-end-subscribe'} />\n </div>\n </div>\n );\n};\n\nSubscribe.propTypes = {\n ...Button.propTypes.propTypes,\n title: Button.propTypes.submitValue\n};\n\nconst actions = {\n simple: SimpleAction,\n subscribe: Subscribe,\n nextCourse: NextCourse\n};\n\nconst Action = props => {\n const {type, ...actionProps} = props;\n const Type = get(type, actions);\n\n return Type ? <Type {...actionProps} /> : null;\n};\n\nAction.propTypes = {\n type: PropTypes.oneOf(keys(actions))\n};\n\nconst CardsLoader = () => (\n <div className={style.loaderWrapper}>\n <Loader />\n </div>\n);\n\nconst CommentConfirmation = (props, context) => {\n const {onClick, commentSectionTitle, confirmationLinkText} = props;\n const {skin} = context;\n const dark = get('common.dark', skin);\n\n return (\n <div className={style.commentSection}>\n <div className={style.commentSectionIconWrapper}>\n <CheckIcon className={style.commentSectionIcon} color={dark} />\n </div>\n <div className={style.commentSectionTexts}>\n <p>{commentSectionTitle}</p>\n <Link onClick={onClick} className={style.commentSectionLink}>\n {confirmationLinkText}\n </Link>\n </div>\n </div>\n );\n};\n\nCommentConfirmation.propTypes = {\n commentSectionTitle: PropTypes.node,\n confirmationLinkText: Link.propTypes.children,\n onClick: Link.propTypes.onClick\n};\n\nCommentConfirmation.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nconst CommentSection = props => {\n const {isSent, edition, confirmation} = props;\n if (isSent) {\n const {onClick, commentSectionTitle, confirmationLinkText} = confirmation;\n return (\n <CommentConfirmation\n onClick={onClick}\n commentSectionTitle={commentSectionTitle}\n confirmationLinkText={confirmationLinkText}\n />\n );\n }\n\n return <Discussion {...edition} />;\n};\n\nCommentSection.propTypes = {\n isSent: PropTypes.bool,\n edition: PropTypes.shape(Discussion.propTypes),\n confirmation: PropTypes.shape(CommentConfirmation.propTypes)\n};\n\nconst Cards = props => {\n const {cards} = props;\n\n return get('cards', props) === null ? (\n <CardsLoader />\n ) : (\n (isEmpty(cards) ? null : (\n <div className={style.cardsWrapper}>\n <CardsList {...props} dataName={'popin-end-recommendation'} />\n </div>\n )) || null\n );\n};\n\nCards.propTypes = CardsList.propTypes;\n\nconst Footer = ({title, color, ...linkProps}) => (\n <Link\n {...linkProps}\n style={{\n color\n }}\n className={style.footer}\n data-name=\"nextLink\"\n data-popin=\"popinEnd\"\n data-next=\"home\"\n >\n {title}\n </Link>\n);\n\nFooter.propTypes = {\n ...Link.propTypes,\n title: Link.propTypes.children,\n color: PropTypes.string\n};\n\nconst Summary = (props, context) => {\n const {header, recommendation, comment, footer, action, feedback, mode} = props;\n const {skin} = context;\n const primary = getOr('#f0f', 'common.primary', skin);\n const commentView =\n mode !== 'scorm' && comment && header ? (\n <div className={style.discussionWrapper}>\n <CommentSection {...comment} />\n </div>\n ) : null;\n const footerView =\n mode !== 'scorm' && footer && header ? <Footer {...footer} color={primary} /> : null;\n const feedbackView = feedback ? <Feedback {...feedback} mode={mode} /> : null;\n\n return (\n <BackgroundScorm mode={mode} failed={header.failed}>\n <div className={mode !== 'scorm' ? style.summaryWrapper : null}>\n <Header {...header} mode={mode} />\n {feedbackView}\n <Action {...action} color={primary} />\n <Cards {...recommendation} />\n {commentView}\n {footerView}\n </div>\n </BackgroundScorm>\n );\n};\n\nconst BackgroundScorm = props => {\n const {mode = 'default', children, failed} = props;\n if (mode === 'scorm')\n return (\n <div className={style.organismPlayerResultContainerScorm}>\n {failed === false ? (\n <div className={style.animationContainer}>\n <AtomLottieWrapper\n {...{\n 'aria-label': 'aria lottie',\n 'data-name': 'default-lottie',\n className: undefined,\n animationSrc:\n 'https://static-staging.coorpacademy.com/animations/review/confetti.json',\n loop: undefined,\n autoplay: true,\n rendererSettings: {\n hideOnTransparent: false,\n animationClassName: ''\n },\n ie11ImageBackup:\n 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg',\n animationControl: undefined\n }}\n loop={false}\n animationControl={'play'}\n autoplay\n data-name=\"lottie-wrapper\"\n className={style.lottie}\n backupImageClassName={style.ie11Backup}\n />\n </div>\n ) : null}\n <div className={style.background}>\n <div className={style.largeCircle} />\n <div className={style.mediumCircle} />\n <div className={style.smallCircle} />\n </div>\n <div className={style.content}>{children}</div>\n </div>\n );\n return children;\n};\n\nSummary.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSummary.propTypes = {\n header: PropTypes.shape(PopinHeader.propTypes),\n footer: PropTypes.shape({\n title: PropTypes.string,\n href: Link.propTypes.href,\n onClick: PropTypes.func\n }),\n comment: PropTypes.shape(CommentSection.propTypes),\n action: PropTypes.shape({\n type: PropTypes.oneOf(keys(actions)).isRequired\n }),\n recommendation: PropTypes.shape(CardsList.propTypes),\n feedback: PropTypes.shape(Feedback.propTypes),\n mode: PropTypes.oneOf(['scorm', 'default'])\n};\n\nexport default Summary;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;AAEA,MAAMA,MAAM,GAAGC,KAAK,iBAAI,6BAAC,oBAAD,EAAiBA,KAAjB,CAA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E,kBAAA,CAAUE,KAAV,CAAgBgD,cAAc,CAACnD,SAA/B,CAPS;EAQlBkE,MAAM,EAAEjE,kBAAA,CAAUE,KAAV,CAAgB;IACtBwB,IAAI,EAAE1B,kBAAA,CAAU6B,KAAV,CAAgB,oBAAKR,OAAL,CAAhB,EAA+B6E;EADf,CAAhB,CARU;EAWlBnC,cAAc,EAAE/D,kBAAA,CAAUE,KAAV,CAAgBS,kBAAA,CAAUZ,SAA1B,CAXE;EAYlBmE,QAAQ,EAAElE,kBAAA,CAAUE,KAAV,CAAgBiG,iBAAA,CAASpG,SAAzB,CAZQ;EAalBoE,IAAI,EAAEnE,kBAAA,CAAU6B,KAAV,CAAgB,CAAC,OAAD,EAAU,SAAV,CAAhB;AAbY,CAApB;eAgBegC,O"}
@@ -15,7 +15,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
15
15
 
16
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
17
 
18
- const Context = /*#__PURE__*/(0, _react.createContext)({
18
+ const Context = (0, _react.createContext)({
19
19
  theme: _theme.default,
20
20
  translations: {},
21
21
  display: {
@@ -1 +1 @@
1
- {"version":3,"file":"template-context.js","names":["Context","createContext","theme","defaultTheme","translations","display","headerHeight","statusBarHeight","store","useTemplateContext","context","useContext","Error","TemplateContext","values","children"],"sources":["../../../src/template/app-review/template-context.tsx"],"sourcesContent":["import React, {createContext, useContext} from 'react';\nimport {Translations} from '../../types/translations';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type HandleBlur = () => void;\nexport type HandleFocus = (id: string) => () => void;\nexport type FocusedSelectId = string | null;\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n headerHeight: number;\n statusBarHeight: number;\n };\n store: {\n focusedSelectId?: FocusedSelectId;\n handleBlur?: HandleBlur;\n handleFocus?: HandleFocus;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n headerHeight: 67,\n statusBarHeight: 42\n },\n store: {}\n});\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport {TemplateContext, useTemplateContext};\n"],"mappings":";;;;;AAAA;;AAGA;;;;;;;;;;AA0BA,MAAMA,OAAO,gBAAG,IAAAC,oBAAA,EAAc;EAC5BC,KAAK,EAAEC,cADqB;EAE5BC,YAAY,EAAE,EAFc;EAG5BC,OAAO,EAAE;IACPC,YAAY,EAAE,EADP;IAEPC,eAAe,EAAE;EAFV,CAHmB;EAO5BC,KAAK,EAAE;AAPqB,CAAd,CAAhB;;AAUA,MAAMC,kBAAkB,GAAG,MAA6B;EACtD,MAAMC,OAAO,GAAG,IAAAC,iBAAA,EAAWX,OAAX,CAAhB;;EAEA,IAAI,CAACU,OAAL,EAAc;IACZ,MAAM,IAAIE,KAAJ,CACH,yFADG,CAAN;EAGD;;EAED,OAAOF,OAAP;AACD,CAVD;;;;AAYA,MAAMG,eAAe,GAAG,CAAC;EAACC,MAAD;EAASC;AAAT,CAAD,KAA+B;EACrD,oBAAO,6BAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,eAAMD,MAAN;EAAvB,GAAuCC,QAAvC,CAAP;AACD,CAFD"}
1
+ {"version":3,"file":"template-context.js","names":["Context","createContext","theme","defaultTheme","translations","display","headerHeight","statusBarHeight","store","useTemplateContext","context","useContext","Error","TemplateContext","values","children"],"sources":["../../../src/template/app-review/template-context.tsx"],"sourcesContent":["import React, {createContext, useContext} from 'react';\nimport {Translations} from '../../types/translations';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type HandleBlur = () => void;\nexport type HandleFocus = (id: string) => () => void;\nexport type FocusedSelectId = string | null;\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n headerHeight: number;\n statusBarHeight: number;\n };\n store: {\n focusedSelectId?: FocusedSelectId;\n handleBlur?: HandleBlur;\n handleFocus?: HandleFocus;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n headerHeight: 67,\n statusBarHeight: 42\n },\n store: {}\n});\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport {TemplateContext, useTemplateContext};\n"],"mappings":";;;;;AAAA;;AAGA;;;;;;;;;;AA0BA,MAAMA,OAAO,GAAG,IAAAC,oBAAA,EAAc;EAC5BC,KAAK,EAAEC,cADqB;EAE5BC,YAAY,EAAE,EAFc;EAG5BC,OAAO,EAAE;IACPC,YAAY,EAAE,EADP;IAEPC,eAAe,EAAE;EAFV,CAHmB;EAO5BC,KAAK,EAAE;AAPqB,CAAd,CAAhB;;AAUA,MAAMC,kBAAkB,GAAG,MAA6B;EACtD,MAAMC,OAAO,GAAG,IAAAC,iBAAA,EAAWX,OAAX,CAAhB;;EAEA,IAAI,CAACU,OAAL,EAAc;IACZ,MAAM,IAAIE,KAAJ,CACH,yFADG,CAAN;EAGD;;EAED,OAAOF,OAAP;AACD,CAVD;;;;AAYA,MAAMG,eAAe,GAAG,CAAC;EAACC,MAAD;EAASC;AAAT,CAAD,KAA+B;EACrD,oBAAO,6BAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,eAAMD,MAAN;EAAvB,GAAuCC,QAAvC,CAAP;AACD,CAFD"}
@@ -25,7 +25,7 @@ var _style = _interopRequireDefault(require("./style.css"));
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
28
- const Hero = /*#__PURE__*/_react.default.memo(function Hero({
28
+ const Hero = _react.default.memo(function Hero({
29
29
  hero,
30
30
  welcome
31
31
  }) {