@codeleap/mobile 2.3.25 → 2.3.27
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/components/ActionIcon/index.js +1 -5
- package/dist/components/ActionIcon/index.js.map +1 -1
- package/dist/components/ActivityIndicator/index.js +1 -5
- package/dist/components/ActivityIndicator/index.js.map +1 -1
- package/dist/components/Animated.d.ts +1 -110
- package/dist/components/Animated.js +1 -5
- package/dist/components/Animated.js.map +1 -1
- package/dist/components/AutoComplete/index.js +1 -5
- package/dist/components/AutoComplete/index.js.map +1 -1
- package/dist/components/Backdrop/index.d.ts +3 -3
- package/dist/components/Backdrop/index.js +2 -6
- package/dist/components/Backdrop/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +4 -4
- package/dist/components/Button/index.js +1 -5
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Calendar/index.js +1 -5
- package/dist/components/Calendar/index.js.map +1 -1
- package/dist/components/Checkbox/index.js +1 -5
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/ContentView/index.js +1 -5
- package/dist/components/ContentView/index.js.map +1 -1
- package/dist/components/Drawer/index.js +1 -5
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/EmptyPlaceholder/index.js +1 -5
- package/dist/components/EmptyPlaceholder/index.js.map +1 -1
- package/dist/components/FileInput/index.js +1 -5
- package/dist/components/FileInput/index.js.map +1 -1
- package/dist/components/Grid/index.js +1 -5
- package/dist/components/Grid/index.js.map +1 -1
- package/dist/components/Icon/index.js +1 -5
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Image/index.js +1 -5
- package/dist/components/Image/index.js.map +1 -1
- package/dist/components/ImageView/Spotlight.d.ts +1 -1
- package/dist/components/ImageView/Spotlight.js +1 -5
- package/dist/components/ImageView/Spotlight.js.map +1 -1
- package/dist/components/ImageView/component.js +1 -5
- package/dist/components/ImageView/component.js.map +1 -1
- package/dist/components/ImageView/index.js +1 -5
- package/dist/components/ImageView/index.js.map +1 -1
- package/dist/components/InputLabel/index.js +1 -5
- package/dist/components/InputLabel/index.js.map +1 -1
- package/dist/components/List/index.js +1 -5
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/Modal/index.js +1 -5
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/MultiSelect/index.js +1 -5
- package/dist/components/MultiSelect/index.js.map +1 -1
- package/dist/components/Navigation/Navigation.js +1 -5
- package/dist/components/Navigation/Navigation.js.map +1 -1
- package/dist/components/Navigation/index.js +1 -5
- package/dist/components/Navigation/index.js.map +1 -1
- package/dist/components/Pager/index.js +1 -5
- package/dist/components/Pager/index.js.map +1 -1
- package/dist/components/RadioInput/index.js +1 -5
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/Scroll/index.d.ts +105 -1
- package/dist/components/Scroll/index.js +2 -6
- package/dist/components/Scroll/index.js.map +1 -1
- package/dist/components/Sections/index.d.ts +105 -1
- package/dist/components/Sections/index.js +1 -5
- package/dist/components/Sections/index.js.map +1 -1
- package/dist/components/SegmentedControl/index.js +1 -5
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/Select/index.js +1 -5
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Slider/index.js +1 -5
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Switch/index.js +1 -5
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Text/index.js +1 -5
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/TextInput/index.js +1 -5
- package/dist/components/TextInput/index.js.map +1 -1
- package/dist/components/Touchable/index.d.ts +2 -2
- package/dist/components/Touchable/index.js +1 -5
- package/dist/components/Touchable/index.js.map +1 -1
- package/dist/components/View/index.d.ts +7 -116
- package/dist/components/View/index.js +2 -8
- package/dist/components/View/index.js.map +1 -1
- package/dist/components/components.d.ts +0 -2
- package/dist/components/components.js +1 -20
- package/dist/components/components.js.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/modules/textInputMask.js +1 -5
- package/dist/modules/textInputMask.js.map +1 -1
- package/dist/types/index.js +1 -5
- package/dist/types/index.js.map +1 -1
- package/dist/types/utility.d.ts +8 -2
- package/dist/utils/KeyboardAware/index.js +1 -5
- package/dist/utils/KeyboardAware/index.js.map +1 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js +0 -12
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js.map +1 -1
- package/dist/utils/ModalManager/components.js +1 -5
- package/dist/utils/ModalManager/components.js.map +1 -1
- package/dist/utils/ModalManager/context.js +1 -5
- package/dist/utils/ModalManager/context.js.map +1 -1
- package/dist/utils/OSAlert.js.map +1 -1
- package/dist/utils/PermissionManager/context.d.ts +1 -0
- package/dist/utils/PermissionManager/context.js +11 -8
- package/dist/utils/PermissionManager/context.js.map +1 -1
- package/dist/utils/index.js +1 -5
- package/dist/utils/index.js.map +1 -1
- package/package.json +9 -8
- package/src/components/Backdrop/index.tsx +5 -3
- package/src/components/Grid/index.tsx +4 -3
- package/src/components/ImageView/Spotlight.tsx +1 -1
- package/src/components/Pager/index.tsx +1 -0
- package/src/components/Scroll/index.tsx +1 -1
- package/src/components/SegmentedControl/index.tsx +1 -0
- package/src/components/Text/index.tsx +1 -0
- package/src/components/Touchable/index.tsx +17 -15
- package/src/components/View/index.tsx +16 -13
- package/src/components/components.ts +1 -4
- package/src/types/utility.ts +12 -5
- package/src/utils/KeyboardAware/lib/KeyboardAwareHOC.tsx +3 -29
- package/src/utils/PermissionManager/context.tsx +16 -4
- package/CodeLeap-Mobile-Packages.code-workspace +0 -8
- package/dist/components/legacy/Modal/index.d.ts +0 -28
- package/dist/components/legacy/Modal/index.js +0 -114
- package/dist/components/legacy/Modal/index.js.map +0 -1
- package/dist/components/legacy/Modal/styles.d.ts +0 -64
- package/dist/components/legacy/Modal/styles.js +0 -60
- package/dist/components/legacy/Modal/styles.js.map +0 -1
- package/dist/components/legacy/Pager/index.d.ts +0 -20
- package/dist/components/legacy/Pager/index.js +0 -168
- package/dist/components/legacy/Pager/index.js.map +0 -1
- package/dist/components/legacy/Pager/styles.d.ts +0 -54
- package/dist/components/legacy/Pager/styles.js +0 -44
- package/dist/components/legacy/Pager/styles.js.map +0 -1
- package/dist/components/legacy/index.d.ts +0 -2
- package/dist/components/legacy/index.js +0 -19
- package/dist/components/legacy/index.js.map +0 -1
- package/src/components/legacy/Modal/index.tsx +0 -163
- package/src/components/legacy/Modal/styles.ts +0 -125
- package/src/components/legacy/Pager/index.tsx +0 -242
- package/src/components/legacy/Pager/styles.ts +0 -51
- package/src/components/legacy/index.ts +0 -2
|
@@ -12,11 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
16
|
}) : (function(o, m, k, k2) {
|
|
21
17
|
if (k2 === undefined) k2 = k;
|
|
22
18
|
o[k2] = m[k];
|
|
@@ -72,7 +68,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
72
68
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
73
69
|
exports.createTypedPermissionHooks = exports.usePermissionModal = exports.usePermissions = exports.Provider = void 0;
|
|
74
70
|
var react_1 = __importStar(require("react"));
|
|
75
|
-
var
|
|
71
|
+
var context_1 = require("../ModalManager/context");
|
|
76
72
|
var common_1 = require("@codeleap/common");
|
|
77
73
|
var react_native_1 = require("react-native");
|
|
78
74
|
var PermissionContext = react_1.default.createContext({});
|
|
@@ -98,17 +94,22 @@ function Provider(_a) {
|
|
|
98
94
|
}
|
|
99
95
|
});
|
|
100
96
|
});
|
|
97
|
+
var setPermissionState = function (forPermission, status) {
|
|
98
|
+
var _a;
|
|
99
|
+
setState(__assign(__assign({}, state), (_a = {}, _a[forPermission] = status, _a)));
|
|
100
|
+
};
|
|
101
101
|
return <PermissionContext.Provider value={{
|
|
102
102
|
state: state,
|
|
103
103
|
modalConfig: modalConfig,
|
|
104
104
|
manager: AppPermissions,
|
|
105
|
+
setState: setPermissionState
|
|
105
106
|
}}>
|
|
106
107
|
{children}
|
|
107
108
|
</PermissionContext.Provider>;
|
|
108
109
|
}
|
|
109
110
|
exports.Provider = Provider;
|
|
110
111
|
var usePermissions = function () {
|
|
111
|
-
var modalCtx =
|
|
112
|
+
var modalCtx = (0, context_1.useModalContext)();
|
|
112
113
|
var permissionCtx = (0, react_1.useContext)(PermissionContext);
|
|
113
114
|
function askPermission(name, onResolve) {
|
|
114
115
|
return new Promise(function (resolve, reject) {
|
|
@@ -167,6 +168,7 @@ var usePermissions = function () {
|
|
|
167
168
|
props: {
|
|
168
169
|
onPermissionResolve: function (status) {
|
|
169
170
|
resolve(status);
|
|
171
|
+
permissionCtx.setState(permission, status);
|
|
170
172
|
},
|
|
171
173
|
},
|
|
172
174
|
});
|
|
@@ -179,6 +181,7 @@ var usePermissions = function () {
|
|
|
179
181
|
modalCtx.toggleModal(permissionModalName, true, {
|
|
180
182
|
onPermissionResolve: function (status) {
|
|
181
183
|
resolve(status);
|
|
184
|
+
permissionCtx.setState(permission, status);
|
|
182
185
|
},
|
|
183
186
|
});
|
|
184
187
|
});
|
|
@@ -230,7 +233,7 @@ exports.usePermissions = usePermissions;
|
|
|
230
233
|
function usePermissionModal(permissionName) {
|
|
231
234
|
var _a;
|
|
232
235
|
var modalId = "permissions.".concat(permissionName);
|
|
233
|
-
var modals =
|
|
236
|
+
var modals = (0, context_1.useModalContext)();
|
|
234
237
|
var permissionCtx = (0, exports.usePermissions)();
|
|
235
238
|
var modalState = modals.state[modalId];
|
|
236
239
|
var currentState = (_a = permissionCtx === null || permissionCtx === void 0 ? void 0 : permissionCtx.state) === null || _a === void 0 ? void 0 : _a[permissionName];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/utils/PermissionManager/context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/utils/PermissionManager/context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAmD;AACnD,mDAAyD;AACzD,2CAA6H;AAC7H,6CAAgD;AAUhD,IAAM,iBAAiB,GAAG,eAAK,CAAC,aAAa,CAAC,EAAwB,CAAC,CAAA;AAQvE,SAAS,WAAW,CAAC,KAAwB;IAC3C,IAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAC,EAAM;YAAL,CAAC,QAAA,EAAE,CAAC,QAAA;QAAM,OAAA,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC;IAAb,CAAa,CAAC,CAAA;IACrE,OAAO,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;AACrC,CAAC;AAED,SAAgB,QAAQ,CAAC,EAAiE;QAA/D,QAAQ,cAAA,EAAE,cAAc,oBAAA,EAAE,WAAW,iBAAA;IAExD,IAAA,KAAoB,IAAA,gBAAQ,EAAC,cAAM,OAAA,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC,EAAlC,CAAkC,CAAC,EAArE,KAAK,QAAA,EAAE,QAAQ,QAAsD,CAAA;IAE5E,IAAA,gBAAO,EAAC;QAEN,uBAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAC,KAAK;YACxC,IAAI,KAAK,KAAK,QAAQ,EAAE;gBACtB,cAAc,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,UAAC,I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P,cAAc,gBAAA;QACd,UAAU,eACL,UAAU,CAEd;QACD,YAAY,cAAA;QACZ,MAAM,QAAA;KACP,CAAA;AACH,CAAC;AAlFD,gDAkFC;AAgBD,SAAgB,0BAA0B,CAIxC,aAAgD;IAEhD,IAAM,eAAe,GAAG,sBAA+E,CAAA;IACvG,IAAM,mBAAmB,GAAG,kBAA4F,CAAA;IAExH,OAAO;QACL,cAAc,EAAE,eAAe;QAC/B,kBAAkB,EAAE,mBAAmB;KAExC,CAAA;AACH,CAAC;AAdD,gEAcC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
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,4CAAyB;AACzB,0CAAuB;AACvB,yCAAsB;AACtB,kDAA+B;AAC/B,iDAA8B;AAC9B,+DAAkD;AAEzC,kCAAW;AACpB,kDAA+B;AAC/B,0CAAuB;AACvB,0CAAuB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeleap/mobile",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.27",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@codeleap/config": "*",
|
|
13
|
-
"@types/react-native": "
|
|
14
|
-
"@types/react-window": "
|
|
15
|
-
"moti": "
|
|
16
|
-
"
|
|
13
|
+
"@types/react-native": "0.66.15",
|
|
14
|
+
"@types/react-window": "1.8.5",
|
|
15
|
+
"moti": "0.18.0",
|
|
16
|
+
"@codeleap/common": "*",
|
|
17
|
+
"typescript": "4.5.4"
|
|
17
18
|
},
|
|
18
19
|
"scripts": {
|
|
19
20
|
"build": "tsc --build",
|
|
@@ -28,8 +29,8 @@
|
|
|
28
29
|
"@react-navigation/native-stack": "^6.2.5",
|
|
29
30
|
"@react-navigation/stack": "^6.1.1",
|
|
30
31
|
"moti": "^0.18.0",
|
|
31
|
-
"react": "
|
|
32
|
-
"react-native": "
|
|
32
|
+
"react": "17.0.2",
|
|
33
|
+
"react-native": "0.66.4",
|
|
33
34
|
"react-native-animatable": "^1.3.3",
|
|
34
35
|
"react-native-calendars": "*",
|
|
35
36
|
"react-native-fast-image": "^8.5.11",
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
40
41
|
"react-native-text-input-mask": "3.1.4",
|
|
41
42
|
"@react-native-community/async-storage": "*",
|
|
42
|
-
"react-native-device-info": "
|
|
43
|
+
"react-native-device-info": "10.3.0"
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
46
|
"@gorhom/portal": "^1.0.13",
|
|
@@ -10,12 +10,14 @@ import { useStaticAnimationStyles } from '../../utils'
|
|
|
10
10
|
import { BackdropComposition, BackdropStyles } from './styles'
|
|
11
11
|
|
|
12
12
|
export * from './styles'
|
|
13
|
-
export type BackdropProps =
|
|
13
|
+
export type BackdropProps = React.PropsWithChildren<
|
|
14
|
+
|
|
15
|
+
PropsOf<typeof Touchable> & {
|
|
14
16
|
visible: boolean
|
|
15
17
|
wrapperProps?: PropsOf<typeof View>
|
|
16
18
|
variants?: ComponentVariants<typeof BackdropStyles>['variants']
|
|
17
19
|
styles?: StylesOf<BackdropComposition>
|
|
18
|
-
}
|
|
20
|
+
}>
|
|
19
21
|
|
|
20
22
|
export const Backdrop = (backdropProps:BackdropProps) => {
|
|
21
23
|
const { variants = [], styles = {}, visible, children, wrapperProps = {}, ...props } = backdropProps
|
|
@@ -39,7 +41,7 @@ export const Backdrop = (backdropProps:BackdropProps) => {
|
|
|
39
41
|
|
|
40
42
|
return <View pointerEvents={visible ? 'auto' : 'none' } animated style={variantStyles.wrapper} state={animation} {...wrapperProps}>
|
|
41
43
|
{
|
|
42
|
-
props?.onPress ?
|
|
44
|
+
!!props?.onPress ?
|
|
43
45
|
<Touchable style={variantStyles.touchable} {...props} noFeedback android_ripple={null}/>
|
|
44
46
|
: null
|
|
45
47
|
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from '@codeleap/common'
|
|
7
7
|
|
|
8
8
|
import { FlatGrid, FlatGridProps, GridRenderItemInfo } from 'react-native-super-grid'
|
|
9
|
-
import { RefreshControl, StyleSheet, RefreshControlProps } from 'react-native'
|
|
9
|
+
import { RefreshControl, StyleSheet, RefreshControlProps, ScrollView } from 'react-native'
|
|
10
10
|
import { View, ViewProps } from '../View'
|
|
11
11
|
import { EmptyPlaceholder, EmptyPlaceholderProps } from '../EmptyPlaceholder'
|
|
12
12
|
import { GridComposition, GridStyles } from './styles'
|
|
@@ -26,6 +26,7 @@ export type ReplaceFlatGridProps<P, T> = Omit<P, DataboundFlatGridPropsTypes> &
|
|
|
26
26
|
) => { length: number; offset: number; index: number })
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
|
|
29
30
|
export * from './styles'
|
|
30
31
|
|
|
31
32
|
export type GridProps<
|
|
@@ -41,7 +42,7 @@ export type GridProps<
|
|
|
41
42
|
refreshControlProps?: Partial<RefreshControlProps>
|
|
42
43
|
} & ComponentVariants<typeof GridStyles>
|
|
43
44
|
|
|
44
|
-
const GridCP = forwardRef<
|
|
45
|
+
const GridCP = forwardRef<ScrollView, GridProps>(
|
|
45
46
|
(flatGridProps, ref) => {
|
|
46
47
|
const {
|
|
47
48
|
variants = [],
|
|
@@ -79,7 +80,7 @@ const GridCP = forwardRef<FlatGrid, GridProps>(
|
|
|
79
80
|
const _gridProps = {
|
|
80
81
|
style: [variantStyles.wrapper, style],
|
|
81
82
|
contentContainerStyle: variantStyles.content,
|
|
82
|
-
ref: ref
|
|
83
|
+
ref: ref ,
|
|
83
84
|
ItemSeparatorComponent: separator,
|
|
84
85
|
refreshControl:
|
|
85
86
|
!!onRefresh && (
|
|
@@ -25,7 +25,7 @@ type TSpotlightCtx = {
|
|
|
25
25
|
|
|
26
26
|
const SpotlightCtx = React.createContext({} as TSpotlightCtx)
|
|
27
27
|
|
|
28
|
-
export const SpotlightProvider:React.FC = ({ children }) => {
|
|
28
|
+
export const SpotlightProvider:React.FC<React.PropsWithChildren<any>> = ({ children }) => {
|
|
29
29
|
const [spotlights, setSpotlights] = useState<TSpotlightCtx['spotlights']>({})
|
|
30
30
|
const [indexes, setIndexes] = useState<TSpotlightCtx['indexes']>({})
|
|
31
31
|
const ctxValue:TSpotlightCtx = {
|
|
@@ -109,7 +109,7 @@ export const Scroll = forwardRef<ScrollView, ScrollProps>(
|
|
|
109
109
|
...keyboardAware,
|
|
110
110
|
|
|
111
111
|
})
|
|
112
|
-
const Component = animated ? MotiScrollView : ScrollView
|
|
112
|
+
const Component = (animated ? MotiScrollView : ScrollView ) as unknown as typeof ScrollView
|
|
113
113
|
|
|
114
114
|
return (
|
|
115
115
|
<Component
|
|
@@ -10,6 +10,7 @@ import { Text, TextProps } from '../Text'
|
|
|
10
10
|
import { KeyboardAwareScrollViewTypes } from '../../modules'
|
|
11
11
|
import { View } from '../View'
|
|
12
12
|
import { InputLabel } from '../InputLabel'
|
|
13
|
+
|
|
13
14
|
export * from './styles'
|
|
14
15
|
export type SegmentedControlRef =KeyboardAwareScrollViewTypes.KeyboardAwareScrollView & {
|
|
15
16
|
scrollTo: (index: number) => void
|
|
@@ -89,6 +89,7 @@ export const Text = forwardRef<NativeText, TextProps>((textProps, ref) => {
|
|
|
89
89
|
onPress: pressDisabled ? null : _onPress,
|
|
90
90
|
} : {}
|
|
91
91
|
|
|
92
|
+
|
|
92
93
|
return <Component {...props}
|
|
93
94
|
onPressIn={handlePress(true)} onPressOut={handlePress(false)}
|
|
94
95
|
style={[styles, colorStyle, feedbackStyle, !!onPress && pressDisabled ? variantStyles['text:disabled'] : null]}
|
|
@@ -17,22 +17,24 @@ import { TouchableComposition, TouchableStyles } from './styles'
|
|
|
17
17
|
import { StylesOf } from '../../types'
|
|
18
18
|
import { View } from '../View'
|
|
19
19
|
import { usePressableFeedback } from '../../utils'
|
|
20
|
-
export type TouchableProps =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
export type TouchableProps = React.PropsWithChildren<
|
|
21
|
+
Omit<
|
|
22
|
+
ComponentPropsWithoutRef<typeof Pressable>,
|
|
23
|
+
'onPress'|'children'
|
|
24
|
+
> & {
|
|
25
|
+
variants?: ComponentVariants<typeof TouchableStyles>['variants']
|
|
26
|
+
component?: any
|
|
27
|
+
ref?: React.Ref<RNView>
|
|
28
|
+
debugName: string
|
|
29
|
+
activeOpacity?: number
|
|
30
|
+
debugComponent?: string
|
|
31
|
+
onPress?: AnyFunction
|
|
32
|
+
noFeedback?: boolean
|
|
33
|
+
debounce?: number
|
|
34
|
+
leadingDebounce?: boolean
|
|
35
|
+
styles?: StylesOf<TouchableComposition>
|
|
35
36
|
} & BaseViewProps
|
|
37
|
+
>
|
|
36
38
|
export * from './styles'
|
|
37
39
|
|
|
38
40
|
export const Touchable: React.FC<TouchableProps> = forwardRef<
|
|
@@ -12,18 +12,26 @@ import {
|
|
|
12
12
|
import { View as NativeView } from 'react-native'
|
|
13
13
|
import { MotiView, MotiProps } from 'moti'
|
|
14
14
|
import { GetKeyboardAwarePropsOptions, useKeyboardAwareView } from '../../utils'
|
|
15
|
+
import {TransitionConfig} from '../../types'
|
|
15
16
|
|
|
16
17
|
export * from './styles'
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
ComponentVariants<typeof ViewStyles> & {
|
|
20
|
-
ref?: any
|
|
21
|
-
component?: any
|
|
22
|
-
animated?: boolean
|
|
23
|
-
keyboardAware?: GetKeyboardAwarePropsOptions
|
|
24
|
-
} & BaseViewProps
|
|
19
|
+
type MotiViewProps = Omit< Partial<MotiProps>, 'transition'|'children'>
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
type NativeViewProps =Omit<ComponentPropsWithoutRef<typeof NativeView>, 'children'>
|
|
22
|
+
|
|
23
|
+
export type ViewProps = React.PropsWithChildren<{
|
|
24
|
+
ref?: any
|
|
25
|
+
component?: any
|
|
26
|
+
animated?: boolean
|
|
27
|
+
keyboardAware?: GetKeyboardAwarePropsOptions
|
|
28
|
+
transition?: Partial<TransitionConfig>
|
|
29
|
+
} &
|
|
30
|
+
NativeViewProps & ComponentVariants<typeof ViewStyles> & BaseViewProps & MotiViewProps
|
|
31
|
+
>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export const View: React.FC<ViewProps> = forwardRef<NativeView,ViewProps>((viewProps, ref) => {
|
|
27
35
|
const {
|
|
28
36
|
responsiveVariants = {},
|
|
29
37
|
variants = [],
|
|
@@ -60,11 +68,6 @@ export const View: React.FC<ViewProps & Partial<MotiProps>> = forwardRef<NativeV
|
|
|
60
68
|
)
|
|
61
69
|
})
|
|
62
70
|
|
|
63
|
-
export const AnimatedView = Animatable.createAnimatableComponent(
|
|
64
|
-
View,
|
|
65
|
-
) as unknown as React.ForwardRefExoticComponent<
|
|
66
|
-
{ transition?: any; animation?: any } & ViewProps
|
|
67
|
-
>
|
|
68
71
|
|
|
69
72
|
type GapProps = ViewProps & {
|
|
70
73
|
value: number
|
package/src/types/utility.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react'
|
|
1
2
|
import { StyleProp } from 'react-native'
|
|
2
3
|
import { EasingFunction } from 'react-native-animatable'
|
|
3
4
|
|
|
4
5
|
export type StylesOf<C extends string> = Partial<Record<C, StyleProp<any>>>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type TransitionBase = {
|
|
7
|
+
easing?: EasingFunction
|
|
8
|
+
type?: string
|
|
9
|
+
duration?: number
|
|
10
|
+
}
|
|
11
|
+
export type TransitionConfig = TransitionBase | {
|
|
12
|
+
[p: string] : TransitionBase
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export type ChildrenProp = ReactNode | ReactNode[] | undefined
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* @flow */
|
|
3
3
|
|
|
4
4
|
import React from 'react'
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
import {
|
|
7
7
|
Keyboard,
|
|
8
8
|
Platform,
|
|
@@ -45,13 +45,7 @@ const supportedKeyboardEvents: KeyboardEventName[] = [
|
|
|
45
45
|
'keyboardDidChangeFrame',
|
|
46
46
|
]
|
|
47
47
|
const keyboardEventToCallbackName = (eventName: string) => 'on' + eventName[0].toUpperCase() + eventName.substring(1)
|
|
48
|
-
|
|
49
|
-
(acc: Object, eventName: string) => ({
|
|
50
|
-
...acc,
|
|
51
|
-
[keyboardEventToCallbackName(eventName)]: PropTypes.func,
|
|
52
|
-
}),
|
|
53
|
-
{},
|
|
54
|
-
)
|
|
48
|
+
|
|
55
49
|
const keyboardAwareHOCTypeEvents = supportedKeyboardEvents.reduce(
|
|
56
50
|
(acc: Object, eventName: string) => ({
|
|
57
51
|
...acc,
|
|
@@ -181,27 +175,7 @@ class KeyboardAwareScrollable extends React.Component<KeyboardAwareHOCProps, Key
|
|
|
181
175
|
|
|
182
176
|
static displayName = `KeyboardAware`
|
|
183
177
|
|
|
184
|
-
|
|
185
|
-
viewIsInsideTabBar: PropTypes.bool,
|
|
186
|
-
resetScrollToCoords: PropTypes.shape({
|
|
187
|
-
x: PropTypes.number.isRequired,
|
|
188
|
-
y: PropTypes.number.isRequired,
|
|
189
|
-
}),
|
|
190
|
-
enableResetScrollToCoords: PropTypes.bool,
|
|
191
|
-
enableAutomaticScroll: PropTypes.bool,
|
|
192
|
-
extraHeight: PropTypes.number,
|
|
193
|
-
extraScrollHeight: PropTypes.number,
|
|
194
|
-
keyboardOpeningTime: PropTypes.number,
|
|
195
|
-
onScroll: PropTypes.oneOfType([
|
|
196
|
-
PropTypes.func, // Normal listener
|
|
197
|
-
PropTypes.object, // Animated.event listener
|
|
198
|
-
]),
|
|
199
|
-
update: PropTypes.func,
|
|
200
|
-
contentContainerStyle: PropTypes.any,
|
|
201
|
-
enableOnAndroid: PropTypes.bool,
|
|
202
|
-
innerRef: PropTypes.func,
|
|
203
|
-
...keyboardEventPropTypes,
|
|
204
|
-
}
|
|
178
|
+
|
|
205
179
|
|
|
206
180
|
// HOC options are used to init default props, so that these options can be overriden with component props
|
|
207
181
|
static defaultProps = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext, useState } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { useModalContext } from '../ModalManager/context'
|
|
3
3
|
import { deepEqual, onMount, onUpdate, PermissionManager, PermissionTypes, useDebounce, usePrevious } from '@codeleap/common'
|
|
4
4
|
import { AppState, Linking } from 'react-native'
|
|
5
5
|
import { PermissionConfig, PermissionModalsConfig } from './types'
|
|
@@ -8,6 +8,7 @@ type TPermissionContext = {
|
|
|
8
8
|
state: Record<string, PermissionTypes.PermissionStatus>
|
|
9
9
|
modalConfig: PermissionModalsConfig<any>
|
|
10
10
|
manager: PermissionManager<any, any>
|
|
11
|
+
setState: (forPermission: string, status: PermissionTypes.PermissionState) => void
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
const PermissionContext = React.createContext({} as TPermissionContext)
|
|
@@ -42,10 +43,19 @@ export function Provider({ children, AppPermissions, modalConfig }:PermissionPro
|
|
|
42
43
|
|
|
43
44
|
})
|
|
44
45
|
|
|
46
|
+
const setPermissionState = (forPermission: string, status: PermissionTypes.PermissionState) => {
|
|
47
|
+
setState({
|
|
48
|
+
...state,
|
|
49
|
+
[forPermission]: status
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
45
54
|
return <PermissionContext.Provider value={{
|
|
46
55
|
state,
|
|
47
56
|
modalConfig: modalConfig,
|
|
48
57
|
manager: AppPermissions,
|
|
58
|
+
setState: setPermissionState
|
|
49
59
|
}}>
|
|
50
60
|
{children}
|
|
51
61
|
</PermissionContext.Provider>
|
|
@@ -74,7 +84,7 @@ export type UsePermissions<
|
|
|
74
84
|
}
|
|
75
85
|
|
|
76
86
|
export const usePermissions:UsePermissions<any> = () => {
|
|
77
|
-
const modalCtx =
|
|
87
|
+
const modalCtx = useModalContext()
|
|
78
88
|
const permissionCtx = useContext(PermissionContext)
|
|
79
89
|
|
|
80
90
|
function askPermission(name: string, onResolve?: (status: PermissionTypes.PermissionStatus, modalName?: string) => any) {
|
|
@@ -139,6 +149,7 @@ export const usePermissions:UsePermissions<any> = () => {
|
|
|
139
149
|
props: {
|
|
140
150
|
onPermissionResolve: (status) => {
|
|
141
151
|
resolve(status)
|
|
152
|
+
permissionCtx.setState(permission, status)
|
|
142
153
|
},
|
|
143
154
|
},
|
|
144
155
|
})
|
|
@@ -150,6 +161,8 @@ export const usePermissions:UsePermissions<any> = () => {
|
|
|
150
161
|
modalCtx.toggleModal(permissionModalName, true, {
|
|
151
162
|
onPermissionResolve: (status) => {
|
|
152
163
|
resolve(status)
|
|
164
|
+
permissionCtx.setState(permission, status)
|
|
165
|
+
|
|
153
166
|
},
|
|
154
167
|
})
|
|
155
168
|
})
|
|
@@ -189,7 +202,7 @@ export const usePermissions:UsePermissions<any> = () => {
|
|
|
189
202
|
export function usePermissionModal(permissionName: string) {
|
|
190
203
|
|
|
191
204
|
const modalId = `permissions.${permissionName}`
|
|
192
|
-
const modals =
|
|
205
|
+
const modals = useModalContext()
|
|
193
206
|
const permissionCtx = usePermissions()
|
|
194
207
|
const modalState = modals.state[modalId]
|
|
195
208
|
|
|
@@ -267,7 +280,6 @@ export function usePermissionModal(permissionName: string) {
|
|
|
267
280
|
},
|
|
268
281
|
currentState,
|
|
269
282
|
config,
|
|
270
|
-
|
|
271
283
|
}
|
|
272
284
|
}
|
|
273
285
|
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ViewProps } from '../../View';
|
|
3
|
-
import { ButtonProps } from '../../Button';
|
|
4
|
-
import { ComponentVariants, IconPlaceholder } from '@codeleap/common';
|
|
5
|
-
import { MobileModalComposition, MobileModalStyles } from './styles';
|
|
6
|
-
import { StylesOf } from '../../../types/utility';
|
|
7
|
-
import { GetKeyboardAwarePropsOptions } from '../../../utils';
|
|
8
|
-
export * from './styles';
|
|
9
|
-
export declare type ModalProps = Omit<ViewProps, 'variants' | 'styles'> & {
|
|
10
|
-
variants?: ComponentVariants<typeof MobileModalStyles>['variants'];
|
|
11
|
-
styles?: StylesOf<MobileModalComposition>;
|
|
12
|
-
dismissOnBackdrop?: boolean;
|
|
13
|
-
buttonProps?: ButtonProps;
|
|
14
|
-
accessible?: boolean;
|
|
15
|
-
showClose?: boolean;
|
|
16
|
-
closable?: boolean;
|
|
17
|
-
footer?: React.ReactNode;
|
|
18
|
-
title?: React.ReactNode;
|
|
19
|
-
debugName?: string;
|
|
20
|
-
closeIconName?: IconPlaceholder;
|
|
21
|
-
visible: boolean;
|
|
22
|
-
toggle?: () => void;
|
|
23
|
-
zIndex?: number;
|
|
24
|
-
scroll?: boolean;
|
|
25
|
-
keyboardAware?: GetKeyboardAwarePropsOptions;
|
|
26
|
-
};
|
|
27
|
-
export declare const Modal: React.FC<ModalProps>;
|
|
28
|
-
export default Modal;
|