@coorpacademy/components 11.0.2-alpha.3 → 11.1.0
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/molecule/discipline-partners/index.js +1 -2
- package/es/molecule/discipline-partners/index.js.map +1 -1
- package/es/organism/review-slide/index.native.js +6 -3
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/organism/review-slide/prop-types.d.ts +2 -0
- package/es/organism/review-slide/prop-types.d.ts.map +1 -1
- package/es/organism/review-slide/prop-types.js.map +1 -1
- package/es/organism/review-stacked-slides/index.native.d.ts +1 -1
- package/es/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/es/organism/review-stacked-slides/index.native.js +82 -6
- package/es/organism/review-stacked-slides/index.native.js.map +1 -1
- package/es/template/common/dashboard/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.js +5 -1
- package/es/template/common/dashboard/index.js.map +1 -1
- package/lib/molecule/discipline-partners/index.js +1 -2
- package/lib/molecule/discipline-partners/index.js.map +1 -1
- package/lib/organism/review-slide/index.native.js +6 -3
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/organism/review-slide/prop-types.d.ts +2 -0
- package/lib/organism/review-slide/prop-types.d.ts.map +1 -1
- package/lib/organism/review-slide/prop-types.js.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.d.ts +1 -1
- package/lib/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.js +81 -5
- package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
- package/lib/template/common/dashboard/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.js +6 -1
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/locales/.mtslconfig.json +1 -0
- package/package.json +3 -3
|
@@ -73,8 +73,7 @@ const DisciplinePartners = (props, context) => {
|
|
|
73
73
|
className: style.logoContainer
|
|
74
74
|
}, /*#__PURE__*/React.createElement(Picture, {
|
|
75
75
|
className: style.logo,
|
|
76
|
-
src: authorLogo.src
|
|
77
|
-
alt: authorLogo.alt
|
|
76
|
+
src: authorLogo.src
|
|
78
77
|
}), /*#__PURE__*/React.createElement("div", {
|
|
79
78
|
className: style.arrowWrapper
|
|
80
79
|
}, /*#__PURE__*/React.createElement(ArrowDown, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionNavigationArrowRight","ArrowRight","NovaCompositionNavigationArrowDown","ArrowDown","SocialLink","Provider","CatalogSection","Picture","style","DisciplinePartners","props","context","translate","skin","authorTitle","authors","authorLabel","defaultColor","authorsView","convert","cap","author","index","socialLinks","authorLogo","authorHref","moreDetails","autName","authorToggleId","linkView","authorLink","color","moreInfoView","linkicon","socialView","map","social","i","link","aNameView","authorName","logoView","logoContainer","logo","src","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionNavigationArrowRight","ArrowRight","NovaCompositionNavigationArrowDown","ArrowDown","SocialLink","Provider","CatalogSection","Picture","style","DisciplinePartners","props","context","translate","skin","authorTitle","authors","authorLabel","defaultColor","authorsView","convert","cap","author","index","socialLinks","authorLogo","authorHref","moreDetails","autName","authorToggleId","linkView","authorLink","color","moreInfoView","linkicon","socialView","map","social","i","link","aNameView","authorName","logoView","logoContainer","logo","src","arrowWrapper","arrow","authorContent","links","authorWrapper","toggle","colDetails","contextTypes","childContextTypes","propTypes","arrayOf","shape","name","string","href"],"sources":["../../../src/molecule/discipline-partners/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, isEmpty, map, uniqueId} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionNavigationArrowDown as ArrowDown\n} from '@coorpacademy/nova-icons';\nimport SocialLink from '../../atom/social-link';\nimport Provider from '../../atom/provider';\nimport CatalogSection from '../../atom/catalog-section';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst DisciplinePartners = (props, context) => {\n const {translate, skin} = context;\n\n const {authorTitle, authors = []} = props;\n\n const authorLabel = authorTitle || translate('author');\n const defaultColor = get('common.primary', skin);\n const authorsView = map.convert({cap: false})((author, index) => {\n const socialLinks = getOr([], 'socialLinks', author);\n const authorLogo = get('logo', author);\n const authorHref = get('href', author);\n const moreDetails = get('more', author);\n const autName = get('name', author);\n const authorToggleId = uniqueId('author-toggle-');\n const linkView = (\n <div className={style.authorLink}>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={{\n color: defaultColor\n }}\n href={authorHref}\n >\n {authorHref}\n </a>\n </div>\n );\n const moreInfoView = (\n <div className={style.authorLink}>\n <a\n href={authorHref}\n style={{\n color: defaultColor\n }}\n >\n {moreDetails}\n <ArrowRight color={defaultColor} className={style.linkicon} />\n </a>\n </div>\n );\n\n const socialView = socialLinks.map((social, i) => (\n <div key={i} className={style.link}>\n <SocialLink {...social} />\n </div>\n ));\n\n const aNameView = autName ? (\n <div data-name=\"authorName\" className={style.authorName}>\n {autName}\n </div>\n ) : null;\n\n const logoView = authorLogo ? (\n <div className={style.logoContainer}>\n <Picture className={style.logo} src={authorLogo.src} />\n <div className={style.arrowWrapper}>\n <ArrowDown className={style.arrow} height={14} whidth={14} />\n </div>\n </div>\n ) : null;\n\n const authorContent =\n authorHref || aNameView || socialView ? (\n <div className={style.authorContent}>\n {autName ? aNameView : null}\n {moreDetails ? moreInfoView : null}\n {!moreDetails && authorHref ? linkView : null}\n <div className={style.links}>{socialView}</div>\n </div>\n ) : null;\n\n return (\n <div key={index} className={style.authorWrapper}>\n <input type=\"checkbox\" id={authorToggleId} className={style.toggle} defaultChecked />\n <label htmlFor={authorToggleId}>{logoView}</label>\n {authorContent}\n </div>\n );\n }, authors);\n\n return !isEmpty(authors) ? (\n <div data-name=\"disciplinePartner\" className={style.colDetails}>\n <CatalogSection title={authorLabel}>{authorsView}</CatalogSection>\n </div>\n ) : null;\n};\n\nDisciplinePartners.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nDisciplinePartners.propTypes = {\n authors: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n href: PropTypes.string,\n logo: PropTypes.shape({\n src: PropTypes.string,\n href: PropTypes.string\n }),\n socialLinks: PropTypes.arrayOf(PropTypes.shape(SocialLink.propTypes))\n })\n ),\n authorTitle: PropTypes.string\n};\n\nexport default DisciplinePartners;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,mCAAmC,IAAIC,UADzC,EAEEC,kCAAkC,IAAIC,SAFxC,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,cAAP,MAA2B,4BAA3B;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC7C,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EAEA,MAAM;IAACG,WAAD;IAAcC,OAAO,GAAG;EAAxB,IAA8BL,KAApC;EAEA,MAAMM,WAAW,GAAGF,WAAW,IAAIF,SAAS,CAAC,QAAD,CAA5C;;EACA,MAAMK,YAAY,GAAG,KAAI,gBAAJ,EAAsBJ,IAAtB,CAArB;;EACA,MAAMK,WAAW,GAAG,KAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,MAAD,EAASC,KAAT,KAAmB;IAC/D,MAAMC,WAAW,GAAG,OAAM,EAAN,EAAU,aAAV,EAAyBF,MAAzB,CAApB;;IACA,MAAMG,UAAU,GAAG,KAAI,MAAJ,EAAYH,MAAZ,CAAnB;;IACA,MAAMI,UAAU,GAAG,KAAI,MAAJ,EAAYJ,MAAZ,CAAnB;;IACA,MAAMK,WAAW,GAAG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gB;IACdC,IAAI,EAAE1D,SAAS,CAAC2D,MADF;IAEdC,IAAI,EAAE5D,SAAS,CAAC2D,MAFF;IAGdf,IAAI,EAAE5C,SAAS,CAACyD,KAAV,CAAgB;MACpBZ,GAAG,EAAE7C,SAAS,CAAC2D,MADK;MAEpBC,IAAI,EAAE5D,SAAS,CAAC2D;IAFI,CAAhB,CAHQ;IAOdnC,WAAW,EAAExB,SAAS,CAACwD,OAAV,CAAkBxD,SAAS,CAACyD,KAAV,CAAgBpD,UAAU,CAACkD,SAA3B,CAAlB;EAPC,CAAhB,CADO,CADoB;EAY7BxC,WAAW,EAAEf,SAAS,CAAC2D;AAZM,CAA/B;AAeA,eAAejD,kBAAf"}
|
|
@@ -146,6 +146,7 @@ const createSlideStyle = (num, screenWidth) => {
|
|
|
146
146
|
|
|
147
147
|
const Slide = props => {
|
|
148
148
|
const {
|
|
149
|
+
animatedStyle,
|
|
149
150
|
slide,
|
|
150
151
|
correctionPopinProps,
|
|
151
152
|
validateButton,
|
|
@@ -166,14 +167,16 @@ const Slide = props => {
|
|
|
166
167
|
} = slide;
|
|
167
168
|
|
|
168
169
|
if (loading) {
|
|
169
|
-
return /*#__PURE__*/React.createElement(
|
|
170
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
171
|
+
style: slideStyle.slide
|
|
172
|
+
});
|
|
170
173
|
}
|
|
171
174
|
|
|
172
175
|
const {
|
|
173
176
|
onClick: handleValidatePress
|
|
174
177
|
} = validateButton;
|
|
175
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
176
|
-
style: slideStyle.slide
|
|
178
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
179
|
+
style: [slideStyle.slide, animatedStyle]
|
|
177
180
|
}, /*#__PURE__*/React.createElement(Question, {
|
|
178
181
|
questionOrigin: parentContentTitle,
|
|
179
182
|
questionText: questionText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","Animated","Easing","StyleSheet","useWindowDimensions","View","get","getOr","useTranslateY","Text","Answer","ReviewCorrectionPopin","useTemplateContext","Button","styles","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","fromValue","toValue","duration","easing","bezier","start","klf","undefined","information","label","message","next","onClick","_correctionPopinProps","type","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <Text>@todo loader {num}</Text>;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <View style={slideStyle.slide}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrect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C;EACA,MAAMuF,UAAU,GAAGlB,gBAAgB,CAACC,GAAD,EAAMvD,KAAN,CAAnC;EAEA,MAAM;IACJyE,OADI;IAEJC,kBAFI;IAGJhC,YAHI;IAIJS,QAJI;IAKJ/C,mBALI;IAMJC;EANI,IAOFqD,KAPJ;;EASA,IAAIe,OAAJ,EAAa;IACX,oBAAO,oBAAC,IAAD,yBAAoBlB,GAApB,CAAP;EACD;;EAED,MAAM;IAACpC,OAAO,EAAEwD;EAAV,IAAiCJ,cAAvC;EAEA,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAEC,UAAU,CAACd;EAAxB,gBACE,oBAAC,QAAD;IACE,cAAc,EAAEgB,kBADlB;IAEE,YAAY,EAAEhC,YAFhB;IAGE,QAAQ,EAAES,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,oBAAC,MAAD;IACE,QAAQ,EAAEoB,cAAc,CAACK,QAD3B;IAEE,WAAW,EAAEL,cAAc,CAACvD,KAF9B;IAGE,OAAO,EAAE2D,mBAHX;IAIE,MAAM,EAAG,yBAAwBxE,UAAW;EAJ9C,EAPF,EAaGD,oBAAoB,gBACnB,oBAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;AAgDA,eAAeiE,KAAf"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","Animated","Easing","StyleSheet","useWindowDimensions","View","get","getOr","useTranslateY","Text","Answer","ReviewCorrectionPopin","useTemplateContext","Button","styles","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","fromValue","toValue","duration","easing","bezier","start","klf","undefined","information","label","message","next","onClick","_correctionPopinProps","type","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {animatedStyle, slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <View style={slideStyle.slide} />;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <Animated.View style={[slideStyle.slide, animatedStyle]}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </Animated.View>\n );\n};\n\nexport default Slide;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SACEC,QADF,EAEEC,MAFF,EAGEC,UAHF,EAKEC,mBALF,EAMEC,IANF,QAQO,cARP;AASA,O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J,EAAa;IACX,oBAAO,oBAAC,IAAD;MAAM,KAAK,EAAED,UAAU,CAACd;IAAxB,EAAP;EACD;;EAED,MAAM;IAACvC,OAAO,EAAEwD;EAAV,IAAiCJ,cAAvC;EAEA,oBACE,oBAAC,QAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAACC,UAAU,CAACd,KAAZ,EAAmBlC,aAAnB;EAAtB,gBACE,oBAAC,QAAD;IACE,cAAc,EAAEkD,kBADlB;IAEE,YAAY,EAAEhC,YAFhB;IAGE,QAAQ,EAAES,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,oBAAC,MAAD;IACE,QAAQ,EAAEoB,cAAc,CAACK,QAD3B;IAEE,WAAW,EAAEL,cAAc,CAACvD,KAF9B;IAGE,OAAO,EAAE2D,mBAHX;IAIE,MAAM,EAAG,yBAAwBxE,UAAW;EAJ9C,EAPF,EAaGD,oBAAoB,gBACnB,oBAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;AAgDA,eAAeiE,KAAf"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import type { Animation } from '@coorpacademy/react-native-animation';
|
|
2
3
|
import { ReviewCorrectionPopinProps } from '../../molecule/review-correction-popin/prop-types';
|
|
3
4
|
import { AnswerProps } from '../../molecule/answer/prop-types';
|
|
4
5
|
import { TemplateContextValues } from '../../template/app-review/template-context';
|
|
@@ -210,6 +211,7 @@ export declare type ReviewSlideProps = {
|
|
|
210
211
|
onClick: () => void;
|
|
211
212
|
disabled: boolean;
|
|
212
213
|
};
|
|
214
|
+
animatedStyle?: Animation['animatedStyle'][];
|
|
213
215
|
};
|
|
214
216
|
export declare type Fixture = {
|
|
215
217
|
props: Revi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B,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,UAAU,CAAC;IAClB,oBAAoB,CAAC,EAAE,0BAA0B,CAAC;IAClD,cAAc,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,EAAE,CAAC;CAC9C,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,gBAAgB,CAAC;IAAC,aAAa,CAAC,EAAE,qBAAqB,CAAA;CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["PropTypes","ReviewCorrectionPopinPropTypes","AnswerPropTypes","SlidePropsTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\nimport {TemplateContextValues} from '../../template/app-review/template-context';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: string;\n showCorrectionPopin?: boolean;\n animateCorrectionPopin?: boolean;\n};\n\nexport type ValidateButtonProps = {\n slideIndex: string;\n validateButton: ReviewSlideProps['validateButton'];\n primarySkinColor?: string;\n};\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n};\n\nexport type Fixture = {props: ReviewSlideProps; mobileContext?: TemplateContextValues};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["PropTypes","ReviewCorrectionPopinPropTypes","AnswerPropTypes","SlidePropsTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport type {Animation} from '@coorpacademy/react-native-animation';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\nimport {TemplateContextValues} from '../../template/app-review/template-context';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: string;\n showCorrectionPopin?: boolean;\n animateCorrectionPopin?: boolean;\n};\n\nexport type ValidateButtonProps = {\n slideIndex: string;\n validateButton: ReviewSlideProps['validateButton'];\n primarySkinColor?: string;\n};\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n animatedStyle?: Animation['animatedStyle'][];\n};\n\nexport type Fixture = {props: ReviewSlideProps; mobileContext?: TemplateContextValues};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,OAAOC,8BAAP,MAEO,mDAFP;AAGA,OAAOC,eAAP,MAA2C,kCAA3C;AAGA,OAAO,MAAMC,eAAe,GAAGH,SAAS,CAACI,KAAV,CAAgB;EAC7CC,QAAQ,EAAEL,SAAS,CAACM,MADyB;EAE7CC,OAAO,EAAEP,SAAS,CAACQ,IAF0B;EAG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Props } from './prop-types';
|
|
2
|
+
import type { ReviewStackProps } from './prop-types';
|
|
3
3
|
export declare const TOTAL_SLIDES_STACK = 5;
|
|
4
4
|
declare const StackedSlides: (props: ReviewStackProps) => JSX.Element;
|
|
5
5
|
export default StackedSlides;
|
|
@@ -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":";AAMA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAEnD,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAyBpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBA0G7C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { Animated, StyleSheet, useWindowDimensions } from 'react-native';
|
|
3
3
|
import keys from 'lodash/fp/keys';
|
|
4
4
|
import { useTranslateY } from '@coorpacademy/react-native-animation';
|
|
@@ -12,26 +12,86 @@ const style = StyleSheet.create({
|
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
+
const FakeSlide = ({
|
|
16
|
+
position,
|
|
17
|
+
validateButton
|
|
18
|
+
}) => /*#__PURE__*/React.createElement(Slide, {
|
|
19
|
+
num: position,
|
|
20
|
+
slide: {
|
|
21
|
+
loading: true,
|
|
22
|
+
position
|
|
23
|
+
},
|
|
24
|
+
slideIndex: `${position}`,
|
|
25
|
+
validateButton: validateButton
|
|
26
|
+
});
|
|
27
|
+
/*
|
|
28
|
+
- slides are ordered to be played from left to right: [0,1,2,3]
|
|
29
|
+
- slides are piled on the view, so we need to reverse the order:
|
|
30
|
+
-> it's like our eye is looking from the right [3,2,1,0] <-- oO
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
15
34
|
const StackedSlides = props => {
|
|
16
35
|
const {
|
|
17
36
|
height: windowHeight
|
|
18
37
|
} = useWindowDimensions();
|
|
19
38
|
const {
|
|
39
|
+
endReview,
|
|
20
40
|
slides,
|
|
21
41
|
validateButton,
|
|
22
42
|
correctionPopinProps
|
|
23
43
|
} = props;
|
|
44
|
+
const [unstacked, setUnstacked] = useState([]);
|
|
45
|
+
const [restacked, setRestacked] = useState();
|
|
24
46
|
const hideSlides = useTranslateY({
|
|
25
47
|
fromValue: 0,
|
|
26
48
|
toValue: windowHeight,
|
|
27
49
|
duration: 800
|
|
28
50
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
const translateDown = useTranslateY({
|
|
52
|
+
fromValue: 0,
|
|
53
|
+
toValue: windowHeight - 100,
|
|
54
|
+
duration: 1000
|
|
55
|
+
});
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (endReview) {
|
|
58
|
+
hideSlides.start();
|
|
59
|
+
}
|
|
60
|
+
}, [endReview, hideSlides]);
|
|
61
|
+
const restackingSlide = keys(slides).find(k => slides[k].animationType === 'restack');
|
|
62
|
+
const unstackingSlide = keys(slides).find(k => slides[k].animationType === 'unstack');
|
|
63
|
+
const remainingKeys = keys(slides).filter(k => slides[k].position >= 0 && !slides[k].animationType);
|
|
64
|
+
const orderedKeys = remainingKeys.sort((k1, k2) => slides[k2].position > slides[k1].position ? 1 : -1);
|
|
65
|
+
const animatedSlide = restackingSlide || unstackingSlide;
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (restacked && orderedKeys.includes(restacked)) {
|
|
68
|
+
setRestacked(null);
|
|
69
|
+
} // this effect is required only when the list orderedKeys changes
|
|
70
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
71
|
+
|
|
72
|
+
}, [orderedKeys.toString()]);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const unstacking = unstackingSlide && !unstacked.includes(unstackingSlide);
|
|
75
|
+
|
|
76
|
+
if (unstacking) {
|
|
77
|
+
translateDown.start(() => {
|
|
78
|
+
setUnstacked([...unstacked, unstackingSlide]);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}, [unstackingSlide, unstacked, setUnstacked, translateDown]);
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
const restacking = restackingSlide && restacked !== restackingSlide;
|
|
84
|
+
|
|
85
|
+
if (restacking) {
|
|
86
|
+
translateDown.start(() => {
|
|
87
|
+
setRestacked(restackingSlide);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}, [restackingSlide, restacked, setRestacked, translateDown]);
|
|
91
|
+
const stackedSlides = orderedKeys.map((slideIndex, index) => {
|
|
32
92
|
const slide = slides[slideIndex];
|
|
33
93
|
return /*#__PURE__*/React.createElement(Slide, {
|
|
34
|
-
num:
|
|
94
|
+
num: orderedKeys.length - index,
|
|
35
95
|
slideIndex,
|
|
36
96
|
slide,
|
|
37
97
|
validateButton,
|
|
@@ -39,9 +99,25 @@ const StackedSlides = props => {
|
|
|
39
99
|
key: slideIndex
|
|
40
100
|
});
|
|
41
101
|
});
|
|
102
|
+
|
|
103
|
+
if (animatedSlide) {
|
|
104
|
+
stackedSlides.push( /*#__PURE__*/React.createElement(Slide, {
|
|
105
|
+
num: 0,
|
|
106
|
+
slideIndex: animatedSlide,
|
|
107
|
+
slide: slides[animatedSlide],
|
|
108
|
+
validateButton,
|
|
109
|
+
correctionPopinProps,
|
|
110
|
+
animatedStyle: [translateDown.animatedStyle],
|
|
111
|
+
key: animatedSlide
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
|
|
42
115
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
43
116
|
style: [style.slides, hideSlides.animatedStyle]
|
|
44
|
-
},
|
|
117
|
+
}, restacked ? /*#__PURE__*/React.createElement(FakeSlide, {
|
|
118
|
+
position: orderedKeys.length + 1,
|
|
119
|
+
validateButton: validateButton
|
|
120
|
+
}) : null, stackedSlides);
|
|
45
121
|
};
|
|
46
122
|
|
|
47
123
|
export default StackedSlides;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","Animated","StyleSheet","useWindowDimensions","keys","useTranslateY","Slide","TOTAL_SLIDES_STACK","style","create","slides","flex","height","width","StackedSlides","props","windowHeight","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","Animated","StyleSheet","useWindowDimensions","keys","useTranslateY","Slide","TOTAL_SLIDES_STACK","style","create","slides","flex","height","width","FakeSlide","position","validateButton","loading","StackedSlides","props","windowHeight","endReview","correctionPopinProps","unstacked","setUnstacked","restacked","setRestacked","hideSlides","fromValue","toValue","duration","translateDown","start","restackingSlide","find","k","animationType","unstackingSlide","remainingKeys","filter","orderedKeys","sort","k1","k2","animatedSlide","includes","toString","unstacking","restacking","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, 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 {ReviewSlideProps} from '../review-slide/prop-types';\nimport type {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\ntype FakeSlideProps = {position: number; validateButton: ReviewSlideProps['validateButton']};\nconst FakeSlide = ({position, validateButton}: FakeSlideProps) => (\n <Slide\n num={position}\n slide={{loading: true, position}}\n slideIndex={`${position}`}\n validateButton={validateButton}\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 [restacked, setRestacked] = useState<string | null>();\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: 1000\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 animatedSlide = restackingSlide || unstackingSlide;\n\n useEffect(() => {\n if (restacked && orderedKeys.includes(restacked)) {\n setRestacked(null);\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 restacking = restackingSlide && restacked !== restackingSlide;\n\n if (restacking) {\n translateDown.start(() => {\n setRestacked(restackingSlide);\n });\n }\n }, [restackingSlide, restacked, setRestacked, translateDown]);\n\n const stackedSlides = orderedKeys.map((slideIndex, index) => {\n const slide = slides[slideIndex];\n\n return (\n <Slide\n {...{\n num: orderedKeys.length - index,\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n if (animatedSlide) {\n stackedSlides.push(\n <Slide\n {...{\n num: 0,\n slideIndex: animatedSlide,\n slide: slides[animatedSlide],\n validateButton,\n correctionPopinProps\n }}\n animatedStyle={[translateDown.animatedStyle]}\n key={animatedSlide}\n />\n );\n }\n\n return (\n <Animated.View style={[style.slides, hideSlides.animatedStyle]}>\n {restacked ? (\n <FakeSlide position={orderedKeys.length + 1} validateButton={validateButton} />\n ) : null}\n {stackedSlides}\n </Animated.View>\n );\n};\n\nexport default StackedSlides;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SAAQC,QAAR,EAAkBC,UAAlB,EAA8BC,mBAA9B,QAAwD,cAAxD;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SAAQC,aAAR,QAA4B,sCAA5B;AACA,OAAOC,KAAP,MAAkB,8BAAlB;AAIA,OAAO,MAAMC,kBAAkB,GAAG,CAA3B;AAEP,MAAMC,KAAK,GAAGN,UAAU,CAACO,MAAX,CAAkB;EAC9BC,MAAM,EAAE;IACNC,IAAI,EAAE,CADA;IAENC,MAAM,EAAE,MAFF;IAGNC,KAAK,EAAE;EAHD;AADsB,CAAlB,CAAd;;AASA,MAAMC,SAAS,GAAG,CAAC;EAACC,QAAD;EAAWC;AAAX,CAAD,kBAChB,oBAAC,KAAD;EACE,GAAG,EAAED,QADP;EAEE,KAAK,EAAE;IAACE,OAAO,EAAE,IAAV;IAAgBF;EAAhB,CAFT;EAGE,UAAU,EAAG,GAAEA,QAAS,EAH1B;EAIE,cAAc,EAAEC;AAJlB,EADF;AASA;AACA;AACA;AACA;AACA;;;AACA,MAAME,aAAa,GAAIC,KAAD,IAA6B;EACjD,MAAM;IAACP,MAAM,EAAEQ;EAAT,IAAyBjB,mBAAmB,EAAlD;EACA,MAAM;IAACkB,SAAD;IAAYX,MAAZ;IAAoBM,cAApB;IAAoCM;EAApC,IAA4DH,KAAlE;EACA,MAAM,CAACI,SAAD,EAAYC,YAAZ,IAA4BxB,QAAQ,CAAW,EAAX,CAA1C;EACA,MAAM,CAACyB,SA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eACE,oBAAC,KAAD;MAEIF,GAAG,EAAE,CAFT;MAGIH,UAAU,EAAEP,aAHhB;MAIIS,KAAK,EAAE3C,MAAM,CAACkC,aAAD,CAJjB;MAKI5B,cALJ;MAMIM,oBANJ;MAQE,aAAa,EAAE,CAACS,aAAa,CAAC0B,aAAf,CARjB;MASE,GAAG,EAAEb;IATP,EADF;EAaD;;EAED,oBACE,oBAAC,QAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAACpC,KAAK,CAACE,MAAP,EAAeiB,UAAU,CAAC8B,aAA1B;EAAtB,GACGhC,SAAS,gBACR,oBAAC,SAAD;IAAW,QAAQ,EAAEe,WAAW,CAACe,MAAZ,GAAqB,CAA1C;IAA6C,cAAc,EAAEvC;EAA7D,EADQ,GAEN,IAHN,EAIGiC,aAJH,CADF;AAQD,CA1GD;;AA4GA,eAAe/B,aAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAqBA,oDAsCC"}
|
|
@@ -7,6 +7,7 @@ import CardsList from '../../../molecule/dashboard/cards-list';
|
|
|
7
7
|
import NewsList from '../../../molecule/dashboard/news-list';
|
|
8
8
|
import StartBattle from '../../../molecule/dashboard/start-battle';
|
|
9
9
|
import CMPopin from '../../../molecule/cm-popin';
|
|
10
|
+
import ReviewBanner from '../../../molecule/dashboard/review-banner';
|
|
10
11
|
import style from './style.css';
|
|
11
12
|
const Hero = /*#__PURE__*/React.memo(function Hero({
|
|
12
13
|
hero,
|
|
@@ -53,6 +54,9 @@ const Dashboard = props => {
|
|
|
53
54
|
case 'battle':
|
|
54
55
|
return /*#__PURE__*/React.createElement(StartBattle, section);
|
|
55
56
|
|
|
57
|
+
case 'review':
|
|
58
|
+
return /*#__PURE__*/React.createElement(ReviewBanner, section);
|
|
59
|
+
|
|
56
60
|
default:
|
|
57
61
|
return null;
|
|
58
62
|
}
|
|
@@ -80,7 +84,7 @@ const Dashboard = props => {
|
|
|
80
84
|
Dashboard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
81
85
|
hero: Hero.propTypes.hero,
|
|
82
86
|
welcome: Hero.propTypes.welcome,
|
|
83
|
-
sections: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(BattleRequestList.propTypes), PropTypes.shape(CardsList.propTypes), PropTypes.shape(NewsList.propTypes), PropTypes.shape(StartBattle.propTypes)])),
|
|
87
|
+
sections: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(BattleRequestList.propTypes), PropTypes.shape(CardsList.propTypes), PropTypes.shape(NewsList.propTypes), PropTypes.shape(StartBattle.propTypes), PropTypes.shape(ReviewBanner.propTypes)])),
|
|
84
88
|
cookie: PropTypes.shape(CMPopin.propTypes)
|
|
85
89
|
} : {};
|
|
86
90
|
export default Dashboard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","style","Hero","memo","hero","welcome","propTypes","shape","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,iBAAP,MAA8B,iDAA9B;AACA,OAAOC,SAAP,MAAsB,wCAAtB;AACA,OAAOC,QAAP,MAAqB,uCAArB;AACA,OAAOC,WAAP,MAAwB,0CAAxB;AACA,OAAOC,OAAP,MAAoB,4BAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","ReviewBanner","style","Hero","memo","hero","welcome","propTypes","shape","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport ReviewBanner from '../../../molecule/dashboard/review-banner';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n case 'review':\n return <ReviewBanner {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes),\n PropTypes.shape(ReviewBanner.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,iBAAP,MAA8B,iDAA9B;AACA,OAAOC,SAAP,MAAsB,wCAAtB;AACA,OAAOC,QAAP,MAAqB,uCAArB;AACA,OAAOC,WAAP,MAAwB,0CAAxB;AACA,OAAOC,OAAP,MAAoB,4BAApB;AACA,OAAOC,YAAP,MAAyB,2CAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,IAAI,gBAAGX,KAAK,CAACY,IAAN,CAAW,SAASD,IAAT,CAAc;EAACE,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEJ,KAAK,CAACG;EAAtB,GAA6BA,IAAI,gBAAG,oBAAC,QAAD,EAAcA,IAAd,CAAH,gBAA4B,oBAAC,KAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;AAIAH,IAAI,CAACI,SAAL,2CAAiB;EACfF,IAAI,EAAEZ,SAAS,CAACe,KAAV,CAAgBb,QAAQ,CAACY,SAAzB,CADS;EAEfD,OAAO,EAAEb,SAAS,CAACe,KAAV,CAAgBd,KAAK,CAACa,SAAtB;AAFM,CAAjB;;AAKA,MAAME,SAAS,GAAGC,KAAK,IAAI;EACzB,MAAM;IAACC,QAAQ,GAAG,EAAZ;IAAgBN,IAAhB;IAAsBC,OAAtB;IAA+BM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F,IAAI,CAACI,SAAL,CAAeF,IADD;EAEpBC,OAAO,EAAEH,IAAI,CAACI,SAAL,CAAeD,OAFJ;EAGpBK,QAAQ,EAAElB,SAAS,CAAC8B,OAAV,CACR9B,SAAS,CAAC+B,SAAV,CAAoB,CAClB/B,SAAS,CAACe,KAAV,CAAgBZ,iBAAiB,CAACW,SAAlC,CADkB,EAElBd,SAAS,CAACe,KAAV,CAAgBX,SAAS,CAACU,SAA1B,CAFkB,EAGlBd,SAAS,CAACe,KAAV,CAAgBV,QAAQ,CAACS,SAAzB,CAHkB,EAIlBd,SAAS,CAACe,KAAV,CAAgBT,WAAW,CAACQ,SAA5B,CAJkB,EAKlBd,SAAS,CAACe,KAAV,CAAgBP,YAAY,CAACM,SAA7B,CALkB,CAApB,CADQ,CAHU;EAYpBK,MAAM,EAAEnB,SAAS,CAACe,KAAV,CAAgBR,OAAO,CAACO,SAAxB;AAZY,CAAtB;AAcA,eAAeE,SAAf"}
|
|
@@ -88,8 +88,7 @@ const DisciplinePartners = (props, context) => {
|
|
|
88
88
|
className: _style.default.logoContainer
|
|
89
89
|
}, /*#__PURE__*/_react.default.createElement(_picture.default, {
|
|
90
90
|
className: _style.default.logo,
|
|
91
|
-
src: authorLogo.src
|
|
92
|
-
alt: authorLogo.alt
|
|
91
|
+
src: authorLogo.src
|
|
93
92
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
94
93
|
className: _style.default.arrowWrapper
|
|
95
94
|
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DisciplinePartners","props","context","translate","skin","authorTitle","authors","authorLabel","defaultColor","authorsView","convert","cap","author","index","socialLinks","authorLogo","authorHref","moreDetails","autName","authorToggleId","linkView","style","authorLink","color","moreInfoView","linkicon","socialView","map","social","i","link","aNameView","authorName","logoView","logoContainer","logo","src","
|
|
1
|
+
{"version":3,"file":"index.js","names":["DisciplinePartners","props","context","translate","skin","authorTitle","authors","authorLabel","defaultColor","authorsView","convert","cap","author","index","socialLinks","authorLogo","authorHref","moreDetails","autName","authorToggleId","linkView","style","authorLink","color","moreInfoView","linkicon","socialView","map","social","i","link","aNameView","authorName","logoView","logoContainer","logo","src","arrowWrapper","arrow","authorContent","links","authorWrapper","toggle","colDetails","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","name","string","href","SocialLink"],"sources":["../../../src/molecule/discipline-partners/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, isEmpty, map, uniqueId} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionNavigationArrowDown as ArrowDown\n} from '@coorpacademy/nova-icons';\nimport SocialLink from '../../atom/social-link';\nimport Provider from '../../atom/provider';\nimport CatalogSection from '../../atom/catalog-section';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst DisciplinePartners = (props, context) => {\n const {translate, skin} = context;\n\n const {authorTitle, authors = []} = props;\n\n const authorLabel = authorTitle || translate('author');\n const defaultColor = get('common.primary', skin);\n const authorsView = map.convert({cap: false})((author, index) => {\n const socialLinks = getOr([], 'socialLinks', author);\n const authorLogo = get('logo', author);\n const authorHref = get('href', author);\n const moreDetails = get('more', author);\n const autName = get('name', author);\n const authorToggleId = uniqueId('author-toggle-');\n const linkView = (\n <div className={style.authorLink}>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={{\n color: defaultColor\n }}\n href={authorHref}\n >\n {authorHref}\n </a>\n </div>\n );\n const moreInfoView = (\n <div className={style.authorLink}>\n <a\n href={authorHref}\n style={{\n color: defaultColor\n }}\n >\n {moreDetails}\n <ArrowRight color={defaultColor} className={style.linkicon} />\n </a>\n </div>\n );\n\n const socialView = socialLinks.map((social, i) => (\n <div key={i} className={style.link}>\n <SocialLink {...social} />\n </div>\n ));\n\n const aNameView = autName ? (\n <div data-name=\"authorName\" className={style.authorName}>\n {autName}\n </div>\n ) : null;\n\n const logoView = authorLogo ? (\n <div className={style.logoContainer}>\n <Picture className={style.logo} src={authorLogo.src} />\n <div className={style.arrowWrapper}>\n <ArrowDown className={style.arrow} height={14} whidth={14} />\n </div>\n </div>\n ) : null;\n\n const authorContent =\n authorHref || aNameView || socialView ? (\n <div className={style.authorContent}>\n {autName ? aNameView : null}\n {moreDetails ? moreInfoView : null}\n {!moreDetails && authorHref ? linkView : null}\n <div className={style.links}>{socialView}</div>\n </div>\n ) : null;\n\n return (\n <div key={index} className={style.authorWrapper}>\n <input type=\"checkbox\" id={authorToggleId} className={style.toggle} defaultChecked />\n <label htmlFor={authorToggleId}>{logoView}</label>\n {authorContent}\n </div>\n );\n }, authors);\n\n return !isEmpty(authors) ? (\n <div data-name=\"disciplinePartner\" className={style.colDetails}>\n <CatalogSection title={authorLabel}>{authorsView}</CatalogSection>\n </div>\n ) : null;\n};\n\nDisciplinePartners.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nDisciplinePartners.propTypes = {\n authors: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n href: PropTypes.string,\n logo: PropTypes.shape({\n src: PropTypes.string,\n href: PropTypes.string\n }),\n socialLinks: PropTypes.arrayOf(PropTypes.shape(SocialLink.propTypes))\n })\n ),\n authorTitle: PropTypes.string\n};\n\nexport default DisciplinePartners;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,kBAAkB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC7C,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EAEA,MAAM;IAACG,WAAD;IAAcC,OAAO,GAAG;EAAxB,IAA8BL,KAApC;EAEA,MAAMM,WAAW,GAAGF,WAAW,IAAIF,SAAS,CAAC,QAAD,CAA5C;EACA,MAAMK,YAAY,GAAG,mBAAI,gB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E,6BAAC,uBAAD;IAAgB,KAAK,EAAEpC;EAAvB,GAAqCE,WAArC,CADF,CADK,GAIH,IAJJ;AAKD,CAvFD;;AAyFAT,kBAAkB,CAAC4C,YAAnB,GAAkC;EAChCzC,SAAS,EAAE0C,iBAAA,CAASC,iBAAT,CAA2B3C,SADN;EAEhCC,IAAI,EAAEyC,iBAAA,CAASC,iBAAT,CAA2B1C;AAFD,CAAlC;AAKAJ,kBAAkB,CAAC+C,SAAnB,2CAA+B;EAC7BzC,OAAO,EAAE0C,kBAAA,CAAUC,OAAV,CACPD,kBAAA,CAAUE,KAAV,CAAgB;IACdC,IAAI,EAAEH,kBAAA,CAAUI,MADF;IAEdC,IAAI,EAAEL,kBAAA,CAAUI,MAFF;IAGdjB,IAAI,EAAEa,kBAAA,CAAUE,KAAV,CAAgB;MACpBd,GAAG,EAAEY,kBAAA,CAAUI,MADK;MAEpBC,IAAI,EAAEL,kBAAA,CAAUI;IAFI,CAAhB,CAHQ;IAOdtC,WAAW,EAAEkC,kBAAA,CAAUC,OAAV,CAAkBD,kBAAA,CAAUE,KAAV,CAAgBI,mBAAA,CAAWP,SAA3B,CAAlB;EAPC,CAAhB,CADO,CADoB;EAY7B1C,WAAW,EAAE2C,kBAAA,CAAUI;AAZM,CAA/B;eAeepD,kB"}
|
|
@@ -167,6 +167,7 @@ const createSlideStyle = (num, screenWidth) => {
|
|
|
167
167
|
|
|
168
168
|
const Slide = props => {
|
|
169
169
|
const {
|
|
170
|
+
animatedStyle,
|
|
170
171
|
slide,
|
|
171
172
|
correctionPopinProps,
|
|
172
173
|
validateButton,
|
|
@@ -187,14 +188,16 @@ const Slide = props => {
|
|
|
187
188
|
} = slide;
|
|
188
189
|
|
|
189
190
|
if (loading) {
|
|
190
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
191
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
192
|
+
style: slideStyle.slide
|
|
193
|
+
});
|
|
191
194
|
}
|
|
192
195
|
|
|
193
196
|
const {
|
|
194
197
|
onClick: handleValidatePress
|
|
195
198
|
} = validateButton;
|
|
196
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
197
|
-
style: slideStyle.slide
|
|
199
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
200
|
+
style: [slideStyle.slide, animatedStyle]
|
|
198
201
|
}, /*#__PURE__*/_react.default.createElement(Question, {
|
|
199
202
|
questionOrigin: parentContentTitle,
|
|
200
203
|
questionText: questionText,
|
|
@@ -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","choicesContainer","flex","Question","props","answerUI","useTemplateContext","setStyle","useState","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","useWindowDimensions","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <Text>@todo loader {num}</Text>;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <View style={slideStyle.slide}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AACA;;AASA;;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,IADqB;IAEhCC,OAAO,EAAE,CAFuB;IAGhCC,QAAQ,EAAE,GAHsB;IAIhCC,MAAM,EAAEC,mBAAA,CAAOC,MAAP,CAAc,IAAd,EAAoB,CAApB,EAAuB,IAAvB,EAA6B,CAA7B;EAJwB,CAAd,CAApB;EAOA,IAAAC,gBAAA,EAAU,MAAMR,WAAW,CAACS,KAAZ,EAAhB,EAAqC,EAArC;EAEA,IAAI,CAACX,mBAAL,EAA0B,OAAO,IAAP;EAE1B,MAAMY,GAAG,GAAG,IAAAC,cAAA,EAAMC,SAAN,EAAiB,KAAjB,EAAwBhB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D3D,UAAU,GAAG;EAAhE,IAAuEoD,KAA7E;EAEA,MAAM;IAACvD;EAAD,IAAU,IAAA+E,gCAAA,GAAhB;EACA,MAAMC,UAAU,GAAGnB,gBAAgB,CAACC,GAAD,EAAM9D,KAAN,CAAnC;EAEA,MAAM;IACJiF,OADI;IAEJC,kBAFI;IAGJnC,YAHI;IAIJS,QAJI;IAKJpD,mBALI;IAMJC;EANI,IAOF4D,KAPJ;;EASA,IAAIgB,OAAJ,EAAa;IACX,oBAAO,6BAAC,cAAD,yBAAoBnB,GAApB,CAAP;EACD;;EAED,MAAM;IAACtC,OAAO,EAAE2D;EAAV,IAAiCL,cAAvC;EAEA,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEE,UAAU,CAACf;EAAxB,gBACE,6BAAC,QAAD;IACE,cAAc,EAAEiB,kBADlB;IAEE,YAAY,EAAEnC,YAFhB;IAGE,QAAQ,EAAES,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,6BAAC,eAAD;IACE,QAAQ,EAAEsB,cAAc,CAACM,QAD3B;IAEE,WAAW,EAAEN,cAAc,CAAC1D,KAF9B;IAGE,OAAO,EAAE+D,mBAHX;IAIE,MAAM,EAAG,yBAAwBhF,UAAW;EAJ9C,EAPF,EAaGD,oBAAoB,gBACnB,6BAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;eAgDewE,K"}
|
|
1
|
+
{"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","choicesContainer","flex","Question","props","answerUI","useTemplateContext","setStyle","useState","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","useWindowDimensions","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {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;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAGA,MAAMA,MAAM,GAAGC,u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AAnB;EAAtB,gBACE,6BAAC,QAAD;IACE,cAAc,EAAEqD,kBADlB;IAEE,YAAY,EAAEnC,YAFhB;IAGE,QAAQ,EAAES,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,6BAAC,eAAD;IACE,QAAQ,EAAEsB,cAAc,CAACM,QAD3B;IAEE,WAAW,EAAEN,cAAc,CAAC1D,KAF9B;IAGE,OAAO,EAAE+D,mBAHX;IAIE,MAAM,EAAG,yBAAwBhF,UAAW;EAJ9C,EAPF,EAaGD,oBAAoB,gBACnB,6BAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;eAgDewE,K"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import type { Animation } from '@coorpacademy/react-native-animation';
|
|
2
3
|
import { ReviewCorrectionPopinProps } from '../../molecule/review-correction-popin/prop-types';
|
|
3
4
|
import { AnswerProps } from '../../molecule/answer/prop-types';
|
|
4
5
|
import { TemplateContextValues } from '../../template/app-review/template-context';
|
|
@@ -210,6 +211,7 @@ export declare type ReviewSlideProps = {
|
|
|
210
211
|
onClick: () => void;
|
|
211
212
|
disabled: boolean;
|
|
212
213
|
};
|
|
214
|
+
animatedStyle?: Animation['animatedStyle'][];
|
|
213
215
|
};
|
|
214
216
|
export declare type Fixture = {
|
|
215
217
|
props: ReviewSlideProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAuC,EACrC,0BAA0B,EAC3B,MAAM,mDAAmD,CAAC;AAC3D,OAAwB,EAAC,WAAW,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AAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,UAAU,CAAC;IAClB,oBAAoB,CAAC,EAAE,0BAA0B,CAAC;IAClD,cAAc,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,EAAE,CAAC;CAC9C,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,gBAAgB,CAAC;IAAC,aAAa,CAAC,EAAE,qBAAqB,CAAA;CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["SlidePropsTypes","PropTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","AnswerPropTypes","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\nimport {TemplateContextValues} from '../../template/app-review/template-context';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: string;\n showCorrectionPopin?: boolean;\n animateCorrectionPopin?: boolean;\n};\n\nexport type ValidateButtonProps = {\n slideIndex: string;\n validateButton: ReviewSlideProps['validateButton'];\n primarySkinColor?: string;\n};\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n};\n\nexport type Fixture = {props: ReviewSlideProps; mobileContext?: TemplateContextValues};\n"],"mappings":";;;;;AAAA;;
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["SlidePropsTypes","PropTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","AnswerPropTypes","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport type {Animation} from '@coorpacademy/react-native-animation';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\nimport {TemplateContextValues} from '../../template/app-review/template-context';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: string;\n showCorrectionPopin?: boolean;\n animateCorrectionPopin?: boolean;\n};\n\nexport type ValidateButtonProps = {\n slideIndex: string;\n validateButton: ReviewSlideProps['validateButton'];\n primarySkinColor?: string;\n};\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n animatedStyle?: Animation['animatedStyle'][];\n};\n\nexport type Fixture = {props: ReviewSlideProps; mobileContext?: TemplateContextValues};\n"],"mappings":";;;;;AAAA;;AAEA;;AAGA;;;;AAGO,MAAMA,eAAe,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAC7CC,QAAQ,EAAEF,kBAAA,CAAUG,MADyB;EAE7CC,OAAO,EAAEJ,kBAAA,CAAUK,IAF0B;EAG7CC,gBAAgB,EAAEN,kBAAA,CAAUO,MAHiB;EAI7CC,aAAa,EAAER,kBAAA,CAAUO,MAJoB;EAIZ;EACjCE,SAAS,EAAET,kBAAA,CAAUK,IALwB;EAM7CK,sBAAsB,EAAEV,kBAAA,CAAUK,IANW;EAO7CM,mBAAmB,EAAEX,kBAAA,CAAUK,IAPc;EAQ7CO,cAAc,EAAEZ,kBAAA,CAAUK,IARmB;EAS7CQ,kBAAkB,EAAEb,kBAAA,CAAUO,MATe;EAU7CO,YAAY,EAAEd,kBAAA,CAAUO,MAVqB;EAW7CQ,QAAQ,EAAEf,kBAAA,CAAUC,KAAV,CAAgBe,mBAAhB;AAXmC,CAAhB,CAAxB;;;AAcP,MAAMC,SAAS,GAAG;EAChBC,UAAU,EAAElB,kBAAA,CAAUO,MADN;EAEhBY,KAAK,EAAEpB,eAFS;EAGhBqB,cAAc,EAAEpB,kBAAA,CAAUC,KAAV,CAAgB;IAC9BoB,KAAK,EAAErB,kBAAA,CAAUO,MAAV,CAAiBe,UADM;IAE9BC,OAAO,EAAEvB,kBAAA,CAAUwB,IAAV,CAAeF,UAFM;IAG9BG,QAAQ,EAAEzB,kBAAA,CAAUK;EAHU,CAAhB,CAHA;EAQhBqB,oBAAoB,EAAE1B,kBAAA,CAAUC,KAAV,CAAgB;IACpC0B,GAAG,EAAEC,mBAAA,CAA+BD,GADA;IAEpCE,WAAW,EAAED,mBAAA,CAA+BC,WAFR;IAGpCC,IAAI,EAAE9B,kBAAA,CAAUC,KAAV,CAAgB;MACpBoB,KAAK,EAAErB,kBAAA,CAAUO,MADG;MAEpB,cAAcP,kBAAA,CAAUO,MAFJ,CAEW;MAC/B;;IAHoB,CAAhB,CAH8B;IAQpCwB,WAAW,EAAEH,mBAAA,CAA+BG,WARR;IASpCC,IAAI,EAAEJ,mBAAA,CAA+BI;EATD,CAAhB;AARN,CAAlB;eAqBef,S"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ReviewStackProps } from './prop-types';
|
|
2
|
+
import type { ReviewStackProps } from './prop-types';
|
|
3
3
|
export declare const TOTAL_SLIDES_STACK = 5;
|
|
4
4
|
declare const StackedSlides: (props: ReviewStackProps) => JSX.Element;
|
|
5
5
|
export default StackedSlides;
|
|
@@ -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":";AAMA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAEnD,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAyBpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBA0G7C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -30,26 +30,86 @@ const style = _reactNative.StyleSheet.create({
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
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
|
+
/*
|
|
46
|
+
- slides are ordered to be played from left to right: [0,1,2,3]
|
|
47
|
+
- slides are piled on the view, so we need to reverse the order:
|
|
48
|
+
-> it's like our eye is looking from the right [3,2,1,0] <-- oO
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
|
|
33
52
|
const StackedSlides = props => {
|
|
34
53
|
const {
|
|
35
54
|
height: windowHeight
|
|
36
55
|
} = (0, _reactNative.useWindowDimensions)();
|
|
37
56
|
const {
|
|
57
|
+
endReview,
|
|
38
58
|
slides,
|
|
39
59
|
validateButton,
|
|
40
60
|
correctionPopinProps
|
|
41
61
|
} = props;
|
|
62
|
+
const [unstacked, setUnstacked] = (0, _react.useState)([]);
|
|
63
|
+
const [restacked, setRestacked] = (0, _react.useState)();
|
|
42
64
|
const hideSlides = (0, _reactNativeAnimation.useTranslateY)({
|
|
43
65
|
fromValue: 0,
|
|
44
66
|
toValue: windowHeight,
|
|
45
67
|
duration: 800
|
|
46
68
|
});
|
|
47
|
-
(0,
|
|
48
|
-
|
|
49
|
-
|
|
69
|
+
const translateDown = (0, _reactNativeAnimation.useTranslateY)({
|
|
70
|
+
fromValue: 0,
|
|
71
|
+
toValue: windowHeight - 100,
|
|
72
|
+
duration: 1000
|
|
73
|
+
});
|
|
74
|
+
(0, _react.useEffect)(() => {
|
|
75
|
+
if (endReview) {
|
|
76
|
+
hideSlides.start();
|
|
77
|
+
}
|
|
78
|
+
}, [endReview, hideSlides]);
|
|
79
|
+
const restackingSlide = (0, _keys.default)(slides).find(k => slides[k].animationType === 'restack');
|
|
80
|
+
const unstackingSlide = (0, _keys.default)(slides).find(k => slides[k].animationType === 'unstack');
|
|
81
|
+
const remainingKeys = (0, _keys.default)(slides).filter(k => slides[k].position >= 0 && !slides[k].animationType);
|
|
82
|
+
const orderedKeys = remainingKeys.sort((k1, k2) => slides[k2].position > slides[k1].position ? 1 : -1);
|
|
83
|
+
const animatedSlide = restackingSlide || unstackingSlide;
|
|
84
|
+
(0, _react.useEffect)(() => {
|
|
85
|
+
if (restacked && orderedKeys.includes(restacked)) {
|
|
86
|
+
setRestacked(null);
|
|
87
|
+
} // this effect is required only when the list orderedKeys changes
|
|
88
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
89
|
+
|
|
90
|
+
}, [orderedKeys.toString()]);
|
|
91
|
+
(0, _react.useEffect)(() => {
|
|
92
|
+
const unstacking = unstackingSlide && !unstacked.includes(unstackingSlide);
|
|
93
|
+
|
|
94
|
+
if (unstacking) {
|
|
95
|
+
translateDown.start(() => {
|
|
96
|
+
setUnstacked([...unstacked, unstackingSlide]);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}, [unstackingSlide, unstacked, setUnstacked, translateDown]);
|
|
100
|
+
(0, _react.useEffect)(() => {
|
|
101
|
+
const restacking = restackingSlide && restacked !== restackingSlide;
|
|
102
|
+
|
|
103
|
+
if (restacking) {
|
|
104
|
+
translateDown.start(() => {
|
|
105
|
+
setRestacked(restackingSlide);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}, [restackingSlide, restacked, setRestacked, translateDown]);
|
|
109
|
+
const stackedSlides = orderedKeys.map((slideIndex, index) => {
|
|
50
110
|
const slide = slides[slideIndex];
|
|
51
111
|
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
52
|
-
num:
|
|
112
|
+
num: orderedKeys.length - index,
|
|
53
113
|
slideIndex,
|
|
54
114
|
slide,
|
|
55
115
|
validateButton,
|
|
@@ -57,9 +117,25 @@ const StackedSlides = props => {
|
|
|
57
117
|
key: slideIndex
|
|
58
118
|
});
|
|
59
119
|
});
|
|
120
|
+
|
|
121
|
+
if (animatedSlide) {
|
|
122
|
+
stackedSlides.push( /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
123
|
+
num: 0,
|
|
124
|
+
slideIndex: animatedSlide,
|
|
125
|
+
slide: slides[animatedSlide],
|
|
126
|
+
validateButton,
|
|
127
|
+
correctionPopinProps,
|
|
128
|
+
animatedStyle: [translateDown.animatedStyle],
|
|
129
|
+
key: animatedSlide
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
|
|
60
133
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
61
134
|
style: [style.slides, hideSlides.animatedStyle]
|
|
62
|
-
},
|
|
135
|
+
}, restacked ? /*#__PURE__*/_react.default.createElement(FakeSlide, {
|
|
136
|
+
position: orderedKeys.length + 1,
|
|
137
|
+
validateButton: validateButton
|
|
138
|
+
}) : null, stackedSlides);
|
|
63
139
|
};
|
|
64
140
|
|
|
65
141
|
var _default = StackedSlides;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["TOTAL_SLIDES_STACK","style","StyleSheet","create","slides","flex","height","width","StackedSlides","props","windowHeight","useWindowDimensions","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["TOTAL_SLIDES_STACK","style","StyleSheet","create","slides","flex","height","width","FakeSlide","position","validateButton","loading","StackedSlides","props","windowHeight","useWindowDimensions","endReview","correctionPopinProps","unstacked","setUnstacked","useState","restacked","setRestacked","hideSlides","useTranslateY","fromValue","toValue","duration","translateDown","useEffect","start","restackingSlide","keys","find","k","animationType","unstackingSlide","remainingKeys","filter","orderedKeys","sort","k1","k2","animatedSlide","includes","toString","unstacking","restacking","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, 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 {ReviewSlideProps} from '../review-slide/prop-types';\nimport type {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\ntype FakeSlideProps = {position: number; validateButton: ReviewSlideProps['validateButton']};\nconst FakeSlide = ({position, validateButton}: FakeSlideProps) => (\n <Slide\n num={position}\n slide={{loading: true, position}}\n slideIndex={`${position}`}\n validateButton={validateButton}\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 [restacked, setRestacked] = useState<string | null>();\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: 1000\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 animatedSlide = restackingSlide || unstackingSlide;\n\n useEffect(() => {\n if (restacked && orderedKeys.includes(restacked)) {\n setRestacked(null);\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 restacking = restackingSlide && restacked !== restackingSlide;\n\n if (restacking) {\n translateDown.start(() => {\n setRestacked(restackingSlide);\n });\n }\n }, [restackingSlide, restacked, setRestacked, translateDown]);\n\n const stackedSlides = orderedKeys.map((slideIndex, index) => {\n const slide = slides[slideIndex];\n\n return (\n <Slide\n {...{\n num: orderedKeys.length - index,\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n if (animatedSlide) {\n stackedSlides.push(\n <Slide\n {...{\n num: 0,\n slideIndex: animatedSlide,\n slide: slides[animatedSlide],\n validateButton,\n correctionPopinProps\n }}\n animatedStyle={[translateDown.animatedStyle]}\n key={animatedSlide}\n />\n );\n }\n\n return (\n <Animated.View style={[style.slides, hideSlides.animatedStyle]}>\n {restacked ? (\n <FakeSlide position={orderedKeys.length + 1} validateButton={validateButton} />\n ) : null}\n {stackedSlides}\n </Animated.View>\n );\n};\n\nexport default StackedSlides;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAIO,MAAMA,kBAAkB,GAAG,CAA3B;;;AAEP,MAAMC,KAAK,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC9BC,MAAM,EAAE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|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAqBA,oDAsCC"}
|
|
@@ -21,6 +21,8 @@ var _startBattle = _interopRequireDefault(require("../../../molecule/dashboard/s
|
|
|
21
21
|
|
|
22
22
|
var _cmPopin = _interopRequireDefault(require("../../../molecule/cm-popin"));
|
|
23
23
|
|
|
24
|
+
var _reviewBanner = _interopRequireDefault(require("../../../molecule/dashboard/review-banner"));
|
|
25
|
+
|
|
24
26
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
25
27
|
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -71,6 +73,9 @@ const Dashboard = props => {
|
|
|
71
73
|
case 'battle':
|
|
72
74
|
return /*#__PURE__*/_react.default.createElement(_startBattle.default, section);
|
|
73
75
|
|
|
76
|
+
case 'review':
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement(_reviewBanner.default, section);
|
|
78
|
+
|
|
74
79
|
default:
|
|
75
80
|
return null;
|
|
76
81
|
}
|
|
@@ -98,7 +103,7 @@ const Dashboard = props => {
|
|
|
98
103
|
Dashboard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
99
104
|
hero: Hero.propTypes.hero,
|
|
100
105
|
welcome: Hero.propTypes.welcome,
|
|
101
|
-
sections: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_battleRequestList.default.propTypes), _propTypes.default.shape(_cardsList.default.propTypes), _propTypes.default.shape(_newsList.default.propTypes), _propTypes.default.shape(_startBattle.default.propTypes)])),
|
|
106
|
+
sections: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_battleRequestList.default.propTypes), _propTypes.default.shape(_cardsList.default.propTypes), _propTypes.default.shape(_newsList.default.propTypes), _propTypes.default.shape(_startBattle.default.propTypes), _propTypes.default.shape(_reviewBanner.default.propTypes)])),
|
|
102
107
|
cookie: _propTypes.default.shape(_cmPopin.default.propTypes)
|
|
103
108
|
} : {};
|
|
104
109
|
var _default = Dashboard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Hero","React","memo","hero","welcome","style","propTypes","PropTypes","shape","HeroCard","Slide","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,IAAI,gBAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,IAAT,CAAc;EAACG,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEC,cAAA,CAAMF;EAAtB,GAA6BA,IAAI,gBAAG,6BAAC,aAAD,EAAcA,IAAd,CAAH,gBAA4B,6BAAC,cAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;;AAIAJ,IAAI,CAACM,SAAL,2CAAiB;EACfH,IAAI,EAAEI,kBAAA,CAAUC,KAAV,CAAgBC,aAAA,CAASH,SAAzB,CADS;EAEfF,OAAO,EAAEG,kBAAA,CAAUC,KAAV,CAAgBE,cAAA,CAAMJ,SAAtB;AAFM,CAAjB;;AAKA,MAAMK,SAAS,GAAGC,KAAK,IAAI;EACzB,MAAM;IAACC,QAAQ,GAAG,EAAZ;IAAgBV,IAAhB;IAAsBC,OAAtB;IAA+BU;EAA/B,IAAyCF,KAA/C;;EAEA,MAAMG,qBAAqB,GAAGC,OAAO,IAAI;IACvC,MAAM;MAACC;IAAD,IAASD,OAAf;;IACA,QAAQC,IAAR;MACE,KAAK,MAAL;QACE,oBAAO,6BAAC,IAAD;UAAM,IAAI,EAAEd,IAAZ;UAAkB,OAAO,EAAEC;QAA3B,EAAP;;MACF,KAAK,gBAAL;QACE,oBAAO,6BAAC,0BAAD,EAAuBY,OAAvB,CAAP;;MACF,KAAK,OAAL;QACE,oBAAO,6BAAC,kBAAD,EAAeA,OAAf,CAAP;;MACF,KAAK,MAAL;QACE,oBAAO,6BAAC,iBAAD,EAAcA,OAAd,CAAP;;MACF,KAAK,QAAL;QACE,oBAAO,6BAAC,oBAAD,EAAiBA,OAAjB,CAAP;;MACF;QACE,OAAO,IAAP;
|
|
1
|
+
{"version":3,"file":"index.js","names":["Hero","React","memo","hero","welcome","style","propTypes","PropTypes","shape","HeroCard","Slide","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType","BattleRequestList","CardsList","NewsList","StartBattle","ReviewBanner","CMPopin"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport ReviewBanner from '../../../molecule/dashboard/review-banner';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n case 'review':\n return <ReviewBanner {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes),\n PropTypes.shape(ReviewBanner.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,IAAI,gBAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,IAAT,CAAc;EAACG,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEC,cAAA,CAAMF;EAAtB,GAA6BA,IAAI,gBAAG,6BAAC,aAAD,EAAcA,IAAd,CAAH,gBAA4B,6BAAC,cAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;;AAIAJ,IAAI,CAACM,SAAL,2CAAiB;EACfH,IAAI,EAAEI,kBAAA,CAAUC,KAAV,CAAgBC,aAAA,CAASH,SAAzB,CADS;EAEfF,OAAO,EAAEG,kBAAA,CAAUC,KAAV,CAAgBE,cAAA,CAAMJ,SAAtB;AAFM,CAAjB;;AAKA,MAAMK,SAAS,GAAGC,KAAK,IAAI;EACzB,MAA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CADF;AAMD,CAtCD;;AAwCAH,SAAS,CAACL,SAAV,2CAAsB;EACpBH,IAAI,EAAEH,IAAI,CAACM,SAAL,CAAeH,IADD;EAEpBC,OAAO,EAAEJ,IAAI,CAACM,SAAL,CAAeF,OAFJ;EAGpBS,QAAQ,EAAEN,kBAAA,CAAUkB,OAAV,CACRlB,kBAAA,CAAUmB,SAAV,CAAoB,CAClBnB,kBAAA,CAAUC,KAAV,CAAgBmB,0BAAA,CAAkBrB,SAAlC,CADkB,EAElBC,kBAAA,CAAUC,KAAV,CAAgBoB,kBAAA,CAAUtB,SAA1B,CAFkB,EAGlBC,kBAAA,CAAUC,KAAV,CAAgBqB,iBAAA,CAASvB,SAAzB,CAHkB,EAIlBC,kBAAA,CAAUC,KAAV,CAAgBsB,oBAAA,CAAYxB,SAA5B,CAJkB,EAKlBC,kBAAA,CAAUC,KAAV,CAAgBuB,qBAAA,CAAazB,SAA7B,CALkB,CAApB,CADQ,CAHU;EAYpBQ,MAAM,EAAEP,kBAAA,CAAUC,KAAV,CAAgBwB,gBAAA,CAAQ1B,SAAxB;AAZY,CAAtB;eAceK,S"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ignore_dirs":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.0
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@coorpacademy/nova-icons": "4.0.0",
|
|
60
|
-
"@coorpacademy/react-native-animation": "1.0.
|
|
60
|
+
"@coorpacademy/react-native-animation": "1.0.2",
|
|
61
61
|
"@jwplayer/jwplayer-react": "^1.1.0",
|
|
62
62
|
"@types/react": "^17.0.50",
|
|
63
63
|
"@types/react-dom": "^17.0.17",
|
|
@@ -159,5 +159,5 @@
|
|
|
159
159
|
"last 2 versions",
|
|
160
160
|
"IE 11"
|
|
161
161
|
],
|
|
162
|
-
"gitHead": "
|
|
162
|
+
"gitHead": "0c43475294a1468b4df0757042b3cb069cbe06e1"
|
|
163
163
|
}
|