@coorpacademy/components 11.0.0 → 11.0.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 (92) hide show
  1. package/es/atom/picture/index.js +5 -8
  2. package/es/atom/picture/index.js.map +1 -1
  3. package/es/molecule/card-congrats/index.native.d.ts.map +1 -1
  4. package/es/molecule/card-congrats/index.native.js.map +1 -1
  5. package/es/molecule/discipline-scope/index.d.ts +1 -0
  6. package/es/molecule/forum/forum-comment/index.d.ts +1 -0
  7. package/es/molecule/forum/forum-comment/index.d.ts.map +1 -1
  8. package/es/molecule/forum/forum-comment/index.js +5 -2
  9. package/es/molecule/forum/forum-comment/index.js.map +1 -1
  10. package/es/molecule/forum/forum-post/index.d.ts +2 -0
  11. package/es/molecule/forum/forum-post/index.d.ts.map +1 -1
  12. package/es/molecule/forum/forum-post/index.js +8 -1
  13. package/es/molecule/forum/forum-post/index.js.map +1 -1
  14. package/es/molecule/review-correction-popin/index.native.d.ts.map +1 -1
  15. package/es/molecule/review-correction-popin/index.native.js +8 -9
  16. package/es/molecule/review-correction-popin/index.native.js.map +1 -1
  17. package/es/molecule/scope-content/index.d.ts +1 -0
  18. package/es/organism/discussion/index.d.ts +1 -0
  19. package/es/organism/discussion/index.d.ts.map +1 -1
  20. package/es/organism/discussion/index.js +4 -1
  21. package/es/organism/discussion/index.js.map +1 -1
  22. package/es/organism/review-congrats/index.native.d.ts.map +1 -1
  23. package/es/organism/review-congrats/index.native.js +60 -67
  24. package/es/organism/review-congrats/index.native.js.map +1 -1
  25. package/es/organism/review-slide/index.native.d.ts.map +1 -1
  26. package/es/organism/review-slide/index.native.js +10 -6
  27. package/es/organism/review-slide/index.native.js.map +1 -1
  28. package/es/organism/review-slide/prop-types.d.ts +2 -0
  29. package/es/organism/review-slide/prop-types.d.ts.map +1 -1
  30. package/es/organism/review-slide/prop-types.js.map +1 -1
  31. package/es/organism/review-stacked-slides/index.native.d.ts +1 -1
  32. package/es/organism/review-stacked-slides/index.native.d.ts.map +1 -1
  33. package/es/organism/review-stacked-slides/index.native.js +85 -12
  34. package/es/organism/review-stacked-slides/index.native.js.map +1 -1
  35. package/es/template/app-player/popin-end/index.d.ts +1 -0
  36. package/es/template/app-player/popin-end/summary.d.ts +1 -0
  37. package/es/template/common/discipline/index.d.ts +1 -0
  38. package/lib/atom/picture/index.js +5 -8
  39. package/lib/atom/picture/index.js.map +1 -1
  40. package/lib/molecule/card-congrats/index.native.d.ts.map +1 -1
  41. package/lib/molecule/card-congrats/index.native.js.map +1 -1
  42. package/lib/molecule/discipline-scope/index.d.ts +1 -0
  43. package/lib/molecule/forum/forum-comment/index.d.ts +1 -0
  44. package/lib/molecule/forum/forum-comment/index.d.ts.map +1 -1
  45. package/lib/molecule/forum/forum-comment/index.js +5 -2
  46. package/lib/molecule/forum/forum-comment/index.js.map +1 -1
  47. package/lib/molecule/forum/forum-post/index.d.ts +2 -0
  48. package/lib/molecule/forum/forum-post/index.d.ts.map +1 -1
  49. package/lib/molecule/forum/forum-post/index.js +8 -1
  50. package/lib/molecule/forum/forum-post/index.js.map +1 -1
  51. package/lib/molecule/review-correction-popin/index.native.d.ts.map +1 -1
  52. package/lib/molecule/review-correction-popin/index.native.js +9 -10
  53. package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
  54. package/lib/molecule/scope-content/index.d.ts +1 -0
  55. package/lib/organism/discussion/index.d.ts +1 -0
  56. package/lib/organism/discussion/index.d.ts.map +1 -1
  57. package/lib/organism/discussion/index.js +4 -1
  58. package/lib/organism/discussion/index.js.map +1 -1
  59. package/lib/organism/review-congrats/index.native.d.ts.map +1 -1
  60. package/lib/organism/review-congrats/index.native.js +60 -68
  61. package/lib/organism/review-congrats/index.native.js.map +1 -1
  62. package/lib/organism/review-slide/index.native.d.ts.map +1 -1
  63. package/lib/organism/review-slide/index.native.js +11 -7
  64. package/lib/organism/review-slide/index.native.js.map +1 -1
  65. package/lib/organism/review-slide/prop-types.d.ts +2 -0
  66. package/lib/organism/review-slide/prop-types.d.ts.map +1 -1
  67. package/lib/organism/review-slide/prop-types.js.map +1 -1
  68. package/lib/organism/review-stacked-slides/index.native.d.ts +1 -1
  69. package/lib/organism/review-stacked-slides/index.native.d.ts.map +1 -1
  70. package/lib/organism/review-stacked-slides/index.native.js +85 -12
  71. package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
  72. package/lib/template/app-player/popin-end/index.d.ts +1 -0
  73. package/lib/template/app-player/popin-end/summary.d.ts +1 -0
  74. package/lib/template/common/discipline/index.d.ts +1 -0
  75. package/locales/.mtslconfig.json +1 -0
  76. package/package.json +3 -2
  77. package/es/behaviours/use-translate-vertically.native.d.ts +0 -16
  78. package/es/behaviours/use-translate-vertically.native.d.ts.map +0 -1
  79. package/es/behaviours/use-translate-vertically.native.js +0 -44
  80. package/es/behaviours/use-translate-vertically.native.js.map +0 -1
  81. package/es/behaviours/use-update-opacity.native.d.ts +0 -14
  82. package/es/behaviours/use-update-opacity.native.d.ts.map +0 -1
  83. package/es/behaviours/use-update-opacity.native.js +0 -55
  84. package/es/behaviours/use-update-opacity.native.js.map +0 -1
  85. package/lib/behaviours/use-translate-vertically.native.d.ts +0 -16
  86. package/lib/behaviours/use-translate-vertically.native.d.ts.map +0 -1
  87. package/lib/behaviours/use-translate-vertically.native.js +0 -51
  88. package/lib/behaviours/use-translate-vertically.native.js.map +0 -1
  89. package/lib/behaviours/use-update-opacity.native.d.ts +0 -14
  90. package/lib/behaviours/use-update-opacity.native.d.ts.map +0 -1
  91. package/lib/behaviours/use-update-opacity.native.js +0 -62
  92. package/lib/behaviours/use-update-opacity.native.js.map +0 -1
