@coorpacademy/components 10.30.10-alpha.3 → 10.30.10-alpha.3.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 (69) hide show
  1. package/es/behaviours/use-translate-vertically.native.d.ts +16 -0
  2. package/es/behaviours/use-translate-vertically.native.d.ts.map +1 -0
  3. package/es/behaviours/use-translate-vertically.native.js +44 -0
  4. package/es/behaviours/use-translate-vertically.native.js.map +1 -0
  5. package/es/behaviours/use-update-opacity.native.d.ts +14 -0
  6. package/es/behaviours/use-update-opacity.native.d.ts.map +1 -0
  7. package/es/behaviours/use-update-opacity.native.js +55 -0
  8. package/es/behaviours/use-update-opacity.native.js.map +1 -0
  9. package/es/molecule/card-congrats/index.native.js +2 -2
  10. package/es/molecule/card-congrats/index.native.js.map +1 -1
  11. package/es/molecule/card-congrats/types.d.ts +1 -1
  12. package/es/molecule/card-congrats/types.d.ts.map +1 -1
  13. package/es/molecule/card-congrats/types.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 +12 -25
  16. package/es/molecule/review-correction-popin/index.native.js.map +1 -1
  17. package/es/organism/get-the-app/index.d.ts.map +1 -1
  18. package/es/organism/get-the-app/index.js +10 -5
  19. package/es/organism/get-the-app/index.js.map +1 -1
  20. package/es/organism/mooc-footer/index.d.ts.map +1 -1
  21. package/es/organism/mooc-footer/index.js +3 -2
  22. package/es/organism/mooc-footer/index.js.map +1 -1
  23. package/es/organism/mooc-header/index.d.ts.map +1 -1
  24. package/es/organism/mooc-header/index.js +6 -6
  25. package/es/organism/mooc-header/index.js.map +1 -1
  26. package/es/organism/review-congrats/index.native.d.ts.map +1 -1
  27. package/es/organism/review-congrats/index.native.js +91 -15
  28. package/es/organism/review-congrats/index.native.js.map +1 -1
  29. package/es/organism/review-slide/index.native.d.ts.map +1 -1
  30. package/es/organism/review-slide/index.native.js +10 -22
  31. package/es/organism/review-slide/index.native.js.map +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 +17 -4
  34. package/es/organism/review-stacked-slides/index.native.js.map +1 -1
  35. package/lib/behaviours/use-translate-vertically.native.d.ts +16 -0
  36. package/lib/behaviours/use-translate-vertically.native.d.ts.map +1 -0
  37. package/lib/behaviours/use-translate-vertically.native.js +51 -0
  38. package/lib/behaviours/use-translate-vertically.native.js.map +1 -0
  39. package/lib/behaviours/use-update-opacity.native.d.ts +14 -0
  40. package/lib/behaviours/use-update-opacity.native.d.ts.map +1 -0
  41. package/lib/behaviours/use-update-opacity.native.js +62 -0
  42. package/lib/behaviours/use-update-opacity.native.js.map +1 -0
  43. package/lib/molecule/card-congrats/index.native.js +2 -2
  44. package/lib/molecule/card-congrats/index.native.js.map +1 -1
  45. package/lib/molecule/card-congrats/types.d.ts +1 -1
  46. package/lib/molecule/card-congrats/types.d.ts.map +1 -1
  47. package/lib/molecule/card-congrats/types.js.map +1 -1
  48. package/lib/molecule/review-correction-popin/index.native.d.ts.map +1 -1
  49. package/lib/molecule/review-correction-popin/index.native.js +12 -24
  50. package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
  51. package/lib/organism/get-the-app/index.d.ts.map +1 -1
  52. package/lib/organism/get-the-app/index.js +11 -5
  53. package/lib/organism/get-the-app/index.js.map +1 -1
  54. package/lib/organism/mooc-footer/index.d.ts.map +1 -1
  55. package/lib/organism/mooc-footer/index.js +4 -2
  56. package/lib/organism/mooc-footer/index.js.map +1 -1
  57. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  58. package/lib/organism/mooc-header/index.js +6 -6
  59. package/lib/organism/mooc-header/index.js.map +1 -1
  60. package/lib/organism/review-congrats/index.native.d.ts.map +1 -1
  61. package/lib/organism/review-congrats/index.native.js +91 -13
  62. package/lib/organism/review-congrats/index.native.js.map +1 -1
  63. package/lib/organism/review-slide/index.native.d.ts.map +1 -1
  64. package/lib/organism/review-slide/index.native.js +10 -21
  65. package/lib/organism/review-slide/index.native.js.map +1 -1
  66. package/lib/organism/review-stacked-slides/index.native.d.ts.map +1 -1
  67. package/lib/organism/review-stacked-slides/index.native.js +21 -3
  68. package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
  69. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateAnim","useRef","Animated","Value","current","translateYAnim","useCallback","timing","toValue","duration","easing","Easing","bezier","useNativeDriver","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","transform","translateY","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","style","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, {useCallback, useEffect, useState, useRef} 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 {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 translateAnim = useRef(new Animated.Value(1000)).current;\n\n const translateYAnim = useCallback(() => {\n Animated.timing(translateAnim, {\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1),\n useNativeDriver: true\n }).start();\n }, [translateAnim]);\n\n if (animateCorrectionPopin) {\n translateYAnim();\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 return (\n <Animated.View\n style={{\n ...styles.correctionPopinWrapper,\n transform: [\n {\n translateY: translateAnim\n }\n ]\n }}\n >\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;;;;;;;;;;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,aAAa,GAAG,IAAAC,aAAA,EAAO,IAAIC,qBAAA,CAASC,KAAb,CAAmB,IAAnB,CAAP,EAAiCC,OAAvD;EAEA,MAAMC,cAAc,GAAG,IAAAC,kBAAA,EAAY,MAAM;IACvCJ,qBAAA,CAASK,MAAT,CAAgBP,aAAhB,EAA+B;MAC7BQ,OAAO,EAAE,CADoB;MAE7BC,QAAQ,EAAE,GAFmB;MAG7BC,MAAM,EAAEC,mBAAA,CAAOC,MAAP,CAAc,IAAd,EAAoB,CAApB,EAAuB,IAAvB,EAA6B,CAA7B,CAHqB;MAI7BC,eAAe,EAAE;IAJY,CAA/B,EAKGC,KALH;EAMD,CAPsB,EAOpB,CAACd,aAAD,CAPoB,CAAvB;;EASA,IAAID,sBAAJ,EAA4B;IAC1BM,cAAc;EACf;;EAED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AD;IAAQtE,oBAAR;IAA8BmF,cAA9B;IAA8ChB,GAA9C;IAAmDlE,UAAU,GAAG;EAAhE,IAAuEyD,KAA7E;EAEA,MAAM;IAAC5D;EAAD,IAAU,IAAAsF,gCAAA,GAAhB;EACA,MAAMC,UAAU,GAAGnB,gBAAgB,CAACC,GAAD,EAAMrE,KAAN,CAAnC;EAEA,MAAM;IACJwF,OADI;IAEJC,kBAFI;IAGJrC,YAHI;IAIJS,QAJI;IAKJzD,mBALI;IAMJC;EANI,IAOFmE,KAPJ;;EASA,IAAIgB,OAAJ,EAAa;IACX,oBAAO,6BAAC,cAAD,yBAAoBnB,GAApB,CAAP;EACD;;EAED,MAAM;IAACxC,OAAO,EAAE6D;EAAV,IAAiCL,cAAvC;EAEA,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEE,UAAU,CAACf;EAAxB,gBACE,6BAAC,QAAD;IACE,cAAc,EAAEiB,kBADlB;IAEE,YAAY,EAAErC,YAFhB;IAGE,QAAQ,EAAES,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,6BAAC,eAAD;IACE,QAAQ,EAAEwB,cAAc,CAACM,QAD3B;IAEE,WAAW,EAAEN,cAAc,CAAC5D,KAF9B;IAGE,OAAO,EAAEiE,mBAHX;IAIE,MAAM,EAAG,yBAAwBvF,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;;eAgDe+E,K"}
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,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AAD;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 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAUpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBAsB7C,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":";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"}
@@ -3,7 +3,7 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = exports.TOTAL_SLIDES_STACK = void 0;
5
5
 
6
- var _react = _interopRequireDefault(require("react"));
6
+ var _react = _interopRequireWildcard(require("react"));
7
7
 
8
8
  var _reactNative = require("react-native");
9
9
 
@@ -11,8 +11,14 @@ var _keys = _interopRequireDefault(require("lodash/fp/keys"));
11
11
 
12
12
  var _index = _interopRequireDefault(require("../review-slide/index.native"));
13
13
 
14
+ var _useTranslateVertically = _interopRequireDefault(require("../../behaviours/use-translate-vertically.native"));
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
18
+ 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); }
19
+
20
+ 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; }
21
+
16
22
  const TOTAL_SLIDES_STACK = 5;
