@coorpacademy/components 10.30.4-alpha.2 → 10.30.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/es/atom/choice/index.native.js +2 -4
  2. package/es/atom/choice/index.native.js.map +1 -1
  3. package/es/atom/html/index.native.js +1 -3
  4. package/es/atom/html/index.native.js.map +1 -1
  5. package/es/atom/review-presentation/index.native.js +56 -60
  6. package/es/atom/review-presentation/index.native.js.map +1 -1
  7. package/es/hoc/modal/select/index.native.js +3 -3
  8. package/es/hoc/modal/select/index.native.js.map +1 -1
  9. package/es/hoc/modal/select-item/index.native.js +13 -17
  10. package/es/hoc/modal/select-item/index.native.js.map +1 -1
  11. package/es/hoc/touchable/index.native.js +2 -2
  12. package/es/hoc/touchable/index.native.js.map +1 -1
  13. package/es/molecule/dashboard/cards-list/index.js +3 -7
  14. package/es/molecule/dashboard/cards-list/index.js.map +1 -1
  15. package/es/molecule/questions/free-text/index.native.js +26 -30
  16. package/es/molecule/questions/free-text/index.native.js.map +1 -1
  17. package/es/molecule/questions/mobile/slider/index.native.js +3 -5
  18. package/es/molecule/questions/mobile/slider/index.native.js.map +1 -1
  19. package/es/molecule/questions/mobile/template/index.native.js +1 -3
  20. package/es/molecule/questions/mobile/template/index.native.js.map +1 -1
  21. package/es/organism/review-congrats/index.js +1 -3
  22. package/es/organism/review-congrats/index.js.map +1 -1
  23. package/es/organism/review-slide/index.d.ts.map +1 -1
  24. package/es/organism/review-slide/index.js +6 -2
  25. package/es/organism/review-slide/index.js.map +1 -1
  26. package/es/organism/review-slide/index.native.d.ts.map +1 -1
  27. package/es/organism/review-slide/index.native.js +116 -79
  28. package/es/organism/review-slide/index.native.js.map +1 -1
  29. package/es/organism/review-slide/prop-types.d.ts +11 -0
  30. package/es/organism/review-slide/prop-types.d.ts.map +1 -1
  31. package/es/organism/review-slide/prop-types.js.map +1 -1
  32. package/es/template/app-player/popin-correction/style.css +1 -0
  33. package/es/template/common/dashboard/index.d.ts +0 -1
  34. package/es/template/common/dashboard/index.d.ts.map +1 -1
  35. package/es/template/common/dashboard/index.js +3 -26
  36. package/es/template/common/dashboard/index.js.map +1 -1
  37. package/lib/atom/choice/index.native.js +2 -4
  38. package/lib/atom/choice/index.native.js.map +1 -1
  39. package/lib/atom/html/index.native.js +1 -3
  40. package/lib/atom/html/index.native.js.map +1 -1
  41. package/lib/atom/review-presentation/index.native.js +56 -60
  42. package/lib/atom/review-presentation/index.native.js.map +1 -1
  43. package/lib/hoc/modal/select/index.native.js +3 -3
  44. package/lib/hoc/modal/select/index.native.js.map +1 -1
  45. package/lib/hoc/modal/select-item/index.native.js +13 -17
  46. package/lib/hoc/modal/select-item/index.native.js.map +1 -1
  47. package/lib/hoc/touchable/index.native.js +2 -2
  48. package/lib/hoc/touchable/index.native.js.map +1 -1
  49. package/lib/molecule/dashboard/cards-list/index.js +3 -7
  50. package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
  51. package/lib/molecule/questions/free-text/index.native.js +26 -30
  52. package/lib/molecule/questions/free-text/index.native.js.map +1 -1
  53. package/lib/molecule/questions/mobile/slider/index.native.js +3 -5
  54. package/lib/molecule/questions/mobile/slider/index.native.js.map +1 -1
  55. package/lib/molecule/questions/mobile/template/index.native.js +1 -3
  56. package/lib/molecule/questions/mobile/template/index.native.js.map +1 -1
  57. package/lib/organism/review-congrats/index.js +1 -3
  58. package/lib/organism/review-congrats/index.js.map +1 -1
  59. package/lib/organism/review-slide/index.d.ts.map +1 -1
  60. package/lib/organism/review-slide/index.js +6 -2
  61. package/lib/organism/review-slide/index.js.map +1 -1
  62. package/lib/organism/review-slide/index.native.d.ts.map +1 -1
  63. package/lib/organism/review-slide/index.native.js +115 -78
  64. package/lib/organism/review-slide/index.native.js.map +1 -1
  65. package/lib/organism/review-slide/prop-types.d.ts +11 -0
  66. package/lib/organism/review-slide/prop-types.d.ts.map +1 -1
  67. package/lib/organism/review-slide/prop-types.js.map +1 -1
  68. package/lib/template/app-player/popin-correction/style.css +1 -0
  69. package/lib/template/common/dashboard/index.d.ts +0 -1
  70. package/lib/template/common/dashboard/index.d.ts.map +1 -1
  71. package/lib/template/common/dashboard/index.js +3 -30
  72. package/lib/template/common/dashboard/index.js.map +1 -1
  73. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","container","flex","paddingHorizontal","flexDirection","justifyContent","header","fontSize","fontWeight","bold","textAlign","textValue","color","colors","black","valuesContainer","leftValue","alignItems","rightValue","track","height","borderRadius","radius","button","thumb","BOX_STYLE","width","backgroundColor","borderWidth","QuestionSlider","props","step","style","min","max","unit","value","storeValue","onSlidingComplete","testID","templateContext","useTemplateContext","brandTheme","styleSheet","setStylesheet","useState","setValue","handleSlidingComplete","useCallback","useEffect","_stylesheet","primary","borderColor"],"sources":["../../../../../src/molecule/questions/mobile/slider/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect, useCallback} from 'react';\nimport {View, StyleSheet, ViewStyle, TextStyle} from 'react-native';\nimport Slider from '@coorpacademy/react-native-slider';\n\nimport {Theme} from '../../../../variables/theme.native';\nimport Text from '../../../../atom/text/index.native';\nimport {useTemplateContext} from '../../../../template/app-review/template-context';\nimport {BOX_STYLE} from '../../../../variables/shadow';\n\nexport type OnSlidingCompleteFunction = (value: number) => void;\n\nexport type Props = {\n min: number;\n max: number;\n value?: number;\n unit?: string;\n onSlidingComplete: OnSlidingCompleteFunction;\n style?: ViewStyle;\n step?: number;\n testID?: string;\n};\n\ntype StyleSheetType = {\n container: ViewStyle;\n header: TextStyle;\n textValue: TextStyle;\n valuesContainer: ViewStyle;\n leftValue: ViewStyle;\n rightValue: ViewStyle;\n track: ViewStyle;\n thumb: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n flex: 1,\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'center'\n },\n header: {\n fontSize: 25,\n fontWeight: theme.fontWeight.bold,\n textAlign: 'center'\n },\n textValue: {\n fontSize: 15,\n color: theme.colors.black,\n fontWeight: theme.fontWeight.bold,\n textAlign: 'center'\n },\n valuesContainer: {\n flexDirection: 'row',\n justifyContent: 'space-around'\n },\n leftValue: {\n flex: 1,\n alignItems: 'flex-start'\n },\n rightValue: {\n flex: 1,\n alignItems: 'flex-end'\n },\n track: {\n height: 10,\n borderRadius: theme.radius.button\n },\n thumb: {\n ...BOX_STYLE,\n width: 30,\n height: 30,\n borderRadius: 30 / 2,\n backgroundColor: 'white',\n borderWidth: 1\n }\n });\n\nconst QuestionSlider = (props: Props) => {\n const {\n step,\n style,\n min,\n max,\n unit = '',\n value: storeValue = 0,\n onSlidingComplete,\n testID\n } = props;\n const templateContext = useTemplateContext();\n const {brandTheme, theme} = templateContext;\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [value, setValue] = useState<number>(storeValue);\n\n const handleSlidingComplete = useCallback(() => {\n onSlidingComplete(value);\n }, [onSlidingComplete, value]);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={[styleSheet.container, style]} testID={testID}>\n <Text style={[styleSheet.header, {color: brandTheme?.colors?.primary}]} testID=\"slider-value\">\n {value}\n </Text>\n <Slider\n step={step || 1}\n value={value}\n onValueChange={setValue}\n maximumValue={max}\n minimumValue={min}\n onSlidingComplete={handleSlidingComplete}\n minimumTrackTintColor={brandTheme?.colors?.primary}\n trackStyle={styleSheet.track}\n thumbStyle={[styleSheet.thumb, {borderColor: brandTheme?.colors?.primary}]}\n testID=\"slider\"\n />\n <View style={styleSheet.valuesContainer} testID=\"slider-values-container\">\n <View style={styleSheet.leftValue}>\n <Text style={styleSheet.textValue} testID=\"slider-min-value\">\n {`${min} ${unit}`}\n </Text>\n </View>\n <View style={styleSheet.rightValue}>\n <Text style={styleSheet.textValue} testID=\"slider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AY,EAAED,GALhB;IAME,iBAAiB,EAAEc,qBANrB;IAOE,qBAAqB,EAAEL,UAAF,2CAAEA,UAAU,CAAE7B,MAAd,qBAAE,oBAAoBsC,OAP7C;IAQE,UAAU,EAAER,UAAU,CAACxB,KARzB;IASE,UAAU,EAAE,CAACwB,UAAU,CAACnB,KAAZ,EAAmB;MAAC4B,WAAW,EAAEV,UAAF,2CAAEA,UAAU,CAAE7B,MAAd,qBAAE,oBAAoBsC;IAAlC,CAAnB,CATd;IAUE,MAAM,EAAC;EAVT,EAJF,eAgBE,6BAAC,iBAAD;IAAM,KAAK,EAAER,UAAU,CAAC5B,eAAxB;IAAyC,MAAM,EAAC;EAAhD,gBACE,6BAAC,iBAAD;IAAM,KAAK,EAAE4B,UAAU,CAAC3B;EAAxB,gBACE,6BAAC,cAAD;IAAM,KAAK,EAAE2B,UAAU,CAAChC,SAAxB;IAAmC,MAAM,EAAC;EAA1C,GACI,GAAEsB,GAAI,IAAGE,IAAK,EADlB,CADF,CADF,eAME,6BAAC,iBAAD;IAAM,KAAK,EAAEQ,UAAU,CAACzB;EAAxB,gBACE,6BAAC,cAAD;IAAM,KAAK,EAAEyB,UAAU,CAAChC,SAAxB;IAAmC,MAAM,EAAC;EAA1C,GACI,GAAEuB,GAAI,IAAGC,IAAK,EADlB,CADF,CANF,CAhBF,CADF;AA+BD,CA5DD;;eA8DeN,c"}
