@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
|
@@ -24,11 +24,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
24
24
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
25
|
|
|
26
26
|
const Html = props => {
|
|
27
|
-
const [disableBaseFontStyleColor, setDisableBaseFontStyleColor] = (0, _react.useState)(false);
|
|
28
27
|
const templateContext = (0, _templateContext.useTemplateContext)();
|
|
29
28
|
const {
|
|
30
|
-
theme
|
|
31
|
-
vibration
|
|
29
|
+
theme
|
|
32
30
|
} = templateContext;
|
|
33
31
|
const {
|
|
34
32
|
children,
|
|
@@ -40,10 +38,7 @@ const Html = props => {
|
|
|
40
38
|
anchorTextColor = _theme.HTML_ANCHOR_TEXT_COLOR,
|
|
41
39
|
isTextCentered,
|
|
42
40
|
numberOfLines
|
|
43
|
-
} = props;
|
|
44
|
-
const handleLinkPress = (0, _react.useMemo)(() => url => {
|
|
45
|
-
vibration?.vibrate();
|
|
46
|
-
}, [vibration]); // Don't use StyleSheet there, it's not a react style
|
|
41
|
+
} = props; // Don't use StyleSheet there, it's not a react style
|
|
47
42
|
|
|
48
43
|
const styles = {
|
|
49
44
|
p: {
|
|
@@ -103,10 +98,11 @@ const Html = props => {
|
|
|
103
98
|
}
|
|
104
99
|
}
|
|
105
100
|
|
|
101
|
+
const SpanRenderer = (0, _react.useCallback)((htmlAttribs, _children) => /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
102
|
+
numberOfLines: numberOfLines
|
|
103
|
+
}, _children), [numberOfLines]);
|
|
106
104
|
const renderers = {
|
|
107
|
-
span:
|
|
108
|
-
numberOfLines: numberOfLines
|
|
109
|
-
}, _children)
|
|
105
|
+
span: SpanRenderer
|
|
110
106
|
};
|
|
111
107
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
112
108
|
testID: testID,
|
|
@@ -122,9 +118,7 @@ const Html = props => {
|
|
|
122
118
|
},
|
|
123
119
|
tagsStyles: tagsStyles // @ts-expect-error TS2322
|
|
124
120
|
,
|
|
125
|
-
baseFontStyle:
|
|
126
|
-
color: disableBaseFontStyleColor ? null : baseFontStyle.color
|
|
127
|
-
}),
|
|
121
|
+
baseFontStyle: baseFontStyle,
|
|
128
122
|
renderers: renderers // this is exceptionally for the onboarding course
|
|
129
123
|
// is the only course that has a gif in the context but the img tag
|
|
130
124
|
// 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":["Html","props","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["Html","props","templateContext","useTemplateContext","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","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-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aC;EAAzD,EAAjB;;EACA,IAAI/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;EAOA,MAAMqC,SAAS,GAAG;IAChBC,IAAI,EAAEL;EADU,CAAlB;EAIA,oBACE,6BAAC,iBAAD;IAAM,MAAM,EAAErC,MAAd;IAAsB,KAAK,EAAEH;EAA7B,gBACE,6BAAC,8BAAD,CACE;EACA;EACA;EACA;EAJF;IAKE,MAAM,EAAE;MACN;MACA8C,IAAI,EAAExC,cAAc,GACf,MAAKR,QAAS,MADC,GAEhBS,aAAa,GACZ,SAAQT,QAAS,SADL,GAEZ,GAAEA,QAAS;IANV,CALV;IAaE,UAAU,EAAEsB,UAbd,CAcE;IAdF;IAeE,aAAa,EAAEU,aAfjB;IAgBE,SAAS,EAAEc,SAhBb,CAiBE;IACA;IACA;IACA;IApBF;IAqBE,aAAa,EAAE,CAAC,OAAD,EAAU,QAAV,CArBjB;IAsBE,MAAM,EAAC;EAtBT,EADF,CADF;AA4BD,CAzGD;;eA2GenD,I"}
|
|
@@ -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":["styles","StyleSheet","create","image","width","height","gradient","flex","ImageBackground","source","gradientStyle","style","testID","props","uri","_width","_height","resizeMode","flatten","maxHeight","undefined","maxWidth","getResizedImage","getCleanUri","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":["styles","StyleSheet","create","image","width","height","gradient","flex","ImageBackground","source","gradientStyle","style","testID","props","uri","_width","_height","resizeMode","flatten","maxHeight","undefined","maxWidth","getResizedImage","getCleanUri","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;;AACA;;AAOA;;AAEA;;AACA;;;;;;;;;;;AAEA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,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,MAAMC,eAAe,GAAG,QAOX;EAAA,IAPY;IACvBC,MADuB;IAEvBH,QAFuB;IAGvBI,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;MAACV,KAAK,EAAEW,MAAR;MAAgBV,MAAM,EAAEW,OAAxB;MAAiCC;IAAjC,IAA+CJ,KAArD;;IACA,MAAM;MAACT,KAAD;MAAQC;IAAR,IAAkBJ,uBAAA,CAAWiB,OAAX,CAAmB,CAAC;MAACd,KAAK,EAAEW,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1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
declare type Skin = {
|
|
3
3
|
common: {
|
|
4
4
|
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"}
|
|
@@ -5,27 +5,26 @@ exports.useWebContext = exports.default = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
8
|
+
const _excluded = ["children"];
|
|
9
|
+
|
|
8
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
11
|
|
|
10
12
|
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; }
|
|
11
13
|
|
|
12
|
-
function
|
|
14
|
+
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; }
|
|
13
15
|
|
|
14
16
|
const Context = /*#__PURE__*/(0, _react.createContext)({
|
|
15
17
|
translate: key => key
|
|
16
18
|
});
|
|
17
19
|
|
|
18
|
-
const WebContext =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
skin,
|
|
25
|
-
translate
|
|
26
|
-
};
|
|
20
|
+
const WebContext = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
children
|
|
23
|
+
} = _ref,
|
|
24
|
+
value = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
25
|
+
|
|
27
26
|
return /*#__PURE__*/_react.default.createElement(Context.Provider, {
|
|
28
|
-
value:
|
|
27
|
+
value: value
|
|
29
28
|
}, children);
|
|
30
29
|
};
|
|
31
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-context.js","names":["Context","createContext","translate","key","WebContext","
|
|
1
|
+
{"version":3,"file":"web-context.js","names":["Context","createContext","translate","key","WebContext","children","value","useWebContext","context","useContext","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;;;;;;;;;;AAaA,MAAMA,OAAO,gBAAG,IAAAC,oBAAA,EAAc;EAC5BC,SAAS,EAAGC,GAAD,IAAiBA;AADA,CAAd,CAAhB;;AAQA,MAAMC,UAAU,GAAG,QAAiC;EAAA,IAAhC;IAACC;EAAD,CAAgC;EAAA,IAAlBC,KAAkB;;EAClD,oBAAO,6BAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,EAAEA;EAAzB,GAAiCD,QAAjC,CAAP;AACD,CAFD;;AAIO,MAAME,aAAa,GAAG,MAAwB;EACnD,MAAMC,OAAO,GAAG,IAAAC,iBAAA,EAAWT,OAAX,CAAhB;;EAEA,IAAI,CAACQ,OAAL,EAAc;IACZ,MAAM,IAAIE,KAAJ,CAAU,0EAAV,CAAN;EACD;;EAED,OAAOF,OAAP;AACD,CARM;;;eAUQJ,U"}
|
|
@@ -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":["createStyle","current","icon","backgroundColor","COLORS","positive","negative","gray","StyleSheet","create","step","width","height","opacity","marginHorizontal","alignItems","justifyContent","borderRadius","stepText","fontWeight","fontSize","Step","value","style","setStyle","useState","useEffect","_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":["createStyle","current","icon","backgroundColor","COLORS","positive","negative","gray","StyleSheet","create","step","width","height","opacity","marginHorizontal","alignItems","justifyContent","borderRadius","stepText","fontWeight","fontSize","Step","value","style","setStyle","useState","useEffect","_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;;AACA;;AACA;;AAIA;;;;;;AASA,MAAMA,WAAW,GAAG,CAACC,OAAD,EAAmBC,IAAnB,KAAyE;EAC3F,IAAIC,eAAJ;;EAEA,QAAQD,IAAR;IACE,KAAK,OAAL;MACEC,eAAe,GAAGC,cAAA,CAAOC,QAAzB;MACA;;IACF,KAAK,OAAL;MACEF,eAAe,GAAGC,cAAA,CAAOE,QAAzB;MACA;;IACF,KAAK,WAAL;IACA;MACEH,eAAe,GAAGC,cAAA,CAAOG,IAAzB;EATJ;;EAYA,OAAOC,uBAAA,CAAWC,MAAX,CAAkB;IACvBC,IAAI,EAAE;MACJC,KAAK,EAAEV,OAAO,GAAG,EAAH,GAAQ,EADlB;MAEJW,MAAM,EAAEX,OAAO,GAAG,EAAH,GAAQ,EAFnB;MAGJY,OAAO,EAAEZ,OAAO,GAAG,CAAH,GAAO,GAHnB;MAIJa,gBAAgB,EAAE,CAJd;MAKJX,eALI;MAMJY,UAAU,EAAE,QANR;MAOJC,cAAc,EAAE,QAPZ;MAQJC,YAAY,EAAE;IARV,CADiB;IAWvBC,QAAQ,EAAE;MACRC,UAAU,EAAE,KADJ;MAERC,QAAQ,EAAEnB,OAAO,GAAG,EAAH,GAAQ;IAFjB,CAXa;IAevBC,IAAI,EAAE;MACJS,KAAK,EAAEV,OAAO,GAAG,EAAH,GAAQ,EADlB;MAEJW,MAAM,EAAEX,OAAO,GAAG,EAAH,GAAQ;IAFnB;EAfiB,CAAlB,CAAP;AAoBD,CAnCD;;AAqCA,MAAMoB,IAAI,GAAG,CAAC;EAACC,KAAD;EAAQpB,IAAR;EAAcD;AAAd,CAAD,KAAiD;EAC5D,MAAM,CAACsB,KAAD,EAAQC,QAAR,IAAoB,IAAAC,eAAA,EAAgC,IAAhC,CAA1B;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACd,MAAMC,MAAM,GAAG3B,WAAW,CAACC,OAAD,EAAUC,IAAV,CAA1B;;IACAsB,QAAQ,CAACG,MAAD,CAAR;EACD,CAHD,EAGG,CAAC1B,OAAD,EAAUC,IAAV,CAHH;;EAKA,IAAI,CAACqB,KAAL,EAAY;IACV,OAAO,IAAP;EACD;;EAED,IAAIK,KAAJ;;EAEA,QAAQ1B,IAAR;IACE,KAAK,OAAL;MACE0B,KAAK,gBAAG,6BAAC,2CAAD;QAAW,KAAK,EAAEL,KAAK,CAACrB,IAAxB;QAA8B,KAAK,EAAC;MAApC,EAAR;MACA;;IACF,KAAK,OAAL;MACE0B,KAAK,gBAAG,6BAAC,+BAAD;QAAW,KAAK,EAAEL,KAAK,CAACrB,IAAxB;QAA8B,KAAK,EAAC;MAApC,EAAR;MACA;;IACF,KAAK,WAAL;IACA;MACE0B,KAAK,gBAAG,6BAAC,iBAAD;QAAM,KAAK,EAAEL,KAAK,CAACL;MAAnB,GAA8BI,KAA9B,CAAR;EATJ;;EAYA,oBAAO,6BAAC,iBAAD;IAAM,KAAK,EAAEC,KAAK,CAACb;EAAnB,GAA0BkB,KAA1B,CAAP;AACD,CA3BD;;eA6BeP,I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["ICON_WIDTH","createStyleSheet","theme","StyleSheet","create","container","alignItems","flexDirection","text","flex","color","colors","gray","medium","textAlign","logEvent","eventName","analyticsID","analytics","questionType","id","Select","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_stylesheet","onBlur","onFocus","onChange","values","placeholder","value","style","textStyle","isFocused","isDisabled","testID","handleFocus","useCallback","ANALYTICS_EVENT_TYPE","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":["ICON_WIDTH","createStyleSheet","theme","StyleSheet","create","container","alignItems","flexDirection","text","flex","color","colors","gray","medium","textAlign","logEvent","eventName","analyticsID","analytics","questionType","id","Select","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_stylesheet","onBlur","onFocus","onChange","values","placeholder","value","style","textStyle","isFocused","isDisabled","testID","handleFocus","useCallback","ANALYTICS_EVENT_TYPE","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;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AA8BA,MAAMA,UAAU,GAAG,EAAnB;;AAEA,MAAMC,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,SAA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BAAD;IAAM,KAAK,EAAE,CAACf,UAAU,CAACpB,SAAZ,EAAuB+B,KAAvB;EAAb,gBACE,6BAAC,eAAD;IAAM,KAAK,EAAEiB;EAAb,GAA0B7C,IAA1B,CADF,eAEE,6BAAC,eAAD;IAAO,IAAI,EAAC;EAAZ,EAFF,eAGE,6BAAC,6CAAD;IACE,KAAK,EAAEE,KAAK,IAAIR,KAAK,CAACS,MAAN,CAAaC,IAAb,CAAkB2C,IADpC;IAEE,MAAM,EAAEvD,UAFV;IAGE,KAAK,EAAEA;EAHT,EAHF,CANF,CADF,eAiBE,6BAAC,yBAAD;IACE,SAAS,EAAEsC,SADb;IAEE,eAAe,EAAEO,UAFnB;IAGE,eAAe,EAAEA,UAHnB;IAIE,MAAM,EAAEL;EAJV,gBAME,6BAAC,eAAD;IACE,KAAK,EAAEL,KADT;IAEE,MAAM,EAAEF,MAFV;IAGE,QAAQ,EAAEc,YAHZ;IAIE,OAAO,EAAEF,UAJX;IAKE,MAAM,EAAG,GAAEL,MAAO;EALpB,EANF,CAjBF,CADF;AAkCD,CAlGD;;eAoGenB,M"}
|
|
@@ -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":["HEADER_HEIGHT","createStyleSheet","theme","StyleSheet","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","useTemplateContext","styleSheet","setStylesheet","useState","children","headerBackgroundColor","iconBackgroundColor","renderIcon","contentStyle","onClose","testID","useEffect","_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":["HEADER_HEIGHT","createStyleSheet","theme","StyleSheet","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","useTemplateContext","styleSheet","setStylesheet","useState","children","headerBackgroundColor","iconBackgroundColor","renderIcon","contentStyle","onClose","testID","useEffect","_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;;AACA;;AACA;;AACA;;;;;;;;AAaO,MAAMA,aAAa,G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GC,UADH,CADF,CADS,GAMP,IAhBN,eAiBE,6BAAC,iBAAD;IAAM,KAAK,EAAEM;EAAb,GAA6BT,QAA7B,CAjBF,CADF;AAqBD,CA/CD;;eAiDeP,K"}
|
|
@@ -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"}
|
|
@@ -38,10 +38,10 @@ const keyExtractor = (item, index) => {
|
|
|
38
38
|
return `modal-select-item-${index + 1}`;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
const createRenderItem = (value, testID, onChange) => ({
|
|
41
|
+
const createRenderItem = (value, testID, onChange) => function Item({
|
|
42
42
|
item,
|
|
43
43
|
index
|
|
44
|
-
})
|
|
44
|
+
}) {
|
|
45
45
|
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
46
46
|
const handleChange = _value => () => onChange(_value);
|
|
47
47
|
|
|
@@ -52,7 +52,7 @@ const createRenderItem = (value, testID, onChange) => ({
|
|
|
52
52
|
}, item.text);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
const createSeparator = styleSheet => ()
|
|
55
|
+
const createSeparator = styleSheet => function Separator() {
|
|
56
56
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
57
57
|
style: styleSheet?.separator
|
|
58
58
|
});
|
|
@@ -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","handleChange","_value","text","createSeparator","styleSheet","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\nconst createRenderItem = (value: string, testID:
|
|
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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AEA,IAAAO,gBAAA,EAAU,MAAM;IACd,MAAMC,WAAW,GAAGpC,gBAAgB,CAACC,KAAD,CAApC;;IACA8B,aAAa,CAACK,WAAD,CAAb;EACD,CAHD,EAGG,CAACnC,KAAD,CAHH;EAKA,MAAMoC,UAAU,GAAG,IAAAC,cAAA,EACjB,MAAMtB,gBAAgB,CAACC,KAAD,EAAQC,MAAR,EAAgBC,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,UAAU,EAAErB,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,UAAU,EAAEd,IANrB;IAOE,MAAM,EAAG,GAAEO,MAAO;EAPpB,EADF,CADF;AAaD,CAtCD;;eAwCeS,W"}
|
|
@@ -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"}
|
|
@@ -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';\n\nexport type Props = {\n isSelected?: boolean;\n children: string;\n onPress?: (event: GestureResponderEvent) =>
|
|
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,KACvBC,uBAAA,CAAWC,MAAX,CAAk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CA1BD;;eA4BeT,e"}
|
|
@@ -12,11 +12,11 @@ export declare type Props = {
|
|
|
12
12
|
focusable?: boolean;
|
|
13
13
|
onBlur?: (event: NativeSyntheticEvent<TargetedEvent>) => void;
|
|
14
14
|
onFocus?: (event: NativeSyntheticEvent<TargetedEvent>) => void;
|
|
15
|
-
onLayout?: (event: LayoutChangeEvent) =>
|
|
16
|
-
onLongPress?: (event: GestureResponderEvent) =>
|
|
17
|
-
onPress?: (event: GestureResponderEvent) =>
|
|
18
|
-
onPressIn?: (event: GestureResponderEvent) =>
|
|
19
|
-
onPressOut?: (event: GestureResponderEvent) =>
|
|
15
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
16
|
+
onLongPress?: (event: GestureResponderEvent) => void;
|
|
17
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
18
|
+
onPressIn?: (event: GestureResponderEvent) => void;
|
|
19
|
+
onPressOut?: (event: GestureResponderEvent) => void;
|
|
20
20
|
testID?: string;
|
|
21
21
|
isHighlight?: boolean;
|
|
22
22
|
isWithoutFeedback?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/hoc/touchable/index.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACd,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAgB,MAAM,OAAO,CAAC;AAErC,OAAO,EAAuB,SAAS,EAAE,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAChG,OAAO,EAAC,SAAS,EAAC,MAAM,2BAA2B,CAAC;AASpD,oBAAY,KAAK,GAAG;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CA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C,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACrD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACnD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAeF,QAAA,MAAM,SAAS,UAAW,KAAK,gBAkE9B,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -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 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) =>
|
|
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 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;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A+CC,SAA/C,EAA0DC,eAA1D,CAFV;IAGAS,WAAW,CAACO,KAAD,CAAX;EACD,CAVqB,EAWtB,CAACjB,SAAD,EAAYD,WAAZ,EAAyBE,eAAzB,EAA0CS,WAA1C,EAAuDF,SAAvD,CAXsB,CAAxB;;EAcA,IAAII,WAAJ,EAAiB;IACf,oBACE,6BAAC,+BAAD,eACMR,KADN;MAEE,OAAO,EAAEZ,OAFX;MAGE,aAAa,EAAEe,KAAK,CAACgB,MAAN,CAAaC,IAAb,CAAkBC,KAHnC;MAIE,OAAO,EAAEV,WAJX;MAKE,WAAW,EAAEM,eALf;MAME,aAAa,EAAER,aAAa,KAAKC,QAAQ,GAAG,CAAH,GAAO,IAApB;IAN9B,GADF;EAUD;;EAED,oBACE,6BAAC,6BAAD,eACMV,KADN;IAEE,OAAO,EAAEZ,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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import { Media } from '../questions/types';
|
|
2
3
|
export declare const TYPE_IMAGE = "img";
|
|
3
4
|
export declare const TYPE_VIDEO = "video";
|
|
4
5
|
export declare const TYPE_AUDIO = "audio";
|
|
@@ -137,24 +138,7 @@ export declare type AnswerProps = {
|
|
|
137
138
|
title?: string;
|
|
138
139
|
};
|
|
139
140
|
help: string;
|
|
140
|
-
media?:
|
|
141
|
-
type: 'img' | 'audio' | 'video';
|
|
142
|
-
url?: string;
|
|
143
|
-
mediaUrl?: string;
|
|
144
|
-
mimeType?: string;
|
|
145
|
-
poster?: string;
|
|
146
|
-
videoId?: string;
|
|
147
|
-
_id?: string;
|
|
148
|
-
description?: string;
|
|
149
|
-
subtitles?: string[];
|
|
150
|
-
posters?: string[];
|
|
151
|
-
src?: string[];
|
|
152
|
-
onClick?: () => void;
|
|
153
|
-
onPlay?: () => void;
|
|
154
|
-
onPause?: () => void;
|
|
155
|
-
onResume?: () => void;
|
|
156
|
-
onEnded?: () => void;
|
|
157
|
-
};
|
|
141
|
+
media?: Media;
|
|
158
142
|
};
|
|
159
143
|
export default propTypes;
|
|
160
144
|
//# sourceMappingURL=prop-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAGzC,eAAO,MAAM,UAAU,QAAQ,CAAC;AAChC,eAAO,MAAM,UAAU,UAAU,CAAC;AAClC,eAAO,MAAM,UAAU,UAAU,CAAC;AAmBlC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAE9B,CAAC;AAqBF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAed,CAAC;AAEF,aAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,MAAM,GAAG;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,KAAK,EAAE;QACL,IAAI,EAAE,SAAS,GAAG,KAAK,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;QACzF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;QAC5C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["TYPE_IMAGE","TYPE_VIDEO","TYPE_AUDIO","isType","name","PropTypes","oneOf","videoPropType","shape","VideoPlayerPropTypes","type","isRequired","imgPropType","url","string","audioPropType","mediaUrl","MediaViewPropTypes","media","oneOfType","SelectOptionsPropTypes","selected","bool","validOption","value","AnswerPropTypes","title","onClick","func","onChange","image","options","arrayOf","propTypes","model","answer","help"],"sources":["../../../src/molecule/answer/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport VideoPlayerPropTypes from '../video-player/prop-types';\n\nexport const TYPE_IMAGE = 'img';\nexport const TYPE_VIDEO = 'video';\nexport const TYPE_AUDIO = 'audio';\n\nconst isType = (name: string) => PropTypes.oneOf([name]);\n\nconst videoPropType = PropTypes.shape({\n ...VideoPlayerPropTypes,\n type: isType(TYPE_VIDEO).isRequired\n});\n\nconst imgPropType = PropTypes.shape({\n type: isType(TYPE_IMAGE).isRequired,\n url: PropTypes.string.isRequired\n});\n\nconst audioPropType = PropTypes.shape({\n type: isType(TYPE_AUDIO).isRequired,\n mediaUrl: PropTypes.string.isRequired\n});\n\nexport const MediaViewPropTypes = {\n media: PropTypes.oneOfType([videoPropType, imgPropType, audioPropType])\n};\n\nconst SelectOptionsPropTypes = PropTypes.shape({\n name: PropTypes.string,\n selected: PropTypes.bool,\n validOption: PropTypes.bool,\n value: PropTypes.string\n});\n\nconst AnswerPropTypes = PropTypes.shape({\n title: PropTypes.string.isRequired,\n 'aria-label': PropTypes.string,\n onClick: PropTypes.func,\n onChange: PropTypes.func,\n selected: PropTypes.bool,\n image: PropTypes.string,\n options: PropTypes.arrayOf(SelectOptionsPropTypes),\n type: PropTypes.oneOf(['text', 'select']),\n name: PropTypes.string\n});\n\nconst propTypes = {\n model: PropTypes.shape({\n type: PropTypes.oneOf([\n 'qcmDrag',\n 'qcm',\n 'qcmGraphic',\n 'freeText',\n 'dropDown',\n 'slider',\n 'template'\n ]).isRequired,\n answer: PropTypes.arrayOf(AnswerPropTypes)\n }).isRequired,\n help: PropTypes.string,\n media: MediaViewPropTypes.media\n};\n\ntype SelectOptions = {\n name: string;\n selected: boolean;\n validOption: boolean;\n value: string;\n};\n\nexport type Answer = {\n title?: string;\n 'aria-label'?: string;\n onClick?: () => void;\n onChange?: (value: string) => void;\n selected?: boolean;\n image?: string;\n options?: SelectOptions[];\n type?: 'text' | 'select';\n name?: string;\n};\n\nexport type AnswerProps = {\n model: {\n type: 'qcmDrag' | 'qcm' | 'qcmGraphic' | 'freeText' | 'dropDown' | 'slider' | 'template';\n answers?: Answer[];\n template?: string;\n onChange?: (value: string | number) => void;\n onSliderChange?: (value: number) => void;\n minLabel?: string;\n maxLabel?: string;\n title?: string;\n };\n help: string;\n media?:
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["TYPE_IMAGE","TYPE_VIDEO","TYPE_AUDIO","isType","name","PropTypes","oneOf","videoPropType","shape","VideoPlayerPropTypes","type","isRequired","imgPropType","url","string","audioPropType","mediaUrl","MediaViewPropTypes","media","oneOfType","SelectOptionsPropTypes","selected","bool","validOption","value","AnswerPropTypes","title","onClick","func","onChange","image","options","arrayOf","propTypes","model","answer","help"],"sources":["../../../src/molecule/answer/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {Media} from '../questions/types';\nimport VideoPlayerPropTypes from '../video-player/prop-types';\n\nexport const TYPE_IMAGE = 'img';\nexport const TYPE_VIDEO = 'video';\nexport const TYPE_AUDIO = 'audio';\n\nconst isType = (name: string) => PropTypes.oneOf([name]);\n\nconst videoPropType = PropTypes.shape({\n ...VideoPlayerPropTypes,\n type: isType(TYPE_VIDEO).isRequired\n});\n\nconst imgPropType = PropTypes.shape({\n type: isType(TYPE_IMAGE).isRequired,\n url: PropTypes.string.isRequired\n});\n\nconst audioPropType = PropTypes.shape({\n type: isType(TYPE_AUDIO).isRequired,\n mediaUrl: PropTypes.string.isRequired\n});\n\nexport const MediaViewPropTypes = {\n media: PropTypes.oneOfType([videoPropType, imgPropType, audioPropType])\n};\n\nconst SelectOptionsPropTypes = PropTypes.shape({\n name: PropTypes.string,\n selected: PropTypes.bool,\n validOption: PropTypes.bool,\n value: PropTypes.string\n});\n\nconst AnswerPropTypes = PropTypes.shape({\n title: PropTypes.string.isRequired,\n 'aria-label': PropTypes.string,\n onClick: PropTypes.func,\n onChange: PropTypes.func,\n selected: PropTypes.bool,\n image: PropTypes.string,\n options: PropTypes.arrayOf(SelectOptionsPropTypes),\n type: PropTypes.oneOf(['text', 'select']),\n name: PropTypes.string\n});\n\nconst propTypes = {\n model: PropTypes.shape({\n type: PropTypes.oneOf([\n 'qcmDrag',\n 'qcm',\n 'qcmGraphic',\n 'freeText',\n 'dropDown',\n 'slider',\n 'template'\n ]).isRequired,\n answer: PropTypes.arrayOf(AnswerPropTypes)\n }).isRequired,\n help: PropTypes.string,\n media: MediaViewPropTypes.media\n};\n\ntype SelectOptions = {\n name: string;\n selected: boolean;\n validOption: boolean;\n value: string;\n};\n\nexport type Answer = {\n title?: string;\n 'aria-label'?: string;\n onClick?: () => void;\n onChange?: (value: string) => void;\n selected?: boolean;\n image?: string;\n options?: SelectOptions[];\n type?: 'text' | 'select';\n name?: string;\n};\n\nexport type AnswerProps = {\n model: {\n type: 'qcmDrag' | 'qcm' | 'qcmGraphic' | 'freeText' | 'dropDown' | 'slider' | 'template';\n answers?: Answer[];\n template?: string;\n onChange?: (value: string | number) => void;\n onSliderChange?: (value: number) => void;\n minLabel?: string;\n maxLabel?: string;\n title?: string;\n };\n help: string;\n\n media?: Media;\n};\n\nexport default propTypes;\n"],"mappings":";;;;;AAAA;;AAEA;;;;;;AAEO,MAAMA,UAAU,GAAG,KAAnB;;AACA,MAAMC,UAAU,GAAG,OAAnB;;AACA,MAAMC,UAAU,GAAG,OAAnB;;;AAEP,MAAMC,MAAM,GAAIC,IAAD,IAAkBC,kBAAA,CAAUC,KAAV,CAAgB,CAACF,IAAD,CAAhB,CAAjC;;AAEA,MAAMG,aAAa,GAAGF,kBAAA,CAAUG,KAAV,cACjBC,mBADiB;EAEpBC,IAAI,EAAEP,MAAM,CAACF,UAAD,CAAN,CAAmBU;AAFL,GAAtB;;AAKA,MAAMC,WAAW,GAAGP,kBAAA,CAAUG,KAAV,CAAgB;EAClCE,IAAI,EAAEP,MAAM,CAACH,UAAD,CAAN,CAAmBW,UADS;EAElCE,GAAG,EAAER,kBAAA,CAAUS,MAAV,CAAiBH;AAFY,CAAhB,CAApB;;AAKA,MAAMI,aAAa,GAAGV,kBAAA,CAAUG,KAAV,CAAgB;EACpCE,IAAI,EAAEP,MAAM,CAACD,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