@coorpacademy/components 10.22.4 → 10.22.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/es/atom/html/index.native.js +9 -16
  2. package/es/atom/html/index.native.js.map +1 -1
  3. package/es/atom/input-switch/index.js +43 -6
  4. package/es/atom/input-switch/index.js.map +1 -1
  5. package/es/atom/input-switch/style.css +56 -6
  6. package/es/atom/select-modal/index.native.js +6 -6
  7. package/es/atom/select-modal/index.native.js.map +1 -1
  8. package/es/atom/text/index.native.js +3 -1
  9. package/es/atom/text/index.native.js.map +1 -1
  10. package/es/hoc/modal/select/index.native.js +4 -3
  11. package/es/hoc/modal/select/index.native.js.map +1 -1
  12. package/es/molecule/answer/index.js +39 -32
  13. package/es/molecule/answer/index.js.map +1 -1
  14. package/es/molecule/cm-popin/index.js +101 -14
  15. package/es/molecule/cm-popin/index.js.map +1 -1
  16. package/es/molecule/cm-popin/style.css +153 -9
  17. package/es/molecule/questions/free-text/index.native.js +8 -8
  18. package/es/molecule/questions/free-text/index.native.js.map +1 -1
  19. package/es/molecule/questions/mobile/template/index.native.js +222 -0
  20. package/es/molecule/questions/mobile/template/index.native.js.map +1 -0
  21. package/es/template/app-review/template-context.js +1 -0
  22. package/es/template/app-review/template-context.js.map +1 -1
  23. package/es/template/common/dashboard/index.js +6 -3
  24. package/es/template/common/dashboard/index.js.map +1 -1
  25. package/es/types/app-review.d.js +2 -0
  26. package/es/types/app-review.d.js.map +1 -0
  27. package/es/types/translations.js +2 -0
  28. package/es/types/translations.js.map +1 -0
  29. package/es/util/parse-template-string.js +4 -2
  30. package/es/util/parse-template-string.js.map +1 -1
  31. package/es/variables/colors.css +1 -0
  32. package/lib/atom/html/index.native.js +8 -15
  33. package/lib/atom/html/index.native.js.map +1 -1
  34. package/lib/atom/input-switch/index.js +43 -6
  35. package/lib/atom/input-switch/index.js.map +1 -1
  36. package/lib/atom/input-switch/style.css +56 -6
  37. package/lib/atom/select-modal/index.native.js +5 -5
  38. package/lib/atom/select-modal/index.native.js.map +1 -1
  39. package/lib/atom/text/index.native.js +3 -1
  40. package/lib/atom/text/index.native.js.map +1 -1
  41. package/lib/hoc/modal/select/index.native.js +7 -5
  42. package/lib/hoc/modal/select/index.native.js.map +1 -1
  43. package/lib/molecule/answer/index.js +39 -32
  44. package/lib/molecule/answer/index.js.map +1 -1
  45. package/lib/molecule/cm-popin/index.js +102 -13
  46. package/lib/molecule/cm-popin/index.js.map +1 -1
  47. package/lib/molecule/cm-popin/style.css +153 -9
  48. package/lib/molecule/questions/free-text/index.native.js +7 -7
  49. package/lib/molecule/questions/free-text/index.native.js.map +1 -1
  50. package/lib/molecule/questions/mobile/template/index.native.js +243 -0
  51. package/lib/molecule/questions/mobile/template/index.native.js.map +1 -0
  52. package/lib/template/app-review/template-context.js +1 -0
  53. package/lib/template/app-review/template-context.js.map +1 -1
  54. package/lib/template/common/dashboard/index.js +7 -3
  55. package/lib/template/common/dashboard/index.js.map +1 -1
  56. package/lib/types/app-review.d.js +2 -0
  57. package/lib/types/app-review.d.js.map +1 -0
  58. package/lib/types/translations.js +2 -0
  59. package/lib/types/translations.js.map +1 -0
  60. package/lib/util/parse-template-string.js +4 -2
  61. package/lib/util/parse-template-string.js.map +1 -1
  62. package/lib/variables/colors.css +1 -0
  63. package/package.json +2 -2
@@ -15,6 +15,13 @@
15
15
  @value cm_grey_200 from colors;
16
16
  @value cm_blue_600 from colors;
17
17
  @value cm_grey_500 from colors;
18
+ @value cm_grey_700 from colors;
19
+ @value white from colors;
20
+ @value cm_blue_50 from colors;
21
+ @value breakpoints: '../../variables/breakpoints.css';
22
+ @value mobile from breakpoints;
23
+ @value tablet from breakpoints;
24
+ @value cm_grey_75 from colors;
18
25
 
19
26
  .background {
20
27
  top: 0px;
@@ -28,7 +35,7 @@
28
35
  box-sizing: border-box;
29
36
  overflow: hidden;
30
37
  display: flex;
31
- position:fixed;
38
+ position: fixed;
32
39
  z-index: 3;
33
40
  }
34
41
 
@@ -60,7 +67,6 @@
60
67
  justify-content: center;
61
68
  align-items: center;
62
69
  padding: 40px 40px 0px;
63
- position: absolute;
64
70
  background: xtraLightGrey;
65
71
  font-family: 'Gilroy';
66
72
  font-weight: 500;
@@ -72,10 +78,10 @@
72
78
  margin: 10px 0px;
73
79
  }
74
80
  @keyframes popup {
75
- 0%{
81
+ 0% {
76
82
  transform: scale(0);
77
83
  }
78
- 100%{
84
+ 100% {
79
85
  transform: scale(1);
80
86
  }
81
87
  }
@@ -85,7 +91,6 @@
85
91
  flex-direction: column;
86
92
  align-items: center;
87
93
  justify-content: center;
88
- width: 65%;
89
94
  }
90
95
 
91
96
  .content {
@@ -101,9 +106,9 @@
101
106
  }
102
107
 
103
108
  .buttonContainer {
104
- width: 100%;
105
- height: 80px;
109
+ min-height: 80px;
106
110
  display: flex;
111
+ width: 100%;
107
112
  align-items: center;
108
113
  justify-content: center;
109
114
  }
@@ -114,7 +119,7 @@
114
119
  }
115
120
 
116
121
  .largeButton {
117
- width: 338px;
122
+ width: 100%;
118
123
  padding: 8px;
119
124
  }
120
125
 
@@ -149,4 +154,143 @@
149
154
  display: flex;
150
155
  flex-direction: column;
