@coorpacademy/components 10.30.4 → 10.30.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/organism/review-slide/index.native.d.ts.map +1 -1
- package/es/organism/review-slide/index.native.js +57 -39
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/organism/review-slide/prop-types.d.ts +5 -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/template/app-player/popin-correction/style.css +1 -0
- package/lib/organism/review-slide/index.native.d.ts.map +1 -1
- package/lib/organism/review-slide/index.native.js +59 -41
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/organism/review-slide/prop-types.d.ts +5 -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/template/app-player/popin-correction/style.css +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAa,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAa,gBAAgB,EAAkC,MAAM,cAAc,CAAC;AA0N3F,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBA8CrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -64,24 +64,56 @@ const CorrectionPopin = ({
|
|
|
64
64
|
}]
|
|
65
65
|
})
|
|
66
66
|
}, /*#__PURE__*/React.createElement(ReviewCorrectionPopin, _correctionPopinProps));
|
|
67
|
-
};
|
|
68
|
-
// const {label, onClick, disabled} = validateButton;
|
|
69
|
-
// const validateButtonProps = {
|
|
70
|
-
// type: 'primary',
|
|
71
|
-
// label,
|
|
72
|
-
// 'aria-label': label,
|
|
73
|
-
// 'data-name': `slide-validate-button-${slideIndex}`,
|
|
74
|
-
// onClick,
|
|
75
|
-
// disabled,
|
|
76
|
-
// customStyle: {
|
|
77
|
-
// backgroundColor: primarySkinColor
|
|
78
|
-
// }
|
|
79
|
-
// };
|
|
80
|
-
// return <Button title="validate todo" />;
|
|
81
|
-
// };
|
|
67
|
+
};
|
|
82
68
|
|
|
69
|
+
const createValidateButtonStyle = (theme, brandTheme) => StyleSheet.create({
|
|
70
|
+
validateButton: {
|
|
71
|
+
backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,
|
|
72
|
+
borderRadius: 7,
|
|
73
|
+
width: '100%'
|
|
74
|
+
},
|
|
75
|
+
validateButtonText: {
|
|
76
|
+
fontSize: 14,
|
|
77
|
+
lineHeight: 20,
|
|
78
|
+
fontWeight: theme.fontWeight.bold,
|
|
79
|
+
color: theme.colors.white,
|
|
80
|
+
marginBottom: theme.spacing.small,
|
|
81
|
+
marginTop: theme.spacing.small,
|
|
82
|
+
textAlign: 'center'
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const ValidateButton = ({
|
|
87
|
+
slideIndex,
|
|
88
|
+
validateButton
|
|
89
|
+
}) => {
|
|
90
|
+
const {
|
|
91
|
+
label,
|
|
92
|
+
onClick,
|
|
93
|
+
disabled
|
|
94
|
+
} = validateButton;
|
|
95
|
+
const {
|
|
96
|
+
theme,
|
|
97
|
+
brandTheme
|
|
98
|
+
} = useTemplateContext();
|
|
99
|
+
const [style, setStyle] = useState();
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
const buttonStyle = createValidateButtonStyle(theme, brandTheme);
|
|
102
|
+
setStyle(buttonStyle);
|
|
103
|
+
}, [theme, brandTheme]);
|
|
104
|
+
if (!style) return null;
|
|
105
|
+
return /*#__PURE__*/React.createElement(Touchable, {
|
|
106
|
+
style: style.validateButton,
|
|
107
|
+
onPress: onClick,
|
|
108
|
+
disabled: disabled,
|
|
109
|
+
accessibilityLabel: label,
|
|
110
|
+
testID: `slide-validate-button-${slideIndex}`
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
112
|
+
style: style.validateButtonText
|
|
113
|
+
}, label));
|
|
114
|
+
};
|
|
83
115
|
|
|
84
|
-
const createQuestionStyle =
|
|
116
|
+
const createQuestionStyle = theme => StyleSheet.create({
|
|
85
117
|
questionHeading: {
|
|
86
118
|
justifyContent: 'space-between'
|
|
87
119
|
},
|
|
@@ -112,20 +144,6 @@ const createQuestionStyle = (theme, brandTheme) => StyleSheet.create({
|
|
|
112
144
|
flex: 1,
|
|
113
145
|
width: '100%',
|
|
114
146
|
justifyContent: 'center'
|
|
115
|
-
},
|
|
116
|
-
validateButton: {
|
|
117
|
-
backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,
|
|
118
|
-
borderRadius: 7,
|
|
119
|
-
width: '100%'
|
|
120
|
-
},
|
|
121
|
-
validateButtonText: {
|
|
122
|
-
fontSize: 14,
|
|
123
|
-
lineHeight: 20,
|
|
124
|
-
fontWeight: '700',
|
|
125
|
-
color: theme.colors.white,
|
|
126
|
-
marginBottom: 16,
|
|
127
|
-
marginTop: 16,
|
|
128
|
-
textAlign: 'center'
|
|
129
147
|
}
|
|
130
148
|
});
|
|
131
149
|
|
|
@@ -136,14 +154,13 @@ const Question = props => {
|
|
|
136
154
|
questionOrigin
|
|
137
155
|
} = props;
|
|
138
156
|
const {
|
|
139
|
-
theme
|
|
140
|
-
brandTheme
|
|
157
|
+
theme
|
|
141
158
|
} = useTemplateContext();
|
|
142
159
|
const [style, setStyle] = useState();
|
|
143
160
|
useEffect(() => {
|
|
144
|
-
const questionStyle = createQuestionStyle(theme
|
|
161
|
+
const questionStyle = createQuestionStyle(theme);
|
|
145
162
|
setStyle(questionStyle);
|
|
146
|
-
}, [theme
|
|
163
|
+
}, [theme]);
|
|
147
164
|
if (!answerUI || !questionText || !style) return null;
|
|
148
165
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
149
166
|
style: style.questionHeading
|
|
@@ -155,11 +172,7 @@ const Question = props => {
|
|
|
155
172
|
style: style.questionHelp
|
|
156
173
|
}, get('help', answerUI))), /*#__PURE__*/React.createElement(View, {
|
|
157
174
|
style: style.choicesContainer
|
|
158
|
-
}, /*#__PURE__*/React.createElement(Answer, answerUI))
|
|
159
|
-
style: style.validateButton
|
|
160
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
161
|
-
style: style.validateButtonText
|
|
162
|
-
}, "@todo validate")));
|
|
175
|
+
}, /*#__PURE__*/React.createElement(Answer, answerUI)));
|
|
163
176
|
};
|
|
164
177
|
|
|
165
178
|
const createSlideStyle = (num, screenWidth) => {
|
|
@@ -193,6 +206,7 @@ const Slide = props => {
|
|
|
193
206
|
const {
|
|
194
207
|
slide,
|
|
195
208
|
correctionPopinProps,
|
|
209
|
+
validateButton,
|
|
196
210
|
num,
|
|
197
211
|
slideIndex = '0'
|
|
198
212
|
} = props;
|
|
@@ -218,6 +232,10 @@ const Slide = props => {
|
|
|
218
232
|
questionText: questionText,
|
|
219
233
|
answerUI: answerUI,
|
|
220
234
|
key: "question-container"
|
|
235
|
+
}), /*#__PURE__*/React.createElement(ValidateButton, {
|
|
236
|
+
slideIndex: slideIndex,
|
|
237
|
+
validateButton: validateButton,
|
|
238
|
+
key: "validate-button"
|
|
221
239
|
}), correctionPopinProps ? /*#__PURE__*/React.createElement(CorrectionPopin, {
|
|
222
240
|
correctionPopinProps: correctionPopinProps,
|
|
223
241
|
slideIndex: slideIndex,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useCallback","useEffect","useState","useRef","Animated","Easing","StyleSheet","useWindowDimensions","View","get","getOr","Text","Answer","ReviewCorrectionPopin","useTemplateContext","Touchable","styles","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateAnim","Value","current","translateYAnim","timing","toValue","duration","easing","bezier","useNativeDriver","start","klf","undefined","information","label","message","next","onClick","_correctionPopinProps","type","resultLabel","transform","translateY","createQuestionStyle","theme","brandTheme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","validateButton","backgroundColor","borderRadius","validateButtonText","white","Question","props","answerUI","style","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","slideStyle","loading","parentContentTitle"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState, useRef} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateAnim = useRef(new Animated.Value(1000)).current;\n\n const translateYAnim = useCallback(() => {\n Animated.timing(translateAnim, {\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1),\n useNativeDriver: true\n }).start();\n }, [translateAnim]);\n\n if (animateCorrectionPopin) {\n translateYAnim();\n }\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n return (\n <Animated.View\n style={{\n ...styles.correctionPopinWrapper,\n transform: [\n {\n translateY: translateAnim\n }\n ]\n }}\n >\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\n// const ValidateButton = ({slideIndex, validateButton, primarySkinColor}) => {\n// const {label, onClick, disabled} = validateButton;\n// const validateButtonProps = {\n// type: 'primary',\n// label,\n// 'aria-label': label,\n// 'data-name': `slide-validate-button-${slideIndex}`,\n// onClick,\n// disabled,\n// customStyle: {\n// backgroundColor: primarySkinColor\n// }\n// };\n\n// return <Button title=\"validate todo\" />;\n// };\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n validateButton: ViewStyle;\n validateButtonText: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme, brandTheme: Brand): 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 validateButton: {\n backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,\n borderRadius: 7,\n width: '100%'\n },\n validateButtonText: {\n fontSize: 14,\n lineHeight: 20,\n fontWeight: '700',\n color: theme.colors.white,\n marginBottom: 16,\n marginTop: 16,\n textAlign: '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, brandTheme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme, brandTheme);\n setStyle(questionStyle);\n }, [theme, brandTheme]);\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 <Touchable style={style.validateButton}>\n <Text style={style.validateButtonText}>@todo validate</Text>\n </Touchable>\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, 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 return (\n <View style={slideStyle.slide}>\n {loading ? (\n // <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n <Text>@todo loader {num}</Text>\n ) : (\n <>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\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 </>\n )}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,QAAvC,EAAiDC,MAAjD,QAA8D,OAA9D;AACA,SACEC,QADF,EAEEC,MAFF,EAGEC,UAHF,EAKEC,mBALF,EAMEC,IANF,QAQO,cARP;AASA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,8BAAjB;AACA,OAAOC,MAAP,MAAmB,oCAAnB;AACA,OAAOC,qBAAP,MAAkC,qDAAlC;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,SAAP,MAAsB,kCAAtB;AAIA,MAAMC,MAAM,GAAGV,UAAU,CAACW,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,aAAa,GAAGxB,MAAM,CAAC,IAAIC,QAAQ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BAAmB,EAAnC;EACA,MAAM8F,UAAU,GAAGf,gBAAgB,CAACC,GAAD,EAAMlE,KAAN,CAAnC;EAEA,MAAM;IACJiF,OADI;IAEJC,kBAFI;IAGJnC,YAHI;IAIJc,QAJI;IAKJzD,mBALI;IAMJC;EANI,IAOFgE,KAPJ;EASA,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAEW,UAAU,CAACX;EAAxB,GACGY,OAAO;EAAA;EACN;EACA,oBAAC,IAAD,yBAAoBf,GAApB,CAFM,gBAIN,uDACE,oBAAC,QAAD;IACE,cAAc,EAAEgB,kBADlB;IAEE,YAAY,EAAEnC,YAFhB;IAGE,QAAQ,EAAEc,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,EAOG3D,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,IAfN,CALJ,CADF;AA0BD,CAzCD;;AA2CA,eAAe0E,KAAf"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useCallback","useEffect","useState","useRef","Animated","Easing","StyleSheet","useWindowDimensions","View","get","getOr","Text","Answer","ReviewCorrectionPopin","useTemplateContext","Touchable","styles","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateAnim","Value","current","translateYAnim","timing","toValue","duration","easing","bezier","useNativeDriver","start","klf","undefined","information","label","message","next","onClick","_correctionPopinProps","type","resultLabel","transform","translateY","createValidateButtonStyle","theme","brandTheme","validateButton","backgroundColor","colors","primary","text","borderRadius","validateButtonText","fontSize","lineHeight","fontWeight","bold","color","white","marginBottom","spacing","small","marginTop","textAlign","ValidateButton","disabled","style","setStyle","buttonStyle","createQuestionStyle","questionHeading","justifyContent","questionOrigin","tiny","questionText","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","slideStyle","loading","parentContentTitle"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState, useRef} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {PopinProps, ReviewSlideProps, SlideProps, ValidateButtonProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateAnim = useRef(new Animated.Value(1000)).current;\n\n const translateYAnim = useCallback(() => {\n Animated.timing(translateAnim, {\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1),\n useNativeDriver: true\n }).start();\n }, [translateAnim]);\n\n if (animateCorrectionPopin) {\n translateYAnim();\n }\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n return (\n <Animated.View\n style={{\n ...styles.correctionPopinWrapper,\n transform: [\n {\n translateY: translateAnim\n }\n ]\n }}\n >\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleValidateButtonType = {\n validateButton: ViewStyle;\n validateButtonText: ViewStyle;\n};\n\nconst createValidateButtonStyle = (theme: Theme, brandTheme: Brand): StyleValidateButtonType =>\n StyleSheet.create({\n validateButton: {\n backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,\n borderRadius: 7,\n width: '100%'\n },\n validateButtonText: {\n fontSize: 14,\n lineHeight: 20,\n fontWeight: theme.fontWeight.bold,\n color: theme.colors.white,\n marginBottom: theme.spacing.small,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n }\n });\n\nconst ValidateButton = ({slideIndex, validateButton}: ValidateButtonProps) => {\n const {label, onClick, disabled} = validateButton;\n const {theme, brandTheme} = useTemplateContext();\n const [style, setStyle] = useState<StyleValidateButtonType>();\n\n useEffect(() => {\n const buttonStyle = createValidateButtonStyle(theme, brandTheme);\n setStyle(buttonStyle);\n }, [theme, brandTheme]);\n\n if (!style) return null;\n\n return (\n <Touchable\n style={style.validateButton}\n onPress={onClick}\n disabled={disabled}\n accessibilityLabel={label}\n testID={`slide-validate-button-${slideIndex}`}\n >\n <Text style={style.validateButtonText}>{label}</Text>\n </Touchable>\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 return (\n <View style={slideStyle.slide}>\n {loading ? (\n // <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n <Text>@todo loader {num}</Text>\n ) : (\n <>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <ValidateButton\n slideIndex={slideIndex}\n validateButton={validateButton}\n key=\"validate-button\"\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 </>\n )}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,QAAvC,EAAiDC,MAAjD,QAA8D,OAA9D;AACA,SACEC,QADF,EAEEC,MAFF,EAGEC,UAHF,EAKEC,mBALF,EAMEC,IANF,QAQO,cARP;AASA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,8BAAjB;AACA,OAAOC,MAAP,MAAmB,oCAAnB;AACA,OAAOC,qBAAP,MAAkC,qDAAlC;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,SAAP,MAAsB,kCAAtB;AAIA,MAAMC,MAAM,GAAGV,UAAU,CAACW,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,aAAa,GAAGxB,MAAM,CAAC,IAAIC,QAAQ,CAACwB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IAGE,GAAG,EAAC;EAHN,EAPF,EAYG9B,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,IApBN,CALJ,CADF;AA+BD,CA9CD;;AAgDA,eAAe+E,KAAf"}
|
|
@@ -182,6 +182,11 @@ export declare type PopinProps = {
|
|
|
182
182
|
showCorrectionPopin?: boolean;
|
|
183
183
|
animateCorrectionPopin?: boolean;
|
|
184
184
|
};
|
|
185
|
+
export declare type ValidateButtonProps = {
|
|
186
|
+
slideIndex: string;
|
|
187
|
+
validateButton: ReviewSlideProps['validateButton'];
|
|
188
|
+
primarySkinColor?: string;
|
|
189
|
+
};
|
|
185
190
|
export declare type SlideProps = {
|
|
186
191
|
position: number;
|
|
187
192
|
loading: boolean;
|
|
@@ -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,EAAC,MAAM,kCAAkC,CAAC;AAE9E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAY1B,CAAC;AAEH,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,UAAU,GAAG;IACvB,oBAAoB,EAAE,0BAA0B,CAAC;IACjD,UAAU,EAA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.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';\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 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"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,8BAAP,MAEO,mDAFP;AAGA,OAAOC,eAAP,MAA2C,kCAA3C;AAEA,OAAO,MAAMC,eAAe,GAAGH,SAAS,CAACI,KAAV,CAAgB;EAC7CC,QAAQ,EAAEL,SAAS,CAACM,MADyB;EAE7CC,OAAO,EAAEP,SAAS,CAACQ,IAF0B;EAG7CC,gBAAgB,EAAET,SAAS,CAACU,MAHiB;EAI7CC,aAAa,EAAEX,SAAS,CAACU,MAJoB;EAIZ;EACjCE,SAAS,EAAEZ,SAAS,CAACQ,IALwB;EAM7CK,sBAAsB,EAAEb,SAAS,CAACQ,IANW;EAO7CM,mBAAmB,EAAEd,SAAS,CAACQ,IAPc;EAQ7CO,cAAc,EAAEf,SAAS,CAACQ,IARmB;EAS7CQ,kBAAkB,EAAEhB,SAAS,CAACU,MATe;EAU7CO,YAAY,EAAEjB,SAAS,CAACU,MAVqB;EAW7CQ,QAAQ,EAAElB,SAAS,CAACI,KAAV,CAAgBF,eAAhB;AAXmC,CAAhB,CAAxB;AAcP,MAAMiB,SAAS,GAAG;EAChBC,UAAU,EAAEpB,SAAS,CAACU,MADN;EAEhBW,KAAK,EAAElB,eAFS;EAGhBmB,cAAc,EAAEtB,SAAS,CAACI,KAAV,CAAgB;IAC9BmB,KAAK,EAAEvB,SAAS,CAACU,MAAV,CAAiBc,UADM;IAE9BC,OAAO,EAAEzB,SAAS,CAAC0B,IAAV,CAAeF,UAFM;IAG9BG,QAAQ,EAAE3B,SAAS,CAACQ;EAHU,CAAhB,CAHA;EAQhBoB,oBAAoB,EAAE5B,SAAS,CAACI,KAAV,CAAgB;IACpCyB,GAAG,EAAE5B,8BAA8B,CAAC4B,GADA;IAEpCC,WAAW,EAAE7B,8BAA8B,CAAC6B,WAFR;IAGpCC,IAAI,EAAE/B,SAAS,CAACI,KAAV,CAAgB;MACpBmB,KAAK,EAAEvB,SAAS,CAACU,MADG;MAEpB,cAAcV,SAAS,CAACU,MAFJ,CAEW;MAC/B;;IAHoB,CAAhB,CAH8B;IAQpCsB,WAAW,EAAE/B,8BAA8B,CAAC+B,WARR;IASpCC,IAAI,EAAEhC,8BAA8B,CAACgC;EATD,CAAhB;AARN,CAAlB;AAqBA,eAAed,SAAf"}
|
|
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';\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"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,8BAAP,MAEO,mDAFP;AAGA,OAAOC,eAAP,MAA2C,kCAA3C;AAEA,OAAO,MAAMC,eAAe,GAAGH,SAAS,CAACI,KAAV,CAAgB;EAC7CC,QAAQ,EAAEL,SAAS,CAACM,MADyB;EAE7CC,OAAO,EAAEP,SAAS,CAACQ,IAF0B;EAG7CC,gBAAgB,EAAET,SAAS,CAACU,MAHiB;EAI7CC,aAAa,EAAEX,SAAS,CAACU,MAJoB;EAIZ;EACjCE,SAAS,EAAEZ,SAAS,CAACQ,IALwB;EAM7CK,sBAAsB,EAAEb,SAAS,CAACQ,IANW;EAO7CM,mBAAmB,EAAEd,SAAS,CAACQ,IAPc;EAQ7CO,cAAc,EAAEf,SAAS,CAACQ,IARmB;EAS7CQ,kBAAkB,EAAEhB,SAAS,CAACU,MATe;EAU7CO,YAAY,EAAEjB,SAAS,CAACU,MAVqB;EAW7CQ,QAAQ,EAAElB,SAAS,CAACI,KAAV,CAAgBF,eAAhB;AAXmC,CAAhB,CAAxB;AAcP,MAAMiB,SAAS,GAAG;EAChBC,UAAU,EAAEpB,SAAS,CAACU,MADN;EAEhBW,KAAK,EAAElB,eAFS;EAGhBmB,cAAc,EAAEtB,SAAS,CAACI,KAAV,CAAgB;IAC9BmB,KAAK,EAAEvB,SAAS,CAACU,MAAV,CAAiBc,UADM;IAE9BC,OAAO,EAAEzB,SAAS,CAAC0B,IAAV,CAAeF,UAFM;IAG9BG,QAAQ,EAAE3B,SAAS,CAACQ;EAHU,CAAhB,CAHA;EAQhBoB,oBAAoB,EAAE5B,SAAS,CAACI,KAAV,CAAgB;IACpCyB,GAAG,EAAE5B,8BAA8B,CAAC4B,GADA;IAEpCC,WAAW,EAAE7B,8BAA8B,CAAC6B,WAFR;IAGpCC,IAAI,EAAE/B,SAAS,CAACI,KAAV,CAAgB;MACpBmB,KAAK,EAAEvB,SAAS,CAACU,MADG;MAEpB,cAAcV,SAAS,CAACU,MAFJ,CAEW;MAC/B;;IAHoB,CAAhB,CAH8B;IAQpCsB,WAAW,EAAE/B,8BAA8B,CAAC+B,WARR;IASpCC,IAAI,EAAEhC,8BAA8B,CAACgC;EATD,CAAhB;AARN,CAAlB;AAqBA,eAAed,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAa,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAa,gBAAgB,EAAkC,MAAM,cAAc,CAAC;AA0N3F,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBA8CrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -84,24 +84,56 @@ const CorrectionPopin = ({
|
|
|
84
84
|
}]
|
|
85
85
|
})
|
|
86
86
|
}, /*#__PURE__*/_react.default.createElement(_index3.default, _correctionPopinProps));
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const createValidateButtonStyle = (theme, brandTheme) => _reactNative.StyleSheet.create({
|
|
90
|
+
validateButton: {
|
|
91
|
+
backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,
|
|
92
|
+
borderRadius: 7,
|
|
93
|
+
width: '100%'
|
|
94
|
+
},
|
|
95
|
+
validateButtonText: {
|
|
96
|
+
fontSize: 14,
|
|
97
|
+
lineHeight: 20,
|
|
98
|
+
fontWeight: theme.fontWeight.bold,
|
|
99
|
+
color: theme.colors.white,
|
|
100
|
+
marginBottom: theme.spacing.small,
|
|
101
|
+
marginTop: theme.spacing.small,
|
|
102
|
+
textAlign: 'center'
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const ValidateButton = ({
|
|
107
|
+
slideIndex,
|
|
108
|
+
validateButton
|
|
109
|
+
}) => {
|
|
110
|
+
const {
|
|
111
|
+
label,
|
|
112
|
+
onClick,
|
|
113
|
+
disabled
|
|
114
|
+
} = validateButton;
|
|
115
|
+
const {
|
|
116
|
+
theme,
|
|
117
|
+
brandTheme
|
|
118
|
+
} = (0, _templateContext.useTemplateContext)();
|
|
119
|
+
const [style, setStyle] = (0, _react.useState)();
|
|
120
|
+
(0, _react.useEffect)(() => {
|
|
121
|
+
const buttonStyle = createValidateButtonStyle(theme, brandTheme);
|
|
122
|
+
setStyle(buttonStyle);
|
|
123
|
+
}, [theme, brandTheme]);
|
|
124
|
+
if (!style) return null;
|
|
125
|
+
return /*#__PURE__*/_react.default.createElement(_index4.default, {
|
|
126
|
+
style: style.validateButton,
|
|
127
|
+
onPress: onClick,
|
|
128
|
+
disabled: disabled,
|
|
129
|
+
accessibilityLabel: label,
|
|
130
|
+
testID: `slide-validate-button-${slideIndex}`
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
132
|
+
style: style.validateButtonText
|
|
133
|
+
}, label));
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const createQuestionStyle = theme => _reactNative.StyleSheet.create({
|
|
105
137
|
questionHeading: {
|
|
106
138
|
justifyContent: 'space-between'
|
|
107
139
|
},
|
|
@@ -132,20 +164,6 @@ const createQuestionStyle = (theme, brandTheme) => _reactNative.StyleSheet.creat
|
|
|
132
164
|
flex: 1,
|
|
133
165
|
width: '100%',
|
|
134
166
|
justifyContent: 'center'
|
|
135
|
-
},
|
|
136
|
-
validateButton: {
|
|
137
|
-
backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,
|
|
138
|
-
borderRadius: 7,
|
|
139
|
-
width: '100%'
|
|
140
|
-
},
|
|
141
|
-
validateButtonText: {
|
|
142
|
-
fontSize: 14,
|
|
143
|
-
lineHeight: 20,
|
|
144
|
-
fontWeight: '700',
|
|
145
|
-
color: theme.colors.white,
|
|
146
|
-
marginBottom: 16,
|
|
147
|
-
marginTop: 16,
|
|
148
|
-
textAlign: 'center'
|
|
149
167
|
}
|
|
150
168
|
});
|
|
151
169
|
|
|
@@ -156,14 +174,13 @@ const Question = props => {
|
|
|
156
174
|
questionOrigin
|
|
157
175
|
} = props;
|
|
158
176
|
const {
|
|
159
|
-
theme
|
|
160
|
-
brandTheme
|
|
177
|
+
theme
|
|
161
178
|
} = (0, _templateContext.useTemplateContext)();
|
|
162
179
|
const [style, setStyle] = (0, _react.useState)();
|
|
163
180
|
(0, _react.useEffect)(() => {
|
|
164
|
-
const questionStyle = createQuestionStyle(theme
|
|
181
|
+
const questionStyle = createQuestionStyle(theme);
|
|
165
182
|
setStyle(questionStyle);
|
|
166
|
-
}, [theme
|
|
183
|
+
}, [theme]);
|
|
167
184
|
if (!answerUI || !questionText || !style) return null;
|
|
168
185
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
169
186
|
style: style.questionHeading
|
|
@@ -175,11 +192,7 @@ const Question = props => {
|
|
|
175
192
|
style: style.questionHelp
|
|
176
193
|
}, (0, _get.default)('help', answerUI))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
177
194
|
style: style.choicesContainer
|
|
178
|
-
}, /*#__PURE__*/_react.default.createElement(_index2.default, answerUI))
|
|
179
|
-
style: style.validateButton
|
|
180
|
-
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
181
|
-
style: style.validateButtonText
|
|
182
|
-
}, "@todo validate")));
|
|
195
|
+
}, /*#__PURE__*/_react.default.createElement(_index2.default, answerUI)));
|
|
183
196
|
};
|
|
184
197
|
|
|
185
198
|
const createSlideStyle = (num, screenWidth) => {
|
|
@@ -213,6 +226,7 @@ const Slide = props => {
|
|
|
213
226
|
const {
|
|
214
227
|
slide,
|
|
215
228
|
correctionPopinProps,
|
|
229
|
+
validateButton,
|
|
216
230
|
num,
|
|
217
231
|
slideIndex = '0'
|
|
218
232
|
} = props;
|
|
@@ -238,6 +252,10 @@ const Slide = props => {
|
|
|
238
252
|
questionText: questionText,
|
|
239
253
|
answerUI: answerUI,
|
|
240
254
|
key: "question-container"
|
|
255
|
+
}), /*#__PURE__*/_react.default.createElement(ValidateButton, {
|
|
256
|
+
slideIndex: slideIndex,
|
|
257
|
+
validateButton: validateButton,
|
|
258
|
+
key: "validate-button"
|
|
241
259
|
}), correctionPopinProps ? /*#__PURE__*/_react.default.createElement(CorrectionPopin, {
|
|
242
260
|
correctionPopinProps: correctionPopinProps,
|
|
243
261
|
slideIndex: slideIndex,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateAnim","useRef","Animated","Value","current","translateYAnim","useCallback","timing","toValue","duration","easing","Easing","bezier","useNativeDriver","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","transform","translateY","createQuestionStyle","theme","brandTheme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","validateButton","backgroundColor","borderRadius","validateButtonText","white","Question","props","answerUI","useTemplateContext","style","setStyle","useState","useEffect","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","useWindowDimensions","slideStyle","loading","parentContentTitle"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState, useRef} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateAnim = useRef(new Animated.Value(1000)).current;\n\n const translateYAnim = useCallback(() => {\n Animated.timing(translateAnim, {\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1),\n useNativeDriver: true\n }).start();\n }, [translateAnim]);\n\n if (animateCorrectionPopin) {\n translateYAnim();\n }\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n return (\n <Animated.View\n style={{\n ...styles.correctionPopinWrapper,\n transform: [\n {\n translateY: translateAnim\n }\n ]\n }}\n >\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\n// const ValidateButton = ({slideIndex, validateButton, primarySkinColor}) => {\n// const {label, onClick, disabled} = validateButton;\n// const validateButtonProps = {\n// type: 'primary',\n// label,\n// 'aria-label': label,\n// 'data-name': `slide-validate-button-${slideIndex}`,\n// onClick,\n// disabled,\n// customStyle: {\n// backgroundColor: primarySkinColor\n// }\n// };\n\n// return <Button title=\"validate todo\" />;\n// };\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n validateButton: ViewStyle;\n validateButtonText: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme, brandTheme: Brand): 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 validateButton: {\n backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,\n borderRadius: 7,\n width: '100%'\n },\n validateButtonText: {\n fontSize: 14,\n lineHeight: 20,\n fontWeight: '700',\n color: theme.colors.white,\n marginBottom: 16,\n marginTop: 16,\n textAlign: '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, brandTheme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme, brandTheme);\n setStyle(questionStyle);\n }, [theme, brandTheme]);\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 <Touchable style={style.validateButton}>\n <Text style={style.validateButtonText}>@todo validate</Text>\n </Touchable>\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, 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 return (\n <View style={slideStyle.slide}>\n {loading ? (\n // <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n <Text>@todo loader {num}</Text>\n ) : (\n <>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\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 </>\n )}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAIA,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;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B,KAAK,GAAItB,KAAD,IAA6B;EACzC,MAAM;IAACY,KAAD;IAAQ5E,oBAAR;IAA8ByE,GAA9B;IAAmCxE,UAAU,GAAG;EAAhD,IAAuD+D,KAA7D;EAEA,MAAM;IAAClE;EAAD,IAAU,IAAAyF,gCAAA,GAAhB;EACA,MAAMC,UAAU,GAAGhB,gBAAgB,CAACC,GAAD,EAAM3E,KAAN,CAAnC;EAEA,MAAM;IACJ2F,OADI;IAEJC,kBAFI;IAGJvC,YAHI;IAIJc,QAJI;IAKJ/D,mBALI;IAMJC;EANI,IAOFyE,KAPJ;EASA,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEY,UAAU,CAACZ;EAAxB,GACGa,OAAO;EAAA;EACN;EACA,6BAAC,cAAD,yBAAoBhB,GAApB,CAFM,gBAIN,yEACE,6BAAC,QAAD;IACE,cAAc,EAAEiB,kBADlB;IAEE,YAAY,EAAEvC,YAFhB;IAGE,QAAQ,EAAEc,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,EAOGjE,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,IAfN,CALJ,CADF;AA0BD,CAzCD;;eA2CemF,K"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateAnim","useRef","Animated","Value","current","translateYAnim","useCallback","timing","toValue","duration","easing","Easing","bezier","useNativeDriver","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","transform","translateY","createValidateButtonStyle","theme","brandTheme","validateButton","backgroundColor","colors","primary","text","borderRadius","validateButtonText","fontSize","lineHeight","fontWeight","bold","color","white","marginBottom","spacing","small","marginTop","textAlign","ValidateButton","disabled","useTemplateContext","style","setStyle","useState","useEffect","buttonStyle","createQuestionStyle","questionHeading","justifyContent","questionOrigin","tiny","questionText","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","useWindowDimensions","slideStyle","loading","parentContentTitle"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState, useRef} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {PopinProps, ReviewSlideProps, SlideProps, ValidateButtonProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateAnim = useRef(new Animated.Value(1000)).current;\n\n const translateYAnim = useCallback(() => {\n Animated.timing(translateAnim, {\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1),\n useNativeDriver: true\n }).start();\n }, [translateAnim]);\n\n if (animateCorrectionPopin) {\n translateYAnim();\n }\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n return (\n <Animated.View\n style={{\n ...styles.correctionPopinWrapper,\n transform: [\n {\n translateY: translateAnim\n }\n ]\n }}\n >\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleValidateButtonType = {\n validateButton: ViewStyle;\n validateButtonText: ViewStyle;\n};\n\nconst createValidateButtonStyle = (theme: Theme, brandTheme: Brand): StyleValidateButtonType =>\n StyleSheet.create({\n validateButton: {\n backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,\n borderRadius: 7,\n width: '100%'\n },\n validateButtonText: {\n fontSize: 14,\n lineHeight: 20,\n fontWeight: theme.fontWeight.bold,\n color: theme.colors.white,\n marginBottom: theme.spacing.small,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n }\n });\n\nconst ValidateButton = ({slideIndex, validateButton}: ValidateButtonProps) => {\n const {label, onClick, disabled} = validateButton;\n const {theme, brandTheme} = useTemplateContext();\n const [style, setStyle] = useState<StyleValidateButtonType>();\n\n useEffect(() => {\n const buttonStyle = createValidateButtonStyle(theme, brandTheme);\n setStyle(buttonStyle);\n }, [theme, brandTheme]);\n\n if (!style) return null;\n\n return (\n <Touchable\n style={style.validateButton}\n onPress={onClick}\n disabled={disabled}\n accessibilityLabel={label}\n testID={`slide-validate-button-${slideIndex}`}\n >\n <Text style={style.validateButtonText}>{label}</Text>\n </Touchable>\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 return (\n <View style={slideStyle.slide}>\n {loading ? (\n // <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n <Text>@todo loader {num}</Text>\n ) : (\n <>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <ValidateButton\n slideIndex={slideIndex}\n validateButton={validateButton}\n key=\"validate-button\"\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 </>\n )}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAIA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,aAAa,GAAG,IAAAC,aAAA,EAAO,IAAIC,qBAAA,CAASC,KAAb,CAAmB,IAAnB,CAAP,EAAiCC,OAAvD;EAEA,MAAMC,cAAc,GAAG,IAAAC,kBAAA,EAAY,MAAM;IACvCJ,qBAAA,CAASK,MAAT,CAAgBP,aAAhB,EAA+B;MAC7BQ,OAAO,EAAE,CADoB;MAE7BC,QAAQ,EAAE,GAFmB;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mB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IApBN,CALJ,CADF;AA+BD,CA9CD;;eAgDewF,K"}
|
|
@@ -182,6 +182,11 @@ export declare type PopinProps = {
|
|
|
182
182
|
showCorrectionPopin?: boolean;
|
|
183
183
|
animateCorrectionPopin?: boolean;
|
|
184
184
|
};
|
|
185
|
+
export declare type ValidateButtonProps = {
|
|
186
|
+
slideIndex: string;
|
|
187
|
+
validateButton: ReviewSlideProps['validateButton'];
|
|
188
|
+
primarySkinColor?: string;
|
|
189
|
+
};
|
|
185
190
|
export declare type SlideProps = {
|
|
186
191
|
position: number;
|
|
187
192
|
loading: boolean;
|
|
@@ -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,EAAC,MAAM,kCAAkC,CAAC;AAE9E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAY1B,CAAC;AAEH,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,UAAU,GAAG;IACvB,oBAAoB,EAAE,0BAA0B,CAAC;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,QAAQ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AU,GAAG;IACvB,oBAAoB,EAAE,0BAA0B,CAAC;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,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;CACH,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';\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 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"],"mappings":";;;;;AAAA;;AACA;;AAGA;;;;AAEO,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
|
+
{"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';\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"],"mappings":";;;;;AAAA;;AACA;;AAGA;;;;AAEO,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.30.
|
|
3
|
+
"version": "10.30.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -157,5 +157,5 @@
|
|
|
157
157
|
"last 2 versions",
|
|
158
158
|
"IE 11"
|
|
159
159
|
],
|
|
160
|
-
"gitHead": "
|
|
160
|
+
"gitHead": "1e5585f9348c66d56f0d690a4533f74c8301b28f"
|
|
161
161
|
}
|