@coorpacademy/components 10.26.0 → 10.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/choice/index.native.d.ts.map +1 -1
- package/es/atom/choice/index.native.js +6 -4
- package/es/atom/choice/index.native.js.map +1 -1
- package/es/atom/header-back-button/index.native.d.ts +1 -1
- package/es/atom/header-back-button/index.native.d.ts.map +1 -1
- package/es/atom/header-back-button/index.native.js.map +1 -1
- package/es/atom/html/index.native.d.ts.map +1 -1
- package/es/atom/html/index.native.js +8 -14
- package/es/atom/html/index.native.js.map +1 -1
- package/es/atom/image-background/index.native.d.ts.map +1 -1
- package/es/atom/image-background/index.native.js +0 -1
- package/es/atom/image-background/index.native.js.map +1 -1
- package/es/atom/provider/web-context.d.ts +3 -3
- package/es/atom/provider/web-context.d.ts.map +1 -1
- package/es/atom/provider/web-context.js +10 -11
- package/es/atom/provider/web-context.js.map +1 -1
- package/es/atom/review-header-step-item/index.native.d.ts.map +1 -1
- package/es/atom/review-header-step-item/index.native.js.map +1 -1
- package/es/atom/select-modal/index.native.js.map +1 -1
- package/es/hoc/modal/index.native.d.ts +1 -1
- package/es/hoc/modal/index.native.d.ts.map +1 -1
- package/es/hoc/modal/index.native.js.map +1 -1
- package/es/hoc/modal/select/index.native.d.ts.map +1 -1
- package/es/hoc/modal/select/index.native.js +3 -3
- package/es/hoc/modal/select/index.native.js.map +1 -1
- package/es/hoc/modal/select-item/index.native.d.ts +1 -1
- package/es/hoc/modal/select-item/index.native.d.ts.map +1 -1
- package/es/hoc/modal/select-item/index.native.js +1 -1
- package/es/hoc/modal/select-item/index.native.js.map +1 -1
- package/es/hoc/touchable/index.native.d.ts +5 -5
- package/es/hoc/touchable/index.native.d.ts.map +1 -1
- package/es/hoc/touchable/index.native.js.map +1 -1
- package/es/molecule/answer/prop-types.d.ts +2 -18
- package/es/molecule/answer/prop-types.d.ts.map +1 -1
- package/es/molecule/answer/prop-types.js.map +1 -1
- package/es/molecule/brand-logo/index.native.d.ts.map +1 -1
- package/es/molecule/brand-logo/index.native.js +4 -3
- package/es/molecule/brand-logo/index.native.js.map +1 -1
- package/es/molecule/questions/free-text/index.native.d.ts.map +1 -1
- package/es/molecule/questions/free-text/index.native.js +2 -2
- package/es/molecule/questions/free-text/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/draggable/index.native.js +1 -1
- package/es/molecule/questions/mobile/draggable/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/slider/index.native.js +3 -3
- package/es/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/switch/index.native.js +2 -2
- package/es/molecule/questions/mobile/switch/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/template/index.native.js +3 -3
- package/es/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/es/molecule/questions/types.d.ts +10 -3
- package/es/molecule/questions/types.d.ts.map +1 -1
- package/es/molecule/questions/types.js.map +1 -1
- package/es/molecule/video-player/jwplayer.d.ts +1 -3
- package/es/molecule/video-player/jwplayer.d.ts.map +1 -1
- package/es/molecule/video-player/jwplayer.js +32 -34
- package/es/molecule/video-player/jwplayer.js.map +1 -1
- package/es/organism/header-v2/index.native.d.ts +3 -3
- package/es/organism/header-v2/index.native.d.ts.map +1 -1
- package/es/organism/header-v2/index.native.js.map +1 -1
- package/es/organism/mobile-navigation/index.native.d.ts +24 -2
- package/es/organism/mobile-navigation/index.native.d.ts.map +1 -1
- package/es/organism/mobile-navigation/index.native.js.map +1 -1
- package/es/organism/review-slide/index.native.d.ts.map +1 -1
- package/es/organism/review-slide/index.native.js +7 -8
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/template/app-player/popin-header/index.js +4 -4
- package/es/template/app-player/popin-header/index.js.map +1 -1
- package/es/template/app-review/index.native.js +0 -2
- package/es/template/app-review/index.native.js.map +1 -1
- package/es/template/app-review/player/index.native.js +2 -5
- package/es/template/app-review/player/index.native.js.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.js.map +1 -1
- package/es/template/app-review/template-context.d.ts +4 -3
- package/es/template/app-review/template-context.d.ts.map +1 -1
- package/es/template/app-review/template-context.js +3 -3
- package/es/template/app-review/template-context.js.map +1 -1
- package/es/variables/analytics.d.ts +4 -1
- package/es/variables/analytics.d.ts.map +1 -1
- package/es/variables/analytics.js.map +1 -1
- package/es/variables/brand.native.d.ts +1 -0
- package/es/variables/brand.native.d.ts.map +1 -1
- package/es/variables/brand.native.js +1 -1
- package/es/variables/brand.native.js.map +1 -1
- package/es/variables/theme.native.d.ts +0 -1
- package/es/variables/theme.native.d.ts.map +1 -1
- package/es/variables/theme.native.js +0 -1
- package/es/variables/theme.native.js.map +1 -1
- package/lib/atom/choice/index.native.d.ts.map +1 -1
- package/lib/atom/choice/index.native.js +6 -4
- package/lib/atom/choice/index.native.js.map +1 -1
- package/lib/atom/header-back-button/index.native.d.ts +1 -1
- package/lib/atom/header-back-button/index.native.d.ts.map +1 -1
- package/lib/atom/header-back-button/index.native.js.map +1 -1
- package/lib/atom/html/index.native.d.ts.map +1 -1
- package/lib/atom/html/index.native.js +7 -13
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/atom/image-background/index.native.d.ts.map +1 -1
- package/lib/atom/image-background/index.native.js +0 -1
- package/lib/atom/image-background/index.native.js.map +1 -1
- package/lib/atom/provider/web-context.d.ts +3 -3
- package/lib/atom/provider/web-context.d.ts.map +1 -1
- package/lib/atom/provider/web-context.js +10 -11
- package/lib/atom/provider/web-context.js.map +1 -1
- package/lib/atom/review-header-step-item/index.native.d.ts.map +1 -1
- package/lib/atom/review-header-step-item/index.native.js.map +1 -1
- package/lib/atom/select-modal/index.native.js.map +1 -1
- package/lib/hoc/modal/index.native.d.ts +1 -1
- package/lib/hoc/modal/index.native.d.ts.map +1 -1
- package/lib/hoc/modal/index.native.js.map +1 -1
- package/lib/hoc/modal/select/index.native.d.ts.map +1 -1
- package/lib/hoc/modal/select/index.native.js +3 -3
- package/lib/hoc/modal/select/index.native.js.map +1 -1
- package/lib/hoc/modal/select-item/index.native.d.ts +1 -1
- package/lib/hoc/modal/select-item/index.native.d.ts.map +1 -1
- package/lib/hoc/modal/select-item/index.native.js +1 -1
- package/lib/hoc/modal/select-item/index.native.js.map +1 -1
- package/lib/hoc/touchable/index.native.d.ts +5 -5
- package/lib/hoc/touchable/index.native.d.ts.map +1 -1
- package/lib/hoc/touchable/index.native.js.map +1 -1
- package/lib/molecule/answer/prop-types.d.ts +2 -18
- package/lib/molecule/answer/prop-types.d.ts.map +1 -1
- package/lib/molecule/answer/prop-types.js.map +1 -1
- package/lib/molecule/brand-logo/index.native.d.ts.map +1 -1
- package/lib/molecule/brand-logo/index.native.js +4 -3
- package/lib/molecule/brand-logo/index.native.js.map +1 -1
- package/lib/molecule/questions/free-text/index.native.d.ts.map +1 -1
- package/lib/molecule/questions/free-text/index.native.js +2 -2
- package/lib/molecule/questions/free-text/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/draggable/index.native.js +1 -1
- package/lib/molecule/questions/mobile/draggable/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/slider/index.native.js +3 -3
- package/lib/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/switch/index.native.js +2 -2
- package/lib/molecule/questions/mobile/switch/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/template/index.native.js +3 -3
- package/lib/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/lib/molecule/questions/types.d.ts +10 -3
- package/lib/molecule/questions/types.d.ts.map +1 -1
- package/lib/molecule/questions/types.js.map +1 -1
- package/lib/molecule/video-player/jwplayer.d.ts +1 -3
- package/lib/molecule/video-player/jwplayer.d.ts.map +1 -1
- package/lib/molecule/video-player/jwplayer.js +32 -34
- package/lib/molecule/video-player/jwplayer.js.map +1 -1
- package/lib/organism/header-v2/index.native.d.ts +3 -3
- package/lib/organism/header-v2/index.native.d.ts.map +1 -1
- package/lib/organism/header-v2/index.native.js.map +1 -1
- package/lib/organism/mobile-navigation/index.native.d.ts +24 -2
- package/lib/organism/mobile-navigation/index.native.d.ts.map +1 -1
- package/lib/organism/mobile-navigation/index.native.js.map +1 -1
- package/lib/organism/review-slide/index.native.d.ts.map +1 -1
- package/lib/organism/review-slide/index.native.js +7 -8
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/template/app-player/popin-header/index.js +4 -4
- package/lib/template/app-player/popin-header/index.js.map +1 -1
- package/lib/template/app-review/index.native.js +0 -2
- package/lib/template/app-review/index.native.js.map +1 -1
- package/lib/template/app-review/player/index.native.js +2 -5
- package/lib/template/app-review/player/index.native.js.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.js.map +1 -1
- package/lib/template/app-review/template-context.d.ts +4 -3
- package/lib/template/app-review/template-context.d.ts.map +1 -1
- package/lib/template/app-review/template-context.js +4 -3
- package/lib/template/app-review/template-context.js.map +1 -1
- package/lib/variables/analytics.d.ts +4 -1
- package/lib/variables/analytics.d.ts.map +1 -1
- package/lib/variables/analytics.js.map +1 -1
- package/lib/variables/brand.native.d.ts +1 -0
- package/lib/variables/brand.native.d.ts.map +1 -1
- package/lib/variables/brand.native.js +5 -0
- package/lib/variables/brand.native.js.map +1 -1
- package/lib/variables/theme.native.d.ts +0 -1
- package/lib/variables/theme.native.d.ts.map +1 -1
- package/lib/variables/theme.native.js +0 -1
- package/lib/variables/theme.native.js.map +1 -1
- package/package.json +6 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/choice/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAmB,SAAS,EAAkB,MAAM,cAAc,CAAC;AAC1E,OAAO,KAAK,EAAC,KAAK,EAAE,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAQxE,oBAAY,KAAK,GAAG;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAoEF,QAAA,MAAM,MAAM,8GAUT,KAAK,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/choice/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAmB,SAAS,EAAkB,MAAM,cAAc,CAAC;AAC1E,OAAO,KAAK,EAAC,KAAK,EAAE,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAQxE,oBAAY,KAAK,GAAG;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAoEF,QAAA,MAAM,MAAM,8GAUT,KAAK,uBAqFP,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -105,11 +105,11 @@ const Choice = ({
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
if (isSelected) {
|
|
108
|
-
textStyle.push(styleSheet.textSelected);
|
|
108
|
+
textStyle.push(styleSheet.textSelected); // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread
|
|
109
109
|
|
|
110
110
|
const selectionStyle = brandTheme && _extends({
|
|
111
|
-
backgroundColor: brandTheme.colors
|
|
112
|
-
borderColor: brandTheme.colors
|
|
111
|
+
backgroundColor: brandTheme.colors?.primary,
|
|
112
|
+
borderColor: brandTheme.colors?.primary
|
|
113
113
|
}, url ? {
|
|
114
114
|
borderTopRightRadius: theme.radius.regular,
|
|
115
115
|
borderBottomRightRadius: theme.radius.regular
|
|
@@ -117,7 +117,9 @@ const Choice = ({
|
|
|
117
117
|
borderRadius: theme.radius.regular
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
if (selectionStyle) {
|
|
121
|
+
textWrapperStyle.push(selectionStyle);
|
|
122
|
+
}
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
return /*#__PURE__*/React.createElement(Touchable, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","View","StyleSheet","Text","ImageBackground","getCleanUri","Touchable","useTemplateContext","createStyleSheet","theme","squeezed","create","boxShadow","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","backgroundColor","container","colors","white","borderRadius","radius","regular","flexDirection","alignItems","textContainer","paddingHorizontal","paddingVertical","justifyContent","flex","squeezedTextContainer","padding","spacing","small","paddingLeft","undefined","paddingRight","text","fontSize","medium","fontWeight","bold","color","black","textAlign","textSelected","unselectedImageContainer","borderRightColor","border","imageContainer","overflow","borderTopLeftRadius","borderBottomLeftRadius","image","Choice","children","isSelected","isDisabled","onPress","media","testID","prefixTestID","style","questionType","templateContext","brandTheme","styleSheet","setStylesheet","_stylesheet","selectedSuffix","mediaType","type","toLowerCase","url","src","length","source","uri","mediaSuffix","textStyle","textWrapperStyle","push","selectionStyle","primary","borderColor","borderTopRightRadius","borderBottomRightRadius"],"sources":["../../../src/atom/choice/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {View, StyleSheet, ViewStyle, Text, TextStyle} from 'react-native';\nimport type {Media, QuestionType} from '../../molecule/questions/types';\n\nimport ImageBackground from '../image-background/index.native';\nimport getCleanUri from '../../util/get-clean-uri';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\nexport type Props = {\n isSelected?: boolean;\n onPress: () => void;\n children?: string;\n isDisabled?: boolean;\n testID?: string;\n media?: Media;\n squeezed?: boolean;\n style?: ViewStyle;\n questionType: QuestionType;\n};\n\ntype StyleSheetType = {\n boxShadow: ViewStyle;\n container: ViewStyle;\n text: TextStyle;\n textSelected: TextStyle;\n textContainer: ViewStyle;\n squeezedTextContainer: ViewStyle;\n unselectedImageContainer: ViewStyle;\n imageContainer: ViewStyle;\n image: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme, squeezed: boolean): StyleSheetType =>\n StyleSheet.create({\n boxShadow: {\n shadowColor: '#000',\n shadowOffset: {width: 0, height: 4},\n shadowOpacity: 0.12,\n shadowRadius: 16,\n elevation: 8,\n backgroundColor: '#0000'\n },\n container: {\n backgroundColor: theme.colors.white,\n borderRadius: theme.radius.regular,\n flexDirection: 'row',\n alignItems: 'stretch'\n },\n textContainer: {\n paddingHorizontal: 24,\n paddingVertical: 12,\n justifyContent: 'center',\n alignItems: 'center',\n flex: 1\n },\n squeezedTextContainer: {\n padding: theme.spacing.small,\n paddingLeft: undefined,\n paddingVertical: undefined,\n paddingRight: undefined,\n flex: 0\n },\n text: {\n fontSize: squeezed ? theme.fontSize.medium : theme.fontSize.regular,\n fontWeight: theme.fontWeight.bold,\n color: theme.colors.black,\n textAlign: 'center'\n },\n textSelected: {\n color: theme.colors.white\n },\n unselectedImageContainer: {\n borderRightColor: theme.colors.border\n },\n imageContainer: {\n height: '100%',\n width: '25%',\n overflow: 'hidden',\n borderTopLeftRadius: theme.radius.regular,\n borderBottomLeftRadius: theme.radius.regular\n },\n image: {\n flex: 1\n }\n });\n\nconst Choice = ({\n children,\n isSelected = false,\n squeezed = false,\n isDisabled,\n onPress,\n media,\n testID: prefixTestID,\n style,\n questionType\n}: Props) => {\n const templateContext = useTemplateContext();\n const {theme, brandTheme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, squeezed);\n setStylesheet(_stylesheet);\n }, [theme, squeezed]);\n\n if (!styleSheet) {\n return null;\n }\n\n const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';\n const mediaType = media && media.type && media.type === 'img' && media.type.toLowerCase();\n const url =\n media &&\n media.type === 'img' &&\n media.src &&\n media.src.length > 0 &&\n getCleanUri(media.src[0].url);\n\n const source = {uri: url ? getCleanUri(url) : undefined};\n const mediaSuffix = prefixTestID && mediaType ? `-${mediaType}` : '';\n\n const textStyle: TextStyle[] = [styleSheet.text];\n const textWrapperStyle: ViewStyle[] = [styleSheet.textContainer];\n\n if (squeezed) {\n textWrapperStyle.push(styleSheet.squeezedTextContainer);\n }\n\n if (isSelected) {\n textStyle.push(styleSheet.textSelected);\n\n const selectionStyle = brandTheme && {\n backgroundColor: brandTheme.colors.primary,\n borderColor: brandTheme.colors.primary,\n ...(url\n ? {\n borderTopRightRadius: theme.radius.regular,\n borderBottomRightRadius: theme.radius.regular\n }\n : {\n borderRadius: theme.radius.regular\n })\n };\n\n textWrapperStyle.push(selectionStyle);\n }\n\n return (\n <Touchable\n onPress={!isDisabled ? onPress : undefined}\n style={style}\n analyticsID=\"question-choice\"\n analyticsParams={{questionType}}\n >\n <View\n style={[styleSheet.boxShadow, styleSheet.container]}\n testID={prefixTestID && `${prefixTestID}${selectedSuffix}`}\n >\n {url ? (\n <View style={styleSheet.imageContainer}>\n <ImageBackground\n testID={prefixTestID && `${prefixTestID}${mediaSuffix}`}\n source={source}\n style={styleSheet.image}\n />\n </View>\n ) : null}\n\n {children ? (\n <View style={textWrapperStyle}>\n <Text style={textStyle}>{children}</Text>\n </View>\n ) : null}\n </View>\n </Touchable>\n );\n};\n\nexport default Choice;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAe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AjC;;IAaA0D,gBAAgB,CAACC,IAAjB,CAAsBC,cAAtB;EACD;;EAED,oBACE,oBAAC,SAAD;IACE,OAAO,EAAE,CAACzB,UAAD,GAAcC,OAAd,GAAwBvB,SADnC;IAEE,KAAK,EAAE2B,KAFT;IAGE,WAAW,EAAC,iBAHd;IAIE,eAAe,EAAE;MAACC;IAAD;EAJnB,gBAME,oBAAC,IAAD;IACE,KAAK,EAAE,CAACG,UAAU,CAAC1D,SAAZ,EAAuB0D,UAAU,CAACjD,SAAlC,CADT;IAEE,MAAM,EAAE4C,YAAY,IAAK,GAAEA,YAAa,GAAEQ,cAAe;EAF3D,GAIGI,GAAG,gBACF,oBAAC,IAAD;IAAM,KAAK,EAAEP,UAAU,CAACjB;EAAxB,gBACE,oBAAC,eAAD;IACE,MAAM,EAAEY,YAAY,IAAK,GAAEA,YAAa,GAAEiB,WAAY,EADxD;IAEE,MAAM,EAAEF,MAFV;IAGE,KAAK,EAAEV,UAAU,CAACb;EAHpB,EADF,CADE,GAQA,IAZN,EAcGE,QAAQ,gBACP,oBAAC,IAAD;IAAM,KAAK,EAAEyB;EAAb,gBACE,oBAAC,IAAD;IAAM,KAAK,EAAED;EAAb,GAAyBxB,QAAzB,CADF,CADO,GAIL,IAlBN,CANF,CADF;AA6BD,CA5FD;;AA8FA,eAAeD,MAAf"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","View","StyleSheet","Text","ImageBackground","getCleanUri","Touchable","useTemplateContext","createStyleSheet","theme","squeezed","create","boxShadow","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","backgroundColor","container","colors","white","borderRadius","radius","regular","flexDirection","alignItems","textContainer","paddingHorizontal","paddingVertical","justifyContent","flex","squeezedTextContainer","padding","spacing","small","paddingLeft","undefined","paddingRight","text","fontSize","medium","fontWeight","bold","color","black","textAlign","textSelected","unselectedImageContainer","borderRightColor","border","imageContainer","overflow","borderTopLeftRadius","borderBottomLeftRadius","image","Choice","children","isSelected","isDisabled","onPress","media","testID","prefixTestID","style","questionType","templateContext","brandTheme","styleSheet","setStylesheet","_stylesheet","selectedSuffix","mediaType","type","toLowerCase","url","src","length","source","uri","mediaSuffix","textStyle","textWrapperStyle","push","selectionStyle","primary","borderColor","borderTopRightRadius","borderBottomRightRadius"],"sources":["../../../src/atom/choice/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {View, StyleSheet, ViewStyle, Text, TextStyle} from 'react-native';\nimport type {Media, QuestionType} from '../../molecule/questions/types';\n\nimport ImageBackground from '../image-background/index.native';\nimport getCleanUri from '../../util/get-clean-uri';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\nexport type Props = {\n isSelected?: boolean;\n onPress: () => void;\n children?: string;\n isDisabled?: boolean;\n testID?: string;\n media?: Media;\n squeezed?: boolean;\n style?: ViewStyle;\n questionType: QuestionType;\n};\n\ntype StyleSheetType = {\n boxShadow: ViewStyle;\n container: ViewStyle;\n text: TextStyle;\n textSelected: TextStyle;\n textContainer: ViewStyle;\n squeezedTextContainer: ViewStyle;\n unselectedImageContainer: ViewStyle;\n imageContainer: ViewStyle;\n image: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme, squeezed: boolean): StyleSheetType =>\n StyleSheet.create({\n boxShadow: {\n shadowColor: '#000',\n shadowOffset: {width: 0, height: 4},\n shadowOpacity: 0.12,\n shadowRadius: 16,\n elevation: 8,\n backgroundColor: '#0000'\n },\n container: {\n backgroundColor: theme.colors.white,\n borderRadius: theme.radius.regular,\n flexDirection: 'row',\n alignItems: 'stretch'\n },\n textContainer: {\n paddingHorizontal: 24,\n paddingVertical: 12,\n justifyContent: 'center',\n alignItems: 'center',\n flex: 1\n },\n squeezedTextContainer: {\n padding: theme.spacing.small,\n paddingLeft: undefined,\n paddingVertical: undefined,\n paddingRight: undefined,\n flex: 0\n },\n text: {\n fontSize: squeezed ? theme.fontSize.medium : theme.fontSize.regular,\n fontWeight: theme.fontWeight.bold,\n color: theme.colors.black,\n textAlign: 'center'\n },\n textSelected: {\n color: theme.colors.white\n },\n unselectedImageContainer: {\n borderRightColor: theme.colors.border\n },\n imageContainer: {\n height: '100%',\n width: '25%',\n overflow: 'hidden',\n borderTopLeftRadius: theme.radius.regular,\n borderBottomLeftRadius: theme.radius.regular\n },\n image: {\n flex: 1\n }\n });\n\nconst Choice = ({\n children,\n isSelected = false,\n squeezed = false,\n isDisabled,\n onPress,\n media,\n testID: prefixTestID,\n style,\n questionType\n}: Props) => {\n const templateContext = useTemplateContext();\n const {theme, brandTheme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, squeezed);\n setStylesheet(_stylesheet);\n }, [theme, squeezed]);\n\n if (!styleSheet) {\n return null;\n }\n\n const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';\n const mediaType = media && media.type && media.type === 'img' && media.type.toLowerCase();\n const url =\n media &&\n media.type === 'img' &&\n media.src &&\n media.src.length > 0 &&\n getCleanUri(media.src[0].url);\n\n const source = {uri: url ? getCleanUri(url) : undefined};\n const mediaSuffix = prefixTestID && mediaType ? `-${mediaType}` : '';\n\n const textStyle: TextStyle[] = [styleSheet.text];\n const textWrapperStyle: ViewStyle[] = [styleSheet.textContainer];\n\n if (squeezed) {\n textWrapperStyle.push(styleSheet.squeezedTextContainer);\n }\n\n if (isSelected) {\n textStyle.push(styleSheet.textSelected);\n\n // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread\n const selectionStyle = brandTheme && {\n backgroundColor: brandTheme.colors?.primary,\n borderColor: brandTheme.colors?.primary,\n ...(url\n ? {\n borderTopRightRadius: theme.radius.regular,\n borderBottomRightRadius: theme.radius.regular\n }\n : {\n borderRadius: theme.radius.regular\n })\n };\n\n if (selectionStyle) {\n textWrapperStyle.push(selectionStyle);\n }\n }\n\n return (\n <Touchable\n onPress={!isDisabled ? onPress : undefined}\n style={style}\n analyticsID=\"question-choice\"\n analyticsParams={{questionType}}\n >\n <View\n style={[styleSheet.boxShadow, styleSheet.container]}\n testID={prefixTestID && `${prefixTestID}${selectedSuffix}`}\n >\n {url ? (\n <View style={styleSheet.imageContainer}>\n <ImageBackground\n testID={prefixTestID && `${prefixTestID}${mediaSuffix}`}\n source={source}\n style={styleSheet.image}\n />\n </View>\n ) : null}\n\n {children ? (\n <View style={textWrapperStyle}>\n <Text style={textStyle}>{children}</Text>\n </View>\n ) : null}\n </View>\n </Touchable>\n );\n};\n\nexport default Choice;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SAAQC,IAAR,EAAcC,UAAd,EAAqCC,IAArC,QAA2D,cAA3D;AAGA,OAAOC,eAAP,MAA4B,kCAA5B;AACA,OAAOC,WAAP,MAAwB,0BAAxB;AACA,OAAOC,SAAP,MAAsB,kCAAtB;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;;AA2BA,MAAMC,gBAAgB,GAAG,CAACC,KAAD,EAAeC,QAAf,KACvBR,UAAU,CAACS,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,WAAW,EAAE,MADJ;IAETC,YAAY,EAAE;MAACC,KAAK,EAAE,CAAR;MAAWC,MAAM,EAAE;IAAnB,CAFL;IAGTC,aAAa,EAAE,IAHN;IAITC,YAAY,EAAE,EAJL;IAKTC,SAAS,EAAE,CALF;IAMTC,eAAe,EAAE;EANR,CADK;EAShBC,SAAS,EAAE;IACTD,eAAe,EAAEX,KAAK,CAACa,MAAN,CAAaC,KADrB;IAETC,YAAY,EAAEf,KAAK,CAACgB,MAAN,CAAaC,OAFlB;IAGTC,aAAa,EAAE,KAHN;IAITC,UAAU,EAAE;EAJH,CATK;EAehBC,aAAa,EAAE;IACbC,iBAAiB,EAAE,EADN;IAEbC,eAAe,EAAE,EAFJ;IAGbC,cAAc,EAAE,QAHH;IAIbJ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F,CADF;AA6BD,CA/FD;;AAiGA,eAAeD,MAAf"}
|
|
@@ -6,7 +6,7 @@ export declare const BACK_ICON_HEIGHT = 20;
|
|
|
6
6
|
export declare type Props = {
|
|
7
7
|
type: 'close' | 'back' | 'home';
|
|
8
8
|
color?: string;
|
|
9
|
-
onPress?: (event: GestureResponderEvent) =>
|
|
9
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
10
10
|
isFloating?: boolean;
|
|
11
11
|
noSafeArea?: boolean;
|
|
12
12
|
testID?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/header-back-button/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAmB,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAWhF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,oBAAY,KAAK,GAAG;IAClB,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/header-back-button/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAmB,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAWhF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,oBAAY,KAAK,GAAG;IAClB,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAuBF,QAAA,MAAM,gBAAgB,UAAW,KAAK,uBA+CrC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","View","StyleSheet","NovaSolidPlacesPlacesHome2","HomeIcon","NovaSolidStatusClose","CloseIcon","useTemplateContext","Touchable","HeaderBackIcon","HOME_ICON_HEIGHT","CLOSE_ICON_HEIGHT","BACK_ICON_HEIGHT","createStyleSheet","theme","statusBarHeight","create","container","paddingLeft","spacing","base","floating","paddingTop","position","top","noSafeArea","HeaderBackButton","props","templateContext","styleSheet","setStylesheet","display","type","color","colors","white","onPress","isFloating","testID","_stylesheet"],"sources":["../../../src/atom/header-back-button/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {View, StyleSheet, GestureResponderEvent, ViewStyle} from 'react-native';\n\nimport {\n NovaSolidPlacesPlacesHome2 as HomeIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport Touchable from '../../hoc/touchable/index.native';\nimport HeaderBackIcon from '../header-back-icon/index.native';\nimport {Theme} from '../../variables/theme.native';\n\nexport const HOME_ICON_HEIGHT = 20;\nexport const CLOSE_ICON_HEIGHT = 16;\nexport const BACK_ICON_HEIGHT = 20;\n\nexport type Props = {\n type: 'close' | 'back' | 'home';\n color?: string;\n onPress?: (event: GestureResponderEvent) =>
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","View","StyleSheet","NovaSolidPlacesPlacesHome2","HomeIcon","NovaSolidStatusClose","CloseIcon","useTemplateContext","Touchable","HeaderBackIcon","HOME_ICON_HEIGHT","CLOSE_ICON_HEIGHT","BACK_ICON_HEIGHT","createStyleSheet","theme","statusBarHeight","create","container","paddingLeft","spacing","base","floating","paddingTop","position","top","noSafeArea","HeaderBackButton","props","templateContext","styleSheet","setStylesheet","display","type","color","colors","white","onPress","isFloating","testID","_stylesheet"],"sources":["../../../src/atom/header-back-button/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {View, StyleSheet, GestureResponderEvent, ViewStyle} from 'react-native';\n\nimport {\n NovaSolidPlacesPlacesHome2 as HomeIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport Touchable from '../../hoc/touchable/index.native';\nimport HeaderBackIcon from '../header-back-icon/index.native';\nimport {Theme} from '../../variables/theme.native';\n\nexport const HOME_ICON_HEIGHT = 20;\nexport const CLOSE_ICON_HEIGHT = 16;\nexport const BACK_ICON_HEIGHT = 20;\n\nexport type Props = {\n type: 'close' | 'back' | 'home';\n color?: string;\n onPress?: (event: GestureResponderEvent) => void;\n isFloating?: boolean;\n noSafeArea?: boolean;\n testID?: string;\n};\n\ntype StyleSheetType = {\n container: ViewStyle;\n floating: ViewStyle;\n noSafeArea: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme, statusBarHeight: number): StyleSheetType =>\n StyleSheet.create({\n container: {\n paddingLeft: theme.spacing.base\n },\n floating: {\n paddingTop: theme.spacing.base,\n position: 'absolute',\n top: statusBarHeight\n },\n noSafeArea: {\n top: 0\n }\n });\n\nconst HeaderBackButton = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {\n theme,\n display: {statusBarHeight}\n } = templateContext;\n\n const {\n type,\n color = theme.colors.white,\n onPress,\n isFloating = true,\n noSafeArea = false,\n testID = 'default-header-back-button-test-id'\n } = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, statusBarHeight);\n setStylesheet(_stylesheet);\n }, [theme, statusBarHeight]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View\n style={[\n styleSheet.container,\n isFloating && styleSheet.floating,\n isFloating && noSafeArea && styleSheet.noSafeArea\n ]}\n >\n <Touchable testID={testID} onPress={onPress} analyticsID=\"button-close\">\n {type === 'home' ? (\n <HomeIcon height={HOME_ICON_HEIGHT} width={HOME_ICON_HEIGHT} color={color} />\n ) : null}\n {type === 'close' ? (\n <CloseIcon height={CLOSE_ICON_HEIGHT} width={CLOSE_ICON_HEIGHT} color={color} />\n ) : null}\n {type === 'back' ? (\n <HeaderBackIcon height={BACK_ICON_HEIGHT} width={BACK_ICON_HEIGHT} color={color} />\n ) : null}\n </Touchable>\n </View>\n );\n};\n\nexport default HeaderBackButton;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,QAAyC,OAAzC;AACA,SAAQC,IAAR,EAAcC,UAAd,QAAiE,cAAjE;AAEA,SACEC,0BAA0B,IAAIC,QADhC,EAEEC,oBAAoB,IAAIC,SAF1B,QAGO,0BAHP;AAIA,SAAQC,kBAAR,QAAiC,4CAAjC;AACA,OAAOC,SAAP,MAAsB,kCAAtB;AACA,OAAOC,cAAP,MAA2B,kCAA3B;AAGA,OAAO,MAAMC,gBAAgB,GAAG,EAAzB;AACP,OAAO,MAAMC,iBAAiB,GAAG,EAA1B;AACP,OAAO,MAAMC,gBAAgB,GAAG,EAAzB;;AAiBP,MAAMC,gBAAgB,GAAG,CAACC,KAAD,EAAeC,eAAf,KACvBb,UAAU,CAACc,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,WAAW,EAAEJ,KAAK,CAACK,OAAN,CAAcC;EADlB,CADK;EAIhBC,QAAQ,EAAE;IACRC,UAAU,EAAER,KAAK,CAACK,OAAN,CAAcC,IADlB;IAERG,QAAQ,EAAE,UAFF;IAGRC,GAAG,EAAET;EAHG,CAJM;EAShBU,UAAU,EAAE;IACVD,GAAG,EAAE;EADK;AATI,CAAlB,CADF;;AAeA,MAAME,gBAAgB,GAAIC,KAAD,IAAkB;EACz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,gBAAxB;IAA0C,KAAK,EAAEA,gBAAjD;IAAmE,KAAK,EAAEqB;EAA1E,EADD,GAEG,IATN,CAPF,CADF;AAqBD,CA/CD;;AAiDA,eAAeP,gBAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/html/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAO,SAAS,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAOpE,oBAAY,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAqBF,QAAA,MAAM,IAAI,UAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/html/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAO,SAAS,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAOpE,oBAAY,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAqBF,QAAA,MAAM,IAAI,UAAW,KAAK,gBAyGzB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
3
|
+
import React, { useCallback } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
5
|
import HtmlBase from 'react-native-render-html';
|
|
6
6
|
import { HTML_ANCHOR_TEXT_COLOR } from '../../variables/theme.native';
|
|
@@ -8,11 +8,9 @@ import { useTemplateContext } from '../../template/app-review/template-context';
|
|
|
8
8
|
import Text, { DEFAULT_STYLE as DEFAULT_TEXT_STYLE } from '../text/index.native';
|
|
9
9
|
|
|
10
10
|
const Html = props => {
|
|
11
|
-
const [disableBaseFontStyleColor, setDisableBaseFontStyleColor] = useState(false);
|
|
12
11
|
const templateContext = useTemplateContext();
|
|
13
12
|
const {
|
|
14
|
-
theme
|
|
15
|
-
vibration
|
|
13
|
+
theme
|
|
16
14
|
} = templateContext;
|
|
17
15
|
const {
|
|
18
16
|
children,
|
|
@@ -24,10 +22,7 @@ const Html = props => {
|
|
|
24
22
|
anchorTextColor = HTML_ANCHOR_TEXT_COLOR,
|
|
25
23
|
isTextCentered,
|
|
26
24
|
numberOfLines
|
|
27
|
-
} = props;
|
|
28
|
-
const handleLinkPress = useMemo(() => url => {
|
|
29
|
-
vibration?.vibrate();
|
|
30
|
-
}, [vibration]); // Don't use StyleSheet there, it's not a react style
|
|
25
|
+
} = props; // Don't use StyleSheet there, it's not a react style
|
|
31
26
|
|
|
32
27
|
const styles = {
|
|
33
28
|
p: {
|
|
@@ -87,10 +82,11 @@ const Html = props => {
|
|
|
87
82
|
}
|
|
88
83
|
}
|
|
89
84
|
|
|
85
|
+
const SpanRenderer = useCallback((htmlAttribs, _children) => /*#__PURE__*/React.createElement(Text, {
|
|
86
|
+
numberOfLines: numberOfLines
|
|
87
|
+
}, _children), [numberOfLines]);
|
|
90
88
|
const renderers = {
|
|
91
|
-
span:
|
|
92
|
-
numberOfLines: numberOfLines
|
|
93
|
-
}, _children)
|
|
89
|
+
span: SpanRenderer
|
|
94
90
|
};
|
|
95
91
|
return /*#__PURE__*/React.createElement(View, {
|
|
96
92
|
testID: testID,
|
|
@@ -106,9 +102,7 @@ const Html = props => {
|
|
|
106
102
|
},
|
|
107
103
|
tagsStyles: tagsStyles // @ts-expect-error TS2322
|
|
108
104
|
,
|
|
109
|
-
baseFontStyle:
|
|
110
|
-
color: disableBaseFontStyleColor ? null : baseFontStyle.color
|
|
111
|
-
}),
|
|
105
|
+
baseFontStyle: baseFontStyle,
|
|
112
106
|
renderers: renderers // this is exceptionally for the onboarding course
|
|
113
107
|
// is the only course that has a gif in the context but the img tag
|
|
114
108
|
// comes with width & height attr and these makes this lib do not render the gif
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useCallback","View","HtmlBase","HTML_ANCHOR_TEXT_COLOR","useTemplateContext","Text","DEFAULT_STYLE","DEFAULT_TEXT_STYLE","Html","props","templateContext","theme","children","fontSize","containerStyle","imageStyle","style","testID","anchorTextColor","isTextCentered","numberOfLines","styles","p","marginVertical","textAlign","u","textDecorationLine","i","fontStyle","b","fontWeight","bold","s","tagsStyles","h1","h2","h3","h4","h5","h6","a","color","img","baseFontStyle","colors","black","Array","isArray","styleObject","reduce","result","child","SpanRenderer","htmlAttribs","_children","renderers","span","html"],"sources":["../../../src/atom/html/index.native.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {View, ViewStyle, ImageStyle, TextStyle} from 'react-native';\nimport HtmlBase, {CustomRendererProps, MixedStyleRecord, TBlock} from 'react-native-render-html';\n\nimport {HTML_ANCHOR_TEXT_COLOR} from '../../variables/theme.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport Text, {DEFAULT_STYLE as DEFAULT_TEXT_STYLE} from '../text/index.native';\n\nexport type Props = {\n children: string;\n fontSize: TextStyle['fontSize'];\n numberOfLines?: number;\n onLinkPress?: (url: string) => void;\n containerStyle?: ViewStyle;\n anchorTextColor?: string;\n imageStyle?: ImageStyle;\n style?: ViewStyle | ViewStyle[];\n testID?: string;\n isTextCentered?: boolean;\n};\n\ntype Styles = {\n p: {\n marginVertical: ViewStyle['marginVertical'];\n textAlign: TextStyle['textAlign'];\n };\n u: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n i: {\n fontStyle: TextStyle['fontStyle'];\n };\n b: {\n fontWeight: TextStyle['fontWeight'];\n };\n s: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n};\n\nconst Html = (props: Props) => {\n const templateContext = useTemplateContext();\n const {theme} = templateContext;\n const {\n children,\n fontSize,\n containerStyle,\n imageStyle,\n style,\n testID,\n anchorTextColor = HTML_ANCHOR_TEXT_COLOR,\n isTextCentered,\n numberOfLines\n } = props;\n\n // Don't use StyleSheet there, it's not a react style\n const styles: Styles = {\n p: {\n marginVertical: 0,\n textAlign: 'center'\n },\n u: {\n textDecorationLine: 'underline'\n },\n i: {\n fontStyle: 'italic'\n },\n b: {\n fontWeight: theme.fontWeight.bold\n },\n s: {\n textDecorationLine: 'line-through'\n }\n };\n\n const tagsStyles: MixedStyleRecord = {\n ...styles,\n h1: {fontSize},\n h2: {fontSize},\n h3: {fontSize},\n h4: {fontSize},\n h5: {fontSize},\n h6: {fontSize},\n a: {color: anchorTextColor},\n img: imageStyle || {}\n };\n\n let baseFontStyle = {...DEFAULT_TEXT_STYLE, fontSize, color: theme.colors.black};\n if (style) {\n if (Array.isArray(style)) {\n const styleObject = style.reduce((result, child) => ({\n ...result,\n ...child\n }));\n baseFontStyle = {\n ...baseFontStyle,\n ...styleObject\n };\n } else {\n baseFontStyle = {\n ...baseFontStyle,\n ...style\n };\n }\n }\n\n const SpanRenderer = useCallback(\n (htmlAttribs: CustomRendererProps<TBlock>, _children: string) => (\n <Text numberOfLines={numberOfLines}>{_children}</Text>\n ),\n [numberOfLines]\n );\n\n const renderers = {\n span: SpanRenderer\n };\n\n return (\n <View testID={testID} style={containerStyle}>\n <HtmlBase\n // to text-align center on android\n // we have to encapsulate between <p> tag\n // and use custom style define on <p>\n // definition in component style doesn't work\n source={{\n // eslint-disable-next-line no-nested-ternary\n html: isTextCentered\n ? `<p>${children}</p>`\n : numberOfLines\n ? `<span>${children}</span>`\n : `${children}`\n }}\n tagsStyles={tagsStyles}\n // @ts-expect-error TS2322\n baseFontStyle={baseFontStyle}\n renderers={renderers}\n // this is exceptionally for the onboarding course\n // is the only course that has a gif in the context but the img tag\n // comes with width & height attr and these makes this lib do not render the gif\n // so to avoid it, we decided to ignore these attr\n ignoredStyles={['width', 'height']}\n testID=\"html-base\"\n />\n </View>\n );\n};\n\nexport default Html;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,SAAQC,IAAR,QAAqD,cAArD;AACA,OAAOC,QAAP,MAAsE,0BAAtE;AAEA,SAAQC,sBAAR,QAAqC,8BAArC;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AACA,OAAOC,IAAP,IAAcC,aAAa,IAAIC,kBAA/B,QAAwD,sBAAxD;;AAkCA,MAAMC,IAAI,GAAIC,KAAD,IAAkB;EAC7B,MAAMC,eAAe,GAAGN,kBAAkB,EAA1C;EACA,MAAM;IAACO;EAAD,IAAUD,eAAhB;EACA,MAAM;IACJE,QADI;IAEJC,Q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,EAERK,WAFQ,CAAb;IAID,CATD,MASO;MACLL,aAAa,gBACRA,aADQ,EAER3B,KAFQ,CAAb;IAID;EACF;;EAED,MAAMoC,YAAY,GAAGpD,WAAW,CAC9B,CAACqD,WAAD,EAA2CC,SAA3C,kBACE,oBAAC,IAAD;IAAM,aAAa,EAAElC;EAArB,GAAqCkC,SAArC,CAF4B,EAI9B,CAAClC,aAAD,CAJ8B,CAAhC;EAOA,MAAMmC,SAAS,GAAG;IAChBC,IAAI,EAAEJ;EADU,CAAlB;EAIA,oBACE,oBAAC,IAAD;IAAM,MAAM,EAAEnC,MAAd;IAAsB,KAAK,EAAEH;EAA7B,gBACE,oBAAC,QAAD,CACE;EACA;EACA;EACA;EAJF;IAKE,MAAM,EAAE;MACN;MACA2C,IAAI,EAAEtC,cAAc,GACf,MAAKP,QAAS,MADC,GAEhBQ,aAAa,GACZ,SAAQR,QAAS,SADL,GAEZ,GAAEA,QAAS;IANV,CALV;IAaE,UAAU,EAAEqB,UAbd,CAcE;IAdF;IAeE,aAAa,EAAEU,aAfjB;IAgBE,SAAS,EAAEY,SAhBb,CAiBE;IACA;IACA;IACA;IApBF;IAqBE,aAAa,EAAE,CAAC,OAAD,EAAU,QAAV,CArBjB;IAsBE,MAAM,EAAC;EAtBT,EADF,CADF;AA4BD,CAzGD;;AA2GA,eAAe/C,IAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/image-background/index.native.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACvC,OAAO,EAGL,SAAS,EACT,UAAU,EACX,MAAM,cAAc,CAAC;AAiBtB,oBAAY,KAAK,GAAG,UAAU,GAAG;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE;QAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAC,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,QAAA,MAAM,eAAe,iEAOlB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/image-background/index.native.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACvC,OAAO,EAGL,SAAS,EACT,UAAU,EACX,MAAM,cAAc,CAAC;AAiBtB,oBAAY,KAAK,GAAG,UAAU,GAAG;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE;QAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAC,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,QAAA,MAAM,eAAe,iEAOlB,KAAK,gBAgDP,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","ImageBackground","ImageBackgroundBase","StyleSheet","getCleanUri","getResizedImage","Gradient","styles","create","image","width","height","gradient","flex","source","gradientStyle","style","testID","props","uri","_width","_height","resizeMode","flatten","maxHeight","undefined","maxWidth","resizedSource","children","remainingProps","_style","push"],"sources":["../../../src/atom/image-background/index.native.tsx"],"sourcesContent":["import React, {ReactNode} from 'react';\nimport {\n ImageBackground as ImageBackgroundBase,\n StyleSheet,\n ViewStyle,\n ImageStyle\n} from 'react-native';\n\nimport getCleanUri from '../../util/get-clean-uri';\n\nimport getResizedImage from '../../util/get-resized-image';\nimport Gradient from '../gradient/index.native';\n\nconst styles = StyleSheet.create({\n image: {\n width: '100%',\n height: '100%'\n },\n gradient: {\n flex: 1\n }\n});\n\nexport type Props = ImageStyle & {\n children?: ReactNode;\n gradient?: Array<string>;\n gradientStyle?: ViewStyle;\n testID?: string;\n source: {uri: string | undefined};\n style?: ViewStyle;\n};\n\nconst ImageBackground = ({\n source,\n gradient,\n gradientStyle,\n style,\n testID = 'image-background',\n ...props\n}: Props) => {\n
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","ImageBackground","ImageBackgroundBase","StyleSheet","getCleanUri","getResizedImage","Gradient","styles","create","image","width","height","gradient","flex","source","gradientStyle","style","testID","props","uri","_width","_height","resizeMode","flatten","maxHeight","undefined","maxWidth","resizedSource","children","remainingProps","_style","push"],"sources":["../../../src/atom/image-background/index.native.tsx"],"sourcesContent":["import React, {ReactNode} from 'react';\nimport {\n ImageBackground as ImageBackgroundBase,\n StyleSheet,\n ViewStyle,\n ImageStyle\n} from 'react-native';\n\nimport getCleanUri from '../../util/get-clean-uri';\n\nimport getResizedImage from '../../util/get-resized-image';\nimport Gradient from '../gradient/index.native';\n\nconst styles = StyleSheet.create({\n image: {\n width: '100%',\n height: '100%'\n },\n gradient: {\n flex: 1\n }\n});\n\nexport type Props = ImageStyle & {\n children?: ReactNode;\n gradient?: Array<string>;\n gradientStyle?: ViewStyle;\n testID?: string;\n source: {uri: string | undefined};\n style?: ViewStyle;\n};\n\nconst ImageBackground = ({\n source,\n gradient,\n gradientStyle,\n style,\n testID = 'image-background',\n ...props\n}: Props) => {\n let uri: string | undefined = source && source.uri;\n\n if (uri) {\n const {width: _width, height: _height, resizeMode} = props;\n const {width, height} = StyleSheet.flatten([{width: _width, height: _height}, style]);\n const maxHeight: number | undefined = typeof height === 'number' ? height : undefined;\n const maxWidth: number | undefined = typeof width === 'number' ? width : undefined;\n\n uri = getResizedImage(getCleanUri(uri), {\n maxHeight,\n maxWidth,\n resizeMode\n });\n }\n\n const resizedSource = (uri && {uri}) || source;\n\n if (gradient) {\n const {children, ...remainingProps} = props;\n const _style: ViewStyle[] = [styles.gradient];\n\n if (gradientStyle) {\n _style.push(gradientStyle);\n }\n\n return (\n <ImageBackgroundBase\n {...remainingProps}\n source={resizedSource}\n style={[styles.image, style]}\n testID={testID}\n >\n <Gradient testID={`${testID}-gradient`} colors={gradient} style={_style}>\n {children}\n </Gradient>\n </ImageBackgroundBase>\n );\n }\n\n return (\n <ImageBackgroundBase\n {...props}\n source={resizedSource}\n style={[styles.image, style]}\n testID={testID}\n />\n );\n};\n\nexport default ImageBackground;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAA+B,OAA/B;AACA,SACEC,eAAe,IAAIC,mBADrB,EAEEC,UAFF,QAKO,cALP;AAOA,OAAOC,WAAP,MAAwB,0BAAxB;AAEA,OAAOC,eAAP,MAA4B,8BAA5B;AACA,OAAOC,QAAP,MAAqB,0BAArB;AAEA,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAX,CAAkB;EAC/BC,KAAK,EAAE;IACLC,KAAK,EAAE,MADF;IAELC,MAAM,EAAE;EAFH,CADwB;EAK/BC,QAAQ,EAAE;IACRC,IAAI,EAAE;EADE;AALqB,CAAlB,CAAf;;AAmBA,MAAMZ,eAAe,GAAG,QAOX;EAAA,IAPY;IACvBa,MADuB;IAEvBF,QAFuB;IAGvBG,aAHuB;IAIvBC,KAJuB;IAKvBC,MAAM,GAAG;EALc,CAOZ;EAAA,IADRC,KACQ;;EACX,IAAIC,GAAuB,GAAGL,MAAM,IAAIA,MAAM,CAACK,GAA/C;;EAEA,IAAIA,GAAJ,EAAS;IACP,MAAM;MAACT,KAAK,EAAEU,MAAR;MAAgBT,MAAM,EAAEU,OAAxB;MAAiCC;IAAjC,IAA+CJ,KAArD;IACA,MAAM;MAACR,KAAD;MAAQC;IAAR,IAAkBR,UAAU,CAACoB,OAAX,CAAmB,CAAC;MAACb,KAAK,EAAEU,MAAR;MAAgBT,MAAM,EAAEU;IAAxB,CAAD,EAAmCL,KAA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primary: string;
|
|
@@ -9,9 +9,9 @@ declare type WebContextValues = {
|
|
|
9
9
|
translate: (key: string) => string;
|
|
10
10
|
};
|
|
11
11
|
declare type Props = WebContextValues & {
|
|
12
|
-
children:
|
|
12
|
+
children: ReactNode;
|
|
13
13
|
};
|
|
14
|
-
declare const WebContext: ({
|
|
14
|
+
declare const WebContext: ({ children, ...value }: Props) => JSX.Element;
|
|
15
15
|
export declare const useWebContext: () => WebContextValues;
|
|
16
16
|
export default WebContext;
|
|
17
17
|
//# sourceMappingURL=web-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-context.d.ts","sourceRoot":"","sources":["../../../src/atom/provider/web-context.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"web-context.d.ts","sourceRoot":"","sources":["../../../src/atom/provider/web-context.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,SAAS,EAAa,MAAM,OAAO,CAAC;AAElE,aAAK,IAAI,GAAG;IACV,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,aAAK,gBAAgB,GAAG;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC,CAAC;AAMF,aAAK,KAAK,GAAG,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,UAAU,2BAA0B,KAAK,gBAE9C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO,gBAQhC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
const _excluded = ["children"];
|
|
2
|
+
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
2
4
|
|
|
3
5
|
import React, { createContext, useContext } from 'react';
|
|
4
6
|
const Context = /*#__PURE__*/createContext({
|
|
5
7
|
translate: key => key
|
|
6
8
|
});
|
|
7
9
|
|
|
8
|
-
const WebContext =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
skin,
|
|
15
|
-
translate
|
|
16
|
-
};
|
|
10
|
+
const WebContext = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
children
|
|
13
|
+
} = _ref,
|
|
14
|
+
value = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
15
|
+
|
|
17
16
|
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
18
|
-
value:
|
|
17
|
+
value: value
|
|
19
18
|
}, children);
|
|
20
19
|
};
|
|
21
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-context.js","names":["React","createContext","useContext","Context","translate","key","WebContext","
|
|
1
|
+
{"version":3,"file":"web-context.js","names":["React","createContext","useContext","Context","translate","key","WebContext","children","value","useWebContext","context","Error"],"sources":["../../../src/atom/provider/web-context.tsx"],"sourcesContent":["import React, {createContext, ReactNode, useContext} from 'react';\n\ntype Skin = {\n common: {\n primary: string;\n };\n};\n\ntype WebContextValues = {\n skin?: Skin;\n translate: (key: string) => string;\n};\n\nconst Context = createContext({\n translate: (key: string) => key\n});\n\ntype Props = WebContextValues & {\n children: ReactNode;\n};\n\nconst WebContext = ({children, ...value}: Props) => {\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n\nexport const useWebContext = (): WebContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');\n }\n\n return context;\n};\n\nexport default WebContext;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,aAAf,EAAyCC,UAAzC,QAA0D,OAA1D;AAaA,MAAMC,OAAO,gBAAGF,aAAa,CAAC;EAC5BG,SAAS,EAAGC,GAAD,IAAiBA;AADA,CAAD,CAA7B;;AAQA,MAAMC,UAAU,GAAG,QAAiC;EAAA,IAAhC;IAACC;EAAD,CAAgC;EAAA,IAAlBC,KAAkB;;EAClD,oBAAO,oBAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,EAAEA;EAAzB,GAAiCD,QAAjC,CAAP;AACD,CAFD;;AAIA,OAAO,MAAME,aAAa,GAAG,MAAwB;EACnD,MAAMC,OAAO,GAAGR,UAAU,CAACC,OAAD,CAA1B;;EAEA,IAAI,CAACO,OAAL,EAAc;IACZ,MAAM,IAAIC,KAAJ,CAAU,0EAAV,CAAN;EACD;;EAED,OAAOD,OAAP;AACD,CARM;AAUP,eAAeJ,UAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/review-header-step-item/index.native.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/review-header-step-item/index.native.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AA6C5C,QAAA,MAAM,IAAI,6BAA4B,mBAAmB,uBA2BxD,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","StyleSheet","Text","View","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","COLORS","createStyle","current","icon","backgroundColor","positive","negative","gray","create","step","width","height","opacity","marginHorizontal","alignItems","justifyContent","borderRadius","stepText","fontWeight","fontSize","Step","value","style","setStyle","_style","child"],"sources":["../../../src/atom/review-header-step-item/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, Text, View} from 'react-native';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport {COLORS} from '../../variables/colors';\nimport {HeaderStepItemProps} from './types';\n\nconst createStyle = (current: boolean, icon: HeaderStepItemProps['icon']) => {\n let backgroundColor;\n\n switch (icon) {\n case 'right':\n backgroundColor = COLORS.positive;\n break;\n case 'wrong':\n backgroundColor = COLORS.negative;\n break;\n case 'no-answer':\n default:\n backgroundColor = COLORS.gray;\n }\n\n return StyleSheet.create({\n step: {\n width: current ? 40 : 32,\n height: current ? 40 : 32,\n opacity: current ? 1 : 0.5,\n marginHorizontal: 8,\n backgroundColor,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 50\n },\n stepText: {\n fontWeight: '600',\n fontSize: current ? 16 : 12\n },\n icon: {\n width: current ? 14 : 12,\n height: current ? 14 : 12\n }\n });\n};\n\nconst Step = ({value, icon, current}: HeaderStepItemProps) => {\n const [style, setStyle] = useState<
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","StyleSheet","Text","View","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","COLORS","createStyle","current","icon","backgroundColor","positive","negative","gray","create","step","width","height","opacity","marginHorizontal","alignItems","justifyContent","borderRadius","stepText","fontWeight","fontSize","Step","value","style","setStyle","_style","child"],"sources":["../../../src/atom/review-header-step-item/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport {COLORS} from '../../variables/colors';\nimport {HeaderStepItemProps} from './types';\n\ntype StyleSheetType = {\n step: ViewStyle;\n stepText: TextStyle;\n icon: ViewStyle;\n};\n\nconst createStyle = (current: boolean, icon: HeaderStepItemProps['icon']): StyleSheetType => {\n let backgroundColor;\n\n switch (icon) {\n case 'right':\n backgroundColor = COLORS.positive;\n break;\n case 'wrong':\n backgroundColor = COLORS.negative;\n break;\n case 'no-answer':\n default:\n backgroundColor = COLORS.gray;\n }\n\n return StyleSheet.create({\n step: {\n width: current ? 40 : 32,\n height: current ? 40 : 32,\n opacity: current ? 1 : 0.5,\n marginHorizontal: 8,\n backgroundColor,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 50\n },\n stepText: {\n fontWeight: '600',\n fontSize: current ? 16 : 12\n },\n icon: {\n width: current ? 14 : 12,\n height: current ? 14 : 12\n }\n });\n};\n\nconst Step = ({value, icon, current}: HeaderStepItemProps) => {\n const [style, setStyle] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _style = createStyle(current, icon);\n setStyle(_style);\n }, [current, icon]);\n\n if (!style) {\n return null;\n }\n\n let child;\n\n switch (icon) {\n case 'right':\n child = <RightIcon style={style.icon} color=\"#fff\" />;\n break;\n case 'wrong':\n child = <WrongIcon style={style.icon} color=\"#fff\" />;\n break;\n case 'no-answer':\n default:\n child = <Text style={style.stepText}>{value}</Text>;\n }\n\n return <View style={style.step}>{child}</View>;\n};\n\nexport default Step;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SAAQC,UAAR,EAAoBC,IAApB,EAAqCC,IAArC,QAA2D,cAA3D;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,oBAAoB,IAAIC,SAF1B,QAGO,0BAHP;AAIA,SAAQC,MAAR,QAAqB,wBAArB;;AASA,MAAMC,WAAW,GAAG,CAACC,OAAD,EAAmBC,IAAnB,KAAyE;EAC3F,IAAIC,eAAJ;;EAEA,QAAQD,IAAR;IACE,KAAK,OAAL;MACEC,eAAe,GAAGJ,MAAM,CAACK,QAAzB;MACA;;IACF,KAAK,OAAL;MACED,eAAe,GAAGJ,MAAM,CAACM,QAAzB;MACA;;IACF,KAAK,WAAL;IACA;MACEF,eAAe,GAAG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BAAC,SAAD;QAAW,KAAK,EAAEH,KAAK,CAACnB,IAAxB;QAA8B,KAAK,EAAC;MAApC,EAAR;MACA;;IACF,KAAK,WAAL;IACA;MACEsB,KAAK,gBAAG,oBAAC,IAAD;QAAM,KAAK,EAAEH,KAAK,CAACL;MAAnB,GAA8BI,KAA9B,CAAR;EATJ;;EAYA,oBAAO,oBAAC,IAAD;IAAM,KAAK,EAAEC,KAAK,CAACb;EAAnB,GAA0BgB,KAA1B,CAAP;AACD,CA3BD;;AA6BA,eAAeL,IAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","useCallback","View","StyleSheet","NovaCompositionNavigationArrowDown","ArrowDown","Modal","Touchable","ANALYTICS_EVENT_TYPE","Space","Text","ModalSelect","useTemplateContext","ICON_WIDTH","createStyleSheet","theme","create","container","alignItems","flexDirection","text","flex","color","colors","gray","medium","textAlign","logEvent","eventName","analyticsID","analytics","questionType","id","Select","props","templateContext","styleSheet","setStylesheet","_stylesheet","onBlur","onFocus","onChange","values","placeholder","value","style","textStyle","isFocused","isDisabled","testID","handleFocus","OPEN_SELECT","handleBlur","CLOSE_SELECT","handleChange","_value","selectedItem","find","item","selected","textStyles","push","dark"],"sources":["../../../src/atom/select-modal/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect, useCallback} from 'react';\nimport {View, StyleSheet, ViewStyle, TextStyle} from 'react-native';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Modal from 'react-native-modal';\nimport Touchable from '../../hoc/touchable/index.native';\nimport type {QuestionType} from '../../molecule/questions/types';\nimport {Theme} from '../../variables/theme.native';\n\nimport {ANALYTICS_EVENT_TYPE, Analytics} from '../../variables/analytics';\nimport Space from '../space/index.native';\nimport Text from '../text/index.native';\nimport ModalSelect, {OnChangeFunction} from '../../hoc/modal/select/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\n\nexport type ChoiceItem = {\n text: string;\n selected: boolean;\n _id: string;\n};\n\nexport type Props = {\n analyticsID: string;\n questionType: QuestionType;\n isDisabled?: boolean;\n isFocused?: boolean;\n values: Array<ChoiceItem>;\n value?: string;\n placeholder?: string;\n color?: string;\n onChange: OnChangeFunction;\n onFocus: () => void;\n onBlur: () => void;\n style?: ViewStyle[];\n textStyle?: ViewStyle[];\n testID?: string;\n};\n\ntype StyleSheetType = {\n container: ViewStyle;\n text: ViewStyle;\n};\n\nconst ICON_WIDTH = 15;\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row'\n },\n text: {\n flex: 1,\n color: theme.colors.gray.medium,\n textAlign: 'center'\n }\n });\n\nconst logEvent = (\n eventName: string,\n analyticsID:
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","useCallback","View","StyleSheet","NovaCompositionNavigationArrowDown","ArrowDown","Modal","Touchable","ANALYTICS_EVENT_TYPE","Space","Text","ModalSelect","useTemplateContext","ICON_WIDTH","createStyleSheet","theme","create","container","alignItems","flexDirection","text","flex","color","colors","gray","medium","textAlign","logEvent","eventName","analyticsID","analytics","questionType","id","Select","props","templateContext","styleSheet","setStylesheet","_stylesheet","onBlur","onFocus","onChange","values","placeholder","value","style","textStyle","isFocused","isDisabled","testID","handleFocus","OPEN_SELECT","handleBlur","CLOSE_SELECT","handleChange","_value","selectedItem","find","item","selected","textStyles","push","dark"],"sources":["../../../src/atom/select-modal/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect, useCallback} from 'react';\nimport {View, StyleSheet, ViewStyle, TextStyle} from 'react-native';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Modal from 'react-native-modal';\nimport Touchable from '../../hoc/touchable/index.native';\nimport type {QuestionType} from '../../molecule/questions/types';\nimport {Theme} from '../../variables/theme.native';\n\nimport {ANALYTICS_EVENT_TYPE, Analytics} from '../../variables/analytics';\nimport Space from '../space/index.native';\nimport Text from '../text/index.native';\nimport ModalSelect, {OnChangeFunction} from '../../hoc/modal/select/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\n\nexport type ChoiceItem = {\n text: string;\n selected: boolean;\n _id: string;\n};\n\nexport type Props = {\n analyticsID: string;\n questionType: QuestionType;\n isDisabled?: boolean;\n isFocused?: boolean;\n values: Array<ChoiceItem>;\n value?: string;\n placeholder?: string;\n color?: string;\n onChange: OnChangeFunction;\n onFocus: () => void;\n onBlur: () => void;\n style?: ViewStyle[];\n textStyle?: ViewStyle[];\n testID?: string;\n};\n\ntype StyleSheetType = {\n container: ViewStyle;\n text: ViewStyle;\n};\n\nconst ICON_WIDTH = 15;\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row'\n },\n text: {\n flex: 1,\n color: theme.colors.gray.medium,\n textAlign: 'center'\n }\n });\n\nconst logEvent = (\n eventName: string,\n analyticsID: string,\n analytics: Analytics,\n questionType: QuestionType\n) => {\n analytics &&\n analytics.logEvent(eventName, {\n id: analyticsID,\n questionType\n });\n};\n\nconst Select = (props: Props) => {\n const templateContext = useTemplateContext();\n const {theme, analytics} = templateContext;\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n const {\n analyticsID,\n onBlur,\n onFocus,\n onChange,\n values,\n placeholder,\n value,\n style,\n textStyle,\n color,\n questionType,\n isFocused = false,\n isDisabled = false,\n testID = 'select'\n } = props;\n\n const handleFocus = useCallback(() => {\n if (!onFocus) return;\n\n analytics && logEvent(ANALYTICS_EVENT_TYPE.OPEN_SELECT, analyticsID, analytics, questionType);\n onFocus();\n }, [analytics, analyticsID, onFocus, questionType]);\n\n const handleBlur = useCallback(() => {\n if (!onBlur) return;\n\n analytics && logEvent(ANALYTICS_EVENT_TYPE.CLOSE_SELECT, analyticsID, analytics, questionType);\n onBlur();\n }, [analytics, analyticsID, onBlur, questionType]);\n\n const handleChange = useCallback(\n _value => {\n onChange(_value);\n handleBlur();\n },\n [onChange, handleBlur]\n );\n\n if (!styleSheet) {\n return null;\n }\n\n const selectedItem = values.find(item => item.selected);\n const text = (selectedItem && selectedItem.text) || placeholder || null;\n let textStyles: TextStyle[] = [styleSheet.text];\n\n if (textStyle) {\n textStyles = [styleSheet.text, ...textStyle];\n }\n if (color) {\n textStyles.push({color});\n }\n\n return (\n <>\n <Touchable\n disabled={isDisabled}\n onPress={handleFocus}\n analyticsID={analyticsID}\n testID={`${testID}-input`}\n >\n <View style={[styleSheet.container, style]}>\n <Text style={textStyles}>{text}</Text>\n <Space type=\"tiny\" />\n <ArrowDown\n color={color || theme.colors.gray.dark}\n height={ICON_WIDTH}\n width={ICON_WIDTH}\n />\n </View>\n </Touchable>\n <Modal\n isVisible={isFocused}\n onSwipeComplete={handleBlur}\n onBackdropPress={handleBlur}\n testID={testID}\n >\n <ModalSelect\n value={value}\n values={values}\n onChange={handleChange}\n onClose={handleBlur}\n testID={`${testID}-modal`}\n />\n </Modal>\n </>\n );\n};\n\nexport default Select;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,EAAoCC,WAApC,QAAsD,OAAtD;AACA,SAAQC,IAAR,EAAcC,UAAd,QAAqD,cAArD;AACA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,OAAOC,KAAP,MAAkB,oBAAlB;AACA,OAAOC,SAAP,MAAsB,kCAAtB;AAIA,SAAQC,oBAAR,QAA8C,2BAA9C;AACA,OAAOC,KAAP,MAAkB,uBAAlB;AACA,OAAOC,IAAP,MAAiB,sBAAjB;AACA,OAAOC,WAAP,MAA4C,qCAA5C;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AA8BA,MAAMC,UAAU,GAAG,EAAnB;;AAEA,MAAMC,gBAAgB,GAAIC,KAAD,IACvBZ,UAAU,CAAC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,IAAD;IAAM,KAAK,EAAE,CAACb,UAAU,CAACnB,SAAZ,EAAuB4B,KAAvB;EAAb,gBACE,oBAAC,IAAD;IAAM,KAAK,EAAEe;EAAb,GAA0BxC,IAA1B,CADF,eAEE,oBAAC,KAAD;IAAO,IAAI,EAAC;EAAZ,EAFF,eAGE,oBAAC,SAAD;IACE,KAAK,EAAEE,KAAK,IAAIP,KAAK,CAACQ,MAAN,CAAaC,IAAb,CAAkBsC,IADpC;IAEE,MAAM,EAAEjD,UAFV;IAGE,KAAK,EAAEA;EAHT,EAHF,CANF,CADF,eAiBE,oBAAC,KAAD;IACE,SAAS,EAAEkC,SADb;IAEE,eAAe,EAAEK,UAFnB;IAGE,eAAe,EAAEA,UAHnB;IAIE,MAAM,EAAEH;EAJV,gBAME,oBAAC,WAAD;IACE,KAAK,EAAEL,KADT;IAEE,MAAM,EAAEF,MAFV;IAGE,QAAQ,EAAEY,YAHZ;IAIE,OAAO,EAAEF,UAJX;IAKE,MAAM,EAAG,GAAEH,MAAO;EALpB,EANF,CAjBF,CADF;AAkCD,CAlGD;;AAoGA,eAAehB,MAAf"}
|
|
@@ -6,7 +6,7 @@ export declare type Props = {
|
|
|
6
6
|
iconBackgroundColor?: string;
|
|
7
7
|
renderIcon?: React.ReactNode;
|
|
8
8
|
contentStyle?: ViewStyle;
|
|
9
|
-
onClose: (event: GestureResponderEvent) =>
|
|
9
|
+
onClose: (event: GestureResponderEvent) => void;
|
|
10
10
|
testID?: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const HEADER_HEIGHT = 64;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/hoc/modal/index.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAC,qBAAqB,EAAoB,SAAS,EAAC,MAAM,cAAc,CAAC;AAKhF,oBAAY,KAAK,GAAG;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/hoc/modal/index.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAC,qBAAqB,EAAoB,SAAS,EAAC,MAAM,cAAc,CAAC;AAKhF,oBAAY,KAAK,GAAG;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,aAAa,KAAK,CAAC;AAqDhC,QAAA,MAAM,KAAK,UAAW,KAAK,uBA+C1B,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","StyleSheet","View","HeaderBackButton","useTemplateContext","HEADER_HEIGHT","createStyleSheet","theme","create","container","borderRadius","radius","card","overflow","backgroundColor","colors","white","header","alignItems","justifyContent","paddingHorizontal","spacing","medium","height","content","paddingBottom","contentWithHeader","paddingTop","contentWithIcon","small","icon","marginTop","padding","thumbnail","alignSelf","iconContent","Modal","props","templateContext","styleSheet","setStylesheet","children","headerBackgroundColor","iconBackgroundColor","renderIcon","contentStyle","onClose","testID","_stylesheet","contentStyles","gray","dark"],"sources":["../../../src/hoc/modal/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {GestureResponderEvent, StyleSheet, View, ViewStyle} from 'react-native';\nimport HeaderBackButton from '../../atom/header-back-button/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\nexport type Props = {\n children: React.ReactNode;\n headerBackgroundColor?: string;\n iconBackgroundColor?: string;\n renderIcon?: React.ReactNode;\n contentStyle?: ViewStyle;\n onClose: (event: GestureResponderEvent) =>
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","StyleSheet","View","HeaderBackButton","useTemplateContext","HEADER_HEIGHT","createStyleSheet","theme","create","container","borderRadius","radius","card","overflow","backgroundColor","colors","white","header","alignItems","justifyContent","paddingHorizontal","spacing","medium","height","content","paddingBottom","contentWithHeader","paddingTop","contentWithIcon","small","icon","marginTop","padding","thumbnail","alignSelf","iconContent","Modal","props","templateContext","styleSheet","setStylesheet","children","headerBackgroundColor","iconBackgroundColor","renderIcon","contentStyle","onClose","testID","_stylesheet","contentStyles","gray","dark"],"sources":["../../../src/hoc/modal/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {GestureResponderEvent, StyleSheet, View, ViewStyle} from 'react-native';\nimport HeaderBackButton from '../../atom/header-back-button/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\nexport type Props = {\n children: React.ReactNode;\n headerBackgroundColor?: string;\n iconBackgroundColor?: string;\n renderIcon?: React.ReactNode;\n contentStyle?: ViewStyle;\n onClose: (event: GestureResponderEvent) => void;\n testID?: string;\n};\n\nexport const HEADER_HEIGHT = 64;\n\ntype StyleSheetType = {\n container: ViewStyle;\n header: ViewStyle;\n content: ViewStyle;\n contentWithHeader: ViewStyle;\n contentWithIcon: ViewStyle;\n icon: ViewStyle;\n iconContent: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n borderRadius: theme.radius.card,\n overflow: 'hidden',\n backgroundColor: theme.colors.white\n },\n header: {\n backgroundColor: theme.colors.white,\n alignItems: 'flex-end',\n justifyContent: 'center',\n paddingHorizontal: theme.spacing.medium,\n height: HEADER_HEIGHT\n },\n content: {\n paddingHorizontal: theme.spacing.medium,\n paddingBottom: theme.spacing.medium,\n alignItems: 'center'\n },\n contentWithHeader: {\n paddingTop: theme.spacing.medium\n },\n contentWithIcon: {\n paddingTop: theme.spacing.small\n },\n icon: {\n marginTop: -HEADER_HEIGHT * (3 / 4),\n padding: 5,\n backgroundColor: theme.colors.white,\n borderRadius: theme.radius.thumbnail,\n alignSelf: 'center'\n },\n iconContent: {\n backgroundColor: theme.colors.white,\n padding: theme.spacing.small,\n borderRadius: theme.radius.thumbnail,\n justifyContent: 'center',\n alignItems: 'center'\n }\n });\n\nconst Modal = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {theme} = templateContext;\n\n const {\n children,\n headerBackgroundColor,\n iconBackgroundColor,\n renderIcon,\n contentStyle,\n onClose,\n testID\n } = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n const contentStyles = [styleSheet.content, contentStyle];\n\n return (\n <View style={styleSheet.container} testID={testID}>\n <View style={[styleSheet.header, {backgroundColor: headerBackgroundColor}]}>\n <HeaderBackButton\n color={theme.colors.gray.dark}\n isFloating={false}\n testID=\"close-modal\"\n onPress={onClose}\n type=\"close\"\n />\n </View>\n {renderIcon ? (\n <View style={styleSheet.icon}>\n <View style={[styleSheet.iconContent, {backgroundColor: iconBackgroundColor}]}>\n {renderIcon}\n </View>\n </View>\n ) : null}\n <View style={contentStyles}>{children}</View>\n </View>\n );\n};\n\nexport default Modal;\n"],"mappings":"AAAA,OAAOA,KAAP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AUGF,UAAU,gBACT,oBAAC,IAAD;IAAM,KAAK,EAAEL,UAAU,CAACT;EAAxB,gBACE,oBAAC,IAAD;IAAM,KAAK,EAAE,CAACS,UAAU,CAACJ,WAAZ,EAAyB;MAACrB,eAAe,EAAE6B;IAAlB,CAAzB;EAAb,GACGC,UADH,CADF,CADS,GAMP,IAhBN,eAiBE,oBAAC,IAAD;IAAM,KAAK,EAAEK;EAAb,GAA6BR,QAA7B,CAjBF,CADF;AAqBD,CA/CD;;AAiDA,eAAeL,KAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../src/hoc/modal/select/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAA6B,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAQ1F,OAAO,EAAC,UAAU,EAAC,MAAM,yCAAyC,CAAC;AAEnE,oBAAY,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAEvD,oBAAY,KAAK,GAAG;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../src/hoc/modal/select/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAA6B,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAQ1F,OAAO,EAAC,UAAU,EAAC,MAAM,yCAAyC,CAAC;AAEnE,oBAAY,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAEvD,oBAAY,KAAK,GAAG;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAgDF,QAAA,MAAM,WAAW,UAAW,KAAK,uBAsChC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -22,10 +22,10 @@ const keyExtractor = (item, index) => {
|
|
|
22
22
|
return `modal-select-item-${index + 1}`;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
const createRenderItem = (value, testID, onChange) => ({
|
|
25
|
+
const createRenderItem = (value, testID, onChange) => function Item({
|
|
26
26
|
item,
|
|
27
27
|
index
|
|
28
|
-
})
|
|
28
|
+
}) {
|
|
29
29
|
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
30
30
|
const handleChange = _value => () => onChange(_value);
|
|
31
31
|
|
|
@@ -36,7 +36,7 @@ const createRenderItem = (value, testID, onChange) => ({
|
|
|
36
36
|
}, item.text);
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const createSeparator = styleSheet => ()
|
|
39
|
+
const createSeparator = styleSheet => function Separator() {
|
|
40
40
|
return /*#__PURE__*/React.createElement(View, {
|
|
41
41
|
style: styleSheet?.separator
|
|
42
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","useMemo","View","FlatList","StyleSheet","useTemplateContext","Modal","ModalSelectItem","createStyleSheet","theme","create","content","paddingHorizontal","separator","borderTopWidth","borderColor","colors","border","list","width","keyExtractor","item","index","createRenderItem","value","testID","onChange","handleChange","_value","text","createSeparator","styleSheet","ModalSelect","props","templateContext","setStylesheet","values","onClose","_stylesheet","renderItem","renderSeparator"],"sources":["../../../../src/hoc/modal/select/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect, useMemo} from 'react';\nimport {View, FlatList, StyleSheet, GestureResponderEvent, ViewStyle} from 'react-native';\nimport {noop} from 'lodash/fp';\n\nimport {Theme} from '../../../variables/theme.native';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\n\nimport Modal from '../index.native';\nimport ModalSelectItem from '../select-item/index.native';\nimport {ChoiceItem} from '../../../atom/select-modal/index.native';\n\nexport type OnChangeFunction = (value: string) => void;\n\nexport type Props = {\n value?: string;\n values: Array<ChoiceItem> | undefined;\n onChange: OnChangeFunction;\n onClose?: (event: GestureResponderEvent) => void;\n testID?: string;\n};\n\ntype StyleSheetType = {\n content: ViewStyle;\n separator: ViewStyle;\n list: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n content: {\n paddingHorizontal: 0\n },\n separator: {\n borderTopWidth: 1,\n borderColor: theme.colors.border\n },\n list: {\n width: '100%'\n }\n });\n\nconst keyExtractor = (item: ChoiceItem, index: number): string => {\n return `modal-select-item-${index + 1}`;\n};\n\nconst createRenderItem = (value: string, testID:
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","useMemo","View","FlatList","StyleSheet","useTemplateContext","Modal","ModalSelectItem","createStyleSheet","theme","create","content","paddingHorizontal","separator","borderTopWidth","borderColor","colors","border","list","width","keyExtractor","item","index","createRenderItem","value","testID","onChange","Item","handleChange","_value","text","createSeparator","styleSheet","Separator","ModalSelect","props","templateContext","setStylesheet","values","onClose","_stylesheet","renderItem","renderSeparator"],"sources":["../../../../src/hoc/modal/select/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect, useMemo} from 'react';\nimport {View, FlatList, StyleSheet, GestureResponderEvent, ViewStyle} from 'react-native';\nimport {noop} from 'lodash/fp';\n\nimport {Theme} from '../../../variables/theme.native';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\n\nimport Modal from '../index.native';\nimport ModalSelectItem from '../select-item/index.native';\nimport {ChoiceItem} from '../../../atom/select-modal/index.native';\n\nexport type OnChangeFunction = (value: string) => void;\n\nexport type Props = {\n value?: string;\n values: Array<ChoiceItem> | undefined;\n onChange: OnChangeFunction;\n onClose?: (event: GestureResponderEvent) => void;\n testID?: string;\n};\n\ntype StyleSheetType = {\n content: ViewStyle;\n separator: ViewStyle;\n list: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n content: {\n paddingHorizontal: 0\n },\n separator: {\n borderTopWidth: 1,\n borderColor: theme.colors.border\n },\n list: {\n width: '100%'\n }\n });\n\nconst keyExtractor = (item: ChoiceItem, index: number): string => {\n return `modal-select-item-${index + 1}`;\n};\n\ntype ItemProps = {item: ChoiceItem; index: number};\nconst createRenderItem = (value: string, testID: string, onChange: OnChangeFunction) =>\n function Item({item, index}: ItemProps) {\n // eslint-disable-next-line unicorn/consistent-function-scoping\n const handleChange = (_value: string) => () => onChange(_value);\n\n return (\n <ModalSelectItem\n onPress={handleChange(item.text)}\n isSelected={value === item.text}\n testID={`${testID}-item-${index + 1}`}\n >\n {item.text}\n </ModalSelectItem>\n );\n };\n\nconst createSeparator = (styleSheet: StyleSheetType) =>\n function Separator() {\n return <View style={styleSheet?.separator} />;\n };\n\nconst ModalSelect = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {theme} = templateContext;\n const {value = '', values, onChange, onClose = noop, testID = 'modal-select'} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n const renderItem = useMemo(\n () => createRenderItem(value, testID, onChange),\n [value, testID, onChange]\n );\n\n const renderSeparator = useMemo(\n () => (styleSheet ? createSeparator(styleSheet) : null),\n [styleSheet]\n );\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <Modal onClose={onClose} contentStyle={styleSheet?.content} testID={testID}>\n <FlatList\n data={values}\n renderItem={renderItem}\n keyExtractor={keyExtractor}\n showsVerticalScrollIndicator={false}\n ItemSeparatorComponent={renderSeparator}\n style={styleSheet?.list}\n testID={`${testID}-items`}\n />\n </Modal>\n );\n};\n\nexport default ModalSelect;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,EAAoCC,OAApC,QAAkD,OAAlD;AACA,SAAQC,IAAR,EAAcC,QAAd,EAAwBC,UAAxB,QAA2E,cAA3E;AAIA,SAAQC,kBAAR,QAAiC,+CAAjC;AAEA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,eAAP,MAA4B,6BAA5B;;AAmBA,MAAMC,gBAAgB,GAAIC,KAAD,IACvBL,UAAU,CAACM,MAAX,CAAkB;EAChBC,OAAO,EAAE;IACPC,iBAAiB,EAAE;EADZ,CADO;EAIhBC,SAAS,EAAE;IACTC,cAAc,EAAE,CADP;IAETC,WAAW,EAAEN,KAAK,CAACO,MAAN,CAAaC;EAFjB,CAJK;EAQhBC,IAAI,EAAE;IACJC,KAAK,EAAE;EADH;AARU,CAAlB,CADF;;AAcA,MAAMC,YAAY,GAAG,CAACC,IAAD,EAAmBC,KAAnB,KAA6C;EAChE,OAAQ,qBAAoBA,KAAK,GAAG,CAAE,EAAtC;AACD,CAFD;;AAKA,MAAMC,gBAAgB,GAAG,CAACC,KAAD,EAAgBC,MAAhB,EAAgCC,QAAhC,KACvB,SAASC,IAAT,CAAc;EAACN,IAAD;EAAOC;AAAP,CAAd,EAAwC;EACtC;EACA,MAAMM,YAAY,GAAIC,MAAD,IAAoB,MAAMH,QAAQ,CAACG,MAAD,CAAvD;;EAEA,oBACE,oBAAC,eAAD;IACE,OAAO,EAAED,YAAY,CAACP,IAAI,CAACS,IAAN,CADvB;IAEE,UAAU,EAAEN,KAAK,KAAKH,IAAI,CAACS,IAF7B;IAGE,MAAM,EAAG,GAAEL,MAAO,SAAQH,KAAK,GAAG,CAAE;EAHtC,GAKGD,IAAI,CAACS,IALR,CADF;AASD,CAdH;;AAgBA,MAAMC,eAAe,GAAIC,UAAD,IACtB,SAASC,SAAT,GA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d,IANrB;IAOE,MAAM,EAAG,GAAEO,MAAO;EAPpB,EADF,CADF;AAaD,CAtCD;;AAwCA,eAAeS,WAAf"}
|
|
@@ -3,7 +3,7 @@ import { GestureResponderEvent } from 'react-native';
|
|
|
3
3
|
export declare type Props = {
|
|
4
4
|
isSelected?: boolean;
|
|
5
5
|
children: string;
|
|
6
|
-
onPress?: (event: GestureResponderEvent) =>
|
|
6
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
7
7
|
testID?: string;
|
|
8
8
|
};
|
|
9
9
|
declare const ModalSelectItem: (props: Props) => JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../src/hoc/modal/select-item/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,qBAAqB,EAAmC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../src/hoc/modal/select-item/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,qBAAqB,EAAmC,MAAM,cAAc,CAAC;AAQrF,oBAAY,KAAK,GAAG;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAuBF,QAAA,MAAM,eAAe,UAAW,KAAK,uBA0BpC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|