@@ -13,6 +13,8 @@ var _lottieReactNative = _interopRequireDefault(require("lottie-react-native"));
13
13
 
14
14
  var _novaIcons = require("@coorpacademy/nova-icons");
15
15
 
16
+ var _reactNativeAnimation = require("@coorpacademy/react-native-animation");
17
+
16
18
  var _templateContext = require("../../template/app-review/template-context");
17
19
 
18
20
  var _index = _interopRequireDefault(require("../../atom/button/index.native"));
@@ -21,10 +23,6 @@ var _shadow = require("../../variables/shadow");
21
23
 
22
24
  var _index2 = _interopRequireDefault(require("../../molecule/card-congrats/index.native"));
23
25
 
24
- var _useTranslateVertically = _interopRequireDefault(require("../../behaviours/use-translate-vertically.native"));
25
-
26
- var _useUpdateOpacity = _interopRequireDefault(require("../../behaviours/use-update-opacity.native"));
27
-
28
26
  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); }
29
27
 
30
28
  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; }
@@ -73,6 +71,19 @@ const createStyleSheet = theme => _reactNative.StyleSheet.create({
73
71
  }
74
72
  });
75
73
 
74
+ const fadeIn = {
75
+ property: 'opacity',
76
+ fromValue: 0,
77
+ toValue: 1,
78
+ duration: 350
79
+ };
80
+ const translateHorizontally = {
81
+ property: 'translateX',
82
+ fromValue: 180,
83
+ toValue: 0,
84
+ duration: 800
85
+ };
86
+
76
87
  const ReviewCongrats = props => {
77
88
  const {
78
89
  'aria-label': ariaLabel,
@@ -86,76 +97,53 @@ const ReviewCongrats = props => {
86
97
  const {
87
98
  theme
88
99
  } = (0, _templateContext.useTemplateContext)();
89
- const {
90
- height: windowHeight
91
- } = (0, _reactNative.useWindowDimensions)();
92
100
  const [styleSheet, setStylesheet] = (0, _react.useState)(null);
93
101
  const [isCongratsTranslationDone, setCongratsTranslationDone] = (0, _react.useState)(false);
94
102
  const [isRankShown, setRankShown] = (0, _react.useState)(false);
95
- const {
96
- translate: translateCongratsUp,
97
- animatedY: animatedCongratsY
98
- } = (0, _useTranslateVertically.default)({
99
- fromValue: windowHeight,
100
- toValue: 0,
101
- delay: 750,
102
- onFinished: () => {
103
+ const scrollViewRef = (0, _react.useRef)(null);
104
+ const showCongrats = (0, _reactNativeAnimation.useAnimateProp)({
105
+ property: 'opacity',
106
+ fromValue: 0,
107
+ toValue: 1,
108
+ duration: 950,
109
+ onComplete: () => {
103
110
  setCongratsTranslationDone(true);
104
111
  }
105
112
  });
106
- const {
107
- translate: translateRankUp,
108
- animatedY: animatedRankY
109
- } = (0, _useTranslateVertically.default)({
110
- fromValue: 150,
111
- duration: 750,
112
- toValue: 0
113
+ const translateCongrats = (0, _reactNativeAnimation.useTranslateY)({
114
+ fromValue: 100,
115
+ toValue: 0,
116
+ duration: 550
113
117
  });
114
- const {
115
- fadeIn: showRank,
116
- animatedOpacity: animatedRankOpacity
117
- } = (0, _useUpdateOpacity.default)({
118
- onFadeInFinished: () => {
118
+ const showConfettis = (0, _reactNativeAnimation.useAnimateProp)(fadeIn);
119
+ const fadeInRank = (0, _reactNativeAnimation.useAnimateProp)(fadeIn);
120
+ const translateRank = (0, _reactNativeAnimation.useTranslateX)(_extends({}, translateHorizontally, {
121
+ onComplete: () => {
119
122
  setRankShown(true);
123
+ setTimeout(() => {
124
+ scrollViewRef?.current?.scrollToEnd();
125
+ }, 700);
120
126
  }
121
- });
122
- const scrollViewRef = (0, _react.useRef)(null);
123
- const {
124
- translate: translateStarsUp,
125
- animatedY: animatedStarsY
126
- } = (0, _useTranslateVertically.default)({
127
- fromValue: 150,
128
- toValue: 0,
129
- duration: 750,
130
- delay: 250
131
- });
132
- const {
133
- fadeIn: showStars,
134
- animatedOpacity: animatedStarsOpacity
135
- } = (0, _useUpdateOpacity.default)({
136
- delay: 250
137
- });
127
+ }));
128
+ const animatedRank = [fadeInRank.animatedStyle, translateRank.animatedStyle];
129
+ const fadeInStars = (0, _reactNativeAnimation.useAnimateProp)(_extends({}, fadeIn, {
130
+ delay: 1000
131
+ }));
132
+ const translateStars = (0, _reactNativeAnimation.useTranslateX)(_extends({}, translateHorizontally, {
133
+ delay: 1000
134
+ }));
135
+ const showButton1 = (0, _reactNativeAnimation.useAnimateProp)(fadeIn);
136
+ const showButton2 = (0, _reactNativeAnimation.useAnimateProp)(fadeIn);
137
+ const congratsSequence = (0, _reactNativeAnimation.sequence)([(0, _reactNativeAnimation.parallel)([showCongrats, translateCongrats]), (0, _reactNativeAnimation.parallel)([showConfettis, fadeInRank, translateRank]), (0, _reactNativeAnimation.parallel)([fadeInStars, translateStars]), (0, _reactNativeAnimation.sequence)([showButton1, showButton2])]);
138
+ (0, _react.useEffect)(() => {
139
+ congratsSequence.start(); // (required only once on mount)
140
+ // eslint-disable-next-line react-hooks/exhaustive-deps
141
+ }, []);
138
142
  (0, _react.useEffect)(() => {
139
143
  const _stylesheet = createStyleSheet(theme);
140
144
 
141
145
  setStylesheet(_stylesheet);
142
146
  }, [theme]);
143
- (0, _react.useEffect)(() => {
144
- translateCongratsUp();
145
- }, []);
146
- (0, _react.useEffect)(() => {
147
- if (isCongratsTranslationDone) {
148
- showRank();
149
- translateRankUp();
150
- }
151
- }, [isCongratsTranslationDone, showRank, translateRankUp]);
152
- (0, _react.useEffect)(() => {
153
- if (isRankShown) {
154
- scrollViewRef?.current?.scrollToEnd();
155
- translateStarsUp();
156
- showStars();
157
- }
158
- }, [isRankShown, translateStarsUp, showStars]);
159
147
 
160
148
  if (!styleSheet) {
161
149
  return null;
@@ -164,7 +152,7 @@ const ReviewCongrats = props => {
164
152
  const handleContinueRevisingPress = buttonRevising?.onClick || _noop2.default;
165
153
  const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || _noop2.default;
166
154
  return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
167
- style: [styleSheet.congrats, animatedCongratsY],
155
+ style: [styleSheet.congrats, translateCongrats.animatedStyle, showCongrats.animatedStyle],
168
156
  accessibilityLabel: ariaLabel
169
157
  }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
170
158
  style: styleSheet.title
@@ -175,7 +163,7 @@ const ReviewCongrats = props => {
175
163
  style: styleSheet.scrollView,
176
164
  contentContainerStyle: styleSheet.scrollViewContent
177
165
  }, cardCongratsRank ? /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
178
- style: [animatedRankOpacity, animatedRankY]
166
+ style: animatedRank
179
167
  }, /*#__PURE__*/_react.default.createElement(_index2.default, {
180
168
  animationUri: cardCongratsRank.animationLottie.animationSrc,
181
169
  text: cardCongratsRank.reviewCardTitle,
@@ -185,7 +173,7 @@ const ReviewCongrats = props => {
185
173
  textColor: theme.colors.text.primary,
186
174
  direction: "row-reverse"
187
175
  })) : null, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
188
- style: [animatedStarsOpacity, animatedStarsY]
176
+ style: [fadeInStars.animatedStyle, translateStars.animatedStyle]
189
177
  }, /*#__PURE__*/_react.default.createElement(_index2.default, {
190
178
  animationUri: isRankShown ? cardCongratsStar.animationLottie.animationSrc : null,
191
179
  Icon: _novaIcons.NovaCompositionCoorpacademyStar,
@@ -194,9 +182,11 @@ const ReviewCongrats = props => {
194
182
  iconColor: theme.colors.battle,
195
183
  textColor: theme.colors.battle,
196
184
  direction: "row"
197
- }))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
185
+ }))), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
198
186
  style: styleSheet.buttons
199
- }, buttonRevisingSkill ? /*#__PURE__*/_react.default.createElement(_index.default, {
187
+ }, buttonRevisingSkill ? /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
188
+ style: showButton1.animatedStyle
189
+ }, /*#__PURE__*/_react.default.createElement(_index.default, {
200
190
  onPress: handleReviseAnotherSkillPress,
201
191
  accessibilityLabel: buttonRevisingSkill['aria-label'],
202
192
  submitValue: buttonRevisingSkill.label,
@@ -206,13 +196,15 @@ const ReviewCongrats = props => {
206
196
  textStyle: {
207
197
  color: '#123'
208
198
  }
209
- }) : null, buttonRevising ? /*#__PURE__*/_react.default.createElement(_index.default, {
199
+ })) : null, buttonRevising ? /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
200
+ style: showButton2.animatedStyle
201
+ }, /*#__PURE__*/_react.default.createElement(_index.default, {
210
202
  onPress: handleContinueRevisingPress,
211
203
  accessibilityLabel: buttonRevising['aria-label'],
212
204
  submitValue: buttonRevising.label
213
- }) : null), isCongratsTranslationDone ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
205
+ })) : null), isCongratsTranslationDone ? /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
214
206
  pointerEvents: "none",