151
156
  width: 100%;
152
- }
157
+ }
158
+
159
+ .cookieHeader {
160
+ width: 100%;
161
+ background-color: cm_grey_700;
162
+ padding: 16px 24px;
163
+ border-radius: 10px 10px 0px 0px;
164
+ display: flex;
165
+ align-items: center;
166
+ }
167
+
168
+ .popinCookie {
169
+ max-width: 550px;
170
+ flex-grow: 0;
171
+ margin: 16px;
172
+ border-radius: 10px;
173
+ background-color: cm_grey_50;
174
+ animation: popup 0.7s;
175
+ position: fixed;
176
+ bottom: 32px;
177
+ left: 32px;
178
+ z-index: 2;
179
+ }
180
+ .cookieTitle {
181
+ font-family: "Gilroy";
182
+ font-style: normal;
183
+ font-weight: 700;
184
+ font-size: 24px;
185
+ line-height: 32px;
186
+ color: white;
187
+ padding-left: 16px;
188
+ width: 60%;
189
+ }
190
+ .cookieIcon {
191
+ height: 20px;
192
+ width: 20px;
193
+ }
194
+ .cookieIconContainer {
195
+ width: 39px;
196
+ height: 39px;
197
+ border-radius: 8px;
198
+ background-color: cm_blue_50;
199
+ display: flex;
200
+ justify-content: center;
201
+ align-items: center;
202
+ }
203
+ .popinCookie .button {
204
+ width: 100%;
205
+ padding: 0px 8px 0px 0px
206
+ }
207
+ .popinCookie .button span {
208
+ margin: 0
209
+ }
210
+
211
+ .popinCookie .message {
212
+ padding: 24px 24px 40px 24px
213
+ }
214
+
215
+ .descriptionBtn {
216
+ font-family: "Gilroy";
217
+ font-weight: 500;
218
+ font-size: 16px;
219
+ line-height: 22px;
220
+ color: cm_grey_500;
221
+ font-style: normal;
222
+ white-space: pre-line;
223
+ margin-top: 24px;
224
+ width: calc(100% - 24px);
225
+ padding-left: 24px;
226
+ margin-bottom: 24px;
227
+ }
228
+
229
+
230
+ .firstBtnSwitchContainer {
231
+ height: 56px;
232
+ background-color: cm_grey_75;
233
+ width: 100%;
234
+ display: flex;
235
+ align-items: center;
236
+ }
237
+ .firstBtnSwitchContainer div:first-child {
238
+ margin-left: 9px;
239
+ }
240
+ .singleSwitchContainer div:first-child {
241
+ margin-left: 9px;
242
+ }
243
+
244
+ .lastBtnSwitchContainer {
245
+ composes: singleSwitchContainer;
246
+ margin-bottom: 28px;
247
+ }
248
+
249
+ .singleSwitchContainer {
250
+ width: 100%;
251
+ display: flex;
252
+ align-items: center;
253
+ width: 100%;
254
+ margin-top: 24px;
255
+ }
256
+ a {
257
+ color: cm_primary_blue;
258
+ text-decoration: none;
259
+ }
260
+
261
+ .popinCookie .buttonContainer {
262
+ min-height: 44px;
263
+ padding-bottom: 16px;
264
+ width: auto;
265
+ padding-left: 24px;
266
+ padding-right: 16px;
267
+ }
268
+ .popinCookie .largeButton {
269
+ padding: 0px 8px 0px 0px
270
+ }
271
+ @media tablet {
272
+ .popinCookie {
273
+ position: fixed;
274
+ bottom: 10px;
275
+ left: unset;
276
+ align-self: center;
277
+ max-height: calc(100vh - 50px);
278
+ overflow-x: hidden;
279
+ overflow-y: auto;
280
+ }
281
+ .popinCookie .button{
282
+ width: 100%;
283
+ padding: 0px 0px 8px 0px
284
+ }
285
+ .buttonContainer {
286
+ flex-wrap: wrap;
287
+ margin-top: 40px;
288
+ }
289
+ .popinCookie .largeButton {
290
+ padding: 8px 0px 0px 0px
291
+ }
292
+ .popinCookie .message {
293
+ padding: 24px 24px 0px 24px
294
+ }
295
+
296
+ }
@@ -51,23 +51,23 @@ const FreeText = props => {
51
51
  const [styleSheet, setStylesheet] = (0, _react.useState)(null);
52
52
  const {
53
53
  brandTheme,
54
- theme
54
+ theme,
55
+ translations
55
56
  } = templateContext;
56
57
  const PLACEHOLDER_COLOR = theme.colors.gray.medium; // ------------------------------------
57
58
 
58
59
  const {
59
60
  analytics,
60
61
  questionType,
61
- fullWitdh,
62
+ fullWitdh = false,
62
63
  testID,
63
64
  onChange,
64
65
  isDisabled,
65
- value,
66
- placeholder
66
+ value
67
67
  } = props; // ------------------------------------
68
68
 
69
- const handleFocus = (0, _react.useMemo)(() => analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType), [analytics, questionType]);
70
- const handleBlur = (0, _react.useMemo)(() => analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType), [analytics, questionType]); // ------------------------------------
69
+ const handleFocus = (0, _react.useCallback)(() => analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType), [analytics, questionType]);
70
+ const handleBlur = (0, _react.useCallback)(() => analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType), [analytics, questionType]); // ------------------------------------
71
71
 
