@coorpacademy/components 11.0.0 → 11.0.1

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 (46) hide show
  1. package/es/molecule/card-congrats/index.native.d.ts.map +1 -1
  2. package/es/molecule/card-congrats/index.native.js.map +1 -1
  3. package/es/molecule/review-correction-popin/index.native.d.ts.map +1 -1
  4. package/es/molecule/review-correction-popin/index.native.js +8 -9
  5. package/es/molecule/review-correction-popin/index.native.js.map +1 -1
  6. package/es/organism/review-congrats/index.native.d.ts.map +1 -1
  7. package/es/organism/review-congrats/index.native.js +60 -67
  8. package/es/organism/review-congrats/index.native.js.map +1 -1
  9. package/es/organism/review-slide/index.native.d.ts.map +1 -1
  10. package/es/organism/review-slide/index.native.js +4 -3
  11. package/es/organism/review-slide/index.native.js.map +1 -1
  12. package/es/organism/review-stacked-slides/index.native.d.ts.map +1 -1
  13. package/es/organism/review-stacked-slides/index.native.js +4 -7
  14. package/es/organism/review-stacked-slides/index.native.js.map +1 -1
  15. package/lib/molecule/card-congrats/index.native.d.ts.map +1 -1
  16. package/lib/molecule/card-congrats/index.native.js.map +1 -1
  17. package/lib/molecule/review-correction-popin/index.native.d.ts.map +1 -1
  18. package/lib/molecule/review-correction-popin/index.native.js +9 -10
  19. package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
  20. package/lib/organism/review-congrats/index.native.d.ts.map +1 -1
  21. package/lib/organism/review-congrats/index.native.js +60 -68
  22. package/lib/organism/review-congrats/index.native.js.map +1 -1
  23. package/lib/organism/review-slide/index.native.d.ts.map +1 -1
  24. package/lib/organism/review-slide/index.native.js +5 -4
  25. package/lib/organism/review-slide/index.native.js.map +1 -1
  26. package/lib/organism/review-stacked-slides/index.native.d.ts.map +1 -1
  27. package/lib/organism/review-stacked-slides/index.native.js +5 -8
  28. package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
  29. package/locales/.mtslconfig.json +1 -0
  30. package/package.json +3 -2
  31. package/es/behaviours/use-translate-vertically.native.d.ts +0 -16
  32. package/es/behaviours/use-translate-vertically.native.d.ts.map +0 -1
  33. package/es/behaviours/use-translate-vertically.native.js +0 -44
  34. package/es/behaviours/use-translate-vertically.native.js.map +0 -1
  35. package/es/behaviours/use-update-opacity.native.d.ts +0 -14
  36. package/es/behaviours/use-update-opacity.native.d.ts.map +0 -1
  37. package/es/behaviours/use-update-opacity.native.js +0 -55
  38. package/es/behaviours/use-update-opacity.native.js.map +0 -1
  39. package/lib/behaviours/use-translate-vertically.native.d.ts +0 -16
  40. package/lib/behaviours/use-translate-vertically.native.d.ts.map +0 -1
  41. package/lib/behaviours/use-translate-vertically.native.js +0 -51
  42. package/lib/behaviours/use-translate-vertically.native.js.map +0 -1
  43. package/lib/behaviours/use-update-opacity.native.d.ts +0 -14
  44. package/lib/behaviours/use-update-opacity.native.d.ts.map +0 -1
  45. package/lib/behaviours/use-update-opacity.native.js +0 -62
  46. package/lib/behaviours/use-update-opacity.native.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","useTranslateVertically","fromValue","toValue","duration","easing","Easing","bezier","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","style","animatedY","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","useTemplateContext","setStyle","useState","useEffect","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","useWindowDimensions","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport useTranslateVertically from '../../behaviours/use-translate-vertically.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateVertically({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedY]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <Text>@todo loader {num}</Text>;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <View style={slideStyle.slide}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;AAGA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,WAAW,GAAG,IAAAC,+BAAA,EAAuB;IACzCC,SAAS,EAAE,IAD8B;IAEzCC,OAAO,EAAE,CAFgC;IAGzCC,QAAQ,EAAE,GAH+B;IAIzCC,MAAM,EAAEC,mBAAA,CAAOC,MAAP,CAAc,IAA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PopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","useTranslateY","fromValue","toValue","duration","easing","Easing","bezier","useEffect","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","useTemplateContext","setStyle","useState","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","useWindowDimensions","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {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 />\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AiCL,cAAvC;EAEA,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEE,UAAU,CAACf;EAAxB,gBACE,6BAAC,QAAD;IACE,cAAc,EAAEiB,kBADlB;IAEE,YAAY,EAAEnC,YAFhB;IAGE,QAAQ,EAAES,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,6BAAC,eAAD;IACE,QAAQ,EAAEsB,cAAc,CAACM,QAD3B;IAEE,WAAW,EAAEN,cAAc,CAAC1D,KAF9B;IAGE,OAAO,EAAE+D,mBAHX;IAIE,MAAM,EAAG,yBAAwBhF,UAAW;EAJ9C,EAPF,EAaGD,oBAAoB,gBACnB,6BAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;eAgDewE,K"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAUpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBA+B7C,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAUpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBAiC7C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -9,9 +9,9 @@ var _reactNative = require("react-native");
