@widergy/mobile-ui 1.50.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/lib/components/Carousel/components/CarouselContainer/index.js +5 -3
- package/lib/components/FilePicker/constants.js +1 -4
- package/lib/components/FilePicker/index.js +33 -17
- package/lib/components/ImagePicker/ModalSelectionOption/index.js +14 -2
- package/lib/components/ImagePicker/index.js +5 -1
- package/lib/components/ImagePicker/layout.js +65 -5
- package/lib/components/MultipleFilePicker/index.js +275 -35
- package/lib/components/MultipleFilePicker/propTypes.js +16 -1
- package/lib/components/MultipleFilePicker/utils.js +44 -13
- package/lib/components/Overlay/index.js +8 -3
- package/lib/components/PhotoAlbum/index.js +28 -4
- package/lib/components/RateChart/components/RateStagesGraph/components/Bars/index.js +5 -4
- package/lib/components/UTCheckBox/index.js +3 -15
- package/lib/components/UTCheckBox/theme.js +4 -18
- package/lib/components/UTCheckList/index.js +11 -7
- package/lib/components/UTDetailDrawer/index.js +4 -4
- package/lib/components/UTHeader/index.js +17 -9
- package/lib/components/UTIcon/index.js +0 -1
- package/lib/components/UTIcon/utils.js +3 -3
- package/lib/components/UTModal/index.js +4 -3
- package/lib/components/UTModal/styles.js +1 -2
- package/lib/components/UTRating/index.js +4 -3
- package/lib/components/UTRating/styles.js +3 -1
- package/lib/components/UTTabs/index.js +14 -6
- package/lib/components/UTTabs/styles.js +51 -19
- package/lib/components/UTTopbar/index.js +11 -8
- package/lib/components/UTTracker/components/Step/styles.js +8 -4
- package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/components/ActionButton/index.js +4 -2
- package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/index.js +15 -2
- package/lib/components/UTWorkflowContainer/versions/V1/index.js +19 -4
- package/lib/constants/testIds.js +30 -7
- package/lib/reactotronConfig.js +36 -3
- package/lib/utils/fileUtils.js/index.js +15 -10
- package/package.json +12 -10
|
@@ -2,6 +2,16 @@ import { StyleSheet } from 'react-native';
|
|
|
2
2
|
|
|
3
3
|
import { COLOR_THEMES, HIERARCHIES } from './constants';
|
|
4
4
|
|
|
5
|
+
const getTabDistribution = length => {
|
|
6
|
+
const equalWidth = `${100 / length}%`;
|
|
7
|
+
return {
|
|
8
|
+
widths: Array(length).fill(equalWidth),
|
|
9
|
+
positions: Array(length)
|
|
10
|
+
.fill(0)
|
|
11
|
+
.map((_, i) => `${(100 / length) * i}%`)
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
5
15
|
export default StyleSheet.create(({ Palette: { accent, neutral, negative, light } }) => ({
|
|
6
16
|
border: {
|
|
7
17
|
position: 'absolute',
|
|
@@ -80,13 +90,24 @@ export default StyleSheet.create(({ Palette: { accent, neutral, negative, light
|
|
|
80
90
|
}
|
|
81
91
|
: {};
|
|
82
92
|
|
|
93
|
+
const distribution = getTabDistribution(length);
|
|
94
|
+
const inputRange =
|
|
95
|
+
length === 3
|
|
96
|
+
? [0, 1, 2]
|
|
97
|
+
: Array(length)
|
|
98
|
+
.fill(0)
|
|
99
|
+
.map((_, i) => i);
|
|
100
|
+
|
|
83
101
|
const positioningStyles = isScrollable
|
|
84
102
|
? {}
|
|
85
103
|
: {
|
|
86
|
-
width:
|
|
104
|
+
width: position.interpolate({
|
|
105
|
+
inputRange,
|
|
106
|
+
outputRange: distribution.widths
|
|
107
|
+
}),
|
|
87
108
|
left: position.interpolate({
|
|
88
|
-
inputRange
|
|
89
|
-
outputRange:
|
|
109
|
+
inputRange,
|
|
110
|
+
outputRange: distribution.positions
|
|
90
111
|
})
|
|
91
112
|
};
|
|
92
113
|
|
|
@@ -98,22 +119,33 @@ export default StyleSheet.create(({ Palette: { accent, neutral, negative, light
|
|
|
98
119
|
...positioningStyles
|
|
99
120
|
};
|
|
100
121
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
122
|
+
tabContainer: (tabs, index) => () => {
|
|
123
|
+
const distribution = getTabDistribution(tabs);
|
|
124
|
+
const width = distribution.widths[index] || 'auto';
|
|
125
|
+
return {
|
|
126
|
+
width,
|
|
127
|
+
zIndex: 3
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
tabContent: selected => ({
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
display: 'flex',
|
|
133
|
+
flexDirection: 'row',
|
|
134
|
+
paddingHorizontal: 8,
|
|
135
|
+
gap: 8,
|
|
136
|
+
height: 48,
|
|
137
|
+
justifyContent: 'center',
|
|
138
|
+
backgroundColor: selected ? 'white' : 'transparent',
|
|
139
|
+
borderRadius: 4,
|
|
140
|
+
width: '100%',
|
|
141
|
+
minWidth: '100%',
|
|
142
|
+
overflow: 'hidden',
|
|
143
|
+
position: 'relative'
|
|
144
|
+
}),
|
|
145
|
+
tabLabel: {
|
|
146
|
+
flex: 1,
|
|
147
|
+
textAlign: 'center'
|
|
148
|
+
},
|
|
117
149
|
scrollableTab: ({ pressed }) => ({
|
|
118
150
|
alignItems: 'center',
|
|
119
151
|
display: 'flex',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect } from 'react';
|
|
2
2
|
import { BackHandler, View } from 'react-native';
|
|
3
3
|
import { number } from 'prop-types';
|
|
4
|
-
import { useFocusEffect } from '@react-navigation/native';
|
|
5
4
|
|
|
5
|
+
import { TEST_IDS } from '../../constants/testIds';
|
|
6
6
|
import UTButton from '../UTButton';
|
|
7
7
|
import UTStepper from '../UTStepper';
|
|
8
8
|
import UTProgressBar from '../UTProgressBar';
|
|
@@ -12,6 +12,8 @@ import UTLabel from '../UTLabel';
|
|
|
12
12
|
import ownStyles, { BAR_HEIGHT } from './styles';
|
|
13
13
|
import { TopbarPropTypes } from './types';
|
|
14
14
|
|
|
15
|
+
const { goBack: goBackTestId, title: titleTestId } = TEST_IDS.topbar;
|
|
16
|
+
|
|
15
17
|
const UTTopbar = ({
|
|
16
18
|
currentStage,
|
|
17
19
|
currentStep,
|
|
@@ -22,8 +24,8 @@ const UTTopbar = ({
|
|
|
22
24
|
}) => {
|
|
23
25
|
const ownTheme = theme.UTWorkflowContainer?.topbar?.[colorTheme];
|
|
24
26
|
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
useEffect(
|
|
27
29
|
useCallback(() => {
|
|
28
30
|
const onBackPress = () => {
|
|
29
31
|
goBack();
|
|
@@ -35,24 +37,25 @@ const UTTopbar = ({
|
|
|
35
37
|
return () => subscription.remove();
|
|
36
38
|
}, [goBack])
|
|
37
39
|
);
|
|
38
|
-
// up to here
|
|
39
40
|
|
|
40
41
|
return (
|
|
41
42
|
<View>
|
|
42
43
|
<View style={[ownStyles.container, ownTheme?.container]}>
|
|
43
44
|
<UTButton
|
|
45
|
+
dataTestId={goBackTestId}
|
|
44
46
|
Icon={Icon || 'IconArrowLeft'}
|
|
45
|
-
|
|
47
|
+
onPress={goBack}
|
|
46
48
|
style={{
|
|
47
49
|
root: ownStyles.goBack
|
|
48
50
|
}}
|
|
49
|
-
|
|
51
|
+
variant="text"
|
|
50
52
|
/>
|
|
51
53
|
<UTLabel
|
|
52
54
|
colorTheme={ownTheme?.text || 'dark'}
|
|
55
|
+
dataTestId={titleTestId}
|
|
56
|
+
style={ownStyles.child}
|
|
53
57
|
variant="subtitle1"
|
|
54
58
|
weight="medium"
|
|
55
|
-
style={ownStyles.child}
|
|
56
59
|
>
|
|
57
60
|
{title}
|
|
58
61
|
</UTLabel>
|
|
@@ -10,13 +10,15 @@ export const getVariantStyles = theme => ({
|
|
|
10
10
|
borderColor: theme.Palette.error['04']
|
|
11
11
|
},
|
|
12
12
|
activeInnerContainer: {
|
|
13
|
-
backgroundColor: theme.Palette.error['04']
|
|
13
|
+
backgroundColor: theme.Palette.error['04'],
|
|
14
|
+
borderRadius: OVAL_SIZE / 4
|
|
14
15
|
},
|
|
15
16
|
completedContainer: {
|
|
16
17
|
borderColor: theme.Palette.error['04']
|
|
17
18
|
},
|
|
18
19
|
completedInnerContainer: {
|
|
19
|
-
backgroundColor: theme.Palette.error['04']
|
|
20
|
+
backgroundColor: theme.Palette.error['04'],
|
|
21
|
+
borderRadius: OVAL_SIZE / 4
|
|
20
22
|
}
|
|
21
23
|
},
|
|
22
24
|
[STANDARD]: {
|
|
@@ -24,13 +26,15 @@ export const getVariantStyles = theme => ({
|
|
|
24
26
|
borderColor: theme.Palette.accent['04']
|
|
25
27
|
},
|
|
26
28
|
activeInnerContainer: {
|
|
27
|
-
backgroundColor: theme.Palette.accent['04']
|
|
29
|
+
backgroundColor: theme.Palette.accent['04'],
|
|
30
|
+
borderRadius: OVAL_SIZE / 4
|
|
28
31
|
},
|
|
29
32
|
completedContainer: {
|
|
30
33
|
borderColor: theme.Palette.accent['04']
|
|
31
34
|
},
|
|
32
35
|
completedInnerContainer: {
|
|
33
|
-
backgroundColor: theme.Palette.accent['04']
|
|
36
|
+
backgroundColor: theme.Palette.accent['04'],
|
|
37
|
+
borderRadius: OVAL_SIZE / 4
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
});
|
|
@@ -8,7 +8,7 @@ import { useTheme } from '../../../../../../../../theming';
|
|
|
8
8
|
|
|
9
9
|
import ownStyles from './styles';
|
|
10
10
|
|
|
11
|
-
const ActionButton = ({ colorTheme, disabled, hidden, label, onPress, style, variant, icon }) => {
|
|
11
|
+
const ActionButton = ({ colorTheme, dataTestId, disabled, hidden, label, onPress, style, variant, icon }) => {
|
|
12
12
|
const theme = useTheme();
|
|
13
13
|
const themedStyles = merge({}, ownStyles, theme?.UTWorkflowContainer?.actionButton, style);
|
|
14
14
|
|
|
@@ -16,12 +16,13 @@ const ActionButton = ({ colorTheme, disabled, hidden, label, onPress, style, var
|
|
|
16
16
|
<View style={themedStyles.actionButton}>
|
|
17
17
|
<UTButton
|
|
18
18
|
colorTheme={colorTheme}
|
|
19
|
+
dataTestId={dataTestId}
|
|
19
20
|
disabled={disabled || hidden}
|
|
21
|
+
Icon={icon}
|
|
20
22
|
onPress={onPress}
|
|
21
23
|
size="large"
|
|
22
24
|
style={{ root: themedStyles.buttonContainer, childrenContainer: themedStyles.buttonContent }}
|
|
23
25
|
variant={variant}
|
|
24
|
-
Icon={icon}
|
|
25
26
|
>
|
|
26
27
|
{label}
|
|
27
28
|
</UTButton>
|
|
@@ -31,6 +32,7 @@ const ActionButton = ({ colorTheme, disabled, hidden, label, onPress, style, var
|
|
|
31
32
|
|
|
32
33
|
ActionButton.propTypes = {
|
|
33
34
|
colorTheme: string,
|
|
35
|
+
dataTestId: string,
|
|
34
36
|
disabled: bool,
|
|
35
37
|
hidden: bool,
|
|
36
38
|
icon: string,
|
|
@@ -3,6 +3,7 @@ import { View } from 'react-native';
|
|
|
3
3
|
import merge from 'lodash/merge';
|
|
4
4
|
import { number } from 'prop-types';
|
|
5
5
|
|
|
6
|
+
import { TEST_IDS } from '../../../../../../constants/testIds';
|
|
6
7
|
import UTLabel from '../../../../../UTLabel';
|
|
7
8
|
import Surface from '../../../../../Surface';
|
|
8
9
|
import UTIcon from '../../../../../UTIcon';
|
|
@@ -16,6 +17,8 @@ import ActionButtonPropTypes from './components/ActionButton/types';
|
|
|
16
17
|
import ownStyles from './styles';
|
|
17
18
|
import { NEXT, RETURN } from './constants';
|
|
18
19
|
|
|
20
|
+
const { workflowContainer } = TEST_IDS;
|
|
21
|
+
|
|
19
22
|
const BottomActions = ({ bottomSafeArea, message, nextButton, returnButton, summary, style }) => {
|
|
20
23
|
const messageIcon = message?.Icon;
|
|
21
24
|
const MESSAGE_ICON_SIZE = 16;
|
|
@@ -28,7 +31,10 @@ const BottomActions = ({ bottomSafeArea, message, nextButton, returnButton, summ
|
|
|
28
31
|
return (
|
|
29
32
|
<Surface position="top" style={[themedStyles.bottomNav, themedStyles.bottomSafeArea(bottomSafeArea)]}>
|
|
30
33
|
{summary && (
|
|
31
|
-
<View
|
|
34
|
+
<View
|
|
35
|
+
testID={workflowContainer.bottomActions.summary}
|
|
36
|
+
style={[themedStyles.summary, checkboxProps && themedStyles.summaryCheckbox]}
|
|
37
|
+
>
|
|
32
38
|
{checkboxProps ? (
|
|
33
39
|
<Checkbox {...checkboxProps} />
|
|
34
40
|
) : (
|
|
@@ -75,7 +81,12 @@ const BottomActions = ({ bottomSafeArea, message, nextButton, returnButton, summ
|
|
|
75
81
|
themedStyles[`message${message.variant?.charAt(0).toUpperCase()}${message.variant?.slice(1)}`]
|
|
76
82
|
]}
|
|
77
83
|
>
|
|
78
|
-
<UTLabel
|
|
84
|
+
<UTLabel
|
|
85
|
+
colorTheme="negative"
|
|
86
|
+
dataTestId={workflowContainer.bottomActions.message}
|
|
87
|
+
style={themedStyles.messageChild}
|
|
88
|
+
weight="medium"
|
|
89
|
+
>
|
|
79
90
|
{message.title}
|
|
80
91
|
</UTLabel>
|
|
81
92
|
{messageIcon && <UTIcon colorTheme="negative" name={messageIcon} size={MESSAGE_ICON_SIZE} />}
|
|
@@ -84,6 +95,7 @@ const BottomActions = ({ bottomSafeArea, message, nextButton, returnButton, summ
|
|
|
84
95
|
<View style={themedStyles.actionsContainer}>
|
|
85
96
|
{returnButtonEnabled && (
|
|
86
97
|
<ActionButton
|
|
98
|
+
dataTestId={workflowContainer.bottomActions.returnButton}
|
|
87
99
|
label={returnButton.label || RETURN}
|
|
88
100
|
variant="text"
|
|
89
101
|
style={{
|
|
@@ -98,6 +110,7 @@ const BottomActions = ({ bottomSafeArea, message, nextButton, returnButton, summ
|
|
|
98
110
|
)}
|
|
99
111
|
{nextButtonEnabled && (
|
|
100
112
|
<ActionButton
|
|
113
|
+
dataTestId={workflowContainer.bottomActions.nextButton}
|
|
101
114
|
label={nextButton.label || NEXT}
|
|
102
115
|
style={{
|
|
103
116
|
actionButton: themedStyles.nextActionButton,
|
|
@@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { ScrollView, View, KeyboardAvoidingView, Keyboard } from 'react-native';
|
|
3
3
|
import { number, func, shape, bool, string, element, oneOfType, any, objectOf } from 'prop-types';
|
|
4
4
|
import { merge } from 'lodash';
|
|
5
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
5
|
|
|
7
6
|
import { useTheme } from '../../../../theming';
|
|
8
7
|
import UTHeader from '../../../UTHeader';
|
|
@@ -17,6 +16,15 @@ import BottomActions from './components/BottomActions';
|
|
|
17
16
|
import ActionButtonPropTypes from './components/BottomActions/components/ActionButton/types';
|
|
18
17
|
import { MessagePropTypes, SummaryPropTypes } from './types';
|
|
19
18
|
|
|
19
|
+
let useSafeAreaInsets;
|
|
20
|
+
try {
|
|
21
|
+
// eslint-disable-next-line no-eval, global-require
|
|
22
|
+
const safeArea = require('react-native-safe-area-context');
|
|
23
|
+
useSafeAreaInsets = safeArea?.useSafeAreaInsets;
|
|
24
|
+
} catch (e) {
|
|
25
|
+
useSafeAreaInsets = undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
const UTWorkflowContainer = ({
|
|
21
29
|
banner,
|
|
22
30
|
children,
|
|
@@ -39,9 +47,10 @@ const UTWorkflowContainer = ({
|
|
|
39
47
|
title,
|
|
40
48
|
topbar,
|
|
41
49
|
useMarkdown,
|
|
42
|
-
wizardConfig
|
|
50
|
+
wizardConfig,
|
|
51
|
+
topSafeAreaDisabled = false
|
|
43
52
|
}) => {
|
|
44
|
-
const { bottom: bottomSafeArea, top: topSafeArea } = useSafeAreaInsets();
|
|
53
|
+
const { bottom: bottomSafeArea, top: topSafeArea } = useSafeAreaInsets?.() || {};
|
|
45
54
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
55
|
useEffect(() => () => onExit?.(), []);
|
|
47
56
|
|
|
@@ -65,7 +74,12 @@ const UTWorkflowContainer = ({
|
|
|
65
74
|
|
|
66
75
|
return (
|
|
67
76
|
<KeyboardAvoidingView behavior={IS_IOS ? 'padding' : ''} style={themedStyles.layoutContainer}>
|
|
68
|
-
<View
|
|
77
|
+
<View
|
|
78
|
+
style={[
|
|
79
|
+
themedStyles.container,
|
|
80
|
+
topbar && !topSafeAreaDisabled && themedStyles.topSafeArea(topSafeArea)
|
|
81
|
+
]}
|
|
82
|
+
>
|
|
69
83
|
{topbar && <UTTopbar {...{ currentStage, currentStep, stages, stepsCount, theme, topbar }} />}
|
|
70
84
|
<ScrollView
|
|
71
85
|
contentContainerStyle={themedStyles.content}
|
|
@@ -129,6 +143,7 @@ UTWorkflowContainer.propTypes = {
|
|
|
129
143
|
tagline: string,
|
|
130
144
|
title: oneOfType([string, element]),
|
|
131
145
|
topbar: TopbarPropTypes,
|
|
146
|
+
topSafeAreaDisabled: bool,
|
|
132
147
|
useMarkdown: bool,
|
|
133
148
|
wizardConfig: shape({
|
|
134
149
|
variant: string,
|
package/lib/constants/testIds.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export const TEST_IDS = {
|
|
2
|
-
modal: 'modal',
|
|
3
|
-
roundView: 'roundView',
|
|
4
|
-
skeletonLoader: 'skeletonLoader'
|
|
5
|
-
};
|
|
6
|
-
|
|
7
1
|
export const TEST_ID_CONSTANTS = {
|
|
8
2
|
acceptButton: 'acceptButton',
|
|
9
3
|
additionalInfo: 'additionalInfo',
|
|
@@ -11,6 +5,7 @@ export const TEST_ID_CONSTANTS = {
|
|
|
11
5
|
areaCode: 'areaCode',
|
|
12
6
|
attribution: 'attribution',
|
|
13
7
|
badge: 'badge',
|
|
8
|
+
bottomActions: 'bottomActions',
|
|
14
9
|
cancelButton: 'cancelButton',
|
|
15
10
|
characterCount: 'characterCount',
|
|
16
11
|
checkIcon: 'checkIcon',
|
|
@@ -31,15 +26,43 @@ export const TEST_ID_CONSTANTS = {
|
|
|
31
26
|
primaryAction: 'primaryAction',
|
|
32
27
|
required: 'required',
|
|
33
28
|
right: 'right',
|
|
29
|
+
requiredFieldInfo: 'requiredFieldInfo',
|
|
34
30
|
searchInput: 'searchInput',
|
|
35
31
|
secondaryAction: 'secondaryAction',
|
|
36
32
|
selectAll: 'selectAll',
|
|
37
33
|
subLabel: 'subLabel',
|
|
38
34
|
subtitle: 'subtitle',
|
|
35
|
+
tagline: 'tagline',
|
|
39
36
|
tertiaryAction: 'tertiaryAction',
|
|
40
37
|
text: 'text',
|
|
41
38
|
title: 'title',
|
|
42
39
|
titleText: 'titleText',
|
|
43
40
|
tooltip: 'tooltip',
|
|
44
|
-
validation: 'validation'
|
|
41
|
+
validation: 'validation',
|
|
42
|
+
workflowContainer: 'workflowContainer'
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const TEST_IDS = {
|
|
46
|
+
modal: 'modal',
|
|
47
|
+
roundView: 'roundView',
|
|
48
|
+
skeletonLoader: 'skeletonLoader',
|
|
49
|
+
topbar: {
|
|
50
|
+
goBack: 'topbar.goBack',
|
|
51
|
+
title: 'topbar.title'
|
|
52
|
+
},
|
|
53
|
+
workflowContainer: {
|
|
54
|
+
bottomActions: {
|
|
55
|
+
message: `${TEST_ID_CONSTANTS.workflowContainer}.${TEST_ID_CONSTANTS.bottomActions}.message`,
|
|
56
|
+
nextButton: `${TEST_ID_CONSTANTS.workflowContainer}.${TEST_ID_CONSTANTS.bottomActions}.nextButton`,
|
|
57
|
+
returnButton: `${TEST_ID_CONSTANTS.workflowContainer}.${TEST_ID_CONSTANTS.bottomActions}.returnButton`,
|
|
58
|
+
summary: `${TEST_ID_CONSTANTS.workflowContainer}.${TEST_ID_CONSTANTS.bottomActions}.summary`
|
|
59
|
+
},
|
|
60
|
+
header: {
|
|
61
|
+
tagline: `${TEST_ID_CONSTANTS.workflowContainer}.header.${TEST_ID_CONSTANTS.tagline}`,
|
|
62
|
+
title: `${TEST_ID_CONSTANTS.workflowContainer}.header.${TEST_ID_CONSTANTS.title}`,
|
|
63
|
+
subtitle: `${TEST_ID_CONSTANTS.workflowContainer}.header.${TEST_ID_CONSTANTS.subtitle}`,
|
|
64
|
+
requiredFieldInfo: `${TEST_ID_CONSTANTS.workflowContainer}.header.${TEST_ID_CONSTANTS.requiredFieldInfo}`,
|
|
65
|
+
helpText: `${TEST_ID_CONSTANTS.workflowContainer}.header.${TEST_ID_CONSTANTS.helpText}`
|
|
66
|
+
}
|
|
67
|
+
}
|
|
45
68
|
};
|
package/lib/reactotronConfig.js
CHANGED
|
@@ -1,7 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
/*
|
|
3
|
+
Reactotron opcional: no importamos el paquete directamente para evitar fallos
|
|
4
|
+
cuando no está instalado en el consumidor. Si el consumidor quiere usarlo,
|
|
5
|
+
puede exponer una instancia en un global llamado REACTOTRON antes de cargar la lib.
|
|
6
|
+
*/
|
|
2
7
|
|
|
3
|
-
const configureReactotron =
|
|
4
|
-
|
|
8
|
+
const configureReactotron = host => {
|
|
9
|
+
let g;
|
|
10
|
+
if (typeof global !== 'undefined') g = global;
|
|
11
|
+
else if (typeof window !== 'undefined') g = window;
|
|
12
|
+
const Reactotron = g && g.REACTOTRON ? g.REACTOTRON : null;
|
|
13
|
+
|
|
14
|
+
if (!Reactotron) {
|
|
15
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
16
|
+
// eslint-disable-next-line no-console
|
|
17
|
+
console.log('[Reactotron] no disponible; se omite configuración');
|
|
18
|
+
}
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const config = host ? { host } : undefined;
|
|
22
|
+
Reactotron.configure(config).useReactNative().connect();
|
|
23
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
24
|
+
// Limpia la timeline y deja un rastro en consola/Reactotron
|
|
25
|
+
try {
|
|
26
|
+
Reactotron.clear?.();
|
|
27
|
+
} catch (err) {
|
|
28
|
+
// noop
|
|
29
|
+
}
|
|
30
|
+
// eslint-disable-next-line no-console
|
|
31
|
+
console.log(`[Reactotron] connect -> host=${host ?? 'default'}`);
|
|
32
|
+
try {
|
|
33
|
+
Reactotron.log?.(`Reactotron connected -> host=${host ?? 'default'}`);
|
|
34
|
+
} catch (err) {
|
|
35
|
+
// noop
|
|
36
|
+
}
|
|
37
|
+
}
|
|
5
38
|
};
|
|
6
39
|
|
|
7
40
|
export default configureReactotron;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import ImageResizer from '@bam.tech/react-native-image-resizer';
|
|
1
|
+
import * as ExpoImageManipulator from 'expo-image-manipulator';
|
|
3
2
|
|
|
4
3
|
import { IS_IOS } from '../platformUtils/constants';
|
|
5
4
|
|
|
@@ -36,14 +35,20 @@ export const retrieveFile = async (uri, type) => {
|
|
|
36
35
|
let blob;
|
|
37
36
|
|
|
38
37
|
if (type ? type.includes('image') : isImageByUri(uri)) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
if (ExpoImageManipulator?.manipulateAsync) {
|
|
39
|
+
try {
|
|
40
|
+
const actions = [{ resize: { width: IMG_SIZE, height: IMG_SIZE } }];
|
|
41
|
+
const options = {
|
|
42
|
+
compress: IMG_QUALITY / 100,
|
|
43
|
+
format: ExpoImageManipulator?.SaveFormat?.JPEG ?? 'jpeg',
|
|
44
|
+
base64: false
|
|
45
|
+
};
|
|
46
|
+
const result = await ExpoImageManipulator.manipulateAsync(uri, actions, options);
|
|
47
|
+
blob = await uriToBlob(result.uri);
|
|
48
|
+
} catch (err) {
|
|
49
|
+
blob = await uriToBlob(uriToUse);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
47
52
|
} else {
|
|
48
53
|
blob = await uriToBlob(uriToUse);
|
|
49
54
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@widergy/mobile-ui",
|
|
3
3
|
"description": "Widergy Mobile Components",
|
|
4
4
|
"author": "widergy",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "2.0.0",
|
|
6
6
|
"repository": "https://github.com/widergy/mobile-ui.git",
|
|
7
7
|
"main": "lib/index.js",
|
|
8
8
|
"files": [
|
|
@@ -23,11 +23,9 @@
|
|
|
23
23
|
"prepare": "husky install"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@bam.tech/react-native-image-resizer": "^3.0.7",
|
|
27
26
|
"prop-types": "*",
|
|
28
27
|
"react": "*",
|
|
29
28
|
"react-native": "*",
|
|
30
|
-
"react-native-document-picker": "^9.0.1",
|
|
31
29
|
"react-native-image-picker": "^5.0.0",
|
|
32
30
|
"react-native-linear-gradient": "^2.8.3",
|
|
33
31
|
"react-native-pager-view": "^6.2.0",
|
|
@@ -35,22 +33,26 @@
|
|
|
35
33
|
"react-native-vector-icons": "^10.0.0"
|
|
36
34
|
},
|
|
37
35
|
"dependencies": {
|
|
38
|
-
"@react-native-masked-view/masked-view": "^0.3.
|
|
36
|
+
"@react-native-masked-view/masked-view": "^0.3.2",
|
|
39
37
|
"@react-navigation/native": "^6.1.9",
|
|
40
|
-
"@tabler/icons-react-native": "^3.
|
|
38
|
+
"@tabler/icons-react-native": "^3.34.1",
|
|
41
39
|
"@widergy/web-utils": "^2.0.0",
|
|
42
40
|
"core-js": "3",
|
|
43
|
-
"deprecated-react-native-prop-types": "^
|
|
41
|
+
"deprecated-react-native-prop-types": "^5.0.0",
|
|
42
|
+
"expo-document-picker": "^13.1.6",
|
|
43
|
+
"expo-image-manipulator": "^13.1.7",
|
|
44
|
+
"expo-image-picker": "^16.1.4",
|
|
45
|
+
"invariant": "^2.2.4",
|
|
44
46
|
"lodash": "^4.17.21",
|
|
45
47
|
"numeral": "^2.0.6",
|
|
46
48
|
"pdf-lib": "^1.17.1",
|
|
47
49
|
"react-native-collapsible": "^1.6.1",
|
|
48
50
|
"react-native-linear-gradient": "^2.8.3",
|
|
49
51
|
"react-native-markdown-display": "^7.0.0-alpha.2",
|
|
50
|
-
"react-native-modal": "^13.0.
|
|
51
|
-
"react-native-pager-view": "^6.
|
|
52
|
-
"react-native-safe-area-context": "^
|
|
53
|
-
"react-native-svg": "^
|
|
52
|
+
"react-native-modal": "^13.0.2",
|
|
53
|
+
"react-native-pager-view": "^6.8.0",
|
|
54
|
+
"react-native-safe-area-context": "^5.2.0",
|
|
55
|
+
"react-native-svg": "^15.11.2",
|
|
54
56
|
"react-native-uuid": "^2.0.3"
|
|
55
57
|
},
|
|
56
58
|
"devDependencies": {
|