@codeleap/mobile 4.2.9 → 4.2.11
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/dist/Registry.js +28 -53
- package/dist/Registry.js.map +1 -1
- package/dist/components/ActionIcon/index.js +27 -67
- package/dist/components/ActionIcon/index.js.map +1 -1
- package/dist/components/ActionIcon/styles.js +1 -2
- package/dist/components/ActionIcon/types.js +1 -2
- package/dist/components/ActivityIndicator/index.js +22 -62
- package/dist/components/ActivityIndicator/index.js.map +1 -1
- package/dist/components/ActivityIndicator/styles.js +1 -2
- package/dist/components/ActivityIndicator/types.js +1 -2
- package/dist/components/Autocomplete/index.js +73 -121
- package/dist/components/Autocomplete/index.js.map +1 -1
- package/dist/components/Autocomplete/styles.js +1 -2
- package/dist/components/Autocomplete/types.js +1 -2
- package/dist/components/Avatar/index.js +49 -90
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/Avatar/styles.js +1 -2
- package/dist/components/Avatar/types.js +1 -2
- package/dist/components/AvatarGroup/index.js +30 -75
- package/dist/components/AvatarGroup/index.js.map +1 -1
- package/dist/components/AvatarGroup/styles.js +1 -2
- package/dist/components/AvatarGroup/types.js +1 -2
- package/dist/components/Backdrop/index.js +26 -66
- package/dist/components/Backdrop/index.js.map +1 -1
- package/dist/components/Backdrop/styles.js +1 -2
- package/dist/components/Backdrop/types.js +1 -2
- package/dist/components/Badge/index.js +44 -85
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Badge/styles.js +1 -2
- package/dist/components/Badge/types.js +1 -2
- package/dist/components/Button/index.js +49 -98
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/styles.js +1 -2
- package/dist/components/Button/types.js +1 -2
- package/dist/components/Calendar/index.js +27 -68
- package/dist/components/Calendar/index.js.map +1 -1
- package/dist/components/Calendar/types.d.ts +1 -2
- package/dist/components/Calendar/types.js +1 -2
- package/dist/components/Checkbox/index.js +52 -85
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.js +1 -2
- package/dist/components/Checkbox/types.js +1 -2
- package/dist/components/DatePickerModal/index.js +61 -113
- package/dist/components/DatePickerModal/index.js.map +1 -1
- package/dist/components/DatePickerModal/styles.js +1 -2
- package/dist/components/DatePickerModal/types.js +1 -2
- package/dist/components/EmptyPlaceholder/index.js +40 -69
- package/dist/components/EmptyPlaceholder/index.js.map +1 -1
- package/dist/components/EmptyPlaceholder/styles.js +1 -2
- package/dist/components/EmptyPlaceholder/types.js +1 -2
- package/dist/components/FileInput/index.js +112 -178
- package/dist/components/FileInput/index.js.map +1 -1
- package/dist/components/FileInput/types.js +1 -2
- package/dist/components/Grid/index.js +47 -97
- package/dist/components/Grid/index.js.map +1 -1
- package/dist/components/Grid/styles.js +1 -2
- package/dist/components/Grid/types.js +1 -2
- package/dist/components/Icon/index.js +34 -75
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Icon/styles.js +1 -2
- package/dist/components/Icon/types.js +1 -2
- package/dist/components/Image/index.js +53 -96
- package/dist/components/Image/index.js.map +1 -1
- package/dist/components/Image/styles.js +1 -2
- package/dist/components/Image/types.js +1 -2
- package/dist/components/ImageView/Spotlight.js +75 -131
- package/dist/components/ImageView/Spotlight.js.map +1 -1
- package/dist/components/ImageView/component.js +8 -15
- package/dist/components/ImageView/component.js.map +1 -1
- package/dist/components/ImageView/index.js +2 -18
- package/dist/components/ImageView/index.js.map +1 -1
- package/dist/components/InputBase/index.js +35 -75
- package/dist/components/InputBase/index.js.map +1 -1
- package/dist/components/InputBase/styles.d.ts +3 -3
- package/dist/components/InputBase/styles.js +49 -50
- package/dist/components/InputBase/styles.js.map +1 -1
- package/dist/components/InputBase/types.d.ts +1 -0
- package/dist/components/InputBase/types.js +1 -2
- package/dist/components/InputBase/utils.js +4 -19
- package/dist/components/InputBase/utils.js.map +1 -1
- package/dist/components/List/index.js +46 -86
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/List/styles.js +1 -2
- package/dist/components/List/types.js +1 -2
- package/dist/components/LoadingOverlay/index.js +28 -66
- package/dist/components/LoadingOverlay/index.js.map +1 -1
- package/dist/components/LoadingOverlay/styles.js +1 -2
- package/dist/components/LoadingOverlay/types.js +1 -2
- package/dist/components/Modal/index.js +77 -113
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.js +1 -2
- package/dist/components/Modal/types.js +1 -2
- package/dist/components/Navigation/Navigation.js +23 -66
- package/dist/components/Navigation/Navigation.js.map +1 -1
- package/dist/components/Navigation/constants.js +7 -10
- package/dist/components/Navigation/constants.js.map +1 -1
- package/dist/components/Navigation/index.js +3 -19
- package/dist/components/Navigation/index.js.map +1 -1
- package/dist/components/Navigation/types.js +1 -2
- package/dist/components/Navigation/utils.js +24 -59
- package/dist/components/Navigation/utils.js.map +1 -1
- package/dist/components/NumberIncrement/index.js +132 -165
- package/dist/components/NumberIncrement/index.js.map +1 -1
- package/dist/components/NumberIncrement/styles.js +1 -2
- package/dist/components/NumberIncrement/types.d.ts +2 -2
- package/dist/components/NumberIncrement/types.js +1 -2
- package/dist/components/NumberIncrement/utils.js +8 -12
- package/dist/components/NumberIncrement/utils.js.map +1 -1
- package/dist/components/Pager/PagerDots.js +17 -54
- package/dist/components/Pager/PagerDots.js.map +1 -1
- package/dist/components/Pager/index.js +43 -97
- package/dist/components/Pager/index.js.map +1 -1
- package/dist/components/Pager/styles.js +1 -2
- package/dist/components/Pager/types.js +1 -2
- package/dist/components/PaginationIndicator/index.js +23 -38
- package/dist/components/PaginationIndicator/index.js.map +1 -1
- package/dist/components/PaginationIndicator/styles.js +1 -2
- package/dist/components/PaginationIndicator/types.js +1 -2
- package/dist/components/PlacesAutocomplete/index.js +55 -106
- package/dist/components/PlacesAutocomplete/index.js.map +1 -1
- package/dist/components/PlacesAutocomplete/styles.js +1 -2
- package/dist/components/PlacesAutocomplete/types.js +1 -2
- package/dist/components/RadioInput/index.js +46 -84
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.js +1 -2
- package/dist/components/RadioInput/types.js +1 -2
- package/dist/components/RefreshControl/index.js +22 -63
- package/dist/components/RefreshControl/index.js.map +1 -1
- package/dist/components/RefreshControl/styles.js +1 -2
- package/dist/components/RefreshControl/types.js +1 -2
- package/dist/components/Scroll/index.js +33 -81
- package/dist/components/Scroll/index.js.map +1 -1
- package/dist/components/Scroll/styles.js +1 -2
- package/dist/components/Scroll/types.js +1 -2
- package/dist/components/SearchInput/index.js +22 -69
- package/dist/components/SearchInput/index.js.map +1 -1
- package/dist/components/SectionFilters/context.d.ts +6 -0
- package/dist/components/SectionFilters/context.js +4 -8
- package/dist/components/SectionFilters/context.js.map +1 -1
- package/dist/components/SectionFilters/index.js +33 -76
- package/dist/components/SectionFilters/index.js.map +1 -1
- package/dist/components/SectionFilters/types.js +1 -2
- package/dist/components/SectionFilters/useSectionFilters.d.ts +4 -0
- package/dist/components/SectionFilters/useSectionFilters.js +75 -73
- package/dist/components/SectionFilters/useSectionFilters.js.map +1 -1
- package/dist/components/Sections/index.d.ts +8 -8
- package/dist/components/Sections/index.js +61 -106
- package/dist/components/Sections/index.js.map +1 -1
- package/dist/components/Sections/styles.d.ts +1 -1
- package/dist/components/Sections/styles.js +1 -2
- package/dist/components/Sections/types.js +1 -2
- package/dist/components/SegmentedControl/Option.js +13 -31
- package/dist/components/SegmentedControl/Option.js.map +1 -1
- package/dist/components/SegmentedControl/index.js +71 -114
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SegmentedControl/styles.js +1 -2
- package/dist/components/SegmentedControl/types.js +1 -2
- package/dist/components/Select/index.js +94 -157
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.js +1 -2
- package/dist/components/Select/types.js +1 -2
- package/dist/components/Slider/index.js +89 -129
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/styles.d.ts +0 -6
- package/dist/components/Slider/styles.js +1 -2
- package/dist/components/Slider/types.js +1 -2
- package/dist/components/SortablePhotos/index.js +58 -91
- package/dist/components/SortablePhotos/index.js.map +1 -1
- package/dist/components/SortablePhotos/styles.js +1 -2
- package/dist/components/SortablePhotos/types.js +1 -2
- package/dist/components/SortablePhotos/useSortablePhotos.js +93 -157
- package/dist/components/SortablePhotos/useSortablePhotos.js.map +1 -1
- package/dist/components/Switch/index.js +51 -84
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Switch/styles.js +1 -2
- package/dist/components/Switch/types.js +1 -2
- package/dist/components/Text/index.js +40 -88
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Text/styles.js +1 -2
- package/dist/components/Text/types.js +1 -2
- package/dist/components/TextInput/index.js +83 -131
- package/dist/components/TextInput/index.js.map +1 -1
- package/dist/components/TextInput/styles.js +1 -2
- package/dist/components/TextInput/types.js +1 -2
- package/dist/components/Touchable/index.js +69 -122
- package/dist/components/Touchable/index.js.map +1 -1
- package/dist/components/Touchable/styles.js +1 -2
- package/dist/components/Touchable/types.js +1 -2
- package/dist/components/View/index.js +19 -51
- package/dist/components/View/index.js.map +1 -1
- package/dist/components/View/styles.js +1 -2
- package/dist/components/View/types.js +1 -2
- package/dist/components/components.js +43 -59
- package/dist/components/components.js.map +1 -1
- package/dist/hooks/index.js +7 -11
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.js +8 -43
- package/dist/index.js.map +1 -1
- package/dist/modules/PressableRipple/index.js +2 -8
- package/dist/modules/PressableRipple/index.js.map +1 -1
- package/dist/modules/PressableRipple/ripple.js +125 -163
- package/dist/modules/PressableRipple/ripple.js.map +1 -1
- package/dist/modules/PressableRipple/styles.js +9 -20
- package/dist/modules/PressableRipple/styles.js.map +1 -1
- package/dist/modules/PressableRipple/type.js +1 -2
- package/dist/modules/reactNavigation.js +10 -21
- package/dist/modules/reactNavigation.js.map +1 -1
- package/dist/modules/textInputMask.js +3 -20
- package/dist/modules/textInputMask.js.map +1 -1
- package/dist/modules/types/textInputMask.js +1 -2
- package/dist/types/index.js +1 -17
- package/dist/types/index.js.map +1 -1
- package/dist/types/utility.js +1 -2
- package/dist/utils/KeyboardAware/context.js +5 -14
- package/dist/utils/KeyboardAware/context.js.map +1 -1
- package/dist/utils/KeyboardAware/index.js +3 -19
- package/dist/utils/KeyboardAware/index.js.map +1 -1
- package/dist/utils/KeyboardAware/keyboardHooks.js +36 -41
- package/dist/utils/KeyboardAware/keyboardHooks.js.map +1 -1
- package/dist/utils/KeyboardAware/types.js +1 -2
- package/dist/utils/KeyboardAware/types.js.map +1 -1
- package/dist/utils/ModalManager/components.js +24 -54
- package/dist/utils/ModalManager/components.js.map +1 -1
- package/dist/utils/ModalManager/context.js +94 -89
- package/dist/utils/ModalManager/context.js.map +1 -1
- package/dist/utils/ModalManager/index.js +7 -10
- package/dist/utils/ModalManager/index.js.map +1 -1
- package/dist/utils/NotificationManager/index.js +115 -245
- package/dist/utils/NotificationManager/index.js.map +1 -1
- package/dist/utils/NotificationManager/types.js +1 -2
- package/dist/utils/OSAlert.js +32 -48
- package/dist/utils/OSAlert.js.map +1 -1
- package/dist/utils/PermissionManager/context.js +138 -255
- package/dist/utils/PermissionManager/context.js.map +1 -1
- package/dist/utils/PermissionManager/index.js +2 -8
- package/dist/utils/PermissionManager/index.js.map +1 -1
- package/dist/utils/PermissionManager/types.js +1 -2
- package/dist/utils/StorageManager.js +39 -46
- package/dist/utils/StorageManager.js.map +1 -1
- package/dist/utils/Subscription.js +30 -54
- package/dist/utils/Subscription.js.map +1 -1
- package/dist/utils/deprecated/notifications.js +143 -250
- package/dist/utils/deprecated/notifications.js.map +1 -1
- package/dist/utils/hooks.js +101 -120
- package/dist/utils/hooks.js.map +1 -1
- package/dist/utils/index.js +14 -43
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/input.js +15 -19
- package/dist/utils/input.js.map +1 -1
- package/dist/utils/locale.js +5 -9
- package/dist/utils/locale.js.map +1 -1
- package/dist/utils/misc.js +25 -40
- package/dist/utils/misc.js.map +1 -1
- package/dist/utils/theme.js +24 -33
- package/dist/utils/theme.js.map +1 -1
- package/dist/utils/useQueryListRefresh.js +16 -26
- package/dist/utils/useQueryListRefresh.js.map +1 -1
- package/package.json +6 -6
- package/package.json.bak +2 -2
- package/src/components/Calendar/types.ts +3 -3
- package/src/components/InputBase/styles.ts +35 -23
- package/src/components/InputBase/types.ts +1 -0
- package/src/components/NumberIncrement/index.tsx +8 -2
- package/src/components/NumberIncrement/types.ts +3 -3
- package/src/components/RadioInput/index.tsx +4 -0
- package/src/components/SectionFilters/useSectionFilters.tsx +39 -1
- package/src/components/Sections/index.tsx +3 -2
- package/src/components/Sections/styles.ts +2 -2
- package/src/components/Slider/index.tsx +9 -1
- package/src/components/Slider/styles.ts +0 -6
- package/src/components/TextInput/index.tsx +5 -0
package/dist/utils/hooks.js
CHANGED
|
@@ -1,73 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.useKeyboardPaddingStyle = exports.useBackButton = exports.usePressableFeedback = exports.useAnimatedVariantStyles = exports.useStaticAnimationStyles = exports.useAppState = exports.useAnimateColor = void 0;
|
|
15
|
-
var common_1 = require("@codeleap/common");
|
|
16
|
-
var react_native_1 = require("react-native");
|
|
17
|
-
var react_native_reanimated_1 = require("react-native-reanimated");
|
|
18
|
-
var react_native_avoid_softinput_1 = require("react-native-avoid-softinput");
|
|
19
|
-
var react_1 = require("react");
|
|
20
|
-
var styles_1 = require("@codeleap/styles");
|
|
21
|
-
function useAnimateColor(value, opts) {
|
|
22
|
-
var iters = (0, common_1.useRef)(0);
|
|
23
|
-
var anim = (0, common_1.useState)(new react_native_1.Animated.Value(iters.current))[0];
|
|
24
|
-
var _prev = (0, common_1.usePrevious)(value);
|
|
25
|
-
var prev = _prev || value;
|
|
26
|
-
(0, common_1.onUpdate)(function () {
|
|
1
|
+
import { onMount, onUpdate, shadeColor, TypeGuards, usePrevious, useRef, useState } from '@codeleap/common';
|
|
2
|
+
import { Animated, AppState, Platform, BackHandler, StyleSheet } from 'react-native';
|
|
3
|
+
import { Easing, useAnimatedStyle, withTiming } from 'react-native-reanimated';
|
|
4
|
+
import { useSoftInputState } from 'react-native-avoid-softinput';
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
import { mergeStyles } from '@codeleap/styles';
|
|
7
|
+
export function useAnimateColor(value, opts) {
|
|
8
|
+
const iters = useRef(0);
|
|
9
|
+
const [anim] = useState(new Animated.Value(iters.current));
|
|
10
|
+
const _prev = usePrevious(value);
|
|
11
|
+
const prev = _prev || value;
|
|
12
|
+
onUpdate(() => {
|
|
27
13
|
// if (value === prev) return
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
const animation = Animated.timing(anim, {
|
|
15
|
+
...opts,
|
|
16
|
+
toValue: iters.current + 1,
|
|
17
|
+
useNativeDriver: false,
|
|
18
|
+
});
|
|
19
|
+
animation.start(() => {
|
|
30
20
|
iters.current += 1;
|
|
31
21
|
});
|
|
32
|
-
return
|
|
22
|
+
return () => {
|
|
33
23
|
animation.stop();
|
|
34
24
|
};
|
|
35
25
|
}, [value]);
|
|
36
|
-
|
|
26
|
+
const color = anim.interpolate({
|
|
37
27
|
outputRange: [prev, value],
|
|
38
28
|
inputRange: [iters.current, iters.current + 1],
|
|
39
29
|
});
|
|
40
30
|
return color;
|
|
41
31
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
react_native_1.AppState.addEventListener('change', function (s) {
|
|
32
|
+
export function useAppState(filter) {
|
|
33
|
+
const [appState, setAppState] = useState(() => AppState.currentState);
|
|
34
|
+
onMount(() => {
|
|
35
|
+
AppState.addEventListener('change', s => {
|
|
47
36
|
if (!filter || filter.includes(s)) {
|
|
48
37
|
setAppState(s);
|
|
49
38
|
}
|
|
50
39
|
});
|
|
51
40
|
});
|
|
52
41
|
return {
|
|
53
|
-
appState
|
|
42
|
+
appState,
|
|
54
43
|
};
|
|
55
44
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var styles = (0, common_1.useRef)({});
|
|
45
|
+
export function useStaticAnimationStyles(obj, keys) {
|
|
46
|
+
const styles = useRef({});
|
|
59
47
|
if (Object.keys(styles.current).length === 0) {
|
|
60
|
-
|
|
48
|
+
const mappedStyles = keys.map((k) => [k, { ...obj[k] }]);
|
|
61
49
|
styles.current = Object.fromEntries(mappedStyles);
|
|
62
50
|
}
|
|
63
51
|
return styles.current;
|
|
64
52
|
}
|
|
65
|
-
|
|
66
|
-
var buildAnimatedStyle = function (property, value, currentStyle, applyFN) {
|
|
53
|
+
const buildAnimatedStyle = (property, value, currentStyle, applyFN = (v) => v) => {
|
|
67
54
|
'worklet';
|
|
68
|
-
|
|
69
|
-
if (applyFN === void 0) { applyFN = function (v) { return v; }; }
|
|
70
|
-
var newStyle = __assign({}, currentStyle);
|
|
55
|
+
const newStyle = { ...currentStyle };
|
|
71
56
|
switch (property) {
|
|
72
57
|
case 'opacity':
|
|
73
58
|
newStyle.opacity = applyFN(value);
|
|
@@ -83,146 +68,142 @@ var buildAnimatedStyle = function (property, value, currentStyle, applyFN) {
|
|
|
83
68
|
if (!newStyle.transform) {
|
|
84
69
|
newStyle.transform = [];
|
|
85
70
|
}
|
|
86
|
-
newStyle.transform.push(
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
newStyle.transform.push({
|
|
72
|
+
[property]: applyFN(value),
|
|
73
|
+
});
|
|
89
74
|
default:
|
|
90
75
|
newStyle[property] = value;
|
|
91
76
|
break;
|
|
92
77
|
}
|
|
93
78
|
return newStyle;
|
|
94
79
|
};
|
|
95
|
-
|
|
80
|
+
const transformProperties = (properties, transition) => {
|
|
96
81
|
'worklet';
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
82
|
+
let styles = {};
|
|
83
|
+
for (const [prop, value] of Object.entries(properties)) {
|
|
84
|
+
const transitionConfig = transition[prop] || transition;
|
|
85
|
+
const _transitionConfig = {
|
|
86
|
+
type: 'timing',
|
|
87
|
+
duration: 100,
|
|
88
|
+
easing: Easing.linear,
|
|
89
|
+
...transitionConfig,
|
|
90
|
+
};
|
|
91
|
+
const { type, duration, easing } = _transitionConfig;
|
|
92
|
+
let fn = (v) => v;
|
|
103
93
|
switch (type) {
|
|
104
94
|
case 'timing':
|
|
105
|
-
fn =
|
|
106
|
-
duration
|
|
107
|
-
easing
|
|
108
|
-
});
|
|
95
|
+
fn = (v) => withTiming(v, {
|
|
96
|
+
duration,
|
|
97
|
+
easing,
|
|
98
|
+
});
|
|
109
99
|
break;
|
|
110
100
|
default:
|
|
111
101
|
break;
|
|
112
102
|
}
|
|
113
103
|
styles = buildAnimatedStyle(prop, value, styles, fn);
|
|
114
|
-
};
|
|
115
|
-
for (var _i = 0, _a = Object.entries(properties); _i < _a.length; _i++) {
|
|
116
|
-
var _b = _a[_i], prop = _b[0], value = _b[1];
|
|
117
|
-
_loop_1(prop, value);
|
|
118
104
|
}
|
|
119
105
|
return styles;
|
|
120
106
|
};
|
|
121
|
-
function useAnimatedVariantStyles(config) {
|
|
122
|
-
|
|
123
|
-
|
|
107
|
+
export function useAnimatedVariantStyles(config) {
|
|
108
|
+
const { animatedProperties, updater, variantStyles, transition = {}, dependencies = [] } = config;
|
|
109
|
+
const _transition = useRef(null);
|
|
124
110
|
if (!_transition.current) {
|
|
125
111
|
_transition.current = JSON.parse(JSON.stringify(transition || {}));
|
|
126
112
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
113
|
+
const staticStyles = useStaticAnimationStyles(variantStyles, animatedProperties);
|
|
114
|
+
const animated = useAnimatedStyle(() => {
|
|
115
|
+
const nextState = updater(staticStyles);
|
|
116
|
+
const formatted = transformProperties(nextState, _transition.current);
|
|
131
117
|
return formatted;
|
|
132
118
|
}, dependencies);
|
|
133
119
|
return animated;
|
|
134
120
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
121
|
+
export function usePressableFeedback(styles, config) {
|
|
122
|
+
const { disabled, feedbackConfig, hightlightPropertyIn = 'backgroundColor', hightlightPropertyOut = 'backgroundColor', } = config;
|
|
123
|
+
const _feedbackConfig = {
|
|
124
|
+
...feedbackConfig,
|
|
125
|
+
};
|
|
126
|
+
let style;
|
|
127
|
+
if (TypeGuards.isObject(styles)) {
|
|
128
|
+
style = styles?.[hightlightPropertyIn];
|
|
142
129
|
}
|
|
143
|
-
else if (
|
|
144
|
-
style = styles.reverse().find(
|
|
130
|
+
else if (TypeGuards.isArray(styles)) {
|
|
131
|
+
style = styles.reverse().find(s => s[hightlightPropertyIn]);
|
|
145
132
|
}
|
|
146
133
|
else {
|
|
147
|
-
style =
|
|
134
|
+
style = StyleSheet.flatten(styles)[hightlightPropertyIn];
|
|
148
135
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
136
|
+
const disableFeedback = disabled;
|
|
137
|
+
const rippleEnabled = _feedbackConfig?.type === 'ripple' && !disableFeedback;
|
|
138
|
+
const rippleConfig = rippleEnabled ? _feedbackConfig?.config : null;
|
|
152
139
|
function getFeedbackStyle(pressed) {
|
|
153
|
-
var _a;
|
|
154
140
|
if (disableFeedback)
|
|
155
141
|
return {};
|
|
156
|
-
|
|
157
|
-
if (rippleEnabled && feedbackConfig.type === 'ripple' &&
|
|
158
|
-
feedbackConfig = feedbackConfig
|
|
142
|
+
let feedbackConfig = { ..._feedbackConfig };
|
|
143
|
+
if (rippleEnabled && feedbackConfig.type === 'ripple' && Platform.OS === 'ios' && !!_feedbackConfig?.iosFallback) {
|
|
144
|
+
feedbackConfig = feedbackConfig?.iosFallback;
|
|
159
145
|
}
|
|
160
146
|
switch (feedbackConfig.type) {
|
|
161
147
|
case 'highlight':
|
|
162
148
|
if (!pressed && hightlightPropertyIn !== hightlightPropertyOut)
|
|
163
149
|
return {};
|
|
164
|
-
|
|
150
|
+
let highlightColorDefault = style || '#0000';
|
|
165
151
|
if (pressed) {
|
|
166
|
-
if (feedbackConfig
|
|
167
|
-
highlightColorDefault = feedbackConfig
|
|
152
|
+
if (feedbackConfig?.color) {
|
|
153
|
+
highlightColorDefault = feedbackConfig?.color;
|
|
168
154
|
}
|
|
169
155
|
else {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (!
|
|
156
|
+
let opacity = feedbackConfig?.shiftOpacity;
|
|
157
|
+
let brightness = feedbackConfig?.brightness;
|
|
158
|
+
if (!TypeGuards.isNumber(opacity)) {
|
|
173
159
|
opacity = 1;
|
|
174
160
|
}
|
|
175
|
-
if (!
|
|
161
|
+
if (!TypeGuards.isNumber(brightness)) {
|
|
176
162
|
brightness = 0;
|
|
177
163
|
}
|
|
178
|
-
highlightColorDefault =
|
|
164
|
+
highlightColorDefault = shadeColor(highlightColorDefault, brightness * 100, opacity);
|
|
179
165
|
}
|
|
180
166
|
}
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
|
|
167
|
+
return {
|
|
168
|
+
[hightlightPropertyOut]: highlightColorDefault,
|
|
169
|
+
};
|
|
184
170
|
break;
|
|
185
171
|
case 'opacity':
|
|
186
172
|
return {
|
|
187
|
-
opacity: pressed ? feedbackConfig
|
|
173
|
+
opacity: pressed ? feedbackConfig?.value : 1,
|
|
188
174
|
};
|
|
189
175
|
case 'styles':
|
|
190
|
-
return pressed ? feedbackConfig
|
|
176
|
+
return pressed ? feedbackConfig?.styles : {};
|
|
191
177
|
case 'none':
|
|
192
178
|
return {};
|
|
193
179
|
}
|
|
194
180
|
}
|
|
195
181
|
return {
|
|
196
|
-
getFeedbackStyle
|
|
197
|
-
rippleConfig
|
|
182
|
+
getFeedbackStyle,
|
|
183
|
+
rippleConfig,
|
|
198
184
|
};
|
|
199
185
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
var stopBubbling = cb();
|
|
206
|
-
if (common_1.TypeGuards.isBoolean(stopBubbling)) {
|
|
186
|
+
export function useBackButton(cb, deps = []) {
|
|
187
|
+
onUpdate(() => {
|
|
188
|
+
const subscription = BackHandler.addEventListener('hardwareBackPress', () => {
|
|
189
|
+
const stopBubbling = cb();
|
|
190
|
+
if (TypeGuards.isBoolean(stopBubbling)) {
|
|
207
191
|
return stopBubbling;
|
|
208
192
|
}
|
|
209
193
|
return false;
|
|
210
194
|
});
|
|
211
|
-
return
|
|
195
|
+
return () => {
|
|
212
196
|
subscription.remove();
|
|
213
197
|
};
|
|
214
198
|
}, deps);
|
|
215
199
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
var propStyle = (0, react_1.useMemo)(function () {
|
|
221
|
-
return react_native_1.StyleSheet.flatten(styles);
|
|
200
|
+
export function useKeyboardPaddingStyle(styles, enabled = true) {
|
|
201
|
+
const { isSoftInputShown, softInputHeight } = useSoftInputState();
|
|
202
|
+
const propStyle = useMemo(() => {
|
|
203
|
+
return StyleSheet.flatten(styles);
|
|
222
204
|
}, styles);
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return isSoftInputShown && enabled ?
|
|
205
|
+
const bottomPadding = propStyle && TypeGuards.isNumber(propStyle.paddingBottom) ? propStyle.paddingBottom : 0;
|
|
206
|
+
const totalPadding = softInputHeight + bottomPadding;
|
|
207
|
+
return isSoftInputShown && enabled ? mergeStyles([propStyle, { paddingBottom: totalPadding }]) : propStyle;
|
|
226
208
|
}
|
|
227
|
-
exports.useKeyboardPaddingStyle = useKeyboardPaddingStyle;
|
|
228
209
|
//# sourceMappingURL=hooks.js.map
|
package/dist/utils/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/utils/hooks.ts"],"names":[],"m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}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
-
};
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Permissions = void 0;
|
|
30
|
-
__exportStar(require("./OSAlert"), exports);
|
|
31
|
-
__exportStar(require("./hooks"), exports);
|
|
32
|
-
__exportStar(require("./misc"), exports);
|
|
33
|
-
__exportStar(require("./NotificationManager"), exports);
|
|
34
|
-
__exportStar(require("./ModalManager"), exports);
|
|
35
|
-
var Permissions = __importStar(require("./PermissionManager"));
|
|
36
|
-
exports.Permissions = Permissions;
|
|
37
|
-
__exportStar(require("./KeyboardAware"), exports);
|
|
38
|
-
__exportStar(require("./input"), exports);
|
|
39
|
-
__exportStar(require("./theme"), exports);
|
|
40
|
-
__exportStar(require("./locale"), exports);
|
|
41
|
-
__exportStar(require("./Subscription"), exports);
|
|
42
|
-
__exportStar(require("./useQueryListRefresh"), exports);
|
|
43
|
-
__exportStar(require("./StorageManager"), exports);
|
|
1
|
+
export * from './OSAlert';
|
|
2
|
+
export * from './hooks';
|
|
3
|
+
export * from './misc';
|
|
4
|
+
export * from './NotificationManager';
|
|
5
|
+
export * from './ModalManager';
|
|
6
|
+
import * as Permissions from './PermissionManager';
|
|
7
|
+
export { Permissions };
|
|
8
|
+
export * from './KeyboardAware';
|
|
9
|
+
export * from './input';
|
|
10
|
+
export * from './theme';
|
|
11
|
+
export * from './locale';
|
|
12
|
+
export * from './Subscription';
|
|
13
|
+
export * from './useQueryListRefresh';
|
|
14
|
+
export * from './StorageManager';
|
|
44
15
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAA;AAElD,OAAO,EAAE,WAAW,EAAE,CAAA;AACtB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AAErC,cAAc,kBAAkB,CAAA"}
|
package/dist/utils/input.js
CHANGED
|
@@ -1,37 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mobileInputPresets = void 0;
|
|
4
|
-
var createInputPresets = function (p) {
|
|
1
|
+
const createInputPresets = (p) => {
|
|
5
2
|
return p;
|
|
6
3
|
};
|
|
7
|
-
|
|
8
|
-
email:
|
|
4
|
+
export const mobileInputPresets = createInputPresets({
|
|
5
|
+
email: () => ({
|
|
9
6
|
keyboardType: 'email-address',
|
|
10
7
|
autoCapitalize: 'none',
|
|
11
8
|
autoComplete: 'email',
|
|
12
9
|
textContentType: 'emailAddress',
|
|
13
|
-
})
|
|
14
|
-
name:
|
|
10
|
+
}),
|
|
11
|
+
name: () => ({
|
|
15
12
|
autoCapitalize: 'words',
|
|
16
13
|
autoComplete: 'name',
|
|
17
14
|
textContentType: 'name',
|
|
18
|
-
})
|
|
19
|
-
chat:
|
|
15
|
+
}),
|
|
16
|
+
chat: () => ({
|
|
20
17
|
returnKeyType: 'send',
|
|
21
|
-
})
|
|
22
|
-
password:
|
|
18
|
+
}),
|
|
19
|
+
password: (options) => {
|
|
23
20
|
return {
|
|
24
21
|
autoCapitalize: 'none',
|
|
25
|
-
autoComplete:
|
|
26
|
-
textContentType:
|
|
22
|
+
autoComplete: options?.new ? 'password-new' : 'password',
|
|
23
|
+
textContentType: options?.new ? 'newPassword' : 'password',
|
|
27
24
|
};
|
|
28
25
|
},
|
|
29
|
-
search:
|
|
26
|
+
search: () => ({
|
|
30
27
|
returnKeyType: 'search',
|
|
31
|
-
})
|
|
32
|
-
redeemCode:
|
|
33
|
-
|
|
34
|
-
var isJoin = action === 'join';
|
|
28
|
+
}),
|
|
29
|
+
redeemCode: (action = 'obtain') => {
|
|
30
|
+
const isJoin = action === 'join';
|
|
35
31
|
if (isJoin) {
|
|
36
32
|
return {
|
|
37
33
|
returnKeyType: 'join',
|
package/dist/utils/input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/utils/input.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/utils/input.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAG,CAAuE,CAAG,EAAI,EAAE;IACzG,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;IACnD,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QACZ,YAAY,EAAE,eAAe;QAC7B,cAAc,EAAE,MAAM;QACtB,YAAY,EAAE,OAAO;QACrB,eAAe,EAAE,cAAc;KAEhC,CAAC;IACF,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACX,cAAc,EAAE,OAAO;QACvB,YAAY,EAAE,MAAM;QACpB,eAAe,EAAE,MAAM;KAExB,CAAC;IACF,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACX,aAAa,EAAE,MAAM;KAEtB,CAAC;IACF,QAAQ,EAAE,CAAC,OAAyB,EAAE,EAAE;QACtC,OAAO;YACL,cAAc,EAAE,MAAM;YACtB,YAAY,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU;YACxD,eAAe,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU;SAC3D,CAAA;IACH,CAAC;IACD,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QACb,aAAa,EAAE,QAAQ;KACxB,CAAC;IACF,UAAU,EAAE,CAAC,SAAyB,QAAQ,EAAE,EAAE;QAChD,MAAM,MAAM,GAAG,MAAM,KAAK,MAAM,CAAA;QAChC,IAAI,MAAM,EAAE;YACV,OAAO;gBACL,aAAa,EAAE,MAAM;gBACrB,eAAe,EAAE,aAAa;gBAC9B,YAAY,EAAE,SAAS;aACxB,CAAA;SACF;QACD,OAAO;YACL,aAAa,EAAE,MAAM;YACrB,eAAe,EAAE,aAAa;YAC9B,YAAY,EAAE,SAAS;SACxB,CAAA;IAEH,CAAC;CACF,CAAC,CAAA"}
|
package/dist/utils/locale.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
? react_native_1.NativeModules.SettingsManager.settings.AppleLocale ||
|
|
7
|
-
react_native_1.NativeModules.SettingsManager.settings.AppleLanguages[0]
|
|
8
|
-
: react_native_1.NativeModules.I18nManager.localeIdentifier; };
|
|
9
|
-
exports.getDeviceLocale = getDeviceLocale;
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
export const getDeviceLocale = () => Platform.OS === 'ios'
|
|
3
|
+
? NativeModules.SettingsManager.settings.AppleLocale ||
|
|
4
|
+
NativeModules.SettingsManager.settings.AppleLanguages[0]
|
|
5
|
+
: NativeModules.I18nManager.localeIdentifier;
|
|
10
6
|
//# sourceMappingURL=locale.js.map
|
package/dist/utils/locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/utils/locale.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/utils/locale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEtD,MAAM,CAAC,MAAM,eAAe,GAAG,GAAW,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK;IAChE,CAAC,CAAC,aAAa,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW;QAChD,aAAa,CAAC,eAAe,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,gBAAgB,CAAA"}
|