@coorpacademy/components 11.11.1 → 11.11.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.
@@ -3,6 +3,6 @@ import { Media } from '../questions/types';
3
3
  export declare type Props = {
4
4
  media: Media;
5
5
  };
6
- declare const Video: ({ media }: Props) => JSX.Element;
6
+ declare const Video: ({ media }: Props) => JSX.Element | null;
7
7
  export default Video;
8
8
  //# sourceMappingURL=index.native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAEzC,oBAAY,KAAK,GAAG;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC;AA0BnC,QAAA,MAAM,KAAK,cAAa,KAAK,gBAE5B,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAEzC,oBAAY,KAAK,GAAG;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC;AAwCnC,QAAA,MAAM,KAAK,cAAa,KAAK,uBAE5B,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,31 +1,50 @@
1
1
  import React from 'react';
2
2
  import { StyleSheet, Text, View } from 'react-native';
3
3
  import JWPlayer from 'react-native-jw-media-player';
4
+ import Youtube from 'react-native-youtube';
5
+ import { Vimeo } from 'react-native-vimeo-iframe';
6
+ import { useTemplateContext } from '../../template/app-review/template-context';
4
7
  const styleSheet = StyleSheet.create({
5
8
  container: {
6
9
  flex: 1,
7
10
  width: '100%'
8
- },
9
- video: {
10
- flex: 1,
11
- width: '100%'
12
11
  }
13
12
  });
14
13
 
