@codeleap/mobile 2.4.7 → 3.1.1
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/mobile-packages.code-workspace +27 -0
- package/package.json +25 -33
- package/src/components/ActionIcon/index.tsx +16 -6
- package/src/components/ActionIcon/styles.ts +3 -90
- package/src/components/ActivityIndicator/index.tsx +28 -9
- package/src/components/ActivityIndicator/styles.ts +2 -59
- package/src/components/Autocomplete/index.tsx +235 -0
- package/src/components/Autocomplete/styles.ts +18 -0
- package/src/components/Autocomplete/types.ts +75 -0
- package/src/components/Avatar/index.tsx +126 -0
- package/src/components/Avatar/styles.ts +22 -0
- package/src/components/AvatarGroup/index.tsx +76 -0
- package/src/components/AvatarGroup/styles.ts +11 -0
- package/src/components/Backdrop/index.tsx +14 -13
- package/src/components/Backdrop/styles.ts +3 -24
- package/src/components/Badge/index.tsx +134 -0
- package/src/components/Badge/styles.ts +14 -0
- package/src/components/Button/index.tsx +39 -49
- package/src/components/Button/styles.ts +6 -107
- package/src/components/Calendar/index.tsx +3 -3
- package/src/components/Calendar/style.ts +2 -31
- package/src/components/Checkbox/index.tsx +137 -74
- package/src/components/Checkbox/styles.ts +13 -73
- package/src/components/ContentView/index.tsx +2 -2
- package/src/components/ContentView/styles.ts +1 -17
- package/src/components/DatePickerModal/index.tsx +240 -0
- package/src/components/DatePickerModal/styles.ts +15 -0
- package/src/components/DatePickerModal/types.ts +55 -0
- package/src/components/Drawer/index.tsx +2 -2
- package/src/components/Drawer/styles.ts +4 -39
- package/src/components/EmptyPlaceholder/index.tsx +3 -3
- package/src/components/EmptyPlaceholder/styles.ts +2 -47
- package/src/components/FileInput/styles.ts +1 -8
- package/src/components/Grid/index.tsx +76 -72
- package/src/components/Grid/styles.ts +4 -7
- package/src/components/Icon/index.tsx +46 -8
- package/src/components/Icon/styles.ts +3 -51
- package/src/components/Image/index.tsx +18 -22
- package/src/components/Image/styles.ts +1 -14
- package/src/components/ImageView/Spotlight.tsx +4 -2
- package/src/components/ImageView/component.tsx +0 -3
- package/src/components/InputBase/index.tsx +101 -0
- package/src/components/InputBase/styles.ts +135 -0
- package/src/components/InputBase/types.ts +28 -0
- package/src/components/InputBase/utils.ts +42 -0
- package/src/components/InputLabel/index.tsx +3 -3
- package/src/components/InputLabel/styles.ts +2 -14
- package/src/components/List/PaginationIndicator.tsx +4 -21
- package/src/components/List/index.tsx +84 -46
- package/src/components/List/styles.ts +8 -20
- package/src/components/LoadingOverlay/index.tsx +45 -45
- package/src/components/LoadingOverlay/styles.ts +5 -27
- package/src/components/Modal/index.tsx +56 -32
- package/src/components/Modal/styles.ts +3 -114
- package/src/components/NumberIncrement/index.tsx +318 -0
- package/src/components/NumberIncrement/styles.ts +14 -0
- package/src/components/NumberIncrement/types.ts +44 -0
- package/src/components/NumberIncrement/utils.ts +27 -0
- package/src/components/Pager/index.tsx +120 -67
- package/src/components/Pager/styles.ts +2 -69
- package/src/components/RadioInput/index.tsx +145 -68
- package/src/components/RadioInput/styles.ts +8 -61
- package/src/components/RefreshControl/index.tsx +28 -0
- package/src/components/RefreshControl/styles.ts +7 -0
- package/src/components/Scroll/index.tsx +22 -37
- package/src/components/Scroll/styles.ts +2 -16
- package/src/components/Sections/index.tsx +116 -54
- package/src/components/Sections/styles.ts +7 -0
- package/src/components/SegmentedControl/Option.tsx +51 -0
- package/src/components/SegmentedControl/index.tsx +51 -67
- package/src/components/SegmentedControl/styles.ts +7 -63
- package/src/components/Select/index.tsx +268 -95
- package/src/components/Select/styles.ts +11 -131
- package/src/components/Select/types.ts +47 -11
- package/src/components/Slider/index.tsx +151 -94
- package/src/components/Slider/styles.ts +7 -72
- package/src/components/Slider/types.ts +18 -20
- package/src/components/Switch/index.tsx +115 -63
- package/src/components/Switch/styles.ts +13 -30
- package/src/components/Text/index.tsx +14 -31
- package/src/components/Text/styles.ts +2 -41
- package/src/components/TextInput/index.tsx +237 -259
- package/src/components/TextInput/styles.ts +6 -120
- package/src/components/Touchable/index.tsx +74 -27
- package/src/components/Touchable/styles.ts +1 -12
- package/src/components/View/index.tsx +11 -26
- package/src/components/View/styles.ts +1 -17
- package/src/components/components.ts +9 -5
- package/src/components/defaultStyles.ts +74 -61
- package/src/index.ts +0 -1
- package/src/modules/PressableRipple/index.ts +5 -0
- package/src/modules/PressableRipple/ripple.js +258 -0
- package/src/modules/PressableRipple/styles.js +22 -0
- package/src/modules/PressableRipple/type.ts +17 -0
- package/src/modules/textInputMask.tsx +13 -0
- package/src/types/index.ts +5 -0
- package/src/types/utility.ts +2 -2
- package/src/utils/KeyboardAware/index.ts +0 -13
- package/src/utils/KeyboardAware/keyboardHooks.ts +69 -79
- package/src/utils/hooks.ts +63 -36
- package/src/utils/index.ts +1 -0
- package/src/utils/locale.ts +7 -0
- package/src/utils/theme.ts +1 -21
- package/dist/components/ActionIcon/index.d.ts +0 -13
- package/dist/components/ActionIcon/index.js +0 -51
- package/dist/components/ActionIcon/index.js.map +0 -1
- package/dist/components/ActionIcon/styles.d.ts +0 -65
- package/dist/components/ActionIcon/styles.js +0 -61
- package/dist/components/ActionIcon/styles.js.map +0 -1
- package/dist/components/ActivityIndicator/index.d.ts +0 -15
- package/dist/components/ActivityIndicator/index.js +0 -55
- package/dist/components/ActivityIndicator/index.js.map +0 -1
- package/dist/components/ActivityIndicator/styles.d.ts +0 -59
- package/dist/components/ActivityIndicator/styles.js +0 -52
- package/dist/components/ActivityIndicator/styles.js.map +0 -1
- package/dist/components/Animated.d.ts +0 -15
- package/dist/components/Animated.js +0 -55
- package/dist/components/Animated.js.map +0 -1
- package/dist/components/AutoComplete/index.d.ts +0 -34
- package/dist/components/AutoComplete/index.js +0 -126
- package/dist/components/AutoComplete/index.js.map +0 -1
- package/dist/components/AutoComplete/styles.d.ts +0 -57
- package/dist/components/AutoComplete/styles.js +0 -89
- package/dist/components/AutoComplete/styles.js.map +0 -1
- package/dist/components/Backdrop/index.d.ts +0 -14
- package/dist/components/Backdrop/index.js +0 -59
- package/dist/components/Backdrop/index.js.map +0 -1
- package/dist/components/Backdrop/styles.d.ts +0 -53
- package/dist/components/Backdrop/styles.js +0 -28
- package/dist/components/Backdrop/styles.js.map +0 -1
- package/dist/components/Button/index.d.ts +0 -246
- package/dist/components/Button/index.js +0 -115
- package/dist/components/Button/index.js.map +0 -1
- package/dist/components/Button/styles.d.ts +0 -65
- package/dist/components/Button/styles.js +0 -61
- package/dist/components/Button/styles.js.map +0 -1
- package/dist/components/Calendar/index.d.ts +0 -15
- package/dist/components/Calendar/index.js +0 -76
- package/dist/components/Calendar/index.js.map +0 -1
- package/dist/components/Calendar/style.d.ts +0 -4
- package/dist/components/Calendar/style.js +0 -36
- package/dist/components/Calendar/style.js.map +0 -1
- package/dist/components/Calendar/types.d.ts +0 -95
- package/dist/components/Calendar/types.js +0 -3
- package/dist/components/Calendar/types.js.map +0 -1
- package/dist/components/Checkbox/index.d.ts +0 -15
- package/dist/components/Checkbox/index.js +0 -81
- package/dist/components/Checkbox/index.js.map +0 -1
- package/dist/components/Checkbox/styles.d.ts +0 -56
- package/dist/components/Checkbox/styles.js +0 -53
- package/dist/components/Checkbox/styles.js.map +0 -1
- package/dist/components/ContentView/index.d.ts +0 -12
- package/dist/components/ContentView/index.js +0 -62
- package/dist/components/ContentView/index.js.map +0 -1
- package/dist/components/ContentView/styles.d.ts +0 -53
- package/dist/components/ContentView/styles.js +0 -26
- package/dist/components/ContentView/styles.js.map +0 -1
- package/dist/components/Drawer/index.d.ts +0 -7
- package/dist/components/Drawer/index.js +0 -66
- package/dist/components/Drawer/index.js.map +0 -1
- package/dist/components/Drawer/styles.d.ts +0 -56
- package/dist/components/Drawer/styles.js +0 -39
- package/dist/components/Drawer/styles.js.map +0 -1
- package/dist/components/EmptyPlaceholder/index.d.ts +0 -25
- package/dist/components/EmptyPlaceholder/index.js +0 -88
- package/dist/components/EmptyPlaceholder/index.js.map +0 -1
- package/dist/components/EmptyPlaceholder/styles.d.ts +0 -55
- package/dist/components/EmptyPlaceholder/styles.js +0 -30
- package/dist/components/EmptyPlaceholder/styles.js.map +0 -1
- package/dist/components/FileInput/index.d.ts +0 -24
- package/dist/components/FileInput/index.js +0 -179
- package/dist/components/FileInput/index.js.map +0 -1
- package/dist/components/FileInput/styles.d.ts +0 -53
- package/dist/components/FileInput/styles.js +0 -19
- package/dist/components/FileInput/styles.js.map +0 -1
- package/dist/components/Grid/index.d.ts +0 -32
- package/dist/components/Grid/index.js +0 -80
- package/dist/components/Grid/index.js.map +0 -1
- package/dist/components/Grid/styles.d.ts +0 -54
- package/dist/components/Grid/styles.js +0 -19
- package/dist/components/Grid/styles.js.map +0 -1
- package/dist/components/Icon/index.d.ts +0 -14
- package/dist/components/Icon/index.js +0 -75
- package/dist/components/Icon/index.js.map +0 -1
- package/dist/components/Icon/styles.d.ts +0 -61
- package/dist/components/Icon/styles.js +0 -49
- package/dist/components/Icon/styles.js.map +0 -1
- package/dist/components/Image/index.d.ts +0 -25
- package/dist/components/Image/index.js +0 -130
- package/dist/components/Image/index.js.map +0 -1
- package/dist/components/Image/styles.d.ts +0 -55
- package/dist/components/Image/styles.js +0 -25
- package/dist/components/Image/styles.js.map +0 -1
- package/dist/components/ImageView/Spotlight.d.ts +0 -25
- package/dist/components/ImageView/Spotlight.js +0 -150
- package/dist/components/ImageView/Spotlight.js.map +0 -1
- package/dist/components/ImageView/component.d.ts +0 -5
- package/dist/components/ImageView/component.js +0 -50
- package/dist/components/ImageView/component.js.map +0 -1
- package/dist/components/ImageView/index.d.ts +0 -2
- package/dist/components/ImageView/index.js +0 -15
- package/dist/components/ImageView/index.js.map +0 -1
- package/dist/components/InputLabel/index.d.ts +0 -12
- package/dist/components/InputLabel/index.js +0 -58
- package/dist/components/InputLabel/index.js.map +0 -1
- package/dist/components/InputLabel/styles.d.ts +0 -4
- package/dist/components/InputLabel/styles.js +0 -26
- package/dist/components/InputLabel/styles.js.map +0 -1
- package/dist/components/List/PaginationIndicator.d.ts +0 -67
- package/dist/components/List/PaginationIndicator.js +0 -51
- package/dist/components/List/PaginationIndicator.js.map +0 -1
- package/dist/components/List/index.d.ts +0 -31
- package/dist/components/List/index.js +0 -77
- package/dist/components/List/index.js.map +0 -1
- package/dist/components/List/styles.d.ts +0 -54
- package/dist/components/List/styles.js +0 -28
- package/dist/components/List/styles.js.map +0 -1
- package/dist/components/LoadingOverlay/index.d.ts +0 -11
- package/dist/components/LoadingOverlay/index.js +0 -60
- package/dist/components/LoadingOverlay/index.js.map +0 -1
- package/dist/components/LoadingOverlay/styles.d.ts +0 -7
- package/dist/components/LoadingOverlay/styles.js +0 -34
- package/dist/components/LoadingOverlay/styles.js.map +0 -1
- package/dist/components/Modal/index.d.ts +0 -43
- package/dist/components/Modal/index.js +0 -147
- package/dist/components/Modal/index.js.map +0 -1
- package/dist/components/Modal/styles.d.ts +0 -58
- package/dist/components/Modal/styles.js +0 -74
- package/dist/components/Modal/styles.js.map +0 -1
- package/dist/components/MultiSelect/index.d.ts +0 -6
- package/dist/components/MultiSelect/index.js +0 -119
- package/dist/components/MultiSelect/index.js.map +0 -1
- package/dist/components/MultiSelect/styles.d.ts +0 -7
- package/dist/components/MultiSelect/styles.js +0 -84
- package/dist/components/MultiSelect/styles.js.map +0 -1
- package/dist/components/MultiSelect/types.d.ts +0 -43
- package/dist/components/MultiSelect/types.js +0 -3
- package/dist/components/MultiSelect/types.js.map +0 -1
- package/dist/components/Navigation/Navigation.d.ts +0 -3
- package/dist/components/Navigation/Navigation.js +0 -80
- package/dist/components/Navigation/Navigation.js.map +0 -1
- package/dist/components/Navigation/constants.d.ts +0 -5
- package/dist/components/Navigation/constants.js +0 -11
- package/dist/components/Navigation/constants.js.map +0 -1
- package/dist/components/Navigation/index.d.ts +0 -3
- package/dist/components/Navigation/index.js +0 -16
- package/dist/components/Navigation/index.js.map +0 -1
- package/dist/components/Navigation/types.d.ts +0 -26
- package/dist/components/Navigation/types.js +0 -8
- package/dist/components/Navigation/types.js.map +0 -1
- package/dist/components/Navigation/utils.d.ts +0 -3
- package/dist/components/Navigation/utils.js +0 -69
- package/dist/components/Navigation/utils.js.map +0 -1
- package/dist/components/Pager/index.d.ts +0 -26
- package/dist/components/Pager/index.js +0 -84
- package/dist/components/Pager/index.js.map +0 -1
- package/dist/components/Pager/styles.d.ts +0 -87
- package/dist/components/Pager/styles.js +0 -72
- package/dist/components/Pager/styles.js.map +0 -1
- package/dist/components/RadioInput/index.d.ts +0 -27
- package/dist/components/RadioInput/index.js +0 -72
- package/dist/components/RadioInput/index.js.map +0 -1
- package/dist/components/RadioInput/styles.d.ts +0 -58
- package/dist/components/RadioInput/styles.js +0 -50
- package/dist/components/RadioInput/styles.js.map +0 -1
- package/dist/components/Scroll/index.d.ts +0 -124
- package/dist/components/Scroll/index.js +0 -97
- package/dist/components/Scroll/index.js.map +0 -1
- package/dist/components/Scroll/styles.d.ts +0 -53
- package/dist/components/Scroll/styles.js +0 -26
- package/dist/components/Scroll/styles.js.map +0 -1
- package/dist/components/Sections/index.d.ts +0 -115
- package/dist/components/Sections/index.js +0 -76
- package/dist/components/Sections/index.js.map +0 -1
- package/dist/components/SegmentedControl/index.d.ts +0 -52
- package/dist/components/SegmentedControl/index.js +0 -131
- package/dist/components/SegmentedControl/index.js.map +0 -1
- package/dist/components/SegmentedControl/styles.d.ts +0 -60
- package/dist/components/SegmentedControl/styles.js +0 -43
- package/dist/components/SegmentedControl/styles.js.map +0 -1
- package/dist/components/Select/index.d.ts +0 -16
- package/dist/components/Select/index.js +0 -122
- package/dist/components/Select/index.js.map +0 -1
- package/dist/components/Select/styles.d.ts +0 -60
- package/dist/components/Select/styles.js +0 -83
- package/dist/components/Select/styles.js.map +0 -1
- package/dist/components/Select/types.d.ts +0 -43
- package/dist/components/Select/types.js +0 -3
- package/dist/components/Select/types.js.map +0 -1
- package/dist/components/Slider/Mark.d.ts +0 -3
- package/dist/components/Slider/Mark.js +0 -32
- package/dist/components/Slider/Mark.js.map +0 -1
- package/dist/components/Slider/Thumb.d.ts +0 -7
- package/dist/components/Slider/Thumb.js +0 -30
- package/dist/components/Slider/Thumb.js.map +0 -1
- package/dist/components/Slider/index.d.ts +0 -4
- package/dist/components/Slider/index.js +0 -99
- package/dist/components/Slider/index.js.map +0 -1
- package/dist/components/Slider/styles.d.ts +0 -54
- package/dist/components/Slider/styles.js +0 -61
- package/dist/components/Slider/styles.js.map +0 -1
- package/dist/components/Slider/types.d.ts +0 -26
- package/dist/components/Slider/types.js +0 -3
- package/dist/components/Slider/types.js.map +0 -1
- package/dist/components/Switch/index.d.ts +0 -14
- package/dist/components/Switch/index.js +0 -81
- package/dist/components/Switch/index.js.map +0 -1
- package/dist/components/Switch/styles.d.ts +0 -55
- package/dist/components/Switch/styles.js +0 -34
- package/dist/components/Switch/styles.js.map +0 -1
- package/dist/components/Text/index.d.ts +0 -25
- package/dist/components/Text/index.js +0 -121
- package/dist/components/Text/index.js.map +0 -1
- package/dist/components/Text/styles.d.ts +0 -70
- package/dist/components/Text/styles.js +0 -34
- package/dist/components/Text/styles.js.map +0 -1
- package/dist/components/TextInput/index.d.ts +0 -181
- package/dist/components/TextInput/index.js +0 -213
- package/dist/components/TextInput/index.js.map +0 -1
- package/dist/components/TextInput/styles.d.ts +0 -63
- package/dist/components/TextInput/styles.js +0 -65
- package/dist/components/TextInput/styles.js.map +0 -1
- package/dist/components/Touchable/index.d.ts +0 -22
- package/dist/components/Touchable/index.js +0 -165
- package/dist/components/Touchable/index.js.map +0 -1
- package/dist/components/Touchable/styles.d.ts +0 -58
- package/dist/components/Touchable/styles.js +0 -24
- package/dist/components/Touchable/styles.js.map +0 -1
- package/dist/components/View/index.d.ts +0 -25
- package/dist/components/View/index.js +0 -107
- package/dist/components/View/index.js.map +0 -1
- package/dist/components/View/styles.d.ts +0 -54
- package/dist/components/View/styles.js +0 -29
- package/dist/components/View/styles.js.map +0 -1
- package/dist/components/components.d.ts +0 -37
- package/dist/components/components.js +0 -50
- package/dist/components/components.js.map +0 -1
- package/dist/components/defaultStyles.d.ts +0 -1468
- package/dist/components/defaultStyles.js +0 -67
- package/dist/components/defaultStyles.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -39
- package/dist/index.js.map +0 -1
- package/dist/modules/documentPicker.d.ts +0 -3
- package/dist/modules/documentPicker.js +0 -12
- package/dist/modules/documentPicker.js.map +0 -1
- package/dist/modules/fastImage.d.ts +0 -1
- package/dist/modules/fastImage.js +0 -10
- package/dist/modules/fastImage.js.map +0 -1
- package/dist/modules/reactNavigation.d.ts +0 -5
- package/dist/modules/reactNavigation.js +0 -26
- package/dist/modules/reactNavigation.js.map +0 -1
- package/dist/modules/rnDeviceInfo.d.ts +0 -2
- package/dist/modules/rnDeviceInfo.js +0 -10
- package/dist/modules/rnDeviceInfo.js.map +0 -1
- package/dist/modules/textInputMask.d.ts +0 -10
- package/dist/modules/textInputMask.js +0 -19
- package/dist/modules/textInputMask.js.map +0 -1
- package/dist/modules/types/fileTypes.d.ts +0 -138
- package/dist/modules/types/fileTypes.js +0 -3
- package/dist/modules/types/fileTypes.js.map +0 -1
- package/dist/modules/types/textInputMask.d.ts +0 -7
- package/dist/modules/types/textInputMask.js +0 -3
- package/dist/modules/types/textInputMask.js.map +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -14
- package/dist/types/index.js.map +0 -1
- package/dist/types/utility.d.ts +0 -14
- package/dist/types/utility.js +0 -3
- package/dist/types/utility.js.map +0 -1
- package/dist/utils/KeyboardAware/context.d.ts +0 -13
- package/dist/utils/KeyboardAware/context.js +0 -63
- package/dist/utils/KeyboardAware/context.js.map +0 -1
- package/dist/utils/KeyboardAware/index.d.ts +0 -8
- package/dist/utils/KeyboardAware/index.js +0 -29
- package/dist/utils/KeyboardAware/index.js.map +0 -1
- package/dist/utils/KeyboardAware/keyboardHooks.d.ts +0 -26
- package/dist/utils/KeyboardAware/keyboardHooks.js +0 -87
- package/dist/utils/KeyboardAware/keyboardHooks.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.d.ts +0 -3
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js +0 -9
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.d.ts +0 -67
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js +0 -439
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.d.ts +0 -7
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js +0 -4
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.d.ts +0 -3
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js +0 -10
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.d.ts +0 -3
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js +0 -10
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js.map +0 -1
- package/dist/utils/KeyboardAware/types.d.ts +0 -1
- package/dist/utils/KeyboardAware/types.js +0 -7
- package/dist/utils/KeyboardAware/types.js.map +0 -1
- package/dist/utils/ModalManager/components.d.ts +0 -20
- package/dist/utils/ModalManager/components.js +0 -114
- package/dist/utils/ModalManager/components.js.map +0 -1
- package/dist/utils/ModalManager/context.d.ts +0 -48
- package/dist/utils/ModalManager/context.js +0 -201
- package/dist/utils/ModalManager/context.js.map +0 -1
- package/dist/utils/ModalManager/index.d.ts +0 -11
- package/dist/utils/ModalManager/index.js +0 -13
- package/dist/utils/ModalManager/index.js.map +0 -1
- package/dist/utils/OSAlert.d.ts +0 -32
- package/dist/utils/OSAlert.js +0 -143
- package/dist/utils/OSAlert.js.map +0 -1
- package/dist/utils/PermissionManager/context.d.ts +0 -53
- package/dist/utils/PermissionManager/context.js +0 -320
- package/dist/utils/PermissionManager/context.js.map +0 -1
- package/dist/utils/PermissionManager/index.d.ts +0 -4
- package/dist/utils/PermissionManager/index.js +0 -9
- package/dist/utils/PermissionManager/index.js.map +0 -1
- package/dist/utils/PermissionManager/types.d.ts +0 -13
- package/dist/utils/PermissionManager/types.js +0 -3
- package/dist/utils/PermissionManager/types.js.map +0 -1
- package/dist/utils/hooks.d.ts +0 -61
- package/dist/utils/hooks.js +0 -233
- package/dist/utils/hooks.js.map +0 -1
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/index.js +0 -36
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/input.d.ts +0 -35
- package/dist/utils/input.js +0 -49
- package/dist/utils/input.js.map +0 -1
- package/dist/utils/misc.d.ts +0 -6
- package/dist/utils/misc.js +0 -87
- package/dist/utils/misc.js.map +0 -1
- package/dist/utils/notifications.d.ts +0 -34
- package/dist/utils/notifications.js +0 -268
- package/dist/utils/notifications.js.map +0 -1
- package/dist/utils/theme.d.ts +0 -42
- package/dist/utils/theme.js +0 -50
- package/dist/utils/theme.js.map +0 -1
- package/src/components/Animated.tsx +0 -34
- package/src/components/AutoComplete/index.tsx +0 -167
- package/src/components/AutoComplete/styles.ts +0 -150
- package/src/components/MultiSelect/index.tsx +0 -148
- package/src/components/MultiSelect/styles.ts +0 -131
- package/src/components/MultiSelect/types.ts +0 -51
- package/src/components/Slider/Mark.tsx +0 -46
- package/src/components/Slider/Thumb.tsx +0 -29
- package/src/modules/textInputMask.ts +0 -11
- package/src/utils/KeyboardAware/lib/KeyboardAwareFlatList.ts +0 -4
- package/src/utils/KeyboardAware/lib/KeyboardAwareHOC.tsx +0 -592
- package/src/utils/KeyboardAware/lib/KeyboardAwareInterface.ts +0 -13
- package/src/utils/KeyboardAware/lib/KeyboardAwareScrollView.ts +0 -6
- package/src/utils/KeyboardAware/lib/KeyboardAwareSectionList.ts +0 -6
package/dist/utils/OSAlert.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.OSAlert = void 0;
|
|
15
|
-
/* eslint no-restricted-imports: 'off' */
|
|
16
|
-
/* eslint prefer-const: 'off' */
|
|
17
|
-
var react_native_1 = require("react-native");
|
|
18
|
-
var currentAlerts = {};
|
|
19
|
-
function generateAlertID(from) {
|
|
20
|
-
return [
|
|
21
|
-
from.type,
|
|
22
|
-
from.title,
|
|
23
|
-
from.body,
|
|
24
|
-
].join('-');
|
|
25
|
-
}
|
|
26
|
-
function shouldShowAlert(args, type) {
|
|
27
|
-
var alertId = generateAlertID(__assign(__assign({}, args), { type: type }));
|
|
28
|
-
if (!Object.keys(currentAlerts).includes(alertId)) {
|
|
29
|
-
currentAlerts[alertId] = true;
|
|
30
|
-
return alertId;
|
|
31
|
-
}
|
|
32
|
-
return '';
|
|
33
|
-
}
|
|
34
|
-
function popAlert(id) {
|
|
35
|
-
delete currentAlerts[id];
|
|
36
|
-
}
|
|
37
|
-
function ask(_a) {
|
|
38
|
-
var title = _a.title, body = _a.body, _b = _a.options, options = _b === void 0 ? null : _b;
|
|
39
|
-
if (!title) {
|
|
40
|
-
title = 'Quick quetion';
|
|
41
|
-
}
|
|
42
|
-
_OSAlert({
|
|
43
|
-
title: title,
|
|
44
|
-
body: body,
|
|
45
|
-
options: options,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function warn(args) {
|
|
49
|
-
var id = shouldShowAlert(args, 'warn');
|
|
50
|
-
if (!id)
|
|
51
|
-
return;
|
|
52
|
-
var title = args.title, body = args.body, onAccept = args.onAccept, onReject = args.onReject;
|
|
53
|
-
if (!title) {
|
|
54
|
-
title = 'Hang on';
|
|
55
|
-
}
|
|
56
|
-
if (!body) {
|
|
57
|
-
body = 'Are you sure?';
|
|
58
|
-
}
|
|
59
|
-
if (!onReject) {
|
|
60
|
-
onReject = function () { return null; };
|
|
61
|
-
}
|
|
62
|
-
_OSAlert({
|
|
63
|
-
title: title,
|
|
64
|
-
body: body,
|
|
65
|
-
options: [
|
|
66
|
-
{
|
|
67
|
-
text: 'Cancel',
|
|
68
|
-
onPress: function () {
|
|
69
|
-
popAlert(id);
|
|
70
|
-
onReject();
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
text: 'OK',
|
|
75
|
-
style: 'destructive',
|
|
76
|
-
onPress: function () {
|
|
77
|
-
popAlert(id);
|
|
78
|
-
onAccept === null || onAccept === void 0 ? void 0 : onAccept();
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
function info(args) {
|
|
85
|
-
var id = shouldShowAlert(args, 'info');
|
|
86
|
-
if (!id)
|
|
87
|
-
return;
|
|
88
|
-
var title = args.title, body = args.body, _a = args.onDismiss, onDismiss = _a === void 0 ? function () { return null; } : _a;
|
|
89
|
-
if (!title) {
|
|
90
|
-
title = 'FYI';
|
|
91
|
-
}
|
|
92
|
-
_OSAlert({
|
|
93
|
-
title: title,
|
|
94
|
-
body: body,
|
|
95
|
-
options: [
|
|
96
|
-
{
|
|
97
|
-
text: 'OK',
|
|
98
|
-
onPress: function () {
|
|
99
|
-
popAlert(id);
|
|
100
|
-
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
function OSError(args) {
|
|
107
|
-
var id = shouldShowAlert(args, 'error');
|
|
108
|
-
if (!id)
|
|
109
|
-
return;
|
|
110
|
-
var title = args.title, body = args.body;
|
|
111
|
-
if (!title) {
|
|
112
|
-
title = 'Whoops!';
|
|
113
|
-
}
|
|
114
|
-
if (!body) {
|
|
115
|
-
body = 'Something went wrong';
|
|
116
|
-
}
|
|
117
|
-
_OSAlert({
|
|
118
|
-
title: title,
|
|
119
|
-
body: body,
|
|
120
|
-
options: [
|
|
121
|
-
{
|
|
122
|
-
text: 'OK',
|
|
123
|
-
onPress: function () {
|
|
124
|
-
var _a;
|
|
125
|
-
popAlert(id);
|
|
126
|
-
(_a = args === null || args === void 0 ? void 0 : args.onDismiss) === null || _a === void 0 ? void 0 : _a.call(args);
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
],
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
function _OSAlert(params) {
|
|
133
|
-
react_native_1.Alert.alert(params.title, params.body, params.options, {
|
|
134
|
-
cancelable: false,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
exports.OSAlert = {
|
|
138
|
-
ask: ask,
|
|
139
|
-
warn: warn,
|
|
140
|
-
info: info,
|
|
141
|
-
error: OSError,
|
|
142
|
-
};
|
|
143
|
-
//# sourceMappingURL=OSAlert.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OSAlert.js","sourceRoot":"","sources":["../../src/utils/OSAlert.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,yCAAyC;AACzC,gCAAgC;AAChC,6CAAiD;AAyBjD,IAAM,aAAa,GAAG,EAErB,CAAA;AAED,SAAS,eAAe,CAAC,IAAsC;IAC7D,OAAO;QACL,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,IAAI;KACV,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACb,CAAC;AAED,SAAS,eAAe,CAAC,IAAgB,EAAE,IAAiB;IAC1D,IAAM,OAAO,GAAG,eAAe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,OAAA;QACL,IAAI,MAAA;QACJ,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE;;oBACP,QAAQ,CAAC,EAAE,CAAC,CAAA;oBACZ,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,+CAAf,IAAI,CAAe,CAAA;gBACrB,CAAC;aACF;SACF;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,MAAmB;IACnC,oBAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE;QACrD,UAAU,EAAE,KAAK;KAClB,CAAC,CAAA;AACJ,CAAC;AAEY,QAAA,OAAO,GAAG;IACrB,GAAG,KAAA;IACH,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,KAAK,EAAE,OAAO;CACf,CAAA"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PermissionManager, PermissionTypes } from '@codeleap/common';
|
|
3
|
-
import { PermissionConfig, PermissionModalsConfig } from './types';
|
|
4
|
-
declare type TPermissionContext = {
|
|
5
|
-
state: Record<string, PermissionTypes.PermissionStatus>;
|
|
6
|
-
modalConfig: PermissionModalsConfig<any>;
|
|
7
|
-
manager: PermissionManager<any, any>;
|
|
8
|
-
setState: (forPermission: string, status: PermissionTypes.PermissionState) => void;
|
|
9
|
-
};
|
|
10
|
-
declare type PermissionProviderProps = {
|
|
11
|
-
children: React.ReactElement;
|
|
12
|
-
AppPermissions: PermissionManager<any, any>;
|
|
13
|
-
modalConfig: PermissionModalsConfig<any>;
|
|
14
|
-
};
|
|
15
|
-
export declare function Provider({ children, AppPermissions, modalConfig }: PermissionProviderProps): JSX.Element;
|
|
16
|
-
declare type TAskManyResults<T extends string> = Record<T, PermissionTypes.PermissionStatus> & {
|
|
17
|
-
overall: PermissionTypes.PermissionStatus;
|
|
18
|
-
};
|
|
19
|
-
declare type AskManyOpts<T extends string | number | symbol> = {
|
|
20
|
-
breakOnDenied?: T[];
|
|
21
|
-
};
|
|
22
|
-
export declare type UsePermissions<_PermissionNames extends string, PermissionNames extends string = `${_PermissionNames}?` | _PermissionNames> = () => TPermissionContext & {
|
|
23
|
-
askPermission: (name: PermissionNames, onResolve?: (status: PermissionTypes.PermissionStatus) => any) => Promise<PermissionTypes.PermissionStatus>;
|
|
24
|
-
askMany<T extends PermissionNames, R = TAskManyResults<T>>(perms: T[], onResolve?: (res: R) => any, options?: AskManyOpts<T>): Promise<R>;
|
|
25
|
-
};
|
|
26
|
-
export declare const usePermissions: UsePermissions<any>;
|
|
27
|
-
export declare function usePermissionModal(permissionName: string): {
|
|
28
|
-
onAllow: () => Promise<void>;
|
|
29
|
-
onDeny: () => void;
|
|
30
|
-
modalId: string;
|
|
31
|
-
permissionName: string;
|
|
32
|
-
modalState: {
|
|
33
|
-
visible: boolean;
|
|
34
|
-
attachments: string[];
|
|
35
|
-
attachedTo: string[];
|
|
36
|
-
props?: any;
|
|
37
|
-
};
|
|
38
|
-
currentState: "unavailable" | "pending" | "denied" | "limited" | "granted" | "blocked";
|
|
39
|
-
config: PermissionConfig;
|
|
40
|
-
};
|
|
41
|
-
declare type PermissionManagerArgTypes<M extends PermissionManager<any, any>> = {
|
|
42
|
-
perms: M extends PermissionManager<infer P, any> ? P extends Record<string, any> ? P : never : never;
|
|
43
|
-
opts: M extends PermissionManager<any, infer O> ? O : never;
|
|
44
|
-
};
|
|
45
|
-
declare type CreateTypedPermissionHooksArgs<M extends PermissionManager<any, any>, Args extends PermissionManagerArgTypes<M> = PermissionManagerArgTypes<M>, ModalConfig extends PermissionModalsConfig<keyof Args['perms']> = PermissionModalsConfig<keyof Args['perms']>> = {
|
|
46
|
-
modalConfig: ModalConfig;
|
|
47
|
-
permissionsManager: M;
|
|
48
|
-
};
|
|
49
|
-
export declare function createTypedPermissionHooks<M extends PermissionManager<any, any>, Args extends PermissionManagerArgTypes<M> = PermissionManagerArgTypes<M>>(configuration: CreateTypedPermissionHooksArgs<M>): {
|
|
50
|
-
usePermissions: UsePermissions<Exclude<keyof Args["perms"], number | symbol>, Exclude<keyof Args["perms"], number | symbol> | `${Exclude<keyof Args["perms"], number | symbol>}?`>;
|
|
51
|
-
usePermissionModal: (name: keyof Args['perms']) => ReturnType<typeof usePermissionModal>;
|
|
52
|
-
};
|
|
53
|
-
export {};
|
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
-
if (mod && mod.__esModule) return mod;
|
|
27
|
-
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
-
__setModuleDefault(result, mod);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
36
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
37
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
38
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
42
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
43
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
44
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
|
-
function step(op) {
|
|
46
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
47
|
-
while (_) try {
|
|
48
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
49
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
50
|
-
switch (op[0]) {
|
|
51
|
-
case 0: case 1: t = op; break;
|
|
52
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
53
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
54
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
55
|
-
default:
|
|
56
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
57
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
58
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
59
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
60
|
-
if (t[2]) _.ops.pop();
|
|
61
|
-
_.trys.pop(); continue;
|
|
62
|
-
}
|
|
63
|
-
op = body.call(thisArg, _);
|
|
64
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
65
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69
|
-
exports.createTypedPermissionHooks = exports.usePermissionModal = exports.usePermissions = exports.Provider = void 0;
|
|
70
|
-
var react_1 = __importStar(require("react"));
|
|
71
|
-
var context_1 = require("../ModalManager/context");
|
|
72
|
-
var common_1 = require("@codeleap/common");
|
|
73
|
-
var react_native_1 = require("react-native");
|
|
74
|
-
var PermissionContext = react_1.default.createContext({});
|
|
75
|
-
function getStatuses(state) {
|
|
76
|
-
var statuses = Object.entries(state).map(function (_a) {
|
|
77
|
-
var k = _a[0], v = _a[1];
|
|
78
|
-
return [k, v.status];
|
|
79
|
-
});
|
|
80
|
-
return Object.fromEntries(statuses);
|
|
81
|
-
}
|
|
82
|
-
function Provider(_a) {
|
|
83
|
-
var children = _a.children, AppPermissions = _a.AppPermissions, modalConfig = _a.modalConfig;
|
|
84
|
-
var _b = (0, react_1.useState)(function () { return getStatuses(AppPermissions.values); }), state = _b[0], setState = _b[1];
|
|
85
|
-
(0, common_1.onMount)(function () {
|
|
86
|
-
react_native_1.AppState.addEventListener('change', function (state) {
|
|
87
|
-
if (state === 'active') {
|
|
88
|
-
AppPermissions.update().then(function (vals) {
|
|
89
|
-
var statuses = getStatuses(vals);
|
|
90
|
-
if (!(0, common_1.deepEqual)(statuses, state)) {
|
|
91
|
-
setState(__assign({}, statuses));
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
var setPermissionState = function (forPermission, status) {
|
|
98
|
-
var _a;
|
|
99
|
-
setState(__assign(__assign({}, state), (_a = {}, _a[forPermission] = status, _a)));
|
|
100
|
-
};
|
|
101
|
-
return <PermissionContext.Provider value={{
|
|
102
|
-
state: state,
|
|
103
|
-
modalConfig: modalConfig,
|
|
104
|
-
manager: AppPermissions,
|
|
105
|
-
setState: setPermissionState
|
|
106
|
-
}}>
|
|
107
|
-
{children}
|
|
108
|
-
</PermissionContext.Provider>;
|
|
109
|
-
}
|
|
110
|
-
exports.Provider = Provider;
|
|
111
|
-
var usePermissions = function () {
|
|
112
|
-
var modalCtx = (0, context_1.useModalContext)();
|
|
113
|
-
var permissionCtx = (0, react_1.useContext)(PermissionContext);
|
|
114
|
-
function askPermission(name, onResolve) {
|
|
115
|
-
return new Promise(function (resolve, reject) {
|
|
116
|
-
permissionCtx.manager.get(name, {
|
|
117
|
-
ask: false,
|
|
118
|
-
askOnDenied: false,
|
|
119
|
-
askOnPending: false,
|
|
120
|
-
}).then(function (status) {
|
|
121
|
-
var permissionModalName = "permissions.".concat(name);
|
|
122
|
-
if (!status.isGranted) {
|
|
123
|
-
modalCtx.toggleModal(permissionModalName, true, {
|
|
124
|
-
onPermissionResolve: function (status) {
|
|
125
|
-
modalCtx.toggleModal(permissionModalName, false, {});
|
|
126
|
-
setTimeout(function () {
|
|
127
|
-
onResolve === null || onResolve === void 0 ? void 0 : onResolve(status, permissionModalName);
|
|
128
|
-
resolve(status);
|
|
129
|
-
}, modalCtx.transitionDuration);
|
|
130
|
-
},
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
onResolve === null || onResolve === void 0 ? void 0 : onResolve(status.status);
|
|
135
|
-
resolve(status);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
var askMany = function (perms, onResolve, options) { return __awaiter(void 0, void 0, void 0, function () {
|
|
141
|
-
var prevModal, results, _loop_1, _i, perms_1, _permission, state_1, res;
|
|
142
|
-
return __generator(this, function (_a) {
|
|
143
|
-
switch (_a.label) {
|
|
144
|
-
case 0:
|
|
145
|
-
prevModal = null;
|
|
146
|
-
results = {};
|
|
147
|
-
_loop_1 = function (_permission) {
|
|
148
|
-
var permission, status, permissionModalName, onOpen, _b, _c;
|
|
149
|
-
return __generator(this, function (_d) {
|
|
150
|
-
switch (_d.label) {
|
|
151
|
-
case 0:
|
|
152
|
-
permission = _permission.replace('?', '');
|
|
153
|
-
return [4 /*yield*/, permissionCtx.manager.get(permission, {
|
|
154
|
-
ask: false,
|
|
155
|
-
askOnDenied: false,
|
|
156
|
-
askOnPending: false,
|
|
157
|
-
})];
|
|
158
|
-
case 1:
|
|
159
|
-
status = _d.sent();
|
|
160
|
-
results[permission] = status.status;
|
|
161
|
-
permissionModalName = "permissions.".concat(permission);
|
|
162
|
-
if (!!status.isGranted) return [3 /*break*/, 3];
|
|
163
|
-
onOpen = null;
|
|
164
|
-
if (prevModal) {
|
|
165
|
-
onOpen = function () { return new Promise(function (resolve) {
|
|
166
|
-
setTimeout(function () {
|
|
167
|
-
modalCtx.transition(prevModal, permissionModalName, {
|
|
168
|
-
props: {
|
|
169
|
-
onPermissionResolve: function (status) {
|
|
170
|
-
resolve(status);
|
|
171
|
-
permissionCtx.setState(permission, status);
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
}); };
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
onOpen = function () { return new Promise(function (resolve) {
|
|
180
|
-
setTimeout(function () {
|
|
181
|
-
modalCtx.toggleModal(permissionModalName, true, {
|
|
182
|
-
onPermissionResolve: function (status) {
|
|
183
|
-
resolve(status);
|
|
184
|
-
permissionCtx.setState(permission, status);
|
|
185
|
-
},
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
}); };
|
|
189
|
-
}
|
|
190
|
-
_b = results;
|
|
191
|
-
_c = permission;
|
|
192
|
-
return [4 /*yield*/, onOpen()];
|
|
193
|
-
case 2:
|
|
194
|
-
_b[_c] = _d.sent();
|
|
195
|
-
prevModal = permissionModalName;
|
|
196
|
-
if (!_permission.endsWith('?') && results[permission] !== 'granted') {
|
|
197
|
-
return [2 /*return*/, "break"];
|
|
198
|
-
}
|
|
199
|
-
_d.label = 3;
|
|
200
|
-
case 3: return [2 /*return*/];
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
};
|
|
204
|
-
_i = 0, perms_1 = perms;
|
|
205
|
-
_a.label = 1;
|
|
206
|
-
case 1:
|
|
207
|
-
if (!(_i < perms_1.length)) return [3 /*break*/, 4];
|
|
208
|
-
_permission = perms_1[_i];
|
|
209
|
-
return [5 /*yield**/, _loop_1(_permission)];
|
|
210
|
-
case 2:
|
|
211
|
-
state_1 = _a.sent();
|
|
212
|
-
if (state_1 === "break")
|
|
213
|
-
return [3 /*break*/, 4];
|
|
214
|
-
_a.label = 3;
|
|
215
|
-
case 3:
|
|
216
|
-
_i++;
|
|
217
|
-
return [3 /*break*/, 1];
|
|
218
|
-
case 4:
|
|
219
|
-
if (prevModal) {
|
|
220
|
-
setTimeout(function () {
|
|
221
|
-
modalCtx.toggleModal(prevModal, false, {});
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
res = __assign(__assign({}, results), { overall: Object.values(results).every(function (x) { return x === 'granted'; }) ? 'granted' : 'denied' });
|
|
225
|
-
onResolve(res);
|
|
226
|
-
return [2 /*return*/, res];
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
}); };
|
|
230
|
-
return __assign({ askPermission: askPermission, askMany: askMany }, permissionCtx);
|
|
231
|
-
};
|
|
232
|
-
exports.usePermissions = usePermissions;
|
|
233
|
-
function usePermissionModal(permissionName) {
|
|
234
|
-
var _a;
|
|
235
|
-
var modalId = "permissions.".concat(permissionName);
|
|
236
|
-
var modals = (0, context_1.useModalContext)();
|
|
237
|
-
var permissionCtx = (0, exports.usePermissions)();
|
|
238
|
-
var modalState = modals.state[modalId];
|
|
239
|
-
var currentState = (_a = permissionCtx === null || permissionCtx === void 0 ? void 0 : permissionCtx.state) === null || _a === void 0 ? void 0 : _a[permissionName];
|
|
240
|
-
var status = currentState;
|
|
241
|
-
var _b = (0, common_1.useDebounce)(status, modals.transitionDuration * 0.5), debouncedStatus = _b[0], reset = _b[1];
|
|
242
|
-
function getConfig(withStatus) {
|
|
243
|
-
var _a;
|
|
244
|
-
return __assign(__assign({}, permissionCtx.modalConfig[permissionName]), (_a = permissionCtx.modalConfig[permissionName]) === null || _a === void 0 ? void 0 : _a[withStatus]);
|
|
245
|
-
}
|
|
246
|
-
var config = getConfig(debouncedStatus);
|
|
247
|
-
function onPermissionResolve(_status) {
|
|
248
|
-
var _a, _b;
|
|
249
|
-
(_b = (_a = modalState === null || modalState === void 0 ? void 0 : modalState.props) === null || _a === void 0 ? void 0 : _a.onPermissionResolve) === null || _b === void 0 ? void 0 : _b.call(_a, _status || status);
|
|
250
|
-
}
|
|
251
|
-
(0, common_1.onUpdate)(function () {
|
|
252
|
-
if ((modalState === null || modalState === void 0 ? void 0 : modalState.visible) && !!status) {
|
|
253
|
-
if (status === 'granted') {
|
|
254
|
-
reset();
|
|
255
|
-
onPermissionResolve();
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
if (!(0, common_1.deepEqual)(config, getConfig(status))) {
|
|
259
|
-
modals.transition(modalId, modalId, {
|
|
260
|
-
props: modalState === null || modalState === void 0 ? void 0 : modalState.props,
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}, [status, modalState === null || modalState === void 0 ? void 0 : modalState.visible]);
|
|
266
|
-
function onAllow() {
|
|
267
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
268
|
-
var _a, newStatus;
|
|
269
|
-
return __generator(this, function (_b) {
|
|
270
|
-
switch (_b.label) {
|
|
271
|
-
case 0:
|
|
272
|
-
_a = config.onAllow;
|
|
273
|
-
switch (_a) {
|
|
274
|
-
case 'ask': return [3 /*break*/, 1];
|
|
275
|
-
case 'openSettings': return [3 /*break*/, 3];
|
|
276
|
-
}
|
|
277
|
-
return [3 /*break*/, 3];
|
|
278
|
-
case 1: return [4 /*yield*/, permissionCtx.manager.get(permissionName, {
|
|
279
|
-
ask: true,
|
|
280
|
-
askOnDenied: true,
|
|
281
|
-
askOnPending: true,
|
|
282
|
-
})];
|
|
283
|
-
case 2:
|
|
284
|
-
newStatus = _b.sent();
|
|
285
|
-
if (!newStatus.isGranted) {
|
|
286
|
-
onPermissionResolve(newStatus.status);
|
|
287
|
-
}
|
|
288
|
-
return [3 /*break*/, 4];
|
|
289
|
-
case 3:
|
|
290
|
-
react_native_1.Linking.openSettings();
|
|
291
|
-
return [3 /*break*/, 4];
|
|
292
|
-
case 4: return [2 /*return*/];
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
function onDeny() {
|
|
298
|
-
onPermissionResolve();
|
|
299
|
-
}
|
|
300
|
-
return {
|
|
301
|
-
onAllow: onAllow,
|
|
302
|
-
onDeny: onDeny,
|
|
303
|
-
modalId: modalId,
|
|
304
|
-
permissionName: permissionName,
|
|
305
|
-
modalState: __assign({}, modalState),
|
|
306
|
-
currentState: currentState,
|
|
307
|
-
config: config,
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
exports.usePermissionModal = usePermissionModal;
|
|
311
|
-
function createTypedPermissionHooks(configuration) {
|
|
312
|
-
var _usePermissions = exports.usePermissions;
|
|
313
|
-
var _usePermissionModal = usePermissionModal;
|
|
314
|
-
return {
|
|
315
|
-
usePermissions: _usePermissions,
|
|
316
|
-
usePermissionModal: _usePermissionModal,
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
exports.createTypedPermissionHooks = createTypedPermissionHooks;
|
|
320
|
-
//# sourceMappingURL=context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,IAAI;oBAChC,IAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;oBAClC,IAAI,CAAC,IAAA,kBAAS,EAAC,QAAQ,EAAE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FC;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"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { usePermissions, Provider, createTypedPermissionHooks, usePermissionModal } from './context';
|
|
2
|
-
import { PermissionConfig, PermissionModalsConfig } from './types';
|
|
3
|
-
export { usePermissions, Provider, usePermissionModal, createTypedPermissionHooks, };
|
|
4
|
-
export type { PermissionConfig, PermissionModalsConfig, };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTypedPermissionHooks = exports.usePermissionModal = exports.Provider = exports.usePermissions = void 0;
|
|
4
|
-
var context_1 = require("./context");
|
|
5
|
-
Object.defineProperty(exports, "usePermissions", { enumerable: true, get: function () { return context_1.usePermissions; } });
|
|
6
|
-
Object.defineProperty(exports, "Provider", { enumerable: true, get: function () { return context_1.Provider; } });
|
|
7
|
-
Object.defineProperty(exports, "createTypedPermissionHooks", { enumerable: true, get: function () { return context_1.createTypedPermissionHooks; } });
|
|
8
|
-
Object.defineProperty(exports, "usePermissionModal", { enumerable: true, get: function () { return context_1.usePermissionModal; } });
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/PermissionManager/index.ts"],"names":[],"mappings":";;;AAAA,qCAAoG;AAQlG,+FARO,wBAAc,OAQP;AACd,yFATuB,kBAAQ,OASvB;AAER,2GAXiC,oCAA0B,OAWjC;AAD1B,mGAV6D,4BAAkB,OAU7D"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PermissionTypes } from '@codeleap/common';
|
|
2
|
-
declare type NonGrantedPermissionTypes = Exclude<PermissionTypes.PermissionStatus, 'granted'>;
|
|
3
|
-
export declare type BasePermissionConfig = {
|
|
4
|
-
fullscreenModal?: boolean;
|
|
5
|
-
dismissable?: boolean;
|
|
6
|
-
title: string;
|
|
7
|
-
onAllow: 'openSettings' | 'ask';
|
|
8
|
-
description: string[];
|
|
9
|
-
icon: string;
|
|
10
|
-
};
|
|
11
|
-
export declare type PermissionConfig = BasePermissionConfig & Partial<Record<NonGrantedPermissionTypes, Partial<BasePermissionConfig>>>;
|
|
12
|
-
export declare type PermissionModalsConfig<PermissionNames extends string | number | symbol> = Partial<Record<PermissionNames, PermissionConfig>>;
|
|
13
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/PermissionManager/types.ts"],"names":[],"mappings":""}
|
package/dist/utils/hooks.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Animated, AppStateStatus, PressableAndroidRippleConfig, ViewStyle, ImageStyle, TextStyle } from 'react-native';
|
|
2
|
-
import { AnimatedStyleProp, EasingFn } from 'react-native-reanimated';
|
|
3
|
-
export declare function useAnimateColor(value: string, opts?: Partial<Animated.TimingAnimationConfig>): Animated.AnimatedInterpolation;
|
|
4
|
-
export declare function useAppState(filter?: AppStateStatus[]): {
|
|
5
|
-
appState: AppStateStatus;
|
|
6
|
-
};
|
|
7
|
-
declare type SelectProperties<T extends Record<string | number | symbol, any>, K extends keyof T> = {
|
|
8
|
-
[P in K]: T[K];
|
|
9
|
-
};
|
|
10
|
-
export declare function useStaticAnimationStyles<T extends Record<string | number | symbol, any>, K extends keyof T>(obj: T, keys: K[]): SelectProperties<T, K>;
|
|
11
|
-
declare type AnimatableProperties = 'scale' | 'scaleX' | 'scaleY' | 'translateX' | 'translateY' | 'opacity';
|
|
12
|
-
declare type VariantTransitionConfig = {
|
|
13
|
-
type: 'timing';
|
|
14
|
-
duration?: number;
|
|
15
|
-
easing?: EasingFn;
|
|
16
|
-
};
|
|
17
|
-
declare type TransitionConfig = Partial<Record<AnimatableProperties, VariantTransitionConfig>> | VariantTransitionConfig;
|
|
18
|
-
declare type UseAnimatedVariantStylesConfig<T extends Record<string | number | symbol, any>, K extends keyof T> = {
|
|
19
|
-
variantStyles: T;
|
|
20
|
-
animatedProperties: K[];
|
|
21
|
-
updater: (states: SelectProperties<T, K>) => AnimatedStyleProp<ViewStyle | ImageStyle | TextStyle>;
|
|
22
|
-
transition: TransitionConfig;
|
|
23
|
-
dependencies?: any[];
|
|
24
|
-
};
|
|
25
|
-
export declare function useAnimatedVariantStyles<T extends Record<string | number | symbol, any>, K extends keyof T>(config: UseAnimatedVariantStylesConfig<T, K>): {};
|
|
26
|
-
export declare type FeedbackConfig = {
|
|
27
|
-
type: 'opacity';
|
|
28
|
-
value?: number;
|
|
29
|
-
} | {
|
|
30
|
-
type: 'highlight';
|
|
31
|
-
color?: string;
|
|
32
|
-
brightness?: number;
|
|
33
|
-
shiftOpacity?: number;
|
|
34
|
-
} | {
|
|
35
|
-
type: 'none';
|
|
36
|
-
};
|
|
37
|
-
declare type RippleConfig = {
|
|
38
|
-
type: 'ripple';
|
|
39
|
-
config?: PressableAndroidRippleConfig;
|
|
40
|
-
iosFallback?: FeedbackConfig;
|
|
41
|
-
};
|
|
42
|
-
export declare type TouchableFeedbackConfig = RippleConfig | FeedbackConfig;
|
|
43
|
-
export declare type UsePressableFeedbackConfig = {
|
|
44
|
-
disabled?: boolean;
|
|
45
|
-
feedbackConfig?: TouchableFeedbackConfig;
|
|
46
|
-
hightlightPropertyIn: 'backgroundColor' | 'borderColor' | 'color';
|
|
47
|
-
hightlightPropertyOut: 'backgroundColor' | 'borderColor' | 'color';
|
|
48
|
-
};
|
|
49
|
-
export declare function usePressableFeedback(styles: any, config: UsePressableFeedbackConfig): {
|
|
50
|
-
getFeedbackStyle: (pressed: boolean) => {
|
|
51
|
-
[x: string]: any;
|
|
52
|
-
opacity?: undefined;
|
|
53
|
-
} | {
|
|
54
|
-
opacity: number;
|
|
55
|
-
};
|
|
56
|
-
rippleConfig: PressableAndroidRippleConfig;
|
|
57
|
-
};
|
|
58
|
-
export declare function useBackButton(cb: () => boolean | void, deps?: any[]): void;
|
|
59
|
-
declare type StateSetter<T> = T | ((prev: T) => T);
|
|
60
|
-
export declare function useAsyncStorageState<T>(key: string, defaultValue?: T): [T, (to: StateSetter<T>) => Promise<void>];
|
|
61
|
-
export {};
|