1
+ {"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","container","flex","paddingHorizontal","flexDirection","justifyContent","header","fontSize","fontWeight","bold","textAlign","textValue","color","colors","black","valuesContainer","leftValue","alignItems","rightValue","track","height","borderRadius","radius","button","thumb","BOX_STYLE","width","backgroundColor","borderWidth","QuestionSlider","props","step","style","min","max","unit","value","storeValue","onSlidingComplete","testID","templateContext","useTemplateContext","brandTheme","styleSheet","setStylesheet","useState","setValue","handleSlidingComplete","useCallback","useEffect","_stylesheet","primary","borderColor"],"sources":["../../../../../src/molecule/questions/mobile/slider/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect, useCallback} from 'react';\nimport {View, StyleSheet, ViewStyle, TextStyle} from 'react-native';\nimport Slider from '@coorpacademy/react-native-slider';\n\nimport {Theme} from '../../../../variables/theme.native';\nimport Text from '../../../../atom/text/index.native';\nimport {useTemplateContext} from '../../../../template/app-review/template-context';\nimport {BOX_STYLE} from '../../../../variables/shadow';\n\nexport type OnSlidingCompleteFunction = (value: number) => void;\n\nexport type Props = {\n min: number;\n max: number;\n value?: number;\n unit?: string;\n onSlidingComplete: OnSlidingCompleteFunction;\n style?: ViewStyle;\n step?: number;\n testID?: string;\n};\n\ntype StyleSheetType = {\n container: ViewStyle;\n header: TextStyle;\n textValue: TextStyle;\n valuesContainer: ViewStyle;\n leftValue: ViewStyle;\n rightValue: ViewStyle;\n track: ViewStyle;\n thumb: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n flex: 1,\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'center'\n },\n header: {\n fontSize: 25,\n fontWeight: theme.fontWeight.bold,\n textAlign: 'center'\n },\n textValue: {\n fontSize: 15,\n color: theme.colors.black,\n fontWeight: theme.fontWeight.bold,\n textAlign: 'center'\n },\n valuesContainer: {\n flexDirection: 'row',\n justifyContent: 'space-around'\n },\n leftValue: {\n flex: 1,\n alignItems: 'flex-start'\n },\n rightValue: {\n flex: 1,\n alignItems: 'flex-end'\n },\n track: {\n height: 10,\n borderRadius: theme.radius.button\n },\n thumb: {\n ...BOX_STYLE,\n width: 30,\n height: 30,\n borderRadius: 30 / 2,\n backgroundColor: 'white',\n borderWidth: 1\n }\n });\n\nconst QuestionSlider = (props: Props) => {\n const {\n step,\n style,\n min,\n max,\n unit = '',\n value: storeValue = 0,\n onSlidingComplete,\n testID\n } = props;\n const templateContext = useTemplateContext();\n const {brandTheme, theme} = templateContext;\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [value, setValue] = useState<number>(storeValue);\n\n const handleSlidingComplete = useCallback(() => {\n onSlidingComplete(value);\n }, [onSlidingComplete, value]);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={[styleSheet.container, style]} testID={testID}>\n <Text style={[styleSheet.header, {color: brandTheme?.colors?.primary}]} testID=\"slider-value\">\n {value}\n </Text>\n <Slider\n step={step || 1}\n value={value}\n onValueChange={setValue}\n maximumValue={max}\n minimumValue={min}\n onSlidingComplete={handleSlidingComplete}\n minimumTrackTintColor={brandTheme?.colors?.primary}\n trackStyle={styleSheet.track}\n thumbStyle={[styleSheet.thumb, {borderColor: brandTheme?.colors?.primary}]}\n testID=\"slider\"\n />\n <View style={styleSheet.valuesContainer} testID=\"slider-values-container\">\n <View style={styleSheet.leftValue}>\n <Text style={styleSheet.textValue} testID=\"slider-min-value\">\n {`${min} ${unit}`}\n </Text>\n </View>\n <View style={styleSheet.rightValue}>\n <Text style={styleSheet.textValue} testID=\"slider-max-value\">\n {`${max} ${unit}`}\n </Text>\n </View>\n </View>\n </View>\n );\n};\n\nexport default QuestionSlider;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAGA;;AACA;;AACA;;;;;;;;;;AA0BA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,IAAI,EAAE,CADG;IAETC,iBAAiB,EAAE,EAFV;IAGTC,aAAa,EAAE,QAHN;IAITC,cAAc,EAAE;EAJP,CADK;EAOhBC,MAAM,EAAE;IACNC,QAAQ,EAAE,EADJ;IAENC,UAAU,EAAEV,KAAK,CAACU,UAAN,CAAiBC,IAFvB;IAGNC,SAAS,EAAE;EAHL,CAPQ;EAYhBC,SAAS,EAAE;IACTJ,QAAQ,EAAE,EADD;IAETK,KAAK,EAAEd,KAAK,CAACe,MAAN,CAAaC,KAFX;IAGTN,UAA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AAM,KAAK,EAAEQ,UAAU,CAACzB;EAAxB,gBACE,6BAAC,cAAD;IAAM,KAAK,EAAEyB,UAAU,CAAChC,SAAxB;IAAmC,MAAM,EAAC;EAA1C,GACI,GAAEuB,GAAI,IAAGC,IAAK,EADlB,CADF,CANF,CAhBF,CADF;AA+BD,CA5DD;;eA8DeN,c"}
@@ -66,8 +66,6 @@ const createStyleSheet = theme => ({
66
66
  });
