@codeleap/mobile 5.0.10 → 5.0.12
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/Pager/PagerItem.d.ts +7 -0
- package/dist/components/Pager/PagerItem.js +12 -0
- package/dist/components/Pager/PagerItem.js.map +1 -0
- package/dist/components/Pager/index.js +34 -25
- package/dist/components/Pager/index.js.map +1 -1
- package/dist/components/Pager/types.d.ts +2 -3
- package/dist/components/SortablePhotos/useSortablePhotos.js +2 -1
- package/dist/components/SortablePhotos/useSortablePhotos.js.map +1 -1
- package/dist/components/Touchable/index.js +8 -9
- package/dist/components/Touchable/index.js.map +1 -1
- package/dist/deprecated/permissions/package/Manager.d.ts +1 -2
- package/dist/deprecated/permissions/package/Manager.js.map +1 -1
- package/dist/deprecated/permissions/package/types.d.ts +1 -2
- package/dist/deprecated/permissions/package/types.js.map +1 -1
- package/dist/modules/scroll.js +2 -2
- package/dist/modules/scroll.js.map +1 -1
- package/dist/utils/NotificationManager/index.d.ts +1 -2
- package/dist/utils/NotificationManager/index.js +6 -10
- package/dist/utils/NotificationManager/index.js.map +1 -1
- package/package.json +27 -27
- package/package.json.bak +11 -11
- package/src/components/Pager/PagerItem.tsx +20 -0
- package/src/components/Pager/index.tsx +57 -32
- package/src/components/Pager/types.ts +2 -3
- package/src/components/SortablePhotos/useSortablePhotos.ts +2 -1
- package/src/components/Touchable/index.tsx +10 -11
- package/src/deprecated/permissions/package/Manager.ts +1 -2
- package/src/deprecated/permissions/package/types.ts +1 -2
- package/src/modules/scroll.tsx +2 -2
- package/src/utils/NotificationManager/index.ts +5 -8
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PageProps } from './types';
|
|
3
|
+
type PagerItemComponentProps = PageProps<any> & {
|
|
4
|
+
renderItem: (props: any) => JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export declare const PagerItem: import("react").NamedExoticComponent<PagerItemComponentProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { memoBy } from '@codeleap/utils';
|
|
2
|
+
import { TypeGuards } from '@codeleap/types';
|
|
3
|
+
function PagerItemComponent(props) {
|
|
4
|
+
const { item, renderItem: RenderItem, ...info } = props;
|
|
5
|
+
if (TypeGuards.isFunction(item)) {
|
|
6
|
+
const ItemComponent = item;
|
|
7
|
+
return <ItemComponent {...info}/>;
|
|
8
|
+
}
|
|
9
|
+
return <RenderItem {...info} item={item}/>;
|
|
10
|
+
}
|
|
11
|
+
export const PagerItem = memoBy(PagerItemComponent, ['renderItem', 'item']);
|
|
12
|
+
//# sourceMappingURL=PagerItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PagerItem.js","sourceRoot":"","sources":["../../../src/components/Pager/PagerItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAM5C,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;IAEvD,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QAC/B,MAAM,aAAa,GAAG,IAAI,CAAA;QAC1B,OAAO,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,EAAG,CAAA;KACnC;IAED,OAAO,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAG,CAAA;AAC7C,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAA"}
|
|
@@ -1,58 +1,64 @@
|
|
|
1
|
-
import React, { useCallback, useRef, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { ReduceMotion } from 'react-native-reanimated';
|
|
3
3
|
import Carousel from 'react-native-reanimated-carousel';
|
|
4
4
|
import { Dimensions } from 'react-native';
|
|
5
|
-
import {
|
|
6
|
-
import { onUpdate, useConditionalState } from '@codeleap/hooks';
|
|
5
|
+
import { useConditionalState } from '@codeleap/hooks';
|
|
7
6
|
import { useNestedStylesByKey } from '@codeleap/styles';
|
|
8
7
|
import { useStylesFor } from '../../hooks';
|
|
9
8
|
import { MobileStyleRegistry } from '../../Registry';
|
|
10
9
|
import { View } from '../View';
|
|
11
10
|
import { PagerDots } from './PagerDots';
|
|
11
|
+
import { PagerItem } from './PagerItem';
|
|
12
12
|
export * from './styles';
|
|
13
13
|
export * from './types';
|
|
14
14
|
export * from './PagerDots';
|
|
15
|
-
const window = Dimensions.get('
|
|
15
|
+
const window = Dimensions.get('screen');
|
|
16
16
|
export function Pager(props) {
|
|
17
|
-
const { pages, page, onChangePage, initialPage, style, showDots, renderItem
|
|
17
|
+
const { pages, page, onChangePage, initialPage, style, showDots, renderItem, footer, width: carouselWidth, height: carouselHeight, autoCalculateFooterHeight, removeFixedHeight, removeFixedWidth, ...rest } = {
|
|
18
18
|
...Pager.defaultProps,
|
|
19
19
|
...props,
|
|
20
20
|
};
|
|
21
|
-
const [currentPage, setCurrentPage] = useConditionalState(page, onChangePage, { initialValue: initialPage });
|
|
22
21
|
const carouselRef = useRef(null);
|
|
22
|
+
const [currentPage, setCurrentPage] = useConditionalState(page, onChangePage, { initialValue: initialPage });
|
|
23
23
|
const [footerHeight, setFooterHeight] = useState(0);
|
|
24
|
+
const [loaded, setLoaded] = useState(!showDots && !footer ? true : false);
|
|
24
25
|
const styles = useStylesFor(Pager.styleRegistryName, style);
|
|
25
26
|
const dotStyles = useNestedStylesByKey('dot', styles);
|
|
26
|
-
|
|
27
|
-
carouselRef.current?.
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (carouselRef.current?.getCurrentIndex?.() !== currentPage) {
|
|
29
|
+
carouselRef.current?.scrollTo?.({ index: currentPage, animated: true });
|
|
30
|
+
}
|
|
28
31
|
}, [currentPage]);
|
|
29
|
-
const
|
|
30
|
-
const
|
|
32
|
+
const getItemInfo = useCallback((index) => {
|
|
33
|
+
const info = {
|
|
31
34
|
isFirst: index === 0,
|
|
32
35
|
isLast: index === pages?.length - 1,
|
|
33
36
|
isOnly: pages?.length === 1,
|
|
34
|
-
isActive: index === currentPage,
|
|
35
|
-
isNext: index === currentPage + 1,
|
|
36
|
-
isPrevious: index === currentPage - 1,
|
|
37
37
|
index,
|
|
38
|
-
animationValue,
|
|
39
38
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return <
|
|
45
|
-
}, [
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
return info;
|
|
40
|
+
}, []);
|
|
41
|
+
const customRenderItem = useCallback(({ item, index, animationValue }) => {
|
|
42
|
+
const info = getItemInfo(index);
|
|
43
|
+
return (<PagerItem {...info} renderItem={renderItem} item={item} animationValue={animationValue}/>);
|
|
44
|
+
}, [renderItem, getItemInfo]);
|
|
45
|
+
const onFooterLayout = useCallback((event) => {
|
|
46
|
+
setFooterHeight(event.nativeEvent.layout.height);
|
|
47
|
+
setTimeout(() => setLoaded(true), 0);
|
|
48
|
+
}, []);
|
|
49
|
+
const width = carouselWidth - removeFixedWidth;
|
|
50
|
+
const height = carouselHeight - ((autoCalculateFooterHeight ? footerHeight : 0) + removeFixedHeight);
|
|
51
|
+
return (<View style={[{ width, opacity: !loaded ? 0 : 1 }, styles.wrapper]}>
|
|
52
|
+
<Carousel data={pages} autoPlay={false} loop={false} overscrollEnabled={false} pagingEnabled={false} ref={carouselRef} defaultIndex={initialPage} onSnapToItem={setCurrentPage} maxScrollDistancePerSwipe={carouselWidth} minScrollDistancePerSwipe={carouselWidth * 0.1} width={width} height={height} renderItem={customRenderItem} withAnimation={{
|
|
48
53
|
type: 'timing',
|
|
49
54
|
config: {
|
|
50
55
|
reduceMotion: ReduceMotion.Never,
|
|
51
56
|
},
|
|
52
|
-
}}
|
|
57
|
+
}} {...rest} style={styles.carousel}/>
|
|
58
|
+
|
|
59
|
+
<View onLayout={onFooterLayout} style={styles.footerWrapper}>
|
|
60
|
+
{footer}
|
|
53
61
|
|
|
54
|
-
<View onLayout={(event) => setFooterHeight(event.nativeEvent.layout.height)} style={styles.footerWrapper}>
|
|
55
|
-
{/* {footer} */}
|
|
56
62
|
{showDots ? (<PagerDots currentPage={currentPage} pages={pages} setCurrentPage={setCurrentPage} styles={dotStyles}/>) : null}
|
|
57
63
|
</View>
|
|
58
64
|
</View>);
|
|
@@ -69,6 +75,9 @@ Pager.defaultProps = {
|
|
|
69
75
|
showDots: true,
|
|
70
76
|
autoCalculateFooterHeight: true,
|
|
71
77
|
initialPage: 0,
|
|
78
|
+
footer: null,
|
|
79
|
+
removeFixedHeight: 0,
|
|
80
|
+
removeFixedWidth: 0,
|
|
72
81
|
};
|
|
73
82
|
MobileStyleRegistry.registerComponent(Pager);
|
|
74
83
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Pager/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Pager/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,QAA+B,MAAM,kCAAkC,CAAA;AAE9E,OAAO,EAAE,UAAU,EAAqB,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE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AAC,IAAI,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAC1D;QAAA,CAAC,MAAM,CAEP;;QAAA,CAAC,QAAQ,CAAC,CAAC,CAAC,CACV,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAG,CACzG,CAAC,CAAC,CAAC,IAAI,CACV;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,KAAK,CAAC,iBAAiB,GAAG,OAAO,CAAA;AACjC,KAAK,CAAC,QAAQ,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,CAAC,CAAA;AAChE,KAAK,CAAC,WAAW,GAAG,SAAS,CAAA;AAE7B,KAAK,CAAC,gBAAgB,GAAG,CAAsB,MAAS,EAAE,EAAE;IAC1D,OAAO,KAAgF,CAAA;AACzF,CAAC,CAAA;AAED,KAAK,CAAC,YAAY,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC,KAAK;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,QAAQ,EAAE,IAAI;IACd,yBAAyB,EAAE,IAAI;IAC/B,WAAW,EAAE,CAAC;IACd,MAAM,EAAE,IAAI;IACZ,iBAAiB,EAAE,CAAC;IACpB,gBAAgB,EAAE,CAAC;CACY,CAAA;AAEjC,mBAAmB,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA"}
|
|
@@ -6,11 +6,8 @@ import { CarouselRenderItemInfo } from 'react-native-reanimated-carousel/lib/typ
|
|
|
6
6
|
export type PageProps<T> = CarouselRenderItemInfo<T> & {
|
|
7
7
|
isLast: boolean;
|
|
8
8
|
isFirst: boolean;
|
|
9
|
-
isActive: boolean;
|
|
10
9
|
isOnly: boolean;
|
|
11
|
-
isNext: boolean;
|
|
12
10
|
index: number;
|
|
13
|
-
isPrevious: boolean;
|
|
14
11
|
};
|
|
15
12
|
export type PagerProps<T> = Partial<Omit<TCarouselProps<T>, 'data' | 'renderItem'>> & {
|
|
16
13
|
pages: TCarouselProps<T>['data'];
|
|
@@ -22,4 +19,6 @@ export type PagerProps<T> = Partial<Omit<TCarouselProps<T>, 'data' | 'renderItem
|
|
|
22
19
|
showDots?: boolean;
|
|
23
20
|
footer?: ReactNode;
|
|
24
21
|
autoCalculateFooterHeight?: boolean;
|
|
22
|
+
removeFixedHeight?: number;
|
|
23
|
+
removeFixedWidth?: number;
|
|
25
24
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { alert } from '@codeleap/modals';
|
|
2
2
|
import { useEffect, useMemo, useState } from '@codeleap/hooks';
|
|
3
3
|
import { useFileInput } from '../FileInput';
|
|
4
|
+
import { logger } from '@codeleap/logger';
|
|
4
5
|
export const useSortablePhotos = (props) => {
|
|
5
6
|
const { onChangePhotos, onPressPhoto, modalBody, modalTitle, modalCameraText, modalDeleteText, modalLibraryText, getFilename, numPhotos, loading, photos: currentPhotos } = props;
|
|
6
7
|
const input = useFileInput();
|
|
@@ -60,7 +61,7 @@ export const useSortablePhotos = (props) => {
|
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
63
|
catch (error) {
|
|
63
|
-
|
|
64
|
+
logger.error('Error opening file picker:', error);
|
|
64
65
|
}
|
|
65
66
|
if (files?.length <= 0)
|
|
66
67
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSortablePhotos.js","sourceRoot":"","sources":["../../../src/components/SortablePhotos/useSortablePhotos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAwB,Y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AE,KAAa,EAAE,EAAE;QACnD,KAAK,CAAC,GAAG,CAAC;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE;gBACpF,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE;gBAClF,CAAC,CAAC,KAAK,EAAE,QAAQ,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;aAC/F;SACF,CAAC,CAAA;QAEF,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;IACpC,CAAC,CAAA;IAED,MAAM,mBAAmB,GAAG,CAAC,OAAoB,EAAE,EAAE;QACnD,QAAQ,CAAC,OAAO,CAAC,CAAA;IACnB,CAAC,CAAA;IAED,OAAO;QACL,KAAK;QACL,gBAAgB;QAChB,iBAAiB;QACjB,gBAAgB;QAChB,UAAU;QACV,mBAAmB;QACnB,mBAAmB;QACnB,YAAY;QACZ,IAAI;QACJ,eAAe;KAChB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { TypeGuards } from '@codeleap/types';
|
|
3
3
|
import { onMount, useComponentTestId } from '@codeleap/hooks';
|
|
4
|
-
import { useGlobalContext } from '@codeleap/hooks';
|
|
5
4
|
import { Pressable, StyleSheet, Platform } from 'react-native';
|
|
6
5
|
import { View } from '../View';
|
|
7
6
|
import { usePressableFeedback } from '../../utils';
|
|
@@ -9,6 +8,7 @@ import { Keyboard } from 'react-native';
|
|
|
9
8
|
import { PressableRipple } from '../../modules/PressableRipple';
|
|
10
9
|
import { MobileStyleRegistry } from '../../Registry';
|
|
11
10
|
import { useStylesFor } from '../../hooks';
|
|
11
|
+
import { logger } from '@codeleap/logger';
|
|
12
12
|
export * from './styles';
|
|
13
13
|
export * from './types';
|
|
14
14
|
export const Touchable = forwardRef((touchableProps, ref) => {
|
|
@@ -25,22 +25,21 @@ export const Touchable = forwardRef((touchableProps, ref) => {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
const styles = useStylesFor(Touchable.styleRegistryName, style);
|
|
28
|
-
const { logger } = useGlobalContext();
|
|
29
28
|
const testId = useComponentTestId(Touchable, touchableProps, ['style', 'children', 'debounce']);
|
|
30
29
|
const press = () => {
|
|
31
30
|
if (!onPress)
|
|
32
31
|
return;
|
|
33
32
|
const _onPress = () => {
|
|
34
|
-
logger.log(`<${debugComponent || 'Touchable'}/>
|
|
33
|
+
logger.log(`<${debugComponent || 'Touchable'}/> pressed:`, debugName);
|
|
35
34
|
if (dismissKeyboard) {
|
|
36
35
|
Keyboard.dismiss();
|
|
37
36
|
}
|
|
38
|
-
if (analyticsEnabled) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
37
|
+
// if (analyticsEnabled) {
|
|
38
|
+
// const name = analyticsName || debugName
|
|
39
|
+
// if (!!name?.trim?.()) {
|
|
40
|
+
// logger.analytics?.interaction(name, analyticsData)
|
|
41
|
+
// }
|
|
42
|
+
// }
|
|
44
43
|
onPress();
|
|
45
44
|
};
|
|
46
45
|
if (TypeGuards.isNumber(debounce)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Touchable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAA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,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;gBACvB,cAAc;gBACd,gBAAgB,CAAC,OAAO,CAAC;gBACzB,MAAM,EAAE,SAAS;aAClB,CAAC,CAAC,CACH,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,GAAG,CAAC,CAET;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,SAAS,CAAC,CACb,CACH;IAAA,EAAE,OAAO,CAAC,CACX,CAAA;AACH,CAAC,CAA6C,CAAA;AAE9C,SAAS,CAAC,iBAAiB,GAAG,WAAW,CAAA;AACzC,SAAS,CAAC,QAAQ,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,CAAA;AACzD,SAAS,CAAC,WAAW,GAAG,SAAS,CAAA;AAEjC,SAAS,CAAC,gBAAgB,GAAG,CAAsB,MAAS,EAAE,EAAE;IAC9D,OAAO,SAAiF,CAAA;AAC1F,CAAC,CAAA;AAED,SAAS,CAAC,YAAY,GAAG;IACvB,QAAQ,EAAE,GAAG;IACb,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,KAAK;IACrB,gBAAgB,EAAE,KAAK;IACvB,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;CACK,CAAA;AAE5B,mBAAmB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Logger } from '@codeleap/logger';
|
|
2
1
|
import * as PermissionTypes from './types';
|
|
3
2
|
export declare class PermissionManager<T extends PermissionTypes.PermissionActionRecord, I extends PermissionTypes.IPermissionManager<T> = PermissionTypes.IPermissionManager<T>> implements PermissionTypes.IPermissionManager<T> {
|
|
4
3
|
private _permissions;
|
|
@@ -11,7 +10,7 @@ export declare class PermissionManager<T extends PermissionTypes.PermissionActio
|
|
|
11
10
|
permissions: {
|
|
12
11
|
[Property in keyof T as Uppercase<string & Property>]: Property;
|
|
13
12
|
};
|
|
14
|
-
logger:
|
|
13
|
+
logger: any;
|
|
15
14
|
constructor(perms: T, options?: PermissionTypes.PermissionManagerOptions);
|
|
16
15
|
get values(): Record<keyof T, PermissionTypes.PermissionState>;
|
|
17
16
|
private check;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manager.js","sourceRoot":"","sources":["../../../../src/deprecated/permissions/package/Manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Manager.js","sourceRoot":"","sources":["../../../../src/deprecated/permissions/package/Manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAGzC,MAAM,OAAO,iBAAiB;IAIpB,YAAY,CAA6B;IAEjD,cAAc,CAA+C;IAErD,WAAW,CAAqC;IAEhD,eAAe,CAAyD;IAEzE,MAAM,CAAG;IAET,IAAI,CAAG;IAEN,MAAM,CAAG;IAEV,WAAW,CAEjB;IAED,MAAM,CAAA;IAEN,YAAY,KAAQ,EAAE,OAAkD;QACtE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,aAAa;QACb,IAAI,CAAC,YAAY,GAAG,EAAE,CAAA;QACtB,aAAa;QACb,IAAI,CAAC,WAAW,GAAG,EAAE,CAAA;QAErB,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,CAAA;QAC7B,IAAI,CAAC,eAAe,GAAG,EAAiC,CAAA;QAExD,KAAK,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAC7D,MAAM,IAAI,GAAG,QAAmB,CAAA;YAChC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,IAAI,UAAU,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,C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,EAAE,CAAA;SACzB;QAED,OAAO,KAAyD,CAAA;IAClE,CAAC;IAED,KAAK,CAAC,MAAM;QACV,MAAM,GAAG,GAAG,EAAsD,CAAA;QAClE,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;YAC9C,GAAG,CAAC,CAAY,CAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;gBACtC,GAAG,EAAE,KAAK;aACX,CAAC,CAAA;SACH;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;CAEF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Logger } from '@codeleap/logger';
|
|
2
1
|
import { FunctionType } from '@codeleap/types';
|
|
3
2
|
export declare const permissionStatuses: readonly ["unavailable", "pending", "denied", "limited", "granted", "blocked"];
|
|
4
3
|
export type PermissionStatus = typeof permissionStatuses[number];
|
|
@@ -28,5 +27,5 @@ export type ChangeListener<T> = FunctionType<[keyof T, PermissionState], any>;
|
|
|
28
27
|
export type PermissionSubscriber = FunctionType<[PermissionState], any>;
|
|
29
28
|
export type PermissionArray<T> = ([name: keyof T, options: CheckOptions])[] | (keyof T)[];
|
|
30
29
|
export type PermissionManagerOptions = {
|
|
31
|
-
logger?:
|
|
30
|
+
logger?: any;
|
|
32
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/deprecated/permissions/package/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/deprecated/permissions/package/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAU,CAAA"}
|
package/dist/modules/scroll.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { logger } from '@codeleap/logger';
|
|
1
2
|
import React, { useCallback, useContext, useImperativeHandle, useRef } from 'react';
|
|
2
3
|
const scrollProperties = [
|
|
3
4
|
'scrollTo',
|
|
4
5
|
];
|
|
5
6
|
const noOpScrollMethods = Object.fromEntries(scrollProperties.map(p => [p, () => {
|
|
6
|
-
|
|
7
|
+
logger.warn(`"${p}" was called from a ScrollProvider ref without a bound scrollable component. This does not cause errors but may impact user experience and indicate an unhandled edge case in calling code`);
|
|
7
8
|
}]));
|
|
8
9
|
const noOpScrollable = {
|
|
9
10
|
...noOpScrollMethods,
|
|
@@ -24,7 +25,6 @@ export const useScrollPubSub = (ref) => {
|
|
|
24
25
|
}, []);
|
|
25
26
|
useImperativeHandle(augmentedRef, () => ({
|
|
26
27
|
scrollTo(...args) {
|
|
27
|
-
console.log(ref.current);
|
|
28
28
|
ref?.current.scrollTo(...args);
|
|
29
29
|
},
|
|
30
30
|
subscribe(e, cb) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll.js","sourceRoot":"","sources":["../../src/modules/scroll.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAoB,WAAW,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAGrG,MAAM,gBAAgB,GAAG;IACtB,UAAU;CACmB,CAAA;AAgBhC,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAC1C,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE;QACjC,
|
|
1
|
+
{"version":3,"file":"scroll.js","sourceRoot":"","sources":["../../src/modules/scroll.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,KAAK,EAAE,EAAoB,WAAW,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAGrG,MAAM,gBAAgB,GAAG;IACtB,UAAU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AAA;YAE3C,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;YAE7B,OAAO,GAAG,EAAE;gBACV,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;YAC9B,CAAC,CAAA;QACH,CAAC;KACF,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IAEV,OAAO;QACL,GAAG,EAAE,YAAY;QACjB,IAAI;KACL,CAAA;AACH,CAAC,CAAA;AAGD,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAAsC,CAAC,EAAC,QAAQ,EAAC,EAAE,GAAG,EAAE,EAAE;IACtG,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAgB,EAAE,CAAC,CAC9D;IAAA,CAAC,QAAQ,CACX;EAAA,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;AAC3B,CAAC,CAAC,CAAA;AAEF,MAAM,UAAU,qBAAqB;IACnC,MAAM,GAAG,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;IAErC,IAAG,CAAC,GAAG,EAAC;QACN,OAAO;YACL,OAAO,EAAE,cAAc;SACxB,CAAA;KACF;IAED,OAAO,GAAG,CAAC,GAAG,CAAA;AAChB,CAAC"}
|
|
@@ -6,14 +6,13 @@ export * from './types';
|
|
|
6
6
|
* Class responsible for the notification system
|
|
7
7
|
*/
|
|
8
8
|
export declare class NotificationManager<N extends object = Message, E extends string = string> {
|
|
9
|
-
private _logger;
|
|
10
9
|
parser: NotificationManagerOptions<N>['parser'];
|
|
11
10
|
currentOptions: NotificationManagerOptions<N>;
|
|
12
11
|
currentToken: any;
|
|
13
12
|
private registeredUnsubscribers;
|
|
14
13
|
private initialized;
|
|
15
14
|
events: Subscription<TNotification<N>, E>;
|
|
16
|
-
constructor(
|
|
15
|
+
constructor(options?: NotificationManagerOptions<N>);
|
|
17
16
|
private invoke;
|
|
18
17
|
log(description: string, data?: any): void;
|
|
19
18
|
/**
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { silentLogger } from '@codeleap/logger'; // @ts-ignore
|
|
2
1
|
import messaging from '@react-native-firebase/messaging';
|
|
3
2
|
import { Subscription } from '../Subscription';
|
|
3
|
+
import { logger } from '@codeleap/logger';
|
|
4
4
|
export * from './types';
|
|
5
5
|
const MODULE = 'NotificationManager';
|
|
6
6
|
/**
|
|
7
7
|
* Class responsible for the notification system
|
|
8
8
|
*/
|
|
9
9
|
export class NotificationManager {
|
|
10
|
-
_logger;
|
|
11
10
|
parser = (message) => message;
|
|
12
11
|
currentOptions = {
|
|
13
12
|
handleInitialNotification: true,
|
|
@@ -18,8 +17,7 @@ export class NotificationManager {
|
|
|
18
17
|
registeredUnsubscribers = {};
|
|
19
18
|
initialized = false;
|
|
20
19
|
events = new Subscription();
|
|
21
|
-
constructor(
|
|
22
|
-
this._logger = _logger;
|
|
20
|
+
constructor(options = {}) {
|
|
23
21
|
if (typeof options?.parser == 'function') {
|
|
24
22
|
this.parser = options?.parser;
|
|
25
23
|
}
|
|
@@ -35,14 +33,12 @@ export class NotificationManager {
|
|
|
35
33
|
type: args?.type
|
|
36
34
|
});
|
|
37
35
|
}
|
|
38
|
-
log(description, data =
|
|
39
|
-
if (!this._logger)
|
|
40
|
-
return;
|
|
36
|
+
log(description, data = '') {
|
|
41
37
|
if (this.currentOptions.debug) {
|
|
42
|
-
|
|
38
|
+
logger.log(`(${MODULE})`, description, data);
|
|
43
39
|
}
|
|
44
40
|
if (this.currentOptions.slackDebug) {
|
|
45
|
-
|
|
41
|
+
logger.slack.echo(description, data, MODULE, {
|
|
46
42
|
'include': ['version'],
|
|
47
43
|
'sendIn': ['release', 'debug']
|
|
48
44
|
});
|
|
@@ -112,7 +108,7 @@ export class NotificationManager {
|
|
|
112
108
|
* @param {function} callback Callback that is executed when the services are initialized, returning the device token
|
|
113
109
|
*/
|
|
114
110
|
async initialize(callback) {
|
|
115
|
-
this.log('Initialize'
|
|
111
|
+
this.log('Initialize');
|
|
116
112
|
this.unsubscribe();
|
|
117
113
|
const token = await this.getToken();
|
|
118
114
|
callback(token);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/NotificationManager/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/NotificationManager/index.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,kCAAkC,CAAA;AACxD,OAAO,EAAc,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,cAAc,SAAS,CAAA;AAEvB,MAAM,MAAM,GAAG,qBAAqB,CAAA;AAEpC;;EAEE;AACF,MAAM,OAAO,mBAAmB;IACvB,MAAM,GAA4C,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAY,CAAA;IAEpF,cAAc,GAAkC;QACrD,yBAAyB,EAAE,IAAI;QAC/B,KAAK,EAAE,KAAK;QACZ,UAAU,EAAE,KAAK;KAClB,CAAA;IAEM,YAAY,GAAG,IAAI,CAAA;IAElB,uBAAuB,GAAgC,EAAE,CAAA;IAEzD,WAAW,GAAG,KAAK,CAAA;IAEpB,MAAM,GAAG,IAAI,YAAY,EAAuB,CAAA;IAEvD,YACE,UAAyC,EAAE;QAE3C,IAAI,OAAO,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE;YACxC,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,CAAA;SAC9B;QAED,IAAI,CAAC,cAAc,GAAG;YACpB,GAAG,IAAI,CAAC,cAAc;YACtB,GAAG,OAAO;SACX,CAAA;IACH,CAAC;IAEO,MAAM,CAAC,IAGd;QACC,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAA;QA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AAE,IAAI,CAAC,uBAAuB,CAAC,CAAA;QAE9D,KAAK,MAAM,cAAc,IAAI,IAAI,CAAC,uBAAuB,EAAE;YACzD,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,EAAE,CAAA;YAC9C,OAAO,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAA;SACpD;IACH,CAAC;IAED;;;;MAIE;IACK,KAAK,CAAC,YAAY,CAAC,WAAwB,IAAI;QACpD,IAAI,CAAC,IAAI,CAAC,WAAW;YAAE,OAAM;QAE7B,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;QAExB,IAAI,CAAC,WAAW,EAAE,CAAA;QAElB,IAAI,OAAO,QAAQ,IAAI,UAAU,EAAE;YACjC,QAAQ,EAAE,CAAA;SACX;IACH,CAAC;IAED;;;;;;MAME;IACK,aAAa,CAAC,SAAY,EAAE,OAAqC;QACtE,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeleap/mobile",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.12",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -9,39 +9,39 @@
|
|
|
9
9
|
"directory": "packages/mobile"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@codeleap/types": "5.0.
|
|
13
|
-
"@codeleap/utils": "5.0.
|
|
14
|
-
"@codeleap/hooks": "5.0.
|
|
15
|
-
"@codeleap/form": "5.0.
|
|
16
|
-
"@codeleap/query": "5.0.
|
|
17
|
-
"@codeleap/logger": "5.0.
|
|
18
|
-
"@codeleap/config": "5.0.
|
|
19
|
-
"@codeleap/modals": "5.0.
|
|
12
|
+
"@codeleap/types": "5.0.12",
|
|
13
|
+
"@codeleap/utils": "5.0.12",
|
|
14
|
+
"@codeleap/hooks": "5.0.12",
|
|
15
|
+
"@codeleap/form": "5.0.12",
|
|
16
|
+
"@codeleap/query": "5.0.12",
|
|
17
|
+
"@codeleap/logger": "5.0.12",
|
|
18
|
+
"@codeleap/config": "5.0.12",
|
|
19
|
+
"@codeleap/modals": "5.0.12"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "tsc --build",
|
|
23
23
|
"lint": "eslint -c .eslintrc.js --fix \"./src/**/*.{ts,tsx,js,jsx}\""
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@codeleap/types": "5.0.
|
|
27
|
-
"@codeleap/utils": "5.0.
|
|
28
|
-
"@codeleap/hooks": "5.0.
|
|
29
|
-
"@codeleap/form": "5.0.
|
|
30
|
-
"@codeleap/query": "5.0.
|
|
31
|
-
"@codeleap/logger": "5.0.
|
|
32
|
-
"@codeleap/styles": "5.0.
|
|
33
|
-
"@codeleap/modals": "5.0.
|
|
34
|
-
"@d11/react-native-fast-image": "8.
|
|
35
|
-
"@react-native-firebase/messaging": "21.
|
|
36
|
-
"@react-navigation/bottom-tabs": "7.
|
|
37
|
-
"@react-navigation/native": "7.0.
|
|
38
|
-
"@react-navigation/native-stack": "7.
|
|
26
|
+
"@codeleap/types": "5.0.12",
|
|
27
|
+
"@codeleap/utils": "5.0.12",
|
|
28
|
+
"@codeleap/hooks": "5.0.12",
|
|
29
|
+
"@codeleap/form": "5.0.12",
|
|
30
|
+
"@codeleap/query": "5.0.12",
|
|
31
|
+
"@codeleap/logger": "5.0.12",
|
|
32
|
+
"@codeleap/styles": "5.0.12",
|
|
33
|
+
"@codeleap/modals": "5.0.12",
|
|
34
|
+
"@d11/react-native-fast-image": "8.9.2",
|
|
35
|
+
"@react-native-firebase/messaging": "21.12.0",
|
|
36
|
+
"@react-navigation/bottom-tabs": "7.3.1",
|
|
37
|
+
"@react-navigation/native": "7.0.17",
|
|
38
|
+
"@react-navigation/native-stack": "7.3.1",
|
|
39
39
|
"react": "18.2.0",
|
|
40
|
-
"react-native": "0.77.
|
|
40
|
+
"react-native": "0.77.1",
|
|
41
41
|
"react-native-calendars": "1.1307.0",
|
|
42
|
-
"react-native-date-picker": "5.0.
|
|
42
|
+
"react-native-date-picker": "5.0.10",
|
|
43
43
|
"react-native-device-info": "14.0.4",
|
|
44
|
-
"react-native-gesture-handler": "2.
|
|
44
|
+
"react-native-gesture-handler": "2.24.0",
|
|
45
45
|
"react-native-image-crop-picker": "0.42.0",
|
|
46
46
|
"react-native-image-viewing": "0.2.2",
|
|
47
47
|
"react-native-localize": "3.4.1",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@miblanchard/react-native-slider": "2.3.1",
|
|
55
55
|
"react-native-currency-input": "^1.1.1",
|
|
56
56
|
"react-native-masked-text": "1.13.0",
|
|
57
|
-
"react-native-reanimated-carousel": "
|
|
58
|
-
"react-native-sortables": "
|
|
57
|
+
"react-native-reanimated-carousel": "4.0.2",
|
|
58
|
+
"react-native-sortables": "1.1.1",
|
|
59
59
|
"react-native-uuid": "2.0.1"
|
|
60
60
|
}
|
|
61
61
|
}
|
package/package.json.bak
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeleap/mobile",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.12",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
"@codeleap/logger": "workspace:*",
|
|
32
32
|
"@codeleap/styles": "workspace:*",
|
|
33
33
|
"@codeleap/modals": "workspace:*",
|
|
34
|
-
"@d11/react-native-fast-image": "8.
|
|
35
|
-
"@react-native-firebase/messaging": "21.
|
|
36
|
-
"@react-navigation/bottom-tabs": "7.
|
|
37
|
-
"@react-navigation/native": "7.0.
|
|
38
|
-
"@react-navigation/native-stack": "7.
|
|
34
|
+
"@d11/react-native-fast-image": "8.9.2",
|
|
35
|
+
"@react-native-firebase/messaging": "21.12.0",
|
|
36
|
+
"@react-navigation/bottom-tabs": "7.3.1",
|
|
37
|
+
"@react-navigation/native": "7.0.17",
|
|
38
|
+
"@react-navigation/native-stack": "7.3.1",
|
|
39
39
|
"react": "18.2.0",
|
|
40
|
-
"react-native": "0.77.
|
|
40
|
+
"react-native": "0.77.1",
|
|
41
41
|
"react-native-calendars": "1.1307.0",
|
|
42
|
-
"react-native-date-picker": "5.0.
|
|
42
|
+
"react-native-date-picker": "5.0.10",
|
|
43
43
|
"react-native-device-info": "14.0.4",
|
|
44
|
-
"react-native-gesture-handler": "2.
|
|
44
|
+
"react-native-gesture-handler": "2.24.0",
|
|
45
45
|
"react-native-image-crop-picker": "0.42.0",
|
|
46
46
|
"react-native-image-viewing": "0.2.2",
|
|
47
47
|
"react-native-localize": "3.4.1",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@miblanchard/react-native-slider": "2.3.1",
|
|
55
55
|
"react-native-currency-input": "^1.1.1",
|
|
56
56
|
"react-native-masked-text": "1.13.0",
|
|
57
|
-
"react-native-reanimated-carousel": "
|
|
58
|
-
"react-native-sortables": "
|
|
57
|
+
"react-native-reanimated-carousel": "4.0.2",
|
|
58
|
+
"react-native-sortables": "1.1.1",
|
|
59
59
|
"react-native-uuid": "2.0.1"
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { memoBy } from '@codeleap/utils'
|
|
2
|
+
import { PageProps } from './types'
|
|
3
|
+
import { TypeGuards } from '@codeleap/types'
|
|
4
|
+
|
|
5
|
+
type PagerItemComponentProps = PageProps<any> & {
|
|
6
|
+
renderItem: (props: any) => JSX.Element
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function PagerItemComponent(props: PagerItemComponentProps) {
|
|
10
|
+
const { item, renderItem: RenderItem, ...info } = props
|
|
11
|
+
|
|
12
|
+
if (TypeGuards.isFunction(item)) {
|
|
13
|
+
const ItemComponent = item
|
|
14
|
+
return <ItemComponent {...info} />
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return <RenderItem {...info} item={item} />
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const PagerItem = memoBy(PagerItemComponent, ['renderItem', 'item'])
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import React, { useCallback, useRef, useState } from 'react'
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
2
|
import { ReduceMotion } from 'react-native-reanimated'
|
|
3
3
|
import Carousel, { ICarouselInstance } from 'react-native-reanimated-carousel'
|
|
4
4
|
import { CarouselRenderItemInfo, TCarouselProps } from 'react-native-reanimated-carousel/lib/typescript/types'
|
|
5
5
|
import { Dimensions, LayoutChangeEvent } from 'react-native'
|
|
6
|
-
import {
|
|
7
|
-
import { onUpdate, useConditionalState } from '@codeleap/hooks'
|
|
6
|
+
import { useConditionalState } from '@codeleap/hooks'
|
|
8
7
|
import { AnyRecord, IJSX, StyledComponentProps, useNestedStylesByKey } from '@codeleap/styles'
|
|
9
8
|
import { useStylesFor } from '../../hooks'
|
|
10
9
|
import { MobileStyleRegistry } from '../../Registry'
|
|
11
10
|
import { View } from '../View'
|
|
12
11
|
import { PageProps, PagerProps } from './types'
|
|
13
12
|
import { PagerDots } from './PagerDots'
|
|
13
|
+
import { PagerItem } from './PagerItem'
|
|
14
14
|
|
|
15
15
|
export * from './styles'
|
|
16
16
|
export * from './types'
|
|
17
17
|
export * from './PagerDots'
|
|
18
18
|
|
|
19
|
-
const window = Dimensions.get('
|
|
19
|
+
const window = Dimensions.get('screen')
|
|
20
20
|
|
|
21
21
|
export function Pager<T>(props: PagerProps<T>) {
|
|
22
22
|
const {
|
|
@@ -26,73 +26,95 @@ export function Pager<T>(props: PagerProps<T>) {
|
|
|
26
26
|
initialPage,
|
|
27
27
|
style,
|
|
28
28
|
showDots,
|
|
29
|
-
renderItem
|
|
29
|
+
renderItem,
|
|
30
30
|
footer,
|
|
31
31
|
width: carouselWidth,
|
|
32
32
|
height: carouselHeight,
|
|
33
33
|
autoCalculateFooterHeight,
|
|
34
|
+
removeFixedHeight,
|
|
35
|
+
removeFixedWidth,
|
|
34
36
|
...rest
|
|
35
37
|
} = {
|
|
36
38
|
...Pager.defaultProps,
|
|
37
39
|
...props,
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
const [currentPage, setCurrentPage] = useConditionalState(page, onChangePage, { initialValue: initialPage })
|
|
41
42
|
const carouselRef = useRef<ICarouselInstance>(null)
|
|
43
|
+
|
|
44
|
+
const [currentPage, setCurrentPage] = useConditionalState(page, onChangePage, { initialValue: initialPage })
|
|
42
45
|
const [footerHeight, setFooterHeight] = useState(0)
|
|
46
|
+
const [loaded, setLoaded] = useState(!showDots && !footer ? true : false)
|
|
43
47
|
|
|
44
48
|
const styles = useStylesFor(Pager.styleRegistryName, style)
|
|
45
49
|
const dotStyles = useNestedStylesByKey('dot', styles)
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
carouselRef.current?.
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (carouselRef.current?.getCurrentIndex?.() !== currentPage) {
|
|
53
|
+
carouselRef.current?.scrollTo?.({ index: currentPage, animated: true })
|
|
54
|
+
}
|
|
49
55
|
}, [currentPage])
|
|
50
56
|
|
|
51
|
-
const
|
|
52
|
-
const
|
|
57
|
+
const getItemInfo = useCallback((index: number) => {
|
|
58
|
+
const info: Omit<PageProps<T>, 'item' | 'animationValue'> = {
|
|
53
59
|
isFirst: index === 0,
|
|
54
60
|
isLast: index === pages?.length - 1,
|
|
55
61
|
isOnly: pages?.length === 1,
|
|
56
|
-
isActive: index === currentPage,
|
|
57
|
-
isNext: index === currentPage + 1,
|
|
58
|
-
isPrevious: index === currentPage - 1,
|
|
59
62
|
index,
|
|
60
|
-
animationValue,
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
return info
|
|
66
|
+
}, [])
|
|
67
|
+
|
|
68
|
+
const customRenderItem = useCallback(({ item, index, animationValue }: CarouselRenderItemInfo<any>) => {
|
|
69
|
+
const info = getItemInfo(index)
|
|
67
70
|
|
|
68
|
-
return
|
|
69
|
-
|
|
71
|
+
return (
|
|
72
|
+
<PagerItem
|
|
73
|
+
{...info}
|
|
74
|
+
renderItem={renderItem}
|
|
75
|
+
item={item}
|
|
76
|
+
animationValue={animationValue}
|
|
77
|
+
/>
|
|
78
|
+
)
|
|
79
|
+
}, [renderItem, getItemInfo])
|
|
80
|
+
|
|
81
|
+
const onFooterLayout = useCallback((event: LayoutChangeEvent) => {
|
|
82
|
+
setFooterHeight(event.nativeEvent.layout.height)
|
|
83
|
+
setTimeout(() => setLoaded(true), 0)
|
|
84
|
+
}, [])
|
|
85
|
+
|
|
86
|
+
const width = carouselWidth - removeFixedWidth
|
|
87
|
+
const height = carouselHeight - ((autoCalculateFooterHeight ? footerHeight : 0) + removeFixedHeight)
|
|
70
88
|
|
|
71
89
|
return (
|
|
72
|
-
<View style={styles.wrapper}>
|
|
90
|
+
<View style={[{ width, opacity: !loaded ? 0 : 1 }, styles.wrapper]}>
|
|
73
91
|
<Carousel
|
|
74
92
|
data={pages}
|
|
93
|
+
autoPlay={false}
|
|
94
|
+
loop={false}
|
|
95
|
+
overscrollEnabled={false}
|
|
96
|
+
pagingEnabled={false}
|
|
97
|
+
ref={carouselRef}
|
|
98
|
+
defaultIndex={initialPage}
|
|
99
|
+
onSnapToItem={setCurrentPage}
|
|
100
|
+
maxScrollDistancePerSwipe={carouselWidth}
|
|
101
|
+
minScrollDistancePerSwipe={carouselWidth * 0.1}
|
|
102
|
+
width={width}
|
|
103
|
+
height={height}
|
|
104
|
+
renderItem={customRenderItem}
|
|
75
105
|
withAnimation={{
|
|
76
106
|
type: 'timing',
|
|
77
107
|
config: {
|
|
78
108
|
reduceMotion: ReduceMotion.Never,
|
|
79
109
|
},
|
|
80
110
|
}}
|
|
81
|
-
autoPlay={false}
|
|
82
|
-
ref={carouselRef}
|
|
83
|
-
loop={false}
|
|
84
|
-
defaultIndex={initialPage}
|
|
85
|
-
onSnapToItem={setCurrentPage}
|
|
86
|
-
maxScrollDistancePerSwipe={carouselWidth}
|
|
87
|
-
width={carouselWidth}
|
|
88
|
-
height={carouselHeight - (autoCalculateFooterHeight ? footerHeight : 0)}
|
|
89
|
-
renderItem={renderItem}
|
|
90
111
|
{...rest as TCarouselProps<T>}
|
|
91
112
|
style={styles.carousel}
|
|
92
113
|
/>
|
|
93
114
|
|
|
94
|
-
<View onLayout={
|
|
95
|
-
{
|
|
115
|
+
<View onLayout={onFooterLayout} style={styles.footerWrapper}>
|
|
116
|
+
{footer}
|
|
117
|
+
|
|
96
118
|
{showDots ? (
|
|
97
119
|
<PagerDots currentPage={currentPage} pages={pages} setCurrentPage={setCurrentPage} styles={dotStyles} />
|
|
98
120
|
) : null}
|
|
@@ -115,6 +137,9 @@ Pager.defaultProps = {
|
|
|
115
137
|
showDots: true,
|
|
116
138
|
autoCalculateFooterHeight: true,
|
|
117
139
|
initialPage: 0,
|
|
140
|
+
footer: null,
|
|
141
|
+
removeFixedHeight: 0,
|
|
142
|
+
removeFixedWidth: 0,
|
|
118
143
|
} as Partial<PagerProps<unknown>>
|
|
119
144
|
|
|
120
145
|
MobileStyleRegistry.registerComponent(Pager)
|
|
@@ -7,11 +7,8 @@ import { CarouselRenderItemInfo } from 'react-native-reanimated-carousel/lib/typ
|
|
|
7
7
|
export type PageProps<T> = CarouselRenderItemInfo<T> & {
|
|
8
8
|
isLast: boolean
|
|
9
9
|
isFirst: boolean
|
|
10
|
-
isActive: boolean
|
|
11
10
|
isOnly: boolean
|
|
12
|
-
isNext: boolean
|
|
13
11
|
index: number
|
|
14
|
-
isPrevious: boolean
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
export type PagerProps<T> = Partial<Omit<TCarouselProps<T>, 'data' | 'renderItem'>> & {
|
|
@@ -24,4 +21,6 @@ export type PagerProps<T> = Partial<Omit<TCarouselProps<T>, 'data' | 'renderItem
|
|
|
24
21
|
showDots?: boolean
|
|
25
22
|
footer?: ReactNode
|
|
26
23
|
autoCalculateFooterHeight?: boolean
|
|
24
|
+
removeFixedHeight?: number
|
|
25
|
+
removeFixedWidth?: number
|
|
27
26
|
}
|
|
@@ -2,6 +2,7 @@ import { alert } from '@codeleap/modals'
|
|
|
2
2
|
import { useEffect, useMemo, useState } from '@codeleap/hooks'
|
|
3
3
|
import { FileInputImageSource, useFileInput } from '../FileInput'
|
|
4
4
|
import { SortablePhoto, SortablePhotosProps, WithId } from './types'
|
|
5
|
+
import { logger } from '@codeleap/logger'
|
|
5
6
|
|
|
6
7
|
export const useSortablePhotos = <T extends SortablePhoto>(props: SortablePhotosProps<T>) => {
|
|
7
8
|
const {
|
|
@@ -93,7 +94,7 @@ export const useSortablePhotos = <T extends SortablePhoto>(props: SortablePhotos
|
|
|
93
94
|
multiple: isEdit ? false : props?.multiple
|
|
94
95
|
})
|
|
95
96
|
} catch (error) {
|
|
96
|
-
|
|
97
|
+
logger.error('Error opening file picker:', error)
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
if (files?.length <= 0) return null
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react'
|
|
2
2
|
import { TypeGuards } from '@codeleap/types'
|
|
3
3
|
import { onMount, useComponentTestId } from '@codeleap/hooks'
|
|
4
|
-
import { useGlobalContext } from '@codeleap/hooks'
|
|
5
4
|
import { Pressable, StyleSheet, View as RNView, Insets, Platform } from 'react-native'
|
|
6
5
|
import { View } from '../View'
|
|
7
6
|
import { TouchableFeedbackConfig, usePressableFeedback } from '../../utils'
|
|
@@ -11,6 +10,7 @@ import { AnyRecord, IJSX, StyledComponentProps, StyledComponentWithProps } from
|
|
|
11
10
|
import { TouchableProps } from './types'
|
|
12
11
|
import { MobileStyleRegistry } from '../../Registry'
|
|
13
12
|
import { useStylesFor } from '../../hooks'
|
|
13
|
+
import { logger } from '@codeleap/logger'
|
|
14
14
|
|
|
15
15
|
export * from './styles'
|
|
16
16
|
export * from './types'
|
|
@@ -49,8 +49,6 @@ export const Touchable = forwardRef<RNView, TouchableProps>((touchableProps, ref
|
|
|
49
49
|
|
|
50
50
|
const styles = useStylesFor(Touchable.styleRegistryName, style)
|
|
51
51
|
|
|
52
|
-
const { logger } = useGlobalContext()
|
|
53
|
-
|
|
54
52
|
const testId = useComponentTestId(Touchable, touchableProps, ['style', 'children', 'debounce'])
|
|
55
53
|
|
|
56
54
|
const press = () => {
|
|
@@ -58,19 +56,20 @@ export const Touchable = forwardRef<RNView, TouchableProps>((touchableProps, ref
|
|
|
58
56
|
|
|
59
57
|
const _onPress = () => {
|
|
60
58
|
logger.log(
|
|
61
|
-
`<${debugComponent || 'Touchable'}/>
|
|
59
|
+
`<${debugComponent || 'Touchable'}/> pressed:`,
|
|
62
60
|
debugName,
|
|
63
|
-
'User interaction',
|
|
64
61
|
)
|
|
62
|
+
|
|
65
63
|
if (dismissKeyboard) {
|
|
66
64
|
Keyboard.dismiss()
|
|
67
65
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
66
|
+
|
|
67
|
+
// if (analyticsEnabled) {
|
|
68
|
+
// const name = analyticsName || debugName
|
|
69
|
+
// if (!!name?.trim?.()) {
|
|
70
|
+
// logger.analytics?.interaction(name, analyticsData)
|
|
71
|
+
// }
|
|
72
|
+
// }
|
|
74
73
|
|
|
75
74
|
onPress()
|
|
76
75
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Logger } from '@codeleap/logger'
|
|
2
1
|
import { Permission } from './Permission'
|
|
3
2
|
import * as PermissionTypes from './types'
|
|
4
3
|
|
|
@@ -24,7 +23,7 @@ export class PermissionManager<
|
|
|
24
23
|
[Property in keyof T as Uppercase<string & Property>]: Property
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
logger
|
|
26
|
+
logger
|
|
28
27
|
|
|
29
28
|
constructor(perms: T, options?: PermissionTypes.PermissionManagerOptions) {
|
|
30
29
|
this.params = perms
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Logger } from '@codeleap/logger'
|
|
2
1
|
import { FunctionType } from '@codeleap/types'
|
|
3
2
|
|
|
4
3
|
export const permissionStatuses = ['unavailable', 'pending', 'denied', 'limited', 'granted', 'blocked'] as const
|
|
@@ -40,5 +39,5 @@ export type PermissionSubscriber = FunctionType<[PermissionState], any>
|
|
|
40
39
|
export type PermissionArray<T> = ([name: keyof T, options: CheckOptions])[] | (keyof T)[]
|
|
41
40
|
|
|
42
41
|
export type PermissionManagerOptions = {
|
|
43
|
-
logger?:
|
|
42
|
+
logger?: any
|
|
44
43
|
}
|
package/src/modules/scroll.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { logger } from '@codeleap/logger'
|
|
1
2
|
import React, { MutableRefObject, useCallback, useContext, useImperativeHandle, useRef } from 'react'
|
|
2
3
|
import { NativeScrollEvent, NativeSyntheticEvent, ScrollView, ScrollViewProps } from "react-native"
|
|
3
4
|
|
|
@@ -21,7 +22,7 @@ type ScrollContextValue = {
|
|
|
21
22
|
|
|
22
23
|
const noOpScrollMethods = Object.fromEntries(
|
|
23
24
|
scrollProperties.map(p => [p, () => {
|
|
24
|
-
|
|
25
|
+
logger.warn(`"${p}" was called from a ScrollProvider ref without a bound scrollable component. This does not cause errors but may impact user experience and indicate an unhandled edge case in calling code`)
|
|
25
26
|
}])
|
|
26
27
|
)
|
|
27
28
|
|
|
@@ -49,7 +50,6 @@ export const useScrollPubSub = (ref: MutableRefObject<Omit<Scrollable,'subscribe
|
|
|
49
50
|
|
|
50
51
|
useImperativeHandle(augmentedRef, () => ({
|
|
51
52
|
scrollTo(...args){
|
|
52
|
-
console.log(ref.current)
|
|
53
53
|
ref?.current.scrollTo(...args)
|
|
54
54
|
},
|
|
55
55
|
subscribe(e, cb){
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AnyFunction } from '@codeleap/types'
|
|
2
|
-
import { silentLogger } from '@codeleap/logger' // @ts-ignore
|
|
3
2
|
import messaging from '@react-native-firebase/messaging'
|
|
4
3
|
import { Subscriber, Subscription } from '../Subscription'
|
|
5
4
|
import { Message, NotificationInitializeCallback, NotificationManagerOptions, NotificationType, TNotification } from './types'
|
|
5
|
+
import { logger } from '@codeleap/logger'
|
|
6
6
|
|
|
7
7
|
export * from './types'
|
|
8
8
|
|
|
@@ -29,7 +29,6 @@ export class NotificationManager<N extends object = Message, E extends string =
|
|
|
29
29
|
public events = new Subscription<TNotification<N>, E>()
|
|
30
30
|
|
|
31
31
|
constructor(
|
|
32
|
-
private _logger = silentLogger,
|
|
33
32
|
options: NotificationManagerOptions<N> = {}
|
|
34
33
|
) {
|
|
35
34
|
if (typeof options?.parser == 'function') {
|
|
@@ -54,15 +53,13 @@ export class NotificationManager<N extends object = Message, E extends string =
|
|
|
54
53
|
})
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
public log(description: string, data: any =
|
|
58
|
-
if (!this._logger) return
|
|
59
|
-
|
|
56
|
+
public log(description: string, data: any = '') {
|
|
60
57
|
if (this.currentOptions.debug) {
|
|
61
|
-
|
|
58
|
+
logger.log(`(${MODULE})`, description, data)
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
if (this.currentOptions.slackDebug) {
|
|
65
|
-
|
|
62
|
+
logger.slack.echo(description, data, MODULE, {
|
|
66
63
|
'include': ['version'],
|
|
67
64
|
'sendIn': ['release', 'debug']
|
|
68
65
|
})
|
|
@@ -150,7 +147,7 @@ export class NotificationManager<N extends object = Message, E extends string =
|
|
|
150
147
|
* @param {function} callback Callback that is executed when the services are initialized, returning the device token
|
|
151
148
|
*/
|
|
152
149
|
public async initialize(callback: NotificationInitializeCallback) {
|
|
153
|
-
this.log('Initialize'
|
|
150
|
+
this.log('Initialize')
|
|
154
151
|
|
|
155
152
|
this.unsubscribe()
|
|
156
153
|
|