17
23
  exports.TOTAL_SLIDES_STACK = TOTAL_SLIDES_STACK;
18
24
 
@@ -25,11 +31,23 @@ const style = _reactNative.StyleSheet.create({
25
31
  });
26
32
 
27
33
  const StackedSlides = props => {
34
+ const {
35
+ height: windowHeight
36
+ } = (0, _reactNative.useWindowDimensions)();
28
37
  const {
29
38
  slides,
30
39
  validateButton,
31
40
  correctionPopinProps
32
41
  } = props;
42
+ const {
43
+ translate,
44
+ animatedY
45
+ } = (0, _useTranslateVertically.default)({
46
+ fromValue: 0,
47
+ toValue: windowHeight,
48
+ duration: 800
49
+ });
50
+ (0, _react.useEffect)(translate, [translate]);
33
51
  const indexes = (0, _keys.default)(slides).reverse();
34
52
  const stackedSlides = indexes.map(slideIndex => {
35
53
  const slide = slides[slideIndex];
@@ -42,8 +60,8 @@ const StackedSlides = props => {
42
60
  key: slideIndex
43
61
  });
44
62
  });
45
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
46
- style: style.slides
63
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
64
+ style: [style.slides, animatedY]
47
65
  }, stackedSlides);
48
66
  };