72
72
  (0, _react.useEffect)(() => {
73
73
  const _stylesheet = createStyleSheet(brandTheme, theme);
@@ -86,7 +86,7 @@ const FreeText = props => {
86
86
  onFocus: handleFocus,
87
87
  onBlur: handleBlur,
88
88
  onChangeText: onChange,
89
- placeholder: placeholder,
89
+ placeholder: translations.typeHere,
90
90
  placeholderTextColor: PLACEHOLDER_COLOR,
91
91
  value: value,
92
92
  testID: testID,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/questions/free-text/index.native.tsx"],"names":["createStyleSheet","brandTheme","theme","StyleSheet","create","input","padding","spacing","tiny","borderWidth","borderColor","colors","gray","lightMedium","borderRadius","radius","common","backgroundColor","white","minWidth","text","primary","color","medium","fontWeight","bold","fontSize","regular","textAlign","spaced","paddingVertical","fullWitdh","width","logEvent","eventName","analytics","questionType","id","FreeText","props","templateContext","styleSheet","setStylesheet","PLACEHOLDER_COLOR","testID","onChange","isDisabled","value","placeholder","handleFocus","ANALYTICS_EVENT_TYPE","INPUT_FOCUS","handleBlur","INPUT_BLUR","_stylesheet"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAuCA,MAAMA,gBAAgB,GAAG,CAACC,UAAD,EAAaC,KAAb,KACvBC,wBAAWC,MAAX,CAAkB;AAChBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IADlB;AAELC,IAAAA,WAAW,EAAE,CAFR;AAGLC,IAAAA,WAAW,EAAER,KAAK,CAACS,MAAN,CAAaC,IAAb,CAAkBC,WAH1B;AAILC,IAAAA,YAAY,EAAEZ,KAAK,CAACa,MAAN,CAAaC,MAJtB;AAKLC,IAAAA,eAAe,EAAEf,KAAK,CAACS,MAAN,CAAaO,KALzB;AAMLC,IAAAA,QAAQ,EAAE;AANL,GADS;AAShBC,EAAAA,IAAI,EAAE;AACJV,IAAAA,WAAW,EAAET,UAAU,EAAEU,MAAZ,CAAmBU,OAD5B;AAEJC,IAAAA,KAAK,EAAErB,UAAU,EAAEU,MAAZ,CAAmBU,OAAnB,IAA8BnB,KAAK,CAACS,MAAN,CAAaC,IAAb,CAAkBW,MAFnD;AAGJC,IAAAA,UAAU,EAAEtB,KAAK,CA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SAAS,IAAIF,QAAQ,CAACiB,gCAAqBG,UAAtB,EAAkClB,SAAlC,EAA6CC,YAA7C,CADV,EAEjB,CAACD,SAAD,EAAYC,YAAZ,CAFiB,CAAnB,CA1BiC,CA+BjC;;AAEA,wBAAU,MAAM;AACd,UAAMkB,WAAW,GAAGtD,gBAAgB,CAACC,UAAD,EAAaC,KAAb,CAApC;;AACAwC,IAAAA,aAAa,CAACY,WAAD,CAAb;AACD,GAHD,EAGG,CAACrD,UAAD,EAAaC,KAAb,CAHH,EAjCiC,CAsCjC;;AAEA,MAAI,CAACuC,UAAL,EAAiB;AACf,WAAO,IAAP;AACD;;AAED,sBACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACA,UAAU,CAACZ,MAAZ,EAAoBE,SAAS,IAAIU,UAAU,CAACV,SAA5C;AAAb,kBACE,6BAAC,sBAAD;AACE,IAAA,KAAK,EAAE,CAACU,UAAU,CAACpC,KAAZ,EAAmBoC,UAAU,CAACrB,IAA9B,CADT;AAEE,IAAA,OAAO,EAAE6B,WAFX;AAGE,IAAA,MAAM,EAAEG,UAHV;AAIE,IAAA,YAAY,EAAEP,QAJhB;AAKE,IAAA,WAAW,EAAEG,WALf;AAME,IAAA,oBAAoB,EAAEL,iBANxB;AAOE,IAAA,KAAK,EAAEI,KAPT;AAQE,IAAA,MAAM,EAAEH,MARV;AASE,IAAA,QAAQ,EAAE,CAACE,UATb;AAUE,IAAA,iBAAiB,EAAE,CAACA;AAVtB,IADF,CADF;AAgBD,CA5DD;;eA8DeR,Q","sourcesContent":["import {View, StyleSheet, TextInput} from 'react-native';\nimport React, {useState, useEffect, useMemo} from 'react';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\nimport {ANALYTICS_EVENT_TYPE, Analytics} from '../../../variables/analytics';\n\ntype QuestionType = 'basic' | 'template';\n\ninterface Props {\n children: string;\n fullWitdh: boolean;\n testID: string;\n questionType: QuestionType;\n analytics?: Analytics;\n onChange: Function;\n isDisabled: boolean;\n value: string;\n placeholder: string;\n}\n\ntype StyleSheetType = {\n input: {\n padding: string;\n borderWidth: number;\n borderColor: string;\n borderRadius: number;\n backgroundColor: string;\n minWidth: number;\n };\n text: {\n color: string;\n fontWeight: number;\n fontSize: number;\n textAlign: string;\n };\n spaced: {\n paddingVertical: number;\n };\n fullWitdh: {\n width: string;\n };\n};\n\nconst createStyleSheet = (brandTheme, theme) =>\n StyleSheet.create({\n input: {\n padding: theme.spacing.tiny,\n borderWidth: 1,\n borderColor: theme.colors.gray.lightMedium,\n borderRadius: theme.radius.common,\n backgroundColor: theme.colors.white,\n minWidth: 175\n },\n text: {\n borderColor: brandTheme?.colors.primary,\n color: brandTheme?.colors.primary || theme.colors.gray.medium,\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.regular,\n textAlign: 'center'\n },\n spaced: {\n paddingVertical: theme.spacing.tiny\n },\n fullWitdh: {\n width: '100%'\n }\n });\n\nconst logEvent = (eventName: string, analytics: Analytics, questionType: QuestionType) => {\n analytics &&\n analytics.logEvent(eventName, {\n id: `question-input-text`,\n questionType\n });\n};\n\nconst FreeText = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n const PLACEHOLDER_COLOR = theme.colors.gray.medium;\n\n // ------------------------------------\n\n const {\n analytics,\n questionType,\n fullWitdh,\n testID,\n onChange,\n isDisabled,\n value,\n placeholder\n } = props;\n\n // ------------------------------------\n\n const handleFocus = useMemo(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType),\n [analytics, questionType]\n );\n\n const handleBlur = useMemo(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType),\n [analytics, questionType]\n );\n\n // ------------------------------------\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.spaced, fullWitdh && styleSheet.fullWitdh]}>\n <TextInput\n style={[styleSheet.input, styleSheet.text]}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={onChange}\n placeholder={placeholder}\n placeholderTextColor={PLACEHOLDER_COLOR}\n value={value}\n testID={testID}\n editable={!isDisabled}\n selectTextOnFocus={!isDisabled}\n />\n </View>\n );\n};\n\nexport default FreeText;\n"],"file":"index.native.js"}
1
+ {"version":3,"sources":["../../../../src/molecule/questions/free-text/index.native.tsx"],"names":["createStyleSheet","brandTheme","theme","StyleSheet","create","input","padding","spacing","tiny","borderWidth","borderColor","colors","gray","lightMedium","borderRadius","radius","common","backgroundColor","white","minWidth","text","primary","color","medium","fontWeight","bold","fontSize","regular","textAlign","spaced","paddingVertical","fullWitdh","width","logEvent","eventName","analytics","questionType","id","FreeText","props","templateContext","styleSheet","setStylesheet","translations","PLACEHOLDER_COLOR","testID","onChange","isDisabled","value","handleFocus","ANALYTICS_EVENT_TYPE","INPUT_FOCUS","handleBlur","INPUT_BLUR","_stylesheet","typeHere"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAiDA,MAAMA,gBAAgB,GAAG,CAACC,UAAD,EAAaC,KAAb,KACvBC,wBAAWC,MAAX,CAAkB;AAChBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IADlB;AAELC,IAAAA,WAAW,EAAE,CAFR;AAGLC,IAAAA,WAAW,EAAER,KAAK,CAACS,MAAN,CAAaC,IAAb,CAAkBC,WAH1B;AAILC,IAAAA,YAAY,EAAEZ,KAAK,CAACa,MAAN,CAAaC,MAJtB;AAKLC,IAAAA,eAAe,EAAEf,KAAK,CAACS,MAAN,CAAaO,KALzB;AAMLC,IAAAA,QAAQ,EAAE;AANL,GADS;AAShBC,EAAAA,IAAI,EAAE;AACJV,IAAAA,WAAW,EAAET,UAAU,EAAEU,M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useEffect, useCallback} from 'react';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\nimport {ANALYTICS_EVENT_TYPE, Analytics} from '../../../variables/analytics';\n\ntype QuestionType = 'basic' | 'template';\n\ninterface Props {\n fullWitdh?: boolean;\n testID: string;\n questionType: QuestionType;\n analytics?: Analytics;\n onChange: (text: string) => void;\n isDisabled: boolean;\n value: string;\n}\n\ntype StyleSheetType = {\n input: {\n padding: string;\n borderWidth: number;\n borderColor: string;\n borderRadius: number;\n backgroundColor: string;\n minWidth: number;\n };\n text: {\n color: string;\n fontWeight:\n | 'normal'\n | 'bold'\n | '100'\n | '200'\n | '300'\n | '400'\n | '500'\n | '600'\n | '700'\n | '800'\n | '900'\n | undefined;\n fontSize: number;\n textAlign: 'auto' | 'left' | 'right' | 'center' | 'justify' | undefined;\n };\n spaced: {\n paddingVertical: number;\n };\n fullWitdh: {\n width: string;\n };\n};\n\nconst createStyleSheet = (brandTheme, theme) =>\n StyleSheet.create({\n input: {\n padding: theme.spacing.tiny,\n borderWidth: 1,\n borderColor: theme.colors.gray.lightMedium,\n borderRadius: theme.radius.common,\n backgroundColor: theme.colors.white,\n minWidth: 175\n },\n text: {\n borderColor: brandTheme?.colors.primary,\n color: brandTheme?.colors.primary || theme.colors.gray.medium,\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.regular,\n textAlign: 'center'\n },\n spaced: {\n paddingVertical: theme.spacing.tiny\n },\n fullWitdh: {\n width: '100%'\n }\n });\n\nconst logEvent = (eventName: string, analytics: Analytics, questionType: QuestionType) => {\n analytics &&\n analytics.logEvent(eventName, {\n id: `question-input-text`,\n questionType\n });\n};\n\nconst FreeText = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme, translations} = templateContext;\n const PLACEHOLDER_COLOR = theme.colors.gray.medium;\n\n // ------------------------------------\n\n const {analytics, questionType, fullWitdh = false, testID, onChange, isDisabled, value} = props;\n\n // ------------------------------------\n\n const handleFocus = useCallback(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType),\n [analytics, questionType]\n );\n\n const handleBlur = useCallback(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType),\n [analytics, questionType]\n );\n\n // ------------------------------------\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.spaced, fullWitdh && styleSheet.fullWitdh]}>\n <TextInput\n style={[styleSheet.input, styleSheet.text]}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={onChange}\n placeholder={translations.typeHere}\n placeholderTextColor={PLACEHOLDER_COLOR}\n value={value}\n testID={testID}\n editable={!isDisabled}\n selectTextOnFocus={!isDisabled}\n />\n </View>\n );\n};\n\nexport default FreeText;\n"],"file":"index.native.js"}
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _react = _interopRequireWildcard(require("react"));
7
+
8
+ var _reactNative = require("react-native");
9
+
10
+ var _trim = _interopRequireDefault(require("lodash/fp/trim"));
11
+
12
+ var _last = _interopRequireDefault(require("lodash/fp/last"));
13
+
14
+ var _index = _interopRequireDefault(require("../../../../atom/html/index.native"));
15
+
16
+ var _index2 = _interopRequireDefault(require("../../../../atom/select-modal/index.native"));
17
+
18
+ var _index3 = _interopRequireDefault(require("../../../../atom/space/index.native"));
19
+
20
+ var _index4 = _interopRequireDefault(require("../../free-text/index.native"));
21
+
22
+ var _templateContext = require("../../../../template/app-review/template-context");
23
+
24
+ var _parseTemplateString = _interopRequireDefault(require("../../../../util/parse-template-string"));
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
+
28
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
29
+
30
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
31
+
32
+ const createStyleSheet = theme => ({
33
+ section: {
34
+ width: '100%',
35
+ flexDirection: 'row',
36
+ flexWrap: 'wrap',
37
+ justifyContent: 'center',
38
+ alignItems: 'center'
39
+ },
40
+ spaced: {
41
+ paddingVertical: theme.spacing.tiny
42
+ },
43
+ input: {
44
+ padding: theme.spacing.tiny,
45
+ borderWidth: 1,
46
+ borderColor: theme.colors.gray.lightMedium,
47
+ borderRadius: theme.radius.common,
48
+ backgroundColor: theme.colors.white,
49
+ minWidth: 175
50
+ },
51
+ htmlText: {
52
+ padding: theme.spacing.tiny,
53
+ color: theme.colors.black,
54
+ fontWeight: theme.fontWeight.bold,
55
+ lineHeight: 30
56
+ },
57
+ text: {
58
+ color: theme.colors.gray.medium,
59
+ fontWeight: theme.fontWeight.bold,
60
+ fontSize: theme.fontSize.regular,
61
+ textAlign: 'center'
62
+ }
63
+ });
64
+
65
+ const Section = ({
66
+ section,
67
+ items,
68
+ index,
69
+ focusedSelectId,
70
+ onInputChange,
71
+ userChoices,
72
+ handleBlur,
73
+ handleFocus,
74
+ isDisabled,
75
+ styles
76
+ }) => {
77
+ const prefix = `question-section-${index + 1}`;
78
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
79
+ style: styles.section,
80
+ key: `container-${prefix}`
81
+ }, section.map((part, id) => {
82
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
83
+ key: `${prefix}-${id}`,
84
+ style: {
85
+ flexDirection: 'row'
86
+ }
87
+ }, /*#__PURE__*/_react.default.createElement(Item, {
88
+ prefix: prefix,
89
+ part: part,
90
+ items: items,
91
+ index: id,
92
+ focusedSelectId: focusedSelectId,
93
+ isDisabled: isDisabled,
94
+ userChoices: userChoices,
95
+ handleBlur: handleBlur,
96
+ handleFocus: handleFocus,
97
+ onInputChange: onInputChange,
98
+ styles: styles
99
+ }), /*#__PURE__*/_react.default.createElement(_index3.default, {
100
+ type: "micro"
101
+ }));
102
+ }));
103
+ };
104
+
105
+ const Item = props => {
106
+ const {
107
+ part,
108
+ index,
109
+ prefix,
110
+ isDisabled = false,
111
+ focusedSelectId,
112
+ items,
113
+ userChoices,
114
+ onInputChange,
115
+ handleBlur,
116
+ handleFocus,
117
+ styles
118
+ } = props;
119
+ const templateContext = (0, _templateContext.useTemplateContext)();
120
+ const {
121
+ theme,
122
+ brandTheme,
123
+ translations
124
+ } = templateContext;
125
+ const inputNames = items.map(item => item.name);
126
+ const id = `${prefix}-part-${index + 1}`;
127
+ const isFocused = focusedSelectId === id;
128
+ const selectedStyle = brandTheme && {
129
+ borderColor: brandTheme.colors.primary,
130
+ color: brandTheme.colors.primary
131
+ };
132
+
133
+ if (part.type === 'answerField' && inputNames.includes(part.value)) {
134
+ const itemIndex = items.findIndex(_item => _item.name === part.value);
135
+ const item = items[itemIndex];
136
+ const value = userChoices[itemIndex];
137
+
138
+ if (!item || !item.type || !item.name) {
139
+ return null;
140
+ }
141
+
142
+ const disabledSuffix = isDisabled ? '-disabled' : '';
143
+ const selectedSuffix = value ? '-selected' : '';
144
+
145
+ const handleInputChange = _item => _value => onInputChange(_item, _value);
146
+
147
+ if (item.type === 'text') {
148
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
149
+ style: styles.spaced,
150
+ testID: id
151
+ }, /*#__PURE__*/_react.default.createElement(_index4.default, {
152
+ key: id,
153
+ isDisabled: isDisabled,
154
+ onChange: handleInputChange(item),
155
+ value: value,
156
+ testID: `${id}-text${selectedSuffix}${disabledSuffix}`,
157
+ questionType: "template"
158
+ }));
159
+ }
160
+
161
+ if (item.type === 'select') {
162
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
163
+ style: styles.spaced,
164
+ testID: id
165
+ }, /*#__PURE__*/_react.default.createElement(_index2.default, {
166
+ isDisabled: isDisabled,
167
+ questionType: "template",
168
+ values: item.items,
169
+ value: value,
170
+ placeholder: translations.selectAnAnswer,
171
+ isFocused: isFocused,
172
+ onBlur: handleBlur,
173
+ onFocus: handleFocus(id),
174
+ onChange: handleInputChange(item),
175
+ textStyle: styles.text,
176
+ style: [styles.input, value && selectedStyle],
177
+ testID: `${id}-select${selectedSuffix}${disabledSuffix}`
178
+ }));
179
+ }
180
+ }
181
+
182
+ return /*#__PURE__*/_react.default.createElement(_index.default, {
183
+ key: id,
184
+ fontSize: theme.fontSize.regular,
185
+ testID: id,
186
+ style: styles.htmlText
187
+ }, (0, _trim.default)(part.value || ''));
188
+ };
189
+
190
+ const QuestionTemplate = props => {
191
+ const {
192
+ template,
193
+ onInputChange,
194
+ userChoices,
195
+ items,
196
+ handleBlur,
197
+ handleFocus,
198
+ focusedSelectId,
199
+ isDisabled = false
200
+ } = props;
201
+ const templateContext = (0, _templateContext.useTemplateContext)();
202
+ const {
203
+ theme
204
+ } = templateContext;
205
+ const [styleSheet, setStylesheet] = (0, _react.useState)(null);
206
+ (0, _react.useEffect)(() => {
207
+ const _stylesheet = createStyleSheet(theme);
208
+
209
+ setStylesheet(_stylesheet);
210
+ }, [theme]);
211
+
212
+ if (!template || !styleSheet) {
213
+ return null;
214
+ }
215
+
216
+ const parts = (0, _parseTemplateString.default)(template);
217
+ const sections = parts.reduce((result, item) => {
218
+ const section = (0, _last.default)(result) || [];
219
+ return result.slice(0, -1).concat([section.concat([item])]);
220
+ }, []);
221
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
222
+ style: {
223
+ flex: 1
224
+ },
225
+ testID: "question-template"
226
+ }, sections.map((section, index) => /*#__PURE__*/_react.default.createElement(Section, {
227
+ key: index,
228
+ section: section,
229
+ items: items,
230
+ index: index,
231
+ handleBlur: handleBlur,
232
+ handleFocus: handleFocus,
233
+ focusedSelectId: focusedSelectId,
234
+ onInputChange: onInputChange,
235
+ userChoices: userChoices,
236
+ isDisabled: isDisabled,
237
+ styles: styleSheet
238
+ })));
239
+ };
240
+
241
+ var _default = QuestionTemplate;
242
+ exports.default = _default;
243
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/questions/mobile/template/index.native.tsx"],"names":["createStyleSheet","theme","section","width","flexDirection","flexWrap","justifyContent","alignItems","spaced","paddingVertical","spacing","tiny","input","padding","borderWidth","borderColor","colors","gray","lightMedium","borderRadius","radius","common","backgroundColor","white","minWidth","htmlText","color","black","fontWeight","bold","lineHeight","text","medium","fontSize","regular","textAlign","Section","items","index","focusedSelectId","onInputChange","userChoices","handleBlur","handleFocus","isDisabled","styles","prefix","map","part","id","Item","props","templateContext","brandTheme","translations","inputNames","item","name","isFocused","selectedStyle","primary","type","includes","value","itemIndex","findIndex","_item","disabledSuffix","selectedSuffix","handleInputChange","_value","selectAnAnswer","QuestionTemplate","template","styleSheet","setStylesheet","_stylesheet","parts","sections","reduce","result","slice","concat","flex"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AAGA;;AACA;;AAEA;;;;;;;;AAEA,MAAMA,gBAAgB,GAAIC,KAAD,KAAmB;AAC1CC,EAAAA,OAAO,EAAE;AACPC,IAAAA,KAAK,EAAE,MADA;AAEPC,IAAAA,aAAa,EAAE,KAFR;AAGPC,IAAAA,QAAQ,EAAE,MAHH;AAIPC,IAAAA,cAAc,EAAE,QAJT;AAKPC,IAAAA,UAAU,EAAE;A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,CAAC/B,GAAT,CAAa,CAAC7C,OAAD,EAAUoC,KAAV,kBACZ,6BAAC,OAAD;AACE,IAAA,GAAG,EAAEA,KADP;AAEE,IAAA,OAAO,EAAEpC,OAFX;AAGE,IAAA,KAAK,EAAEmC,KAHT;AAIE,IAAA,KAAK,EAAEC,KAJT;AAKE,IAAA,UAAU,EAAEI,UALd;AAME,IAAA,WAAW,EAAEC,WANf;AAOE,IAAA,eAAe,EAAEJ,eAPnB;AAQE,IAAA,aAAa,EAAEC,aARjB;AASE,IAAA,WAAW,EAAEC,WATf;AAUE,IAAA,UAAU,EAAEG,UAVd;AAWE,IAAA,MAAM,EAAE8B;AAXV,IADD,CADH,CADF;AAmBD,CApDD;;eAsDeF,gB","sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {View} from 'react-native';\n\nimport trim from 'lodash/fp/trim';\nimport last from 'lodash/fp/last';\n\nimport Html from '../../../../atom/html/index.native';\nimport Select from '../../../../atom/select-modal/index.native';\nimport Space from '../../../../atom/space/index.native';\nimport {FocusedSelectId, HandleBlur, HandleFocus} from '../../../../types/app-review.d';\nimport type {Choice} from '../../../../types/progression-engine.d';\nimport FreeText from '../../free-text/index.native';\nimport {useTemplateContext} from '../../../../template/app-review/template-context';\nimport {Theme} from '../../../../variables/theme.native';\nimport parseTemplateString from '../../../../util/parse-template-string';\n\nconst createStyleSheet = (theme: Theme) => ({\n section: {\n width: '100%',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'center',\n alignItems: 'center'\n },\n spaced: {\n paddingVertical: theme.spacing.tiny\n },\n input: {\n padding: theme.spacing.tiny,\n borderWidth: 1,\n borderColor: theme.colors.gray.lightMedium,\n borderRadius: theme.radius.common,\n backgroundColor: theme.colors.white,\n minWidth: 175\n },\n htmlText: {\n padding: theme.spacing.tiny,\n color: theme.colors.black,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 30\n },\n text: {\n color: theme.colors.gray.medium,\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.regular,\n textAlign: 'center'\n }\n});\n\ntype TemplatePart = {\n type: 'string' | 'answerField';\n value: string;\n};\n\ntype SectionProps = {\n isDisabled: boolean;\n userChoices: Array<string>;\n section: Array<TemplatePart>;\n items: Array<Choice>;\n index: number;\n onInputChange: (item: Choice, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n styles: any;\n};\n\nconst Section = ({\n section,\n items,\n index,\n focusedSelectId,\n onInputChange,\n userChoices,\n handleBlur,\n handleFocus,\n isDisabled,\n styles\n}: SectionProps) => {\n const prefix = `question-section-${index + 1}`;\n\n return (\n <View style={styles.section} key={`container-${prefix}`}>\n {section.map((part, id) => {\n return (\n <View key={`${prefix}-${id}`} style={{flexDirection: 'row'}}>\n <Item\n prefix={prefix}\n part={part}\n items={items}\n index={id}\n focusedSelectId={focusedSelectId}\n isDisabled={isDisabled}\n userChoices={userChoices}\n handleBlur={handleBlur}\n handleFocus={handleFocus}\n onInputChange={onInputChange}\n styles={styles}\n />\n <Space type=\"micro\" />\n </View>\n );\n })}\n </View>\n );\n};\n\ntype ItemProps = {\n part: TemplatePart;\n items: Array<Choice>;\n index: number;\n prefix: string;\n isDisabled?: boolean;\n userChoices: Array<string>;\n onInputChange: (item: Choice, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n styles: any;\n};\n\nconst Item = (props: ItemProps) => {\n const {\n part,\n index,\n prefix,\n isDisabled = false,\n focusedSelectId,\n items,\n userChoices,\n onInputChange,\n handleBlur,\n handleFocus,\n styles\n } = props;\n\n const templateContext = useTemplateContext();\n const {theme, brandTheme, translations} = templateContext;\n\n const inputNames = items.map(item => item.name);\n const id = `${prefix}-part-${index + 1}`;\n const isFocused = focusedSelectId === id;\n\n const selectedStyle = brandTheme && {\n borderColor: brandTheme.colors.primary,\n color: brandTheme.colors.primary\n };\n\n if (part.type === 'answerField' && inputNames.includes(part.value)) {\n const itemIndex = items.findIndex(_item => _item.name === part.value);\n const item = items[itemIndex];\n const value = userChoices[itemIndex];\n\n if (!item || !item.type || !item.name) {\n return null;\n }\n\n const disabledSuffix = isDisabled ? '-disabled' : '';\n const selectedSuffix = value ? '-selected' : '';\n\n const handleInputChange = (_item: Choice) => (_value: string) => onInputChange(_item, _value);\n\n if (item.type === 'text') {\n return (\n <View style={styles.spaced} testID={id}>\n <FreeText\n key={id}\n isDisabled={isDisabled}\n onChange={handleInputChange(item)}\n value={value}\n testID={`${id}-text${selectedSuffix}${disabledSuffix}`}\n questionType=\"template\"\n />\n </View>\n );\n }\n\n if (item.type === 'select') {\n return (\n <View style={styles.spaced} testID={id}>\n <Select\n isDisabled={isDisabled}\n questionType=\"template\"\n values={item.items}\n value={value}\n placeholder={translations.selectAnAnswer}\n isFocused={isFocused}\n onBlur={handleBlur}\n onFocus={handleFocus(id)}\n onChange={handleInputChange(item)}\n textStyle={styles.text}\n style={[styles.input, value && selectedStyle]}\n testID={`${id}-select${selectedSuffix}${disabledSuffix}`}\n />\n </View>\n );\n }\n }\n\n return (\n <Html key={id} fontSize={theme.fontSize.regular} testID={id} style={styles.htmlText}>\n {trim(part.value || '')}\n </Html>\n );\n};\n\nexport type Props = {\n isDisabled?: boolean;\n template: string;\n items: Array<Choice>;\n userChoices: Array<string>;\n onInputChange: (item: Choice, value: string) => void;\n focusedSelectId: FocusedSelectId;\n handleBlur: HandleBlur;\n handleFocus: HandleFocus;\n};\n\nconst QuestionTemplate = (props: Props) => {\n const {\n template,\n onInputChange,\n userChoices,\n items,\n handleBlur,\n handleFocus,\n focusedSelectId,\n isDisabled = false\n } = props;\n\n const templateContext = useTemplateContext();\n const {theme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<any | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!template || !styleSheet) {\n return null;\n }\n\n const parts = parseTemplateString(template);\n\n const sections: Array<Array<TemplatePart>> = parts.reduce((result, item) => {\n const section = last(result) || [];\n return result.slice(0, -1).concat([section.concat([item])]);\n }, []);\n\n return (\n <View style={{flex: 1}} testID=\"question-template\">\n {sections.map((section, index) => (\n <Section\n key={index}\n section={section}\n items={items}\n index={index}\n handleBlur={handleBlur}\n handleFocus={handleFocus}\n focusedSelectId={focusedSelectId}\n onInputChange={onInputChange}\n userChoices={userChoices}\n isDisabled={isDisabled}\n styles={styleSheet}\n />\n ))}\n </View>\n );\n};\n\nexport default QuestionTemplate;\n"],"file":"index.native.js"}
@@ -18,6 +18,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
18
18
  // -----------------------------------------------------------------------------