67
67
 
68
68
  const Item = props => {
69
- var _brandTheme$colors;
70
-
71
69
  const {
72
70
  part,
73
71
  index,
@@ -89,7 +87,7 @@ const Item = props => {
89
87
  const id = `question-part-${index + 1}`;
90
88
  const isFocused = focusedSelectId === id;
91
89
  const coloredText = brandTheme && {
92
- color: (_brandTheme$colors = brandTheme.colors) == null ? void 0 : _brandTheme$colors.primary
90
+ color: brandTheme.colors?.primary
93
91
  };
94
92
 
95
93
  if (part.type === 'answerField' && inputNames.includes(part.value)) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["createStyleSheet","theme","container","width","flexDirection","flexWrap","justifyContent","alignItems","spaced","paddingVertical","spacing","tiny","htmlText","color","colors","black","fontWeight","bold","lineHeight","selectInput","padding","borderRadius","radius","regular","minWidth","marginHorizontal","BOX_STYLE","backgroundColor","white","selectText","gray","medium","fontSize","textAlign","Item","props","part","index","isDisabled","focusedSelectId","choices","onInputChange","handleBlur","handleFocus","styles","templateContext","useTemplateContext","brandTheme","translations","inputNames","map","choice","name","id","isFocused","coloredText","primary","type","includes","value","choiceIndex","findIndex","disabledSuffix","selectedSuffix","handleInputChange","_item","_value","selectInputStyle","push","selectTextStyle","items","selectAnAnswer","trim","QuestionTemplate","template","styleSheet","setStylesheet","useState","useEffect","_stylesheet","parts","parseTemplateString"],"sources":["../../../../../src/molecule/questions/mobile/template/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {TextStyle, View, ViewStyle} from 'react-native';\n\nimport trim from 'lodash/fp/trim';\n\nimport Html from '../../../../atom/html/index.native';\nimport Select from '../../../../atom/select-modal/index.native';\nimport Space from '../../../../atom/space/index.native';\nimport type {TemplateListOfChoices, TemplateTextChoice} from '../../types';\nimport FreeText from '../../free-text/index.native';\nimport {\n FocusedSelectId,\n HandleBlur,\n HandleFocus,\n useTemplateContext\n} from '../../../../template/app-review/template-context';\nimport {Theme} from '../../../../variables/theme.native';\nimport parseTemplateString from '../../../../util/parse-template-string';\nimport {BOX_STYLE} from '../../../../variables/shadow';\n\ntype StyleSheetType = {\n container: ViewStyle;\n spaced: ViewStyle;\n htmlText: TextStyle;\n selectInput: ViewStyle;\n selectText: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType => ({\n container: {\n width: '100%',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'center',\n alignItems: 'center'\n },\n spaced: {\n paddingVertical: theme.spacing.tiny\n },\n htmlText: {\n color: theme.colors.black,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 25\n },\n // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread\n selectInput: {\n padding: theme.spacing.tiny,\n borderRadius: theme.radius.regular,\n minWidth: 175,\n marginHorizontal: 12,\n paddingVertical: 16,\n ...BOX_STYLE,\n backgroundColor: theme.colors.white\n },\n selectText: {\n color: theme.colors.gray.medium,\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.regular,\n textAlign: 'center'\n }\n});\n\ntype TemplatePart = {\n type: 'string' | 'answerField';\n value: string;\n};\n\ntype ItemProps = {\n part: TemplatePart;\n choices: Array<TemplateTextChoice | TemplateListOfChoices>;\n index: number;\n isDisabled?: boolean;\n onInputChange: (item: TemplateTextChoice | TemplateListOfChoices, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n styles: StyleSheetType;\n};\n\nconst Item = (props: ItemProps) => {\n const {\n part,\n index,\n isDisabled = false,\n focusedSelectId,\n choices,\n onInputChange,\n handleBlur,\n handleFocus,\n styles\n } = props;\n\n const templateContext = useTemplateContext();\n const {theme, brandTheme, translations} = templateContext;\n\n const inputNames = choices.map(choice => choice.name);\n const id = `question-part-${index + 1}`;\n const isFocused = focusedSelectId === id;\n\n const coloredText = brandTheme && {\n color: brandTheme.colors?.primary\n };\n\n if (part.type === 'answerField' && inputNames.includes(part.value)) {\n const choiceIndex = choices.findIndex(choice => choice.name === part.value);\n const choice = choices[choiceIndex];\n const {value} = choice;\n\n if (!choice || !choice.type || !choice.name) {\n return null;\n }\n\n const disabledSuffix = isDisabled ? '-disabled' : '';\n const selectedSuffix = value ? '-selected' : '';\n\n const handleInputChange =\n (_item: TemplateTextChoice | TemplateListOfChoices) => (_value: string) =>\n onInputChange(_item, _value);\n\n if (choice.type === 'text') {\n return (\n <View style={styles.spaced} testID={id}>\n <FreeText\n key={id}\n isDisabled={isDisabled}\n onChange={handleInputChange(choice)}\n value={value}\n testID={`${id}-text${selectedSuffix}${disabledSuffix}`}\n questionType=\"template\"\n />\n </View>\n );\n }\n\n const selectInputStyle: TextStyle[] = [styles.selectInput];\n if (coloredText && value) {\n selectInputStyle.push(coloredText);\n }\n\n const selectTextStyle: TextStyle[] = [styles.selectText];\n if (coloredText && value) {\n selectTextStyle.push(coloredText);\n }\n\n if (choice.type === 'select') {\n return (\n <View style={styles.spaced} testID={id}>\n <Select\n isDisabled={isDisabled}\n questionType=\"template\"\n values={choice.items}\n value={value}\n placeholder={translations.selectAnAnswer}\n isFocused={isFocused}\n onBlur={handleBlur}\n onFocus={handleFocus(id)}\n onChange={handleInputChange(choice)}\n textStyle={selectTextStyle}\n style={selectInputStyle}\n analyticsID={`${id}-select${selectedSuffix}${disabledSuffix}`}\n testID={`${id}-select${selectedSuffix}${disabledSuffix}`}\n />\n </View>\n );\n }\n }\n\n return (\n <Html key={id} fontSize={theme.fontSize.regular} testID={id} style={styles.htmlText}>\n {trim(part.value || '')}\n </Html>\n );\n};\n\nexport type Props = {\n isDisabled?: boolean;\n template: string;\n choices: Array<TemplateTextChoice | TemplateListOfChoices>;\n onInputChange: (item: TemplateTextChoice | TemplateListOfChoices, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n};\n\nconst QuestionTemplate = (props: Props) => {\n const {\n template,\n onInputChange,\n choices,\n handleBlur,\n handleFocus,\n focusedSelectId,\n isDisabled = false\n } = props;\n\n const templateContext = useTemplateContext();\n const {theme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!template || !styleSheet) {\n return null;\n }\n\n const parts: TemplatePart[] = parseTemplateString(template);\n\n return (\n <View style={styleSheet.container} testID=\"question-template\">\n {parts.map((part, id) => (\n <View key={`question-part-${id}`} style={{flexDirection: 'row'}}>\n <Item\n part={part}\n choices={choices}\n index={id}\n focusedSelectId={focusedSelectId}\n isDisabled={isDisabled}\n handleBlur={handleBlur}\n handleFocus={handleFocus}\n onInputChange={onInputChange}\n styles={styleSheet}\n />\n <Space type=\"micro\" />\n </View>\n ))}\n </View>\n );\n};\n\nexport default QuestionTemplate;\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AAOA;;AACA;;;;;;;;;;AAUA,MAAMA,gBAAgB,GAAIC,KAAD,KAAmC;EAC1DC,SAAS,EAAE;IACTC,KAAK,EAAE,MADE;IAETC,aAAa,EAAE,KAFN;IAGTC,QAAQ,EAAE,MAHD;IAITC,cAAc,EAAE,QAJP;IAKTC,UAAU,EAAE;EALH,CAD+C;EAQ1DC,MAAM,EAAE;IACNC,eAAe,EAAER,KAAK,CAACS,OAAN,CAAcC;EADzB,CARkD;EAW1DC,QAAQ,EAAE;IACRC,KAAK,EAAEZ,KAAK,CAACa,MAAN,CAAaC,KADZ;IAERC,UAAU,EAAEf,KAAK,CAACe,UAAN,CAAiBC,IAFrB;IAGRC,UAAU,E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AhB;EAEA,MAAM,CAAC8B,UAAD,EAAaC,aAAb,IAA8B,IAAAC,eAAA,EAAgC,IAAhC,CAApC;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACd,MAAMC,WAAW,GAAG/E,gBAAgB,CAACC,KAAD,CAApC;;IACA2E,aAAa,CAACG,WAAD,CAAb;EACD,CAHD,EAGG,CAAC9E,KAAD,CAHH;;EAKA,IAAI,CAACyE,QAAD,IAAa,CAACC,UAAlB,EAA8B;IAC5B,OAAO,IAAP;EACD;;EAED,MAAMK,KAAqB,GAAG,IAAAC,4BAAA,EAAoBP,QAApB,CAA9B;EAEA,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEC,UAAU,CAACzE,SAAxB;IAAmC,MAAM,EAAC;EAA1C,GACG8E,KAAK,CAAC9B,GAAN,CAAU,CAACd,IAAD,EAAOiB,EAAP,kBACT,6BAAC,iBAAD;IAAM,GAAG,EAAG,iBAAgBA,EAAG,EAA/B;IAAkC,KAAK,EAAE;MAACjD,aAAa,EAAE;IAAhB;EAAzC,gBACE,6BAAC,IAAD;IACE,IAAI,EAAEgC,IADR;IAEE,OAAO,EAAEI,OAFX;IAGE,KAAK,EAAEa,EAHT;IAIE,eAAe,EAAEd,eAJnB;IAKE,UAAU,EAAED,UALd;IAME,UAAU,EAAEI,UANd;IAOE,WAAW,EAAEC,WAPf;IAQE,aAAa,EAAEF,aARjB;IASE,MAAM,EAAEkC;EATV,EADF,eAYE,6BAAC,eAAD;IAAO,IAAI,EAAC;EAAZ,EAZF,CADD,CADH,CADF;AAoBD,CA/CD;;eAiDeF,gB"}
1
+ {"version":3,"file":"index.native.js","names":["createStyleSheet","theme","container","width","flexDirection","flexWrap","justifyContent","alignItems","spaced","paddingVertical","spacing","tiny","htmlText","color","colors","black","fontWeight","bold","lineHeight","selectInput","padding","borderRadius","radius","regular","minWidth","marginHorizontal","BOX_STYLE","backgroundColor","white","selectText","gray","medium","fontSize","textAlign","Item","props","part","index","isDisabled","focusedSelectId","choices","onInputChange","handleBlur","handleFocus","styles","templateContext","useTemplateContext","brandTheme","translations","inputNames","map","choice","name","id","isFocused","coloredText","primary","type","includes","value","choiceIndex","findIndex","disabledSuffix","selectedSuffix","handleInputChange","_item","_value","selectInputStyle","push","selectTextStyle","items","selectAnAnswer","trim","QuestionTemplate","template","styleSheet","setStylesheet","useState","useEffect","_stylesheet","parts","parseTemplateString"],"sources":["../../../../../src/molecule/questions/mobile/template/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {TextStyle, View, ViewStyle} from 'react-native';\n\nimport trim from 'lodash/fp/trim';\n\nimport Html from '../../../../atom/html/index.native';\nimport Select from '../../../../atom/select-modal/index.native';\nimport Space from '../../../../atom/space/index.native';\nimport type {TemplateListOfChoices, TemplateTextChoice} from '../../types';\nimport FreeText from '../../free-text/index.native';\nimport {\n FocusedSelectId,\n HandleBlur,\n HandleFocus,\n useTemplateContext\n} from '../../../../template/app-review/template-context';\nimport {Theme} from '../../../../variables/theme.native';\nimport parseTemplateString from '../../../../util/parse-template-string';\nimport {BOX_STYLE} from '../../../../variables/shadow';\n\ntype StyleSheetType = {\n container: ViewStyle;\n spaced: ViewStyle;\n htmlText: TextStyle;\n selectInput: ViewStyle;\n selectText: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType => ({\n container: {\n width: '100%',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'center',\n alignItems: 'center'\n },\n spaced: {\n paddingVertical: theme.spacing.tiny\n },\n htmlText: {\n color: theme.colors.black,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 25\n },\n // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread\n selectInput: {\n padding: theme.spacing.tiny,\n borderRadius: theme.radius.regular,\n minWidth: 175,\n marginHorizontal: 12,\n paddingVertical: 16,\n ...BOX_STYLE,\n backgroundColor: theme.colors.white\n },\n selectText: {\n color: theme.colors.gray.medium,\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.regular,\n textAlign: 'center'\n }\n});\n\ntype TemplatePart = {\n type: 'string' | 'answerField';\n value: string;\n};\n\ntype ItemProps = {\n part: TemplatePart;\n choices: Array<TemplateTextChoice | TemplateListOfChoices>;\n index: number;\n isDisabled?: boolean;\n onInputChange: (item: TemplateTextChoice | TemplateListOfChoices, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n styles: StyleSheetType;\n};\n\nconst Item = (props: ItemProps) => {\n const {\n part,\n index,\n isDisabled = false,\n focusedSelectId,\n choices,\n onInputChange,\n handleBlur,\n handleFocus,\n styles\n } = props;\n\n const templateContext = useTemplateContext();\n const {theme, brandTheme, translations} = templateContext;\n\n const inputNames = choices.map(choice => choice.name);\n const id = `question-part-${index + 1}`;\n const isFocused = focusedSelectId === id;\n\n const coloredText = brandTheme && {\n color: brandTheme.colors?.primary\n };\n\n if (part.type === 'answerField' && inputNames.includes(part.value)) {\n const choiceIndex = choices.findIndex(choice => choice.name === part.value);\n const choice = choices[choiceIndex];\n const {value} = choice;\n\n if (!choice || !choice.type || !choice.name) {\n return null;\n }\n\n const disabledSuffix = isDisabled ? '-disabled' : '';\n const selectedSuffix = value ? '-selected' : '';\n\n const handleInputChange =\n (_item: TemplateTextChoice | TemplateListOfChoices) => (_value: string) =>\n onInputChange(_item, _value);\n\n if (choice.type === 'text') {\n return (\n <View style={styles.spaced} testID={id}>\n <FreeText\n key={id}\n isDisabled={isDisabled}\n onChange={handleInputChange(choice)}\n value={value}\n testID={`${id}-text${selectedSuffix}${disabledSuffix}`}\n questionType=\"template\"\n />\n </View>\n );\n }\n\n const selectInputStyle: TextStyle[] = [styles.selectInput];\n if (coloredText && value) {\n selectInputStyle.push(coloredText);\n }\n\n const selectTextStyle: TextStyle[] = [styles.selectText];\n if (coloredText && value) {\n selectTextStyle.push(coloredText);\n }\n\n if (choice.type === 'select') {\n return (\n <View style={styles.spaced} testID={id}>\n <Select\n isDisabled={isDisabled}\n questionType=\"template\"\n values={choice.items}\n value={value}\n placeholder={translations.selectAnAnswer}\n isFocused={isFocused}\n onBlur={handleBlur}\n onFocus={handleFocus(id)}\n onChange={handleInputChange(choice)}\n textStyle={selectTextStyle}\n style={selectInputStyle}\n analyticsID={`${id}-select${selectedSuffix}${disabledSuffix}`}\n testID={`${id}-select${selectedSuffix}${disabledSuffix}`}\n />\n </View>\n );\n }\n }\n\n return (\n <Html key={id} fontSize={theme.fontSize.regular} testID={id} style={styles.htmlText}>\n {trim(part.value || '')}\n </Html>\n );\n};\n\nexport type Props = {\n isDisabled?: boolean;\n template: string;\n choices: Array<TemplateTextChoice | TemplateListOfChoices>;\n onInputChange: (item: TemplateTextChoice | TemplateListOfChoices, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n};\n\nconst QuestionTemplate = (props: Props) => {\n const {\n template,\n onInputChange,\n choices,\n handleBlur,\n handleFocus,\n focusedSelectId,\n isDisabled = false\n } = props;\n\n const templateContext = useTemplateContext();\n const {theme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!template || !styleSheet) {\n return null;\n }\n\n const parts: TemplatePart[] = parseTemplateString(template);\n\n return (\n <View style={styleSheet.container} testID=\"question-template\">\n {parts.map((part, id) => (\n <View key={`question-part-${id}`} style={{flexDirection: 'row'}}>\n <Item\n part={part}\n choices={choices}\n index={id}\n focusedSelectId={focusedSelectId}\n isDisabled={isDisabled}\n handleBlur={handleBlur}\n handleFocus={handleFocus}\n onInputChange={onInputChange}\n styles={styleSheet}\n />\n <Space type=\"micro\" />\n </View>\n ))}\n </View>\n );\n};\n\nexport default QuestionTemplate;\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AAOA;;AACA;;;;;;;;;;AAUA,MAA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,EAAEF,aARjB;IASE,MAAM,EAAEkC;EATV,EADF,eAYE,6BAAC,eAAD;IAAO,IAAI,EAAC;EAAZ,EAZF,CADD,CADH,CADF;AAoBD,CA/CD;;eAiDeF,gB"}
@@ -24,9 +24,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
24
24
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
25
 
26
26
  const setScroll = container => () => {
27
- var _container$current;
28
-
29
- ((_container$current = container.current) == null ? void 0 : _container$current.scrollTo) && container.current.scrollTo({
27
+ container.current?.scrollTo && container.current.scrollTo({
30
28
  left: 1000,
31
29
  behavior: 'smooth'
32
30
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["setScroll","container","current","scrollTo","left","behavior","ReviewCongrats","props","ariaLabel","dataName","animationLottie","title","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","useRef","useEffect","timer","setTimeout","clearTimeout","style","mainContainer","lottie","ie11Backup","containerCongrats","containerCards","cardStar","cardRank","cardStarNoRank","buttonContainer","buttonRevise","propTypes"],"sources":["../../../src/organism/review-congrats/index.js"],"sourcesContent":["import React, {useEffect, useRef} from 'react';\nimport AtomLottieWrapper from '../../atom/lottie-wrapper';\nimport ButtonLink from '../../atom/button-link';\nimport MoleculeReviewCardCongrats from '../../molecule/review-card-congrats';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nexport const setScroll = container => () => {\n container.current?.scrollTo &&\n container.current.scrollTo({\n left: 1000,\n behavior: 'smooth'\n });\n};\n\nconst ReviewCongrats = props => {\n const {\n 'aria-label': ariaLabel,\n 'data-name': dataName,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const container = useRef(null);\n\n useEffect(() => {\n const timer = setTimeout(setScroll(container), 2000);\n return () => timer && clearTimeout(timer);\n }, []);\n\n return (\n <div\n className={style.mainContainer}\n aria-label={ariaLabel}\n data-name={dataName}\n data-testid=\"congrats\"\n >\n <AtomLottieWrapper\n {...animationLottie}\n loop={false}\n animationControl={'play'}\n autoplay\n data-name=\"lottie-wrapper\"\n className={style.lottie}\n backupImageClassName={style.ie11Backup}\n />\n <div className={style.containerCongrats}>\n <div className={style.title}>{title}</div>\n <div ref={container} className={style.containerCards}>\n {cardCongratsRank ? (\n <>\n <MoleculeReviewCardCongrats {...cardCongratsStar} className={style.cardStar} />\n <MoleculeReviewCardCongrats\n {...cardCongratsRank}\n timerAnimation={1800}\n className={style.cardRank}\n />\n </>\n ) : (\n <MoleculeReviewCardCongrats {...cardCongratsStar} className={style.cardStarNoRank} />\n )}\n </div>\n <div className={style.buttonContainer}>\n {buttonRevising ? (\n <ButtonLink\n {...buttonRevising}\n className={style.buttonRevise}\n data-testid=\"revise-skill-link\"\n />\n ) : null}\n {buttonRevisingSkill ? (\n <ButtonLink\n {...buttonRevisingSkill}\n className={style.buttonRevise}\n data-testid=\"revise-another-skill-link\"\n />\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nReviewCongrats.propTypes = propTypes;\n\nexport default ReviewCongrats;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,MAAMA,SAAS,GAAGC,SAAS,IAAI,MAAM;EAAA;;EAC1C,uBAAAA,SAAS,CAACC,OAAV,wCAAmBC,QAAnB,KACEF,SAAS,CAACC,OAAV,CAAkBC,QAAlB,CAA2B;IACzBC,IAAI,EAAE,IADmB;IAEzBC,QAAQ,EAAE;EAFe,CAA3B,CADF;AAKD,CANM;;;;AAQP,MAAMC,cAAc,GAAGC,KAAK,IAAI;EAC9B,MAAM;IACJ,cAAcC,SADV;IAEJ,aAAaC,QAFT;IAGJC,eAHI;IAIJC,KAJI;IAKJC,gBALI;IAMJC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AGE,eAAY;EAHd,GADa,GAMX,IAPN,EAQGhB,mBAAmB,gBAClB,6BAAC,mBAAD,eACMA,mBADN;IAEE,SAAS,EAAEM,cAAA,CAAMU,YAFnB;IAGE,eAAY;EAHd,GADkB,GAMhB,IAdN,CAhBF,CAfF,CADF;AAmDD,CAtED;;AAwEAzB,cAAc,CAAC0B,SAAf,2CAA2BA,kBAA3B;eAEe1B,c"}
1
+ {"version":3,"file":"index.js","names":["setScroll","container","current","scrollTo","left","behavior","ReviewCongrats","props","ariaLabel","dataName","animationLottie","title","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","useRef","useEffect","timer","setTimeout","clearTimeout","style","mainContainer","lottie","ie11Backup","containerCongrats","containerCards","cardStar","cardRank","cardStarNoRank","buttonContainer","buttonRevise","propTypes"],"sources":["../../../src/organism/review-congrats/index.js"],"sourcesContent":["import React, {useEffect, useRef} from 'react';\nimport AtomLottieWrapper from '../../atom/lottie-wrapper';\nimport ButtonLink from '../../atom/button-link';\nimport MoleculeReviewCardCongrats from '../../molecule/review-card-congrats';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nexport const setScroll = container => () => {\n container.current?.scrollTo &&\n container.current.scrollTo({\n left: 1000,\n behavior: 'smooth'\n });\n};\n\nconst ReviewCongrats = props => {\n const {\n 'aria-label': ariaLabel,\n 'data-name': dataName,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const container = useRef(null);\n\n useEffect(() => {\n const timer = setTimeout(setScroll(container), 2000);\n return () => timer && clearTimeout(timer);\n }, []);\n\n return (\n <div\n className={style.mainContainer}\n aria-label={ariaLabel}\n data-name={dataName}\n data-testid=\"congrats\"\n >\n <AtomLottieWrapper\n {...animationLottie}\n loop={false}\n animationControl={'play'}\n autoplay\n data-name=\"lottie-wrapper\"\n className={style.lottie}\n backupImageClassName={style.ie11Backup}\n />\n <div className={style.containerCongrats}>\n <div className={style.title}>{title}</div>\n <div ref={container} className={style.containerCards}>\n {cardCongratsRank ? (\n <>\n <MoleculeReviewCardCongrats {...cardCongratsStar} className={style.cardStar} />\n <MoleculeReviewCardCongrats\n {...cardCongratsRank}\n timerAnimation={1800}\n className={style.cardRank}\n />\n </>\n ) : (\n <MoleculeReviewCardCongrats {...cardCongratsStar} className={style.cardStarNoRank} />\n )}\n </div>\n <div className={style.buttonContainer}>\n {buttonRevising ? (\n <ButtonLink\n {...buttonRevising}\n className={style.buttonRevise}\n data-testid=\"revise-skill-link\"\n />\n ) : null}\n {buttonRevisingSkill ? (\n <ButtonLink\n {...buttonRevisingSkill}\n className={style.buttonRevise}\n data-testid=\"revise-another-skill-link\"\n />\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nReviewCongrats.propTypes = propTypes;\n\nexport default ReviewCongrats;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,MAAMA,SAAS,GAAGC,SAAS,IAAI,MAAM;EAC1CA,SAAS,CAACC,OAAV,EAAmBC,QAAnB,IACEF,SAAS,CAACC,OAAV,CAAkBC,QAAlB,CAA2B;IACzBC,IAAI,EAAE,IADmB;IAEzBC,QAAQ,EAAE;EAFe,CAA3B,CADF;AAKD,CANM;;;;AAQP,MAAMC,cAAc,GAAGC,KAAK,IAAI;EAC9B,MAAM;IACJ,cAAcC,SADV;IAEJ,aAAaC,QAFT;IAGJC,eAHI;IAIJC,KAJI;IAKJC,gBALI;IAMJC,gBANI;IAOJC,cAPI;IAQJC;EARI,IASFR,KATJ;EAWA,MAAMN,SAAS,GAAG,IAAAe,aAAA,EAAO,IAAP,CAAlB;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACd,MAAMC,KAAK,GAAGC,UAAU,CAACnB,SAAS,CAACC,SAAD,CAAV,EAAuB,IAAvB,CAAxB;IACA,OAAO,MAAMiB,KAAK,IAAIE,YAAY,CAACF,KAAD,CAAlC;EACD,CAHD,EAGG,EAHH;EAKA,oBACE;I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src/organism/review-slide/index.js"],"names":[],"mappings":";AA8HA,sDA8CC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.js"],"names":[],"mappings":";AAiIA,sDA8CC"}
@@ -132,8 +132,12 @@ const QuestionContainer = props => {
132
132
  }
133
133
  }), /*#__PURE__*/_react.default.createElement("div", {
134
134
  key: "help",
135
- className: _style.default.help
136
- }, (0, _get.default)('help', answerUI)), /*#__PURE__*/_react.default.createElement("div", {
135
+ className: _style.default.help // eslint-disable-next-line react/no-danger
136
+ ,
137
+ dangerouslySetInnerHTML: {
138
+ __html: (0, _get.default)('help', answerUI)
139
+ }
140
+ }), /*#__PURE__*/_react.default.createElement("div", {
137
141
  key: "answer-container",
138
142
  className: _style.default.answerContainer
139
143
  }, /*#__PURE__*/_react.default.createElement(_answer.default, _extends({}, answerUI, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","klf","getOr","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","classnames","style","correctionPopinWrapper","popinAnimation","propTypes","PropTypes","string","bool","ValidateButton","validateButton","primarySkinColor","disabled","validateButtonProps","className","customStyle","backgroundColor","validateButtonWrapper","QuestionContainer","props","answerUI","questionText","questionOrigin","disableContent","slideContentContainer","disabledSlideContent","question","__html","help","answerContainer","shape","slide","ReviewSlide","skin","GetSkinFromContext","useMemo","loading","loadingAriaLabel","parentContentTitle","disabledContent","loader"],"sources":["../../../src/organism/review-slide/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Answer from '../../molecule/answer';\nimport ButtonLink from '../../atom/button-link';\nimport Loader from '../../atom/loader';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin';\nimport {GetSkinFromContext} from '../../atom/provider';\nimport propTypes from './prop-types';\nimport style from './style.css';\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}) => {\n if (!showCorrectionPopin) return null;\n\n const klf = getOr({}, '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 <div\n className={classnames(\n style.correctionPopinWrapper,\n animateCorrectionPopin ? style.popinAnimation : null\n )}\n >\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </div>\n );\n};\n\nCorrectionPopin.propTypes = {\n slideIndex: PropTypes.string,\n showCorrectionPopin: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n correctionPopinProps: propTypes.correctionPopinProps\n};\n\nconst 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 className: style.validateButton,\n customStyle: {\n backgroundColor: primarySkinColor\n }\n };\n\n return (\n <div key=\"button-wrapper\" className={style.validateButtonWrapper}>\n <ButtonLink {...validateButtonProps} />\n </div>\n );\n};\n\nValidateButton.propTypes = {\n slideIndex: PropTypes.string,\n validateButton: propTypes.validateButton,\n primarySkinColor: PropTypes.string\n};\n\nconst QuestionContainer = props => {\n const {answerUI, questionText, questionOrigin, disableContent} = props;\n if (!answerUI || !questionText) return null;\n\n return (\n <div\n key=\"content-container\"\n data-testid=\"content-container\"\n className={classnames(\n style.slideContentContainer,\n disableContent ? style.disabledSlideContent : null\n )}\n >\n <div key=\"from-course\" className={style.questionOrigin}>\n {questionOrigin}\n </div>\n <div\n key=\"title\"\n data-testid=\"slide-question\"\n className={style.question}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: questionText}}\n />\n <div key=\"help\" className={style.help}>\n {get('help', answerUI)}\n </div>\n <div key=\"answer-container\" className={style.answerContainer}>\n <Answer {...answerUI} key=\"answer\" />\n </div>\n </div>\n );\n};\n\nQuestionContainer.propTypes = {\n answerUI: PropTypes.shape(propTypes.slide.answerUI),\n questionText: PropTypes.string,\n questionOrigin: PropTypes.string,\n disableContent: PropTypes.bool\n};\n\nconst ReviewSlide = props => {\n const {slide, validateButton, correctionPopinProps, slideIndex = '0'} = props;\n\n const skin = GetSkinFromContext();\n const primarySkinColor = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const {\n loading,\n loadingAriaLabel,\n parentContentTitle,\n questionText,\n disabledContent,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <div data-testid=\"review-slide\" className={style.slide}>\n {loading ? (\n <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n ) : (\n <>\n <QuestionContainer\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n disableContent={disabledContent}\n key=\"question-container\"\n />\n <ValidateButton\n slideIndex={slideIndex}\n validateButton={validateButton}\n primarySkinColor={primarySkinColor}\n key=\"validate-button\"\n />\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n </>\n )}\n </div>\n );\n};\n\nReviewSlide.propTypes = propTypes;\n\nexport default ReviewSlide;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB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O,gBACN,6BAAC,eAAD;IAAQ,SAAS,EAAElC,cAAA,CAAMsC,MAAzB;IAAiC,KAAK,EAAC,SAAvC;IAAiD,cAAYH;EAA7D,EADM,gBAGN,yEACE,6BAAC,iBAAD;IACE,cAAc,EAAEC,kBADlB;IAEE,YAAY,EAAEjB,YAFhB;IAGE,QAAQ,EAAED,QAHZ;IAIE,cAAc,EAAEmB,eAJlB;IAKE,GAAG,EAAC;EALN,EADF,eAQE,6BAAC,cAAD;IACE,UAAU,EAAEpD,UADd;IAEE,cAAc,EAAEuB,cAFlB;IAGE,gBAAgB,EAAEC,gBAHpB;IAIE,GAAG,EAAC;EAJN,EARF,eAcE,6BAAC,eAAD;IACE,oBAAoB,EAAEzB,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EAdF,CAJJ,CADF;AA8BD,CA9CD;;AAgDA2C,WAAW,CAAC3B,SAAZ,2CAAwBA,mBAAxB;eAEe2B,W"}
1
+ {"version":3,"file":"index.js","names":["CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","klf","getOr","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","classnames","style","correctionPopinWrapper","popinAnimation","propTypes","PropTypes","string","bool","ValidateButton","validateButton","primarySkinColor","disabled","validateButtonProps","className","customStyle","backgroundColor","validateButtonWrapper","QuestionContainer","props","answerUI","questionText","questionOrigin","disableContent","slideContentContainer","disabledSlideContent","question","__html","help","answerContainer","shape","slide","ReviewSlide","skin","GetSkinFromContext","useMemo","loading","loadingAriaLabel","parentContentTitle","disabledContent","loader"],"sources":["../../../src/organism/review-slide/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Answer from '../../molecule/answer';\nimport ButtonLink from '../../atom/button-link';\nimport Loader from '../../atom/loader';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin';\nimport {GetSkinFromContext} from '../../atom/provider';\nimport propTypes from './prop-types';\nimport style from './style.css';\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}) => {\n if (!showCorrectionPopin) return null;\n\n const klf = getOr({}, '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 <div\n className={classnames(\n style.correctionPopinWrapper,\n animateCorrectionPopin ? style.popinAnimation : null\n )}\n >\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </div>\n );\n};\n\nCorrectionPopin.propTypes = {\n slideIndex: PropTypes.string,\n showCorrectionPopin: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n correctionPopinProps: propTypes.correctionPopinProps\n};\n\nconst 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 className: style.validateButton,\n customStyle: {\n backgroundColor: primarySkinColor\n }\n };\n\n return (\n <div key=\"button-wrapper\" className={style.validateButtonWrapper}>\n <ButtonLink {...validateButtonProps} />\n </div>\n );\n};\n\nValidateButton.propTypes = {\n slideIndex: PropTypes.string,\n validateButton: propTypes.validateButton,\n primarySkinColor: PropTypes.string\n};\n\nconst QuestionContainer = props => {\n const {answerUI, questionText, questionOrigin, disableContent} = props;\n if (!answerUI || !questionText) return null;\n\n return (\n <div\n key=\"content-container\"\n data-testid=\"content-container\"\n className={classnames(\n style.slideContentContainer,\n disableContent ? style.disabledSlideContent : null\n )}\n >\n <div key=\"from-course\" className={style.questionOrigin}>\n {questionOrigin}\n </div>\n <div\n key=\"title\"\n data-testid=\"slide-question\"\n className={style.question}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: questionText}}\n />\n <div\n key=\"help\"\n className={style.help}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: get('help', answerUI)}}\n />\n <div key=\"answer-container\" className={style.answerContainer}>\n <Answer {...answerUI} key=\"answer\" />\n </div>\n </div>\n );\n};\n\nQuestionContainer.propTypes = {\n answerUI: PropTypes.shape(propTypes.slide.answerUI),\n questionText: PropTypes.string,\n questionOrigin: PropTypes.string,\n disableContent: PropTypes.bool\n};\n\nconst ReviewSlide = props => {\n const {slide, validateButton, correctionPopinProps, slideIndex = '0'} = props;\n\n const skin = GetSkinFromContext();\n const primarySkinColor = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const {\n loading,\n loadingAriaLabel,\n parentContentTitle,\n questionText,\n disabledContent,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <div data-testid=\"review-slide\" className={style.slide}>\n {loading ? (\n <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n ) : (\n <>\n <QuestionContainer\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n disableContent={disabledContent}\n key=\"question-container\"\n />\n <ValidateButton\n slideIndex={slideIndex}\n validateButton={validateButton}\n primarySkinColor={primarySkinColor}\n key=\"validate-button\"\n />\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n </>\n )}\n </div>\n );\n};\n\nReviewSlide.propTypes = propTypes;\n\nexport default ReviewSlide;\n"],"mappings":";;;;;A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MAAM;IACJG,OADI;IAEJC,gBAFI;IAGJC,kBAHI;IAIJjB,YAJI;IAKJkB,eALI;IAMJnB,QANI;IAOJhC,mBAPI;IAQJC;EARI,IASF0C,KATJ;EAWA,oBACE;IAAK,eAAY,cAAjB;IAAgC,SAAS,EAAE7B,cAAA,CAAM6B;EAAjD,GACGK,OAAO,gBACN,6BAAC,eAAD;IAAQ,SAAS,EAAElC,cAAA,CAAMsC,MAAzB;IAAiC,KAAK,EAAC,SAAvC;IAAiD,cAAYH;EAA7D,EADM,gBAGN,yEACE,6BAAC,iBAAD;IACE,cAAc,EAAEC,kBADlB;IAEE,YAAY,EAAEjB,YAFhB;IAGE,QAAQ,EAAED,QAHZ;IAIE,cAAc,EAAEmB,eAJlB;IAKE,GAAG,EAAC;EALN,EADF,eAQE,6BAAC,cAAD;IACE,UAAU,EAAEpD,UADd;IAEE,cAAc,EAAEuB,cAFlB;IAGE,gBAAgB,EAAEC,gBAHpB;IAIE,GAAG,EAAC;EAJN,EARF,eAcE,6BAAC,eAAD;IACE,oBAAoB,EAAEzB,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EAdF,CAJJ,CADF;AA8BD,CA9CD;;AAgDA2C,WAAW,CAAC3B,SAAZ,2CAAwBA,mBAAxB;eAEe2B,W"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAC,gBAAgB,EAAa,MAAM,cAAc,CAAC;AAsL1D,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBAyCrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
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"}
@@ -27,6 +27,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
27
 
28
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
29
 
30
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
31
+
30
32
  const styles = _reactNative.StyleSheet.create({
31
33
  correctionPopinWrapper: {
32
34
  position: 'absolute',
@@ -37,8 +39,25 @@ const styles = _reactNative.StyleSheet.create({
37
39
 
38
40
  const CorrectionPopin = ({
39
41
  correctionPopinProps,
40
- slideIndex
42
+ slideIndex,
43
+ showCorrectionPopin,
44
+ animateCorrectionPopin
41
45
  }) => {
46
+ const translateAnim = (0, _react.useRef)(new _reactNative.Animated.Value(1000)).current;
47
+ const translateYAnim = (0, _react.useCallback)(() => {
48
+ _reactNative.Animated.timing(translateAnim, {
49
+ toValue: 0,
50
+ duration: 800,
51
+ easing: _reactNative.Easing.bezier(0.37, 0, 0.63, 1),
52
+ useNativeDriver: true
53
+ }).start();
54
+ }, [translateAnim]);
55
+
56
+ if (animateCorrectionPopin) {
57
+ translateYAnim();
58
+ }
59
+
60
+ if (!showCorrectionPopin) return null;
42
61
  const klf = (0, _getOr.default)(undefined, 'klf', correctionPopinProps);
43
62
  const information = (0, _getOr.default)({
44
63
  label: '',
@@ -58,78 +77,96 @@ const CorrectionPopin = ({
58
77
  type: correctionPopinProps.type,
59
78
  resultLabel: correctionPopinProps.resultLabel
60
79
  };
61
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
62
- style: styles.correctionPopinWrapper
80
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
81
+ style: _extends({}, styles.correctionPopinWrapper, {
82
+ transform: [{
83
+ translateY: translateAnim
84
+ }]
85
+ })
63
86
  }, /*#__PURE__*/_react.default.createElement(_index3.default, _correctionPopinProps));
64
- }; // const ValidateButton = ({slideIndex, validateButton, primarySkinColor}) => {
65
- // const {label, onClick, disabled} = validateButton;
66
- // const validateButtonProps = {
67
- // type: 'primary',
68
- // label,
69
- // 'aria-label': label,
70
- // 'data-name': `slide-validate-button-${slideIndex}`,
71
- // onClick,
72
- // disabled,
73
- // customStyle: {
74
- // backgroundColor: primarySkinColor
75
- // }
76
- // };
77
- // return <Button title="validate todo" />;
78
- // };
79
-
80
-
81
- const createQuestionStyle = (theme, brandTheme) => {
82
- var _brandTheme$colors;
87
+ };
83
88
 
84
- return _reactNative.StyleSheet.create({
85
- questionHeading: {
86
- justifyContent: 'space-between'
87
- },
88
- questionOrigin: {
89
- fontSize: 12,
90
- lineHeight: 16,
91
- color: theme.colors.text.primary,
92
- marginBottom: theme.spacing.tiny,
93
- marginTop: theme.spacing.small,
94
- textAlign: 'center'
95
- },
96
- questionText: {
97
- fontSize: 16,
98
- lineHeight: 22,
99
- fontWeight: '700',
100
- color: theme.colors.text.primary,
101
- textAlign: 'center'
102
- },
103
- questionHelp: {
104
- fontSize: 12,
105
- lineHeight: 16,
106
- color: theme.colors.gray.medium,
107
- marginBottom: 0,
108
- marginTop: theme.spacing.small,
109
- textAlign: 'center'
110
- },
111
- choicesContainer: {
112
- flex: 1,
113
- width: '100%',
114
- justifyContent: 'center'
115
- },
116
- validateButton: {
117
- backgroundColor: (brandTheme == null ? void 0 : (_brandTheme$colors = brandTheme.colors) == null ? void 0 : _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
- }
130
- });
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));
131
134
  };
132
135
 
136
+ const createQuestionStyle = theme => _reactNative.StyleSheet.create({
137
+ questionHeading: {
138
+ justifyContent: 'space-between'
139
+ },
140
+ questionOrigin: {
141
+ fontSize: 12,
142
+ lineHeight: 16,
143
+ color: theme.colors.text.primary,
144
+ marginBottom: theme.spacing.tiny,
145
+ marginTop: theme.spacing.small,
146
+ textAlign: 'center'
147
+ },
148
+ questionText: {
149
+ fontSize: 16,
150
+ lineHeight: 22,
151
+ fontWeight: '700',
152
+ color: theme.colors.text.primary,
153
+ textAlign: 'center'
154
+ },
155
+ questionHelp: {
156
+ fontSize: 12,
157
+ lineHeight: 16,
158
+ color: theme.colors.gray.medium,
159
+ marginBottom: 0,
160
+ marginTop: theme.spacing.small,
161
+ textAlign: 'center'
162
+ },
163
+ choicesContainer: {
164
+ flex: 1,
165
+ width: '100%',
166
+ justifyContent: 'center'
167
+ }
168
+ });
169
+
133
170
  const Question = props => {
134
171
  const {
135
172
  answerUI,
@@ -137,14 +174,13 @@ const Question = props => {
137
174
  questionOrigin
138
175
  } = props;
139
176
  const {
140
- theme,
141
- brandTheme
177
+ theme
142
178
  } = (0, _templateContext.useTemplateContext)();
143
179
  const [style, setStyle] = (0, _react.useState)();
144
180
  (0, _react.useEffect)(() => {
145
- const questionStyle = createQuestionStyle(theme, brandTheme);
181
+ const questionStyle = createQuestionStyle(theme);
146
182
  setStyle(questionStyle);
147
- }, [theme, brandTheme]);
183
+ }, [theme]);
148
184
  if (!answerUI || !questionText || !style) return null;
149
185
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
150
186
  style: style.questionHeading
@@ -156,11 +192,7 @@ const Question = props => {
156
192
  style: style.questionHelp
157
193
  }, (0, _get.default)('help', answerUI))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
158
194
  style: style.choicesContainer
159
- }, /*#__PURE__*/_react.default.createElement(_index2.default, answerUI)), /*#__PURE__*/_react.default.createElement(_index4.default, {
160
- style: style.validateButton
161
- }, /*#__PURE__*/_react.default.createElement(_index.default, {
162
- style: style.validateButtonText
163
- }, "@todo validate")));
195
+ }, /*#__PURE__*/_react.default.createElement(_index2.default, answerUI)));
164
196
  };
165
197
 
166
198
  const createSlideStyle = (num, screenWidth) => {
@@ -194,6 +226,7 @@ const Slide = props => {
194
226
  const {
195
227
  slide,
196
228
  correctionPopinProps,
229
+ validateButton,
197
230
  num,
198
231
  slideIndex = '0'
199
232
  } = props;
@@ -219,6 +252,10 @@ const Slide = props => {
219
252
  questionText: questionText,
220
253
  answerUI: answerUI,
221
254
  key: "question-container"
255
+ }), /*#__PURE__*/_react.default.createElement(ValidateButton, {
256
+ slideIndex: slideIndex,
257
+ validateButton: validateButton,
258
+ key: "validate-button"
222
259
  }), correctionPopinProps ? /*#__PURE__*/_react.default.createElement(CorrectionPopin, {
223
260
  correctionPopinProps: correctionPopinProps,
224
261
  slideIndex: slideIndex,
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","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","showCorrectionPopin","animateCorrectionPopin"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, TextStyle, useWindowDimensions, View, ViewStyle} 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 {ReviewCorrectionPopinProps} from '../../molecule/review-correction-popin/prop-types';\nimport {ReviewSlideProps, SlideProps} from './prop-types';\n\ntype PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: unknown;\n showCorrectionPopin: unknown;\n animateCorrectionPopin: unknown;\n};\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({correctionPopinProps, slideIndex}: PopinProps) => {\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 <View style={styles.correctionPopinWrapper}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </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;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAYA,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,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Z;IAIE,GAAG,EAAC;EAJN,EADF,EAOG9C,oBAAoB,gBACnB,6BAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEuE,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IAfN,CALJ,CADF;AA0BD,CAzCD;;eA2CeN,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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GhB,gBAAgB,CAACC,GAAD,EAAMhF,KAAN,CAAnC;EAEA,MAAM;IACJgG,OADI;IAEJC,kBAFI;IAGJ5B,YAHI;IAIJQ,QAJI;IAKJzE,mBALI;IAMJC;EANI,IAOF8E,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,EAAE5B,YAFhB;IAGE,QAAQ,EAAEQ,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,6BAAC,cAAD;IACE,UAAU,EAAE1E,UADd;IAEE,cAAc,EAAEmC,cAFlB;IAGE,GAAG,EAAC;EAHN,EAPF,EAYGpC,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,IApBN,CALJ,CADF;AA+BD,CA9CD;;eAgDewF,K"}
@@ -176,6 +176,17 @@ declare const propTypes: {
176
176
  }>>;
177
177
  };
178
178
  export default propTypes;
179
+ export declare type PopinProps = {
180
+ correctionPopinProps: ReviewCorrectionPopinProps;
181
+ slideIndex: string;
182
+ showCorrectionPopin?: boolean;
183
+ animateCorrectionPopin?: boolean;
184
+ };
185
+ export declare type ValidateButtonProps = {
186
+ slideIndex: string;
187
+ validateButton: ReviewSlideProps['validateButton'];
188
+ primarySkinColor?: string;
189
+ };
179
190
  export declare type SlideProps = {
180
191
  position: number;
181
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;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