49
67
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["TOTAL_SLIDES_STACK","style","StyleSheet","create","slides","flex","height","width","StackedSlides","props","validateButton","correctionPopinProps","indexes","keys","reverse","stackedSlides","map","slideIndex","slide","num","Number","parseInt"],"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, View} from 'react-native';\nimport keys from 'lodash/fp/keys';\nimport Slide from '../review-slide/index.native';\nimport {ReviewStackProps} from './prop-types';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst style = StyleSheet.create({\n slides: {\n flex: 1,\n height: '100%',\n width: '100%'\n }\n});\n\nconst StackedSlides = (props: ReviewStackProps) => {\n const {slides, validateButton, correctionPopinProps} = props;\n\n const indexes = keys(slides).reverse();\n const stackedSlides = indexes.map(slideIndex => {\n const slide = slides[slideIndex];\n\n return (\n <Slide\n {...{\n num: Number.parseInt(slideIndex),\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n return <View style={style.slides}>{stackedSlides}</View>;\n};\n\nexport default StackedSlides;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;AAGO,MAAMA,kBAAkB,GAAG,CAA3B;;;AAEP,MAAMC,KAAK,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC9BC,MAAM,EAAE;IACNC,IAAI,EAAE,CADA;IAENC,MAAM,EAAE,MAFF;IAGNC,KAAK,EAAE;EAHD;AADsB,CAAlB,CAAd;;AAQA,MAAMC,aAAa,GAAIC,KAAD,IAA6B;EACjD,MAAM;IAACL,MAAD;IAASM,cAAT;IAAyBC;EAAzB,IAAiDF,KAAvD;EAEA,MAAMG,OAAO,GAAG,IAAAC,aAAA,EAAKT,MAAL,EAAaU,OAAb,EAAhB;EACA,MAAMC,aAAa,GAAGH,OAAO,CAACI,GAAR,CAAYC,UAAU,IAAI;IAC9C,MAAMC,KAAK,GAAGd,MAAM,CAACa,UAAD,CAApB;IAEA,oBACE,6BAAC,cAAD;MAEIE,GAAG,EAAEC,MAAM,CAACC,QAAP,CAAgBJ,UAAhB,CAFT;MAGIA,UAHJ;MAIIC,KAJJ;MAKIR,cALJ;MAMIC,oBANJ;MAQE,GAAG,EAAEM;IARP,EADF;EAYD,CAfqB,CAAtB;EAiBA,oBAAO,6BAAC,iBAAD;IAAM,KAAK,EAAEhB,KAAK,CAACG;EAAnB,GAA4BW,aAA5B,CAAP;AACD,CAtBD;;eAwBeP,a"}
1
+ {"version":3,"file":"index.native.js","names":["TOTAL_SLIDES_STACK","style","StyleSheet","create","slides","flex","height","width","StackedSlides","props","windowHeight","useWindowDimensions","validateButton","correctionPopinProps","translate","animatedY","useTranslateVertically","fromValue","toValue","duration","useEffect","indexes","keys","reverse","stackedSlides","map","slideIndex","slide","num","Number","parseInt"],"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"sourcesContent":["import React, {useEffect} from 'react';\nimport {Animated, StyleSheet, useWindowDimensions} from 'react-native';\nimport keys from 'lodash/fp/keys';\nimport Slide from '../review-slide/index.native';\nimport useTranslateVertically from '../../behaviours/use-translate-vertically.native';\nimport {ReviewStackProps} from './prop-types';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst style = StyleSheet.create({\n slides: {\n flex: 1,\n height: '100%',\n width: '100%'\n }\n});\n\nconst StackedSlides = (props: ReviewStackProps) => {\n const {height: windowHeight} = useWindowDimensions();\n const {slides, validateButton, correctionPopinProps} = props;\n\n const {translate, animatedY} = useTranslateVertically({\n fromValue: 0,\n toValue: windowHeight,\n duration: 800\n });\n\n useEffect(translate, [translate]);\n\n const indexes = keys(slides).reverse();\n const stackedSlides = indexes.map(slideIndex => {\n const slide = slides[slideIndex];\n\n return (\n <Slide\n {...{\n num: Number.parseInt(slideIndex),\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n return <Animated.View style={[style.slides, animatedY]}>{stackedSlides}</Animated.View>;\n};\n\nexport default StackedSlides;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAGO,MAAMA,kBAAkB,GAAG,CAA3B;;;AAEP,MAAMC,KAAK,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC9BC,MAAM,EAAE;IACNC,IAAI,EAAE,CADA;IAENC,MAAM,EAAE,MAFF;IAGNC,KAAK,EAAE;EAHD;AADsB,CAAlB,CAAd;;AAQA,MAAMC,aAAa,GAAIC,KAAD,IAA6B;EACjD,MAAM;IAACH,MAAM,EAAEI;EAAT,IAAyB,IAAAC,gCAAA,GAA/B;EACA,MAAM;IAACP,MAAD;IAASQ,cAAT;IAAyBC;EAAzB,IAAiDJ,KAAvD;EAEA,MAAM;IAACK,SAAD;IAAYC;EAAZ,IAAyB,IAAAC,+BAAA,EAAuB;IACpDC,SAAS,EAAE,CADyC;IAEpDC,OAAO,EAAER,YAF2C;IAGpDS,QAAQ,EAAE;EAH0C,CAAvB,CAA/B;EAMA,IAAAC,gBAAA,EAAUN,SAAV,EAAqB,CAACA,SAAD,CAArB;EAEA,MAAMO,OAAO,GAAG,IAAAC,aAAA,EAAKlB,MAAL,EAAamB,OAAb,EAAhB;EACA,MAAMC,aAAa,GAAGH,OAAO,CAACI,GAAR,CAAYC,UAAU,IAAI;IAC9C,MAAMC,KAAK,GAAGvB,MAAM,CAACsB,UAAD,CAApB;IAEA,oBACE,6BAAC,cAAD;MAEIE,GAAG,EAAEC,MAAM,CAACC,QAAP,CAAgBJ,UAAhB,CAFT;MAGIA,UAHJ;MAIIC,KAJJ;MAKIf,cALJ;MAMIC,oBANJ;MAQE,GAAG,EAAEa;IARP,EADF;EAYD,CAfqB,CAAtB;EAiBA,oBAAO,6BAAC,qBAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAACzB,KAAK,CAACG,MAAP,EAAeW,SAAf;EAAtB,GAAkDS,aAAlD,CAAP;AACD,CA/BD;;eAiCehB,a"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "10.30.10-alpha.3+3f987715c",
3
+ "version": "10.30.10-alpha.3.2+e15346da7",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -158,5 +158,5 @@
158
158
  "last 2 versions",
159
159
  "IE 11"
160
160
  ],
161
- "gitHead": "3f987715c23fa50b8743e02fcf388b6f8ff55796"
161
+ "gitHead": "e15346da71ca140b841fcfa0e37f435246c55c11"
162
162
  }