15
14
  const VideoSwitch = ({
16
15
  media
17
16
  }) => {
17
+ const {
18
+ brandTheme
19
+ } = useTemplateContext();
20
+
18
21
  switch (media.mimeType) {
22
+ case 'application/kontiki':
19
23
  case 'application/jwplayer':
24
+ case 'video/mp4':
20
25
  if (!media.jwpOptions?.config) {
21
26
  return null;
22
27
  }
23
28
 
24
29
  return /*#__PURE__*/React.createElement(JWPlayer, {
25
- style: styleSheet.video,
30
+ style: styleSheet.container,
26
31
  config: media.jwpOptions.config
27
32
  });
28
33
 
34
+ case 'application/vimeo':
35
+ return media.videoId ? /*#__PURE__*/React.createElement(View, {
36
+ style: styleSheet.container
37
+ }, /*#__PURE__*/React.createElement(Vimeo, {
38
+ videoId: media.videoId
39
+ })) : null;
40
+
41
+ case 'application/youtube':
42
+ return /*#__PURE__*/React.createElement(Youtube, {
43
+ apiKey: brandTheme.youtube?.apiKey || '',
44
+ style: styleSheet.container,
45
+ videoId: media.videoId
46
+ });
47
+
29
48
  default:
30
49
  return /*#__PURE__*/React.createElement(Text, null, `video mimeType ${media.mimeType} is not handled`);
31
50
  }
@@ -34,11 +53,9 @@ const VideoSwitch = ({
34
53
  const Video = ({
35
54
  media
36
55
  }) => {
37
- return /*#__PURE__*/React.createElement(View, {
38
- style: styleSheet.container
39
- }, media ? /*#__PURE__*/React.createElement(VideoSwitch, {
56
+ return media ? /*#__PURE__*/React.createElement(VideoSwitch, {
40
57
  media: media
41
- }) : null);
58
+ }) : null;
42
59
  };
43
60
 
44
61
  export default Video;
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["React","StyleSheet","Text","View","JWPlayer","styleSheet","create","container","flex","width","video","VideoSwitch","media","mimeType","jwpOptions","config","Video"],"sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, Text, View} from 'react-native';\nimport JWPlayer from 'react-native-jw-media-player';\n\nimport {Media} from '../questions/types';\n\nexport type Props = {media: Media};\n\nconst styleSheet = StyleSheet.create({\n container: {\n flex: 1,\n width: '100%'\n },\n video: {\n flex: 1,\n width: '100%'\n }\n});\n\nconst VideoSwitch = ({media}: Props) => {\n switch (media.mimeType) {\n case 'application/jwplayer':\n if (!media.jwpOptions?.config) {\n return null;\n }\n\n return <JWPlayer style={styleSheet.video} config={media.jwpOptions.config} />;\n default:\n return <Text>{`video mimeType ${media.mimeType} is not handled`}</Text>;\n }\n};\n\nconst Video = ({media}: Props) => {\n return <View style={styleSheet.container}>{media ? <VideoSwitch media={media} /> : null}</View>;\n};\n\nexport default Video;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAQC,UAAR,EAAoBC,IAApB,EAA0BC,IAA1B,QAAqC,cAArC;AACA,OAAOC,QAAP,MAAqB,8BAArB;AAMA,MAAMC,UAAU,GAAGJ,UAAU,CAACK,MAAX,CAAkB;EACnCC,SAAS,EAAE;IACTC,IAAI,EAAE,CADG;IAETC,KAAK,EAAE;EAFE,CADwB;EAKnCC,KAAK,EAAE;IACLF,IAAI,EAAE,CADD;IAELC,KAAK,EAAE;EAFF;AAL4B,CAAlB,CAAnB;;AAWA,MAAME,WAAW,GAAG,CAAC;EAACC;AAAD,CAAD,KAAoB;EACtC,QAAQA,KAAK,CAACC,QAAd;IACE,KAAK,sBAAL;MACE,IAAI,CAACD,KAAK,CAACE,UAAN,EAAkBC,MAAvB,EAA+B;QAC7B,OAAO,IAAP;MACD;;MAED,oBAAO,oBAAC,QAAD;QAAU,KAAK,EAAEV,UAAU,CAACK,KAA5B;QAAmC,MAAM,EAAEE,KAAK,CAACE,UAAN,CAAiBC;MAA5D,EAAP;;IACF;MACE,oBAAO,oBAAC,IAAD,QAAQ,kBAAiBH,KAAK,CAACC,QAAS,iBAAxC,CAAP;EARJ;AAUD,CAXD;;AAaA,MAAMG,KAAK,GAAG,CAAC;EAACJ;AAAD,CAAD,KAAoB;EAChC,oBAAO,oBAAC,IAAD;IAAM,KAAK,EAAEP,UAAU,CAACE;EAAxB,GAAoCK,KAAK,gBAAG,oBAAC,WAAD;IAAa,KAAK,EAAEA;EAApB,EAAH,GAAmC,IAA5E,CAAP;AACD,CAFD;;AAIA,eAAeI,KAAf"}
1
+ {"version":3,"file":"index.native.js","names":["React","StyleSheet","Text","View","JWPlayer","Youtube","Vimeo","useTemplateContext","styleSheet","create","container","flex","width","VideoSwitch","media","brandTheme","mimeType","jwpOptions","config","videoId","youtube","apiKey","Video"],"sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, Text, View} from 'react-native';\nimport JWPlayer from 'react-native-jw-media-player';\nimport Youtube from 'react-native-youtube';\nimport {Vimeo} from 'react-native-vimeo-iframe';\nimport {useTemplateContext} from '../../template/app-review/template-context';\n\nimport {Media} from '../questions/types';\n\nexport type Props = {media: Media};\n\nconst styleSheet = StyleSheet.create({\n container: {\n flex: 1,\n width: '100%'\n }\n});\n\nconst VideoSwitch = ({media}: Props) => {\n const {brandTheme} = useTemplateContext();\n\n switch (media.mimeType) {\n case 'application/kontiki':\n case 'application/jwplayer':\n case 'video/mp4':\n if (!media.jwpOptions?.config) {\n return null;\n }\n\n return <JWPlayer style={styleSheet.container} config={media.jwpOptions.config} />;\n case 'application/vimeo':\n return media.videoId ? (\n <View style={styleSheet.container}>\n <Vimeo videoId={media.videoId} />\n </View>\n ) : null;\n case 'application/youtube':\n return (\n <Youtube\n apiKey={brandTheme.youtube?.apiKey || ''}\n style={styleSheet.container}\n videoId={media.videoId}\n />\n );\n default:\n return <Text>{`video mimeType ${media.mimeType} is not handled`}</Text>;\n }\n};\n\nconst Video = ({media}: Props) => {\n return media ? <VideoSwitch media={media} /> : null;\n};\n\nexport default Video;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAQC,UAAR,EAAoBC,IAApB,EAA0BC,IAA1B,QAAqC,cAArC;AACA,OAAOC,QAAP,MAAqB,8BAArB;AACA,OAAOC,OAAP,MAAoB,sBAApB;AACA,SAAQC,KAAR,QAAoB,2BAAp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Af"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAyBA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;AA2MtE,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":";AA0BA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;AAoNtE,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBA2DrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,5 +1,5 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { Animated, Easing, Image, ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native';
1
+ import React, { useCallback, useEffect, useState } from 'react';
2
+ import { Animated, Easing, Image, Keyboard, ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native';
3
3
  import get from 'lodash/fp/get';
4
4
  import getOr from 'lodash/fp/getOr';
5
5
  import { useTranslateY } from '@coorpacademy/react-native-animation';
@@ -37,15 +37,17 @@ const MediaView = ({
37
37
  }) => {
38
38
  switch (media.type) {
39
39
  case TYPE_VIDEO:
40
- return /*#__PURE__*/React.createElement(Video, {
40
+ return /*#__PURE__*/React.createElement(View, {
41
+ style: styles.mediaContainer
42
+ }, /*#__PURE__*/React.createElement(Video, {
41
43
  media: media
42
- });
44
+ }));
43
45
 
44
46
  case TYPE_IMAGE:
45
47
  {
46
48
  const uri = `https://${media.url?.split('//')[1]}`;
47
49
  return /*#__PURE__*/React.createElement(Image, {
48
- style: styles.image,
50
+ style: [styles.mediaContainer, styles.image],
49
51
  source: {
50
52
  uri
51
53
  }
@@ -54,7 +56,7 @@ const MediaView = ({
54
56
 
55
57
  case TYPE_AUDIO:
56
58
  default:
57
- return /*#__PURE__*/React.createElement(Text, null, `media type ${media.type} is not handled`);
59
+ return null;
58
60
  }
59
61
  };
60
62
 
@@ -158,11 +160,9 @@ const Question = props => {
158
160
  style: style.questionText
159
161
  }, questionText), /*#__PURE__*/React.createElement(Text, {
160
162
  style: style.questionHelp
161
- }, get('help', answerUI))), answerUI.media ? /*#__PURE__*/React.createElement(View, {
162
- style: styles.mediaContainer
163
- }, /*#__PURE__*/React.createElement(MediaView, {
163
+ }, get('help', answerUI))), answerUI.media ? /*#__PURE__*/React.createElement(MediaView, {
164
164
  media: answerUI.media
165
- })) : null, /*#__PURE__*/React.createElement(ScrollView, {
165
+ }) : null, /*#__PURE__*/React.createElement(ScrollView, {
166
166
  style: style.choicesScrollView,
167
167
  contentContainerStyle: style.choicesScrollContent,
168
168
  centerContent: true,
@@ -174,6 +174,14 @@ const Question = props => {
174
174
  const createSlideStyle = (num, screenWidth) => {
175
175
  const slideWidth = screenWidth - 40 - num * 8;
176
176
  return StyleSheet.create({
177
+ hiddenBackgroundToLockActions: {
178
+ position: 'absolute',
179
+ left: 0,
180
+ right: 0,
181
+ top: 0,
182
+ bottom: 0,
183
+ backgroundColor: '#00000000'
184
+ },
177
185
  slide: {
178
186
  position: 'absolute',
179
187
  left: 20 + num * 4,
@@ -207,6 +215,16 @@ const Slide = props => {
207
215
  num,
208
216
  slideIndex = '0'
209
217
  } = props;
218
+ const [isValidated, setValidated] = useState(false);
219
+ const handleValidatePress = useCallback(() => {
220
+ Keyboard.dismiss();
221
+ setValidated(true); // calling the onclick later, after react has rerendered, to display the locking BG as soon as possible
222
+
223
+ setTimeout(() => {
224
+ validateButton.onClick();
225
+ }, 20); // only to create on mount
226
+ // eslint-disable-next-line react-hooks/exhaustive-deps
227
+ }, []);
210
228
  const {
211
229
  width
212
230
  } = useWindowDimensions();
@@ -226,9 +244,6 @@ const Slide = props => {
226
244
  });
227
245
  }
228
246
 
229
- const {
230
- onClick: handleValidatePress
231
- } = validateButton;
232
247
  return /*#__PURE__*/React.createElement(Animated.View, {
233
248
  style: [slideStyle.slide, animatedStyle]
234
249
  }, /*#__PURE__*/React.createElement(Question, {
@@ -237,11 +252,13 @@ const Slide = props => {
237
252
  answerUI: answerUI,
238
253
  key: "question-container"
239
254
  }), /*#__PURE__*/React.createElement(Button, {
240
- disabled: validateButton.disabled,
255
+ disabled: isValidated || validateButton.disabled,
241
256
  submitValue: validateButton.label,
242
257
  onPress: handleValidatePress,
243
258
  testID: `slide-validate-button-${slideIndex}`
244
- }), correctionPopinProps ? /*#__PURE__*/React.createElement(CorrectionPopin, {
259
+ }), isValidated ? /*#__PURE__*/React.createElement(View, {
260
+ style: slideStyle.hiddenBackgroundToLockActions
261
+ }) : null, correctionPopinProps ? /*#__PURE__*/React.createElement(CorrectionPopin, {
245
262
  correctionPopinProps: correctionPopinProps,
246
263
  slideIndex: slideIndex,
247
264
  showCorrectionPopin: showCorrectionPopin,
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["React","useEffect","useState","Animated","Easing","Image","ScrollView","StyleSheet","useWindowDimensions","View","get","getOr","useTranslateY","Text","Answer","ReviewCorrectionPopin","useTemplateContext","Button","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","Video","styles","create","mediaContainer","flex","alignItems","justifyContent","marginTop","width","minHeight","borderRadius","overflow","image","correctionPopinWrapper","position","bottom","MediaView","media","type","uri","url","split","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","fromValue","toValue","duration","easing","bezier","start","klf","undefined","information","label","message","next","onClick","_correctionPopinProps","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesScrollView","marginVertical","choicesScrollContent","padding","Question","props","answerUI","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","validateButton","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\n\nimport {\n Animated,\n Easing,\n Image,\n ScrollView,\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 {TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from '../../molecule/answer/prop-types';\nimport Video from '../../molecule/video-player-mobile/index.native';\nimport {Media} from '../../molecule/questions/types';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n mediaContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 20,\n width: '100%',\n minHeight: 150,\n borderRadius: 10,\n overflow: 'hidden'\n },\n image: {\n flex: 1,\n width: '100%'\n },\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst MediaView = ({media}: {media: Media}) => {\n switch (media.type) {\n case TYPE_VIDEO:\n return <Video media={media} />;\n case TYPE_IMAGE: {\n const uri = `https://${media.url?.split('//')[1]}`;\n return <Image style={styles.image} source={{uri}} />;\n }\n case TYPE_AUDIO:\n default:\n return <Text>{`media type ${media.type} is not handled`}</Text>;\n }\n};\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 500,\n toValue: 0,\n duration: 500,\n easing: Easing.bezier(0.34, 1.36, 0.64, 1)\n });\n\n // the translation is required only once on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\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 choicesScrollView: ViewStyle;\n choicesScrollContent: 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 choicesScrollView: {\n marginVertical: 20,\n width: '100%'\n },\n choicesScrollContent: {\n padding: 10\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 {answerUI.media ? (\n <View style={styles.mediaContainer}>\n <MediaView media={answerUI.media} />\n </View>\n ) : null}\n <ScrollView\n style={style.choicesScrollView}\n contentContainerStyle={style.choicesScrollContent}\n centerContent\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n >\n <Answer {...answerUI} />\n </ScrollView>\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,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AAEA,SACEC,QADF,EAEEC,MAFF,EAGEC,KAHF,EAIEC,UAJF,EAKEC,UALF,EAOEC,mBAPF,EAQEC,IARF,QAUO,cAVP;AAWA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,SAAQC,aAAR,QAA4B,sCAA5B;AACA,OAAOC,IAAP,MAAiB,8BAAjB;AACA,OAAOC,MAAP,MAAmB,oCAAnB;AACA,OAAOC,qBAAP,MAAkC,qDAAlC;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,MAAP,MAAmB,gCAAnB;AACA,SAAQC,UAAR,EAAoBC,UAApB,EAAgCC,UAAhC,QAAiD,kCAAjD;AACA,OAAOC,KAAP,MAAkB,iDAAlB;AAIA,MAAMC,MAAM,GAAGf,UAAU,CAACgB,MAAX,CAAkB;EAC/BC,cAAc,EAAE;IACdC,IAAI,EAAE,CADQ;IAEdC,UAAU,EAAE,QAFE;IAGdC,cAAc,EAAE,QAHF;IAIdC,SAAS,EAAE,EAJG;IAKdC,KAAK,EAAE,MALO;IAMdC,SAAS,EAAE,GANG;IAOdC,YAAY,EAAE,EAPA;IAQdC,QAAQ,EAAE;EARI,CADe;EAW/BC,KAAK,EAAE;IACLR,IAAI,EAAE,CADD;IAELI,KAAK,EAAE;EAFF,CAXw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vB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;AAgDA,eAAe6D,KAAf"}
1
+ {"version":3,"file":"index.native.js","names":["React","useCallback","useEffect","useState","Animated","Easing","Image","Keyboard","ScrollView","StyleSheet","useWindowDimensions","View","get","getOr","useTranslateY","Text","Answer","ReviewCorrectionPopin","useTemplateContext","Button","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","Video","styles","create","mediaContainer","flex","alignItems","justifyContent","marginTop","width","minHeight","borderRadius","overflow","image","correctionPopinWrapper","position","bottom","MediaView","media","type","uri","url","split","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","fromValue","toValue","duration","easing","bezier","start","klf","undefined","information","label","message","next","onClick","_correctionPopinProps","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesScrollView","marginVertical","choicesScrollContent","padding","Question","props","answerUI","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","hiddenBackgroundToLockActions","left","right","top","backgroundColor","slide","height","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","validateButton","isValidated","setValidated","handleValidatePress","dismiss","setTimeout","slideStyle","loading","parentContentTitle","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState} from 'react';\n\nimport {\n Animated,\n Easing,\n Image,\n Keyboard,\n ScrollView,\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 {TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from '../../molecule/answer/prop-types';\nimport Video from '../../molecule/video-player-mobile/index.native';\nimport {Media} from '../../molecule/questions/types';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n mediaContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 20,\n width: '100%',\n minHeight: 150,\n borderRadius: 10,\n overflow: 'hidden'\n },\n image: {\n flex: 1,\n width: '100%'\n },\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst MediaView = ({media}: {media: Media}) => {\n switch (media.type) {\n case TYPE_VIDEO:\n return (\n <View style={styles.mediaContainer}>\n <Video media={media} />\n </View>\n );\n case TYPE_IMAGE: {\n const uri = `https://${media.url?.split('//')[1]}`;\n return <Image style={[styles.mediaContainer, styles.image]} source={{uri}} />;\n }\n case TYPE_AUDIO:\n default:\n return null;\n }\n};\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 500,\n toValue: 0,\n duration: 500,\n easing: Easing.bezier(0.34, 1.36, 0.64, 1)\n });\n\n // the translation is required only once on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\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 choicesScrollView: ViewStyle;\n choicesScrollContent: 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 choicesScrollView: {\n marginVertical: 20,\n width: '100%'\n },\n choicesScrollContent: {\n padding: 10\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 {answerUI.media ? <MediaView media={answerUI.media} /> : null}\n <ScrollView\n style={style.choicesScrollView}\n contentContainerStyle={style.choicesScrollContent}\n centerContent\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n >\n <Answer {...answerUI} />\n </ScrollView>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n hiddenBackgroundToLockActions: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n hiddenBackgroundToLockActions: {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n backgroundColor: '#00000000'\n },\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 const [isValidated, setValidated] = useState<boolean>(false);\n\n const handleValidatePress = useCallback(() => {\n Keyboard.dismiss();\n setValidated(true);\n\n // calling the onclick later, after react has rerendered, to display the locking BG as soon as possible\n setTimeout(() => {\n validateButton.onClick();\n }, 20);\n\n // only to create on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\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 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={isValidated || validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {isValidated ? <View style={slideStyle.hiddenBackgroundToLockActions} /> : null}\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,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,QAAvC,QAAsD,OAAtD;AAEA,SACEC,QADF,EAEEC,MAFF,EAGEC,KAHF,EAIEC,QAJF,EAKEC,UALF,EAMEC,UANF,EAQEC,mBARF,EASEC,IATF,QAWO,cAXP;AAYA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,SAAQC,aAAR,QAA4B,sCAA5B;AACA,OAAOC,IAAP,MAAiB,8BAAjB;AACA,OAAOC,MAAP,MAAmB,oCAAnB;AACA,OAAOC,qBAAP,MAAkC,qDAAlC;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,MAAP,MAAmB,gCAAnB;AACA,SAAQC,UAAR,EAAoBC,UAApB,EAAgCC,UAAhC,QAAiD,kCAAjD;AACA,OAAOC,KAAP,MAAkB,iDAAlB;AAIA,MAAMC,MAAM,GAAGf,UAAU,CAACgB,MAAX,CAAkB;EAC/BC,cAAc,EAAE;IACdC,IAAI,EAAE,CADQ;IAEdC,UAAU,EAAE,QAFE;IAGdC,cAAc,EAAE,QAHF;IAIdC,SAAS,EAAE,EAJG;IAKdC,KAAK,EAAE,MALO;IAMdC,SAAS,EAAE,GANG;IAOdC,YAAY,EAAE,EAPA;IAQdC,QAAQ,EAAE;EARI,CADe;EAW/BC,KAAK,EAAE;IACLR,IAAI,EAAE,CADD;IAELI,KAAK,EAAE;EAFF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c,UAAU,CAACd,KAAZ,EAAmBvC,aAAnB;EAAtB,gBACE,oBAAC,QAAD;IACE,cAAc,EAAEuD,kBADlB;IAEE,YAAY,EAAEvC,YAFhB;IAGE,QAAQ,EAAEW,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,oBAAC,MAAD;IACE,QAAQ,EAAEqB,WAAW,IAAID,cAAc,CAACS,QAD1C;IAEE,WAAW,EAAET,cAAc,CAACtD,KAF9B;IAGE,OAAO,EAAEyD,mBAHX;IAIE,MAAM,EAAG,yBAAwBtE,UAAW;EAJ9C,EAPF,EAaGoE,WAAW,gBAAG,oBAAC,IAAD;IAAM,KAAK,EAAEK,UAAU,CAACnB;EAAxB,EAAH,GAA+D,IAb7E,EAcGvD,oBAAoB,gBACnB,oBAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IAtBN,CADF;AA0BD,CA3DD;;AA6DA,eAAegE,KAAf"}
@@ -3,6 +3,6 @@ import { Media } from '../questions/types';
3
3
  export declare type Props = {
4
4
  media: Media;
5
5
  };
6
- declare const Video: ({ media }: Props) => JSX.Element;
6
+ declare const Video: ({ media }: Props) => JSX.Element | null;
7
7
  export default Video;
8
8
  //# sourceMappingURL=index.native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAEzC,oBAAY,KAAK,GAAG;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC;AA0BnC,QAAA,MAAM,KAAK,cAAa,KAAK,gBAE5B,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAEzC,oBAAY,KAAK,GAAG;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC;AAwCnC,QAAA,MAAM,KAAK,cAAa,KAAK,uBAE5B,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -9,33 +9,55 @@ var _reactNative = require("react-native");
9
9
 
10
10
  var _reactNativeJwMediaPlayer = _interopRequireDefault(require("react-native-jw-media-player"));
11
11
 
12
+ var _reactNativeYoutube = _interopRequireDefault(require("react-native-youtube"));
13
+
14
+ var _reactNativeVimeoIframe = require("react-native-vimeo-iframe");
15
+
16
+ var _templateContext = require("../../template/app-review/template-context");
17
+
12
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
19
 
14
20
  const styleSheet = _reactNative.StyleSheet.create({
15
21
  container: {
16
22
  flex: 1,
17
23
  width: '100%'
18
- },
19
- video: {
20
- flex: 1,
21
- width: '100%'
22
24
  }
23
25
  });
24
26
 
25
27
  const VideoSwitch = ({
26
28
  media
27
29
  }) => {
30
+ const {
31
+ brandTheme
32
+ } = (0, _templateContext.useTemplateContext)();
33
+
28
34
  switch (media.mimeType) {
35
+ case 'application/kontiki':
29
36
  case 'application/jwplayer':
37
+ case 'video/mp4':
30
38
  if (!media.jwpOptions?.config) {
31
39
  return null;
32
40
  }
33
41
 
34
42
  return /*#__PURE__*/_react.default.createElement(_reactNativeJwMediaPlayer.default, {
35
- style: styleSheet.video,
43
+ style: styleSheet.container,
36
44
  config: media.jwpOptions.config
37
45
  });
38
46
 
47
+ case 'application/vimeo':
48
+ return media.videoId ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
49
+ style: styleSheet.container
50
+ }, /*#__PURE__*/_react.default.createElement(_reactNativeVimeoIframe.Vimeo, {
51
+ videoId: media.videoId
52
+ })) : null;
53
+
54
+ case 'application/youtube':
55
+ return /*#__PURE__*/_react.default.createElement(_reactNativeYoutube.default, {
56
+ apiKey: brandTheme.youtube?.apiKey || '',
57
+ style: styleSheet.container,
58
+ videoId: media.videoId
59
+ });
60
+
39
61
  default:
40
62
  return /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, `video mimeType ${media.mimeType} is not handled`);
41
63
  }
@@ -44,11 +66,9 @@ const VideoSwitch = ({
44
66
  const Video = ({
45
67
  media
46
68
  }) => {
47
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
48
- style: styleSheet.container
49
- }, media ? /*#__PURE__*/_react.default.createElement(VideoSwitch, {
69
+ return media ? /*#__PURE__*/_react.default.createElement(VideoSwitch, {
50
70
  media: media
51
- }) : null);
71
+ }) : null;
52
72
  };
53
73
 
54
74
  var _default = Video;
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["styleSheet","StyleSheet","create","container","flex","width","video","VideoSwitch","media","mimeType","jwpOptions","config","Video"],"sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, Text, View} from 'react-native';\nimport JWPlayer from 'react-native-jw-media-player';\n\nimport {Media} from '../questions/types';\n\nexport type Props = {media: Media};\n\nconst styleSheet = StyleSheet.create({\n container: {\n flex: 1,\n width: '100%'\n },\n video: {\n flex: 1,\n width: '100%'\n }\n});\n\nconst VideoSwitch = ({media}: Props) => {\n switch (media.mimeType) {\n case 'application/jwplayer':\n if (!media.jwpOptions?.config) {\n return null;\n }\n\n return <JWPlayer style={styleSheet.video} config={media.jwpOptions.config} />;\n default:\n return <Text>{`video mimeType ${media.mimeType} is not handled`}</Text>;\n }\n};\n\nconst Video = ({media}: Props) => {\n return <View style={styleSheet.container}>{media ? <VideoSwitch media={media} /> : null}</View>;\n};\n\nexport default Video;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAMA,MAAMA,UAAU,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EACnCC,SAAS,EAAE;IACTC,IAAI,EAAE,CADG;IAETC,KAAK,EAAE;EAFE,CADwB;EAKnCC,KAAK,EAAE;IACLF,IAAI,EAAE,CADD;IAELC,KAAK,EAAE;EAFF;AAL4B,CAAlB,CAAnB;;AAWA,MAAME,WAAW,GAAG,CAAC;EAACC;AAAD,CAAD,KAAoB;EACtC,QAAQA,KAAK,CAACC,QAAd;IACE,KAAK,sBAAL;MACE,IAAI,CAACD,KAAK,CAACE,UAAN,EAAkBC,MAAvB,EAA+B;QAC7B,OAAO,IAAP;MACD;;MAED,oBAAO,6BAAC,iCAAD;QAAU,KAAK,EAAEX,UAAU,CAACM,KAA5B;QAAmC,MAAM,EAAEE,KAAK,CAACE,UAAN,CAAiBC;MAA5D,EAAP;;IACF;MACE,oBAAO,6BAAC,iBAAD,QAAQ,kBAAiBH,KAAK,CAACC,QAAS,iBAAxC,CAAP;EARJ;AAUD,CAXD;;AAaA,MAAMG,KAAK,GAAG,CAAC;EAACJ;AAAD,CAAD,KAAoB;EAChC,oBAAO,6BAAC,iBAAD;IAAM,KAAK,EAAER,UAAU,CAACG;EAAxB,GAAoCK,KAAK,gBAAG,6BAAC,WAAD;IAAa,KAAK,EAAEA;EAApB,EAAH,GAAmC,IAA5E,CAAP;AACD,CAFD;;eAIeI,K"}
1
+ {"version":3,"file":"index.native.js","names":["styleSheet","StyleSheet","create","container","flex","width","VideoSwitch","media","brandTheme","useTemplateContext","mimeType","jwpOptions","config","videoId","youtube","apiKey","Video"],"sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, Text, View} from 'react-native';\nimport JWPlayer from 'react-native-jw-media-player';\nimport Youtube from 'react-native-youtube';\nimport {Vimeo} from 'react-native-vimeo-iframe';\nimport {useTemplateContext} from '../../template/app-review/template-context';\n\nimport {Media} from '../questions/types';\n\nexport type Props = {media: Media};\n\nconst styleSheet = StyleSheet.create({\n container: {\n flex: 1,\n width: '100%'\n }\n});\n\nconst VideoSwitch = ({media}: Props) => {\n const {brandTheme} = useTemplateContext();\n\n switch (media.mimeType) {\n case 'application/kontiki':\n case 'application/jwplayer':\n case 'video/mp4':\n if (!media.jwpOptions?.config) {\n return null;\n }\n\n return <JWPlayer style={styleSheet.container} config={media.jwpOptions.config} />;\n case 'application/vimeo':\n return media.videoId ? (\n <View style={styleSheet.container}>\n <Vimeo videoId={media.videoId} />\n </View>\n ) : null;\n case 'application/youtube':\n return (\n <Youtube\n apiKey={brandTheme.youtube?.apiKey || ''}\n style={styleSheet.container}\n videoId={media.videoId}\n />\n );\n default:\n return <Text>{`video mimeType ${media.mimeType} is not handled`}</Text>;\n }\n};\n\nconst Video = ({media}: Props) => {\n return media ? <VideoSwitch media={media} /> : null;\n};\n\nexport default Video;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAMA,MAAMA,UAAU,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EACnCC,SAAS,EAAE;IACTC,IAAI,EAAE,CADG;IAETC,KAAK,EAAE;EAFE;AADwB,CAAlB,CAAnB;;AAOA,MAAMC,WAAW,GAAG,CAAC;EAACC;AAAD,CAAD,KAAoB;EACtC,MAAM;IAACC;EAAD,IAAe,IAAAC,mCAAA,GAArB;;EAEA,QAAQF,KAAK,CAACG,QAAd;IACE,KAAK,qBAAL;IACA,KAAK,sBAAL;IACA,KAAK,WAAL;MACE,IAAI,CAACH,KAAK,CAACI,UAAN,EAAkBC,MAAvB,EAA+B;QAC7B,OAAO,IAAP;MACD;;MAED,oBAAO,6BAAC,iCAAD;QAAU,KAAK,EAAEZ,UAAU,CAACG,SAA5B;QAAuC,MAAM,EAAEI,KAAK,CAACI,UAAN,CAAiBC;MAAhE,EAAP;;IACF,KAAK,mBAAL;MACE,OAAOL,KAAK,CAACM,OAAN,gBACL,6BAAC,iBAAD;QAAM,KAAK,EAAEb,UAAU,CAACG;MAAxB,gBACE,6BAAC,6BAAD;QAAO,OAAO,EAAEI,KAAK,CAACM;MAAtB,EADF,CADK,GAIH,IAJJ;;IAKF,KAAK,qBAAL;MACE,oBACE,6BAAC,2BAAD;QACE,MAAM,EAAEL,UAAU,CAACM,OAAX,EAAoBC,MAApB,IAA8B,EADxC;QAEE,KAAK,EAAEf,UAAU,CAACG,SAFpB;QAGE,OAAO,EAAEI,KAAK,CAACM;MAHjB,EADF;;IAOF;MACE,oBAAO,6BAAC,iBAAD,QAAQ,kBAAiBN,KAAK,CAACG,QAAS,iBAAxC,CAAP;EAxBJ;AA0BD,CA7BD;;AA+BA,MAAMM,KAAK,GAAG,CAAC;EAACT;AAAD,CAAD,KAAoB;EAChC,OAAOA,KAAK,gBAAG,6BAAC,WAAD;IAAa,KAAK,EAAEA;EAApB,EAAH,GAAmC,IAA/C;AACD,CAFD;;eAIeS,K"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAyBA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;AA2MtE,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":";AA0BA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;AAoNtE,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBA2DrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -60,15 +60,17 @@ const MediaView = ({
60
60
  }) => {
61
61
  switch (media.type) {
62
62
  case _propTypes.TYPE_VIDEO:
63
- return /*#__PURE__*/_react.default.createElement(_index5.default, {
63
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
64
+ style: styles.mediaContainer
65
+ }, /*#__PURE__*/_react.default.createElement(_index5.default, {
64
66
  media: media
65
- });
67
+ }));
66
68
 
67
69
  case _propTypes.TYPE_IMAGE:
68
70
  {
69
71
  const uri = `https://${media.url?.split('//')[1]}`;
70
72
  return /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
71
- style: styles.image,
73
+ style: [styles.mediaContainer, styles.image],
72
74
  source: {
73
75
  uri
74
76
  }
@@ -77,7 +79,7 @@ const MediaView = ({
77
79
 
78
80
  case _propTypes.TYPE_AUDIO:
79
81
  default:
80
- return /*#__PURE__*/_react.default.createElement(_index.default, null, `media type ${media.type} is not handled`);
82
+ return null;
81
83
  }
82
84
  };
83
85
 
@@ -181,11 +183,9 @@ const Question = props => {
181
183
  style: style.questionText
182
184
  }, questionText), /*#__PURE__*/_react.default.createElement(_index.default, {
183
185
  style: style.questionHelp
184
- }, (0, _get.default)('help', answerUI))), answerUI.media ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
185
- style: styles.mediaContainer
186
- }, /*#__PURE__*/_react.default.createElement(MediaView, {
186
+ }, (0, _get.default)('help', answerUI))), answerUI.media ? /*#__PURE__*/_react.default.createElement(MediaView, {
187
187
  media: answerUI.media
188
- })) : null, /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, {
188
+ }) : null, /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, {
189
189
  style: style.choicesScrollView,
190
190
  contentContainerStyle: style.choicesScrollContent,
191
191
  centerContent: true,
@@ -197,6 +197,14 @@ const Question = props => {
197
197
  const createSlideStyle = (num, screenWidth) => {
198
198
  const slideWidth = screenWidth - 40 - num * 8;
199
199
  return _reactNative.StyleSheet.create({
200
+ hiddenBackgroundToLockActions: {
201
+ position: 'absolute',
202
+ left: 0,
203
+ right: 0,
204
+ top: 0,
205
+ bottom: 0,
206
+ backgroundColor: '#00000000'
207
+ },
200
208
  slide: {
201
209
  position: 'absolute',
202
210
  left: 20 + num * 4,
@@ -230,6 +238,17 @@ const Slide = props => {
230
238
  num,
231
239
  slideIndex = '0'
232
240
  } = props;
241
+ const [isValidated, setValidated] = (0, _react.useState)(false);
242
+ const handleValidatePress = (0, _react.useCallback)(() => {
243
+ _reactNative.Keyboard.dismiss();
244
+
245
+ setValidated(true); // calling the onclick later, after react has rerendered, to display the locking BG as soon as possible
246
+
247
+ setTimeout(() => {
248
+ validateButton.onClick();
249
+ }, 20); // only to create on mount
250
+ // eslint-disable-next-line react-hooks/exhaustive-deps
251
+ }, []);
233
252
  const {
234
253
  width
235
254
  } = (0, _reactNative.useWindowDimensions)();
@@ -249,9 +268,6 @@ const Slide = props => {
249
268
  });
250
269
  }
251
270
 
252
- const {
253
- onClick: handleValidatePress
254
- } = validateButton;
255
271
  return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
256
272
  style: [slideStyle.slide, animatedStyle]
257
273
  }, /*#__PURE__*/_react.default.createElement(Question, {
@@ -260,11 +276,13 @@ const Slide = props => {
260
276
  answerUI: answerUI,
261
277
  key: "question-container"
262
278
  }), /*#__PURE__*/_react.default.createElement(_index4.default, {
263
- disabled: validateButton.disabled,
279
+ disabled: isValidated || validateButton.disabled,
264
280
  submitValue: validateButton.label,
265
281
  onPress: handleValidatePress,
266
282
  testID: `slide-validate-button-${slideIndex}`
267
- }), correctionPopinProps ? /*#__PURE__*/_react.default.createElement(CorrectionPopin, {
283
+ }), isValidated ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
284
+ style: slideStyle.hiddenBackgroundToLockActions
285
+ }) : null, correctionPopinProps ? /*#__PURE__*/_react.default.createElement(CorrectionPopin, {
268
286
  correctionPopinProps: correctionPopinProps,
269
287
  slideIndex: slideIndex,
270
288
  showCorrectionPopin: showCorrectionPopin,
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","mediaContainer","flex","alignItems","justifyContent","marginTop","width","minHeight","borderRadius","overflow","image","correctionPopinWrapper","position","bottom","MediaView","media","type","TYPE_VIDEO","TYPE_IMAGE","uri","url","split","TYPE_AUDIO","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","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesScrollView","marginVertical","choicesScrollContent","padding","Question","props","answerUI","useTemplateContext","setStyle","useState","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","validateButton","useWindowDimensions","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\n\nimport {\n Animated,\n Easing,\n Image,\n ScrollView,\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 {TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from '../../molecule/answer/prop-types';\nimport Video from '../../molecule/video-player-mobile/index.native';\nimport {Media} from '../../molecule/questions/types';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n mediaContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 20,\n width: '100%',\n minHeight: 150,\n borderRadius: 10,\n overflow: 'hidden'\n },\n image: {\n flex: 1,\n width: '100%'\n },\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst MediaView = ({media}: {media: Media}) => {\n switch (media.type) {\n case TYPE_VIDEO:\n return <Video media={media} />;\n case TYPE_IMAGE: {\n const uri = `https://${media.url?.split('//')[1]}`;\n return <Image style={styles.image} source={{uri}} />;\n }\n case TYPE_AUDIO:\n default:\n return <Text>{`media type ${media.type} is not handled`}</Text>;\n }\n};\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 500,\n toValue: 0,\n duration: 500,\n easing: Easing.bezier(0.34, 1.36, 0.64, 1)\n });\n\n // the translation is required only once on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\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 choicesScrollView: ViewStyle;\n choicesScrollContent: 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 choicesScrollView: {\n marginVertical: 20,\n width: '100%'\n },\n choicesScrollContent: {\n padding: 10\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 {answerUI.media ? (\n <View style={styles.mediaContainer}>\n <MediaView media={answerUI.media} />\n </View>\n ) : null}\n <ScrollView\n style={style.choicesScrollView}\n contentContainerStyle={style.choicesScrollContent}\n centerContent\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n >\n <Answer {...answerUI} />\n </ScrollView>\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;;AAEA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;AAIA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,cAAc,EAAE;IACdC,IAAI,EAAE,CADQ;IAEdC,UAAU,EAAE,QAFE;IAGdC,cAAc,EAAE,QAHF;IAIdC,SAAS,EAAE,EAJG;IAKdC,KAAK,EAAE,MALO;IAMdC,SAAS,EAAE,GANG;IAOdC,YAAY,EAAE,EAPA;IAQdC,QAAQ,EAAE;EARI,CADe;EAW/BC,KAAK,EAAE;IACLR,IAAI,EAAE,CADD;IAELI,KAAK,EAAE;EAFF,CAXwB;EAe/BK,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBP,KAAK,EAAE;EAHe;AAfO,CAAlB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C;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;eAgDeoE,K"}
1
+ {"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","mediaContainer","flex","alignItems","justifyContent","marginTop","width","minHeight","borderRadius","overflow","image","correctionPopinWrapper","position","bottom","MediaView","media","type","TYPE_VIDEO","TYPE_IMAGE","uri","url","split","TYPE_AUDIO","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","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesScrollView","marginVertical","choicesScrollContent","padding","Question","props","answerUI","useTemplateContext","setStyle","useState","questionStyle","createSlideStyle","num","screenWidth","slideWidth","hiddenBackgroundToLockActions","left","right","top","backgroundColor","slide","height","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","validateButton","isValidated","setValidated","handleValidatePress","useCallback","Keyboard","dismiss","setTimeout","useWindowDimensions","slideStyle","loading","parentContentTitle","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState} from 'react';\n\nimport {\n Animated,\n Easing,\n Image,\n Keyboard,\n ScrollView,\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 {TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from '../../molecule/answer/prop-types';\nimport Video from '../../molecule/video-player-mobile/index.native';\nimport {Media} from '../../molecule/questions/types';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n mediaContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 20,\n width: '100%',\n minHeight: 150,\n borderRadius: 10,\n overflow: 'hidden'\n },\n image: {\n flex: 1,\n width: '100%'\n },\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst MediaView = ({media}: {media: Media}) => {\n switch (media.type) {\n case TYPE_VIDEO:\n return (\n <View style={styles.mediaContainer}>\n <Video media={media} />\n </View>\n );\n case TYPE_IMAGE: {\n const uri = `https://${media.url?.split('//')[1]}`;\n return <Image style={[styles.mediaContainer, styles.image]} source={{uri}} />;\n }\n case TYPE_AUDIO:\n default:\n return null;\n }\n};\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 500,\n toValue: 0,\n duration: 500,\n easing: Easing.bezier(0.34, 1.36, 0.64, 1)\n });\n\n // the translation is required only once on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\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 choicesScrollView: ViewStyle;\n choicesScrollContent: 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 choicesScrollView: {\n marginVertical: 20,\n width: '100%'\n },\n choicesScrollContent: {\n padding: 10\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 {answerUI.media ? <MediaView media={answerUI.media} /> : null}\n <ScrollView\n style={style.choicesScrollView}\n contentContainerStyle={style.choicesScrollContent}\n centerContent\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n >\n <Answer {...answerUI} />\n </ScrollView>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n hiddenBackgroundToLockActions: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n hiddenBackgroundToLockActions: {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n backgroundColor: '#00000000'\n },\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 const [isValidated, setValidated] = useState<boolean>(false);\n\n const handleValidatePress = useCallback(() => {\n Keyboard.dismiss();\n setValidated(true);\n\n // calling the onclick later, after react has rerendered, to display the locking BG as soon as possible\n setTimeout(() => {\n validateButton.onClick();\n }, 20);\n\n // only to create on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\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 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={isValidated || validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {isValidated ? <View style={slideStyle.hiddenBackgroundToLockActions} /> : null}\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;;AAEA;;AAYA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;AAIA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,cAAc,EAAE;IACdC,IAAI,EAAE,CADQ;IAEdC,UAAU,EAAE,QAFE;IAGdC,cAAc,EAAE,QAHF;IAIdC,SAAS,EAAE,EAJG;IAKdC,KAAK,EAAE,MALO;IAMdC,SAAS,EAAE,GANG;IAOdC,YAAY,EAAE,EAPA;IAQdC,QAAQ,EAAE;EARI,CADe;EAW/BC,KAAK,EAAE;IACLR,IAAI,EAAE,CADD;IAELI,KAAK,EAAE;EAFF,CAXwB;EAe/BK,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBP,KAAK,EAAE;EAHe;AAfO,CAAlB,CAAf;;AAsBA,MAAMQ,SAAS,GAAG,CAAC;EAACC;AAAD,CAAD,KAA6B;EAC7C,QAAQA,KAAK,CAACC,IAAd;IACE,KAAKC,qBAAL;MACE,oBACE,6BAAC,iBAAD;QAAM,KAAK,EAAEnB,MAAM,CAACG;MAApB,gBACE,6BAAC,eAAD;QAAO,KAAK,EAAEc;MAAd,EADF,CADF;;IAKF,KAAKG,qBAAL;MAAiB;QACf,MAAMC,GAAG,GAAI,WAAUJ,KAAK,CAACK,GAAN,EAAWC,KAAX,CAAiB,IAAjB,EAAuB,CAAvB,CAA0B,EAAjD;QACA,oBAAO,6BAAC,kBAAD;UAAO,KAAK,EAAE,CAACvB,MAAM,CAACG,cAAR,EAAwBH,MAAM,CAACY,KA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BAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IAtBN,CADF;AA0BD,CA3DD;;eA6DeuE,K"}
@@ -0,0 +1 @@
1
+ {"ignore_dirs":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "11.11.1",
3
+ "version": "11.11.2",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -150,6 +150,8 @@
150
150
  "react-native-linear-gradient": "^2.6.2",
151
151
  "react-native-modal": "11.5.6",
152
152
  "react-native-render-html": "^6.3.4",
153
+ "react-native-vimeo-iframe": "^1.2.0",
154
+ "react-native-youtube": "^2.0.1",
153
155
  "rxjs": "^6.5.5",
154
156
  "style-loader": "^3.3.1",
155
157
  "stylelint-config-standard": "^28.0.0",
@@ -162,5 +164,5 @@
162
164
  "last 2 versions",
163
165
  "IE 11"
164
166
  ],
165
- "gitHead": "3c136e031dad5e7b1b4f2e40a7a3de5971e88472"
167
+ "gitHead": "afcbeeaee410cff21d042c45c85c5121613b3027"
166
168
  }