@coorpacademy/components 11.2.7-alpha.3 → 11.2.8
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/html/index.native.d.ts.map +1 -1
- package/es/atom/html/index.native.js +3 -3
- package/es/atom/html/index.native.js.map +1 -1
- package/es/atom/review-presentation/index.d.ts.map +1 -1
- package/es/atom/review-presentation/index.js +5 -9
- package/es/atom/review-presentation/index.js.map +1 -1
- package/es/atom/review-presentation/index.native.js.map +1 -1
- package/es/atom/review-presentation/prop-types.d.ts +9 -11
- package/es/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/es/atom/review-presentation/prop-types.js +1 -2
- package/es/atom/review-presentation/prop-types.js.map +1 -1
- package/es/atom/select-modal/index.native.d.ts +1 -1
- package/es/atom/select-modal/index.native.d.ts.map +1 -1
- package/es/atom/select-modal/index.native.js +5 -2
- package/es/atom/select-modal/index.native.js.map +1 -1
- package/es/molecule/filters/index.d.ts +2 -0
- package/es/molecule/filters/index.d.ts.map +1 -1
- package/es/molecule/filters/index.js +10 -4
- package/es/molecule/filters/index.js.map +1 -1
- package/es/molecule/questions/mobile/template/index.native.d.ts.map +1 -1
- package/es/molecule/questions/mobile/template/index.native.js +0 -13
- package/es/molecule/questions/mobile/template/index.native.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 +4 -3
- package/es/molecule/review-correction-popin/index.native.js.map +1 -1
- package/es/organism/mooc-footer/index.d.ts +1 -0
- package/es/organism/mooc-footer/index.d.ts.map +1 -1
- package/es/organism/mooc-footer/index.js +3 -1
- 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 +4 -3
- 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 +6 -5
- 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 +3 -1
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/organism/review-stacked-slides/index.native.d.ts +0 -1
- package/es/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/es/organism/review-stacked-slides/index.native.js +37 -32
- package/es/organism/review-stacked-slides/index.native.js.map +1 -1
- package/es/template/activity/stars-summary.css +2 -0
- package/es/template/activity/stars-summary.js +2 -2
- package/es/template/activity/stars-summary.js.map +1 -1
- package/es/template/app-review/index.d.ts +0 -4
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +0 -4
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/common/search-page/index.d.ts +4 -0
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +10 -3
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/review-dashboard-skills/index.d.ts +0 -4
- package/lib/atom/html/index.native.d.ts.map +1 -1
- package/lib/atom/html/index.native.js +2 -2
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/atom/review-presentation/index.d.ts.map +1 -1
- package/lib/atom/review-presentation/index.js +5 -9
- package/lib/atom/review-presentation/index.js.map +1 -1
- package/lib/atom/review-presentation/index.native.js.map +1 -1
- package/lib/atom/review-presentation/prop-types.d.ts +9 -11
- package/lib/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/lib/atom/review-presentation/prop-types.js +1 -2
- package/lib/atom/review-presentation/prop-types.js.map +1 -1
- package/lib/atom/select-modal/index.native.d.ts +1 -1
- package/lib/atom/select-modal/index.native.d.ts.map +1 -1
- package/lib/atom/select-modal/index.native.js +5 -2
- package/lib/atom/select-modal/index.native.js.map +1 -1
- package/lib/molecule/filters/index.d.ts +2 -0
- package/lib/molecule/filters/index.d.ts.map +1 -1
- package/lib/molecule/filters/index.js +10 -4
- package/lib/molecule/filters/index.js.map +1 -1
- package/lib/molecule/questions/mobile/template/index.native.d.ts.map +1 -1
- package/lib/molecule/questions/mobile/template/index.native.js +0 -13
- package/lib/molecule/questions/mobile/template/index.native.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 +4 -3
- package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
- package/lib/organism/mooc-footer/index.d.ts +1 -0
- package/lib/organism/mooc-footer/index.d.ts.map +1 -1
- package/lib/organism/mooc-footer/index.js +3 -1
- 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 +4 -3
- 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 +6 -5
- 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 +3 -1
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.d.ts +0 -1
- package/lib/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.js +38 -34
- package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
- package/lib/template/activity/stars-summary.css +2 -0
- package/lib/template/activity/stars-summary.js +2 -2
- package/lib/template/activity/stars-summary.js.map +1 -1
- package/lib/template/app-review/index.d.ts +0 -4
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +0 -4
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/common/search-page/index.d.ts +4 -0
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +10 -3
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/review-dashboard-skills/index.d.ts +0 -4
- package/locales/.mtslconfig.json +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","congrats","position","width","height","flexDirection","alignItems","paddingVertical","flex","buttons","paddingHorizontal","justifyContent","title","fontWeight","fontSize","lineHeight","marginVertical","color","colors","text","primary","confettis","flexGrow","pointerEvents","scrollView","scrollViewContent","fadeIn","property","fromValue","toValue","duration","translateHorizontally","ReviewCongrats","props","ariaLabel","animationLottie","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","useTemplateContext","styleSheet","setStylesheet","useState","isCongratsTranslationDone","setCongratsTranslationDone","isRankShown","setRankShown","scrollViewRef","useRef","showCongrats","useAnimateProp","onComplete","translateCongrats","useTranslateY","showConfettis","fadeInRank","translateRank","useTranslateX","setTimeout","current","scrollToEnd","animatedRank","animatedStyle","fadeInStars","delay","translateStars","showButton1","showButton2","congratsSequence","sequence","parallel","useEffect","start","_stylesheet","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","RankIcon","positive","StarIcon","battle","label","BOX_STYLE","backgroundColor","uri"],"sources":["../../../src/organism/review-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {Animated, ScrollView, StyleSheet, Text, TextStyle, ViewStyle} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {noop} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaSolidVoteRewardsRewardsBadge5 as RankIcon\n} from '@coorpacademy/nova-icons';\nimport {\n sequence,\n parallel,\n useAnimateProp,\n useTranslateY,\n useTranslateX\n} from '@coorpacademy/react-native-animation';\nimport type {AnimatePropParams} from '@coorpacademy/react-native-animation/es/use-animate-prop';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport CardCongrats from '../../molecule/card-congrats/index.native';\nimport {ReviewCongratsProps} from './prop-types';\n\ntype StyleSheetType = {\n buttons: ViewStyle;\n congrats: ViewStyle;\n confettis: ViewStyle;\n scrollView: ViewStyle;\n scrollViewContent: ViewStyle;\n title: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n congrats: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n alignItems: 'center',\n paddingVertical: 90,\n flex: 1\n },\n buttons: {\n width: '100%',\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'space-between',\n flex: 1\n },\n title: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n marginVertical: 20,\n color: theme.colors.text.primary\n },\n confettis: {\n flexGrow: 1,\n position: 'absolute',\n width: '100%',\n height: '100%',\n pointerEvents: 'box-none'\n },\n scrollView: {\n height: 300\n },\n scrollViewContent: {\n alignItems: 'center',\n paddingHorizontal: 40\n }\n });\n\nconst fadeIn: AnimatePropParams = {\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 350\n};\n\nconst translateHorizontally = {\n property: 'translateX',\n fromValue: 180,\n toValue: 0,\n duration: 800\n};\n\nconst ReviewCongrats = (props: ReviewCongratsProps) => {\n const {\n 'aria-label': ariaLabel,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const {theme} = useTemplateContext();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [isCongratsTranslationDone, setCongratsTranslationDone] = useState<boolean>(false);\n const [isRankShown, setRankShown] = useState<boolean>(false);\n\n const scrollViewRef = useRef<ScrollView>(null);\n\n const showCongrats = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 950,\n onComplete: () => {\n setCongratsTranslationDone(true);\n }\n });\n\n const translateCongrats = useTranslateY({\n fromValue: 100,\n toValue: 0,\n duration: 550\n });\n\n const showConfettis = useAnimateProp(fadeIn);\n const fadeInRank = useAnimateProp(fadeIn);\n const translateRank = useTranslateX({\n ...translateHorizontally,\n onComplete: () => {\n setRankShown(true);\n setTimeout(() => {\n scrollViewRef?.current?.scrollToEnd();\n }, 700);\n }\n });\n\n const animatedRank = [fadeInRank.animatedStyle, translateRank.animatedStyle];\n\n const fadeInStars = useAnimateProp({\n ...fadeIn,\n delay: 1000\n });\n\n const translateStars = useTranslateX({\n ...translateHorizontally,\n delay: 1000\n });\n\n const showButton1 = useAnimateProp(fadeIn);\n const showButton2 = useAnimateProp(fadeIn);\n\n const congratsSequence = sequence([\n parallel([showCongrats, translateCongrats]),\n parallel([showConfettis, fadeInRank, translateRank]),\n parallel([fadeInStars, translateStars]),\n sequence([showButton1, showButton2])\n ]);\n\n useEffect(() => {\n congratsSequence.start();\n // (required only once on mount)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n const handleContinueRevisingPress = buttonRevising?.onClick || noop;\n const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || noop;\n\n return (\n <Animated.View\n style={[styleSheet.congrats, translateCongrats.animatedStyle, showCongrats.animatedStyle]}\n accessibilityLabel={ariaLabel}\n >\n <Text style={styleSheet.title}>{title}</Text>\n <ScrollView\n ref={scrollViewRef}\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styleSheet.scrollView}\n contentContainerStyle={styleSheet.scrollViewContent}\n >\n {cardCongratsRank ? (\n <Animated.View style={animatedRank}>\n <CardCongrats\n animationUri={cardCongratsRank.animationLottie.animationSrc}\n text={cardCongratsRank.reviewCardTitle}\n value={`${cardCongratsRank.reviewCardValue} ${cardCongratsRank.rankSuffix}`}\n Icon={RankIcon}\n iconColor={theme.colors.positive}\n textColor={theme.colors.text.primary}\n direction=\"row-reverse\"\n />\n </Animated.View>\n ) : null}\n <Animated.View style={[fadeInStars.animatedStyle, translateStars.animatedStyle]}>\n <CardCongrats\n animationUri={isRankShown ? cardCongratsStar.animationLottie.animationSrc : null}\n Icon={StarIcon}\n text={cardCongratsStar.reviewCardTitle}\n value={cardCongratsStar.reviewCardValue}\n iconColor={theme.colors.battle}\n textColor={theme.colors.battle}\n direction=\"row\"\n />\n </Animated.View>\n </ScrollView>\n\n <Animated.View style={styleSheet.buttons}>\n {buttonRevisingSkill ? (\n <Animated.View style={showButton1.animatedStyle}>\n <Button\n onPress={handleReviseAnotherSkillPress}\n accessibilityLabel={buttonRevisingSkill['aria-label']}\n submitValue={buttonRevisingSkill.label}\n style={{...BOX_STYLE, backgroundColor: '#fff'}}\n textStyle={{color: '#123'}}\n />\n </Animated.View>\n ) : null}\n {buttonRevising ? (\n <Animated.View style={showButton2.animatedStyle}>\n <Button\n onPress={handleContinueRevisingPress}\n accessibilityLabel={buttonRevising['aria-label']}\n submitValue={buttonRevising.label}\n />\n </Animated.View>\n ) : null}\n </Animated.View>\n\n {isCongratsTranslationDone ? (\n <Animated.View\n pointerEvents=\"none\"\n style={[styleSheet.confettis, showConfettis.animatedStyle]}\n >\n <LottieView source={{uri: animationLottie.animationSrc}} autoPlay loop={false} />\n </Animated.View>\n ) : null}\n </Animated.View>\n );\n};\n\nexport default ReviewCongrats;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AASA;;AAEA;;AACA;;AACA;;;;;;;;;;AAYA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,QAAQ,EAAE;IACRC,QAAQ,EAAE,UADF;IAERC,KAAK,EAAE,MAFC;IAGRC,MAAM,EAAE,MAHA;IAIRC,aAAa,EAAE,QAJP;IAKRC,UAAU,EAAE,QALJ;IAMRC,eAAe,EAAE,EANT;IAORC,IAAI,EAAE;EAPE,CADM;EAUhBC,OAAO,EAAE;IACPN,KAAK,EAAE,MADA;IAEPO,iBAAiB,EAAE,EAFZ;IAGPL,aAAa,E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C;IAGE,WAAW,EAAEA,mBAAmB,CAAC+C,KAHnC;IAIE,KAAK,eAAMC,iBAAN;MAAiBC,eAAe,EAAE;IAAlC,EAJP;IAKE,SAAS,EAAE;MAACvE,KAAK,EAAE;IAAR;EALb,EADF,CADkB,GAUhB,IAXN,EAYGqB,cAAc,gBACb,6BAAC,qBAAD,CAAU,IAAV;IAAe,KAAK,EAAE8B,WAAW,CAACL;EAAlC,gBACE,6BAAC,cAAD;IACE,OAAO,EAAEY,2BADX;IAEE,kBAAkB,EAAErC,cAAc,CAAC,YAAD,CAFpC;IAGE,WAAW,EAAEA,cAAc,CAACgD;EAH9B,EADF,CADa,GAQX,IApBN,CAtCF,EA6DG1C,yBAAyB,gBACxB,6BAAC,qBAAD,CAAU,IAAV;IACE,aAAa,EAAC,MADhB;IAEE,KAAK,EAAE,CAACH,UAAU,CAACpB,SAAZ,EAAuBkC,aAAa,CAACQ,aAArC;EAFT,gBAIE,6BAAC,0BAAD;IAAY,MAAM,EAAE;MAAC0B,GAAG,EAAEtD,eAAe,CAAC2C;IAAtB,CAApB;IAAyD,QAAQ,MAAjE;IAAkE,IAAI,EAAE;EAAxE,EAJF,CADwB,GAOtB,IApEN,CADF;AAwED,CA/JD;;eAiKe9C,c"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","congrats","position","width","height","flexDirection","alignItems","paddingVertical","flex","buttons","paddingHorizontal","justifyContent","title","fontWeight","fontSize","lineHeight","marginVertical","color","colors","text","primary","confettis","flexGrow","pointerEvents","scrollView","scrollViewContent","fadeIn","property","fromValue","toValue","duration","translateHorizontally","ReviewCongrats","props","ariaLabel","animationLottie","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","useTemplateContext","styleSheet","setStylesheet","useState","isCongratsTranslationDone","setCongratsTranslationDone","isRankShown","setRankShown","scrollViewRef","useRef","showCongrats","useAnimateProp","onComplete","translateCongrats","useTranslateY","showConfettis","fadeInRank","translateRank","useTranslateX","setTimeout","current","scrollToEnd","animatedRank","animatedStyle","fadeInStars","delay","translateStars","showButton1","showButton2","congratsSequence","sequence","parallel","useEffect","start","_stylesheet","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","showStarLottieAnimation","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","RankIcon","positive","StarIcon","battle","label","BOX_STYLE","backgroundColor","uri"],"sources":["../../../src/organism/review-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {Animated, ScrollView, StyleSheet, Text, TextStyle, ViewStyle} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {noop} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaSolidVoteRewardsRewardsBadge5 as RankIcon\n} from '@coorpacademy/nova-icons';\nimport {\n sequence,\n parallel,\n useAnimateProp,\n useTranslateY,\n useTranslateX\n} from '@coorpacademy/react-native-animation';\nimport type {AnimatePropParams} from '@coorpacademy/react-native-animation/es/use-animate-prop';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport CardCongrats from '../../molecule/card-congrats/index.native';\nimport {ReviewCongratsProps} from './prop-types';\n\ntype StyleSheetType = {\n buttons: ViewStyle;\n congrats: ViewStyle;\n confettis: ViewStyle;\n scrollView: ViewStyle;\n scrollViewContent: ViewStyle;\n title: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n congrats: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n alignItems: 'center',\n paddingVertical: 90,\n flex: 1\n },\n buttons: {\n width: '100%',\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'space-between',\n height: 114\n },\n title: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n marginVertical: 20,\n color: theme.colors.text.primary\n },\n confettis: {\n flexGrow: 1,\n position: 'absolute',\n width: '100%',\n height: '100%',\n pointerEvents: 'box-none'\n },\n scrollView: {\n height: 300\n },\n scrollViewContent: {\n alignItems: 'center',\n paddingHorizontal: 40\n }\n });\n\nconst fadeIn: AnimatePropParams = {\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 350\n};\n\nconst translateHorizontally = {\n property: 'translateX',\n fromValue: 180,\n toValue: 0,\n duration: 800\n};\n\nconst ReviewCongrats = (props: ReviewCongratsProps) => {\n const {\n 'aria-label': ariaLabel,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const {theme} = useTemplateContext();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [isCongratsTranslationDone, setCongratsTranslationDone] = useState<boolean>(false);\n const [isRankShown, setRankShown] = useState<boolean>(false);\n\n const scrollViewRef = useRef<ScrollView>(null);\n\n const showCongrats = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 950,\n onComplete: () => {\n setCongratsTranslationDone(true);\n }\n });\n\n const translateCongrats = useTranslateY({\n fromValue: 100,\n toValue: 0,\n duration: 550\n });\n\n const showConfettis = useAnimateProp(fadeIn);\n const fadeInRank = useAnimateProp(fadeIn);\n const translateRank = useTranslateX({\n ...translateHorizontally,\n onComplete: () => {\n setRankShown(true);\n setTimeout(() => {\n scrollViewRef?.current?.scrollToEnd();\n }, 700);\n }\n });\n\n const animatedRank = [fadeInRank.animatedStyle, translateRank.animatedStyle];\n\n const fadeInStars = useAnimateProp({\n ...fadeIn,\n delay: cardCongratsRank ? 1000 : 0\n });\n\n const translateStars = useTranslateX({\n ...translateHorizontally,\n delay: cardCongratsRank ? 1000 : 0\n });\n\n const showButton1 = useAnimateProp(fadeIn);\n const showButton2 = useAnimateProp(fadeIn);\n\n const congratsSequence = sequence([\n parallel([showCongrats, translateCongrats]),\n parallel([\n showConfettis,\n cardCongratsRank\n ? sequence([parallel([fadeInRank, translateRank]), parallel([fadeInStars, translateStars])])\n : parallel([fadeInStars, translateStars])\n ]),\n sequence([showButton1, showButton2])\n ]);\n\n useEffect(() => {\n congratsSequence.start();\n // (required only once on mount)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n const handleContinueRevisingPress = buttonRevising?.onClick || noop;\n const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || noop;\n const showStarLottieAnimation = !cardCongratsRank || isRankShown;\n\n return (\n <Animated.View\n style={[styleSheet.congrats, translateCongrats.animatedStyle, showCongrats.animatedStyle]}\n accessibilityLabel={ariaLabel}\n >\n <Text style={styleSheet.title}>{title}</Text>\n <ScrollView\n ref={scrollViewRef}\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styleSheet.scrollView}\n contentContainerStyle={styleSheet.scrollViewContent}\n >\n {cardCongratsRank ? (\n <Animated.View style={animatedRank}>\n <CardCongrats\n animationUri={cardCongratsRank.animationLottie.animationSrc}\n text={cardCongratsRank.reviewCardTitle}\n value={`${cardCongratsRank.reviewCardValue} ${cardCongratsRank.rankSuffix}`}\n Icon={RankIcon}\n iconColor={theme.colors.positive}\n textColor={theme.colors.text.primary}\n direction=\"row-reverse\"\n />\n </Animated.View>\n ) : null}\n <Animated.View style={[fadeInStars.animatedStyle, translateStars.animatedStyle]}>\n <CardCongrats\n animationUri={\n showStarLottieAnimation ? cardCongratsStar.animationLottie.animationSrc : null\n }\n Icon={StarIcon}\n text={cardCongratsStar.reviewCardTitle}\n value={cardCongratsStar.reviewCardValue}\n iconColor={theme.colors.battle}\n textColor={theme.colors.battle}\n direction=\"row\"\n />\n </Animated.View>\n </ScrollView>\n\n <Animated.View style={styleSheet.buttons}>\n {buttonRevisingSkill ? (\n <Animated.View style={showButton1.animatedStyle}>\n <Button\n onPress={handleReviseAnotherSkillPress}\n accessibilityLabel={buttonRevisingSkill['aria-label']}\n submitValue={buttonRevisingSkill.label}\n style={{...BOX_STYLE, backgroundColor: '#fff'}}\n textStyle={{color: '#123'}}\n />\n </Animated.View>\n ) : null}\n {buttonRevising ? (\n <Animated.View style={showButton2.animatedStyle}>\n <Button\n onPress={handleContinueRevisingPress}\n accessibilityLabel={buttonRevising['aria-label']}\n submitValue={buttonRevising.label}\n />\n </Animated.View>\n ) : null}\n </Animated.View>\n\n {isCongratsTranslationDone ? (\n <Animated.View\n pointerEvents=\"none\"\n style={[styleSheet.confettis, showConfettis.animatedStyle]}\n >\n <LottieView source={{uri: animationLottie.animationSrc}} autoPlay loop={false} />\n </Animated.View>\n ) : null}\n </Animated.View>\n );\n};\n\nexport default ReviewCongrats;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AASA;;AAEA;;AACA;;AACA;;;;;;;;;;AAYA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,QAAQ,EAAE;IACRC,QAAQ,EAAE,UADF;IAERC,KAAK,EAAE,MAFC;IAGRC,MAAM,EAAE,MAHA;IAIRC,aAAa,EAAE,QAJP;IAKRC,UAAU,EAAE,QALJ;IAMRC,eAAe,EAAE,EANT;IAORC,IAAI,EAAE;EAPE,CADM;EAUhBC,OAAO,EAAE;IACPN,KAAK,EAAE,MADA;IAEPO,iBAAiB,EAAE,EAFZ;IAGPL,aAAa,EAAE,QAHR;IAIPM,cAAc,EAAE,eAJT;IAKPP,MAAM,EAAE;EALD,CAVO;EAiBhBQ,KAAK,EAAE;IACLC,UAAU,EAAE,KADP;IAELC,QAAQ,EAAE,EAFL;IAGLC,UAAU,EAAE,EAHP;IAILC,cAAc,EAAE,EAJX;IAKLC,KAAK,EAAEnB,KAAK,CAACoB,MAAN,CAAaC,IAAb,CAAkBC;EALpB,CAjBS;EAwBhBC,SAAS,EAAE;IACTC,QAAQ,EAAE,CADD;IAETpB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,KAAK,eAAMC,iBAAN;MAAiBC,eAAe,EAAE;IAAlC,EAJP;IAKE,SAAS,EAAE;MAACxE,KAAK,EAAE;IAAR;EALb,EADF,CADkB,GAUhB,IAXN,EAYGqB,cAAc,gBACb,6BAAC,qBAAD,CAAU,IAAV;IAAe,KAAK,EAAE8B,WAAW,CAACL;EAAlC,gBACE,6BAAC,cAAD;IACE,OAAO,EAAEY,2BADX;IAEE,kBAAkB,EAAErC,cAAc,CAAC,YAAD,CAFpC;IAGE,WAAW,EAAEA,cAAc,CAACiD;EAH9B,EADF,CADa,GAQX,IApBN,CAxCF,EA+DG3C,yBAAyB,gBACxB,6BAAC,qBAAD,CAAU,IAAV;IACE,aAAa,EAAC,MADhB;IAEE,KAAK,EAAE,CAACH,UAAU,CAACpB,SAAZ,EAAuBkC,aAAa,CAACQ,aAArC;EAFT,gBAIE,6BAAC,0BAAD;IAAY,MAAM,EAAE;MAAC2B,GAAG,EAAEvD,eAAe,CAAC4C;IAAtB,CAApB;IAAyD,QAAQ,MAAjE;IAAkE,IAAI,EAAE;EAAxE,EAJF,CADwB,GAOtB,IAtEN,CADF;AA0ED,CAtKD;;eAwKe/C,c"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAoBA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAoBA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;AA0KtE,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBA8CrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -48,7 +48,9 @@ const CorrectionPopin = ({
|
|
|
48
48
|
toValue: 0,
|
|
49
49
|
duration: 500,
|
|
50
50
|
easing: _reactNative.Easing.bezier(0.34, 1.36, 0.64, 1)
|
|
51
|
-
});
|
|
51
|
+
}); // the translation is required only once on mount
|
|
52
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
|
+
|
|
52
54
|
(0, _react.useEffect)(() => translateUp.start(), []);
|
|
53
55
|
if (!showCorrectionPopin) return null;
|
|
54
56
|
const klf = (0, _getOr.default)(undefined, 'klf', correctionPopinProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","useTranslateY","fromValue","toValue","duration","easing","Easing","bezier","useEffect","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesScrollView","marginVertical","choicesScrollContent","padding","Question","props","answerUI","useTemplateContext","setStyle","useState","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","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 ScrollView,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {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: 500,\n toValue: 0,\n duration: 500,\n easing: Easing.bezier(0.34, 1.36, 0.64, 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 choicesScrollView: ViewStyle;\n choicesScrollContent: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesScrollView: {\n marginVertical: 20,\n width: '100%'\n },\n choicesScrollContent: {\n padding: 10\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <ScrollView\n style={style.choicesScrollView}\n contentContainerStyle={style.choicesScrollContent}\n centerContent\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n >\n <Answer {...answerUI} />\n </ScrollView>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {animatedStyle, slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <View style={slideStyle.slide} />;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <Animated.View style={[slideStyle.slide, animatedStyle]}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </Animated.View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AACA;;AAUA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAGA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,WAAW,GAAG,IAAAC,mCAAA,EAAc;IAChCC,SAAS,EAAE,GADqB;IAEhCC,OAAO,EAAE,CAFuB;IAGhCC,QAAQ,EAAE,GAHsB;IAIhCC,MAAM,EAAEC,mBAAA,CAAOC,MAAP,CAAc,IAAd,EAAoB,IAApB,EAA0B,IAA1B,EAAgC,CAAhC;EAJwB,CAAd,CAApB;EAOA,IAAAC,gBAAA,EAAU,MAAMR,WAAW,CAACS,KAAZ,EAAhB,EAAqC,EAArC;EAE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,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;eAgDeyE,K"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","useTranslateY","fromValue","toValue","duration","easing","Easing","bezier","useEffect","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesScrollView","marginVertical","choicesScrollContent","padding","Question","props","answerUI","useTemplateContext","setStyle","useState","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","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 ScrollView,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {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: 500,\n toValue: 0,\n duration: 500,\n easing: Easing.bezier(0.34, 1.36, 0.64, 1)\n });\n\n // the translation is required only once on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesScrollView: ViewStyle;\n choicesScrollContent: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesScrollView: {\n marginVertical: 20,\n width: '100%'\n },\n choicesScrollContent: {\n padding: 10\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <ScrollView\n style={style.choicesScrollView}\n contentContainerStyle={style.choicesScrollContent}\n centerContent\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n >\n <Answer {...answerUI} />\n </ScrollView>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {animatedStyle, slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <View style={slideStyle.slide} />;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <Animated.View style={[slideStyle.slide, animatedStyle]}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </Animated.View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AACA;;AAUA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAGA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,WAAW,GAAG,IAAAC,mCAAA,EAAc;IAChCC,SAAS,EAAE,GADqB;IAEhCC,OAAO,EAAE,CAFuB;IAGhCC,QAAQ,EAAE,GAHsB;IAIhCC,MAAM,EAAEC,mBAAA,CAAOC,MAAP,CAAc,IAAd,EAAoB,IAApB,EAA0B,IAA1B,EAAgC,CAAhC;EAJwB,CAAd,CAApB,CADgB,CAQhB;EACA;;EACA,IAAAC,gBAAA,EAAU,MAAMR,WAAW,CAACS,KAAZ,EAAhB,EAAqC,EAArC;EAEA,IAAI,CAACX,mBAAL,EAA0B,OAAO,IAAP;EAE1B,MAAMY,GAAG,GAAG,IAAAC,cAAA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QjB,IArBN,CADF;AAyBD,CA9CD;;eAgDeyE,K"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ReviewStackProps } from './prop-types';
|
|
3
|
-
export declare const TOTAL_SLIDES_STACK = 5;
|
|
4
3
|
declare const StackedSlides: (props: ReviewStackProps) => JSX.Element;
|
|
5
4
|
export default StackedSlides;
|
|
6
5
|
//# sourceMappingURL=index.native.d.ts.map
|
|
@@ -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,KAAK,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAenD,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBAuI7C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default =
|
|
4
|
+
exports.default = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
@@ -19,9 +19,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
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
21
|
|
|
22
|
-
const TOTAL_SLIDES_STACK = 5;
|
|
23
|
-
exports.TOTAL_SLIDES_STACK = TOTAL_SLIDES_STACK;
|
|
24
|
-
|
|
25
22
|
const style = _reactNative.StyleSheet.create({
|
|
26
23
|
slides: {
|
|
27
24
|
flex: 1,
|
|
@@ -29,19 +26,6 @@ const style = _reactNative.StyleSheet.create({
|
|
|
29
26
|
width: '100%'
|
|
30
27
|
}
|
|
31
28
|
});
|
|
32
|
-
|
|
33
|
-
const FakeSlide = ({
|
|
34
|
-
position,
|
|
35
|
-
validateButton
|
|
36
|
-
}) => /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
37
|
-
num: position,
|
|
38
|
-
slide: {
|
|
39
|
-
loading: true,
|
|
40
|
-
position
|
|
41
|
-
},
|
|
42
|
-
slideIndex: `${position}`,
|
|
43
|
-
validateButton: validateButton
|
|
44
|
-
});
|
|
45
29
|
/*
|
|
46
30
|
- slides are ordered to be played from left to right: [0,1,2,3]
|
|
47
31
|
- slides are piled on the view, so we need to reverse the order:
|
|
@@ -60,7 +44,8 @@ const StackedSlides = props => {
|
|
|
60
44
|
correctionPopinProps
|
|
61
45
|
} = props;
|
|
62
46
|
const [unstacked, setUnstacked] = (0, _react.useState)([]);
|
|
63
|
-
const [
|
|
47
|
+
const [restacking, setRestacking] = (0, _react.useState)(null);
|
|
48
|
+
const [restackingDone, setRestackingDone] = (0, _react.useState)(false);
|
|
64
49
|
const hideSlides = (0, _reactNativeAnimation.useTranslateY)({
|
|
65
50
|
fromValue: 0,
|
|
66
51
|
toValue: windowHeight,
|
|
@@ -72,6 +57,12 @@ const StackedSlides = props => {
|
|
|
72
57
|
duration: 500,
|
|
73
58
|
easing: _reactNative.Easing.cubic
|
|
74
59
|
});
|
|
60
|
+
const restackTranslation = (0, _reactNativeAnimation.useTranslateY)({
|
|
61
|
+
toValue: 0,
|
|
62
|
+
fromValue: -windowHeight,
|
|
63
|
+
duration: 1200,
|
|
64
|
+
easing: _reactNative.Easing.out(_reactNative.Easing.cubic)
|
|
65
|
+
});
|
|
75
66
|
(0, _react.useEffect)(() => {
|
|
76
67
|
if (endReview) {
|
|
77
68
|
hideSlides.start();
|
|
@@ -81,10 +72,12 @@ const StackedSlides = props => {
|
|
|
81
72
|
const unstackingSlide = (0, _keys.default)(slides).find(k => slides[k].animationType === 'unstack');
|
|
82
73
|
const remainingKeys = (0, _keys.default)(slides).filter(k => slides[k].position >= 0 && !slides[k].animationType);
|
|
83
74
|
const orderedKeys = remainingKeys.sort((k1, k2) => slides[k2].position > slides[k1].position ? 1 : -1);
|
|
84
|
-
const
|
|
75
|
+
const animatedFrontSlide = unstackingSlide || (restackingSlide && restacking === null ? restackingSlide : undefined);
|
|
76
|
+
const animatedRestackedSlide = restacking !== null;
|
|
85
77
|
(0, _react.useEffect)(() => {
|
|
86
|
-
if (
|
|
87
|
-
|
|
78
|
+
if (restacking !== null && orderedKeys.includes(restacking)) {
|
|
79
|
+
setRestacking(null);
|
|
80
|
+
setRestackingDone(false);
|
|
88
81
|
} // this effect is required only when the list orderedKeys changes
|
|
89
82
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
90
83
|
|
|
@@ -99,18 +92,24 @@ const StackedSlides = props => {
|
|
|
99
92
|
}
|
|
100
93
|
}, [unstackingSlide, unstacked, setUnstacked, translateDown]);
|
|
101
94
|
(0, _react.useEffect)(() => {
|
|
102
|
-
const
|
|
95
|
+
const startRestacking = !restackingDone && restackingSlide && restacking !== restackingSlide;
|
|
103
96
|
|
|
104
|
-
if (
|
|
97
|
+
if (startRestacking) {
|
|
105
98
|
translateDown.start(() => {
|
|
106
|
-
|
|
99
|
+
setRestacking(restackingSlide);
|
|
100
|
+
restackTranslation.start(() => {
|
|
101
|
+
setRestackingDone(true);
|
|
102
|
+
});
|
|
107
103
|
});
|
|
108
|
-
}
|
|
109
|
-
|
|
104
|
+
} // this effect is required only to trigger the restack animation when a new restackingSlide is set
|
|
105
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
106
|
+
|
|
107
|
+
}, [restackingSlide, restacking]);
|
|
110
108
|
const stackedSlides = orderedKeys.map((slideIndex, index) => {
|
|
111
109
|
const slide = slides[slideIndex];
|
|
110
|
+
const num = orderedKeys.length - index;
|
|
112
111
|
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
113
|
-
num
|
|
112
|
+
num,
|
|
114
113
|
slideIndex,
|
|
115
114
|
slide,
|
|
116
115
|
validateButton,
|
|
@@ -119,23 +118,28 @@ const StackedSlides = props => {
|
|
|
119
118
|
});
|
|
120
119
|
});
|
|
121
120
|
|
|
122
|
-
if (
|
|
121
|
+
if (animatedFrontSlide) {
|
|
123
122
|
stackedSlides.push( /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
124
123
|
num: 0,
|
|
125
|
-
slideIndex:
|
|
126
|
-
slide: slides[
|
|
124
|
+
slideIndex: animatedFrontSlide,
|
|
125
|
+
slide: slides[animatedFrontSlide],
|
|
127
126
|
validateButton,
|
|
128
127
|
correctionPopinProps,
|
|
129
128
|
animatedStyle: [translateDown.animatedStyle],
|
|
130
|
-
key:
|
|
129
|
+
key: animatedFrontSlide
|
|
131
130
|
}));
|
|
132
131
|
}
|
|
133
132
|
|
|
134
133
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
135
134
|
style: [style.slides, hideSlides.animatedStyle]
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
}, animatedRestackedSlide ? /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
136
|
+
num: orderedKeys.length + 1,
|
|
137
|
+
slideIndex: restacking,
|
|
138
|
+
slide: slides[restacking],
|
|
139
|
+
validateButton,
|
|
140
|
+
correctionPopinProps,
|
|
141
|
+
animatedStyle: [restackTranslation.animatedStyle],
|
|
142
|
+
key: restacking
|
|
139
143
|
}) : null, stackedSlides);
|
|
140
144
|
};
|
|
141
145
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["style","StyleSheet","create","slides","flex","height","width","StackedSlides","props","windowHeight","useWindowDimensions","endReview","validateButton","correctionPopinProps","unstacked","setUnstacked","useState","restacking","setRestacking","restackingDone","setRestackingDone","hideSlides","useTranslateY","fromValue","toValue","duration","translateDown","easing","Easing","cubic","restackTranslation","out","useEffect","start","restackingSlide","keys","find","k","animationType","unstackingSlide","remainingKeys","filter","position","orderedKeys","sort","k1","k2","animatedFrontSlide","undefined","animatedRestackedSlide","includes","toString","unstacking","startRestacking","stackedSlides","map","slideIndex","index","slide","num","length","push","animatedStyle"],"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {Animated, Easing, 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 type {ReviewStackProps} from './prop-types';\n\nconst style = StyleSheet.create({\n slides: {\n flex: 1,\n height: '100%',\n width: '100%'\n }\n});\n\n/*\n - slides are ordered to be played from left to right: [0,1,2,3]\n - slides are piled on the view, so we need to reverse the order:\n -> it's like our eye is looking from the right [3,2,1,0] <-- oO\n*/\nconst StackedSlides = (props: ReviewStackProps) => {\n const {height: windowHeight} = useWindowDimensions();\n const {endReview, slides, validateButton, correctionPopinProps} = props;\n const [unstacked, setUnstacked] = useState<string[]>([]);\n const [restacking, setRestacking] = useState<string | null>(null);\n const [restackingDone, setRestackingDone] = useState<boolean>(false);\n\n const hideSlides = useTranslateY({\n fromValue: 0,\n toValue: windowHeight,\n duration: 800\n });\n\n const translateDown = useTranslateY({\n fromValue: 0,\n toValue: windowHeight - 100,\n duration: 500,\n easing: Easing.cubic\n });\n\n const restackTranslation = useTranslateY({\n toValue: 0,\n fromValue: -windowHeight,\n duration: 1200,\n easing: Easing.out(Easing.cubic)\n });\n\n useEffect(() => {\n if (endReview) {\n hideSlides.start();\n }\n }, [endReview, hideSlides]);\n\n const restackingSlide = keys(slides).find(k => slides[k].animationType === 'restack');\n const unstackingSlide = keys(slides).find(k => slides[k].animationType === 'unstack');\n\n const remainingKeys = keys(slides).filter(\n k => slides[k].position >= 0 && !slides[k].animationType\n );\n\n const orderedKeys = remainingKeys.sort((k1, k2) =>\n slides[k2].position > slides[k1].position ? 1 : -1\n );\n\n const animatedFrontSlide =\n unstackingSlide || (restackingSlide && restacking === null ? restackingSlide : undefined);\n\n const animatedRestackedSlide = restacking !== null;\n\n useEffect(() => {\n if (restacking !== null && orderedKeys.includes(restacking)) {\n setRestacking(null);\n setRestackingDone(false);\n }\n // this effect is required only when the list orderedKeys changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [orderedKeys.toString()]);\n\n useEffect(() => {\n const unstacking = unstackingSlide && !unstacked.includes(unstackingSlide);\n\n if (unstacking) {\n translateDown.start(() => {\n setUnstacked([...unstacked, unstackingSlide]);\n });\n }\n }, [unstackingSlide, unstacked, setUnstacked, translateDown]);\n\n useEffect(() => {\n const startRestacking = !restackingDone && restackingSlide && restacking !== restackingSlide;\n\n if (startRestacking) {\n translateDown.start(() => {\n setRestacking(restackingSlide);\n restackTranslation.start(() => {\n setRestackingDone(true);\n });\n });\n }\n // this effect is required only to trigger the restack animation when a new restackingSlide is set\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [restackingSlide, restacking]);\n\n const stackedSlides = orderedKeys.map((slideIndex, index) => {\n const slide = slides[slideIndex];\n const num = orderedKeys.length - index;\n\n return (\n <Slide\n {...{\n num,\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n if (animatedFrontSlide) {\n stackedSlides.push(\n <Slide\n {...{\n num: 0,\n slideIndex: animatedFrontSlide,\n slide: slides[animatedFrontSlide],\n validateButton,\n correctionPopinProps\n }}\n animatedStyle={[translateDown.animatedStyle]}\n key={animatedFrontSlide}\n />\n );\n }\n\n return (\n <Animated.View style={[style.slides, hideSlides.animatedStyle]}>\n {animatedRestackedSlide ? (\n <Slide\n {...{\n num: orderedKeys.length + 1,\n slideIndex: restacking,\n slide: slides[restacking],\n validateButton,\n correctionPopinProps\n }}\n animatedStyle={[restackTranslation.animatedStyle]}\n key={restacking}\n />\n ) : null}\n {stackedSlides}\n </Animated.View>\n );\n};\n\nexport default StackedSlides;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,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;AACA;AACA;AACA;AACA;;;AACA,MAAMC,aAAa,GAAIC,KAAD,IAA6B;EACjD,MAAM;IAACH,MAAM,EAAEI;EAAT,IAAyB,IAAAC,gCAAA,GAA/B;EACA,MAAM;IAACC,SAAD;IAAYR,MAAZ;IAAoBS,cAApB;IAAoCC;EAApC,IAA4DL,KAAlE;EACA,MAAM,CAACM,SAAD,EAAYC,YAAZ,IAA4B,IAAAC,eAAA,EAAmB,EAAnB,CAAlC;EACA,MAAM,CAACC,UAAD,EAAaC,aAAb,IAA8B,IAAAF,eAAA,EAAwB,IAAxB,CAApC;EACA,MAAM,CAACG,cAAD,EAAiBC,iBAAjB,IAAsC,IAAAJ,eAAA,EAAkB,KAAlB,CAA5C;EAEA,MAAMK,UAAU,GAAG,IAAAC,mCAAA,EAAc;IAC/BC,SAAS,EAAE,CADoB;IAE/BC,OAAO,EAAEf,YAFsB;IAG/BgB,QAAQ,EAAE;EAHqB,CAAd,CAAnB;EAMA,MAAMC,aAAa,GAAG,IAAAJ,mCAAA,EAAc;IAClCC,SAAS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AACC,UAAD,EAAaC,KAAb,KAAuB;IAC3D,MAAMC,KAAK,GAAGvD,MAAM,CAACqD,UAAD,CAApB;IACA,MAAMG,GAAG,GAAGhB,WAAW,CAACiB,MAAZ,GAAqBH,KAAjC;IAEA,oBACE,6BAAC,cAAD;MAEIE,GAFJ;MAGIH,UAHJ;MAIIE,KAJJ;MAKI9C,cALJ;MAMIC,oBANJ;MAQE,GAAG,EAAE2C;IARP,EADF;EAYD,CAhBqB,CAAtB;;EAkBA,IAAIT,kBAAJ,EAAwB;IACtBO,aAAa,CAACO,IAAd,eACE,6BAAC,cAAD;MAEIF,GAAG,EAAE,CAFT;MAGIH,UAAU,EAAET,kBAHhB;MAIIW,KAAK,EAAEvD,MAAM,CAAC4C,kBAAD,CAJjB;MAKInC,cALJ;MAMIC,oBANJ;MAQE,aAAa,EAAE,CAACa,aAAa,CAACoC,aAAf,CARjB;MASE,GAAG,EAAEf;IATP,EADF;EAaD;;EAED,oBACE,6BAAC,qBAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAAC/C,KAAK,CAACG,MAAP,EAAekB,UAAU,CAACyC,aAA1B;EAAtB,GACGb,sBAAsB,gBACrB,6BAAC,cAAD;IAEIU,GAAG,EAAEhB,WAAW,CAACiB,MAAZ,GAAqB,CAF9B;IAGIJ,UAAU,EAAEvC,UAHhB;IAIIyC,KAAK,EAAEvD,MAAM,CAACc,UAAD,CAJjB;IAKIL,cALJ;IAMIC,oBANJ;IAQE,aAAa,EAAE,CAACiB,kBAAkB,CAACgC,aAApB,CARjB;IASE,GAAG,EAAE7C;EATP,EADqB,GAYnB,IAbN,EAcGqC,aAdH,CADF;AAkBD,CAvID;;eAyIe/C,a"}
|
|
@@ -40,7 +40,7 @@ const EngineTab = ({
|
|
|
40
40
|
type
|
|
41
41
|
} = engine;
|
|
42
42
|
const state = engineIndex < firstItem ? 'hidden' : 'active';
|
|
43
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
44
44
|
className: _starsSummary.default[state],
|
|
45
45
|
key: type,
|
|
46
46
|
"data-name": `${type}_total_${state}`
|
|
@@ -154,7 +154,7 @@ class StarsSummary extends _react.default.Component {
|
|
|
154
154
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
155
155
|
"data-name": "myStars-wrapper",
|
|
156
156
|
className: _starsSummary.default.myStarsWrapper
|
|
157
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
157
|
+
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
158
158
|
className: _starsSummary.default.allStars,
|
|
159
159
|
"data-name": "engineList"
|
|
160
160
|
}, /*#__PURE__*/_react.default.createElement(EngineTabs, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stars-summary.js","names":["EngineTab","engine","engineIndex","firstItem","type","state","style","hidden","active","propTypes","PropTypes","shape","EngineStars","number","EngineTabs","engines","useMemo","convert","cap","index","arrayOf","StarsSummary","React","Component","constructor","props","totalItems","length","handleOnLeft","bind","handleOnRight","scrollTo","page","setState","render","total","skin","context","dark","primary","leftArrowView","circle","left","rightArrowView","right","myStars","myStarsWrapper","allStars","footerSummaryStars","backgroundColor","totalStars","label","stars","iconBubble","iconHeader","navigationLeft","navigationRight","contextTypes","Provider","childContextTypes","string","isRequired"],"sources":["../../../src/template/activity/stars-summary.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, isEmpty, map} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowLeft as ArrowLeft,\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionCoorpacademyStar as StarIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../atom/provider';\nimport EngineStars from './engine-stars';\nimport style from './stars-summary.css';\n\nconst EngineTab = ({engine, engineIndex, firstItem}) => {\n const {type} = engine;\n const state = engineIndex < firstItem ? 'hidden' : 'active';\n return (\n <
|
|
1
|
+
{"version":3,"file":"stars-summary.js","names":["EngineTab","engine","engineIndex","firstItem","type","state","style","hidden","active","propTypes","PropTypes","shape","EngineStars","number","EngineTabs","engines","useMemo","convert","cap","index","arrayOf","StarsSummary","React","Component","constructor","props","totalItems","length","handleOnLeft","bind","handleOnRight","scrollTo","page","setState","render","total","skin","context","dark","primary","leftArrowView","circle","left","rightArrowView","right","myStars","myStarsWrapper","allStars","footerSummaryStars","backgroundColor","totalStars","label","stars","iconBubble","iconHeader","navigationLeft","navigationRight","contextTypes","Provider","childContextTypes","string","isRequired"],"sources":["../../../src/template/activity/stars-summary.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, isEmpty, map} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowLeft as ArrowLeft,\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionCoorpacademyStar as StarIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../atom/provider';\nimport EngineStars from './engine-stars';\nimport style from './stars-summary.css';\n\nconst EngineTab = ({engine, engineIndex, firstItem}) => {\n const {type} = engine;\n const state = engineIndex < firstItem ? 'hidden' : 'active';\n return (\n <li className={style[state]} key={type} data-name={`${type}_total_${state}`}>\n <EngineStars {...engine} className={engineIndex < firstItem ? style.hidden : style.active} />\n </li>\n );\n};\nEngineTab.propTypes = {\n engine: PropTypes.shape(EngineStars.propTypes),\n engineIndex: PropTypes.number,\n firstItem: PropTypes.number\n};\n\nconst EngineTabs = ({engines, firstItem}) => {\n return useMemo(\n () =>\n map.convert({cap: false})(\n (engine, index) => (\n <EngineTab\n engine={engine}\n key={`engineTab_${index}`}\n firstItem={firstItem}\n engineIndex={index}\n />\n ),\n engines\n ),\n [engines, firstItem]\n );\n};\n\nEngineTabs.propTypes = {\n engines: PropTypes.arrayOf(PropTypes.shape(EngineStars.propTypes)),\n firstItem: PropTypes.number\n};\n\nclass StarsSummary extends React.Component {\n static propTypes = {\n total: PropTypes.shape({\n label: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired\n }).isRequired,\n engines: PropTypes.arrayOf(PropTypes.shape(EngineStars.propTypes))\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props) {\n super(props);\n\n const {engines = []} = props;\n this.state = {\n firstItem: 0,\n totalItems: engines.length\n };\n\n this.handleOnLeft = this.handleOnLeft.bind(this);\n this.handleOnRight = this.handleOnRight.bind(this);\n this.scrollTo = this.scrollTo.bind(this);\n }\n\n handleOnLeft() {\n const {firstItem} = this.state;\n this.scrollTo(firstItem - 1);\n }\n\n handleOnRight() {\n const {firstItem} = this.state;\n this.scrollTo(firstItem + 1);\n }\n\n scrollTo(page) {\n this.setState({\n firstItem: page\n });\n }\n\n render() {\n const {total, engines = []} = this.props;\n const {skin} = this.context;\n const {firstItem, totalItems} = this.state;\n const dark = getOr('#90A4AE', 'common.dark', skin);\n const primary = get('common.primary', skin);\n\n if (isEmpty(engines)) {\n return null;\n }\n const leftArrowView =\n totalItems > 6 && firstItem > 0 ? (\n <div className={style.circle} onClick={this.handleOnLeft} data-name=\"left-arrow\">\n <ArrowLeft color={dark} className={style.left} width={10} height={10} />\n </div>\n ) : null;\n\n const rightArrowView =\n totalItems > 6 && firstItem < totalItems - 6 ? (\n <div className={style.circle} onClick={this.handleOnRight} data-name=\"right-arrow\">\n <ArrowRight color={dark} className={style.right} width={10} height={10} />\n </div>\n ) : null;\n\n return (\n <div data-name=\"myStars\" className={style.myStars}>\n <div data-name=\"myStars-wrapper\" className={style.myStarsWrapper}>\n <ul className={style.allStars} data-name=\"engineList\">\n <EngineTabs engines={engines} firstItem={firstItem} />\n </ul>\n <div\n className={style.footerSummaryStars}\n style={{\n backgroundColor: primary\n }}\n >\n <div className={style.totalStars}>\n <span>{total.label}</span>\n <p data-name=\"star-counter\">{total.stars}</p>\n <div className={style.iconBubble}>\n <StarIcon className={style.iconHeader} color={primary} />\n </div>\n </div>\n <div className={style.navigationLeft}>{leftArrowView}</div>\n <div className={style.navigationRight}>{rightArrowView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AEV;MADZ;IAFT,gBAME;MAAK,SAAS,EAAEjC,qBAAA,CAAM4C;IAAtB,gBACE,2CAAOf,KAAK,CAACgB,KAAb,CADF,eAEE;MAAG,aAAU;IAAb,GAA6BhB,KAAK,CAACiB,KAAnC,CAFF,eAGE;MAAK,SAAS,EAAE9C,qBAAA,CAAM+C;IAAtB,gBACE,6BAAC,0CAAD;MAAU,SAAS,EAAE/C,qBAAA,CAAMgD,UAA3B;MAAuC,KAAK,EAAEf;IAA9C,EADF,CAHF,CANF,eAaE;MAAK,SAAS,EAAEjC,qBAAA,CAAMiD;IAAtB,GAAuCf,aAAvC,CAbF,eAcE;MAAK,SAAS,EAAElC,qBAAA,CAAMkD;IAAtB,GAAwCb,cAAxC,CAdF,CAJF,CADF,CADF;EAyBD;;AA5FwC;;AAArCtB,Y,CASGoC,Y,GAAe;EACpBrB,IAAI,EAAEsB,iBAAA,CAASC,iBAAT,CAA2BvB;AADb,C;AATlBf,Y,CACGZ,S,2CAAY;EACjB0B,KAAK,EAAEzB,kBAAA,CAAUC,KAAV,CAAgB;IACrBwC,KAAK,EAAEzC,kBAAA,CAAUkD,MAAV,CAAiBC,UADH;IAErBT,KAAK,EAAE1C,kBAAA,CAAUG,MAAV,CAAiBgD;EAFH,CAAhB,EAGJA,UAJc;EAKjB9C,OAAO,EAAEL,kBAAA,CAAUU,OAAV,CAAkBV,kBAAA,CAAUC,KAAV,CAAgBC,oBAAA,CAAYH,SAA5B,CAAlB;AALQ,C;eA8FNY,Y"}
|
|
@@ -12,22 +12,18 @@ declare const AppReview: {
|
|
|
12
12
|
skills: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
13
13
|
text: import("prop-types").Requireable<string>;
|
|
14
14
|
tooltipText: import("prop-types").Requireable<string>;
|
|
15
|
-
moreDetailsAreaLabel: import("prop-types").Requireable<string>;
|
|
16
15
|
}>>;
|
|
17
16
|
questions: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
18
17
|
text: import("prop-types").Requireable<string>;
|
|
19
18
|
tooltipText: import("prop-types").Requireable<string>;
|
|
20
|
-
moreDetailsAreaLabel: import("prop-types").Requireable<string>;
|
|
21
19
|
}>>;
|
|
22
20
|
lifes: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
23
21
|
text: import("prop-types").Requireable<string>;
|
|
24
22
|
tooltipText: import("prop-types").Requireable<string>;
|
|
25
|
-
moreDetailsAreaLabel: import("prop-types").Requireable<string>;
|
|
26
23
|
}>>;
|
|
27
24
|
allright: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
28
25
|
text: import("prop-types").Requireable<string>;
|
|
29
26
|
tooltipText: import("prop-types").Requireable<string>;
|
|
30
|
-
moreDetailsAreaLabel: import("prop-types").Requireable<string>;
|
|
31
27
|
}>>;
|
|
32
28
|
}>>;
|
|
33
29
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAEvD,QAAA,MAAM,SAAS;+CAA4C,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAEvD,QAAA,MAAM,SAAS;+CAA4C,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWxE,CAAC;AAIF,eAAe,SAAS,CAAC"}
|
|
@@ -20,22 +20,18 @@ declare const propTypes: {
|
|
|
20
20
|
skills: PropTypes.Requireable<PropTypes.InferProps<{
|
|
21
21
|
text: PropTypes.Requireable<string>;
|
|
22
22
|
tooltipText: PropTypes.Requireable<string>;
|
|
23
|
-
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
24
23
|
}>>;
|
|
25
24
|
questions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
26
25
|
text: PropTypes.Requireable<string>;
|
|
27
26
|
tooltipText: PropTypes.Requireable<string>;
|
|
28
|
-
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
29
27
|
}>>;
|
|
30
28
|
lifes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
31
29
|
text: PropTypes.Requireable<string>;
|
|
32
30
|
tooltipText: PropTypes.Requireable<string>;
|
|
33
|
-
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
34
31
|
}>>;
|
|
35
32
|
allright: PropTypes.Requireable<PropTypes.InferProps<{
|
|
36
33
|
text: PropTypes.Requireable<string>;
|
|
37
34
|
tooltipText: PropTypes.Requireable<string>;
|
|
38
|
-
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
39
35
|
}>>;
|
|
40
36
|
}>>;
|
|
41
37
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,UAAU,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEtD,oBAAY,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErE,oBAAY,cAAc,GAAG;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,UAAU,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEtD,oBAAY,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErE,oBAAY,cAAc,GAAG;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -62,6 +62,8 @@ declare namespace SearchPage {
|
|
|
62
62
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
63
63
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
|
64
64
|
onToggleSorts: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
|
+
moreSortAriaLabel: PropTypes.Requireable<string>;
|
|
66
|
+
moreFilterAriaLabel: PropTypes.Requireable<string>;
|
|
65
67
|
}>>;
|
|
66
68
|
const cards: PropTypes.Requireable<PropTypes.InferProps<{
|
|
67
69
|
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
@@ -96,6 +98,8 @@ declare namespace SearchPage {
|
|
|
96
98
|
showMoreOnRightAriaLabel: PropTypes.Requireable<string>;
|
|
97
99
|
}>>;
|
|
98
100
|
}>>;
|
|
101
|
+
const moreSortAriaLabel: PropTypes.Requireable<string>;
|
|
102
|
+
const moreFilterAriaLabel: PropTypes.Requireable<string>;
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
105
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAUA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAUA,mEAgDC"}
|
|
@@ -34,7 +34,9 @@ const SearchPage = (props, context) => {
|
|
|
34
34
|
cards,
|
|
35
35
|
noresultsfound,
|
|
36
36
|
clearFilters,
|
|
37
|
-
recommendations
|
|
37
|
+
recommendations,
|
|
38
|
+
moreSortAriaLabel,
|
|
39
|
+
moreFilterAriaLabel
|
|
38
40
|
} = props;
|
|
39
41
|
const {
|
|
40
42
|
skin
|
|
@@ -53,7 +55,10 @@ const SearchPage = (props, context) => {
|
|
|
53
55
|
},
|
|
54
56
|
type: "link"
|
|
55
57
|
}))), recommendationsView) : /*#__PURE__*/_react.default.createElement(_cardsGrid.default, cards);
|
|
56
|
-
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_filters.default,
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_filters.default, _extends({}, searchFilters, {
|
|
59
|
+
moreSortAriaLabel: moreSortAriaLabel,
|
|
60
|
+
moreFilterAriaLabel: moreFilterAriaLabel
|
|
61
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
57
62
|
"data-name": "searchResult",
|
|
58
63
|
className: _style.default.cardsWrapper
|
|
59
64
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -70,7 +75,9 @@ SearchPage.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
70
75
|
searchFilters: _propTypes.default.shape(_filters.default.propTypes),
|
|
71
76
|
cards: _propTypes.default.shape(_cardsGrid.default.propTypes),
|
|
72
77
|
clearFilters: _propTypes.default.shape(_button.default.propTypes),
|
|
73
|
-
recommendations: _propTypes.default.shape(_cardsList.default.propTypes)
|
|
78
|
+
recommendations: _propTypes.default.shape(_cardsList.default.propTypes),
|
|
79
|
+
moreSortAriaLabel: _propTypes.default.string,
|
|
80
|
+
moreFilterAriaLabel: _propTypes.default.string
|
|
74
81
|
} : {};
|
|
75
82
|
var _default = SearchPage;
|
|
76
83
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","skin","defaultColor","recommendationsView","cardsView","list","style","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","Filters","CardsGrid","Button","CardsList"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {title
|
|
1
|
+
{"version":3,"file":"index.js","names":["SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","skin","defaultColor","recommendationsView","cardsView","list","style","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","Filters","CardsGrid","Button","CardsList"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n cards,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel\n } = props;\n\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const recommendationsView = isEmpty(recommendations) ? null : <CardsList {...recommendations} />;\n\n const cardsView = isEmpty(cards.list) ? (\n <div>\n <div className={style.noresults}>\n <div className={style.noresultstxt}>{noresultsfound}</div>\n <Button\n {...clearFilters}\n data-name=\"searchPageClear\"\n className={style.clear}\n style={{background: defaultColor}}\n type=\"link\"\n />\n </div>\n {recommendationsView}\n </div>\n ) : (\n <CardsGrid {...cards} />\n );\n\n return (\n <div>\n <Filters\n {...searchFilters}\n moreSortAriaLabel={moreSortAriaLabel}\n moreFilterAriaLabel={moreFilterAriaLabel}\n />\n <div data-name=\"searchResult\" className={style.cardsWrapper}>\n <div className={style.title}>{title}</div>\n {cardsView}\n </div>\n </div>\n );\n};\n\nSearchPage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearchPage.propTypes = {\n noresultsfound: PropTypes.string,\n title: PropTypes.string,\n searchFilters: PropTypes.shape(Filters.propTypes),\n cards: PropTypes.shape(CardsGrid.propTypes),\n clearFilters: PropTypes.shape(Button.propTypes),\n recommendations: PropTypes.shape(CardsList.propTypes),\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string\n};\n\nexport default SearchPage;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,UAAU,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrC,MAAM;IACJC,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