@coorpacademy/components 10.22.4 → 10.22.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/es/atom/choice/index.native.js +132 -0
- package/es/atom/choice/index.native.js.map +1 -0
- package/es/atom/gradient/index.native.js +46 -0
- package/es/atom/gradient/index.native.js.map +1 -0
- package/es/atom/html/index.native.js +9 -16
- package/es/atom/html/index.native.js.map +1 -1
- package/es/atom/image-background/index.native.js +90 -0
- package/es/atom/image-background/index.native.js.map +1 -0
- package/es/atom/input-switch/index.js +43 -6
- package/es/atom/input-switch/index.js.map +1 -1
- package/es/atom/input-switch/style.css +56 -6
- package/es/atom/select-modal/index.native.js +6 -6
- package/es/atom/select-modal/index.native.js.map +1 -1
- package/es/atom/text/index.native.js +3 -1
- package/es/atom/text/index.native.js.map +1 -1
- package/es/hoc/modal/select/index.native.js +4 -3
- package/es/hoc/modal/select/index.native.js.map +1 -1
- package/es/molecule/answer/index.js +39 -32
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/cm-popin/index.js +101 -14
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +153 -9
- package/es/molecule/questions/free-text/index.native.js +8 -8
- package/es/molecule/questions/free-text/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/template/index.native.js +222 -0
- package/es/molecule/questions/mobile/template/index.native.js.map +1 -0
- package/es/template/app-review/template-context.js +1 -0
- package/es/template/app-review/template-context.js.map +1 -1
- package/es/template/common/dashboard/index.js +6 -3
- package/es/template/common/dashboard/index.js.map +1 -1
- package/es/types/app-review.d.js +2 -0
- package/es/types/app-review.d.js.map +1 -0
- package/es/types/translations.js +2 -0
- package/es/types/translations.js.map +1 -0
- package/es/util/build-query-string.js +9 -0
- package/es/util/build-query-string.js.map +1 -0
- package/es/util/get-clean-uri.js +4 -0
- package/es/util/get-clean-uri.js.map +1 -0
- package/es/util/get-resized-image.js +39 -0
- package/es/util/get-resized-image.js.map +1 -0
- package/es/util/parse-template-string.js +4 -2
- package/es/util/parse-template-string.js.map +1 -1
- package/es/variables/colors.css +1 -0
- package/es/variables/theme.native.js.map +1 -1
- package/lib/atom/choice/index.native.js +150 -0
- package/lib/atom/choice/index.native.js.map +1 -0
- package/lib/atom/gradient/index.native.js +56 -0
- package/lib/atom/gradient/index.native.js.map +1 -0
- package/lib/atom/html/index.native.js +8 -15
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/atom/image-background/index.native.js +105 -0
- package/lib/atom/image-background/index.native.js.map +1 -0
- package/lib/atom/input-switch/index.js +43 -6
- package/lib/atom/input-switch/index.js.map +1 -1
- package/lib/atom/input-switch/style.css +56 -6
- package/lib/atom/select-modal/index.native.js +5 -5
- package/lib/atom/select-modal/index.native.js.map +1 -1
- package/lib/atom/text/index.native.js +3 -1
- package/lib/atom/text/index.native.js.map +1 -1
- package/lib/hoc/modal/select/index.native.js +7 -5
- package/lib/hoc/modal/select/index.native.js.map +1 -1
- package/lib/molecule/answer/index.js +39 -32
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.js +102 -13
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +153 -9
- package/lib/molecule/questions/free-text/index.native.js +7 -7
- package/lib/molecule/questions/free-text/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/template/index.native.js +243 -0
- package/lib/molecule/questions/mobile/template/index.native.js.map +1 -0
- package/lib/template/app-review/template-context.js +1 -0
- package/lib/template/app-review/template-context.js.map +1 -1
- package/lib/template/common/dashboard/index.js +7 -3
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/lib/types/app-review.d.js +2 -0
- package/lib/types/app-review.d.js.map +1 -0
- package/lib/types/translations.js +2 -0
- package/lib/types/translations.js.map +1 -0
- package/lib/util/build-query-string.js +17 -0
- package/lib/util/build-query-string.js.map +1 -0
- package/lib/util/get-clean-uri.js +10 -0
- package/lib/util/get-clean-uri.js.map +1 -0
- package/lib/util/get-resized-image.js +49 -0
- package/lib/util/get-resized-image.js.map +1 -0
- package/lib/util/parse-template-string.js +4 -2
- package/lib/util/parse-template-string.js.map +1 -1
- package/lib/variables/colors.css +1 -0
- package/lib/variables/theme.native.js.map +1 -1
- package/package.json +5 -3
|
@@ -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,E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AM,IAAA,KAAK,EAAE;AAAC2B,MAAAA,IAAI,EAAE;AAAP,KAAb;AAAwB,IAAA,MAAM,EAAC;AAA/B,KACGL,QAAQ,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;;
|
|
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,KAA6BA,IAAI,gBAAG,6BAAC,aAAD,EAAcA,IAAd,CAAH,gBAA4B,6BAAC,cAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;;AAIAJ,IAAI,CAACM,SAAL,2CAAiB;AACfH,EAAAA,IAAI,EAAEI,mBAAUC,KAAV,CAAgBC,cAASH,SAAzB,CADS;AAEfF,EAAAA,OAAO,EAAEG,mBAAUC,KAAV,CAAgBE,eAAMJ,SAAtB;AAFM,CAAjB;;AAKA,MAAMK,SAAS,GAAGC,KAAK,IAAI;AACzB,QAAM;AAACC,IAAAA,QAAQ,GAAG,EAAZ;AAAgBV,IAAAA,IAAhB;AAAsBC,IAAAA;
|
|
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;AA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AAlB,CAAP;AACD,GAJD;;AAMA,QAAMC,YAAY,GAAG,CAAC;AAACJ,IAAAA,IAAI,EAAE,MAAP;AAAeK,IAAAA,GAAG,EAAE;AAApB,GAAD,EAA8B,GAAGT,QAAjC,EAA2CU,GAA3C,CAA+CP,OAAO,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 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"app-review.d.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"translations.js"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
const buildUrlQueryParams = params => (0, _keys2.default)(params).map(key => {
|
|
11
|
+
const value = params[key].toString();
|
|
12
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
13
|
+
}).join('&');
|
|
14
|
+
|
|
15
|
+
var _default = buildUrlQueryParams;
|
|
16
|
+
exports.default = _default;
|
|
17
|
+
//# sourceMappingURL=build-query-string.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/util/build-query-string.ts"],"names":["buildUrlQueryParams","params","map","key","value","toString","encodeURIComponent","join"],"mappings":";;;;;;;;;AAMA,MAAMA,mBAAmB,GAAIC,MAAD,IAC1B,oBAAKA,MAAL,EACGC,GADH,CACOC,GAAG,IAAI;AACV,QAAMC,KAAK,GAAGH,MAAM,CAACE,GAAD,CAAN,CAAYE,QAAZ,EAAd;AACA,SAAQ,GAAEC,kBAAkB,CAACH,GAAD,CAAM,IAAGG,kBAAkB,CAACF,KAAD,CAAQ,EAA/D;AACD,CAJH,EAKGG,IALH,CAKQ,GALR,CADF;;eAQeP,mB","sourcesContent":["import {keys} from 'lodash/fp';\n\nexport type QueryParams = {\n [key: string]: string | number | boolean;\n};\n\nconst buildUrlQueryParams = (params: QueryParams) =>\n keys(params)\n .map(key => {\n const value = params[key].toString();\n return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;\n })\n .join('&');\n\nexport default buildUrlQueryParams;\n"],"file":"build-query-string.js"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
const getCleanUri = originalUri => originalUri && originalUri.replace(/(http:|https:|)\/\//g, 'https://');
|
|
7
|
+
|
|
8
|
+
var _default = getCleanUri;
|
|
9
|
+
exports.default = _default;
|
|
10
|
+
//# sourceMappingURL=get-clean-uri.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/util/get-clean-uri.ts"],"names":["getCleanUri","originalUri","replace"],"mappings":";;;;;AAAA,MAAMA,WAAW,GAAIC,WAAD,IAClBA,WAAW,IAAIA,WAAW,CAACC,OAAZ,CAAoB,sBAApB,EAA4C,UAA5C,CADjB;;eAGeF,W","sourcesContent":["const getCleanUri = (originalUri: string): string =>\n originalUri && originalUri.replace(/(http:|https:|)\\/\\//g, 'https://');\n\nexport default getCleanUri;\n"],"file":"get-clean-uri.js"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _reactNative = require("react-native");
|
|
7
|
+
|
|
8
|
+
var _buildQueryString = _interopRequireDefault(require("./build-query-string"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
13
|
+
|
|
14
|
+
const MEDIAS_API = 'https://api.coorpacademy.com/api-service/medias';
|
|
15
|
+
|
|
16
|
+
const getResizedImage = (url, {
|
|
17
|
+
maxWidth,
|
|
18
|
+
maxHeight,
|
|
19
|
+
resizeMode
|
|
20
|
+
}) => {
|
|
21
|
+
if (!maxWidth && !maxHeight) {
|
|
22
|
+
return url;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let queryParams = {
|
|
26
|
+
url,
|
|
27
|
+
m: !resizeMode || resizeMode === 'cover' ? 'crop' : 'contain',
|
|
28
|
+
q: 90
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
if (maxWidth) {
|
|
32
|
+
queryParams = _extends(_extends({}, queryParams), {}, {
|
|
33
|
+
w: _reactNative.PixelRatio.getPixelSizeForLayoutSize(maxWidth)
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (maxHeight) {
|
|
38
|
+
queryParams = _extends(_extends({}, queryParams), {}, {
|
|
39
|
+
h: _reactNative.PixelRatio.getPixelSizeForLayoutSize(maxHeight)
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const queryString = (0, _buildQueryString.default)(queryParams);
|
|
44
|
+
return `${MEDIAS_API}?${queryString}`;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var _default = getResizedImage;
|
|
48
|
+
exports.default = _default;
|
|
49
|
+
//# sourceMappingURL=get-resized-image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/util/get-resized-image.ts"],"names":["MEDIAS_API","getResizedImage","url","maxWidth","maxHeight","resizeMode","queryParams","m","q","w","PixelRatio","getPixelSizeForLayoutSize","h","queryString"],"mappings":";;;;;AAAA;;AAEA;;;;;;AAEA,MAAMA,UAAU,GAAG,iDAAnB;;AAUA,MAAMC,eAAe,GAAG,CACtBC,GADsB,EAEtB;AACEC,EAAAA,QADF;AAEEC,EAAAA,SAFF;AAGEC,EAAAA;AAHF,CAFsB,KAWnB;AACH,MAAI,CAACF,QAAD,IAAa,CAACC,SAAlB,EAA6B;AAC3B,WAAOF,GAAP;AACD;;AAED,MAAII,WAAgC,GAAG;AACrCJ,IAAAA,GADqC;AAErCK,IAAAA,CAAC,EAAE,CAACF,UAAD,IAAeA,UAAU,KAAK,OAA9B,GAAwC,MAAxC,GAAiD,SAFf;AAGrCG,IAAAA,CAAC,EAAE;AAHkC,GAAvC;;AAMA,MAAIL,QAAJ,EAAc;AACZG,IAAAA,WAAW,yBACNA,WADM;AAETG,MAAAA,CAAC,EAAEC,wBAAWC,yBAAX,CAAqCR,QAArC;AAFM,MAAX;AAID;;AAED,MAAIC,SAAJ,EAAe;AACbE,IAAAA,WAAW,yBACNA,WADM;AAETM,MAAAA,CAAC,EAAEF,wBAAWC,yBAAX,CAAqCP,SAArC;AAFM,MAAX;AAID;;AAED,QAAMS,WAAW,GAAG,+BAAoBP,WAApB,CAApB;AAEA,SAAQ,GAAEN,UAAW,IAAGa,WAAY,EAApC;AACD,CAvCD;;eAyCeZ,e","sourcesContent":["import {PixelRatio, ImageResizeMode} from 'react-native';\n\nimport buildUrlQueryParams from './build-query-string';\n\nconst MEDIAS_API = 'https://api.coorpacademy.com/api-service/medias';\n\ntype MediaAPIQueryParams = {\n url: string;\n m: ImageResizeMode | 'crop';\n q: number;\n w?: number;\n h?: number;\n};\n\nconst getResizedImage = (\n url: string,\n {\n maxWidth,\n maxHeight,\n resizeMode\n }: {\n maxWidth?: number;\n maxHeight?: number;\n resizeMode?: ImageResizeMode | undefined;\n }\n) => {\n if (!maxWidth && !maxHeight) {\n return url;\n }\n\n let queryParams: MediaAPIQueryParams = {\n url,\n m: !resizeMode || resizeMode === 'cover' ? 'crop' : 'contain',\n q: 90\n };\n\n if (maxWidth) {\n queryParams = {\n ...queryParams,\n w: PixelRatio.getPixelSizeForLayoutSize(maxWidth)\n };\n }\n\n if (maxHeight) {\n queryParams = {\n ...queryParams,\n h: PixelRatio.getPixelSizeForLayoutSize(maxHeight)\n };\n }\n\n const queryString = buildUrlQueryParams(queryParams);\n\n return `${MEDIAS_API}?${queryString}`;\n};\n\nexport default getResizedImage;\n"],"file":"get-resized-image.js"}
|
|
@@ -9,11 +9,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
9
9
|
|
|
10
10
|
const reg = /{{(\w+)}}/;
|
|
11
11
|
|
|
12
|
-
function parseTemplateString(
|
|
13
|
-
if (!
|
|
12
|
+
function parseTemplateString(_template) {
|
|
13
|
+
if (!_template) {
|
|
14
14
|
return [];
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
const template = _template.replace(/<br\s*\/*>/g, '<br>').replace(/\r?\n|\r/g, '<br>');
|
|
18
|
+
|
|
17
19
|
const res = reg.exec(template);
|
|
18
20
|
|
|
19
21
|
if (!res) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/parse-template-string.js"],"names":["reg","parseTemplateString","template","res","exec","type","value","index","slice","concat","length"],"mappings":";;;;;;;;;AAEA,MAAMA,GAAG,GAAG,WAAZ;;AAEA,SAASC,mBAAT,CAA6BC,
|
|
1
|
+
{"version":3,"sources":["../../src/util/parse-template-string.js"],"names":["reg","parseTemplateString","_template","template","replace","res","exec","type","value","index","slice","concat","length"],"mappings":";;;;;;;;;AAEA,MAAMA,GAAG,GAAG,WAAZ;;AAEA,SAASC,mBAAT,CAA6BC,SAA7B,EAAwC;AACtC,MAAI,CAACA,SAAL,EAAgB;AACd,WAAO,EAAP;AACD;;AAED,QAAMC,QAAQ,GAAGD,SAAS,CAACE,OAAV,CAAkB,aAAlB,EAAiC,MAAjC,EAAyCA,OAAzC,CAAiD,WAAjD,EAA8D,MAA9D,CAAjB;;AAEA,QAAMC,GAAG,GAAGL,GAAG,CAACM,IAAJ,CAASH,QAAT,CAAZ;;AAEA,MAAI,CAACE,GAAL,EAAU;AACR,WAAO,CAAC;AAACE,MAAAA,IAAI,EAAE,QAAP;AAAiBC,MAAAA,KAAK,EAAEL;AAAxB,KAAD,CAAP;AACD;;AAED,SAAO,uBAAQ,CACbE,GAAG,CAACI,KAAJ,KAAc,CAAd,GAAkB,IAAlB,GAAyB;AAACF,IAAAA,IAAI,EAAE,QAAP;AAAiBC,IAAAA,KAAK,EAAEL,QAAQ,CAACO,KAAT,CAAe,CAAf,EAAkBL,GAAG,CAACI,KAAtB;AAAxB,GADZ,EAEb;AAACF,IAAAA,IAAI,EAAE,aAAP;AAAsBC,IAAAA,KAAK,EAAEH,GAAG,CAAC,CAAD;AAAhC,GAFa,CAAR,EAGJM,MAHI,CAGGV,mBAAmB,CAACE,QAAQ,CAACO,KAAT,CAAeL,GAAG,CAACI,KAAJ,GAAYJ,GAAG,CAAC,CAAD,CAAH,CAAOO,MAAlC,CAAD,CAHtB,CAAP;AAID;;eAEcX,mB","sourcesContent":["import {compact} from 'lodash/fp';\n\nconst reg = /{{(\\w+)}}/;\n\nfunction parseTemplateString(_template) {\n if (!_template) {\n return [];\n }\n\n const template = _template.replace(/<br\\s*\\/*>/g, '<br>').replace(/\\r?\\n|\\r/g, '<br>');\n\n const res = reg.exec(template);\n\n if (!res) {\n return [{type: 'string', value: template}];\n }\n\n return compact([\n res.index === 0 ? null : {type: 'string', value: template.slice(0, res.index)},\n {type: 'answerField', value: res[1]}\n ]).concat(parseTemplateString(template.slice(res.index + res[0].length)));\n}\n\nexport default parseTemplateString;\n"],"file":"parse-template-string.js"}
|
package/lib/variables/colors.css
CHANGED
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
@value box_shadow_light_dark: rgba(0, 0, 0, 0.12);
|
|
68
68
|
@value box_shadow_medium_dark: rgba(0, 0, 0, 0.2);
|
|
69
69
|
@value box_shadow_orange_700: rgba(255, 84, 31, 0.15);
|
|
70
|
+
@value light_blue: #ADC9F5;
|
|
70
71
|
|
|
71
72
|
@value go1_backgound: #144953;
|
|
72
73
|
@value go1_primary: #D5FD42;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/variables/theme.native.ts"],"names":["HTML_ANCHOR_TEXT_COLOR","defaultTheme","colors","border","gray","extra","lighter","light","lightMedium","medium","dark","extraDark","text","primary","background","cta","negative","positive","white","black","battle","notification","salmon","spacing","micro","tiny","small","base","large","xlarge","radius","common","card","regular","search","button","thumbnail","fontWeight","semiBold","bold","extraBold","fontSize","extraSmall","xxlarge","xxxlarge","letterSpacing","header"],"mappings":";;;;AAEO,MAAMA,sBAAsB,GAAG,SAA/B;;
|
|
1
|
+
{"version":3,"sources":["../../src/variables/theme.native.ts"],"names":["HTML_ANCHOR_TEXT_COLOR","defaultTheme","colors","border","gray","extra","lighter","light","lightMedium","medium","dark","extraDark","text","primary","background","cta","negative","positive","white","black","battle","notification","salmon","spacing","micro","tiny","small","base","large","xlarge","radius","common","card","regular","search","button","thumbnail","fontWeight","semiBold","bold","extraBold","fontSize","extraSmall","xxlarge","xxxlarge","letterSpacing","header"],"mappings":";;;;AAEO,MAAMA,sBAAsB,GAAG,SAA/B;;AAoEP,MAAMC,YAAmB,GAAG;AAC1BC,EAAAA,MAAM,EAAE;AACNC,IAAAA,MAAM,EAAE,oBADF;AAENC,IAAAA,IAAI,EAAE;AACJC,MAAAA,KAAK,EAAE,SADH;AAEJC,MAAAA,OAAO,EAAE,SAFL;AAGJC,MAAAA,KAAK,EAAE,SAHH;AAIJC,MAAAA,WAAW,EAAE,SAJT;AAKJC,MAAAA,MAAM,EAAE,SALJ;AAMJC,MAAAA,IAAI,EAAE,SANF;AAOJC,MAAAA,SAAS,EAAE;AAPP,KAFA;AAWNC,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAE;AADL,KAXA;AAcNC,IAAAA,UAAU,EAAE,EAdN;AAeNC,IAAAA,GAAG,EAAE,SAfC;AAgBNC,IAAAA,QAAQ,EAAE,SAhBJ;AAiBNC,IAAAA,QAAQ,EAAE,SAjBJ;AAkBNC,IAAAA,KAAK,EAAE,SAlBD;AAmBNC,IAAAA,KAAK,EAAE,SAnBD;AAoBNC,IAAAA,MAAM,EAAE,SApBF;AAqBNC,IAAAA,YAAY,EAAE,SArBR;AAsBNC,IAAAA,MAAM,EAAE;AAtBF,GADkB;AAyB1BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,KAAK,EAAE,CADA;AAEPC,IAAAA,IAAI,EAAE,CAFC;AAGPC,IAAAA,KAAK,EAAE,EAHA;AAIPC,IAAAA,IAAI,EAAE,EAJC;AAKPlB,IAAAA,MAAM,EAAE,EALD;AAMPmB,IAAAA,KAAK,EAAE,EANA;AAOPC,IAAAA,MAAM,EAAE;AAPD,GAzBiB;AAkC1BC,EAAAA,MAAM,EAAE;AACNC,IAAAA,MAAM,EAAE,CADF;AAENC,IAAAA,IAAI,EAAE,CAFA;AAGNC,IAAAA,OAAO,EAAE,CAHH;AAINxB,IAAAA,MAAM,EAAE,EAJF;AAKNyB,IAAAA,MAAM,EAAE,EALF;AAMNC,IAAAA,MAAM,EAAE,EANF;AAONC,IAAAA,SAAS,EAAE;AAPL,GAlCkB;AA2C1BC,EAAAA,UAAU,EAAE;AACVJ,IAAAA,OAAO,EAAE,KADC;AAEVK,IAAAA,QAAQ,EAAE,KAFA;AAGVC,IAAAA,IAAI,EAAE,KAHI;AAIVC,IAAAA,SAAS,EAAE;AAJD,GA3Cc;AAiD1BC,EAAAA,QAAQ,EAAE;AACRC,IAAAA,UAAU,EAAE,EADJ;AAERhB,IAAAA,KAAK,EAAE,EAFC;AAGRjB,IAAAA,MAAM,EAAE,EAHA;AAIRwB,IAAAA,OAAO,EAAE,EAJD;AAKRL,IAAAA,KAAK,EAAE,EALC;AAMRC,IAAAA,MAAM,EAAE,EANA;AAORc,IAAAA,OAAO,EAAE,EAPD;AAQRC,IAAAA,QAAQ,EAAE;AARF,GAjDgB;AA2D1BC,EAAAA,aAAa,EAAE;AACbC,IAAAA,MAAM,EAAE;AADK;AA3DW,CAA5B;eAgEe7C,Y","sourcesContent":["import {TextStyle} from 'react-native';\n\nexport const HTML_ANCHOR_TEXT_COLOR = '#002BDB';\n\nexport type Colors = {\n background?: any;\n border: string;\n gray: {\n extra: string;\n light: string;\n lighter: string;\n lightMedium: string;\n medium: string;\n dark: string;\n extraDark: string;\n };\n text: {\n primary: '#06265B';\n };\n cta: string;\n negative: string;\n positive: string;\n white: string;\n black: string;\n battle: string;\n notification: string;\n salmon: string;\n};\n\nexport type Theme = {\n colors: Colors;\n spacing: {\n micro: number;\n tiny: number;\n small: number;\n base: number;\n medium: number;\n large: number;\n xlarge: number;\n };\n radius: {\n button: number;\n common: number;\n card: number;\n medium: number;\n regular: number;\n search: number;\n thumbnail: number;\n };\n fontWeight: {\n regular: TextStyle['fontWeight'];\n semiBold: TextStyle['fontWeight'];\n bold: TextStyle['fontWeight'];\n extraBold: TextStyle['fontWeight'];\n };\n fontSize: {\n extraSmall: TextStyle['fontSize'];\n small: TextStyle['fontSize'];\n medium: TextStyle['fontSize'];\n regular: TextStyle['fontSize'];\n large: TextStyle['fontSize'];\n xlarge: TextStyle['fontSize'];\n xxlarge: TextStyle['fontSize'];\n xxxlarge: TextStyle['fontSize'];\n };\n letterSpacing: {\n header: number;\n };\n};\n\nconst defaultTheme: Theme = {\n colors: {\n border: 'rgba(0, 0, 0, 0.1)',\n gray: {\n extra: '#FAFAFA',\n lighter: '#F4F4F5',\n light: '#ededed',\n lightMedium: '#CFD8DC',\n medium: '#90A4AE',\n dark: '#546E7A',\n extraDark: '#323232'\n },\n text: {\n primary: '#06265B'\n },\n background: {},\n cta: '#0061FF',\n negative: '#F73F52',\n positive: '#3EC483',\n white: '#FFFFFF',\n black: '#14171A',\n battle: '#FFDE03',\n notification: '#FF7043',\n salmon: '#FDE2E5'\n },\n spacing: {\n micro: 4,\n tiny: 8,\n small: 16,\n base: 24,\n medium: 32,\n large: 48,\n xlarge: 64\n },\n radius: {\n common: 3,\n card: 5,\n regular: 8,\n medium: 12,\n search: 24,\n button: 32,\n thumbnail: 1000\n },\n fontWeight: {\n regular: '400',\n semiBold: '500',\n bold: '700',\n extraBold: '900'\n },\n fontSize: {\n extraSmall: 10,\n small: 12,\n medium: 13,\n regular: 15,\n large: 17,\n xlarge: 22,\n xxlarge: 28,\n xxxlarge: 40\n },\n letterSpacing: {\n header: 5\n }\n};\n\nexport default defaultTheme;\n"],"file":"theme.native.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.22.
|
|
3
|
+
"version": "10.22.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@babel/types": "^7.9.6",
|
|
97
97
|
"@coorpacademy/css-modules-require-hook": "2.1.5",
|
|
98
98
|
"@coorpacademy/eslint-plugin-coorpacademy": "^10.0.0",
|
|
99
|
-
"@coorpacademy/react-native-mock-render": "^0.2.
|
|
99
|
+
"@coorpacademy/react-native-mock-render": "^0.2.4",
|
|
100
100
|
"@coorpacademy/translate": "6.1.5",
|
|
101
101
|
"@coorpacademy/webpack-config": "10.0.4",
|
|
102
102
|
"@storybook/addon-knobs": "^5.3.18",
|
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
"babel-plugin-lodash": "^3.3.4",
|
|
113
113
|
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
|
|
114
114
|
"browser-env": "^3.3.0",
|
|
115
|
+
"color": "^4.2.3",
|
|
115
116
|
"concurrently": "^5.2.0",
|
|
116
117
|
"cross-env": "^7.0.2",
|
|
117
118
|
"enzyme": "^3.11.0",
|
|
@@ -126,6 +127,7 @@
|
|
|
126
127
|
"react": "^17.0.2",
|
|
127
128
|
"react-dom": "^17.0.2",
|
|
128
129
|
"react-native": "^0.68.2",
|
|
130
|
+
"react-native-linear-gradient": "^2.6.2",
|
|
129
131
|
"react-native-modal": "11.5.6",
|
|
130
132
|
"react-native-render-html": "^6.3.4",
|
|
131
133
|
"rxjs": "^6.5.5",
|
|
@@ -136,5 +138,5 @@
|
|
|
136
138
|
"webpack": "^4.43.0"
|
|
137
139
|
},
|
|
138
140
|
"author": "CoorpAcademy",
|
|
139
|
-
"gitHead": "
|
|
141
|
+
"gitHead": "0581f6b96f948da672c274c4d233bc853981f4cc"
|
|
140
142
|
}
|