@codeleap/mobile 4.2.18 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ActivityIndicator/types.d.ts +1 -1
- package/dist/components/Autocomplete/index.js +2 -1
- package/dist/components/Autocomplete/index.js.map +1 -1
- package/dist/components/Autocomplete/types.d.ts +2 -1
- package/dist/components/Avatar/index.js +3 -1
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Badge/types.d.ts +1 -1
- package/dist/components/Button/styles.d.ts +1 -1
- package/dist/components/Calendar/index.js +1 -1
- package/dist/components/Calendar/index.js.map +1 -1
- package/dist/components/Calendar/types.d.ts +1 -1
- package/dist/components/DatePickerModal/index.js +3 -1
- package/dist/components/DatePickerModal/index.js.map +1 -1
- package/dist/components/DatePickerModal/types.d.ts +2 -1
- package/dist/components/FileInput/index.js +1 -1
- package/dist/components/FileInput/index.js.map +1 -1
- package/dist/components/FileInput/types.d.ts +2 -1
- package/dist/components/Icon/index.js +2 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Image/index.js +2 -1
- package/dist/components/Image/index.js.map +1 -1
- package/dist/components/Image/types.d.ts +1 -1
- package/dist/components/ImageView/Spotlight.js +3 -1
- package/dist/components/ImageView/Spotlight.js.map +1 -1
- package/dist/components/ImageView/component.d.ts +1 -1
- package/dist/components/ImageView/component.js +1 -1
- package/dist/components/ImageView/component.js.map +1 -1
- package/dist/components/InputBase/index.js +2 -1
- package/dist/components/InputBase/index.js.map +1 -1
- package/dist/components/InputBase/styles.js +1 -1
- package/dist/components/InputBase/styles.js.map +1 -1
- package/dist/components/InputBase/types.d.ts +1 -1
- package/dist/components/List/index.js +2 -1
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/types.d.ts +1 -1
- package/dist/components/Navigation/Navigation.js +1 -1
- package/dist/components/Navigation/Navigation.js.map +1 -1
- package/dist/components/NumberIncrement/index.js +2 -1
- package/dist/components/NumberIncrement/index.js.map +1 -1
- package/dist/components/NumberIncrement/types.d.ts +2 -1
- package/dist/components/Pager/PagerDots.d.ts +1 -1
- package/dist/components/Pager/index.js +2 -1
- package/dist/components/Pager/index.js.map +1 -1
- package/dist/components/PaginationIndicator/index.js +1 -1
- package/dist/components/PaginationIndicator/index.js.map +1 -1
- package/dist/components/PlacesAutocomplete/index.js +1 -1
- package/dist/components/PlacesAutocomplete/index.js.map +1 -1
- package/dist/components/PlacesAutocomplete/types.d.ts +1 -1
- package/dist/components/RadioInput/index.js +1 -1
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/types.d.ts +2 -1
- package/dist/components/Scroll/index.js +2 -1
- package/dist/components/Scroll/index.js.map +1 -1
- package/dist/components/SearchInput/index.js +1 -1
- package/dist/components/SearchInput/index.js.map +1 -1
- package/dist/components/SectionFilters/index.js +2 -1
- package/dist/components/SectionFilters/index.js.map +1 -1
- package/dist/components/SectionFilters/useSectionFilters.js +2 -1
- package/dist/components/SectionFilters/useSectionFilters.js.map +1 -1
- package/dist/components/Sections/index.js +2 -1
- package/dist/components/Sections/index.js.map +1 -1
- package/dist/components/SegmentedControl/Option.d.ts +1 -1
- package/dist/components/SegmentedControl/styles.d.ts +1 -1
- package/dist/components/SegmentedControl/types.d.ts +1 -1
- package/dist/components/Select/index.js +2 -1
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/types.d.ts +2 -1
- package/dist/components/Slider/index.js +2 -1
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/SortablePhotos/useSortablePhotos.d.ts +1 -1
- package/dist/components/SortablePhotos/useSortablePhotos.js +3 -3
- package/dist/components/SortablePhotos/useSortablePhotos.js.map +1 -1
- package/dist/components/Text/index.js +1 -1
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Text/styles.d.ts +1 -1
- package/dist/components/TextInput/index.js +3 -1
- package/dist/components/TextInput/index.js.map +1 -1
- package/dist/components/TextInput/types.d.ts +2 -1
- package/dist/components/Touchable/index.js +3 -1
- package/dist/components/Touchable/index.js.map +1 -1
- package/dist/components/Touchable/types.d.ts +1 -1
- package/dist/components/View/types.d.ts +1 -1
- package/dist/modules/types/textInputMask.d.ts +1 -1
- package/dist/utils/KeyboardAware/keyboardHooks.js +1 -1
- package/dist/utils/KeyboardAware/keyboardHooks.js.map +1 -1
- package/dist/utils/MobilePermissionManager/Permission.d.ts +19 -0
- package/dist/utils/MobilePermissionManager/Permission.js +65 -0
- package/dist/utils/MobilePermissionManager/Permission.js.map +1 -0
- package/dist/utils/MobilePermissionManager/PermissionManager.d.ts +24 -0
- package/dist/utils/MobilePermissionManager/PermissionManager.js +84 -0
- package/dist/utils/MobilePermissionManager/PermissionManager.js.map +1 -0
- package/dist/utils/MobilePermissionManager/index.d.ts +3 -0
- package/dist/utils/MobilePermissionManager/index.js +5 -0
- package/dist/utils/MobilePermissionManager/index.js.map +1 -0
- package/dist/utils/MobilePermissionManager/types.d.ts +32 -0
- package/dist/utils/MobilePermissionManager/types.js +2 -0
- package/dist/utils/MobilePermissionManager/types.js.map +1 -0
- package/dist/utils/ModalManager/components.d.ts +1 -1
- package/dist/utils/ModalManager/components.js +1 -1
- package/dist/utils/ModalManager/components.js.map +1 -1
- package/dist/utils/ModalManager/context.d.ts +1 -1
- package/dist/utils/ModalManager/context.js +2 -1
- package/dist/utils/ModalManager/context.js.map +1 -1
- package/dist/utils/NotificationManager/index.d.ts +2 -2
- package/dist/utils/NotificationManager/index.js +1 -1
- package/dist/utils/NotificationManager/index.js.map +1 -1
- package/dist/utils/NotificationManager/types.d.ts +1 -1
- package/dist/utils/PermissionManager/context.d.ts +1 -1
- package/dist/utils/PermissionManager/context.js +2 -1
- package/dist/utils/PermissionManager/context.js.map +1 -1
- package/dist/utils/PermissionManager/types.d.ts +1 -1
- package/dist/utils/StorageManager.d.ts +1 -1
- package/dist/utils/hooks.js +3 -1
- package/dist/utils/hooks.js.map +1 -1
- package/dist/utils/misc.d.ts +1 -1
- package/dist/utils/misc.js +2 -1
- package/dist/utils/misc.js.map +1 -1
- package/dist/utils/useQueryListRefresh.d.ts +2 -1
- package/dist/utils/useQueryListRefresh.js +1 -1
- package/dist/utils/useQueryListRefresh.js.map +1 -1
- package/package.json +19 -5
- package/package.json.bak +18 -4
- package/src/components/ActivityIndicator/types.ts +1 -1
- package/src/components/Autocomplete/index.tsx +3 -1
- package/src/components/Autocomplete/types.ts +2 -1
- package/src/components/Avatar/index.tsx +3 -1
- package/src/components/Badge/index.tsx +2 -2
- package/src/components/Badge/types.ts +1 -1
- package/src/components/Button/index.tsx +1 -1
- package/src/components/Button/styles.ts +1 -1
- package/src/components/Calendar/index.tsx +1 -1
- package/src/components/Calendar/types.ts +1 -2
- package/src/components/DatePickerModal/index.tsx +3 -1
- package/src/components/DatePickerModal/types.ts +2 -1
- package/src/components/FileInput/index.tsx +2 -1
- package/src/components/FileInput/types.ts +2 -1
- package/src/components/Icon/index.tsx +2 -1
- package/src/components/Image/index.tsx +2 -1
- package/src/components/Image/types.ts +1 -1
- package/src/components/ImageView/Spotlight.tsx +3 -1
- package/src/components/ImageView/component.tsx +3 -1
- package/src/components/InputBase/index.tsx +2 -1
- package/src/components/InputBase/styles.ts +1 -1
- package/src/components/InputBase/types.ts +1 -1
- package/src/components/List/index.tsx +2 -1
- package/src/components/Modal/index.tsx +1 -1
- package/src/components/Modal/types.ts +1 -1
- package/src/components/Navigation/Navigation.tsx +1 -1
- package/src/components/NumberIncrement/index.tsx +2 -1
- package/src/components/NumberIncrement/types.ts +2 -1
- package/src/components/Pager/PagerDots.tsx +1 -1
- package/src/components/Pager/index.tsx +2 -1
- package/src/components/PaginationIndicator/index.tsx +1 -1
- package/src/components/PlacesAutocomplete/index.tsx +1 -1
- package/src/components/PlacesAutocomplete/types.ts +1 -1
- package/src/components/RadioInput/index.tsx +1 -1
- package/src/components/RadioInput/types.ts +2 -1
- package/src/components/Scroll/index.tsx +2 -1
- package/src/components/SearchInput/index.tsx +1 -1
- package/src/components/SectionFilters/index.tsx +2 -1
- package/src/components/SectionFilters/useSectionFilters.tsx +2 -1
- package/src/components/Sections/index.tsx +2 -1
- package/src/components/SegmentedControl/Option.tsx +1 -1
- package/src/components/SegmentedControl/styles.ts +1 -1
- package/src/components/SegmentedControl/types.ts +1 -1
- package/src/components/Select/index.tsx +3 -3
- package/src/components/Select/types.ts +2 -1
- package/src/components/Slider/index.tsx +2 -1
- package/src/components/SortablePhotos/useSortablePhotos.ts +3 -3
- package/src/components/Text/index.tsx +1 -1
- package/src/components/Text/styles.ts +1 -1
- package/src/components/TextInput/index.tsx +3 -1
- package/src/components/TextInput/types.ts +2 -1
- package/src/components/Touchable/index.tsx +3 -1
- package/src/components/Touchable/types.ts +1 -1
- package/src/components/View/types.ts +1 -1
- package/src/modules/types/textInputMask.ts +1 -1
- package/src/utils/KeyboardAware/keyboardHooks.ts +1 -1
- package/src/utils/MobilePermissionManager/Permission.ts +79 -0
- package/src/utils/MobilePermissionManager/PermissionManager.ts +124 -0
- package/src/utils/MobilePermissionManager/index.ts +3 -0
- package/src/utils/MobilePermissionManager/types.ts +44 -0
- package/src/utils/ModalManager/components.tsx +2 -1
- package/src/utils/ModalManager/context.tsx +2 -1
- package/src/utils/NotificationManager/index.ts +2 -1
- package/src/utils/NotificationManager/types.ts +1 -1
- package/src/utils/PermissionManager/context.tsx +3 -1
- package/src/utils/PermissionManager/types.ts +1 -1
- package/src/utils/StorageManager.ts +1 -1
- package/src/utils/hooks.ts +3 -1
- package/src/utils/misc.ts +2 -1
- package/src/utils/useQueryListRefresh.ts +2 -1
- package/dist/utils/deprecated/notifications.d.ts +0 -40
- package/dist/utils/deprecated/notifications.js +0 -167
- package/dist/utils/deprecated/notifications.js.map +0 -1
- package/src/utils/deprecated/notifications.ts +0 -213
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CreateOSAlert
|
|
1
|
+
import { CreateOSAlert } from '@codeleap/modals'
|
|
2
|
+
import { useEffect, useMemo, useState } from '@codeleap/hooks'
|
|
2
3
|
import { FileInputImageSource, useFileInput } from '../FileInput'
|
|
3
4
|
import { SortablePhoto, SortablePhotosProps } from './types'
|
|
4
5
|
|
|
@@ -20,7 +21,6 @@ export const useSortablePhotos = <T extends SortablePhoto>(props: SortablePhotos
|
|
|
20
21
|
} = props
|
|
21
22
|
|
|
22
23
|
const input = useFileInput()
|
|
23
|
-
const { logger } = useGlobalContext()
|
|
24
24
|
|
|
25
25
|
const [data, setData] = useState<T[]>([])
|
|
26
26
|
|
|
@@ -91,7 +91,7 @@ export const useSortablePhotos = <T extends SortablePhoto>(props: SortablePhotos
|
|
|
91
91
|
multiple: isEdit ? false : props?.multiple
|
|
92
92
|
})
|
|
93
93
|
} catch (error) {
|
|
94
|
-
|
|
94
|
+
console.error('Error opening file picker:', error)
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
if (files?.length <= 0) return null
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef, useState } from 'react'
|
|
2
|
-
import { TypeGuards } from '@codeleap/
|
|
2
|
+
import { TypeGuards } from '@codeleap/types'
|
|
3
3
|
import { Animated, Platform, Text as NativeText } from 'react-native'
|
|
4
4
|
import { TouchableFeedbackConfig, usePressableFeedback } from '../../utils'
|
|
5
5
|
import { TextProps } from './types'
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { useValidate } from '@codeleap/form'
|
|
3
|
+
import { useBooleanToggle } from '@codeleap/hooks'
|
|
4
|
+
import { TypeGuards } from '@codeleap/types'
|
|
3
5
|
import { forwardRef, useImperativeHandle } from 'react'
|
|
4
6
|
import { TextInput as NativeTextInput, NativeSyntheticEvent, TextInputFocusEventData } from 'react-native'
|
|
5
7
|
import { InputBase, selectInputBaseProps } from '../InputBase'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { InputBaseProps } from '../InputBase'
|
|
2
2
|
import { TextInputProps as RNTextInputProps, TextInput as RNTextInput } from 'react-native'
|
|
3
|
-
import { AnyFunction
|
|
3
|
+
import { AnyFunction } from '@codeleap/types'
|
|
4
|
+
import { FormTypes, yup } from '@codeleap/form'
|
|
4
5
|
import { AppIcon, StyledProp } from '@codeleap/styles'
|
|
5
6
|
import { TextInputMaskProps } from '../../modules/textInputMask'
|
|
6
7
|
import { TextInputComposition } from './styles'
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react'
|
|
2
|
-
import { TypeGuards
|
|
2
|
+
import { TypeGuards } from '@codeleap/types'
|
|
3
|
+
import { onMount } from '@codeleap/hooks'
|
|
4
|
+
import { useGlobalContext } from '@codeleap/common'
|
|
3
5
|
import { Pressable, StyleSheet, View as RNView, Insets, Platform } from 'react-native'
|
|
4
6
|
import { View } from '../View'
|
|
5
7
|
import { TouchableFeedbackConfig, usePressableFeedback } from '../../utils'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsOf } from '@codeleap/
|
|
1
|
+
import { PropsOf } from '@codeleap/types'
|
|
2
2
|
import { StyledProp } from '@codeleap/styles'
|
|
3
3
|
import { ImageStyle, TextStyle, View as RNView, ViewStyle } from 'react-native'
|
|
4
4
|
import { AnimatedStyleProp } from 'react-native-reanimated'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsOf, TypeGuards } from '@codeleap/
|
|
1
|
+
import { PropsOf, TypeGuards } from '@codeleap/types'
|
|
2
2
|
import { ScrollView, Platform, StyleSheet, Dimensions, EasingFunction, Easing } from 'react-native'
|
|
3
3
|
import { TransitionConfig } from '../../types'
|
|
4
4
|
import { useKeyboard } from './context'
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { AnyFunction } from '@codeleap/types'
|
|
2
|
+
import * as PermissionTypes from './types'
|
|
3
|
+
|
|
4
|
+
const SCOPE = 'Permissions'
|
|
5
|
+
|
|
6
|
+
export class Permission implements PermissionTypes.IPermission {
|
|
7
|
+
status: PermissionTypes.PermissionStatus
|
|
8
|
+
|
|
9
|
+
shouldAsk: boolean
|
|
10
|
+
|
|
11
|
+
constructor(private actions:PermissionTypes.PermissionActions & {log?: AnyFunction}, public name = '') {
|
|
12
|
+
this.actions = actions
|
|
13
|
+
this.shouldAsk = true
|
|
14
|
+
this.status = 'pending'
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async ask(): Promise<void> {
|
|
19
|
+
const newState = await this.actions.onAsk()
|
|
20
|
+
this.actions.log(`Request for permission ${this.name} returned`, newState, SCOPE)
|
|
21
|
+
this.status = newState
|
|
22
|
+
|
|
23
|
+
if (newState === 'blocked') {
|
|
24
|
+
this.shouldAsk = false
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async check(options?:PermissionTypes.CheckOptions): Promise<void> {
|
|
29
|
+
const _options:PermissionTypes.CheckOptions = {
|
|
30
|
+
askOnPending: true,
|
|
31
|
+
askOnDenied: false,
|
|
32
|
+
ask: true,
|
|
33
|
+
...options,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
this.status = await this.actions.onCheck()
|
|
37
|
+
this.actions.log(`Check for permission ${this.name} returned`, this.status, SCOPE)
|
|
38
|
+
if (!_options.ask) return
|
|
39
|
+
|
|
40
|
+
switch (this.status) {
|
|
41
|
+
case 'denied':
|
|
42
|
+
if (_options.askOnDenied) {
|
|
43
|
+
await this.ask()
|
|
44
|
+
}
|
|
45
|
+
break
|
|
46
|
+
case 'pending':
|
|
47
|
+
if (_options.askOnPending) {
|
|
48
|
+
await this.ask()
|
|
49
|
+
}
|
|
50
|
+
break
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
get isGranted() {
|
|
55
|
+
return this.status === 'granted'
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get isDenied() {
|
|
59
|
+
return this.status === 'denied'
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get isPending() {
|
|
63
|
+
return this.status === 'pending'
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
get isBlocked() {
|
|
67
|
+
return this.status === 'blocked'
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get isUnavailable() {
|
|
71
|
+
return this.status === 'unavailable'
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
get isLimited() {
|
|
76
|
+
return this.status === 'limited'
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Logger } from '@codeleap/logger'
|
|
2
|
+
import { Permission } from './Permission'
|
|
3
|
+
import * as PermissionTypes from './types'
|
|
4
|
+
|
|
5
|
+
export class PermissionManager<
|
|
6
|
+
T extends PermissionTypes.PermissionActionRecord,
|
|
7
|
+
I extends PermissionTypes.IPermissionManager<T> = PermissionTypes.IPermissionManager<T>
|
|
8
|
+
> implements PermissionTypes.IPermissionManager<T> {
|
|
9
|
+
private _permissions:Record<keyof T, Permission>
|
|
10
|
+
|
|
11
|
+
subscriberArgs:Parameters<PermissionTypes.ChangeListener<T>>
|
|
12
|
+
|
|
13
|
+
private subscribers: PermissionTypes.ChangeListener<T>[]
|
|
14
|
+
|
|
15
|
+
private permSubscribers: Record<keyof T, PermissionTypes.PermissionSubscriber[]>
|
|
16
|
+
|
|
17
|
+
public _perms: T
|
|
18
|
+
|
|
19
|
+
public opts: I
|
|
20
|
+
|
|
21
|
+
private params: T
|
|
22
|
+
|
|
23
|
+
public permissions: {
|
|
24
|
+
[Property in keyof T as Uppercase<string & Property>] : Property
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
logger: Logger
|
|
28
|
+
|
|
29
|
+
constructor(perms: T, options?: PermissionTypes.PermissionManagerOptions) {
|
|
30
|
+
this.params = perms
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
this._permissions = {}
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
this.permissions = {}
|
|
35
|
+
|
|
36
|
+
this.logger = options?.logger
|
|
37
|
+
this.permSubscribers = {} as typeof this.permSubscribers
|
|
38
|
+
|
|
39
|
+
for (const [permName, actions] of Object.entries(this.params)) {
|
|
40
|
+
const name = permName as keyof T
|
|
41
|
+
this._permissions[name] = new Permission({ ...actions, log: this.logger?.log || (() => null) }, permName)
|
|
42
|
+
|
|
43
|
+
this.permSubscribers[name] = []
|
|
44
|
+
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
this.permissions[(name as string).toUpperCase()] = name
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
this.subscribers = []
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get values() {
|
|
53
|
+
return this._permissions as unknown as Record<keyof T, PermissionTypes.PermissionState>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private async check(name: keyof T, options?: PermissionTypes.CheckOptions): Promise<PermissionTypes.PermissionState> {
|
|
57
|
+
const previousStatus = this._permissions[name].status
|
|
58
|
+
|
|
59
|
+
await this._permissions[name].check(options)
|
|
60
|
+
|
|
61
|
+
if (this._permissions[name].status !== previousStatus) {
|
|
62
|
+
this.permSubscribers[name].forEach(sub => sub(this._permissions[name]))
|
|
63
|
+
this.subscribers.forEach(sub => sub(name, this._permissions[name]))
|
|
64
|
+
}
|
|
65
|
+
return this._permissions[name]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
getMany:I['getMany'] = async (perms, options) => {
|
|
69
|
+
|
|
70
|
+
const results = []
|
|
71
|
+
|
|
72
|
+
for (const p of perms) {
|
|
73
|
+
const isArray = Array.isArray(p)
|
|
74
|
+
const name = isArray ? p[0] : p
|
|
75
|
+
const opts = isArray ? p[1] : options
|
|
76
|
+
|
|
77
|
+
results.push(await this.check(name, opts))
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return results
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
get:I['get'] = async (name, options) => {
|
|
85
|
+
return await this.check(name, options)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
onPermissionChange(name: keyof T, callback:PermissionTypes.PermissionSubscriber) {
|
|
89
|
+
const subIdx = this.permSubscribers[name].push(callback) - 1
|
|
90
|
+
|
|
91
|
+
return () => {
|
|
92
|
+
this.permSubscribers[name].splice(subIdx, 1)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
onChange(callback:PermissionTypes.ChangeListener<T>) {
|
|
97
|
+
const subIdx = this.subscribers.push(callback) - 1
|
|
98
|
+
|
|
99
|
+
return () => {
|
|
100
|
+
this.subscribers.splice(subIdx, 1)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
getState() {
|
|
105
|
+
const state = {}
|
|
106
|
+
|
|
107
|
+
for (const [p, { ask: _ig2, check: _ig1, ...values }] of Object.entries(this._permissions)) {
|
|
108
|
+
state[p] = { ...values }
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return state as Record<keyof T, PermissionTypes.PermissionState>
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async update() {
|
|
115
|
+
const res = {} as Record<keyof T, PermissionTypes.PermissionState>
|
|
116
|
+
for (const p of Object.keys(this._permissions)) {
|
|
117
|
+
res[p as keyof T] = await this.check(p, {
|
|
118
|
+
ask: false,
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
return res
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Logger } from '@codeleap/logger'
|
|
2
|
+
import { FunctionType } from '@codeleap/types'
|
|
3
|
+
|
|
4
|
+
export const permissionStatuses = ['unavailable', 'pending', 'denied', 'limited', 'granted', 'blocked'] as const
|
|
5
|
+
export type PermissionStatus = typeof permissionStatuses[number]
|
|
6
|
+
|
|
7
|
+
export type PermissionState = {
|
|
8
|
+
status: PermissionStatus
|
|
9
|
+
shouldAsk: boolean
|
|
10
|
+
|
|
11
|
+
} & Record<`is${Capitalize<PermissionStatus>}`, boolean>
|
|
12
|
+
|
|
13
|
+
export type CheckOptions = {
|
|
14
|
+
askOnPending?:boolean
|
|
15
|
+
askOnDenied?:boolean
|
|
16
|
+
ask?: boolean
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type IPermission = {
|
|
21
|
+
ask():Promise<void>
|
|
22
|
+
check(options?:CheckOptions):Promise<void>
|
|
23
|
+
|
|
24
|
+
} & PermissionState
|
|
25
|
+
|
|
26
|
+
export type PermFunction = FunctionType<[], Promise<PermissionStatus>>
|
|
27
|
+
|
|
28
|
+
export type PermissionActions = Record<'onAsk'|'onCheck', PermFunction> & { init?: 'check' | PermissionState }
|
|
29
|
+
|
|
30
|
+
export type PermissionActionRecord = Record<string, PermissionActions>
|
|
31
|
+
|
|
32
|
+
export interface IPermissionManager<T extends PermissionActionRecord> {
|
|
33
|
+
getMany(perms: PermissionArray<T>, options?: CheckOptions): Promise<PermissionState[]>
|
|
34
|
+
get(name: keyof T, options?: CheckOptions): Promise<PermissionState>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type ChangeListener<T> = FunctionType<[keyof T, PermissionState], any>
|
|
38
|
+
export type PermissionSubscriber = FunctionType<[PermissionState], any>
|
|
39
|
+
|
|
40
|
+
export type PermissionArray<T> = ([name: keyof T, options: CheckOptions])[] | (keyof T)[]
|
|
41
|
+
|
|
42
|
+
export type PermissionManagerOptions = {
|
|
43
|
+
logger?: Logger
|
|
44
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { usePrevious, onMount, onUpdate
|
|
2
|
+
import { usePrevious, onMount, onUpdate } from '@codeleap/hooks'
|
|
3
|
+
import { PropsOf } from '@codeleap/types'
|
|
3
4
|
import { useModalContext } from './context'
|
|
4
5
|
import { Portal } from '@gorhom/portal'
|
|
5
6
|
import { Modal as _Modal } from '../../components/Modal'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { AnyFunction,
|
|
2
|
+
import { AnyFunction, TypeGuards } from '@codeleap/types'
|
|
3
|
+
import { onUpdate, useState } from '@codeleap/hooks'
|
|
3
4
|
import { PortalProvider } from '@gorhom/portal'
|
|
4
5
|
import { KeyboardProvider } from '../KeyboardAware'
|
|
5
6
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AnyFunction
|
|
1
|
+
import { AnyFunction } from '@codeleap/types'
|
|
2
|
+
import { silentLogger } from '@codeleap/logger' // @ts-ignore
|
|
2
3
|
import messaging from '@react-native-firebase/messaging'
|
|
3
4
|
import { Subscriber, Subscription } from '../Subscription'
|
|
4
5
|
import { Message, NotificationInitializeCallback, NotificationManagerOptions, NotificationType, TNotification } from './types'
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React, { useContext, useState } from 'react'
|
|
2
2
|
import { useModalContext } from '../ModalManager/context'
|
|
3
|
-
import {
|
|
3
|
+
import { onMount, onUpdate, useDebounce, usePrevious } from '@codeleap/hooks'
|
|
4
|
+
import { deepEqual } from '@codeleap/utils'
|
|
4
5
|
import { AppState, Linking } from 'react-native'
|
|
5
6
|
import { PermissionConfig, PermissionModalsConfig } from './types'
|
|
7
|
+
import { PermissionManager, PermissionTypes } from '../MobilePermissionManager'
|
|
6
8
|
|
|
7
9
|
type TPermissionContext = {
|
|
8
10
|
state: Record<string, PermissionTypes.PermissionStatus>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PermissionTypes } from '@codeleap/common'
|
|
2
1
|
import { ImageProps } from '../../components/Image'
|
|
2
|
+
import { PermissionTypes } from '../MobilePermissionManager'
|
|
3
3
|
type NonGrantedPermissionTypes = Exclude<PermissionTypes.PermissionStatus, 'granted'>
|
|
4
4
|
|
|
5
5
|
export type BasePermissionConfig = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MMKV } from 'react-native-mmkv'
|
|
2
|
-
import { AnyFunction, AnyRecord } from '@codeleap/
|
|
2
|
+
import { AnyFunction, AnyRecord } from '@codeleap/types'
|
|
3
3
|
|
|
4
4
|
type StorageKey<T extends Record<string, any>> = keyof T | (string & {}) | ((allKeys: T) => string) | [keyof T, any]
|
|
5
5
|
|
package/src/utils/hooks.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { onMount, onUpdate,
|
|
1
|
+
import { onMount, onUpdate, usePrevious, useRef, useState } from '@codeleap/hooks'
|
|
2
|
+
import { shadeColor } from '@codeleap/utils'
|
|
3
|
+
import { TypeGuards } from '@codeleap/types'
|
|
2
4
|
import { Animated, AppState, AppStateStatus, Platform, BackHandler, ViewStyle, ImageStyle, TextStyle, StyleSheet, StyleProp } from 'react-native'
|
|
3
5
|
import { AnimatedStyleProp, Easing, EasingFn, useAnimatedStyle, withTiming } from 'react-native-reanimated'
|
|
4
6
|
import { PressableRippleProps } from '../modules/PressableRipple/type'
|
package/src/utils/misc.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { MobileFile, MobileInputFile,
|
|
1
|
+
import { MobileFile, MobileInputFile, FileWithPreview, TypeGuards } from '@codeleap/types'
|
|
2
|
+
import { parseFilePathData } from '@codeleap/utils'
|
|
2
3
|
|
|
3
4
|
export const stringToFile = (str: string): MobileInputFile => {
|
|
4
5
|
if (!str) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { useFocusEffect } from '@react-navigation/native'
|
|
3
|
-
import { AnyFunction, TypeGuards
|
|
3
|
+
import { AnyFunction, TypeGuards } from '@codeleap/types'
|
|
4
|
+
import { UseListEffect } from '@codeleap/query'
|
|
4
5
|
|
|
5
6
|
type useQueryListRefresh = (
|
|
6
7
|
listQuery: Parameters<UseListEffect>[0],
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { FunctionType } from '@codeleap/common';
|
|
2
|
-
import { FirebaseMessagingTypes } from '@react-native-firebase/messaging';
|
|
3
|
-
export type Message = FirebaseMessagingTypes.RemoteMessage;
|
|
4
|
-
export type MessageType = 'foreground' | 'background' | 'press' | 'initial';
|
|
5
|
-
export type NotificationHandler = FunctionType<[message: Message, type: MessageType], any>;
|
|
6
|
-
export type HandleNotificationParam = {
|
|
7
|
-
data: Message;
|
|
8
|
-
type: MessageType;
|
|
9
|
-
};
|
|
10
|
-
export type NotificationStateChangeListener = FunctionType<[isInitialized: boolean, token?: string], any>;
|
|
11
|
-
/**
|
|
12
|
-
* Class responsible for the notification system
|
|
13
|
-
*
|
|
14
|
-
* @deprecated Use the most updated version
|
|
15
|
-
* @note check the documentation to make the migration
|
|
16
|
-
*/
|
|
17
|
-
export declare class NotificationManager {
|
|
18
|
-
private logger;
|
|
19
|
-
autoHandleInitialNotification: boolean;
|
|
20
|
-
stateChangeListeners: NotificationStateChangeListener[];
|
|
21
|
-
messageListeners: NotificationHandler[];
|
|
22
|
-
_initialized: boolean;
|
|
23
|
-
unsubscribeFromMessage: any;
|
|
24
|
-
unsubscribeFromBackgroundMessage: any;
|
|
25
|
-
unsubscribeFromPress: any;
|
|
26
|
-
_currentToken: any;
|
|
27
|
-
_initialNoficationHandled: boolean;
|
|
28
|
-
constructor(logger?: import("@codeleap/common").Logger, autoHandleInitialNotification?: boolean);
|
|
29
|
-
init(): Promise<void>;
|
|
30
|
-
deinit(): Promise<void>;
|
|
31
|
-
private handleNotification;
|
|
32
|
-
get currentToken(): string;
|
|
33
|
-
set currentToken(token: string);
|
|
34
|
-
get initialized(): boolean;
|
|
35
|
-
set initialized(to: boolean);
|
|
36
|
-
onNotification(handler: NotificationHandler): () => void;
|
|
37
|
-
private triggerStateChange;
|
|
38
|
-
onStateChange(handler: NotificationStateChangeListener): () => void;
|
|
39
|
-
getInitialNotification(): Promise<HandleNotificationParam>;
|
|
40
|
-
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { silentLogger } from '@codeleap/common';
|
|
2
|
-
// @ts-ignore
|
|
3
|
-
import { firebase } from '@react-native-firebase/messaging';
|
|
4
|
-
const messaging = firebase.messaging;
|
|
5
|
-
const MODULE = 'Notifications';
|
|
6
|
-
/**
|
|
7
|
-
* Class responsible for the notification system
|
|
8
|
-
*
|
|
9
|
-
* @deprecated Use the most updated version
|
|
10
|
-
* @note check the documentation to make the migration
|
|
11
|
-
*/
|
|
12
|
-
export class NotificationManager {
|
|
13
|
-
logger;
|
|
14
|
-
autoHandleInitialNotification;
|
|
15
|
-
stateChangeListeners = [];
|
|
16
|
-
messageListeners = [];
|
|
17
|
-
_initialized = false;
|
|
18
|
-
unsubscribeFromMessage = null;
|
|
19
|
-
unsubscribeFromBackgroundMessage = null;
|
|
20
|
-
unsubscribeFromPress = null;
|
|
21
|
-
_currentToken = null;
|
|
22
|
-
_initialNoficationHandled = false;
|
|
23
|
-
constructor(logger = silentLogger, autoHandleInitialNotification = true) {
|
|
24
|
-
this.logger = logger;
|
|
25
|
-
this.autoHandleInitialNotification = autoHandleInitialNotification;
|
|
26
|
-
}
|
|
27
|
-
async init() {
|
|
28
|
-
// return
|
|
29
|
-
if (this.initialized)
|
|
30
|
-
return;
|
|
31
|
-
try {
|
|
32
|
-
await messaging().registerDeviceForRemoteMessages();
|
|
33
|
-
// logger.log('firebase registeted', '', MODULE)
|
|
34
|
-
const token = await messaging().getToken();
|
|
35
|
-
// logger.log('init token', { token }, MODULE)
|
|
36
|
-
if (token) {
|
|
37
|
-
this.currentToken = token;
|
|
38
|
-
this.initialized = true;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
this.currentToken = null;
|
|
42
|
-
this.initialized = false;
|
|
43
|
-
}
|
|
44
|
-
messaging().onTokenRefresh(newToken => {
|
|
45
|
-
// logger.log('onTokenRefresh', { newToken }, MODULE)
|
|
46
|
-
if (token) {
|
|
47
|
-
this.currentToken = newToken;
|
|
48
|
-
this.initialized = true;
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
this.currentToken = null;
|
|
52
|
-
this.initialized = false;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
// logger.log('init success', {}, MODULE)
|
|
56
|
-
}
|
|
57
|
-
catch (e) {
|
|
58
|
-
this.logger.error('Failed to initialize notification services', e, MODULE);
|
|
59
|
-
// OSAlert.error({ title: 'Failed to initialize notification services' })
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
async deinit() {
|
|
63
|
-
[
|
|
64
|
-
this.unsubscribeFromMessage,
|
|
65
|
-
this.unsubscribeFromBackgroundMessage,
|
|
66
|
-
this.unsubscribeFromPress,
|
|
67
|
-
].forEach(unsubscribe => {
|
|
68
|
-
if (unsubscribe) {
|
|
69
|
-
unsubscribe();
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
this.initialized = false;
|
|
73
|
-
}
|
|
74
|
-
async handleNotification(args) {
|
|
75
|
-
for (const listener of this.messageListeners) {
|
|
76
|
-
await listener(args.data, args.type);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
get currentToken() {
|
|
80
|
-
return this._currentToken;
|
|
81
|
-
}
|
|
82
|
-
set currentToken(token) {
|
|
83
|
-
this._currentToken = token;
|
|
84
|
-
this.triggerStateChange();
|
|
85
|
-
}
|
|
86
|
-
get initialized() {
|
|
87
|
-
return this._initialized;
|
|
88
|
-
}
|
|
89
|
-
set initialized(to) {
|
|
90
|
-
if (to) {
|
|
91
|
-
this.logger.info('Initialized', '', MODULE);
|
|
92
|
-
this.unsubscribeFromMessage = messaging().onMessage((msg) => {
|
|
93
|
-
this.handleNotification({
|
|
94
|
-
data: msg,
|
|
95
|
-
type: 'foreground',
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
this.unsubscribeFromBackgroundMessage = messaging().setBackgroundMessageHandler(async (msg) => {
|
|
99
|
-
this.handleNotification({
|
|
100
|
-
data: msg,
|
|
101
|
-
type: 'background',
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
this.unsubscribeFromPress = messaging().onNotificationOpenedApp(msg => {
|
|
105
|
-
this.logger.info('Notification press', msg, MODULE);
|
|
106
|
-
this.handleNotification({
|
|
107
|
-
data: msg,
|
|
108
|
-
type: 'press',
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
if (!this._initialNoficationHandled && this.autoHandleInitialNotification) {
|
|
112
|
-
this.getInitialNotification().then(msg => {
|
|
113
|
-
if (!msg.data)
|
|
114
|
-
return;
|
|
115
|
-
this.logger.info('Notification initial', msg, MODULE);
|
|
116
|
-
this.handleNotification(msg).then(() => {
|
|
117
|
-
this._initialNoficationHandled = true;
|
|
118
|
-
}).catch(e => {
|
|
119
|
-
this._initialNoficationHandled = true;
|
|
120
|
-
this.logger.error('Error handling initial notification', e, MODULE);
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
this.unsubscribeFromMessage = null;
|
|
127
|
-
this.unsubscribeFromBackgroundMessage = null;
|
|
128
|
-
this.unsubscribeFromPress = null;
|
|
129
|
-
this.logger.info('Deinitialized', '', MODULE);
|
|
130
|
-
}
|
|
131
|
-
this._initialized = to;
|
|
132
|
-
this.triggerStateChange();
|
|
133
|
-
}
|
|
134
|
-
onNotification(handler) {
|
|
135
|
-
const newLen = this.messageListeners.push(handler);
|
|
136
|
-
return () => {
|
|
137
|
-
this.messageListeners.splice(newLen - 1, 1);
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
triggerStateChange() {
|
|
141
|
-
this.stateChangeListeners.forEach(l => {
|
|
142
|
-
l(this._initialized, this.currentToken);
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
onStateChange(handler) {
|
|
146
|
-
const newLen = this.stateChangeListeners.push(handler);
|
|
147
|
-
return () => {
|
|
148
|
-
this.stateChangeListeners.splice(newLen - 1, 1);
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
async getInitialNotification() {
|
|
152
|
-
try {
|
|
153
|
-
const msg = await messaging().getInitialNotification();
|
|
154
|
-
return {
|
|
155
|
-
data: msg,
|
|
156
|
-
type: 'initial',
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
catch (e) {
|
|
160
|
-
return {
|
|
161
|
-
data: null,
|
|
162
|
-
type: 'initial',
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../src/utils/deprecated/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC7D,aAAa;AACb,OAAO,EAAE,QAAQ,EAA0B,MAAM,kCAAkC,CAAA;AAEnF,MAAM,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAA;AAEpC,MAAM,MAAM,GAAG,eAAe,CAAA;AAc9B;;;;;EAKE;AACF,MAAM,OAAO,mBAAmB;IAkBR;IAA8B;IAhBlD,oBAAoB,GAAqC,EAAE,CAAA;IAE3D,gBAAgB,GAAyB,EAAE,CAAA;IAE3C,YAAY,GAAG,KAAK,CAAA;IAEpB,sBAAsB,GAAG,IAAI,CAAA;IAE7B,gCAAgC,GAAG,IAAI,CAAA;IAEvC,oBAAoB,GAAG,IAAI,CAAA;IAE3B,aAAa,GAAG,IAAI,CAAA;IAEpB,yBAAyB,GAAG,KAAK,CAAA;IAEjC,YAAoB,SAAS,YAAY,EAAS,gCAAgC,IAAI;QAAlE,WAAM,GAAN,MAAM,CAAe;QAAS,kCAA6B,GAA7B,6BAA6B,CAAO;IACtF,CAAC;IAED,KAAK,CAAC,IAAI;QACR,SAAS;QACT,IAAI,IAAI,CAAC,WAAW;YAAE,OAAM;QAE5B,IAAI;YAEF,MAAM,SAAS,EAAE,CAAC,+BAA+B,EAAE,CAAA;YACnD,gDAAgD;YAEhD,MAAM,KAAK,G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