215
- style: styleSheet.confettis
207
+ style: [styleSheet.confettis, showConfettis.animatedStyle]
216
208
  }, /*#__PURE__*/_react.default.createElement(_lottieReactNative.default, {
217
209
  source: {
218
210
  uri: animationLottie.animationSrc
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","congrats","position","width","height","flexDirection","alignItems","paddingVertical","flex","buttons","paddingHorizontal","justifyContent","title","fontWeight","fontSize","lineHeight","marginVertical","color","colors","text","primary","confettis","flexGrow","pointerEvents","scrollView","scrollViewContent","ReviewCongrats","props","ariaLabel","animationLottie","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","useTemplateContext","windowHeight","useWindowDimensions","styleSheet","setStylesheet","useState","isCongratsTranslationDone","setCongratsTranslationDone","isRankShown","setRankShown","translate","translateCongratsUp","animatedY","animatedCongratsY","useTranslateVertically","fromValue","toValue","delay","onFinished","translateRankUp","animatedRankY","duration","fadeIn","showRank","animatedOpacity","animatedRankOpacity","useUpdateOpacity","onFadeInFinished","scrollViewRef","useRef","translateStarsUp","animatedStarsY","showStars","animatedStarsOpacity","useEffect","_stylesheet","current","scrollToEnd","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","RankIcon","positive","StarIcon","battle","label","BOX_STYLE","backgroundColor","uri"],"sources":["../../../src/organism/review-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {\n Animated,\n ScrollView,\n StyleSheet,\n Text,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {noop} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaSolidVoteRewardsRewardsBadge5 as RankIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport CardCongrats from '../../molecule/card-congrats/index.native';\nimport useTranslateVertically from '../../behaviours/use-translate-vertically.native';\nimport useUpdateOpacity from '../../behaviours/use-update-opacity.native';\nimport {ReviewCongratsProps} from './prop-types';\n\ntype StyleSheetType = {\n buttons: ViewStyle;\n congrats: ViewStyle;\n confettis: ViewStyle;\n scrollView: ViewStyle;\n scrollViewContent: ViewStyle;\n title: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n congrats: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n alignItems: 'center',\n paddingVertical: 90,\n flex: 1\n },\n buttons: {\n width: '100%',\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'space-between',\n flex: 1\n },\n title: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n marginVertical: 20,\n color: theme.colors.text.primary\n },\n confettis: {\n flexGrow: 1,\n position: 'absolute',\n width: '100%',\n height: '100%',\n pointerEvents: 'box-none'\n },\n scrollView: {\n height: 300\n },\n scrollViewContent: {\n alignItems: 'center',\n paddingHorizontal: 40\n }\n });\n\nconst ReviewCongrats = (props: ReviewCongratsProps) => {\n const {\n 'aria-label': ariaLabel,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const {theme} = useTemplateContext();\n const {height: windowHeight} = useWindowDimensions();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [isCongratsTranslationDone, setCongratsTranslationDone] = useState<boolean>(false);\n const [isRankShown, setRankShown] = useState<boolean>(false);\n\n const {translate: translateCongratsUp, animatedY: animatedCongratsY} = useTranslateVertically({\n fromValue: windowHeight,\n toValue: 0,\n delay: 750,\n onFinished: () => {\n setCongratsTranslationDone(true);\n }\n });\n\n const {translate: translateRankUp, animatedY: animatedRankY} = useTranslateVertically({\n fromValue: 150,\n duration: 750,\n toValue: 0\n });\n\n const {fadeIn: showRank, animatedOpacity: animatedRankOpacity} = useUpdateOpacity({\n onFadeInFinished: () => {\n setRankShown(true);\n }\n });\n\n const scrollViewRef = useRef<ScrollView>(null);\n\n const {translate: translateStarsUp, animatedY: animatedStarsY} = useTranslateVertically({\n fromValue: 150,\n toValue: 0,\n duration: 750,\n delay: 250\n });\n\n const {fadeIn: showStars, animatedOpacity: animatedStarsOpacity} = useUpdateOpacity({\n delay: 250\n });\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n useEffect(() => {\n translateCongratsUp();\n }, []);\n\n useEffect(() => {\n if (isCongratsTranslationDone) {\n showRank();\n translateRankUp();\n }\n }, [isCongratsTranslationDone, showRank, translateRankUp]);\n\n useEffect(() => {\n if (isRankShown) {\n scrollViewRef?.current?.scrollToEnd();\n translateStarsUp();\n showStars();\n }\n }, [isRankShown, translateStarsUp, showStars]);\n\n if (!styleSheet) {\n return null;\n }\n\n const handleContinueRevisingPress = buttonRevising?.onClick || noop;\n const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || noop;\n\n return (\n <Animated.View style={[styleSheet.congrats, animatedCongratsY]} accessibilityLabel={ariaLabel}>\n <Text style={styleSheet.title}>{title}</Text>\n <ScrollView\n ref={scrollViewRef}\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styleSheet.scrollView}\n contentContainerStyle={styleSheet.scrollViewContent}\n >\n {cardCongratsRank ? (\n <Animated.View style={[animatedRankOpacity, animatedRankY]}>\n <CardCongrats\n animationUri={cardCongratsRank.animationLottie.animationSrc}\n text={cardCongratsRank.reviewCardTitle}\n value={`${cardCongratsRank.reviewCardValue} ${cardCongratsRank.rankSuffix}`}\n Icon={RankIcon}\n iconColor={theme.colors.positive}\n textColor={theme.colors.text.primary}\n direction=\"row-reverse\"\n />\n </Animated.View>\n ) : null}\n <Animated.View style={[animatedStarsOpacity, animatedStarsY]}>\n <CardCongrats\n animationUri={isRankShown ? cardCongratsStar.animationLottie.animationSrc : null}\n Icon={StarIcon}\n text={cardCongratsStar.reviewCardTitle}\n value={cardCongratsStar.reviewCardValue}\n iconColor={theme.colors.battle}\n textColor={theme.colors.battle}\n direction=\"row\"\n />\n </Animated.View>\n </ScrollView>\n\n <View style={styleSheet.buttons}>\n {buttonRevisingSkill ? (\n <Button\n onPress={handleReviseAnotherSkillPress}\n accessibilityLabel={buttonRevisingSkill['aria-label']}\n submitValue={buttonRevisingSkill.label}\n style={{...BOX_STYLE, backgroundColor: '#fff'}}\n textStyle={{color: '#123'}}\n />\n ) : null}\n {buttonRevising ? (\n <Button\n onPress={handleContinueRevisingPress}\n accessibilityLabel={buttonRevising['aria-label']}\n submitValue={buttonRevising.label}\n />\n ) : null}\n </View>\n\n {isCongratsTranslationDone ? (\n <View pointerEvents=\"none\" style={styleSheet.confettis}>\n <LottieView source={{uri: animationLottie.animationSrc}} autoPlay loop={false} />\n </View>\n ) : null}\n </Animated.View>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AmB,CAAC,YAAD,CAFzC;IAGE,WAAW,EAAEA,mBAAmB,CAACkD,KAHnC;IAIE,KAAK,eAAMC,iBAAN;MAAiBC,eAAe,EAAE;IAAlC,EAJP;IAKE,SAAS,EAAE;MAACpE,KAAK,EAAE;IAAR;EALb,EADkB,GAQhB,IATN,EAUGe,cAAc,gBACb,6BAAC,cAAD;IACE,OAAO,EAAEwC,2BADX;IAEE,kBAAkB,EAAExC,cAAc,CAAC,YAAD,CAFpC;IAGE,WAAW,EAAEA,cAAc,CAACmD;EAH9B,EADa,GAMX,IAhBN,CAnCF,EAsDG3C,yBAAyB,gBACxB,6BAAC,iBAAD;IAAM,aAAa,EAAC,MAApB;IAA2B,KAAK,EAAEH,UAAU,CAAChB;EAA7C,gBACE,6BAAC,0BAAD;IAAY,MAAM,EAAE;MAACiE,GAAG,EAAEzD,eAAe,CAAC8C;IAAtB,CAApB;IAAyD,QAAQ,MAAjE;IAAkE,IAAI,EAAE;EAAxE,EADF,CADwB,GAItB,IA1DN,CADF;AA8DD,CAjJD;;eAmJejD,c"}
1
+ {"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","congrats","position","width","height","flexDirection","alignItems","paddingVertical","flex","buttons","paddingHorizontal","justifyContent","title","fontWeight","fontSize","lineHeight","marginVertical","color","colors","text","primary","confettis","flexGrow","pointerEvents","scrollView","scrollViewContent","fadeIn","property","fromValue","toValue","duration","translateHorizontally","ReviewCongrats","props","ariaLabel","animationLottie","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","useTemplateContext","styleSheet","setStylesheet","useState","isCongratsTranslationDone","setCongratsTranslationDone","isRankShown","setRankShown","scrollViewRef","useRef","showCongrats","useAnimateProp","onComplete","translateCongrats","useTranslateY","showConfettis","fadeInRank","translateRank","useTranslateX","setTimeout","current","scrollToEnd","animatedRank","animatedStyle","fadeInStars","delay","translateStars","showButton1","showButton2","congratsSequence","sequence","parallel","useEffect","start","_stylesheet","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","RankIcon","positive","StarIcon","battle","label","BOX_STYLE","backgroundColor","uri"],"sources":["../../../src/organism/review-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {Animated, ScrollView, StyleSheet, Text, TextStyle, ViewStyle} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {noop} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaSolidVoteRewardsRewardsBadge5 as RankIcon\n} from '@coorpacademy/nova-icons';\nimport {\n sequence,\n parallel,\n useAnimateProp,\n useTranslateY,\n useTranslateX\n} from '@coorpacademy/react-native-animation';\nimport type {AnimatePropParams} from '@coorpacademy/react-native-animation/es/use-animate-prop';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport CardCongrats from '../../molecule/card-congrats/index.native';\nimport {ReviewCongratsProps} from './prop-types';\n\ntype StyleSheetType = {\n buttons: ViewStyle;\n congrats: ViewStyle;\n confettis: ViewStyle;\n scrollView: ViewStyle;\n scrollViewContent: ViewStyle;\n title: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n congrats: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n alignItems: 'center',\n paddingVertical: 90,\n flex: 1\n },\n buttons: {\n width: '100%',\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'space-between',\n flex: 1\n },\n title: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n marginVertical: 20,\n color: theme.colors.text.primary\n },\n confettis: {\n flexGrow: 1,\n position: 'absolute',\n width: '100%',\n height: '100%',\n pointerEvents: 'box-none'\n },\n scrollView: {\n height: 300\n },\n scrollViewContent: {\n alignItems: 'center',\n paddingHorizontal: 40\n }\n });\n\nconst fadeIn: AnimatePropParams = {\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 350\n};\n\nconst translateHorizontally = {\n property: 'translateX',\n fromValue: 180,\n toValue: 0,\n duration: 800\n};\n\nconst ReviewCongrats = (props: ReviewCongratsProps) => {\n const {\n 'aria-label': ariaLabel,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const {theme} = useTemplateContext();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [isCongratsTranslationDone, setCongratsTranslationDone] = useState<boolean>(false);\n const [isRankShown, setRankShown] = useState<boolean>(false);\n\n const scrollViewRef = useRef<ScrollView>(null);\n\n const showCongrats = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 950,\n onComplete: () => {\n setCongratsTranslationDone(true);\n }\n });\n\n const translateCongrats = useTranslateY({\n fromValue: 100,\n toValue: 0,\n duration: 550\n });\n\n const showConfettis = useAnimateProp(fadeIn);\n const fadeInRank = useAnimateProp(fadeIn);\n const translateRank = useTranslateX({\n ...translateHorizontally,\n onComplete: () => {\n setRankShown(true);\n setTimeout(() => {\n scrollViewRef?.current?.scrollToEnd();\n }, 700);\n }\n });\n\n const animatedRank = [fadeInRank.animatedStyle, translateRank.animatedStyle];\n\n const fadeInStars = useAnimateProp({\n ...fadeIn,\n delay: 1000\n });\n\n const translateStars = useTranslateX({\n ...translateHorizontally,\n delay: 1000\n });\n\n const showButton1 = useAnimateProp(fadeIn);\n const showButton2 = useAnimateProp(fadeIn);\n\n const congratsSequence = sequence([\n parallel([showCongrats, translateCongrats]),\n parallel([showConfettis, fadeInRank, translateRank]),\n parallel([fadeInStars, translateStars]),\n sequence([showButton1, showButton2])\n ]);\n\n useEffect(() => {\n congratsSequence.start();\n // (required only once on mount)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n const handleContinueRevisingPress = buttonRevising?.onClick || noop;\n const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || noop;\n\n return (\n <Animated.View\n style={[styleSheet.congrats, translateCongrats.animatedStyle, showCongrats.animatedStyle]}\n accessibilityLabel={ariaLabel}\n >\n <Text style={styleSheet.title}>{title}</Text>\n <ScrollView\n ref={scrollViewRef}\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styleSheet.scrollView}\n contentContainerStyle={styleSheet.scrollViewContent}\n >\n {cardCongratsRank ? (\n <Animated.View style={animatedRank}>\n <CardCongrats\n animationUri={cardCongratsRank.animationLottie.animationSrc}\n text={cardCongratsRank.reviewCardTitle}\n value={`${cardCongratsRank.reviewCardValue} ${cardCongratsRank.rankSuffix}`}\n Icon={RankIcon}\n iconColor={theme.colors.positive}\n textColor={theme.colors.text.primary}\n direction=\"row-reverse\"\n />\n </Animated.View>\n ) : null}\n <Animated.View style={[fadeInStars.animatedStyle, translateStars.animatedStyle]}>\n <CardCongrats\n animationUri={isRankShown ? cardCongratsStar.animationLottie.animationSrc : null}\n Icon={StarIcon}\n text={cardCongratsStar.reviewCardTitle}\n value={cardCongratsStar.reviewCardValue}\n iconColor={theme.colors.battle}\n textColor={theme.colors.battle}\n direction=\"row\"\n />\n </Animated.View>\n </ScrollView>\n\n <Animated.View style={styleSheet.buttons}>\n {buttonRevisingSkill ? (\n <Animated.View style={showButton1.animatedStyle}>\n <Button\n onPress={handleReviseAnotherSkillPress}\n accessibilityLabel={buttonRevisingSkill['aria-label']}\n submitValue={buttonRevisingSkill.label}\n style={{...BOX_STYLE, backgroundColor: '#fff'}}\n textStyle={{color: '#123'}}\n />\n </Animated.View>\n ) : null}\n {buttonRevising ? (\n <Animated.View style={showButton2.animatedStyle}>\n <Button\n onPress={handleContinueRevisingPress}\n accessibilityLabel={buttonRevising['aria-label']}\n submitValue={buttonRevising.label}\n />\n </Animated.View>\n ) : null}\n </Animated.View>\n\n {isCongratsTranslationDone ? (\n <Animated.View\n pointerEvents=\"none\"\n style={[styleSheet.confettis, showConfettis.animatedStyle]}\n >\n <LottieView source={{uri: animationLottie.animationSrc}} autoPlay loop={false} />\n </Animated.View>\n ) : null}\n </Animated.View>\n );\n};\n\nexport default ReviewCongrats;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AASA;;AAEA;;AACA;;AACA;;;;;;;;;;AAYA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,QAAQ,EAAE;IACRC,QAAQ,EAAE,UADF;IAERC,KAAK,EAAE,MAFC;IAGRC,MAAM,EAAE,MAHA;IAIRC,aAAa,EAAE,QAJP;IAKRC,UAAU,EAAE,QALJ;IAMRC,eAAe,EAAE,EANT;IAORC,IAAI,EAAE;EAPE,CADM;EAUhBC,OAAO,EAAE;IACPN,KAAK,EAAE,MADA;IAEPO,iBAAiB,EAAE,EAFZ;IAGPL,aAAa,EAAE,QAHR;IAIPM,cAAc,EAAE,eAJT;IAKPH,IAAI,EAAE;EALC,CAVO;EAiBhBI,KAAK,EAAE;IACLC,UAAU,EAAE,KADP;IAELC,QAAQ,EAAE,EAFL;IAGLC,UAAU,EAAE,EAHP;IAILC,cAAc,EAAE,EAJX;IAKLC,KAAK,EAAEnB,KAAK,CAACoB,MAAN,CAAaC,IAAb,CAAkBC;EALpB,CAjBS;EAwBhBC,SAAS,EAAE;IACTC,QAAQ,EAAE,CADD;IAETpB,QAAQ,EAAE,UAFD;IAGTC,KAAK,EAAE,MAHE;IAITC,MAAM,EAAE,MAJC;IAKTmB,aAAa,EAAE;EALN,CAxBK;EA+BhBC,UAAU,EAAE;IACVpB,MAAM,EAAE;EADE,CA/BI;EAkChBqB,iBAAiB,EAAE;IACjBnB,UAAU,EAAE,QADK;IAEjBI,iBAAiB,EAAE;EAFF;AAlCH,CAAlB,CADF;;AAyCA,MAAMgB,M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,6BAAC,0BAAD;IAAY,MAAM,EAAE;MAAC0B,GAAG,EAAEtD,eAAe,CAAC2C;IAAtB,CAApB;IAAyD,QAAQ,MAAjE;IAAkE,IAAI,EAAE;EAAxE,EAJF,CADwB,GAOtB,IApEN,CADF;AAwED,CA/JD;;eAiKe9C,c"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;AA6JtE,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBA8CrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;AA+JtE,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBA8CrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -11,6 +11,8 @@ var _get = _interopRequireDefault(require("lodash/fp/get"));
11
11
 
12
12
  var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
13
13
 
14
+ var _reactNativeAnimation = require("@coorpacademy/react-native-animation");
15
+
14
16
  var _index = _interopRequireDefault(require("../../atom/text/index.native"));
15
17
 
16
18
  var _index2 = _interopRequireDefault(require("../../molecule/answer/index.native"));
@@ -21,8 +23,6 @@ var _templateContext = require("../../template/app-review/template-context");
21
23
 
22
24
  var _index4 = _interopRequireDefault(require("../../atom/button/index.native"));
23
25
 
24
- var _useTranslateVertically = _interopRequireDefault(require("../../behaviours/use-translate-vertically.native"));
25
-
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
28
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); }
@@ -43,12 +43,13 @@ const CorrectionPopin = ({
43
43
  showCorrectionPopin,
44
44
  animateCorrectionPopin
45
45
  }) => {
46
- const translateUp = (0, _useTranslateVertically.default)({
46
+ const translateUp = (0, _reactNativeAnimation.useTranslateY)({
47
47
  fromValue: 1000,
48
48
  toValue: 0,
49
49
  duration: 800,
50
50
  easing: _reactNative.Easing.bezier(0.37, 0, 0.63, 1)
51
51
  });
52
+ (0, _react.useEffect)(() => translateUp.start(), []);
52
53
  if (!showCorrectionPopin) return null;
53
54
  const klf = (0, _getOr.default)(undefined, 'klf', correctionPopinProps);
54
55
  const information = (0, _getOr.default)({
@@ -69,7 +70,7 @@ const CorrectionPopin = ({
69
70
  type: correctionPopinProps.type,
70
71
  resultLabel: correctionPopinProps.resultLabel
71
72
  };
72
- const style = animateCorrectionPopin ? [styles.correctionPopinWrapper, translateUp.animatedY] : styles.correctionPopinWrapper;
73
+ const style = animateCorrectionPopin ? [styles.correctionPopinWrapper, translateUp.animatedStyle] : styles.correctionPopinWrapper;
73
74
  return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
74
75
  style: style
75
76
  }, /*#__PURE__*/_react.default.createElement(_index3.default, _correctionPopinProps));
@@ -166,6 +167,7 @@ const createSlideStyle = (num, screenWidth) => {
166
167
 
167
168
  const Slide = props => {
168
169
  const {
170
+ animatedStyle,
169
171
  slide,
170
172
  correctionPopinProps,
171
173
  validateButton,
@@ -186,14 +188,16 @@ const Slide = props => {
186
188
  } = slide;
187
189
 
188
190
  if (loading) {
189
- return /*#__PURE__*/_react.default.createElement(_index.default, null, "@todo loader ", num);
191
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
192
+ style: slideStyle.slide
193
+ });
190
194
  }
191
195
 
192
196
  const {
193
197
  onClick: handleValidatePress
194
198
  } = validateButton;
195
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
196
- style: slideStyle.slide
199
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
200
+ style: [slideStyle.slide, animatedStyle]
197
201
  }, /*#__PURE__*/_react.default.createElement(Question, {
198
202
  questionOrigin: parentContentTitle,
199
203
  questionText: questionText,
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","useTranslateVertically","fromValue","toValue","duration","easing","Easing","bezier","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","style","animatedY","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","useTemplateContext","setStyle","useState","useEffect","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","useWindowDimensions","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport useTranslateVertically from '../../behaviours/use-translate-vertically.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateVertically({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedY]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <Text>@todo loader {num}</Text>;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <View style={slideStyle.slide}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;AAGA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,WAAW,GAAG,IAAAC,+BAAA,EAAuB;IACzCC,SAAS,EAAE,IAD8B;IAEzCC,OAAO,EAAE,CAFgC;IAGzCC,QAAQ,EAAE,GAH+B;IAIzCC,MAAM,EAAEC,mBAAA,CAAOC,MAAP,CAAc,IAAd,EAAoB,CAApB,EAAuB,IAAvB,EAA6B,CAA7B;EAJiC,CAAvB,CAApB;EAOA,IAAI,CAACT,mBAAL,EAA0B,OAAO,IAAP;EAE1B,MAAMU,GAAG,GAAG,IAAAC,cAAA,EAAMC,SAAN,EAAiB,KAAjB,EAAwBd,oBAAxB,CAAZ;EACA,MAAMe,WAAW,GAAG,IAAAF,cAAA,EAAM;IAACG,KAAK,EAAE,EAAR;IAAYC,OAAO,EAAE;EAArB,CAAN,EAAgC,aAAhC,EAA+CjB,oBAA/C,CAApB;EACA,MAAMkB,IAAI,GAAG,IAAAC,YAAA,EAAI,MAAJ,EAAYnB,oBAAZ,CAAb;EACA,MAAMoB,OAAO,GAAG,IAAAD,YAAA,EAAI,C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IAAIgB,OAAJ,EAAa;IACX,oBAAO,6BAAC,cAAD,yBAAoBnB,GAApB,CAAP;EACD;;EAED,MAAM;IAACvC,OAAO,EAAE4D;EAAV,IAAiCL,cAAvC;EAEA,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEE,UAAU,CAACf;EAAxB,gBACE,6BAAC,QAAD;IACE,cAAc,EAAEiB,kBADlB;IAEE,YAAY,EAAEpC,YAFhB;IAGE,QAAQ,EAAES,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,6BAAC,eAAD;IACE,QAAQ,EAAEuB,cAAc,CAACM,QAD3B;IAEE,WAAW,EAAEN,cAAc,CAAC3D,KAF9B;IAGE,OAAO,EAAEgE,mBAHX;IAIE,MAAM,EAAG,yBAAwB/E,UAAW;EAJ9C,EAPF,EAaGD,oBAAoB,gBACnB,6BAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;eAgDeuE,K"}
1
+ {"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","useTranslateY","fromValue","toValue","duration","easing","Easing","bezier","useEffect","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","useTemplateContext","setStyle","useState","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","useWindowDimensions","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {animatedStyle, slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <View style={slideStyle.slide} />;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <Animated.View style={[slideStyle.slide, animatedStyle]}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </Animated.View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAGA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,WAAW,GAAG,IAAAC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AG,yBAAwBhF,UAAW;EAJ9C,EAPF,EAaGD,oBAAoB,gBACnB,6BAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;eAgDewE,K"}
@@ -1,4 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
+ import type { Animation } from '@coorpacademy/react-native-animation';
2
3
  import { ReviewCorrectionPopinProps } from '../../molecule/review-correction-popin/prop-types';
3
4
  import { AnswerProps } from '../../molecule/answer/prop-types';
4
5
  import { TemplateContextValues } from '../../template/app-review/template-context';
@@ -210,6 +211,7 @@ export declare type ReviewSlideProps = {
210
211
  onClick: () => void;
211
212
  disabled: boolean;
212
213
  };
214
+ animatedStyle?: Animation['animatedStyle'][];
213
215
  };
214
216
  export declare type Fixture = {
215
217
  props: ReviewSlideProps;
@@ -1 +1 @@
1
- {"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAuC,EACrC,0BAA0B,EAC3B,MAAM,mDAAmD,CAAC;AAC3D,OAAwB,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAC,qBAAqB,EAAC,MAAM,4CAA4C,CAAC;AAEjF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAY1B,CAAC;AAEH,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBd,CAAC;AAEF,eAAe,SAAS,CAAC;AAE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MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,UAAU,CAAC;IAClB,oBAAoB,CAAC,EAAE,0BAA0B,CAAC;IAClD,cAAc,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,EAAE,CAAC;CAC9C,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,gBAAgB,CAAC;IAAC,aAAa,CAAC,EAAE,qBAAqB,CAAA;CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"prop-types.js","names":["SlidePropsTypes","PropTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","AnswerPropTypes","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\nimport {TemplateContextValues} from '../../template/app-review/template-context';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: string;\n showCorrectionPopin?: boolean;\n animateCorrectionPopin?: boolean;\n};\n\nexport type ValidateButtonProps = {\n slideIndex: string;\n validateButton: ReviewSlideProps['validateButton'];\n primarySkinColor?: string;\n};\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n};\n\nexport type Fixture = {props: ReviewSlideProps; mobileContext?: TemplateContextValues};\n"],"mappings":";;;;;AAAA;;AACA;;AAGA;;;;AAGO,MAAMA,eAAe,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAC7CC,QAAQ,EAAEF,kBAAA,CAAUG,MADyB;EAE7CC,OAAO,EAAEJ,kB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Types","PropTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","AnswerPropTypes","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport type {Animation} from '@coorpacademy/react-native-animation';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\nimport {TemplateContextValues} from '../../template/app-review/template-context';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: string;\n showCorrectionPopin?: boolean;\n animateCorrectionPopin?: boolean;\n};\n\nexport type ValidateButtonProps = {\n slideIndex: string;\n validateButton: ReviewSlideProps['validateButton'];\n primarySkinColor?: string;\n};\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n animatedStyle?: Animation['animatedStyle'][];\n};\n\nexport type Fixture = {props: ReviewSlideProps; mobileContext?: TemplateContextValues};\n"],"mappings":";;;;;AAAA;;AAEA;;AAGA;;;;AAGO,MAAMA,eAAe,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAC7CC,QAAQ,EAAEF,kBAAA,CAAUG,MADyB;EAE7CC,OAAO,EAAEJ,kBAAA,CAAUK,IAF0B;EAG7CC,gBAAgB,EAAEN,kBAAA,CAAUO,MAHiB;EAI7CC,aAAa,EAAER,kBAAA,CAAUO,MAJoB;EAIZ;EACjCE,SAAS,EAAET,kBAAA,CAAUK,IALwB;EAM7CK,sBAAsB,EAAEV,kBAAA,CAAUK,IANW;EAO7CM,mBAAmB,EAAEX,kBAAA,CAAUK,IAPc;EAQ7CO,cAAc,EAAEZ,kBAAA,CAAUK,IARmB;EAS7CQ,kBAAkB,EAAEb,kBAAA,CAAUO,MATe;EAU7CO,YAAY,EAAEd,kBAAA,CAAUO,MAVqB;EAW7CQ,QAAQ,EAAEf,kBAAA,CAAUC,KAAV,CAAgBe,mBAAhB;AAXmC,CAAhB,CAAxB;;;AAcP,MAAMC,SAAS,GAAG;EAChBC,UAAU,EAAElB,kBAAA,CAAUO,MADN;EAEhBY,KAAK,EAAEpB,eAFS;EAGhBqB,cAAc,EAAEpB,kBAAA,CAAUC,KAAV,CAAgB;IAC9BoB,KAAK,EAAErB,kBAAA,CAAUO,MAAV,CAAiBe,UADM;IAE9BC,OAAO,EAAEvB,kBAAA,CAAUwB,IAAV,CAAeF,UAFM;IAG9BG,QAAQ,EAAEzB,kBAAA,CAAUK;EAHU,CAAhB,CAHA;EAQhBqB,oBAAoB,EAAE1B,kBAAA,CAAUC,KAAV,CAAgB;IACpC0B,GAAG,EAAEC,mBAAA,CAA+BD,GADA;IAEpCE,WAAW,EAAED,mBAAA,CAA+BC,WAFR;IAGpCC,IAAI,EAAE9B,kBAAA,CAAUC,KAAV,CAAgB;MACpBoB,KAAK,EAAErB,kBAAA,CAAUO,MADG;MAEpB,cAAcP,kBAAA,CAAUO,MAFJ,CAEW;MAC/B;;IAHoB,CAAhB,CAH8B;IAQpCwB,WAAW,EAAEH,mBAAA,CAA+BG,WARR;IASpCC,IAAI,EAAEJ,mBAAA,CAA+BI;EATD,CAAhB;AARN,CAAlB;eAqBef,S"}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ReviewStackProps } from './prop-types';
2
+ import type { ReviewStackProps } from './prop-types';
3
3
  export declare const TOTAL_SLIDES_STACK = 5;
4
4
  declare const StackedSlides: (props: ReviewStackProps) => JSX.Element;
5
5
  export default StackedSlides;
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAUpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBA+B7C,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAEnD,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAyBpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBA0G7C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -9,9 +9,9 @@ var _reactNative = require("react-native");
9
9
 
10
10
  var _keys = _interopRequireDefault(require("lodash/fp/keys"));
11
11
 
12
- var _index = _interopRequireDefault(require("../review-slide/index.native"));
12
+ var _reactNativeAnimation = require("@coorpacademy/react-native-animation");
13
13
 
14
- var _useTranslateVertically = _interopRequireDefault(require("../../behaviours/use-translate-vertically.native"));
14
+ var _index = _interopRequireDefault(require("../review-slide/index.native"));
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
@@ -30,29 +30,86 @@ const style = _reactNative.StyleSheet.create({
30
30
  }
31
31
  });
32
32
 
33
+ const FakeSlide = ({
34
+ position,
35
+ validateButton
36
+ }) => /*#__PURE__*/_react.default.createElement(_index.default, {
37
+ num: position,
38
+ slide: {
39
+ loading: true,
40
+ position
41
+ },
42
+ slideIndex: `${position}`,
43
+ validateButton: validateButton
44
+ });
45
+ /*
46
+ - slides are ordered to be played from left to right: [0,1,2,3]
47
+ - slides are piled on the view, so we need to reverse the order:
48
+ -> it's like our eye is looking from the right [3,2,1,0] <-- oO
49
+ */
50
+
51
+
33
52
  const StackedSlides = props => {
34
53
  const {
35
54
  height: windowHeight
36
55
  } = (0, _reactNative.useWindowDimensions)();
37
56
  const {
57
+ endReview,
38
58
  slides,
39
59
  validateButton,
40
60
  correctionPopinProps
41
61
  } = props;
42
- const {
43
- translate,
44
- animatedY
45
- } = (0, _useTranslateVertically.default)({
62
+ const [unstacked, setUnstacked] = (0, _react.useState)([]);
63
+ const [restacked, setRestacked] = (0, _react.useState)();
64
+ const hideSlides = (0, _reactNativeAnimation.useTranslateY)({
46
65
  fromValue: 0,
47
66
  toValue: windowHeight,
48
67
  duration: 800
49
68
  });
50
- (0, _react.useEffect)(translate, [translate]);
51
- const indexes = (0, _keys.default)(slides).reverse();
52
- const stackedSlides = indexes.map(slideIndex => {
69
+ const translateDown = (0, _reactNativeAnimation.useTranslateY)({
70
+ fromValue: 0,
71
+ toValue: windowHeight - 100,
72
+ duration: 1000
73
+ });
74
+ (0, _react.useEffect)(() => {
75
+ if (endReview) {
76
+ hideSlides.start();
77
+ }
78
+ }, [endReview, hideSlides]);
79
+ const restackingSlide = (0, _keys.default)(slides).find(k => slides[k].animationType === 'restack');
80
+ const unstackingSlide = (0, _keys.default)(slides).find(k => slides[k].animationType === 'unstack');
81
+ const remainingKeys = (0, _keys.default)(slides).filter(k => slides[k].position >= 0 && !slides[k].animationType);
82
+ const orderedKeys = remainingKeys.sort((k1, k2) => slides[k2].position > slides[k1].position ? 1 : -1);
83
+ const animatedSlide = restackingSlide || unstackingSlide;
84
+ (0, _react.useEffect)(() => {
85
+ if (restacked && orderedKeys.includes(restacked)) {
86
+ setRestacked(null);
87
+ } // this effect is required only when the list orderedKeys changes
88
+ // eslint-disable-next-line react-hooks/exhaustive-deps
89
+
90
+ }, [orderedKeys.toString()]);
91
+ (0, _react.useEffect)(() => {
92
+ const unstacking = unstackingSlide && !unstacked.includes(unstackingSlide);
93
+
94
+ if (unstacking) {
95
+ translateDown.start(() => {
96
+ setUnstacked([...unstacked, unstackingSlide]);
97
+ });
98
+ }
99
+ }, [unstackingSlide, unstacked, setUnstacked, translateDown]);
100
+ (0, _react.useEffect)(() => {
101
+ const restacking = restackingSlide && restacked !== restackingSlide;
102
+
103
+ if (restacking) {
104
+ translateDown.start(() => {
105
+ setRestacked(restackingSlide);
106
+ });
107
+ }
108
+ }, [restackingSlide, restacked, setRestacked, translateDown]);
109
+ const stackedSlides = orderedKeys.map((slideIndex, index) => {
53
110
  const slide = slides[slideIndex];
54
111
  return /*#__PURE__*/_react.default.createElement(_index.default, {
55
- num: Number.parseInt(slideIndex),
112
+ num: orderedKeys.length - index,
56
113
  slideIndex,
57
114
  slide,
58
115
  validateButton,
@@ -60,9 +117,25 @@ const StackedSlides = props => {
60
117
  key: slideIndex
61
118
  });
62
119
  });
120
+
121
+ if (animatedSlide) {
122
+ stackedSlides.push( /*#__PURE__*/_react.default.createElement(_index.default, {
123
+ num: 0,
124
+ slideIndex: animatedSlide,
125
+ slide: slides[animatedSlide],
126
+ validateButton,
127
+ correctionPopinProps,
128
+ animatedStyle: [translateDown.animatedStyle],
129
+ key: animatedSlide
130
+ }));
131
+ }
132
+
63
133
  return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
64
- style: [style.slides, animatedY]
65
- }, stackedSlides);
134
+ style: [style.slides, hideSlides.animatedStyle]
135
+ }, restacked ? /*#__PURE__*/_react.default.createElement(FakeSlide, {
136
+ position: orderedKeys.length + 1,
137
+ validateButton: validateButton
138
+ }) : null, stackedSlides);
66
139
  };
67
140
 
68
141
  var _default = StackedSlides;