19
19
  const Context = (0, _react.createContext)({
20
20
  theme: _theme.default,
21
+ translations: {},
21
22
  display: {
22
23
  statusBarHeight: 42
23
24
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/template/app-review/template-context.tsx"],"names":["Context","theme","defaultTheme","display","statusBarHeight","useTemplateContext","context","Error","TemplateContext","values","children"],"mappings":";;;;;AAEA;;AAEA;;;;;;;;;;AAeA;AAEA,MAAMA,OAAO,GAAG,0BAAc;AAC5BC,EAAAA,KAAK,EAAEC,cADqB;AAE5BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,eAAe,EAAE;AADV;AAFmB,CAAd,CAAhB,C,CAOA;;AAEA,MAAMC,kBAAkB,GAAG,MAA6B;AACtD,QAAMC,OAAO,GAAG,uBAAWN,OAAX,CAAhB;;AAEA,MAAI,CAACM,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CACH,yFADG,CAAN;AAGD;;AAED,SAAOD,OAAP;AACD,CAVD,C,CAYA;;;;;AAEA,MAAME,eAAe,GAAG,CAAC;AAACC,EAAAA,MAAD;AAASC,EAAAA;AAAT,CAAD,KAA+B;AACrD,sBAAO,6BAAC,OAAD,CAAS,QAAT;AAAkB,IAAA,KAAK,eAAMD,MAAN;AAAvB,KAAuCC,QAAvC,CAAP;AACD,CAFD,C,CAIA","sourcesContent":["// -----------------------------------------------------------------------------\n\nimport React, {createContext, useContext} from 'react';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n vibration?: Vibration;\n display: {\n statusBarHeight: number;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\n// -----------------------------------------------------------------------------\n\nconst Context = createContext({\n theme: defaultTheme,\n display: {\n statusBarHeight: 42\n }\n});\n\n// -----------------------------------------------------------------------------\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\n// -----------------------------------------------------------------------------\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\n// -----------------------------------------------------------------------------\n\nexport {TemplateContext, useTemplateContext};\n"],"file":"template-context.js"}
1
+ {"version":3,"sources":["../../../src/template/app-review/template-context.tsx"],"names":["Context","theme","defaultTheme","translations","display","statusBarHeight","useTemplateContext","context","Error","TemplateContext","values","children"],"mappings":";;;;;AAEA;;AAGA;;;;;;;;;;AAgBA;AAEA,MAAMA,OAAO,GAAG,0BAAc;AAC5BC,EAAAA,KAAK,EAAEC,cADqB;AAE5BC,EAAAA,YAAY,EAAE,EAFc;AAG5BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,eAAe,EAAE;AADV;AAHmB,CAAd,CAAhB,C,CAQA;;AAEA,MAAMC,kBAAkB,GAAG,MAA6B;AACtD,QAAMC,OAAO,GAAG,uBAAWP,OAAX,CAAhB;;AAEA,MAAI,CAACO,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CACH,yFADG,CAAN;AAGD;;AAED,SAAOD,OAAP;AACD,CAVD,C,CAYA;;;;;AAEA,MAAME,eAAe,GAAG,CAAC;AAACC,EAAAA,MAAD;AAASC,EAAAA;AAAT,CAAD,KAA+B;AACrD,sBAAO,6BAAC,OAAD,CAAS,QAAT;AAAkB,IAAA,KAAK,eAAMD,MAAN;AAAvB,KAAuCC,QAAvC,CAAP;AACD,CAFD,C,CAIA","sourcesContent":["// -----------------------------------------------------------------------------\n\nimport React, {createContext, useContext} from 'react';\nimport {Translations} from '../../types/translations';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n statusBarHeight: number;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\n// -----------------------------------------------------------------------------\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n statusBarHeight: 42\n }\n});\n\n// -----------------------------------------------------------------------------\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\n// -----------------------------------------------------------------------------\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\n// -----------------------------------------------------------------------------\n\nexport {TemplateContext, useTemplateContext};\n"],"file":"template-context.js"}
@@ -19,6 +19,8 @@ var _newsList = _interopRequireDefault(require("../../../molecule/dashboard/news
19
19
 
20
20
  var _startBattle = _interopRequireDefault(require("../../../molecule/dashboard/start-battle"));
21
21
 
22
+ var _cmPopin = _interopRequireDefault(require("../../../molecule/cm-popin"));
23
+
22
24
  var _style = _interopRequireDefault(require("./style.css"));
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -41,7 +43,8 @@ const Dashboard = props => {
41
43
  const {
42
44
  sections = [],
43
45
  hero,
44
- welcome
46
+ welcome,
47
+ cookie
45
48
  } = props;
46
49
 
47
50
  const buildSectionComponent = section => {
@@ -89,13 +92,14 @@ const Dashboard = props => {
89
92
  return /*#__PURE__*/_react.default.createElement("div", {
90
93
  className: _style.default.wrapper,
91
94
  "data-name": "dashboard"
92
- }, sectionsList);
95
+ }, sectionsList, cookie ? /*#__PURE__*/_react.default.createElement(_cmPopin.default, cookie) : null);
93
96
  };
94
97
 
95
98
  Dashboard.propTypes = process.env.NODE_ENV !== "production" ? {
96
99
  hero: Hero.propTypes.hero,
97
100
  welcome: Hero.propTypes.welcome,
98
- sections: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_battleRequestList.default.propTypes), _propTypes.default.shape(_cardsList.default.propTypes), _propTypes.default.shape(_newsList.default.propTypes), _propTypes.default.shape(_startBattle.default.propTypes)]))
101
+ sections: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_battleRequestList.default.propTypes), _propTypes.default.shape(_cardsList.default.propTypes), _propTypes.default.shape(_newsList.default.propTypes), _propTypes.default.shape(_startBattle.default.propTypes)])),
102
+ cookie: _propTypes.default.shape(_cmPopin.default.propTypes)
99
103
  } : {};
