@coorpacademy/components 10.30.7 → 10.30.9
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.js +4 -2
- package/es/atom/choice/index.native.js.map +1 -1
- package/es/atom/html/index.native.js +3 -1
- package/es/atom/html/index.native.js.map +1 -1
- package/es/atom/input-search/index.d.ts.map +1 -1
- package/es/atom/input-search/index.js +1 -0
- package/es/atom/input-search/index.js.map +1 -1
- package/es/atom/review-presentation/index.native.js +60 -56
- package/es/atom/review-presentation/index.native.js.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.js +17 -13
- package/es/hoc/modal/select-item/index.native.js.map +1 -1
- package/es/hoc/touchable/index.native.js +2 -2
- package/es/hoc/touchable/index.native.js.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +7 -3
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/questions/free-text/index.native.js +30 -26
- package/es/molecule/questions/free-text/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/slider/index.native.js +5 -3
- package/es/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/template/index.native.js +3 -1
- package/es/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/es/organism/review-congrats/index.js +3 -1
- package/es/organism/review-congrats/index.js.map +1 -1
- package/es/organism/review-slide/index.native.js +20 -16
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/lib/atom/choice/index.native.js +4 -2
- package/lib/atom/choice/index.native.js.map +1 -1
- package/lib/atom/html/index.native.js +3 -1
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/atom/input-search/index.d.ts.map +1 -1
- package/lib/atom/input-search/index.js +1 -0
- package/lib/atom/input-search/index.js.map +1 -1
- package/lib/atom/review-presentation/index.native.js +60 -56
- package/lib/atom/review-presentation/index.native.js.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.js +17 -13
- package/lib/hoc/modal/select-item/index.native.js.map +1 -1
- package/lib/hoc/touchable/index.native.js +2 -2
- package/lib/hoc/touchable/index.native.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +7 -3
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/questions/free-text/index.native.js +30 -26
- package/lib/molecule/questions/free-text/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/slider/index.native.js +5 -3
- package/lib/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/template/index.native.js +3 -1
- package/lib/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/lib/organism/review-congrats/index.js +3 -1
- package/lib/organism/review-congrats/index.js.map +1 -1
- package/lib/organism/review-slide/index.native.js +20 -16
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","squeezed","StyleSheet","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","useTemplateContext","brandTheme","styleSheet","setStylesheet","useState","useEffect","_stylesheet","selectedSuffix","mediaType","type","toLowerCase","url","src","length","getCleanUri","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, TextStyle} from 'react-native';\n\nimport Html from '../html/index.native';\nimport ImageBackground from '../image-background/index.native';\nimport type {Media, QuestionType} from '../../molecule/questions/types';\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 <Html style={textStyle}>{children}</Html>\n </View>\n ) : null}\n </View>\n </Touchable>\n );\n};\n\nexport default Choice;\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,QAAf,KACvBC,uBAAA,CAAWC,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,EAAEZ,KAAK,CAACc,MAAN,CAAaC,KADrB;IAETC,YAAY,EAAEhB,KAAK,CAACiB,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,UAAU,EAAE,QAJC;IAKbK,IAAI,EAAE;EALO,CAfC;EAsBhBC,qBAAqB,EAAE;IACrBC,OAAO,EAAE3B,KAAK,CAAC4B,OAAN,CAAcC,KADF;IAErBC,WAAW,EAAEC,SAFQ;IAGrBR,eAAe,EAAEQ,SAHI;IAIrBC,YAAY,EAAED,SAJO;IAKrBN,IAAI,EAAE;EALe,CAtBP;EA6BhBQ,IAAI,EAAE;IACJC,QAAQ,EAAEjC,QAAQ,GAAGD,KAAK,CAACkC,QAAN,CAAeC,MAAlB,GAA2BnC,KAAK,CAACkC,QAAN,CAAehB,OADxD;IAEJkB,UAAU,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AAY,EAAEhB,KAAK,CAACiB,MAAN,CAAaC;IAD7B,CAR2B,CAAjC;;IAaA,IAAIgE,cAAJ,EAAoB;MAClBF,gBAAgB,CAACC,IAAjB,CAAsBC,cAAtB;IACD;EACF;;EAED,oBACE,6BAAC,eAAD;IACE,OAAO,EAAE,CAAC7B,UAAD,GAAcC,OAAd,GAAwBvB,SADnC;IAEE,KAAK,EAAE2B,KAFT;IAGE,WAAW,EAAC,iBAHd;IAIE,eAAe,EAAE;MAACC;IAAD;EAJnB,gBAME,6BAAC,iBAAD;IACE,KAAK,EAAE,CAACI,UAAU,CAAC3D,SAAZ,EAAuB2D,UAAU,CAAClD,SAAlC,CADT;IAEE,MAAM,EAAE4C,YAAY,IAAK,GAAEA,YAAa,GAAEW,cAAe;EAF3D,GAIGI,GAAG,gBACF,6BAAC,iBAAD;IAAM,KAAK,EAAET,UAAU,CAAClB;EAAxB,gBACE,6BAAC,eAAD;IACE,MAAM,EAAEY,YAAY,IAAK,GAAEA,YAAa,GAAEqB,WAAY,EADxD;IAEE,MAAM,EAAEF,MAFV;IAGE,KAAK,EAAEb,UAAU,CAACd;EAHpB,EADF,CADE,GAQA,IAZN,EAcGE,QAAQ,gBACP,6BAAC,iBAAD;IAAM,KAAK,EAAE6B;EAAb,gBACE,6BAAC,cAAD;IAAM,KAAK,EAAED;EAAb,GAAyB5B,QAAzB,CADF,CADO,GAIL,IAlBN,CANF,CADF;AA6BD,CA/FD;;eAiGeD,M"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","squeezed","StyleSheet","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","useTemplateContext","brandTheme","styleSheet","setStylesheet","useState","useEffect","_stylesheet","selectedSuffix","mediaType","type","toLowerCase","url","src","length","getCleanUri","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, TextStyle} from 'react-native';\n\nimport Html from '../html/index.native';\nimport ImageBackground from '../image-background/index.native';\nimport type {Media, QuestionType} from '../../molecule/questions/types';\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 <Html style={textStyle}>{children}</Html>\n </View>\n ) : null}\n </View>\n </Touchable>\n );\n};\n\nexport default Choice;\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,QAAf,KACvBC,uBAAA,CAAWC,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,EAAEZ,KAAK,CAACc,MAAN,CAAaC,KADrB;IAETC,YAAY,EAAEhB,KAAK,CAACiB,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,UAAU,EAAE,QAJC;IAKbK,IAAI,EAAE;EALO,CAfC;EAsBhBC,qBAAqB,EAAE;IACrBC,OAAO,EAAE3B,KAAK,CAAC4B,OAAN,CAAcC,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html = props => {
|
|
|
107
107
|
numberOfLines: numberOfLines
|
|
108
108
|
}, _children), [numberOfLines]);
|
|
109
109
|
const FontRenderer = (0, _react.useCallback)((htmlAttribs, _children) => {
|
|
110
|
+
var _htmlAttribs$color;
|
|
111
|
+
|
|
110
112
|
if (htmlAttribs.color) {
|
|
111
113
|
disableBaseFontStyleColor(true);
|
|
112
114
|
}
|
|
@@ -114,7 +116,7 @@ const Html = props => {
|
|
|
114
116
|
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
115
117
|
key: 1,
|
|
116
118
|
style: _extends({}, baseFontStyle, {
|
|
117
|
-
color: htmlAttribs.color
|
|
119
|
+
color: (_htmlAttribs$color = htmlAttribs.color) == null ? void 0 : _htmlAttribs$color.replace(/ /g, '')
|
|
118
120
|
})
|
|
119
121
|
}, _children);
|
|
120
122
|
}, [baseFontStyle]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["HtmlBase","props","Html","templateContext","useTemplateContext","isDisabledBaseFontStyleColor","disableBaseFontStyleColor","useState","theme","children","fontSize","containerStyle","imageStyle","style","testID","anchorTextColor","HTML_ANCHOR_TEXT_COLOR","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","DEFAULT_TEXT_STYLE","colors","black","Array","isArray","styleObject","reduce","result","child","SpanRenderer","useCallback","htmlAttribs","_children","FontRenderer","replace","renderers","font","span","html","undefined"],"sources":["../../../src/atom/html/index.native.tsx"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport {View, ViewStyle, ImageStyle, TextStyle} from 'react-native';\nimport RenderHTML, {\n CustomRendererProps,\n MixedStyleRecord,\n RenderHTMLProps,\n TBlock\n} 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\ninterface CustomRenderHTMLProps extends RenderHTMLProps {\n baseFontStyle?: TextStyle;\n testID?: string;\n}\n\nconst HtmlBase = (props: CustomRenderHTMLProps) => {\n return <RenderHTML {...props} />;\n};\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 [isDisabledBaseFontStyleColor, disableBaseFontStyleColor] = useState<boolean>(false);\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: TextStyle = {...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 interface HtmlAttrib extends CustomRendererProps<TBlock> {\n color?: string;\n }\n\n const FontRenderer = useCallback(\n (htmlAttribs: HtmlAttrib, _children: string) => {\n if (htmlAttribs.color) {\n disableBaseFontStyleColor(true);\n }\n\n return (\n <Text\n key={1}\n style={{\n ...baseFontStyle,\n color: htmlAttribs.color?.replace(/ /g, '')\n }}\n >\n {_children}\n </Text>\n );\n },\n [baseFontStyle]\n );\n\n const renderers = {\n font: FontRenderer,\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 baseFontStyle={{\n ...baseFontStyle,\n color: isDisabledBaseFontStyleColor ? undefined : baseFontStyle.color\n }}\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;;AACA;;AACA;;AAOA;;AACA;;AACA;;;;;;;;;;AAOA,MAAMA,QAAQ,GAAIC,KAAD,IAAkC;EACjD,oBAAO,6BAAC,8BAAD,EAAgBA,KAAhB,CAAP;AACD,CAFD;;AAoCA,MAAMC,IAAI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B,KAAJ,EAAW;IACT,IAAIgC,KAAK,CAACC,OAAN,CAAcjC,KAAd,CAAJ,EAA0B;MACxB,MAAMkC,WAAW,GAAGlC,KAAK,CAACmC,MAAN,CAAa,CAACC,MAAD,EAASC,KAAT,kBAC5BD,MAD4B,EAE5BC,KAF4B,CAAb,CAApB;MAIAT,aAAa,gBACRA,aADQ,EAERM,WAFQ,CAAb;IAID,CATD,MASO;MACLN,aAAa,gBACRA,aADQ,EAER5B,KAFQ,CAAb;IAID;EACF;;EAED,MAAMsC,YAAY,GAAG,IAAAC,kBAAA,EACnB,CAACC,WAAD,EAA2CC,SAA3C,kBACE,6BAAC,cAAD;IAAM,aAAa,EAAEpC;EAArB,GAAqCoC,SAArC,CAFiB,EAInB,CAACpC,aAAD,CAJmB,CAArB;EAWA,MAAMqC,YAAY,GAAG,IAAAH,kBAAA,EACnB,CAACC,WAAD,EAA0BC,SAA1B,KAAgD;IAC9C,IAAID,WAAW,CAACd,KAAhB,EAAuB;MACrBjC,yBAAyB,CAAC,IAAD,CAAzB;IACD;;IAED,oBACE,6BAAC,cAAD;MACE,GAAG,EAAE,CADP;MAEE,KAAK,eACAmC,aADA;QAEHF,KAAK,
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["HtmlBase","props","Html","templateContext","useTemplateContext","isDisabledBaseFontStyleColor","disableBaseFontStyleColor","useState","theme","children","fontSize","containerStyle","imageStyle","style","testID","anchorTextColor","HTML_ANCHOR_TEXT_COLOR","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","DEFAULT_TEXT_STYLE","colors","black","Array","isArray","styleObject","reduce","result","child","SpanRenderer","useCallback","htmlAttribs","_children","FontRenderer","replace","renderers","font","span","html","undefined"],"sources":["../../../src/atom/html/index.native.tsx"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport {View, ViewStyle, ImageStyle, TextStyle} from 'react-native';\nimport RenderHTML, {\n CustomRendererProps,\n MixedStyleRecord,\n RenderHTMLProps,\n TBlock\n} 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\ninterface CustomRenderHTMLProps extends RenderHTMLProps {\n baseFontStyle?: TextStyle;\n testID?: string;\n}\n\nconst HtmlBase = (props: CustomRenderHTMLProps) => {\n return <RenderHTML {...props} />;\n};\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 [isDisabledBaseFontStyleColor, disableBaseFontStyleColor] = useState<boolean>(false);\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: TextStyle = {...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 interface HtmlAttrib extends CustomRendererProps<TBlock> {\n color?: string;\n }\n\n const FontRenderer = useCallback(\n (htmlAttribs: HtmlAttrib, _children: string) => {\n if (htmlAttribs.color) {\n disableBaseFontStyleColor(true);\n }\n\n return (\n <Text\n key={1}\n style={{\n ...baseFontStyle,\n color: htmlAttribs.color?.replace(/ /g, '')\n }}\n >\n {_children}\n </Text>\n );\n },\n [baseFontStyle]\n );\n\n const renderers = {\n font: FontRenderer,\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 baseFontStyle={{\n ...baseFontStyle,\n color: isDisabledBaseFontStyleColor ? undefined : baseFontStyle.color\n }}\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"],"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AAK,EAAEH;EAA7B,gBACE,6BAAC,QAAD,CACE;EACA;EACA;EACA;EAJF;IAKE,MAAM,EAAE;MACN;MACAiD,IAAI,EAAE3C,cAAc,GACf,MAAKR,QAAS,MADC,GAEhBS,aAAa,GACZ,SAAQT,QAAS,SADL,GAEZ,GAAEA,QAAS;IANV,CALV;IAaE,UAAU,EAAEsB,UAbd;IAcE,aAAa,eACRU,aADQ;MAEXF,KAAK,EAAElC,4BAA4B,GAAGwD,SAAH,GAAepB,aAAa,CAACF;IAFrD,EAdf;IAkBE,SAAS,EAAEkB,SAlBb,CAmBE;IACA;IACA;IACA;IAtBF;IAuBE,aAAa,EAAE,CAAC,OAAD,EAAU,QAAV,CAvBjB;IAwBE,MAAM,EAAC;EAxBT,EADF,CADF;AA8BD,CAtID;;eAwIevD,I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAYA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAYA,iDA+CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Search","props","value","placeholder","onChange","onClear","onFocus","onBlur","theme","handleChange","useMemo","e","target","cmStyle","classnames","style","coorpmanager","isDefaultTheme","wrapperSearch","searchIcon","title","noValue","search","clearIcon","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","func","oneOf"],"sources":["../../../src/atom/input-search/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademySearchThin as CMSearchIcon,\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {noop, isEmpty} from 'lodash/fp';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst Search = props => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n theme = 'default'\n } = props;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const cmStyle = classnames(style.coorpmanager);\n const isDefaultTheme = theme === 'default';\n\n return (\n <div className={isDefaultTheme ? style.wrapperSearch : cmStyle}>\n <label htmlFor=\"search\" title={placeholder}>\n {!isDefaultTheme ? (\n <CMSearchIcon className={style.searchIcon} />\n ) : (\n <SearchIcon className={style.searchIcon} />\n )}\n {!isDefaultTheme ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n data-name=\"search-input\"\n className={style.search}\n type=\"text\"\n name=\"search\"\n id=\"search\"\n placeholder={placeholder}\n value={value}\n onInput={handleChange}\n onFocus={onFocus}\n onChange={noop}\n onBlur={onBlur}\n />\n {value && !isDefaultTheme ? (\n <CloseIcon onClick={onClear} className={style.clearIcon} />\n ) : null}\n </div>\n );\n};\n\nSearch.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearch.propTypes = {\n value: PropTypes.string,\n placeholder: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onClear: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager'])\n};\n\nexport default Search;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAMA;;AACA;;;;;;;;AAEA,MAAMA,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,QAAQ,iBAHJ;IAIJC,OAAO,iBAJH;IAKJC,OALI;IAMJC,MANI;IAOJC,KAAK,GAAG;EAPJ,IAQFP,KARJ;EASA,MAAMQ,YAAY,GAAG,IAAAC,cAAA,EAAQ,MAAMC,CAAC,IAAIP,QAAQ,CAACO,CAAC,CAACC,MAAF,CAASV,KAAV,CAA3B,EAA6C,CAACE,QAAD,CAA7C,CAArB;EACA,MAAMS,OAAO,GAAG,IAAAC,mBAAA,EAAWC,cAAA,CAAMC,YAAjB,CAAhB;EACA,MAAMC,cAAc,GAAGT,KAAK,KAAK,SAAjC;EAEA,oBACE;IAAK,SAAS,EAAES,cAAc,GAAGF,cAAA,CAAMG,aAAT,GAAyBL;EAAvD,gBACE;IAAO,OAAO,EAAC,QAAf;IAAwB,KAAK,EAAEV;EAA/B,GACG,CAACc,cAAD,gBACC,6BAAC,gDAAD;IAAc,SAAS,EAAEF,cAAA,CAAMI;EAA/B,EADD,gBAGC,6BAAC,4CAAD;IAAY,SAAS,EAAEJ,cAAA,CAAMI;EAA7B,EAJJ,EAMG,CAACF,cAAD,gBACC;IAAM,SAAS,EAAE,IAAAH,mBAAA,EAAWC,cAAA,CAAMK,KAAjB,EAAwB,uBAAQlB,KAAR,KAAkBa,cAAA,CAAMM,OAAhD;EAAjB,GACGlB,WADH,CADD,GAIG,IAVN,CADF,eAaE;IACE,aAAU,cADZ;IAEE,SAAS,EAAEY,cAAA,CAAMO,MAFnB;IAGE,IAAI,EAAC,
|
|
1
|
+
{"version":3,"file":"index.js","names":["Search","props","value","placeholder","onChange","onClear","onFocus","onBlur","theme","handleChange","useMemo","e","target","cmStyle","classnames","style","coorpmanager","isDefaultTheme","wrapperSearch","searchIcon","title","noValue","search","clearIcon","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","func","oneOf"],"sources":["../../../src/atom/input-search/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademySearchThin as CMSearchIcon,\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {noop, isEmpty} from 'lodash/fp';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst Search = props => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n theme = 'default'\n } = props;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const cmStyle = classnames(style.coorpmanager);\n const isDefaultTheme = theme === 'default';\n\n return (\n <div className={isDefaultTheme ? style.wrapperSearch : cmStyle}>\n <label htmlFor=\"search\" title={placeholder}>\n {!isDefaultTheme ? (\n <CMSearchIcon className={style.searchIcon} />\n ) : (\n <SearchIcon className={style.searchIcon} />\n )}\n {!isDefaultTheme ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n data-name=\"search-input\"\n className={style.search}\n aria-label={placeholder}\n type=\"text\"\n name=\"search\"\n id=\"search\"\n placeholder={placeholder}\n value={value}\n onInput={handleChange}\n onFocus={onFocus}\n onChange={noop}\n onBlur={onBlur}\n />\n {value && !isDefaultTheme ? (\n <CloseIcon onClick={onClear} className={style.clearIcon} />\n ) : null}\n </div>\n );\n};\n\nSearch.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearch.propTypes = {\n value: PropTypes.string,\n placeholder: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onClear: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager'])\n};\n\nexport default Search;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAMA;;AACA;;;;;;;;AAEA,MAAMA,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,QAAQ,iBAHJ;IAIJC,OAAO,iBAJH;IAKJC,OALI;IAMJC,MANI;IAOJC,KAAK,GAAG;EAPJ,IAQFP,KARJ;EASA,MAAMQ,YAAY,GAAG,IAAAC,cAAA,EAAQ,MAAMC,CAAC,IAAIP,QAAQ,CAACO,CAAC,CAACC,MAAF,CAASV,KAAV,CAA3B,EAA6C,CAACE,QAAD,CAA7C,CAArB;EACA,MAAMS,OAAO,GAAG,IAAAC,mBAAA,EAAWC,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AGjB3B,QAAQ,EAAEyB,kBAAA,CAAUG,IAHH;EAIjB3B,OAAO,EAAEwB,kBAAA,CAAUG,IAJF;EAKjB1B,OAAO,EAAEuB,kBAAA,CAAUG,IALF;EAMjBzB,MAAM,EAAEsB,kBAAA,CAAUG,IAND;EAOjBxB,KAAK,EAAEqB,kBAAA,CAAUI,KAAV,CAAgB,CAAC,SAAD,EAAY,cAAZ,CAAhB;AAPU,CAAnB;eAUejC,M"}
|
|
@@ -23,62 +23,66 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
23
23
|
|
|
24
24
|
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; }
|
|
25
25
|
|
|
26
|
-
const createStyleSheet = (brandTheme, theme) =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
26
|
+
const createStyleSheet = (brandTheme, theme) => {
|
|
27
|
+
var _brandTheme$colors;
|
|
28
|
+
|
|
29
|
+
return _reactNative.StyleSheet.create({
|
|
30
|
+
container: {
|
|
31
|
+
backgroundColor: theme.colors.white,
|
|
32
|
+
justifyContent: 'space-between',
|
|
33
|
+
flex: 1,
|
|
34
|
+
padding: 20,
|
|
35
|
+
paddingTop: _index.HEADER_HEIGHT + 20
|
|
36
|
+
},
|
|
37
|
+
title: {
|
|
38
|
+
height: 72,
|
|
39
|
+
width: 268,
|
|
40
|
+
fontSize: theme.fontSize.xxlarge,
|
|
41
|
+
fontWeight: theme.fontWeight.bold,
|
|
42
|
+
lineHeight: 36,
|
|
43
|
+
color: theme.colors.text.primary,
|
|
44
|
+
marginBottom: theme.spacing.small
|
|
45
|
+
},
|
|
46
|
+
text: {
|
|
47
|
+
fontSize: theme.fontSize.large,
|
|
48
|
+
color: theme.colors.text.primary,
|
|
49
|
+
opacity: 0.7,
|
|
50
|
+
marginBottom: theme.spacing.small
|
|
51
|
+
},
|
|
52
|
+
tip: {
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
overflow: 'hidden',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
height: 54,
|
|
57
|
+
borderRadius: 8,
|
|
58
|
+
backgroundColor: theme.colors.gray.extra,
|
|
59
|
+
marginTop: theme.spacing.micro,
|
|
60
|
+
marginBottom: theme.spacing.micro
|
|
61
|
+
},
|
|
62
|
+
tipText: {
|
|
63
|
+
fontSize: 16,
|
|
64
|
+
lineHeight: 22,
|
|
65
|
+
color: theme.colors.text.primary
|
|
66
|
+
},
|
|
67
|
+
icon: {
|
|
68
|
+
margin: 10
|
|
69
|
+
},
|
|
70
|
+
button: {
|
|
71
|
+
height: 52,
|
|
72
|
+
borderRadius: 7,
|
|
73
|
+
marginBottom: theme.spacing.large,
|
|
74
|
+
marginTop: theme.spacing.large,
|
|
75
|
+
backgroundColor: (brandTheme == null ? void 0 : (_brandTheme$colors = brandTheme.colors) == null ? void 0 : _brandTheme$colors.primary) || theme.colors.cta,
|
|
76
|
+
justifyContent: 'center'
|
|
77
|
+
},
|
|
78
|
+
buttonText: {
|
|
79
|
+
alignSelf: 'center',
|
|
80
|
+
fontWeight: theme.fontWeight.bold,
|
|
81
|
+
fontSize: theme.fontSize.large,
|
|
82
|
+
color: '#fff'
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
};
|
|
82
86
|
|
|
83
87
|
const Tip = props => {
|
|
84
88
|
const templateContext = (0, _templateContext.useTemplateContext)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","brandTheme","theme","StyleSheet","create","container","backgroundColor","colors","white","justifyContent","flex","padding","paddingTop","HEADER_HEIGHT","title","height","width","fontSize","xxlarge","fontWeight","bold","lineHeight","color","text","primary","marginBottom","spacing","small","large","opacity","tip","flexDirection","overflow","alignItems","borderRadius","gray","extra","marginTop","micro","tipText","icon","margin","button","cta","buttonText","alignSelf","Tip","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","Icon","useEffect","_stylesheet","Onboarding","translations","onPress","appReview","presentation","TargetIcon","labelList","skills","QuestionMarkIcon","questions","HeartIcon","lifes","CheckCircle2Icon","allright","ok"],"sources":["../../../src/atom/review-presentation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionMarkIcon,\n NovaSolidStatusCheckCircle2 as CheckCircle2Icon,\n NovaCompositionCoorpacademyVoteHeartOutline as HeartIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport {HEADER_HEIGHT} from '../../organism/header-v2/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport Html from '../html/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {OnboardingProps, TipProps} from './prop-types';\n\ntype StyleSheetType = {\n container: ViewStyle;\n title: TextStyle;\n text: TextStyle;\n tip: ViewStyle;\n tipText: TextStyle;\n icon: ViewStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n};\n\nconst createStyleSheet = (brandTheme: Brand, theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n backgroundColor: theme.colors.white,\n justifyContent: 'space-between',\n flex: 1,\n padding: 20,\n paddingTop: HEADER_HEIGHT + 20\n },\n title: {\n height: 72,\n width: 268,\n fontSize: theme.fontSize.xxlarge,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 36,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.small\n },\n text: {\n fontSize: theme.fontSize.large,\n color: theme.colors.text.primary,\n opacity: 0.7,\n marginBottom: theme.spacing.small\n },\n tip: {\n flexDirection: 'row',\n overflow: 'hidden',\n alignItems: 'center',\n height: 54,\n borderRadius: 8,\n backgroundColor: theme.colors.gray.extra,\n marginTop: theme.spacing.micro,\n marginBottom: theme.spacing.micro\n },\n tipText: {\n fontSize: 16,\n lineHeight: 22,\n color: theme.colors.text.primary\n },\n icon: {\n margin: 10\n },\n button: {\n height: 52,\n borderRadius: 7,\n marginBottom: theme.spacing.large,\n marginTop: theme.spacing.large,\n backgroundColor: brandTheme?.colors?.primary || theme.colors.cta,\n justifyContent: 'center'\n },\n buttonText: {\n alignSelf: 'center',\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.large,\n color: '#fff'\n }\n });\n\nconst Tip = (props: TipProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n const {Icon, text} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.tip}>\n {<Icon height={16} width={16} style={styleSheet.icon} color={theme.colors.text.primary} />}\n <Text style={styleSheet.tipText}>{text}</Text>\n </View>\n );\n};\n\nconst Onboarding = (props: OnboardingProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme, translations} = templateContext;\n const {onPress} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n // ------------------------------------\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.container}>\n <Html style={styleSheet.title}>{translations.appReview.presentation.title}</Html>\n <Html style={styleSheet.text}>{translations.appReview.presentation.text}</Html>\n\n <Tip Icon={TargetIcon} text={translations.appReview.presentation.labelList.skills.text} />\n <Tip\n Icon={QuestionMarkIcon}\n text={translations.appReview.presentation.labelList.questions.text}\n />\n <Tip Icon={HeartIcon} text={translations.appReview.presentation.labelList.lifes.text} />\n <Tip\n Icon={CheckCircle2Icon}\n text={translations.appReview.presentation.labelList.allright.text}\n />\n <Touchable\n testID=\"button-quit-revision-onboarding\"\n onPress={onPress}\n analyticsID=\"button-start\"\n style={styleSheet.button}\n >\n <Text style={styleSheet.buttonText}>{translations.ok}</Text>\n </Touchable>\n </View>\n );\n};\n\nexport default Onboarding;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAOA;;AAEA;;AACA;;AACA;;;;;;;;AAeA,MAAMA,gBAAgB,GAAG,CAACC,UAAD,EAAoBC,KAApB,
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","brandTheme","theme","StyleSheet","create","container","backgroundColor","colors","white","justifyContent","flex","padding","paddingTop","HEADER_HEIGHT","title","height","width","fontSize","xxlarge","fontWeight","bold","lineHeight","color","text","primary","marginBottom","spacing","small","large","opacity","tip","flexDirection","overflow","alignItems","borderRadius","gray","extra","marginTop","micro","tipText","icon","margin","button","cta","buttonText","alignSelf","Tip","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","Icon","useEffect","_stylesheet","Onboarding","translations","onPress","appReview","presentation","TargetIcon","labelList","skills","QuestionMarkIcon","questions","HeartIcon","lifes","CheckCircle2Icon","allright","ok"],"sources":["../../../src/atom/review-presentation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionMarkIcon,\n NovaSolidStatusCheckCircle2 as CheckCircle2Icon,\n NovaCompositionCoorpacademyVoteHeartOutline as HeartIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport {HEADER_HEIGHT} from '../../organism/header-v2/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport Html from '../html/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {OnboardingProps, TipProps} from './prop-types';\n\ntype StyleSheetType = {\n container: ViewStyle;\n title: TextStyle;\n text: TextStyle;\n tip: ViewStyle;\n tipText: TextStyle;\n icon: ViewStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n};\n\nconst createStyleSheet = (brandTheme: Brand, theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n backgroundColor: theme.colors.white,\n justifyContent: 'space-between',\n flex: 1,\n padding: 20,\n paddingTop: HEADER_HEIGHT + 20\n },\n title: {\n height: 72,\n width: 268,\n fontSize: theme.fontSize.xxlarge,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 36,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.small\n },\n text: {\n fontSize: theme.fontSize.large,\n color: theme.colors.text.primary,\n opacity: 0.7,\n marginBottom: theme.spacing.small\n },\n tip: {\n flexDirection: 'row',\n overflow: 'hidden',\n alignItems: 'center',\n height: 54,\n borderRadius: 8,\n backgroundColor: theme.colors.gray.extra,\n marginTop: theme.spacing.micro,\n marginBottom: theme.spacing.micro\n },\n tipText: {\n fontSize: 16,\n lineHeight: 22,\n color: theme.colors.text.primary\n },\n icon: {\n margin: 10\n },\n button: {\n height: 52,\n borderRadius: 7,\n marginBottom: theme.spacing.large,\n marginTop: theme.spacing.large,\n backgroundColor: brandTheme?.colors?.primary || theme.colors.cta,\n justifyContent: 'center'\n },\n buttonText: {\n alignSelf: 'center',\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.large,\n color: '#fff'\n }\n });\n\nconst Tip = (props: TipProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n const {Icon, text} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.tip}>\n {<Icon height={16} width={16} style={styleSheet.icon} color={theme.colors.text.primary} />}\n <Text style={styleSheet.tipText}>{text}</Text>\n </View>\n );\n};\n\nconst Onboarding = (props: OnboardingProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme, translations} = templateContext;\n const {onPress} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n // ------------------------------------\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.container}>\n <Html style={styleSheet.title}>{translations.appReview.presentation.title}</Html>\n <Html style={styleSheet.text}>{translations.appReview.presentation.text}</Html>\n\n <Tip Icon={TargetIcon} text={translations.appReview.presentation.labelList.skills.text} />\n <Tip\n Icon={QuestionMarkIcon}\n text={translations.appReview.presentation.labelList.questions.text}\n />\n <Tip Icon={HeartIcon} text={translations.appReview.presentation.labelList.lifes.text} />\n <Tip\n Icon={CheckCircle2Icon}\n text={translations.appReview.presentation.labelList.allright.text}\n />\n <Touchable\n testID=\"button-quit-revision-onboarding\"\n onPress={onPress}\n analyticsID=\"button-start\"\n style={styleSheet.button}\n >\n <Text style={styleSheet.buttonText}>{translations.ok}</Text>\n </Touchable>\n </View>\n );\n};\n\nexport default Onboarding;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAOA;;AAEA;;AACA;;AACA;;;;;;;;AAeA,MAAMA,gBAAgB,GAAG,CAACC,UAAD,EAAoBC,KAApB;EAAA;;EAAA,OACvBC,uBAAA,CAAWC,MAAX,CAAkB;IAChBC,SAAS,EAAE;MACTC,eAAe,EAAEJ,KAAK,CAACK,MAAN,CAAaC,KADrB;MAETC,cAAc,EAAE,eAFP;MAGTC,IAAI,EAAE,CAHG;MAITC,OAAO,EAAE,EAJA;MAKTC,UAAU,EAAEC,oBAAA,GAAgB;IALnB,CADK;IAQhBC,KAAK,EAAE;MACLC,MAAM,EAAE,EADH;MAELC,KAAK,EAAE,GAFF;MAGLC,QAAQ,EAAEf,KAAK,CAACe,QAAN,CAAeC,OAHpB;MAILC,UAAU,EAAEjB,KAAK,CAACiB,UAAN,CAAiBC,IAJxB;MAKLC,UAAU,EAAE,EALP;MAMLC,KAAK,EAAEpB,KAAK,CAACK,MAAN,CAAagB,IAAb,CAAkBC,OANpB;MAOLC,YAAY,EAAEvB,KAAK,CAACwB,OAAN,CAAcC;IAPvB,CARS;IAiBhBJ,IAAI,EAAE;MACJN,QAAQ,EAAEf,KAAK,CA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AACR;EAJpB,gBAME,6BAAC,iBAAD;IAAM,KAAK,EAAEQ,UAAU,CAACN;EAAxB,GAAqCa,YAAY,CAACa,EAAlD,CANF,CAdF,CADF;AAyBD,CA1CD;;eA4Ced,U"}
|
|
@@ -54,7 +54,7 @@ const createRenderItem = (value, testID, onChange) => function Item({
|
|
|
54
54
|
|
|
55
55
|
const createSeparator = styleSheet => function Separator() {
|
|
56
56
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
57
|
-
style: styleSheet
|
|
57
|
+
style: styleSheet == null ? void 0 : styleSheet.separator
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -85,7 +85,7 @@ const ModalSelect = props => {
|
|
|
85
85
|
|
|
86
86
|
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
87
87
|
onClose: onClose,
|
|
88
|
-
contentStyle: styleSheet
|
|
88
|
+
contentStyle: styleSheet == null ? void 0 : styleSheet.content,
|
|
89
89
|
testID: testID
|
|
90
90
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.FlatList, {
|
|
91
91
|
data: values,
|
|
@@ -93,7 +93,7 @@ const ModalSelect = props => {
|
|
|
93
93
|
keyExtractor: keyExtractor,
|
|
94
94
|
showsVerticalScrollIndicator: false,
|
|
95
95
|
ItemSeparatorComponent: renderSeparator,
|
|
96
|
-
style: styleSheet
|
|
96
|
+
style: styleSheet == null ? void 0 : styleSheet.list,
|
|
97
97
|
testID: `${testID}-items`
|
|
98
98
|
}));
|
|
99
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","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","useTemplateContext","setStylesheet","useState","values","onClose","useEffect","_stylesheet","renderItem","useMemo","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;;AACA;;AAIA;;AAEA;;AACA;;;;;;;;AAmBA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,OAAO,EAAE;IACPC,iBAAiB,EAAE;EADZ,CADO;EAIhBC,SAAS,EAAE;IACTC,cAAc,EAAE,CADP;IAETC,WAAW,EAAEP,KAAK,CAACQ,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,6BAAC,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,GAAqB;EACnB,oBAAO,6BAAC,iBAAD;IAAM,KAAK,EAAED,UAAU,
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","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","useTemplateContext","setStylesheet","useState","values","onClose","useEffect","_stylesheet","renderItem","useMemo","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;;AACA;;AAIA;;AAEA;;AACA;;;;;;;;AAmBA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,OAAO,EAAE;IACPC,iBAAiB,EAAE;EADZ,CADO;EAIhBC,SAAS,EAAE;IACTC,cAAc,EAAE,CADP;IAETC,WAAW,EAAEP,KAAK,CAACQ,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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QAAhB,CADL,EAEjB,CAACF,KAAD,EAAQC,MAAR,EAAgBC,QAAhB,CAFiB,CAAnB;EAKA,MAAMoB,eAAe,GAAG,IAAAD,cAAA,EACtB,MAAOb,UAAU,GAAGD,eAAe,CAACC,UAAD,CAAlB,GAAiC,IAD5B,EAEtB,CAACA,UAAD,CAFsB,CAAxB;;EAKA,IAAI,CAACA,UAAL,EAAiB;IACf,OAAO,IAAP;EACD;;EAED,oBACE,6BAAC,cAAD;IAAO,OAAO,EAAES,OAAhB;IAAyB,YAAY,EAAET,UAAF,oBAAEA,UAAU,CAAErB,OAAnD;IAA4D,MAAM,EAAEc;EAApE,gBACE,6BAAC,qBAAD;IACE,IAAI,EAAEe,MADR;IAEE,UAAU,EAAEI,UAFd;IAGE,YAAY,EAAExB,YAHhB;IAIE,4BAA4B,EAAE,KAJhC;IAKE,sBAAsB,EAAE0B,eAL1B;IAME,KAAK,EAAEd,UAAF,oBAAEA,UAAU,CAAEd,IANrB;IAOE,MAAM,EAAG,GAAEO,MAAO;EAPpB,EADF,CADF;AAaD,CAtCD;;eAwCeS,W"}
|
|
@@ -19,19 +19,23 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
|
-
const createStyleSheet = (brandTheme, theme) =>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
const createStyleSheet = (brandTheme, theme) => {
|
|
23
|
+
var _brandTheme$colors;
|
|
24
|
+
|
|
25
|
+
return _reactNative.StyleSheet.create({
|
|
26
|
+
container: {
|
|
27
|
+
backgroundColor: theme.colors.white,
|
|
28
|
+
padding: theme.spacing.small
|
|
29
|
+
},
|
|
30
|
+
text: {
|
|
31
|
+
fontWeight: theme.fontWeight.bold,
|
|
32
|
+
color: theme.colors.black
|
|
33
|
+
},
|
|
34
|
+
selectedTextStyle: {
|
|
35
|
+
color: brandTheme == null ? void 0 : (_brandTheme$colors = brandTheme.colors) == null ? void 0 : _brandTheme$colors.primary
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
};
|
|
35
39
|
|
|
36
40
|
const ModalSelectItem = props => {
|
|
37
41
|
const templateContext = (0, _templateContext.useTemplateContext)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","brandTheme","theme","StyleSheet","create","container","backgroundColor","colors","white","padding","spacing","small","text","fontWeight","bold","color","black","selectedTextStyle","primary","ModalSelectItem","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_stylesheet","children","onPress","isSelected","testID","textStyle","push"],"sources":["../../../../src/hoc/modal/select-item/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {GestureResponderEvent, StyleSheet, TextStyle, ViewStyle} from 'react-native';\n\nimport Text from '../../../atom/text/index.native';\nimport Touchable from '../../touchable/index.native';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\nimport {Theme} from '../../../variables/theme.native';\nimport {Brand} from '../../../variables/brand.native';\n\nexport type Props = {\n isSelected?: boolean;\n children: string;\n onPress?: (event: GestureResponderEvent) => void;\n testID?: string;\n};\n\ntype StyleSheetType = {\n container: ViewStyle;\n text: TextStyle;\n selectedTextStyle: TextStyle;\n};\n\nconst createStyleSheet = (brandTheme: Brand, theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n backgroundColor: theme.colors.white,\n padding: theme.spacing.small\n },\n text: {\n fontWeight: theme.fontWeight.bold,\n color: theme.colors.black\n },\n selectedTextStyle: {\n color: brandTheme?.colors?.primary\n }\n });\n\nconst ModalSelectItem = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [theme, brandTheme]);\n\n if (!styleSheet) {\n return null;\n }\n\n const {children, onPress, isSelected, testID} = props;\n\n const textStyle: TextStyle[] = [styleSheet.text];\n if (isSelected) {\n textStyle.push(styleSheet.selectedTextStyle);\n }\n\n return (\n <Touchable onPress={onPress} style={styleSheet.container} testID={testID}>\n <Text style={textStyle}>{children}</Text>\n </Touchable>\n );\n};\n\nexport default ModalSelectItem;\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;AAiBA,MAAMA,gBAAgB,GAAG,CAACC,UAAD,EAAoBC,KAApB,
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","brandTheme","theme","StyleSheet","create","container","backgroundColor","colors","white","padding","spacing","small","text","fontWeight","bold","color","black","selectedTextStyle","primary","ModalSelectItem","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_stylesheet","children","onPress","isSelected","testID","textStyle","push"],"sources":["../../../../src/hoc/modal/select-item/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {GestureResponderEvent, StyleSheet, TextStyle, ViewStyle} from 'react-native';\n\nimport Text from '../../../atom/text/index.native';\nimport Touchable from '../../touchable/index.native';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\nimport {Theme} from '../../../variables/theme.native';\nimport {Brand} from '../../../variables/brand.native';\n\nexport type Props = {\n isSelected?: boolean;\n children: string;\n onPress?: (event: GestureResponderEvent) => void;\n testID?: string;\n};\n\ntype StyleSheetType = {\n container: ViewStyle;\n text: TextStyle;\n selectedTextStyle: TextStyle;\n};\n\nconst createStyleSheet = (brandTheme: Brand, theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n backgroundColor: theme.colors.white,\n padding: theme.spacing.small\n },\n text: {\n fontWeight: theme.fontWeight.bold,\n color: theme.colors.black\n },\n selectedTextStyle: {\n color: brandTheme?.colors?.primary\n }\n });\n\nconst ModalSelectItem = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [theme, brandTheme]);\n\n if (!styleSheet) {\n return null;\n }\n\n const {children, onPress, isSelected, testID} = props;\n\n const textStyle: TextStyle[] = [styleSheet.text];\n if (isSelected) {\n textStyle.push(styleSheet.selectedTextStyle);\n }\n\n return (\n <Touchable onPress={onPress} style={styleSheet.container} testID={testID}>\n <Text style={textStyle}>{children}</Text>\n </Touchable>\n );\n};\n\nexport default ModalSelectItem;\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;AAiBA,MAAMA,gBAAgB,GAAG,CAACC,UAAD,EAAoBC,KAApB;EAAA;;EAAA,OACvBC,uBAAA,CAAWC,MAAX,CAAkB;IAChBC,SAAS,EAAE;MACTC,eAAe,EAAEJ,KAAK,CAACK,MAAN,CAAaC,KADrB;MAETC,OAAO,EAAEP,KAAK,CAACQ,OAAN,CAAcC;IAFd,CADK;IAKhBC,IAAI,EAAE;MACJC,UAAU,EAAEX,KAAK,CAACW,UAAN,CAAiBC,IADzB;MAEJC,KAAK,EAAEb,KAAK,CAACK,MAAN,CAAaS;IAFhB,CALU;IAShBC,iBAAiB,EAAE;MACjBF,KAAK,EAAEd,UAAF,0CAAEA,UAAU,CAAEM,MAAd,qBAAE,mBAAoBW;IADV;EATH,CAAlB,CADuB;AAAA,CAAzB;;AAeA,MAAMC,eAAe,GAAIC,KAAD,IAAkB;EACxC,MAAMC,eAAe,GAAG,IAAAC,mCAAA,GAAxB;EACA,MAAM,CAACC,UAAD,EAAaC,aAAb,IAA8B,IAAAC,eAAA,EAAgC,IAAhC,CAApC;EACA,MAAM;IAACxB,UAAD;IAAaC;EAAb,IAAsBmB,eAA5B;EAEA,IAAAK,gBAAA,EAAU,MAAM;IACd,MAAMC,WAAW,GAAG3B,gBAAgB,CAACC,UAAD,EAAaC,KAAb,CAApC;;IACAsB,aAAa,CAACG,WAAD,CAAb;EACD,CAHD,EAGG,CAACzB,KAAD,EAAQD,UAAR,CAHH;;EAKA,IAAI,CAACsB,UAAL,EAAiB;IACf,OAAO,IAAP;EACD;;EAED,MAAM;IAACK,QAAD;IAAWC,OAAX;IAAoBC,UAApB;IAAgCC;EAAhC,IAA0CX,KAAhD;EAEA,MAAMY,SAAsB,GAAG,CAACT,UAAU,CAACX,IAAZ,CAA/B;;EACA,IAAIkB,UAAJ,EAAgB;IACdE,SAAS,CAACC,IAAV,CAAeV,UAAU,CAACN,iBAA1B;EACD;;EAED,oBACE,6BAAC,eAAD;IAAW,OAAO,EAAEY,OAApB;IAA6B,KAAK,EAAEN,UAAU,CAAClB,SAA/C;IAA0D,MAAM,EAAE0B;EAAlE,gBACE,6BAAC,cAAD;IAAM,KAAK,EAAEC;EAAb,GAAyBJ,QAAzB,CADF,CADF;AAKD,CA1BD;;eA4BeT,e"}
|
|
@@ -49,13 +49,13 @@ const Touchable = props => {
|
|
|
49
49
|
} = props;
|
|
50
50
|
const handlePress = (0, _react.useMemo)(() => event => {
|
|
51
51
|
if (!onPress) return;
|
|
52
|
-
vibration
|
|
52
|
+
vibration == null ? void 0 : vibration.vibrate();
|
|
53
53
|
analytics && analyticsID && logEvent(_analytics.ANALYTICS_EVENT_TYPE.PRESS, analyticsID, analytics, analyticsParams);
|
|
54
54
|
onPress(event);
|
|
55
55
|
}, [analytics, analyticsID, analyticsParams, onPress, vibration]);
|
|
56
56
|
const handleLongPress = (0, _react.useMemo)(() => event => {
|
|
57
57
|
if (!onLongPress) return;
|
|
58
|
-
vibration
|
|
58
|
+
vibration == null ? void 0 : vibration.vibrate();
|
|
59
59
|
analytics && analyticsID && logEvent(_analytics.ANALYTICS_EVENT_TYPE.LONG_PRESS, analyticsID, analytics, analyticsParams);
|
|
60
60
|
onLongPress(event);
|
|
61
61
|
}, [analytics, analyticsID, analyticsParams, onLongPress, vibration]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["hitSlop","left","right","bottom","top","logEvent","eventName","analyticsID","analytics","analyticsParams","id","Touchable","props","templateContext","useTemplateContext","theme","vibration","onPress","onLongPress","isWithoutFeedback","isHighlight","activeOpacity","disabled","handlePress","useMemo","event","vibrate","ANALYTICS_EVENT_TYPE","PRESS","handleLongPress","LONG_PRESS","colors","gray","light"],"sources":["../../../src/hoc/touchable/index.native.tsx"],"sourcesContent":["import {\n TouchableOpacity,\n TouchableHighlight,\n ViewStyle,\n LayoutChangeEvent,\n NativeSyntheticEvent,\n GestureResponderEvent,\n TargetedEvent\n} from 'react-native';\n\nimport React, {useMemo} from 'react';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {ANALYTICS_EVENT_TYPE, Analytics, AnalyticsEventParams} from '../../variables/analytics';\nimport {Vibration} from '../../variables/vibration';\n\nconst hitSlop = {\n left: 12,\n right: 12,\n bottom: 12,\n top: 12\n};\n\nexport type Props = {\n accessibilityLabel?: string;\n accessible?: boolean;\n children?: React.ReactNode;\n delayLongPress?: number;\n delayPressIn?: number;\n delayPressOut?: number;\n disabled?: boolean;\n focusable?: boolean;\n onBlur?: (event: NativeSyntheticEvent<TargetedEvent>) => void;\n onFocus?: (event: NativeSyntheticEvent<TargetedEvent>) => void;\n onLayout?: (event: LayoutChangeEvent) => void;\n onLongPress?: (event: GestureResponderEvent) => void;\n onPress?: (event: GestureResponderEvent) => void;\n onPressIn?: (event: GestureResponderEvent) => void;\n onPressOut?: (event: GestureResponderEvent) => void;\n testID?: string;\n isHighlight?: boolean;\n isWithoutFeedback?: boolean;\n // for TouchableOpacity\n activeOpacity?: number;\n style?: ViewStyle;\n // Analytics\n analytics?: Analytics;\n analyticsID?: string;\n analyticsParams?: AnalyticsEventParams;\n vibration?: Vibration;\n};\n\nconst logEvent = (\n eventName: string,\n analyticsID: string,\n analytics: Analytics,\n analyticsParams?: AnalyticsEventParams\n) => {\n analytics &&\n analytics.logEvent(eventName, {\n ...(analyticsParams || {}),\n id: analyticsID\n });\n};\n\nconst Touchable = (props: Props) => {\n const templateContext = useTemplateContext();\n\n const {theme, vibration, analytics} = templateContext;\n\n const {\n analyticsID,\n analyticsParams,\n onPress,\n onLongPress,\n isWithoutFeedback,\n isHighlight,\n activeOpacity,\n disabled\n } = props;\n\n const handlePress = useMemo(\n () => (event: GestureResponderEvent) => {\n if (!onPress) return;\n\n vibration?.vibrate();\n\n analytics &&\n analyticsID &&\n logEvent(ANALYTICS_EVENT_TYPE.PRESS, analyticsID, analytics, analyticsParams);\n onPress(event);\n },\n [analytics, analyticsID, analyticsParams, onPress, vibration]\n );\n\n const handleLongPress = useMemo(\n () => (event: GestureResponderEvent) => {\n if (!onLongPress) return;\n\n vibration?.vibrate();\n\n analytics &&\n analyticsID &&\n logEvent(ANALYTICS_EVENT_TYPE.LONG_PRESS, analyticsID, analytics, analyticsParams);\n onLongPress(event);\n },\n [analytics, analyticsID, analyticsParams, onLongPress, vibration]\n );\n\n if (isHighlight) {\n return (\n <TouchableHighlight\n {...props}\n hitSlop={hitSlop}\n underlayColor={theme.colors.gray.light}\n onPress={handlePress}\n onLongPress={handleLongPress}\n activeOpacity={activeOpacity || (disabled ? 1 : 0.85)}\n />\n );\n }\n\n return (\n <TouchableOpacity\n {...props}\n hitSlop={hitSlop}\n onPress={handlePress}\n onLongPress={handleLongPress}\n activeOpacity={(isWithoutFeedback && 1) || activeOpacity || (disabled ? 1 : 0.2)}\n />\n );\n};\n\nexport default Touchable;\n"],"mappings":";;;;;AAAA;;AAUA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,OAAO,GAAG;EACdC,IAAI,EAAE,EADQ;EAEdC,KAAK,EAAE,EAFO;EAGdC,MAAM,EAAE,EAHM;EAIdC,GAAG,EAAE;AAJS,CAAhB;;AAoCA,MAAMC,QAAQ,GAAG,CACfC,SADe,EAEfC,WAFe,EAGfC,SAHe,EAIfC,eAJe,KAKZ;EACHD,SAAS,IACPA,SAAS,CAACH,QAAV,CAAmBC,SAAnB,eACMG,eAAe,IAAI,EADzB;IAEEC,EAAE,EAAEH;EAFN,GADF;AAKD,CAXD;;AAaA,MAAMI,SAAS,GAAIC,KAAD,IAAkB;EAClC,MAAMC,eAAe,GAAG,IAAAC,mCAAA,GAAxB;EAEA,MAAM;IAACC,KAAD;IAAQC,SAAR;IAAmBR;EAAnB,IAAgCK,eAAtC;EAEA,MAAM;IACJN,WADI;IAEJE,eAFI;IAGJQ,OAHI;IAIJC,WAJI;IAKJC,iBALI;IAMJC,WANI;IAOJC,aAPI;IAQJC;EARI,IASFV,KATJ;EAWA,MAAMW,WAAW,GAAG,IAAAC,cAAA,EAClB,MAAOC,KAAD,IAAkC;IACtC,IAAI,CAACR,OAAL,EAAc;IAEdD,SAAS,
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["hitSlop","left","right","bottom","top","logEvent","eventName","analyticsID","analytics","analyticsParams","id","Touchable","props","templateContext","useTemplateContext","theme","vibration","onPress","onLongPress","isWithoutFeedback","isHighlight","activeOpacity","disabled","handlePress","useMemo","event","vibrate","ANALYTICS_EVENT_TYPE","PRESS","handleLongPress","LONG_PRESS","colors","gray","light"],"sources":["../../../src/hoc/touchable/index.native.tsx"],"sourcesContent":["import {\n TouchableOpacity,\n TouchableHighlight,\n ViewStyle,\n LayoutChangeEvent,\n NativeSyntheticEvent,\n GestureResponderEvent,\n TargetedEvent\n} from 'react-native';\n\nimport React, {useMemo} from 'react';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {ANALYTICS_EVENT_TYPE, Analytics, AnalyticsEventParams} from '../../variables/analytics';\nimport {Vibration} from '../../variables/vibration';\n\nconst hitSlop = {\n left: 12,\n right: 12,\n bottom: 12,\n top: 12\n};\n\nexport type Props = {\n accessibilityLabel?: string;\n accessible?: boolean;\n children?: React.ReactNode;\n delayLongPress?: number;\n delayPressIn?: number;\n delayPressOut?: number;\n disabled?: boolean;\n focusable?: boolean;\n onBlur?: (event: NativeSyntheticEvent<TargetedEvent>) => void;\n onFocus?: (event: NativeSyntheticEvent<TargetedEvent>) => void;\n onLayout?: (event: LayoutChangeEvent) => void;\n onLongPress?: (event: GestureResponderEvent) => void;\n onPress?: (event: GestureResponderEvent) => void;\n onPressIn?: (event: GestureResponderEvent) => void;\n onPressOut?: (event: GestureResponderEvent) => void;\n testID?: string;\n isHighlight?: boolean;\n isWithoutFeedback?: boolean;\n // for TouchableOpacity\n activeOpacity?: number;\n style?: ViewStyle;\n // Analytics\n analytics?: Analytics;\n analyticsID?: string;\n analyticsParams?: AnalyticsEventParams;\n vibration?: Vibration;\n};\n\nconst logEvent = (\n eventName: string,\n analyticsID: string,\n analytics: Analytics,\n analyticsParams?: AnalyticsEventParams\n) => {\n analytics &&\n analytics.logEvent(eventName, {\n ...(analyticsParams || {}),\n id: analyticsID\n });\n};\n\nconst Touchable = (props: Props) => {\n const templateContext = useTemplateContext();\n\n const {theme, vibration, analytics} = templateContext;\n\n const {\n analyticsID,\n analyticsParams,\n onPress,\n onLongPress,\n isWithoutFeedback,\n isHighlight,\n activeOpacity,\n disabled\n } = props;\n\n const handlePress = useMemo(\n () => (event: GestureResponderEvent) => {\n if (!onPress) return;\n\n vibration?.vibrate();\n\n analytics &&\n analyticsID &&\n logEvent(ANALYTICS_EVENT_TYPE.PRESS, analyticsID, analytics, analyticsParams);\n onPress(event);\n },\n [analytics, analyticsID, analyticsParams, onPress, vibration]\n );\n\n const handleLongPress = useMemo(\n () => (event: GestureResponderEvent) => {\n if (!onLongPress) return;\n\n vibration?.vibrate();\n\n analytics &&\n analyticsID &&\n logEvent(ANALYTICS_EVENT_TYPE.LONG_PRESS, analyticsID, analytics, analyticsParams);\n onLongPress(event);\n },\n [analytics, analyticsID, analyticsParams, onLongPress, vibration]\n );\n\n if (isHighlight) {\n return (\n <TouchableHighlight\n {...props}\n hitSlop={hitSlop}\n underlayColor={theme.colors.gray.light}\n onPress={handlePress}\n onLongPress={handleLongPress}\n activeOpacity={activeOpacity || (disabled ? 1 : 0.85)}\n />\n );\n }\n\n return (\n <TouchableOpacity\n {...props}\n hitSlop={hitSlop}\n onPress={handlePress}\n onLongPress={handleLongPress}\n activeOpacity={(isWithoutFeedback && 1) || activeOpacity || (disabled ? 1 : 0.2)}\n />\n );\n};\n\nexport default Touchable;\n"],"mappings":";;;;;AAAA;;AAUA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,OAAO,GAAG;EACdC,IAAI,EAAE,EADQ;EAEdC,KAAK,EAAE,EAFO;EAGdC,MAAM,EAAE,EAHM;EAIdC,GAAG,EAAE;AAJS,CAAhB;;AAoCA,MAAMC,QAAQ,GAAG,CACfC,SADe,EAEfC,WAFe,EAGfC,SAHe,EAIfC,eAJe,KAKZ;EACHD,SAAS,IACPA,SAAS,CAACH,QAAV,CAAmBC,SAAnB,eACMG,eAAe,IAAI,EADzB;IAEEC,EAAE,EAAEH;EAFN,GADF;AAKD,CAXD;;AAaA,MAAMI,SAAS,GAAIC,KAAD,IAAkB;EAClC,MAAMC,eAAe,GAAG,IAAAC,mCAAA,GAAxB;EAEA,MAAM;IAACC,KAAD;IAAQC,SAAR;IAAmBR;EAAnB,IAAgCK,eAAtC;EAEA,MAAM;IACJN,WADI;IAEJE,eAFI;IAGJQ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EZ,OAFX;IAGE,OAAO,EAAEuB,WAHX;IAIE,WAAW,EAAEM,eAJf;IAKE,aAAa,EAAGV,iBAAiB,IAAI,CAAtB,IAA4BE,aAA5B,KAA8CC,QAAQ,GAAG,CAAH,GAAO,GAA7D;EALjB,GADF;AASD,CAlED;;eAoEeX,S"}
|
|
@@ -206,10 +206,12 @@ class CardsList extends _react.default.PureComponent {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
setCardsWrapper(element) {
|
|
209
|
+
var _this$cardsWrapper, _this$cardsWrapper2;
|
|
210
|
+
|
|
209
211
|
this.cardsWrapper = element;
|
|
210
212
|
this.setState({
|
|
211
|
-
scrollLeft: this.cardsWrapper
|
|
212
|
-
offsetWidth: this.cardsWrapper
|
|
213
|
+
scrollLeft: (_this$cardsWrapper = this.cardsWrapper) == null ? void 0 : _this$cardsWrapper.scrollLeft,
|
|
214
|
+
offsetWidth: (_this$cardsWrapper2 = this.cardsWrapper) == null ? void 0 : _this$cardsWrapper2.offsetWidth
|
|
213
215
|
});
|
|
214
216
|
}
|
|
215
217
|
|
|
@@ -222,7 +224,9 @@ class CardsList extends _react.default.PureComponent {
|
|
|
222
224
|
}
|
|
223
225
|
|
|
224
226
|
handleScroll() {
|
|
225
|
-
|
|
227
|
+
var _this$cardsWrapper3;
|
|
228
|
+
|
|
229
|
+
const scrollLeft = (_this$cardsWrapper3 = this.cardsWrapper) == null ? void 0 : _this$cardsWrapper3.scrollLeft;
|
|
226
230
|
this.setState({
|
|
227
231
|
scrollLeft
|
|
228
232
|
});
|