react-native-hyperkyc-sdk 3.2.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnativehyperkycsdk/HyperkycSdkModule.java +22 -1
- package/ios/HyperkycSdk.swift +20 -4
- package/lib/commonjs/HyperKycThemeMode.js +48 -0
- package/lib/commonjs/HyperKycThemeMode.js.map +1 -0
- package/lib/commonjs/index.js +12 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/HyperKycThemeMode.js +40 -0
- package/lib/module/HyperKycThemeMode.js.map +1 -0
- package/lib/module/index.js +6 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/HyperKycThemeMode.d.ts +37 -0
- package/lib/typescript/index.d.ts +2 -0
- package/package.json +1 -1
- package/react-native-hyperkyc-sdk.podspec +1 -1
- package/src/HyperKycThemeMode.ts +42 -0
- package/src/index.tsx +5 -0
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ npm install react-native-hyperkyc-sdk
|
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
14
|
import { NativeModules } from 'react-native';
|
|
15
|
+
import { HKThemeMode } from 'react-native-hyperkyc-sdk';
|
|
15
16
|
const { Hyperkyc } = NativeModules
|
|
16
17
|
|
|
17
18
|
// ...
|
|
@@ -30,6 +31,9 @@ const { Hyperkyc } = NativeModules
|
|
|
30
31
|
configDictionary["transactionId"] = transactionId
|
|
31
32
|
configDictionary["workflowId"] = "<workflow-id>"
|
|
32
33
|
|
|
34
|
+
// [Optional] Theme mode — defaults to light if not set
|
|
35
|
+
configDictionary["themeMode"] = HKThemeMode.SYSTEM
|
|
36
|
+
|
|
33
37
|
// Generate unique ID
|
|
34
38
|
Hyperkyc.createUniqueId(uniqueId =>{
|
|
35
39
|
console.log(uniqueId)
|
|
@@ -53,6 +57,18 @@ Hyperkyc.launch(configDictionary, function(response){
|
|
|
53
57
|
})
|
|
54
58
|
```
|
|
55
59
|
|
|
60
|
+
### Theme mode
|
|
61
|
+
|
|
62
|
+
Pass `themeMode` in the launch config to control how the SDK renders its UI:
|
|
63
|
+
|
|
64
|
+
| Value | Behaviour |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `HKThemeMode.LIGHT` | Force light theme regardless of system settings |
|
|
67
|
+
| `HKThemeMode.DARK` | Force dark theme regardless of system settings |
|
|
68
|
+
| `HKThemeMode.SYSTEM` | Follow the device's system theme settings |
|
|
69
|
+
|
|
70
|
+
If `themeMode` is not set, the SDK defaults to the light theme.
|
|
71
|
+
|
|
56
72
|
## Contributing
|
|
57
73
|
|
|
58
74
|
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
package/android/build.gradle
CHANGED
|
@@ -56,7 +56,7 @@ repositories {
|
|
|
56
56
|
dependencies {
|
|
57
57
|
//noinspection GradleDynamicVersion
|
|
58
58
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
59
|
-
implementation('co.hyperverge:hyperkyc:3.
|
|
59
|
+
implementation('co.hyperverge:hyperkyc:3.3.1@aar', {
|
|
60
60
|
transitive = true
|
|
61
61
|
exclude group: 'co.hyperverge', module: 'hyperdocdetect'
|
|
62
62
|
exclude group: 'co.hyperverge', module: 'hypersnap-pdf'
|
|
@@ -27,6 +27,7 @@ import java.util.HashMap;
|
|
|
27
27
|
import java.util.Map;
|
|
28
28
|
|
|
29
29
|
import co.hyperverge.hyperkyc.HyperKyc;
|
|
30
|
+
import co.hyperverge.hyperkyc.data.models.ThemeMode;
|
|
30
31
|
import co.hyperverge.hyperkyc.data.models.HyperKycConfig;
|
|
31
32
|
import co.hyperverge.hyperkyc.data.models.result.HyperKycResult;
|
|
32
33
|
import kotlin.Unit;
|
|
@@ -180,8 +181,9 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
|
|
|
180
181
|
String defaultLangCode = kycConfig.hasKey("defaultLangCode") ? kycConfig.getString("defaultLangCode") : null;
|
|
181
182
|
Boolean useLocation = kycConfig.hasKey("useLocation") ? kycConfig.getBoolean("useLocation") : null;
|
|
182
183
|
String uniqueId = kycConfig.hasKey("uniqueId") ? kycConfig.getString("uniqueId") : null;
|
|
184
|
+
String themeMode = kycConfig.hasKey("themeMode") ? kycConfig.getString("themeMode") : null;
|
|
183
185
|
Map<String, String> metadata = new HashMap<>();
|
|
184
|
-
metadata.put("sdk-version", "3.
|
|
186
|
+
metadata.put("sdk-version", "3.3.1");
|
|
185
187
|
metadata.put("sdk-type", "React Native");
|
|
186
188
|
if (accessToken == null) {
|
|
187
189
|
assert appId != null;
|
|
@@ -202,6 +204,9 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
|
|
|
202
204
|
hyperKycConfig.setUniqueId(uniqueId);
|
|
203
205
|
}
|
|
204
206
|
hyperKycConfig.addMetadata(metadata);
|
|
207
|
+
if (themeMode != null) {
|
|
208
|
+
hyperKycConfig.setThemeMode(getThemeModeFromString(themeMode));
|
|
209
|
+
}
|
|
205
210
|
|
|
206
211
|
return hyperKycConfig;
|
|
207
212
|
} else {
|
|
@@ -221,11 +226,27 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
|
|
|
221
226
|
hyperKycConfig.setUniqueId(uniqueId);
|
|
222
227
|
}
|
|
223
228
|
hyperKycConfig.addMetadata(metadata);
|
|
229
|
+
if (themeMode != null) {
|
|
230
|
+
hyperKycConfig.setThemeMode(getThemeModeFromString(themeMode));
|
|
231
|
+
}
|
|
224
232
|
|
|
225
233
|
return hyperKycConfig;
|
|
226
234
|
}
|
|
227
235
|
}
|
|
228
236
|
|
|
237
|
+
private ThemeMode getThemeModeFromString(String themeModeString) {
|
|
238
|
+
switch (themeModeString) {
|
|
239
|
+
case "LIGHT":
|
|
240
|
+
return ThemeMode.LIGHT;
|
|
241
|
+
case "DARK":
|
|
242
|
+
return ThemeMode.DARK;
|
|
243
|
+
case "SYSTEM":
|
|
244
|
+
return ThemeMode.SYSTEM;
|
|
245
|
+
default:
|
|
246
|
+
return ThemeMode.LIGHT;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
229
250
|
private WritableMap getDummyResultMap() {
|
|
230
251
|
WritableMap dummyResult = new WritableNativeMap();
|
|
231
252
|
dummyResult.putString("status", "");
|
package/ios/HyperkycSdk.swift
CHANGED
|
@@ -44,8 +44,9 @@ class Hyperkyc: RCTEventEmitter {
|
|
|
44
44
|
let inputs = _config["inputs"] as? [String: Any]
|
|
45
45
|
let useLocation = _config["useLocation"] as? Bool
|
|
46
46
|
let uniqueId = _config["uniqueId"] as? String
|
|
47
|
+
let themeMode = _config["themeMode"] as? String
|
|
47
48
|
let metadata: [String: String] = [
|
|
48
|
-
"sdk-version": "3.
|
|
49
|
+
"sdk-version": "3.3.1",
|
|
49
50
|
"sdk-type": "React Native"
|
|
50
51
|
]
|
|
51
52
|
|
|
@@ -64,8 +65,7 @@ class Hyperkyc: RCTEventEmitter {
|
|
|
64
65
|
|
|
65
66
|
if let accessToken = accessToken {
|
|
66
67
|
hyperKYCConfig = HyperKycConfig(accessToken: accessToken, workflowId: workflowId!, transactionId: transactionId!)
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
68
|
+
} else {
|
|
69
69
|
hyperKYCConfig = HyperKycConfig(appId: appId!, appKey: appKey!, workflowId: workflowId!, transactionId: transactionId!)
|
|
70
70
|
}
|
|
71
71
|
if let inputs = inputs {
|
|
@@ -81,6 +81,9 @@ class Hyperkyc: RCTEventEmitter {
|
|
|
81
81
|
hyperKYCConfig.setUniqueId(uuid: uniqueId)
|
|
82
82
|
}
|
|
83
83
|
hyperKYCConfig.addMetadata(metadata: metadata)
|
|
84
|
+
if let themeMode = themeMode {
|
|
85
|
+
hyperKYCConfig.setThemeMode(themeMode: self.getThemeModeFromString(themeModeString: themeMode))
|
|
86
|
+
}
|
|
84
87
|
|
|
85
88
|
// launch HyperKyc
|
|
86
89
|
HyperKyc.launch(controller!, hyperKycConfig: hyperKYCConfig) { hyperKycResult in
|
|
@@ -90,6 +93,19 @@ class Hyperkyc: RCTEventEmitter {
|
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
|
|
96
|
+
func getThemeModeFromString(themeModeString: String) -> HyperKYC.ThemeMode {
|
|
97
|
+
switch themeModeString {
|
|
98
|
+
case "LIGHT":
|
|
99
|
+
return .light
|
|
100
|
+
case "DARK":
|
|
101
|
+
return .dark
|
|
102
|
+
case "SYSTEM":
|
|
103
|
+
return .system
|
|
104
|
+
default:
|
|
105
|
+
return .light
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
93
109
|
func processHyperKycResponse(hyperKycResult: HyperKycResult) -> [String: Any] {
|
|
94
110
|
var kycData = [:] as [String: Any]
|
|
95
111
|
|
|
@@ -126,7 +142,7 @@ class Hyperkyc: RCTEventEmitter {
|
|
|
126
142
|
isNativeListenerRegistered = false
|
|
127
143
|
}
|
|
128
144
|
|
|
129
|
-
|
|
145
|
+
// Add these two methods
|
|
130
146
|
@objc override func addListener(_ eventName: String) {
|
|
131
147
|
// Required for RN built-in EventEmitter support
|
|
132
148
|
// Can be empty if we don't need per-event management.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.HKThemeMode = void 0;
|
|
7
|
+
// src/HyperKycThemeMode.ts
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Theme mode for the HyperKyc SDK.
|
|
11
|
+
*
|
|
12
|
+
* This enum specifies how the SDK should handle theming:
|
|
13
|
+
* - `LIGHT`: Force light theme regardless of system settings
|
|
14
|
+
* - `DARK`: Force dark theme regardless of system settings
|
|
15
|
+
* - `SYSTEM`: Follow the device's system theme settings
|
|
16
|
+
*
|
|
17
|
+
* The values are the strings sent over the bridge to the native SDKs.
|
|
18
|
+
*
|
|
19
|
+
* Usage:
|
|
20
|
+
* ```js
|
|
21
|
+
* import HyperKyc, { HKThemeMode } from 'react-native-hyperkyc-sdk';
|
|
22
|
+
*
|
|
23
|
+
* const configDictionary = {};
|
|
24
|
+
* configDictionary["appId"] = appId;
|
|
25
|
+
* configDictionary["appKey"] = appKey;
|
|
26
|
+
* configDictionary["workflowId"] = workflowId;
|
|
27
|
+
* configDictionary["transactionId"] = transactionId;
|
|
28
|
+
* configDictionary["themeMode"] = HKThemeMode.SYSTEM; // Follow system theme
|
|
29
|
+
* // or
|
|
30
|
+
* configDictionary["themeMode"] = HKThemeMode.DARK; // Force dark theme
|
|
31
|
+
* // or
|
|
32
|
+
* configDictionary["themeMode"] = HKThemeMode.LIGHT; // Force light theme
|
|
33
|
+
*
|
|
34
|
+
* HyperKyc.launch(configDictionary, (response) => console.log(response));
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
let HKThemeMode;
|
|
38
|
+
exports.HKThemeMode = HKThemeMode;
|
|
39
|
+
|
|
40
|
+
(function (HKThemeMode) {
|
|
41
|
+
HKThemeMode["LIGHT"] = "LIGHT";
|
|
42
|
+
HKThemeMode["DARK"] = "DARK";
|
|
43
|
+
HKThemeMode["SYSTEM"] = "SYSTEM";
|
|
44
|
+
})(HKThemeMode || (exports.HKThemeMode = HKThemeMode = {}));
|
|
45
|
+
|
|
46
|
+
var _default = HKThemeMode;
|
|
47
|
+
exports.default = _default;
|
|
48
|
+
//# sourceMappingURL=HyperKycThemeMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["HyperKycThemeMode.ts"],"names":["HKThemeMode"],"mappings":";;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACYA,W;;;WAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,2BAAAA,W;;eAWGA,W","sourcesContent":["// src/HyperKycThemeMode.ts\n\n/**\n * Theme mode for the HyperKyc SDK.\n *\n * This enum specifies how the SDK should handle theming:\n * - `LIGHT`: Force light theme regardless of system settings\n * - `DARK`: Force dark theme regardless of system settings\n * - `SYSTEM`: Follow the device's system theme settings\n *\n * The values are the strings sent over the bridge to the native SDKs.\n *\n * Usage:\n * ```js\n * import HyperKyc, { HKThemeMode } from 'react-native-hyperkyc-sdk';\n *\n * const configDictionary = {};\n * configDictionary[\"appId\"] = appId;\n * configDictionary[\"appKey\"] = appKey;\n * configDictionary[\"workflowId\"] = workflowId;\n * configDictionary[\"transactionId\"] = transactionId;\n * configDictionary[\"themeMode\"] = HKThemeMode.SYSTEM; // Follow system theme\n * // or\n * configDictionary[\"themeMode\"] = HKThemeMode.DARK; // Force dark theme\n * // or\n * configDictionary[\"themeMode\"] = HKThemeMode.LIGHT; // Force light theme\n *\n * HyperKyc.launch(configDictionary, (response) => console.log(response));\n * ```\n */\nexport enum HKThemeMode {\n /** Force light theme regardless of system settings */\n LIGHT = 'LIGHT',\n\n /** Force dark theme regardless of system settings */\n DARK = 'DARK',\n\n /** Follow the device's system theme settings */\n SYSTEM = 'SYSTEM',\n}\n\nexport default HKThemeMode;\n"]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "HKThemeMode", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _HyperKycThemeMode.HKThemeMode;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
exports.default = exports.addEventListener = void 0;
|
|
7
13
|
exports.multiply = multiply;
|
|
8
14
|
exports.removeAllEventListeners = void 0;
|
|
@@ -11,6 +17,8 @@ var _reactNative = require("react-native");
|
|
|
11
17
|
|
|
12
18
|
var _HyperKycEvents = _interopRequireDefault(require("./HyperKycEvents"));
|
|
13
19
|
|
|
20
|
+
var _HyperKycThemeMode = require("./HyperKycThemeMode");
|
|
21
|
+
|
|
14
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
23
|
|
|
16
24
|
// src/index.tsx
|
|
@@ -27,11 +35,12 @@ const HyperkycSdk = _reactNative.NativeModules.HyperkycSdk ? _reactNative.Native
|
|
|
27
35
|
const {
|
|
28
36
|
addEventListener,
|
|
29
37
|
removeAllEventListeners
|
|
30
|
-
} = _HyperKycEvents.default; // Export
|
|
38
|
+
} = _HyperKycEvents.default; // Export HKThemeMode so clients can access it
|
|
31
39
|
|
|
32
40
|
exports.removeAllEventListeners = removeAllEventListeners;
|
|
33
41
|
exports.addEventListener = addEventListener;
|
|
34
42
|
|
|
43
|
+
// Export any native methods if needed
|
|
35
44
|
function multiply(a, b) {
|
|
36
45
|
return HyperkycSdk.multiply(a, b);
|
|
37
46
|
} // You can also export the full native module if needed:
|
|
@@ -39,7 +48,8 @@ function multiply(a, b) {
|
|
|
39
48
|
|
|
40
49
|
var _default = { ...HyperkycSdk,
|
|
41
50
|
addEventListener,
|
|
42
|
-
removeAllEventListeners
|
|
51
|
+
removeAllEventListeners,
|
|
52
|
+
HKThemeMode: _HyperKycThemeMode.HKThemeMode
|
|
43
53
|
};
|
|
44
54
|
exports.default = _default;
|
|
45
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["LINKING_ERROR","Platform","select","ios","default","HyperkycSdk","NativeModules","Proxy","get","Error","addEventListener","removeAllEventListeners","HyperKycEvents","multiply","a","b"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["LINKING_ERROR","Platform","select","ios","default","HyperkycSdk","NativeModules","Proxy","get","Error","addEventListener","removeAllEventListeners","HyperKycEvents","multiply","a","b","HKThemeMode"],"mappings":";;;;;;;;;;;;;;;AACA;;AACA;;AACA;;;;AAHA;AAKA,MAAMA,aAAa,GAChB,oFAAD,GACAC,sBAASC,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,WAAW,GAAGC,2BAAcD,WAAd,GAChBC,2BAAcD,WADE,GAEhB,IAAIE,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUT,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAWO,MAAM;AAAEU,EAAAA,gBAAF;AAAoBC,EAAAA;AAApB,IAAgDC,uBAAtD,C,CAEP;;;;;AAGA;AACO,SAASC,QAAT,CAAkBC,CAAlB,EAA6BC,CAA7B,EAAyD;AAC9D,SAAOV,WAAW,CAACQ,QAAZ,CAAqBC,CAArB,EAAwBC,CAAxB,CAAP;AACD,C,CAED;;;eACe,EACb,GAAGV,WADU;AAEbK,EAAAA,gBAFa;AAGbC,EAAAA,uBAHa;AAIbK,EAAAA,WAAW,EAAXA;AAJa,C","sourcesContent":["// src/index.tsx\nimport { NativeModules, Platform } from 'react-native';\nimport HyperKycEvents from './HyperKycEvents';\nimport { HKThemeMode } from './HyperKycThemeMode';\n\nconst LINKING_ERROR =\n `The package 'react-native-hyperkyc-sdk' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst HyperkycSdk = NativeModules.HyperkycSdk\n ? NativeModules.HyperkycSdk\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport const { addEventListener, removeAllEventListeners } = HyperKycEvents;\n\n// Export HKThemeMode so clients can access it\nexport { HKThemeMode };\n\n// Export any native methods if needed\nexport function multiply(a: number, b: number): Promise<number> {\n return HyperkycSdk.multiply(a, b);\n}\n\n// You can also export the full native module if needed:\nexport default {\n ...HyperkycSdk,\n addEventListener,\n removeAllEventListeners,\n HKThemeMode,\n};"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/HyperKycThemeMode.ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Theme mode for the HyperKyc SDK.
|
|
5
|
+
*
|
|
6
|
+
* This enum specifies how the SDK should handle theming:
|
|
7
|
+
* - `LIGHT`: Force light theme regardless of system settings
|
|
8
|
+
* - `DARK`: Force dark theme regardless of system settings
|
|
9
|
+
* - `SYSTEM`: Follow the device's system theme settings
|
|
10
|
+
*
|
|
11
|
+
* The values are the strings sent over the bridge to the native SDKs.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* ```js
|
|
15
|
+
* import HyperKyc, { HKThemeMode } from 'react-native-hyperkyc-sdk';
|
|
16
|
+
*
|
|
17
|
+
* const configDictionary = {};
|
|
18
|
+
* configDictionary["appId"] = appId;
|
|
19
|
+
* configDictionary["appKey"] = appKey;
|
|
20
|
+
* configDictionary["workflowId"] = workflowId;
|
|
21
|
+
* configDictionary["transactionId"] = transactionId;
|
|
22
|
+
* configDictionary["themeMode"] = HKThemeMode.SYSTEM; // Follow system theme
|
|
23
|
+
* // or
|
|
24
|
+
* configDictionary["themeMode"] = HKThemeMode.DARK; // Force dark theme
|
|
25
|
+
* // or
|
|
26
|
+
* configDictionary["themeMode"] = HKThemeMode.LIGHT; // Force light theme
|
|
27
|
+
*
|
|
28
|
+
* HyperKyc.launch(configDictionary, (response) => console.log(response));
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export let HKThemeMode;
|
|
32
|
+
|
|
33
|
+
(function (HKThemeMode) {
|
|
34
|
+
HKThemeMode["LIGHT"] = "LIGHT";
|
|
35
|
+
HKThemeMode["DARK"] = "DARK";
|
|
36
|
+
HKThemeMode["SYSTEM"] = "SYSTEM";
|
|
37
|
+
})(HKThemeMode || (HKThemeMode = {}));
|
|
38
|
+
|
|
39
|
+
export default HKThemeMode;
|
|
40
|
+
//# sourceMappingURL=HyperKycThemeMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["HyperKycThemeMode.ts"],"names":["HKThemeMode"],"mappings":"AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYA,WAAZ;;WAAYA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,KAAAA,W;;AAWZ,eAAeA,WAAf","sourcesContent":["// src/HyperKycThemeMode.ts\n\n/**\n * Theme mode for the HyperKyc SDK.\n *\n * This enum specifies how the SDK should handle theming:\n * - `LIGHT`: Force light theme regardless of system settings\n * - `DARK`: Force dark theme regardless of system settings\n * - `SYSTEM`: Follow the device's system theme settings\n *\n * The values are the strings sent over the bridge to the native SDKs.\n *\n * Usage:\n * ```js\n * import HyperKyc, { HKThemeMode } from 'react-native-hyperkyc-sdk';\n *\n * const configDictionary = {};\n * configDictionary[\"appId\"] = appId;\n * configDictionary[\"appKey\"] = appKey;\n * configDictionary[\"workflowId\"] = workflowId;\n * configDictionary[\"transactionId\"] = transactionId;\n * configDictionary[\"themeMode\"] = HKThemeMode.SYSTEM; // Follow system theme\n * // or\n * configDictionary[\"themeMode\"] = HKThemeMode.DARK; // Force dark theme\n * // or\n * configDictionary[\"themeMode\"] = HKThemeMode.LIGHT; // Force light theme\n *\n * HyperKyc.launch(configDictionary, (response) => console.log(response));\n * ```\n */\nexport enum HKThemeMode {\n /** Force light theme regardless of system settings */\n LIGHT = 'LIGHT',\n\n /** Force dark theme regardless of system settings */\n DARK = 'DARK',\n\n /** Follow the device's system theme settings */\n SYSTEM = 'SYSTEM',\n}\n\nexport default HKThemeMode;\n"]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/index.tsx
|
|
2
2
|
import { NativeModules, Platform } from 'react-native';
|
|
3
3
|
import HyperKycEvents from './HyperKycEvents';
|
|
4
|
+
import { HKThemeMode } from './HyperKycThemeMode';
|
|
4
5
|
const LINKING_ERROR = `The package 'react-native-hyperkyc-sdk' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
5
6
|
ios: "- You have run 'pod install'\n",
|
|
6
7
|
default: ''
|
|
@@ -14,7 +15,9 @@ const HyperkycSdk = NativeModules.HyperkycSdk ? NativeModules.HyperkycSdk : new
|
|
|
14
15
|
export const {
|
|
15
16
|
addEventListener,
|
|
16
17
|
removeAllEventListeners
|
|
17
|
-
} = HyperKycEvents; // Export
|
|
18
|
+
} = HyperKycEvents; // Export HKThemeMode so clients can access it
|
|
19
|
+
|
|
20
|
+
export { HKThemeMode }; // Export any native methods if needed
|
|
18
21
|
|
|
19
22
|
export function multiply(a, b) {
|
|
20
23
|
return HyperkycSdk.multiply(a, b);
|
|
@@ -22,6 +25,7 @@ export function multiply(a, b) {
|
|
|
22
25
|
|
|
23
26
|
export default { ...HyperkycSdk,
|
|
24
27
|
addEventListener,
|
|
25
|
-
removeAllEventListeners
|
|
28
|
+
removeAllEventListeners,
|
|
29
|
+
HKThemeMode
|
|
26
30
|
};
|
|
27
31
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["NativeModules","Platform","HyperKycEvents","LINKING_ERROR","select","ios","default","HyperkycSdk","Proxy","get","Error","addEventListener","removeAllEventListeners","multiply","a","b"],"mappings":"AAAA;AACA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AACA,OAAOC,cAAP,MAA2B,kBAA3B;AAEA,MAAMC,aAAa,GAChB,oFAAD,
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["NativeModules","Platform","HyperKycEvents","HKThemeMode","LINKING_ERROR","select","ios","default","HyperkycSdk","Proxy","get","Error","addEventListener","removeAllEventListeners","multiply","a","b"],"mappings":"AAAA;AACA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AACA,OAAOC,cAAP,MAA2B,kBAA3B;AACA,SAASC,WAAT,QAA4B,qBAA5B;AAEA,MAAMC,aAAa,GAChB,oFAAD,GACAH,QAAQ,CAACI,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,WAAW,GAAGR,aAAa,CAACQ,WAAd,GAChBR,aAAa,CAACQ,WADE,GAEhB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUP,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAWA,OAAO,MAAM;AAAEQ,EAAAA,gBAAF;AAAoBC,EAAAA;AAApB,IAAgDX,cAAtD,C,CAEP;;AACA,SAASC,WAAT,G,CAEA;;AACA,OAAO,SAASW,QAAT,CAAkBC,CAAlB,EAA6BC,CAA7B,EAAyD;AAC9D,SAAOR,WAAW,CAACM,QAAZ,CAAqBC,CAArB,EAAwBC,CAAxB,CAAP;AACD,C,CAED;;AACA,eAAe,EACb,GAAGR,WADU;AAEbI,EAAAA,gBAFa;AAGbC,EAAAA,uBAHa;AAIbV,EAAAA;AAJa,CAAf","sourcesContent":["// src/index.tsx\nimport { NativeModules, Platform } from 'react-native';\nimport HyperKycEvents from './HyperKycEvents';\nimport { HKThemeMode } from './HyperKycThemeMode';\n\nconst LINKING_ERROR =\n `The package 'react-native-hyperkyc-sdk' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst HyperkycSdk = NativeModules.HyperkycSdk\n ? NativeModules.HyperkycSdk\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport const { addEventListener, removeAllEventListeners } = HyperKycEvents;\n\n// Export HKThemeMode so clients can access it\nexport { HKThemeMode };\n\n// Export any native methods if needed\nexport function multiply(a: number, b: number): Promise<number> {\n return HyperkycSdk.multiply(a, b);\n}\n\n// You can also export the full native module if needed:\nexport default {\n ...HyperkycSdk,\n addEventListener,\n removeAllEventListeners,\n HKThemeMode,\n};"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme mode for the HyperKyc SDK.
|
|
3
|
+
*
|
|
4
|
+
* This enum specifies how the SDK should handle theming:
|
|
5
|
+
* - `LIGHT`: Force light theme regardless of system settings
|
|
6
|
+
* - `DARK`: Force dark theme regardless of system settings
|
|
7
|
+
* - `SYSTEM`: Follow the device's system theme settings
|
|
8
|
+
*
|
|
9
|
+
* The values are the strings sent over the bridge to the native SDKs.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```js
|
|
13
|
+
* import HyperKyc, { HKThemeMode } from 'react-native-hyperkyc-sdk';
|
|
14
|
+
*
|
|
15
|
+
* const configDictionary = {};
|
|
16
|
+
* configDictionary["appId"] = appId;
|
|
17
|
+
* configDictionary["appKey"] = appKey;
|
|
18
|
+
* configDictionary["workflowId"] = workflowId;
|
|
19
|
+
* configDictionary["transactionId"] = transactionId;
|
|
20
|
+
* configDictionary["themeMode"] = HKThemeMode.SYSTEM; // Follow system theme
|
|
21
|
+
* // or
|
|
22
|
+
* configDictionary["themeMode"] = HKThemeMode.DARK; // Force dark theme
|
|
23
|
+
* // or
|
|
24
|
+
* configDictionary["themeMode"] = HKThemeMode.LIGHT; // Force light theme
|
|
25
|
+
*
|
|
26
|
+
* HyperKyc.launch(configDictionary, (response) => console.log(response));
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare enum HKThemeMode {
|
|
30
|
+
/** Force light theme regardless of system settings */
|
|
31
|
+
LIGHT = "LIGHT",
|
|
32
|
+
/** Force dark theme regardless of system settings */
|
|
33
|
+
DARK = "DARK",
|
|
34
|
+
/** Follow the device's system theme settings */
|
|
35
|
+
SYSTEM = "SYSTEM"
|
|
36
|
+
}
|
|
37
|
+
export default HKThemeMode;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { HKThemeMode } from './HyperKycThemeMode';
|
|
1
2
|
export declare const addEventListener: typeof import("./HyperKycEvents").addEventListener, removeAllEventListeners: typeof import("./HyperKycEvents").removeAllEventListeners;
|
|
3
|
+
export { HKThemeMode };
|
|
2
4
|
export declare function multiply(a: number, b: number): Promise<number>;
|
|
3
5
|
declare const _default: any;
|
|
4
6
|
export default _default;
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.static_framework = true
|
|
18
18
|
|
|
19
19
|
s.dependency "React-Core"
|
|
20
|
-
s.dependency "HyperKYC", "1.
|
|
20
|
+
s.dependency "HyperKYC", "1.9.0"
|
|
21
21
|
# Need these lines to support HyperKYC framework
|
|
22
22
|
s.preserve_paths = 'HyperKYC.framework'
|
|
23
23
|
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework HyperKYC' }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// src/HyperKycThemeMode.ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Theme mode for the HyperKyc SDK.
|
|
5
|
+
*
|
|
6
|
+
* This enum specifies how the SDK should handle theming:
|
|
7
|
+
* - `LIGHT`: Force light theme regardless of system settings
|
|
8
|
+
* - `DARK`: Force dark theme regardless of system settings
|
|
9
|
+
* - `SYSTEM`: Follow the device's system theme settings
|
|
10
|
+
*
|
|
11
|
+
* The values are the strings sent over the bridge to the native SDKs.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* ```js
|
|
15
|
+
* import HyperKyc, { HKThemeMode } from 'react-native-hyperkyc-sdk';
|
|
16
|
+
*
|
|
17
|
+
* const configDictionary = {};
|
|
18
|
+
* configDictionary["appId"] = appId;
|
|
19
|
+
* configDictionary["appKey"] = appKey;
|
|
20
|
+
* configDictionary["workflowId"] = workflowId;
|
|
21
|
+
* configDictionary["transactionId"] = transactionId;
|
|
22
|
+
* configDictionary["themeMode"] = HKThemeMode.SYSTEM; // Follow system theme
|
|
23
|
+
* // or
|
|
24
|
+
* configDictionary["themeMode"] = HKThemeMode.DARK; // Force dark theme
|
|
25
|
+
* // or
|
|
26
|
+
* configDictionary["themeMode"] = HKThemeMode.LIGHT; // Force light theme
|
|
27
|
+
*
|
|
28
|
+
* HyperKyc.launch(configDictionary, (response) => console.log(response));
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export enum HKThemeMode {
|
|
32
|
+
/** Force light theme regardless of system settings */
|
|
33
|
+
LIGHT = 'LIGHT',
|
|
34
|
+
|
|
35
|
+
/** Force dark theme regardless of system settings */
|
|
36
|
+
DARK = 'DARK',
|
|
37
|
+
|
|
38
|
+
/** Follow the device's system theme settings */
|
|
39
|
+
SYSTEM = 'SYSTEM',
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default HKThemeMode;
|
package/src/index.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/index.tsx
|
|
2
2
|
import { NativeModules, Platform } from 'react-native';
|
|
3
3
|
import HyperKycEvents from './HyperKycEvents';
|
|
4
|
+
import { HKThemeMode } from './HyperKycThemeMode';
|
|
4
5
|
|
|
5
6
|
const LINKING_ERROR =
|
|
6
7
|
`The package 'react-native-hyperkyc-sdk' doesn't seem to be linked. Make sure: \n\n` +
|
|
@@ -21,6 +22,9 @@ const HyperkycSdk = NativeModules.HyperkycSdk
|
|
|
21
22
|
|
|
22
23
|
export const { addEventListener, removeAllEventListeners } = HyperKycEvents;
|
|
23
24
|
|
|
25
|
+
// Export HKThemeMode so clients can access it
|
|
26
|
+
export { HKThemeMode };
|
|
27
|
+
|
|
24
28
|
// Export any native methods if needed
|
|
25
29
|
export function multiply(a: number, b: number): Promise<number> {
|
|
26
30
|
return HyperkycSdk.multiply(a, b);
|
|
@@ -31,4 +35,5 @@ export default {
|
|
|
31
35
|
...HyperkycSdk,
|
|
32
36
|
addEventListener,
|
|
33
37
|
removeAllEventListeners,
|
|
38
|
+
HKThemeMode,
|
|
34
39
|
};
|