@coorpacademy/components 10.30.10-alpha.7 → 10.30.11-alpha.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.
- package/es/atom/picture/index.d.ts +1 -0
- package/es/atom/picture/index.js +5 -4
- package/es/atom/picture/index.js.map +1 -1
- package/es/behaviours/use-translate-vertically.native.d.ts +16 -0
- package/es/behaviours/use-translate-vertically.native.d.ts.map +1 -0
- package/es/behaviours/use-translate-vertically.native.js +44 -0
- package/es/behaviours/use-translate-vertically.native.js.map +1 -0
- package/es/behaviours/use-update-opacity.native.d.ts +14 -0
- package/es/behaviours/use-update-opacity.native.d.ts.map +1 -0
- package/es/behaviours/use-update-opacity.native.js +55 -0
- package/es/behaviours/use-update-opacity.native.js.map +1 -0
- package/es/molecule/card-congrats/index.native.js +2 -2
- package/es/molecule/card-congrats/index.native.js.map +1 -1
- package/es/molecule/card-congrats/types.d.ts +1 -1
- package/es/molecule/card-congrats/types.d.ts.map +1 -1
- package/es/molecule/card-congrats/types.js.map +1 -1
- package/es/molecule/review-correction-popin/index.native.d.ts.map +1 -1
- package/es/molecule/review-correction-popin/index.native.js +12 -25
- package/es/molecule/review-correction-popin/index.native.js.map +1 -1
- package/es/organism/get-the-app/index.d.ts.map +1 -1
- package/es/organism/get-the-app/index.js +15 -2
- package/es/organism/get-the-app/index.js.map +1 -1
- package/es/organism/mooc-footer/index.d.ts.map +1 -1
- package/es/organism/mooc-footer/index.js +3 -2
- package/es/organism/mooc-footer/index.js.map +1 -1
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +0 -2
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/review-congrats/index.native.d.ts.map +1 -1
- package/es/organism/review-congrats/index.native.js +91 -15
- package/es/organism/review-congrats/index.native.js.map +1 -1
- package/es/organism/review-slide/index.native.d.ts.map +1 -1
- package/es/organism/review-slide/index.native.js +10 -22
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/es/organism/review-stacked-slides/index.native.js +17 -4
- package/es/organism/review-stacked-slides/index.native.js.map +1 -1
- package/lib/atom/picture/index.d.ts +1 -0
- package/lib/atom/picture/index.js +5 -4
- package/lib/atom/picture/index.js.map +1 -1
- package/lib/behaviours/use-translate-vertically.native.d.ts +16 -0
- package/lib/behaviours/use-translate-vertically.native.d.ts.map +1 -0
- package/lib/behaviours/use-translate-vertically.native.js +51 -0
- package/lib/behaviours/use-translate-vertically.native.js.map +1 -0
- package/lib/behaviours/use-update-opacity.native.d.ts +14 -0
- package/lib/behaviours/use-update-opacity.native.d.ts.map +1 -0
- package/lib/behaviours/use-update-opacity.native.js +62 -0
- package/lib/behaviours/use-update-opacity.native.js.map +1 -0
- package/lib/molecule/card-congrats/index.native.js +2 -2
- package/lib/molecule/card-congrats/index.native.js.map +1 -1
- package/lib/molecule/card-congrats/types.d.ts +1 -1
- package/lib/molecule/card-congrats/types.d.ts.map +1 -1
- package/lib/molecule/card-congrats/types.js.map +1 -1
- package/lib/molecule/review-correction-popin/index.native.d.ts.map +1 -1
- package/lib/molecule/review-correction-popin/index.native.js +12 -24
- package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
- package/lib/organism/get-the-app/index.d.ts.map +1 -1
- package/lib/organism/get-the-app/index.js +16 -2
- package/lib/organism/get-the-app/index.js.map +1 -1
- package/lib/organism/mooc-footer/index.d.ts.map +1 -1
- package/lib/organism/mooc-footer/index.js +4 -2
- package/lib/organism/mooc-footer/index.js.map +1 -1
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +0 -2
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/review-congrats/index.native.d.ts.map +1 -1
- package/lib/organism/review-congrats/index.native.js +91 -13
- package/lib/organism/review-congrats/index.native.js.map +1 -1
- package/lib/organism/review-slide/index.native.d.ts.map +1 -1
- package/lib/organism/review-slide/index.native.js +10 -21
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.js +21 -3
- package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","congrats","position","width","height","backgroundColor","flexDirection","alignItems","paddingVertical","flex","buttons","paddingHorizontal","justifyContent","title","fontWeight","fontSize","lineHeight","marginVertical","color","colors","text","primary","confettis","flexGrow","pointerEvents","ReviewCongrats","props","ariaLabel","animationLottie","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_stylesheet","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","RankIcon","positive","StarIcon","battle","label","BOX_STYLE","uri"],"sources":["../../../src/organism/review-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {ScrollView, StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {noop} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaSolidVoteRewardsRewardsBadge5 as RankIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport CardCongrats from '../../molecule/card-congrats/index.native';\nimport {ReviewCongratsProps} from './prop-types';\n\ntype StyleSheetType = {\n buttons: ViewStyle;\n congrats: ViewStyle;\n confettis: ViewStyle;\n title: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n congrats: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n backgroundColor: '#ededed',\n flexDirection: 'column',\n alignItems: 'center',\n paddingVertical: 90,\n flex: 1\n },\n buttons: {\n width: '100%',\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'space-between',\n flex: 1\n },\n title: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n marginVertical: 20,\n color: theme.colors.text.primary\n },\n confettis: {\n flexGrow: 1,\n position: 'absolute',\n width: '100%',\n height: '100%',\n pointerEvents: 'box-none'\n }\n });\n\nconst ReviewCongrats = (props: ReviewCongratsProps) => {\n const {\n 'aria-label': ariaLabel,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const {theme} = useTemplateContext();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n const handleContinueRevisingPress = buttonRevising?.onClick || noop;\n const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || noop;\n\n return (\n <View style={styleSheet.congrats} accessibilityLabel={ariaLabel}>\n <Text style={styleSheet.title}>{title}</Text>\n <ScrollView showsHorizontalScrollIndicator={false} horizontal style={{height: 300}}>\n {cardCongratsRank ? (\n <CardCongrats\n animationUri={cardCongratsRank.animationLottie.animationSrc}\n text={cardCongratsRank.reviewCardTitle}\n value={`${cardCongratsRank.reviewCardValue} ${cardCongratsRank.rankSuffix}`}\n Icon={RankIcon}\n iconColor={theme.colors.positive}\n textColor={theme.colors.text.primary}\n direction=\"row-reverse\"\n />\n ) : null}\n <CardCongrats\n animationUri={cardCongratsStar.animationLottie.animationSrc}\n Icon={StarIcon}\n text={cardCongratsStar.reviewCardTitle}\n value={cardCongratsStar.reviewCardValue}\n iconColor={theme.colors.battle}\n textColor={theme.colors.battle}\n direction=\"row\"\n />\n </ScrollView>\n\n <View style={styleSheet.buttons}>\n {buttonRevisingSkill ? (\n <Button\n onPress={handleReviseAnotherSkillPress}\n accessibilityLabel={buttonRevisingSkill['aria-label']}\n submitValue={buttonRevisingSkill.label}\n style={{...BOX_STYLE, backgroundColor: '#fff'}}\n textStyle={{color: '#123'}}\n />\n ) : null}\n {buttonRevising ? (\n <Button\n onPress={handleContinueRevisingPress}\n accessibilityLabel={buttonRevising['aria-label']}\n submitValue={buttonRevising.label}\n />\n ) : null}\n </View>\n\n <View pointerEvents=\"none\" style={styleSheet.confettis}>\n <LottieView source={{uri: animationLottie.animationSrc}} autoPlay loop={false} />\n </View>\n </View>\n );\n};\n\nexport default ReviewCongrats;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAKA;;AAEA;;AACA;;AACA;;;;;;;;;;AAUA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,QAAQ,EAAE;IACRC,QAAQ,EAAE,UADF;IAERC,KAAK,EAAE,MAFC;IAGRC,MAAM,EAAE,MAHA;IAIRC,eAAe,EAAE,SAJT;IAKRC,aAAa,EAAE,QALP;IAMRC,UAAU,EAAE,QANJ;IAORC,eAAe,EAAE,EAPT;IAQRC,IAAI,EAAE;EARE,CADM;EAWhBC,OAAO,EAAE;IACPP,KAAK,EAAE,MADA;IAEPQ,iBAAiB,EAAE,EAFZ;IAGPL,aAAa,EAAE,QAHR;IAIPM,cAAc,EAAE,eAJT;IAKPH,IAAI,EAAE;EALC,CAXO;EAkBhBI,KAAK,EAAE;IACLC,UAAU,EAAE,KADP;IAELC,QAAQ,EAAE,EAFL;IAGLC,UAAU,EAAE,EAHP;IAILC,cAAc,EAAE,EAJX;IAKLC,KAAK,EAAEpB,KAAK,CAACqB,MAAN,CAAaC,IAAb,CAAkBC;EALpB,CAlBS;EAyBhBC,SAAS,EAAE;IACTC,QAAQ,EAAE,CADD;IAETrB,QAAQ,EAAE,UAFD;IAGTC,KAAK,EAAE,MAHE;IAITC,MAAM,EAAE,MAJC;IAKToB,aAAa,EAAE;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{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","congrats","position","width","height","flexDirection","alignItems","paddingVertical","flex","buttons","paddingHorizontal","justifyContent","title","fontWeight","fontSize","lineHeight","marginVertical","color","colors","text","primary","confettis","flexGrow","pointerEvents","scrollView","scrollViewContent","ReviewCongrats","props","ariaLabel","animationLottie","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","useTemplateContext","windowHeight","useWindowDimensions","styleSheet","setStylesheet","useState","isCongratsTranslationDone","setCongratsTranslationDone","isRankShown","setRankShown","translate","translateCongratsUp","animatedY","animatedCongratsY","useTranslateVertically","fromValue","toValue","delay","onFinished","translateRankUp","animatedRankY","duration","fadeIn","showRank","animatedOpacity","animatedRankOpacity","useUpdateOpacity","onFadeInFinished","scrollViewRef","useRef","translateStarsUp","animatedStarsY","showStars","animatedStarsOpacity","useEffect","_stylesheet","current","scrollToEnd","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","RankIcon","positive","StarIcon","battle","label","BOX_STYLE","backgroundColor","uri"],"sources":["../../../src/organism/review-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {\n Animated,\n ScrollView,\n StyleSheet,\n Text,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {noop} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaSolidVoteRewardsRewardsBadge5 as RankIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport CardCongrats from '../../molecule/card-congrats/index.native';\nimport useTranslateVertically from '../../behaviours/use-translate-vertically.native';\nimport useUpdateOpacity from '../../behaviours/use-update-opacity.native';\nimport {ReviewCongratsProps} from './prop-types';\n\ntype StyleSheetType = {\n buttons: ViewStyle;\n congrats: ViewStyle;\n confettis: ViewStyle;\n scrollView: ViewStyle;\n scrollViewContent: ViewStyle;\n title: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n congrats: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n alignItems: 'center',\n paddingVertical: 90,\n flex: 1\n },\n buttons: {\n width: '100%',\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'space-between',\n flex: 1\n },\n title: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n marginVertical: 20,\n color: theme.colors.text.primary\n },\n confettis: {\n flexGrow: 1,\n position: 'absolute',\n width: '100%',\n height: '100%',\n pointerEvents: 'box-none'\n },\n scrollView: {\n height: 300\n },\n scrollViewContent: {\n alignItems: 'center',\n paddingHorizontal: 40\n }\n });\n\nconst ReviewCongrats = (props: ReviewCongratsProps) => {\n const {\n 'aria-label': ariaLabel,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const {theme} = useTemplateContext();\n const {height: windowHeight} = useWindowDimensions();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [isCongratsTranslationDone, setCongratsTranslationDone] = useState<boolean>(false);\n const [isRankShown, setRankShown] = useState<boolean>(false);\n\n const {translate: translateCongratsUp, animatedY: animatedCongratsY} = useTranslateVertically({\n fromValue: windowHeight,\n toValue: 0,\n delay: 750,\n onFinished: () => {\n setCongratsTranslationDone(true);\n }\n });\n\n const {translate: translateRankUp, animatedY: animatedRankY} = useTranslateVertically({\n fromValue: 150,\n duration: 750,\n toValue: 0\n });\n\n const {fadeIn: showRank, animatedOpacity: animatedRankOpacity} = useUpdateOpacity({\n onFadeInFinished: () => {\n setRankShown(true);\n }\n });\n\n const scrollViewRef = useRef<ScrollView>(null);\n\n const {translate: translateStarsUp, animatedY: animatedStarsY} = useTranslateVertically({\n fromValue: 150,\n toValue: 0,\n duration: 750,\n delay: 250\n });\n\n const {fadeIn: showStars, animatedOpacity: animatedStarsOpacity} = useUpdateOpacity({\n delay: 250\n });\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n useEffect(() => {\n translateCongratsUp();\n }, []);\n\n useEffect(() => {\n if (isCongratsTranslationDone) {\n showRank();\n translateRankUp();\n }\n }, [isCongratsTranslationDone, showRank, translateRankUp]);\n\n useEffect(() => {\n if (isRankShown) {\n scrollViewRef?.current?.scrollToEnd();\n translateStarsUp();\n showStars();\n }\n }, [isRankShown, translateStarsUp, showStars]);\n\n if (!styleSheet) {\n return null;\n }\n\n const handleContinueRevisingPress = buttonRevising?.onClick || noop;\n const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || noop;\n\n return (\n <Animated.View style={[styleSheet.congrats, animatedCongratsY]} accessibilityLabel={ariaLabel}>\n <Text style={styleSheet.title}>{title}</Text>\n <ScrollView\n ref={scrollViewRef}\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styleSheet.scrollView}\n contentContainerStyle={styleSheet.scrollViewContent}\n >\n {cardCongratsRank ? (\n <Animated.View style={[animatedRankOpacity, animatedRankY]}>\n <CardCongrats\n animationUri={cardCongratsRank.animationLottie.animationSrc}\n text={cardCongratsRank.reviewCardTitle}\n value={`${cardCongratsRank.reviewCardValue} ${cardCongratsRank.rankSuffix}`}\n Icon={RankIcon}\n iconColor={theme.colors.positive}\n textColor={theme.colors.text.primary}\n direction=\"row-reverse\"\n />\n </Animated.View>\n ) : null}\n <Animated.View style={[animatedStarsOpacity, animatedStarsY]}>\n <CardCongrats\n animationUri={isRankShown ? cardCongratsStar.animationLottie.animationSrc : null}\n Icon={StarIcon}\n text={cardCongratsStar.reviewCardTitle}\n value={cardCongratsStar.reviewCardValue}\n iconColor={theme.colors.battle}\n textColor={theme.colors.battle}\n direction=\"row\"\n />\n </Animated.View>\n </ScrollView>\n\n <View style={styleSheet.buttons}>\n {buttonRevisingSkill ? (\n <Button\n onPress={handleReviseAnotherSkillPress}\n accessibilityLabel={buttonRevisingSkill['aria-label']}\n submitValue={buttonRevisingSkill.label}\n style={{...BOX_STYLE, backgroundColor: '#fff'}}\n textStyle={{color: '#123'}}\n />\n ) : null}\n {buttonRevising ? (\n <Button\n onPress={handleContinueRevisingPress}\n accessibilityLabel={buttonRevising['aria-label']}\n submitValue={buttonRevising.label}\n />\n ) : null}\n </View>\n\n {isCongratsTranslationDone ? (\n <View pointerEvents=\"none\" style={styleSheet.confettis}>\n <LottieView source={{uri: animationLottie.animationSrc}} autoPlay loop={false} />\n </View>\n ) : null}\n </Animated.View>\n );\n};\n\nexport default ReviewCongrats;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAUA;;AAEA;;AAKA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAYA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,QAAQ,EAAE;IACRC,QAAQ,EAAE,UADF;IAERC,KAAK,EAAE,MAFC;IAGRC,MAAM,EAAE,MAHA;IAIRC,aAAa,EAAE,QAJP;IAKRC,UAAU,EAAE,QALJ;IAMRC,eAAe,EAAE,EANT;IAORC,IAAI,EAAE;EAPE,CADM;EAUhBC,OAAO,EAAE;IACPN,KAAK,EAAE,MADA;IAEPO,iBAAiB,EAAE,EAFZ;IAGPL,aAAa,EAAE,QAHR;IAIPM,cAAc,EAAE,eAJT;IAKPH,IAAI,EAAE;EALC,CAVO;EAiBhBI,KAAK,EAAE;IACLC,UAAU,EAAE,KADP;IAELC,QAAQ,EAAE,EAFL;IAGLC,UAAU,EAAE,EAHP;IAILC,cAAc,EAAE,EAJX;IAKLC,KAAK,EAAEnB,KAAK,CAACoB,MAAN,CAAaC,IAAb,CAAkBC;EALpB,CAjBS;EAwBhBC,SAAS,EAAE;IACTC,QAAQ,EAAE,CADD;IAETp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AiC8C,YAApC,GAAmD,IAD9E;IAEE,IAAI,EAAEM,0CAFR;IAGE,IAAI,EAAEnD,gBAAgB,CAAC8C,eAHzB;IAIE,KAAK,EAAE9C,gBAAgB,CAAC+C,eAJ1B;IAKE,SAAS,EAAE/E,KAAK,CAACoB,MAAN,CAAagE,MAL1B;IAME,SAAS,EAAEpF,KAAK,CAACoB,MAAN,CAAagE,MAN1B;IAOE,SAAS,EAAC;EAPZ,EADF,CApBF,CAFF,eAmCE,6BAAC,iBAAD;IAAM,KAAK,EAAE7C,UAAU,CAAC5B;EAAxB,GACGwB,mBAAmB,gBAClB,6BAAC,cAAD;IACE,OAAO,EAAEyC,6BADX;IAEE,kBAAkB,EAAEzC,mBAAmB,CAAC,YAAD,CAFzC;IAGE,WAAW,EAAEA,mBAAmB,CAACkD,KAHnC;IAIE,KAAK,eAAMC,iBAAN;MAAiBC,eAAe,EAAE;IAAlC,EAJP;IAKE,SAAS,EAAE;MAACpE,KAAK,EAAE;IAAR;EALb,EADkB,GAQhB,IATN,EAUGe,cAAc,gBACb,6BAAC,cAAD;IACE,OAAO,EAAEwC,2BADX;IAEE,kBAAkB,EAAExC,cAAc,CAAC,YAAD,CAFpC;IAGE,WAAW,EAAEA,cAAc,CAACmD;EAH9B,EADa,GAMX,IAhBN,CAnCF,EAsDG3C,yBAAyB,gBACxB,6BAAC,iBAAD;IAAM,aAAa,EAAC,MAApB;IAA2B,KAAK,EAAEH,UAAU,CAAChB;EAA7C,gBACE,6BAAC,0BAAD;IAAY,MAAM,EAAE;MAACiE,GAAG,EAAEzD,eAAe,CAAC8C;IAAtB,CAApB;IAAyD,QAAQ,MAAjE;IAAkE,IAAI,EAAE;EAAxE,EADF,CADwB,GAItB,IA1DN,CADF;AA8DD,CAjJD;;eAmJejD,c"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;AA6JtE,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBA8CrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -21,14 +21,14 @@ var _templateContext = require("../../template/app-review/template-context");
|
|
|
21
21
|
|
|
22
22
|
var _index4 = _interopRequireDefault(require("../../atom/button/index.native"));
|
|
23
23
|
|
|
24
|
+
var _useTranslateVertically = _interopRequireDefault(require("../../behaviours/use-translate-vertically.native"));
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
26
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
29
|
|
|
28
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
31
|
|
|
30
|
-
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); }
|
|
31
|
-
|
|
32
32
|
const styles = _reactNative.StyleSheet.create({
|
|
33
33
|
correctionPopinWrapper: {
|
|
34
34
|
position: 'absolute',
|
|
@@ -43,20 +43,12 @@ const CorrectionPopin = ({
|
|
|
43
43
|
showCorrectionPopin,
|
|
44
44
|
animateCorrectionPopin
|
|
45
45
|
}) => {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
useNativeDriver: true
|
|
53
|
-
}).start();
|
|
54
|
-
}, [translateAnim]);
|
|
55
|
-
|
|
56
|
-
if (animateCorrectionPopin) {
|
|
57
|
-
translateYAnim();
|
|
58
|
-
}
|
|
59
|
-
|
|
46
|
+
const translateUp = (0, _useTranslateVertically.default)({
|
|
47
|
+
fromValue: 1000,
|
|
48
|
+
toValue: 0,
|
|
49
|
+
duration: 800,
|
|
50
|
+
easing: _reactNative.Easing.bezier(0.37, 0, 0.63, 1)
|
|
51
|
+
});
|
|
60
52
|
if (!showCorrectionPopin) return null;
|
|
61
53
|
const klf = (0, _getOr.default)(undefined, 'klf', correctionPopinProps);
|
|
62
54
|
const information = (0, _getOr.default)({
|
|
@@ -77,12 +69,9 @@ const CorrectionPopin = ({
|
|
|
77
69
|
type: correctionPopinProps.type,
|
|
78
70
|
resultLabel: correctionPopinProps.resultLabel
|
|
79
71
|
};
|
|
72
|
+
const style = animateCorrectionPopin ? [styles.correctionPopinWrapper, translateUp.animatedY] : styles.correctionPopinWrapper;
|
|
80
73
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
81
|
-
style:
|
|
82
|
-
transform: [{
|
|
83
|
-
translateY: translateAnim
|
|
84
|
-
}]
|
|
85
|
-
})
|
|
74
|
+
style: style
|
|
86
75
|
}, /*#__PURE__*/_react.default.createElement(_index3.default, _correctionPopinProps));
|
|
87
76
|
};
|
|
88
77
|
|
|
@@ -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,IAAI,CAACP,mBAAL,EAA0B,OAAO,IAAP;EAE1B,MAAMiB,GAAG,GAAG,IAAAC,cAAA,EAAMC,SAAN,EAAiB,KAAjB,EAAwBrB,oBAAxB,CAAZ;EACA,MAAMsB,WAAW,GAA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A,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,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;A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AJ9C,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":";
|
|
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 =
|
|
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,
|
|
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.
|
|
3
|
+
"version": "10.30.11-alpha.1+61044cb2d",
|
|
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": "
|
|
161
|
+
"gitHead": "61044cb2dd65dc401f0bca3b2694d2d59719d8d1"
|
|
162
162
|
}
|