@finos_sdk/sdk-ekyc 1.5.1 → 1.5.2

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.
@@ -1,167 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const react_native_1 = require("react-native");
8
- // Dùng NativeModules trực tiếp để tránh circular dependency với FinosEKYCModule
9
- // (ExitConfirmSheet được load qua ExitSheetWrapper được import bởi FinosEKYCModule)
10
- const BellIcon = () => (<react_native_1.View style={styles.bellWrapper}>
11
- <react_native_1.View style={styles.bellMount}/>
12
- <react_native_1.View style={styles.bellBody}/>
13
- <react_native_1.View style={styles.bellSkirt}/>
14
- <react_native_1.View style={styles.bellClapper}/>
15
- </react_native_1.View>);
16
- const ExitConfirmSheet = (props) => {
17
- const message = props.message || 'Giao dịch bị hủy khi điều hướng sang tính năng tiếp theo. Quý khách có chắc chắn hủy giao dịch?';
18
- const confirmText = props.confirmText || 'Đồng ý';
19
- const cancelText = props.cancelText || 'Ở lại';
20
- const handleConfirm = async () => {
21
- var _a, _b;
22
- await ((_b = (_a = react_native_1.NativeModules.EKYCModule) === null || _a === void 0 ? void 0 : _a.resolveExit) === null || _b === void 0 ? void 0 : _b.call(_a, 'CONFIRM'));
23
- };
24
- const handleCancel = async () => {
25
- var _a, _b;
26
- await ((_b = (_a = react_native_1.NativeModules.EKYCModule) === null || _a === void 0 ? void 0 : _a.resolveExit) === null || _b === void 0 ? void 0 : _b.call(_a, 'CANCEL'));
27
- };
28
- return (<react_native_1.View style={styles.container} onLayout={(e) => {
29
- var _a, _b;
30
- const h = e.nativeEvent.layout.height;
31
- if (h > 0)
32
- (_b = (_a = react_native_1.NativeModules.EKYCModule) === null || _a === void 0 ? void 0 : _a.setExitSheetHeight) === null || _b === void 0 ? void 0 : _b.call(_a, h);
33
- }}>
34
- <react_native_1.View style={styles.handle}/>
35
-
36
- <react_native_1.View style={styles.content}>
37
- <BellIcon />
38
- <react_native_1.Text style={styles.message}>{message}</react_native_1.Text>
39
- </react_native_1.View>
40
-
41
- <react_native_1.View style={styles.footer}>
42
- <react_native_1.TouchableOpacity style={styles.confirmButton} onPress={handleConfirm} activeOpacity={0.8}>
43
- <react_native_1.View style={styles.gradientContainer}>
44
- <react_native_1.View style={[styles.gradientStep, { backgroundColor: '#E53935' }]}/>
45
- <react_native_1.View style={[styles.gradientStep, { backgroundColor: '#EA4F28' }]}/>
46
- <react_native_1.View style={[styles.gradientStep, { backgroundColor: '#EF6519' }]}/>
47
- <react_native_1.View style={[styles.gradientStep, { backgroundColor: '#F47A0B' }]}/>
48
- <react_native_1.View style={[styles.gradientStep, { backgroundColor: '#F98F00' }]}/>
49
- <react_native_1.View style={[styles.gradientStep, { backgroundColor: '#FCA300' }]}/>
50
- <react_native_1.View style={[styles.gradientStep, { backgroundColor: '#FFB800' }]}/>
51
- <react_native_1.View style={[styles.gradientStep, { backgroundColor: '#FFCC00' }]}/>
52
- <react_native_1.View style={[styles.gradientStep, { backgroundColor: '#FFD600' }]}/>
53
- </react_native_1.View>
54
- <react_native_1.Text style={styles.confirmText}>{confirmText}</react_native_1.Text>
55
- </react_native_1.TouchableOpacity>
56
-
57
- <react_native_1.TouchableOpacity style={styles.cancelButton} onPress={handleCancel} activeOpacity={0.7}>
58
- <react_native_1.Text style={styles.cancelText}>{cancelText}</react_native_1.Text>
59
- </react_native_1.TouchableOpacity>
60
- </react_native_1.View>
61
- </react_native_1.View>);
62
- };
63
- const styles = react_native_1.StyleSheet.create({
64
- container: {
65
- backgroundColor: 'white',
66
- paddingHorizontal: 24,
67
- paddingBottom: 32,
68
- borderTopLeftRadius: 32,
69
- borderTopRightRadius: 32,
70
- },
71
- handle: {
72
- width: 40,
73
- height: 4,
74
- backgroundColor: '#CCCCCC',
75
- borderRadius: 2,
76
- alignSelf: 'center',
77
- marginTop: 12,
78
- marginBottom: 20,
79
- },
80
- content: {
81
- alignItems: 'center',
82
- marginBottom: 28,
83
- },
84
- bellWrapper: {
85
- alignItems: 'center',
86
- width: 72,
87
- height: 72,
88
- marginBottom: 20,
89
- },
90
- bellMount: {
91
- width: 9,
92
- height: 7,
93
- borderRadius: 4,
94
- backgroundColor: '#E53935',
95
- marginTop: 7,
96
- },
97
- bellBody: {
98
- width: 36,
99
- height: 34,
100
- borderTopLeftRadius: 18,
101
- borderTopRightRadius: 18,
102
- backgroundColor: '#E53935',
103
- marginTop: -1,
104
- },
105
- bellSkirt: {
106
- width: 48,
107
- height: 9,
108
- borderBottomLeftRadius: 5,
109
- borderBottomRightRadius: 5,
110
- backgroundColor: '#E53935',
111
- },
112
- bellClapper: {
113
- width: 12,
114
- height: 7,
115
- borderBottomLeftRadius: 6,
116
- borderBottomRightRadius: 6,
117
- backgroundColor: '#E53935',
118
- marginTop: 2,
119
- },
120
- message: {
121
- fontSize: 15,
122
- color: '#1A1A1A',
123
- textAlign: 'center',
124
- lineHeight: 19.5,
125
- },
126
- footer: {
127
- width: '100%',
128
- gap: 12,
129
- },
130
- confirmButton: {
131
- width: '100%',
132
- height: 52,
133
- borderRadius: 24,
134
- alignItems: 'center',
135
- justifyContent: 'center',
136
- overflow: 'hidden',
137
- elevation: 4,
138
- shadowColor: '#E53935',
139
- shadowOffset: { width: 0, height: 4 },
140
- shadowOpacity: 0.3,
141
- shadowRadius: 8,
142
- },
143
- gradientContainer: Object.assign(Object.assign({}, react_native_1.StyleSheet.absoluteFillObject), { flexDirection: 'row' }),
144
- gradientStep: {
145
- flex: 1,
146
- },
147
- confirmText: {
148
- fontSize: 16,
149
- fontWeight: '700',
150
- color: '#fff',
151
- },
152
- cancelButton: {
153
- width: '100%',
154
- height: 52,
155
- borderRadius: 24,
156
- borderWidth: 1.5,
157
- borderColor: '#CCCCCC',
158
- alignItems: 'center',
159
- justifyContent: 'center',
160
- },
161
- cancelText: {
162
- fontSize: 16,
163
- fontWeight: '600',
164
- color: '#555555',
165
- },
166
- });
167
- exports.default = ExitConfirmSheet;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * Set custom exit sheet component.
4
- * Gọi trước khi showRNExitSheet để override default ExitConfirmSheet.
5
- */
6
- export declare function setCustomExitComponent(component: React.ComponentType<any> | null): void;
7
- /**
8
- * Wrapper component được SDK auto-register với tên 'SDKExitSheetWrapper'.
9
- * Render custom component nếu được set, fallback về ExitConfirmSheet mặc định.
10
- */
11
- declare const ExitSheetWrapper: (props: any) => React.JSX.Element;
12
- export default ExitSheetWrapper;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.setCustomExitComponent = setCustomExitComponent;
7
- const react_1 = __importDefault(require("react"));
8
- const ExitConfirmSheet_1 = __importDefault(require("./ExitConfirmSheet"));
9
- // Module-level variable — set bởi FinosEKYC.setExitSheetComponent()
10
- let _customComponent = null;
11
- /**
12
- * Set custom exit sheet component.
13
- * Gọi trước khi showRNExitSheet để override default ExitConfirmSheet.
14
- */
15
- function setCustomExitComponent(component) {
16
- _customComponent = component;
17
- }
18
- /**
19
- * Wrapper component được SDK auto-register với tên 'SDKExitSheetWrapper'.
20
- * Render custom component nếu được set, fallback về ExitConfirmSheet mặc định.
21
- */
22
- const ExitSheetWrapper = (props) => {
23
- const Component = _customComponent || ExitConfirmSheet_1.default;
24
- return <Component {...props}/>;
25
- };
26
- exports.default = ExitSheetWrapper;
@@ -1,182 +0,0 @@
1
- import React from 'react';
2
- import {
3
- View,
4
- Text,
5
- StyleSheet,
6
- TouchableOpacity,
7
- NativeModules,
8
- } from 'react-native';
9
-
10
- // Dùng NativeModules trực tiếp để tránh circular dependency với FinosEKYCModule
11
- // (ExitConfirmSheet được load qua ExitSheetWrapper được import bởi FinosEKYCModule)
12
-
13
- const BellIcon = () => (
14
- <View style={styles.bellWrapper}>
15
- <View style={styles.bellMount} />
16
- <View style={styles.bellBody} />
17
- <View style={styles.bellSkirt} />
18
- <View style={styles.bellClapper} />
19
- </View>
20
- );
21
-
22
- const ExitConfirmSheet = (props: any) => {
23
- const message = props.message || 'Giao dịch bị hủy khi điều hướng sang tính năng tiếp theo. Quý khách có chắc chắn hủy giao dịch?';
24
- const confirmText = props.confirmText || 'Đồng ý';
25
- const cancelText = props.cancelText || 'Ở lại';
26
-
27
- const handleConfirm = async () => {
28
- await NativeModules.EKYCModule?.resolveExit?.('CONFIRM');
29
- };
30
-
31
- const handleCancel = async () => {
32
- await NativeModules.EKYCModule?.resolveExit?.('CANCEL');
33
- };
34
-
35
- return (
36
- <View
37
- style={styles.container}
38
- onLayout={(e) => {
39
- const h = e.nativeEvent.layout.height;
40
- if (h > 0) NativeModules.EKYCModule?.setExitSheetHeight?.(h);
41
- }}
42
- >
43
- <View style={styles.handle} />
44
-
45
- <View style={styles.content}>
46
- <BellIcon />
47
- <Text style={styles.message}>{message}</Text>
48
- </View>
49
-
50
- <View style={styles.footer}>
51
- <TouchableOpacity style={styles.confirmButton} onPress={handleConfirm} activeOpacity={0.8}>
52
- <View style={styles.gradientContainer}>
53
- <View style={[styles.gradientStep, { backgroundColor: '#E53935' }]} />
54
- <View style={[styles.gradientStep, { backgroundColor: '#EA4F28' }]} />
55
- <View style={[styles.gradientStep, { backgroundColor: '#EF6519' }]} />
56
- <View style={[styles.gradientStep, { backgroundColor: '#F47A0B' }]} />
57
- <View style={[styles.gradientStep, { backgroundColor: '#F98F00' }]} />
58
- <View style={[styles.gradientStep, { backgroundColor: '#FCA300' }]} />
59
- <View style={[styles.gradientStep, { backgroundColor: '#FFB800' }]} />
60
- <View style={[styles.gradientStep, { backgroundColor: '#FFCC00' }]} />
61
- <View style={[styles.gradientStep, { backgroundColor: '#FFD600' }]} />
62
- </View>
63
- <Text style={styles.confirmText}>{confirmText}</Text>
64
- </TouchableOpacity>
65
-
66
- <TouchableOpacity style={styles.cancelButton} onPress={handleCancel} activeOpacity={0.7}>
67
- <Text style={styles.cancelText}>{cancelText}</Text>
68
- </TouchableOpacity>
69
- </View>
70
- </View>
71
- );
72
- };
73
-
74
- const styles = StyleSheet.create({
75
- container: {
76
- backgroundColor: 'white',
77
- paddingHorizontal: 24,
78
- paddingBottom: 32,
79
- borderTopLeftRadius: 32,
80
- borderTopRightRadius: 32,
81
- },
82
- handle: {
83
- width: 40,
84
- height: 4,
85
- backgroundColor: '#CCCCCC',
86
- borderRadius: 2,
87
- alignSelf: 'center',
88
- marginTop: 12,
89
- marginBottom: 20,
90
- },
91
- content: {
92
- alignItems: 'center',
93
- marginBottom: 28,
94
- },
95
- bellWrapper: {
96
- alignItems: 'center',
97
- width: 72,
98
- height: 72,
99
- marginBottom: 20,
100
- },
101
- bellMount: {
102
- width: 9,
103
- height: 7,
104
- borderRadius: 4,
105
- backgroundColor: '#E53935',
106
- marginTop: 7,
107
- },
108
- bellBody: {
109
- width: 36,
110
- height: 34,
111
- borderTopLeftRadius: 18,
112
- borderTopRightRadius: 18,
113
- backgroundColor: '#E53935',
114
- marginTop: -1,
115
- },
116
- bellSkirt: {
117
- width: 48,
118
- height: 9,
119
- borderBottomLeftRadius: 5,
120
- borderBottomRightRadius: 5,
121
- backgroundColor: '#E53935',
122
- },
123
- bellClapper: {
124
- width: 12,
125
- height: 7,
126
- borderBottomLeftRadius: 6,
127
- borderBottomRightRadius: 6,
128
- backgroundColor: '#E53935',
129
- marginTop: 2,
130
- },
131
- message: {
132
- fontSize: 15,
133
- color: '#1A1A1A',
134
- textAlign: 'center',
135
- lineHeight: 19.5,
136
- },
137
- footer: {
138
- width: '100%',
139
- gap: 12,
140
- },
141
- confirmButton: {
142
- width: '100%',
143
- height: 52,
144
- borderRadius: 24,
145
- alignItems: 'center',
146
- justifyContent: 'center',
147
- overflow: 'hidden',
148
- elevation: 4,
149
- shadowColor: '#E53935',
150
- shadowOffset: { width: 0, height: 4 },
151
- shadowOpacity: 0.3,
152
- shadowRadius: 8,
153
- },
154
- gradientContainer: {
155
- ...StyleSheet.absoluteFillObject,
156
- flexDirection: 'row',
157
- },
158
- gradientStep: {
159
- flex: 1,
160
- },
161
- confirmText: {
162
- fontSize: 16,
163
- fontWeight: '700',
164
- color: '#fff',
165
- },
166
- cancelButton: {
167
- width: '100%',
168
- height: 52,
169
- borderRadius: 24,
170
- borderWidth: 1.5,
171
- borderColor: '#CCCCCC',
172
- alignItems: 'center',
173
- justifyContent: 'center',
174
- },
175
- cancelText: {
176
- fontSize: 16,
177
- fontWeight: '600',
178
- color: '#555555',
179
- },
180
- });
181
-
182
- export default ExitConfirmSheet;
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import ExitConfirmSheet from './ExitConfirmSheet';
3
-
4
- // Module-level variable — set bởi FinosEKYC.setExitSheetComponent()
5
- let _customComponent: React.ComponentType<any> | null = null;
6
-
7
- /**
8
- * Set custom exit sheet component.
9
- * Gọi trước khi showRNExitSheet để override default ExitConfirmSheet.
10
- */
11
- export function setCustomExitComponent(component: React.ComponentType<any> | null) {
12
- _customComponent = component;
13
- }
14
-
15
- /**
16
- * Wrapper component được SDK auto-register với tên 'SDKExitSheetWrapper'.
17
- * Render custom component nếu được set, fallback về ExitConfirmSheet mặc định.
18
- */
19
- const ExitSheetWrapper = (props: any) => {
20
- const Component = _customComponent || ExitConfirmSheet;
21
- return <Component {...props} />;
22
- };
23
-
24
- export default ExitSheetWrapper;