9
9
 
10
10
  var _keys = _interopRequireDefault(require("lodash/fp/keys"));
11
11
 
12
- var _index = _interopRequireDefault(require("../review-slide/index.native"));
12
+ var _reactNativeAnimation = require("@coorpacademy/react-native-animation");
13
13
 
14
- var _useTranslateVertically = _interopRequireDefault(require("../../behaviours/use-translate-vertically.native"));
14
+ var _index = _interopRequireDefault(require("../review-slide/index.native"));
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
@@ -39,15 +39,12 @@ const StackedSlides = props => {
39
39
  validateButton,
40
40
  correctionPopinProps
41
41
  } = props;
42
- const {
43
- translate,
44
- animatedY
45
- } = (0, _useTranslateVertically.default)({
42
+ const hideSlides = (0, _reactNativeAnimation.useTranslateY)({
46
43
  fromValue: 0,
47
44
  toValue: windowHeight,
48
45
  duration: 800
49
46
  });
50
- (0, _react.useEffect)(translate, [translate]);
47
+ (0, _react.useEffect)(() => hideSlides.start(), []);
51
48
  const indexes = (0, _keys.default)(slides).reverse();
52
49
  const stackedSlides = indexes.map(slideIndex => {
53
50
  const slide = slides[slideIndex];
@@ -61,7 +58,7 @@ const StackedSlides = props => {
61
58
  });
62
59
  });
63
60
  return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
64
- style: [style.slides, animatedY]
61
+ style: [style.slides, hideSlides.animatedStyle]
65
62
  }, stackedSlides);
66
63
  };
67
64
 
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"index.native.js","names":["TOTAL_SLIDES_STACK","style","StyleSheet","create","slides","flex","height","width","StackedSlides","props","windowHeight","useWindowDimensions","validateButton","correctionPopinProps","hideSlides","useTranslateY","fromValue","toValue","duration","useEffect","start","indexes","keys","reverse","stackedSlides","map","slideIndex","slide","num","Number","parseInt","animatedStyle"],"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 {useTranslateY} from '@coorpacademy/react-native-animation';\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 {height: windowHeight} = useWindowDimensions();\n const {slides, validateButton, correctionPopinProps} = props;\n\n const hideSlides = useTranslateY({\n fromValue: 0,\n toValue: windowHeight,\n duration: 800\n });\n\n useEffect(() => hideSlides.start(), []);\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 (\n <Animated.View style={[style.slides, hideSlides.animatedStyle]}>{stackedSlides}</Animated.View>\n );\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,MAAMK,UAAU,GAAG,IAAAC,mCAAA,EAAc;IAC/BC,SAAS,EAAE,CADoB;IAE/BC,OAAO,EAAEP,YAFsB;IAG/BQ,QAAQ,EAAE;EAHqB,CAAd,CAAnB;EAMA,IAAAC,gBAAA,EAAU,MAAML,UAAU,CAACM,KAAX,EAAhB,EAAoC,EAApC;EAEA,MAAMC,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,oBACE,6BAAC,qBAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAACzB,KAAK,CAACG,MAAP,EAAeU,UAAU,CAACiB,aAA1B;EAAtB,GAAiEP,aAAjE,CADF;AAGD,CAjCD;;eAmCehB,a"}
@@ -0,0 +1 @@
1
+ {"ignore_dirs":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "11.0.0",
3
+ "version": "11.0.1",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -57,6 +57,7 @@
57
57
  ],