100
104
  var _default = Dashboard;
101
105
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/template/common/dashboard/index.js"],"names":["Hero","React","memo","hero","welcome","style","propTypes","PropTypes","shape","HeroCard","Slide","Dashboard","props","sections","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType","BattleRequestList","CardsList","NewsList","StartBattle"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,IAAI,GAAGC,eAAMC,IAAN,CAAW,SAASF,IAAT,CAAc;AAACG,EAAAA,IAAD;AAAOC,EAAAA;AAAP,CAAd,EAA+B;AACrD,sBAAO;AAAK,IAAA,SAAS,EAAEC,eAAMF;AAAtB,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K,IAAAA,GAAG,EAAE;AAApB,GAAD,EAA8B,GAAGR,QAAjC,EAA2CS,GAA3C,CAA+CP,OAAO,iBACzE;AAAK,IAAA,GAAG,EAAEA,OAAO,CAACM;AAAlB,KAAwBJ,YAAY,CAACF,OAAD,CAApC,CADmB,CAArB;AAGA,sBACE;AAAK,IAAA,SAAS,EAAEV,eAAMkB,OAAtB;AAA+B,iBAAU;AAAzC,KACGH,YADH,CADF;AAKD,CAnCD;;AAqCAT,SAAS,CAACL,SAAV,2CAAsB;AACpBH,EAAAA,IAAI,EAAEH,IAAI,CAACM,SAAL,CAAeH,IADD;AAEpBC,EAAAA,OAAO,EAAEJ,IAAI,CAACM,SAAL,CAAeF,OAFJ;AAGpBS,EAAAA,QAAQ,EAAEN,mBAAUiB,OAAV,CACRjB,mBAAUkB,SAAV,CAAoB,CAClBlB,mBAAUC,KAAV,CAAgBkB,2BAAkBpB,SAAlC,CADkB,EAElBC,mBAAUC,KAAV,CAAgBmB,mBAAUrB,SAA1B,CAFkB,EAGlBC,mBAAUC,KAAV,CAAgBoB,kBAAStB,SAAzB,CAHkB,EAIlBC,mBAAUC,KAAV,CAAgBqB,qBAAYvB,SAA5B,CAJkB,CAApB,CADQ;AAHU,CAAtB;eAYeK,S","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes)\n ])\n )\n};\nexport default Dashboard;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/template/common/dashboard/index.js"],"names":["Hero","React","memo","hero","welcome","style","propTypes","PropTypes","shape","HeroCard","Slide","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,IAAI,GAAGC,eAAMC,IAAN,CAAW,SAASF,IAAT,CAAc;AAACG,EAAAA,IAAD;AAAOC,EAAAA;AAAP,CAAd,EAA+B;AACrD,sBAAO;AAAK,IAAA,SAAS,EAAEC,eAAMF;AAAtB,KAA6BA,IAAI,gBAAG,6BAAC,aAAD,EAAcA,IAAd,CAAH,gBAA4B,6BAAC,cAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,C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iBACzE;AAAK,IAAA,GAAG,EAAEA,OAAO,CAACM;AAAlB,KAAwBJ,YAAY,CAACF,OAAD,CAApC,CADmB,CAArB;AAGA,sBACE;AAAK,IAAA,SAAS,EAAEX,eAAMmB,OAAtB;AAA+B,iBAAU;AAAzC,KACGH,YADH,EAEGP,MAAM,gBAAG,6BAAC,gBAAD,EAAaA,MAAb,CAAH,GAA6B,IAFtC,CADF;AAMD,CApCD;;AAsCAH,SAAS,CAACL,SAAV,2CAAsB;AACpBH,EAAAA,IAAI,EAAEH,IAAI,CAACM,SAAL,CAAeH,IADD;AAEpBC,EAAAA,OAAO,EAAEJ,IAAI,CAACM,SAAL,CAAeF,OAFJ;AAGpBS,EAAAA,QAAQ,EAAEN,mBAAUkB,OAAV,CACRlB,mBAAUmB,SAAV,CAAoB,CAClBnB,mBAAUC,KAAV,CAAgBmB,2BAAkBrB,SAAlC,CADkB,EAElBC,mBAAUC,KAAV,CAAgBoB,mBAAUtB,SAA1B,CAFkB,EAGlBC,mBAAUC,KAAV,CAAgBqB,kBAASvB,SAAzB,CAHkB,EAIlBC,mBAAUC,KAAV,CAAgBsB,qBAAYxB,SAA5B,CAJkB,CAApB,CADQ,CAHU;AAWpBQ,EAAAA,MAAM,EAAEP,mBAAUC,KAAV,CAAgBuB,iBAAQzB,SAAxB;AAXY,CAAtB;eAaeK,S","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"file":"index.js"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=app-review.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"app-review.d.js"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=translations.js.map