58
58
  "dependencies": {
59
59
  "@coorpacademy/nova-icons": "4.0.0",
60
+ "@coorpacademy/react-native-animation": "1.0.1",
60
61
  "@jwplayer/jwplayer-react": "^1.1.0",
61
62
  "@types/react": "^17.0.50",
62
63
  "@types/react-dom": "^17.0.17",
@@ -158,5 +159,5 @@
158
159
  "last 2 versions",
159
160
  "IE 11"
160
161
  ],
161
- "gitHead": "0250c01a34d4ca5c8b74313bea000d3be97d855c"
162
+ "gitHead": "726c8d07a9b92a9fa28a1b754ab361ae3cb3e650"
162
163
  }
@@ -1,16 +0,0 @@
1
- import { Animated } from 'react-native';
2
- declare type Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {
3
- onFinished?: () => void;
4
- fromValue?: number;
5
- toValue?: Animated.TimingAnimationConfig['toValue'];
6
- };
7
- declare const useTranslateVertically: (params?: Params) => {
8
- translate: () => void;
9
- animatedY: {
10
- transform: {
11
- translateY: Animated.Value;
12
- }[];
13
- };
14
- };
15
- export default useTranslateVertically;
16
- //# sourceMappingURL=use-translate-vertically.native.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-translate-vertically.native.d.ts","sourceRoot":"","sources":["../../src/behaviours/use-translate-vertically.native.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAEtC,aAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,iBAAiB,GAAG,SAAS,CAAC,GAAG;IAClF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,QAAQ,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;CACrD,CAAC;AAEF,QAAA,MAAM,sBAAsB,YAAY,MAAM;;;;;;;CAkB7C,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,44 +0,0 @@
1
- const _excluded = ["fromValue", "toValue", "duration", "onFinished"];
2
-
3
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
-
5
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
-
7
- import { useCallback, useRef } from 'react';
8
- import { Animated } from 'react-native';
9
-
10
- const useTranslateVertically = (params = {}) => {
11
- const {
12
- fromValue = 0,
13
- toValue = 100,
14
- duration = 550,
15
- onFinished
16
- } = params,
17
- othersParams = _objectWithoutPropertiesLoose(params, _excluded);
18
-
19
- const translateY = useRef(new Animated.Value(fromValue)).current;
20
- const translate = useCallback(() => {
21
- Animated.timing(translateY, _extends({}, othersParams, {
22
- toValue,
23
- duration,
24
- useNativeDriver: true
25
- })).start(({
26
- finished
27
- }) => {
28
- if (finished) {
29
- onFinished?.();
30
- }
31
- });
32
- }, [onFinished, duration, othersParams, toValue, translateY]);
33
- return {
34
- translate,
35
- animatedY: {
36
- transform: [{
37
- translateY
38
- }]
39
- }
40
- };
41
- };
42
-
43
- export default useTranslateVertically;
44
- //# sourceMappingURL=use-translate-vertically.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-translate-vertically.native.js","names":["useCallback","useRef","Animated","useTranslateVertically","params","fromValue","toValue","duration","onFinished","othersParams","translateY","Value","current","translate","timing","useNativeDriver","start","finished","animatedY","transform"],"sources":["../../src/behaviours/use-translate-vertically.native.tsx"],"sourcesContent":["import {useCallback, useRef} from 'react';\nimport {Animated} from 'react-native';\n\ntype Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {\n onFinished?: () => void;\n fromValue?: number;\n toValue?: Animated.TimingAnimationConfig['toValue'];\n};\n\nconst useTranslateVertically = (params: Params = {}) => {\n const {fromValue = 0, toValue = 100, duration = 550, onFinished, ...othersParams} = params;\n const translateY = useRef(new Animated.Value(fromValue)).current;\n\n const translate = useCallback(() => {\n Animated.timing(translateY, {\n ...othersParams,\n toValue,\n duration,\n useNativeDriver: true\n }).start(({finished}) => {\n if (finished) {\n onFinished?.();\n }\n });\n }, [onFinished, duration, othersParams, toValue, translateY]);\n\n return {translate, animatedY: {transform: [{translateY}]}};\n};\n\nexport default useTranslateVertically;\n"],"mappings":";;;;;;AAAA,SAAQA,WAAR,EAAqBC,MAArB,QAAkC,OAAlC;AACA,SAAQC,QAAR,QAAuB,cAAvB;;AAQA,MAAMC,sBAAsB,GAAG,CAACC,MAAc,GAAG,EAAlB,KAAyB;EACtD,MAAM;IAACC,SAAS,GAAG,CAAb;IAAgBC,OAAO,GAAG,GAA1B;IAA+BC,QAAQ,GAAG,GAA1C;IAA+CC;EAA/C,IAA8EJ,MAApF;EAAA,MAAoEK,YAApE,iCAAoFL,MAApF;;EACA,MAAMM,UAAU,GAAGT,MAAM,CAAC,IAAIC,QAAQ,CAACS,KAAb,CAAmBN,SAAnB,CAAD,CAAN,CAAsCO,OAAzD;EAEA,MAAMC,SAAS,GAAGb,WAAW,CAAC,MAAM;IAClCE,QAAQ,CAACY,MAAT,CAAgBJ,UAAhB,eACKD,YADL;MAEEH,OAFF;MAGEC,QAHF;MAIEQ,eAAe,EAAE;IAJnB,IAKGC,KALH,CAKS,CAAC;MAACC;IAAD,CAAD,KAAgB;MACvB,IAAIA,QAAJ,EAAc;QACZT,UAAU;MACX;IACF,CATD;EAUD,CAX4B,EAW1B,CAACA,UAAD,EAAaD,QAAb,EAAuBE,YAAvB,EAAqCH,OAArC,EAA8CI,UAA9C,CAX0B,CAA7B;EAaA,OAAO;IAACG,SAAD;IAAYK,SAAS,EAAE;MAACC,SAAS,EAAE,CAAC;QAACT;MAAD,CAAD;IAAZ;EAAvB,CAAP;AACD,CAlBD;;AAoBA,eAAeP,sBAAf"}
@@ -1,14 +0,0 @@
1
- import { Animated } from 'react-native';
2
- declare type Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {
3
- onFadeInFinished?: () => void;
4
- onFadeOutFinished?: () => void;
5
- };
6
- declare const useUpdateOpacity: (params?: Params) => {
7
- fadeIn: () => void;
8
- fadeOut: () => void;
9
- animatedOpacity: {
10
- opacity: Animated.Value;
11
- };
12
- };
13
- export default useUpdateOpacity;
14
- //# sourceMappingURL=use-update-opacity.native.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-update-opacity.native.d.ts","sourceRoot":"","sources":["../../src/behaviours/use-update-opacity.native.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAEtC,aAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,iBAAiB,GAAG,SAAS,CAAC,GAAG;IAClF,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC,CAAC;AAEF,QAAA,MAAM,gBAAgB,YAAY,MAAM;;;;;;CAgCvC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,55 +0,0 @@
1
- const _excluded = ["duration", "onFadeInFinished", "onFadeOutFinished"];
2
-
3
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
-
5
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
-
7
- import { useCallback, useRef } from 'react';
8
- import { Animated } from 'react-native';
9
-
10
- const useUpdateOpacity = (params = {}) => {
11
- const {
12
- duration = 750,
13
- onFadeInFinished,
14
- onFadeOutFinished
15
- } = params,
16
- othersParams = _objectWithoutPropertiesLoose(params, _excluded);
17
-
18
- const fadeAnim = useRef(new Animated.Value(0)).current;
19
- const fadeIn = useCallback(() => {
20
- Animated.timing(fadeAnim, _extends({}, othersParams, {
21
- toValue: 1,
22
- duration,
23
- useNativeDriver: true
24
- })).start(({
25
- finished
26
- }) => {
27
- if (finished) {
28
- onFadeInFinished?.();
29
- }
30
- });
31
- }, [duration, fadeAnim, onFadeInFinished, othersParams]);
32
- const fadeOut = useCallback(() => {
33
- Animated.timing(fadeAnim, _extends({}, othersParams, {
34
- toValue: 0,
35
- duration,
36
- useNativeDriver: true
37
- })).start(({
38
- finished
39
- }) => {
40
- if (finished) {
41
- onFadeOutFinished?.();
42
- }
43
- });
44
- }, [duration, fadeAnim, onFadeOutFinished, othersParams]);
45
- return {
46
- fadeIn,
47
- fadeOut,
48
- animatedOpacity: {
49
- opacity: fadeAnim
50
- }
51
- };
52
- };
53
-
54
- export default useUpdateOpacity;
55
- //# sourceMappingURL=use-update-opacity.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-update-opacity.native.js","names":["useCallback","useRef","Animated","useUpdateOpacity","params","duration","onFadeInFinished","onFadeOutFinished","othersParams","fadeAnim","Value","current","fadeIn","timing","toValue","useNativeDriver","start","finished","fadeOut","animatedOpacity","opacity"],"sources":["../../src/behaviours/use-update-opacity.native.tsx"],"sourcesContent":["import {useCallback, useRef} from 'react';\nimport {Animated} from 'react-native';\n\ntype Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {\n onFadeInFinished?: () => void;\n onFadeOutFinished?: () => void;\n};\n\nconst useUpdateOpacity = (params: Params = {}) => {\n const {duration = 750, onFadeInFinished, onFadeOutFinished, ...othersParams} = params;\n\n const fadeAnim = useRef(new Animated.Value(0)).current;\n\n const fadeIn = useCallback(() => {\n Animated.timing(fadeAnim, {\n ...othersParams,\n toValue: 1,\n duration,\n useNativeDriver: true\n }).start(({finished}) => {\n if (finished) {\n onFadeInFinished?.();\n }\n });\n }, [duration, fadeAnim, onFadeInFinished, othersParams]);\n\n const fadeOut = useCallback(() => {\n Animated.timing(fadeAnim, {\n ...othersParams,\n toValue: 0,\n duration,\n useNativeDriver: true\n }).start(({finished}) => {\n if (finished) {\n onFadeOutFinished?.();\n }\n });\n }, [duration, fadeAnim, onFadeOutFinished, othersParams]);\n\n return {fadeIn, fadeOut, animatedOpacity: {opacity: fadeAnim}};\n};\n\nexport default useUpdateOpacity;\n"],"mappings":";;;;;;AAAA,SAAQA,WAAR,EAAqBC,MAArB,QAAkC,OAAlC;AACA,SAAQC,QAAR,QAAuB,cAAvB;;AAOA,MAAMC,gBAAgB,GAAG,CAACC,MAAc,GAAG,EAAlB,KAAyB;EAChD,MAAM;IAACC,QAAQ,GAAG,GAAZ;IAAiBC,gBAAjB;IAAmCC;EAAnC,IAAyEH,MAA/E;EAAA,MAA+DI,YAA/D,iCAA+EJ,MAA/E;;EAEA,MAAMK,QAAQ,GAAGR,MAAM,CAAC,IAAIC,QAAQ,CAACQ,KAAb,CAAmB,CAAnB,CAAD,CAAN,CAA8BC,OAA/C;EAEA,MAAMC,MAAM,GAAGZ,WAAW,CAAC,MAAM;IAC/BE,QAAQ,CAACW,MAAT,CAAgBJ,QAAhB,eACKD,YADL;MAEEM,OAAO,EAAE,CAFX;MAGET,QAHF;MAIEU,eAAe,EAAE;IAJnB,IAKGC,KALH,CAKS,CAAC;MAACC;IAAD,CAAD,KAAgB;MACvB,IAAIA,QAAJ,EAAc;QACZX,gBAAgB;MACjB;IACF,CATD;EAUD,CAXyB,EAWvB,CAACD,QAAD,EAAWI,QAAX,EAAqBH,gBAArB,EAAuCE,YAAvC,CAXuB,CAA1B;EAaA,MAAMU,OAAO,GAAGlB,WAAW,CAAC,MAAM;IAChCE,QAAQ,CAACW,MAAT,CAAgBJ,QAAhB,eACKD,YADL;MAEEM,OAAO,EAAE,CAFX;MAGET,QAHF;MAIEU,eAAe,EAAE;IAJnB,IAKGC,KALH,CAKS,CAAC;MAACC;IAAD,CAAD,KAAgB;MACvB,IAAIA,QAAJ,EAAc;QACZV,iBAAiB;MAClB;IACF,CATD;EAUD,CAX0B,EAWxB,CAACF,QAAD,EAAWI,QAAX,EAAqBF,iBAArB,EAAwCC,YAAxC,CAXwB,CAA3B;EAaA,OAAO;IAACI,MAAD;IAASM,OAAT;IAAkBC,eAAe,EAAE;MAACC,OAAO,EAAEX;IAAV;EAAnC,CAAP;AACD,CAhCD;;AAkCA,eAAeN,gBAAf"}
@@ -1,16 +0,0 @@
1
- import { Animated } from 'react-native';
2
- declare type Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {
3
- onFinished?: () => void;
4
- fromValue?: number;
5
- toValue?: Animated.TimingAnimationConfig['toValue'];
6
- };
7
- declare const useTranslateVertically: (params?: Params) => {
8
- translate: () => void;
9
- animatedY: {
10
- transform: {
11
- translateY: Animated.Value;
12
- }[];
13
- };
14
- };
15
- export default useTranslateVertically;
16
- //# sourceMappingURL=use-translate-vertically.native.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-translate-vertically.native.d.ts","sourceRoot":"","sources":["../../src/behaviours/use-translate-vertically.native.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAEtC,aAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,iBAAiB,GAAG,SAAS,CAAC,GAAG;IAClF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,QAAQ,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;CACrD,CAAC;AAEF,QAAA,MAAM,sBAAsB,YAAY,MAAM;;;;;;;CAkB7C,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.default = void 0;
5
-
6
- var _react = require("react");
7
-
8
- var _reactNative = require("react-native");
9
-
10
- const _excluded = ["fromValue", "toValue", "duration", "onFinished"];
11
-
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
-
14
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15
-
16
- const useTranslateVertically = (params = {}) => {
17
- const {
18
- fromValue = 0,
19
- toValue = 100,
20
- duration = 550,
21
- onFinished
22
- } = params,
23
- othersParams = _objectWithoutPropertiesLoose(params, _excluded);
24
-
25
- const translateY = (0, _react.useRef)(new _reactNative.Animated.Value(fromValue)).current;
26
- const translate = (0, _react.useCallback)(() => {
27
- _reactNative.Animated.timing(translateY, _extends({}, othersParams, {
28
- toValue,
29
- duration,
30
- useNativeDriver: true
31
- })).start(({
32
- finished
33
- }) => {
34
- if (finished) {
35
- onFinished?.();
36
- }
37
- });
38
- }, [onFinished, duration, othersParams, toValue, translateY]);
39
- return {
40
- translate,
41
- animatedY: {
42
- transform: [{
43
- translateY
44
- }]
45
- }
46
- };
47
- };
48
-
49
- var _default = useTranslateVertically;
50
- exports.default = _default;
51
- //# sourceMappingURL=use-translate-vertically.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-translate-vertically.native.js","names":["useTranslateVertically","params","fromValue","toValue","duration","onFinished","othersParams","translateY","useRef","Animated","Value","current","translate","useCallback","timing","useNativeDriver","start","finished","animatedY","transform"],"sources":["../../src/behaviours/use-translate-vertically.native.tsx"],"sourcesContent":["import {useCallback, useRef} from 'react';\nimport {Animated} from 'react-native';\n\ntype Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {\n onFinished?: () => void;\n fromValue?: number;\n toValue?: Animated.TimingAnimationConfig['toValue'];\n};\n\nconst useTranslateVertically = (params: Params = {}) => {\n const {fromValue = 0, toValue = 100, duration = 550, onFinished, ...othersParams} = params;\n const translateY = useRef(new Animated.Value(fromValue)).current;\n\n const translate = useCallback(() => {\n Animated.timing(translateY, {\n ...othersParams,\n toValue,\n duration,\n useNativeDriver: true\n }).start(({finished}) => {\n if (finished) {\n onFinished?.();\n }\n });\n }, [onFinished, duration, othersParams, toValue, translateY]);\n\n return {translate, animatedY: {transform: [{translateY}]}};\n};\n\nexport default useTranslateVertically;\n"],"mappings":";;;;;AAAA;;AACA;;;;;;;;AAQA,MAAMA,sBAAsB,GAAG,CAACC,MAAc,GAAG,EAAlB,KAAyB;EACtD,MAAM;IAACC,SAAS,GAAG,CAAb;IAAgBC,OAAO,GAAG,GAA1B;IAA+BC,QAAQ,GAAG,GAA1C;IAA+CC;EAA/C,IAA8EJ,MAApF;EAAA,MAAoEK,YAApE,iCAAoFL,MAApF;;EACA,MAAMM,UAAU,GAAG,IAAAC,aAAA,EAAO,IAAIC,qBAAA,CAASC,KAAb,CAAmBR,SAAnB,CAAP,EAAsCS,OAAzD;EAEA,MAAMC,SAAS,GAAG,IAAAC,kBAAA,EAAY,MAAM;IAClCJ,qBAAA,CAASK,MAAT,CAAgBP,UAAhB,eACKD,YADL;MAEEH,OAFF;MAGEC,QAHF;MAIEW,eAAe,EAAE;IAJnB,IAKGC,KALH,CAKS,CAAC;MAACC;IAAD,CAAD,KAAgB;MACvB,IAAIA,QAAJ,EAAc;QACZZ,UAAU;MACX;IACF,CATD;EAUD,CAXiB,EAWf,CAACA,UAAD,EAAaD,QAAb,EAAuBE,YAAvB,EAAqCH,OAArC,EAA8CI,UAA9C,CAXe,CAAlB;EAaA,OAAO;IAACK,SAAD;IAAYM,SAAS,EAAE;MAACC,SAAS,EAAE,CAAC;QAACZ;MAAD,CAAD;IAAZ;EAAvB,CAAP;AACD,CAlBD;;eAoBeP,sB"}
@@ -1,14 +0,0 @@
1
- import { Animated } from 'react-native';
2
- declare type Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {
3
- onFadeInFinished?: () => void;
4
- onFadeOutFinished?: () => void;
5
- };
6
- declare const useUpdateOpacity: (params?: Params) => {
7
- fadeIn: () => void;
8
- fadeOut: () => void;
9
- animatedOpacity: {
10
- opacity: Animated.Value;
11
- };
12
- };
13
- export default useUpdateOpacity;
14
- //# sourceMappingURL=use-update-opacity.native.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-update-opacity.native.d.ts","sourceRoot":"","sources":["../../src/behaviours/use-update-opacity.native.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAEtC,aAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,iBAAiB,GAAG,SAAS,CAAC,GAAG;IAClF,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC,CAAC;AAEF,QAAA,MAAM,gBAAgB,YAAY,MAAM;;;;;;CAgCvC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,62 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.default = void 0;
5
-
6
- var _react = require("react");
7
-
8
- var _reactNative = require("react-native");
9
-
10
- const _excluded = ["duration", "onFadeInFinished", "onFadeOutFinished"];
11
-
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
-
14
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15
-
16
- const useUpdateOpacity = (params = {}) => {
17
- const {
18
- duration = 750,
19
- onFadeInFinished,
20
- onFadeOutFinished
21
- } = params,
22
- othersParams = _objectWithoutPropertiesLoose(params, _excluded);
23
-
24
- const fadeAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
25
- const fadeIn = (0, _react.useCallback)(() => {
26
- _reactNative.Animated.timing(fadeAnim, _extends({}, othersParams, {
27
- toValue: 1,
28
- duration,
29
- useNativeDriver: true
30
- })).start(({
31
- finished
32
- }) => {
33
- if (finished) {
34
- onFadeInFinished?.();
35
- }
36
- });
37
- }, [duration, fadeAnim, onFadeInFinished, othersParams]);
38
- const fadeOut = (0, _react.useCallback)(() => {
39
- _reactNative.Animated.timing(fadeAnim, _extends({}, othersParams, {
40
- toValue: 0,
41
- duration,
42
- useNativeDriver: true
43
- })).start(({
44
- finished
45
- }) => {
46
- if (finished) {
47
- onFadeOutFinished?.();
48
- }
49
- });
50
- }, [duration, fadeAnim, onFadeOutFinished, othersParams]);
51
- return {
52
- fadeIn,
53
- fadeOut,
54
- animatedOpacity: {
55
- opacity: fadeAnim
56
- }
57
- };
58
- };
59
-
60
- var _default = useUpdateOpacity;
61
- exports.default = _default;
62
- //# sourceMappingURL=use-update-opacity.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-update-opacity.native.js","names":["useUpdateOpacity","params","duration","onFadeInFinished","onFadeOutFinished","othersParams","fadeAnim","useRef","Animated","Value","current","fadeIn","useCallback","timing","toValue","useNativeDriver","start","finished","fadeOut","animatedOpacity","opacity"],"sources":["../../src/behaviours/use-update-opacity.native.tsx"],"sourcesContent":["import {useCallback, useRef} from 'react';\nimport {Animated} from 'react-native';\n\ntype Params = Omit<Animated.TimingAnimationConfig, 'useNativeDriver' | 'toValue'> & {\n onFadeInFinished?: () => void;\n onFadeOutFinished?: () => void;\n};\n\nconst useUpdateOpacity = (params: Params = {}) => {\n const {duration = 750, onFadeInFinished, onFadeOutFinished, ...othersParams} = params;\n\n const fadeAnim = useRef(new Animated.Value(0)).current;\n\n const fadeIn = useCallback(() => {\n Animated.timing(fadeAnim, {\n ...othersParams,\n toValue: 1,\n duration,\n useNativeDriver: true\n }).start(({finished}) => {\n if (finished) {\n onFadeInFinished?.();\n }\n });\n }, [duration, fadeAnim, onFadeInFinished, othersParams]);\n\n const fadeOut = useCallback(() => {\n Animated.timing(fadeAnim, {\n ...othersParams,\n toValue: 0,\n duration,\n useNativeDriver: true\n }).start(({finished}) => {\n if (finished) {\n onFadeOutFinished?.();\n }\n });\n }, [duration, fadeAnim, onFadeOutFinished, othersParams]);\n\n return {fadeIn, fadeOut, animatedOpacity: {opacity: fadeAnim}};\n};\n\nexport default useUpdateOpacity;\n"],"mappings":";;;;;AAAA;;AACA;;;;;;;;AAOA,MAAMA,gBAAgB,GAAG,CAACC,MAAc,GAAG,EAAlB,KAAyB;EAChD,MAAM;IAACC,QAAQ,GAAG,GAAZ;IAAiBC,gBAAjB;IAAmCC;EAAnC,IAAyEH,MAA/E;EAAA,MAA+DI,YAA/D,iCAA+EJ,MAA/E;;EAEA,MAAMK,QAAQ,GAAG,IAAAC,aAAA,EAAO,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