@rownd/react-native 3.3.0 → 4.0.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/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
- package/android/build.gradle +4 -4
- package/android/gradle.properties +5 -5
- package/android/src/main/java/com/reactnativerowndplugin/RowndPluginModule.kt +2 -5
- package/android/src/main/java/com/reactnativerowndplugin/RowndPluginPackage.kt +0 -2
- package/expo/plugin.js +8 -8
- package/ios/RowndPlugin.swift +84 -55
- package/lib/commonjs/components/GlobalContext.js +4 -5
- package/lib/commonjs/components/GlobalContext.js.map +1 -1
- package/lib/commonjs/components/GlobalContext.web.js +1 -1
- package/lib/commonjs/components/GlobalContext.web.js.map +1 -1
- package/lib/commonjs/components/RequireSignIn.js +2 -3
- package/lib/commonjs/components/RequireSignIn.js.map +1 -1
- package/lib/commonjs/components/SignedIn.js +1 -1
- package/lib/commonjs/components/SignedIn.js.map +1 -1
- package/lib/commonjs/components/SignedOut.js +1 -1
- package/lib/commonjs/components/SignedOut.js.map +1 -1
- package/lib/commonjs/constants/action.js +3 -3
- package/lib/commonjs/constants/action.js.map +1 -1
- package/lib/commonjs/hooks/rownd.js.map +1 -1
- package/lib/commonjs/hooks/rownd.web.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/reducer/rowndReducer.js.map +1 -1
- package/lib/commonjs/utils/nativeModule.js.map +1 -1
- package/lib/module/components/GlobalContext.js +4 -4
- package/lib/module/components/GlobalContext.js.map +1 -1
- package/lib/module/components/GlobalContext.web.js.map +1 -1
- package/lib/module/components/RequireSignIn.js +1 -1
- package/lib/module/components/RequireSignIn.js.map +1 -1
- package/lib/module/components/SignedIn.js.map +1 -1
- package/lib/module/components/SignedOut.js.map +1 -1
- package/lib/module/constants/action.js +3 -3
- package/lib/module/constants/action.js.map +1 -1
- package/lib/module/hooks/rownd.js.map +1 -1
- package/lib/module/hooks/rownd.web.js.map +1 -1
- package/lib/module/reducer/rowndReducer.js.map +1 -1
- package/lib/module/utils/nativeModule.js.map +1 -1
- package/package.json +2 -9
- package/rownd-react-native.podspec +13 -11
- package/src/components/GlobalContext.tsx +5 -7
- package/src/components/GlobalContext.web.tsx +1 -4
- package/src/components/RequireSignIn.tsx +1 -1
- package/src/components/SignedIn.tsx +1 -1
- package/src/components/SignedOut.tsx +2 -2
- package/src/hooks/rownd.ts +14 -5
- package/src/hooks/rownd.web.ts +2 -2
- package/src/reducer/rowndReducer.ts +2 -2
- package/src/utils/nativeModule.ts +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build.gradle
CHANGED
|
@@ -54,8 +54,8 @@ android {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
compileOptions {
|
|
57
|
-
sourceCompatibility JavaVersion.
|
|
58
|
-
targetCompatibility JavaVersion.
|
|
57
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
58
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -136,8 +136,8 @@ dependencies {
|
|
|
136
136
|
//noinspection GradleDynamicVersion
|
|
137
137
|
implementation "com.facebook.react:react-native:+"
|
|
138
138
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
139
|
-
implementation 'io.rownd:android:
|
|
140
|
-
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.
|
|
139
|
+
implementation 'io.rownd:android:4.1.0'
|
|
140
|
+
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0"
|
|
141
141
|
implementation 'androidx.compose.ui:ui-unit:1.3.0'
|
|
142
142
|
implementation 'androidx.compose.ui:ui-graphics:1.3.0'
|
|
143
143
|
// From node_modules
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
RowndPlugin_kotlinVersion=
|
|
2
|
-
RowndPlugin_minSdkVersion=
|
|
3
|
-
RowndPlugin_targetSdkVersion=
|
|
4
|
-
RowndPlugin_compileSdkVersion=
|
|
5
|
-
RowndPlugin_ndkversion=
|
|
1
|
+
RowndPlugin_kotlinVersion=2.0.21
|
|
2
|
+
RowndPlugin_minSdkVersion=26
|
|
3
|
+
RowndPlugin_targetSdkVersion=35
|
|
4
|
+
RowndPlugin_compileSdkVersion=35
|
|
5
|
+
RowndPlugin_ndkversion=26.1.10909125
|
|
@@ -14,13 +14,9 @@ import io.rownd.android.*
|
|
|
14
14
|
import io.rownd.android.Rownd
|
|
15
15
|
import io.rownd.android.RowndSignInHint
|
|
16
16
|
import io.rownd.android.RowndSignInOptions
|
|
17
|
-
import io.rownd.android.models.ConnectionActionPayload
|
|
18
|
-
import io.rownd.android.models.FirebaseGetIdTokenResponse
|
|
19
17
|
import io.rownd.android.models.RowndCustomizations
|
|
20
18
|
import io.rownd.android.models.repos.GlobalState
|
|
21
|
-
import io.rownd.android.util.RowndException
|
|
22
19
|
import kotlinx.coroutines.*
|
|
23
|
-
import kotlinx.serialization.SerialName
|
|
24
20
|
import kotlinx.serialization.json.Json
|
|
25
21
|
|
|
26
22
|
class AppCustomizations(app: FragmentActivity) : RowndCustomizations() {
|
|
@@ -180,8 +176,9 @@ class RowndPluginModule(reactContext: ReactApplicationContext) : ReactContextBas
|
|
|
180
176
|
}
|
|
181
177
|
|
|
182
178
|
@ReactMethod
|
|
179
|
+
@Suppress("UNCHECKED_CAST")
|
|
183
180
|
fun setUserData(data: ReadableMap) {
|
|
184
|
-
Rownd.user.set(data.toHashMap())
|
|
181
|
+
Rownd.user.set(data.toHashMap() as Map<String, Any>)
|
|
185
182
|
}
|
|
186
183
|
|
|
187
184
|
@ReactMethod
|
package/expo/plugin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const { withMainActivity, withInfoPlist } = require('expo/config-plugins');
|
|
2
2
|
|
|
3
3
|
const withRowndMainActivity = (config) => {
|
|
4
|
-
return withMainActivity(config, async (
|
|
5
|
-
let mainActivityString =
|
|
4
|
+
return withMainActivity(config, async (actConfig) => {
|
|
5
|
+
let mainActivityString = actConfig.modResults.contents;
|
|
6
6
|
|
|
7
7
|
if (!mainActivityString.includes('RowndPluginPackage.preInit')) {
|
|
8
8
|
const regex = /super.onCreate\(\w+\);?/;
|
|
@@ -25,9 +25,9 @@ const withRowndMainActivity = (config) => {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const newConfig = {
|
|
28
|
-
...
|
|
28
|
+
...actConfig,
|
|
29
29
|
modResults: {
|
|
30
|
-
...
|
|
30
|
+
...actConfig.modResults,
|
|
31
31
|
contents: mainActivityString,
|
|
32
32
|
},
|
|
33
33
|
};
|
|
@@ -37,9 +37,9 @@ const withRowndMainActivity = (config) => {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
const withRowndPlist = (config) => {
|
|
40
|
-
return withInfoPlist(config, async (
|
|
40
|
+
return withInfoPlist(config, async (actConfig) => {
|
|
41
41
|
const LSApplicationQueriesSchemes =
|
|
42
|
-
|
|
42
|
+
actConfig.modResults?.LSApplicationQueriesSchemes || [];
|
|
43
43
|
const additionalSchemes = ['googlegmail', 'ms-outlook', 'ymail'];
|
|
44
44
|
additionalSchemes.forEach((scheme) => {
|
|
45
45
|
if (!LSApplicationQueriesSchemes.includes(scheme)) {
|
|
@@ -48,9 +48,9 @@ const withRowndPlist = (config) => {
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
return {
|
|
51
|
-
...
|
|
51
|
+
...actConfig,
|
|
52
52
|
modResults: {
|
|
53
|
-
...
|
|
53
|
+
...actConfig?.modResults,
|
|
54
54
|
LSApplicationQueriesSchemes,
|
|
55
55
|
},
|
|
56
56
|
};
|
package/ios/RowndPlugin.swift
CHANGED
|
@@ -1,56 +1,76 @@
|
|
|
1
|
-
import Rownd
|
|
2
|
-
import SwiftUI
|
|
3
|
-
import Combine
|
|
4
1
|
import AnyCodable
|
|
2
|
+
import Combine
|
|
5
3
|
import Lottie
|
|
4
|
+
import Rownd
|
|
5
|
+
import SwiftUI
|
|
6
6
|
|
|
7
7
|
@objc(RowndPlugin)
|
|
8
8
|
class RowndPlugin: NSObject {
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
private var state: ObservableState<RowndState>? = nil
|
|
11
11
|
|
|
12
12
|
private var stateCancellable: AnyCancellable?
|
|
13
13
|
|
|
14
14
|
override init() {
|
|
15
15
|
super.init()
|
|
16
|
+
}
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} catch {
|
|
21
|
-
print("Failed to encode Rownd state: \(String(describing: error))")
|
|
22
|
-
}
|
|
23
|
-
}
|
|
18
|
+
deinit {
|
|
19
|
+
// Cancel the state subscription to prevent memory leaks
|
|
20
|
+
stateCancellable?.cancel()
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
@objc(configure:withResolver:withRejecter:)
|
|
27
|
-
func configure(
|
|
28
|
-
|
|
24
|
+
func configure(
|
|
25
|
+
config: NSDictionary, resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock
|
|
26
|
+
) {
|
|
27
|
+
|
|
29
28
|
if let apiUrl = config.value(forKey: "apiUrl") as? String {
|
|
30
29
|
Rownd.config.apiUrl = apiUrl
|
|
31
30
|
}
|
|
32
|
-
|
|
31
|
+
|
|
33
32
|
if let baseUrl = config.value(forKey: "baseUrl") as? String {
|
|
34
33
|
Rownd.config.baseUrl = baseUrl
|
|
35
34
|
}
|
|
36
|
-
|
|
35
|
+
|
|
37
36
|
if let appKey = config.value(forKey: "appKey") as? String {
|
|
38
37
|
Task {
|
|
39
|
-
await Rownd.configure(launchOptions: nil, appKey: appKey)
|
|
38
|
+
await Rownd.configure(launchOptions: nil, appKey: appKey)
|
|
40
39
|
}
|
|
41
40
|
resolve(appKey)
|
|
41
|
+
|
|
42
|
+
// Initialize state and sink after Rownd is configured.
|
|
43
|
+
// Note: Subsequent calls to configure() will not reinitialize the state subscription
|
|
44
|
+
// if it has already been initialized. This is intentional to prevent duplicate subscriptions.
|
|
45
|
+
if self.state == nil {
|
|
46
|
+
let initializedState = Rownd.getInstance().state().subscribe { $0 }
|
|
47
|
+
self.state = initializedState
|
|
48
|
+
self.stateCancellable = initializedState.$current.sink { newState in
|
|
49
|
+
do {
|
|
50
|
+
RowndPluginEventEmitter.emitter.sendEvent(
|
|
51
|
+
withName: "update_state", body: try newState.toDictionary())
|
|
52
|
+
} catch {
|
|
53
|
+
print("Failed to encode Rownd state: \(String(describing: error))")
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
42
57
|
}
|
|
43
58
|
}
|
|
44
59
|
|
|
45
60
|
@objc(customizations:)
|
|
46
|
-
func customizations(customizations: NSDictionary)
|
|
61
|
+
func customizations(customizations: NSDictionary) {
|
|
47
62
|
let appCustomizations = AppCustomizations()
|
|
48
63
|
|
|
49
|
-
if let sheetBackgroundColor = customizations.value(forKey: "sheetBackgroundHexColor")
|
|
50
|
-
|
|
64
|
+
if let sheetBackgroundColor = customizations.value(forKey: "sheetBackgroundHexColor")
|
|
65
|
+
as? String
|
|
66
|
+
{
|
|
67
|
+
appCustomizations.reactNativeSheetBackgroundColor = colorWithHexString(
|
|
68
|
+
hexString: sheetBackgroundColor)
|
|
51
69
|
}
|
|
52
70
|
|
|
53
|
-
if let sheetCornerBorderRadius = customizations.value(forKey: "sheetCornerBorderRadius")
|
|
71
|
+
if let sheetCornerBorderRadius = customizations.value(forKey: "sheetCornerBorderRadius")
|
|
72
|
+
as? String
|
|
73
|
+
{
|
|
54
74
|
if let doubleValue = Double(sheetCornerBorderRadius) {
|
|
55
75
|
appCustomizations.sheetCornerBorderRadius = CGFloat(doubleValue)
|
|
56
76
|
}
|
|
@@ -71,14 +91,14 @@ class RowndPlugin: NSObject {
|
|
|
71
91
|
}
|
|
72
92
|
|
|
73
93
|
@objc(requestSignIn:)
|
|
74
|
-
func requestSignIn(signInConfig: NSDictionary)
|
|
75
|
-
|
|
94
|
+
func requestSignIn(signInConfig: NSDictionary) {
|
|
95
|
+
|
|
76
96
|
var rowndSignInOptions = RowndSignInOptions()
|
|
77
|
-
|
|
97
|
+
|
|
78
98
|
if let postSignInRedirect = signInConfig.value(forKey: "postSignInRedirect") as? String {
|
|
79
99
|
rowndSignInOptions.postSignInRedirect = postSignInRedirect
|
|
80
100
|
}
|
|
81
|
-
|
|
101
|
+
|
|
82
102
|
if let intentString = signInConfig.value(forKey: "intent") as? String {
|
|
83
103
|
if let intent = RowndSignInIntent(rawValue: intentString) {
|
|
84
104
|
rowndSignInOptions.intent = intent
|
|
@@ -86,9 +106,8 @@ class RowndPlugin: NSObject {
|
|
|
86
106
|
print("Rownd plugin. An incorrect intent type was used: \(intentString)")
|
|
87
107
|
}
|
|
88
108
|
}
|
|
89
|
-
|
|
90
109
|
|
|
91
|
-
func requestSignInHub()
|
|
110
|
+
func requestSignInHub() {
|
|
92
111
|
DispatchQueue.main.async {
|
|
93
112
|
Rownd.requestSignIn(rowndSignInOptions)
|
|
94
113
|
}
|
|
@@ -97,19 +116,23 @@ class RowndPlugin: NSObject {
|
|
|
97
116
|
switch method {
|
|
98
117
|
case "apple":
|
|
99
118
|
DispatchQueue.main.async {
|
|
100
|
-
Rownd.requestSignIn(
|
|
119
|
+
Rownd.requestSignIn(
|
|
120
|
+
with: RowndSignInHint.appleId, signInOptions: rowndSignInOptions)
|
|
101
121
|
}
|
|
102
122
|
case "google":
|
|
103
123
|
DispatchQueue.main.async {
|
|
104
|
-
Rownd.requestSignIn(
|
|
124
|
+
Rownd.requestSignIn(
|
|
125
|
+
with: RowndSignInHint.googleId, signInOptions: rowndSignInOptions)
|
|
105
126
|
}
|
|
106
127
|
case "guest":
|
|
107
128
|
DispatchQueue.main.async {
|
|
108
|
-
Rownd.requestSignIn(
|
|
129
|
+
Rownd.requestSignIn(
|
|
130
|
+
with: RowndSignInHint.guest, signInOptions: rowndSignInOptions)
|
|
109
131
|
}
|
|
110
132
|
case "passkey":
|
|
111
133
|
DispatchQueue.main.async {
|
|
112
|
-
Rownd.requestSignIn(
|
|
134
|
+
Rownd.requestSignIn(
|
|
135
|
+
with: RowndSignInHint.passkey, signInOptions: rowndSignInOptions)
|
|
113
136
|
}
|
|
114
137
|
default:
|
|
115
138
|
requestSignInHub()
|
|
@@ -120,24 +143,27 @@ class RowndPlugin: NSObject {
|
|
|
120
143
|
}
|
|
121
144
|
|
|
122
145
|
@objc
|
|
123
|
-
func signOut()
|
|
146
|
+
func signOut() {
|
|
124
147
|
DispatchQueue.main.async {
|
|
125
148
|
Rownd.signOut()
|
|
126
149
|
}
|
|
127
150
|
}
|
|
128
151
|
|
|
129
152
|
@objc
|
|
130
|
-
func manageAccount()
|
|
153
|
+
func manageAccount() {
|
|
131
154
|
DispatchQueue.main.async {
|
|
132
155
|
Rownd.manageAccount()
|
|
133
156
|
}
|
|
134
157
|
}
|
|
135
158
|
|
|
136
159
|
@objc(getAccessToken:withResolver:withRejecter:)
|
|
137
|
-
func getAccessToken(
|
|
160
|
+
func getAccessToken(
|
|
161
|
+
token: String?, resolve: @escaping RCTPromiseResolveBlock,
|
|
162
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
163
|
+
) {
|
|
138
164
|
Task {
|
|
139
165
|
do {
|
|
140
|
-
|
|
166
|
+
var accessToken: String?
|
|
141
167
|
if let token = token {
|
|
142
168
|
accessToken = try await Rownd.getAccessToken(token: token)
|
|
143
169
|
} else {
|
|
@@ -145,49 +171,52 @@ class RowndPlugin: NSObject {
|
|
|
145
171
|
}
|
|
146
172
|
resolve(accessToken ?? "")
|
|
147
173
|
} catch {
|
|
148
|
-
reject("Error","\(error)",error)
|
|
174
|
+
reject("Error", "\(error)", error)
|
|
149
175
|
}
|
|
150
176
|
}
|
|
151
177
|
}
|
|
152
|
-
|
|
178
|
+
|
|
153
179
|
@objc(getFirebaseIdToken:withRejecter:)
|
|
154
|
-
func getFirebaseIdToken(
|
|
180
|
+
func getFirebaseIdToken(
|
|
181
|
+
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
182
|
+
) {
|
|
155
183
|
Task {
|
|
156
184
|
do {
|
|
157
185
|
let idToken = try await Rownd.firebase.getIdToken()
|
|
158
186
|
resolve(idToken)
|
|
159
187
|
} catch {
|
|
160
|
-
reject("Error","\(error)",error)
|
|
188
|
+
reject("Error", "\(error)", error)
|
|
161
189
|
}
|
|
162
190
|
}
|
|
163
191
|
}
|
|
164
192
|
|
|
165
193
|
@objc(setUserData:)
|
|
166
|
-
func setUserData(data:
|
|
194
|
+
func setUserData(data: [String: Any]) {
|
|
167
195
|
do {
|
|
168
|
-
|
|
169
|
-
let
|
|
170
|
-
let
|
|
171
|
-
|
|
172
|
-
|
|
196
|
+
// Convert to JSON and back to get proper types
|
|
197
|
+
let jsonData = try JSONSerialization.data(withJSONObject: data, options: [])
|
|
198
|
+
let jsonObject = try JSONSerialization.jsonObject(with: jsonData, options: [])
|
|
199
|
+
|
|
200
|
+
// Try to cast to the expected type
|
|
201
|
+
if let dictionary = jsonObject as? [String: Any] {
|
|
202
|
+
// Convert each value to AnyCodable and set individually
|
|
203
|
+
for (key, value) in dictionary {
|
|
204
|
+
Rownd.user.set(field: key, value: AnyCodable(value))
|
|
205
|
+
}
|
|
206
|
+
}
|
|
173
207
|
} catch {
|
|
174
|
-
print("FAILED TO SET USER DATA: ",error)
|
|
208
|
+
print("FAILED TO SET USER DATA: ", error)
|
|
175
209
|
}
|
|
176
210
|
}
|
|
177
211
|
|
|
178
212
|
@objc(setUserDataValue:withValue:)
|
|
179
|
-
func setUserDataValue(key: String, value: Any)
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
""".data(using: .utf8)!
|
|
183
|
-
|
|
184
|
-
let decoder = JSONDecoder()
|
|
185
|
-
let dictionary = try! decoder.decode(AnyCodable.self, from: json)
|
|
186
|
-
Rownd.user.set(field: key, value: dictionary)
|
|
213
|
+
func setUserDataValue(key: String, value: Any) {
|
|
214
|
+
// Convert value to AnyCodable
|
|
215
|
+
Rownd.user.set(field: key, value: AnyCodable(value))
|
|
187
216
|
}
|
|
188
217
|
|
|
189
218
|
@objc(handleSignInLink:)
|
|
190
|
-
func handleSignInLink(url: String)
|
|
191
|
-
Rownd.
|
|
219
|
+
func handleSignInLink(url: String) {
|
|
220
|
+
Rownd.handleSmartLink(url: URL(string: url))
|
|
192
221
|
}
|
|
193
222
|
}
|
|
@@ -11,10 +11,9 @@ var _rowndReducer = require("../reducer/rowndReducer");
|
|
|
11
11
|
var _nativeModule = _interopRequireWildcard(require("../utils/nativeModule"));
|
|
12
12
|
var NativeRowndModules = _nativeModule;
|
|
13
13
|
var _action = require("../constants/action");
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
_reactNative.
|
|
17
|
-
_reactNative.YellowBox.ignoreWarnings(['YellowBox has been replaced with LogBox.']);
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
+
_reactNative.LogBox.ignoreLogs(['Sending `update_state` with no listeners registered.']);
|
|
16
|
+
_reactNative.LogBox.ignoreLogs(['YellowBox has been replaced with LogBox.']);
|
|
18
17
|
const GlobalContext = exports.GlobalContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
19
18
|
const eventEmitter = new _reactNative.NativeEventEmitter(_nativeModule.IOSRowndEventEmitter || _nativeModule.Rownd);
|
|
20
19
|
const RowndProvider = ({
|
|
@@ -32,7 +31,7 @@ const RowndProvider = ({
|
|
|
32
31
|
if (customizations) {
|
|
33
32
|
NativeRowndModules.customizations(customizations);
|
|
34
33
|
}
|
|
35
|
-
}, [config
|
|
34
|
+
}, [config, customizations]);
|
|
36
35
|
(0, _react.useEffect)(() => {
|
|
37
36
|
const onSessionConnect = event => {
|
|
38
37
|
dispatch({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_rowndReducer","_nativeModule","NativeRowndModules","_action","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_rowndReducer","_nativeModule","NativeRowndModules","_action","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","LogBox","ignoreLogs","GlobalContext","exports","createContext","undefined","eventEmitter","NativeEventEmitter","IOSRowndEventEmitter","Rownd","RowndProvider","children","config","customizations","state","dispatch","useReducer","rowndReducer","initialRowndState","value","useEffect","configure","onSessionConnect","event","type","ActionType","UPDATE_STATE","payload","Platform","OS","JSON","parse","subscription","addListener","remove","Linking","addEventListener","handleSignInLink","url","initialUrl","getInitialURL","createElement","Provider","useRowndContext","context","useContext","Error"],"sources":["GlobalContext.tsx"],"sourcesContent":["import React, {\n useReducer,\n createContext,\n FunctionComponent,\n useEffect,\n useContext,\n} from 'react';\nimport { NativeEventEmitter, LogBox, Platform, Linking } from 'react-native';\nimport { initialRowndState, rowndReducer } from '../reducer/rowndReducer';\n\nimport * as NativeRowndModules from '../utils/nativeModule';\nimport { Rownd, IOSRowndEventEmitter } from '../utils/nativeModule';\nimport type { ContextProps, GlobalState } from './GlobalContext.types';\nimport type { TAction } from '../constants/action';\nimport { ActionType } from '../constants/action';\n\nLogBox.ignoreLogs(['Sending `update_state` with no listeners registered.']);\nLogBox.ignoreLogs(['YellowBox has been replaced with LogBox.']);\n\nexport const GlobalContext = createContext<\n { state: GlobalState; dispatch: React.Dispatch<TAction> } | undefined\n>(undefined);\n\nconst eventEmitter = new NativeEventEmitter(IOSRowndEventEmitter || Rownd);\n\nconst RowndProvider: FunctionComponent<ContextProps> = ({\n children,\n config,\n customizations,\n}) => {\n const [state, dispatch] = useReducer(rowndReducer, initialRowndState);\n const value = { state, dispatch };\n\n useEffect(() => {\n NativeRowndModules.configure(config);\n if (customizations) {\n NativeRowndModules.customizations(customizations);\n }\n }, [config, customizations]);\n\n useEffect(() => {\n const onSessionConnect = (event: any) => {\n dispatch({\n type: ActionType.UPDATE_STATE,\n payload: Platform.OS === 'android' ? JSON.parse(event.state) : event,\n });\n };\n const subscription = eventEmitter.addListener(\n 'update_state',\n onSessionConnect\n );\n\n if (!subscription) return;\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n // Handle deep linking\n useEffect(() => {\n if (Platform.OS !== 'ios') {\n return;\n }\n\n Linking.addEventListener('url', (event) =>\n NativeRowndModules.handleSignInLink(event.url)\n );\n\n (async () => {\n const initialUrl = await Linking.getInitialURL();\n if (initialUrl) {\n NativeRowndModules.handleSignInLink(initialUrl);\n }\n })();\n }, []);\n\n return (\n <GlobalContext.Provider value={value}>{children}</GlobalContext.Provider>\n );\n};\n\nfunction useRowndContext() {\n const context = useContext(GlobalContext);\n\n if (context === undefined) {\n throw new Error(\n 'useGlobalContext must be used within a GlobalContext Provider'\n );\n }\n\n return context;\n}\n\nexport { RowndProvider, useRowndContext };\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAA4D,IAAAI,kBAAA,GAAAD,aAAA;AAI5D,IAAAE,OAAA,GAAAL,OAAA;AAAiD,SAAAD,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA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D;IACF,CAAC,EAAE,CAAC;EACN,CAAC,EAAE,EAAE,CAAC;EAEN,oBACElE,MAAA,CAAAkB,OAAA,CAAAkD,aAAA,CAACvC,aAAa,CAACwC,QAAQ;IAACvB,KAAK,EAAEA;EAAM,GAAER,QAAiC,CAAC;AAE7E,CAAC;AAACR,OAAA,CAAAO,aAAA,GAAAA,aAAA;AAEF,SAASiC,eAAeA,CAAA,EAAG;EACzB,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAAC3C,aAAa,CAAC;EAEzC,IAAI0C,OAAO,KAAKvC,SAAS,EAAE;IACzB,MAAM,IAAIyC,KAAK,CACb,+DACF,CAAC;EACH;EAEA,OAAOF,OAAO;AAChB","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.RowndProvider = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _react2 = require("@rownd/react");
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
const RowndProvider = ({
|
|
11
11
|
children,
|
|
12
12
|
config
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_react2","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_react2","e","__esModule","default","RowndProvider","children","config","createElement","appKey","apiUrl","exports"],"sources":["GlobalContext.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { ContextProps } from './GlobalContext.types';\nimport { RowndProvider as RowndReactProvider } from '@rownd/react';\n\nconst RowndProvider: React.FC<ContextProps> = ({ children, config }) => {\n return (\n <RowndReactProvider appKey={config.appKey} apiUrl={config.apiUrl}>\n {children}\n </RowndReactProvider>\n );\n};\n\nexport { RowndProvider };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAAmE,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnE,MAAMG,aAAqC,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAK;EACtE,oBACET,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAACP,OAAA,CAAAI,aAAkB;IAACI,MAAM,EAAEF,MAAM,CAACE,MAAO;IAACC,MAAM,EAAEH,MAAM,CAACG;EAAO,GAC9DJ,QACiB,CAAC;AAEzB,CAAC;AAACK,OAAA,CAAAN,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -7,8 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _rownd = require("../hooks/rownd");
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
|
-
function
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
11
|
const RequireSignIn = ({
|
|
13
12
|
children,
|
|
14
13
|
initializing,
|
|
@@ -28,7 +27,7 @@ const RequireSignIn = ({
|
|
|
28
27
|
...signInProps
|
|
29
28
|
});
|
|
30
29
|
}
|
|
31
|
-
}, [is_authenticated, is_initializing, signInProps]);
|
|
30
|
+
}, [is_authenticated, is_initializing, signInProps, requestSignIn]);
|
|
32
31
|
if (is_initializing && initializing) {
|
|
33
32
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, initializing);
|
|
34
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_rownd","_reactNative","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_rownd","_reactNative","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","RequireSignIn","children","initializing","signInProps","is_authenticated","is_initializing","requestSignIn","useRownd","useEffect","Platform","OS","prevent_closing","undefined","createElement","Fragment","_default","exports"],"sources":["RequireSignIn.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { useRownd } from '../hooks/rownd';\nimport type { RequestSignIn } from '../hooks/rownd';\nimport { Platform } from 'react-native';\n\nexport type ContextProps = {\n children?: React.ReactNode;\n initializing?: React.ReactNode;\n signInProps?: RequestSignIn;\n};\n\nconst RequireSignIn: React.FC<ContextProps> = ({\n children,\n initializing,\n signInProps,\n}) => {\n const { is_authenticated, is_initializing, requestSignIn } = useRownd();\n\n useEffect(() => {\n if (!is_authenticated && !is_initializing) {\n requestSignIn({\n ...(Platform.OS === 'web' ? { prevent_closing: true } : undefined),\n ...signInProps,\n });\n }\n }, [is_authenticated, is_initializing, signInProps, requestSignIn]);\n\n if (is_initializing && initializing) {\n return <>{initializing}</>;\n }\n\n return <>{children}</>;\n};\n\nexport default RequireSignIn;\n"],"mappings":";;;;;;AAAA,IAAAA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vE,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAI,CAACJ,gBAAgB,IAAI,CAACC,eAAe,EAAE;MACzCC,aAAa,CAAC;QACZ,IAAIG,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG;UAAEC,eAAe,EAAE;QAAK,CAAC,GAAGC,SAAS,CAAC;QAClE,GAAGT;MACL,CAAC,CAAC;IACJ;EACF,CAAC,EAAE,CAACC,gBAAgB,EAAEC,eAAe,EAAEF,WAAW,EAAEG,aAAa,CAAC,CAAC;EAEnE,IAAID,eAAe,IAAIH,YAAY,EAAE;IACnC,oBAAO1B,MAAA,CAAAe,OAAA,CAAAsB,aAAA,CAAArC,MAAA,CAAAe,OAAA,CAAAuB,QAAA,QAAGZ,YAAe,CAAC;EAC5B;EAEA,oBAAO1B,MAAA,CAAAe,OAAA,CAAAsB,aAAA,CAAArC,MAAA,CAAAe,OAAA,CAAAuB,QAAA,QAAGb,QAAW,CAAC;AACxB,CAAC;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAzB,OAAA,GAEaS,aAAa","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _rownd = require("../hooks/rownd");
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
const SignedIn = ({
|
|
11
11
|
children
|
|
12
12
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_rownd","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_rownd","e","__esModule","default","SignedIn","children","is_authenticated","useRownd","createElement","Fragment","_default","exports"],"sources":["SignedIn.tsx"],"sourcesContent":["import React from 'react';\nimport { useRownd } from '../hooks/rownd';\n\ninterface SignedInProps {\n children: React.ReactNode;\n}\n\nconst SignedIn: React.FC<SignedInProps> = ({ children }) => {\n const { is_authenticated } = useRownd();\n\n if (!is_authenticated) {\n return null;\n }\n return <>{children}</>;\n};\n\nexport default SignedIn;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAA0C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAM1C,MAAMG,QAAiC,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EAC1D,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,eAAQ,EAAC,CAAC;EAEvC,IAAI,CAACD,gBAAgB,EAAE;IACrB,OAAO,IAAI;EACb;EACA,oBAAOT,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAAAX,MAAA,CAAAM,OAAA,CAAAM,QAAA,QAAGJ,QAAW,CAAC;AACxB,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEaC,QAAQ","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _rownd = require("../hooks/rownd");
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
const SignedOut = ({
|
|
11
11
|
children
|
|
12
12
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_rownd","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_rownd","e","__esModule","default","SignedOut","children","is_authenticated","useRownd","createElement","Fragment","_default","exports"],"sources":["SignedOut.tsx"],"sourcesContent":["import React from 'react';\nimport { useRownd } from '../hooks/rownd';\n\ninterface SignedOutProps {\n children: React.ReactNode;\n}\n\nconst SignedOut: React.FC<SignedOutProps> = ({ children }) => {\n const { is_authenticated } = useRownd();\n\n if (is_authenticated) {\n return null;\n }\n return <>{children}</>;\n};\n\nexport default SignedOut;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAA0C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAM1C,MAAMG,SAAmC,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EAC5D,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,eAAQ,EAAC,CAAC;EAEvC,IAAID,gBAAgB,EAAE;IACpB,OAAO,IAAI;EACb;EACA,oBAAOT,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAAAX,MAAA,CAAAM,OAAA,CAAAM,QAAA,QAAGJ,QAAW,CAAC;AACxB,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEaC,SAAS","ignoreList":[]}
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ActionType = void 0;
|
|
7
|
-
let ActionType = exports.ActionType =
|
|
8
|
-
(function (ActionType) {
|
|
7
|
+
let ActionType = exports.ActionType = /*#__PURE__*/function (ActionType) {
|
|
9
8
|
ActionType["UPDATE_STATE"] = "UPDATE_STATE";
|
|
10
|
-
|
|
9
|
+
return ActionType;
|
|
10
|
+
}({});
|
|
11
11
|
//# sourceMappingURL=action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ActionType","exports"],"sources":["action.ts"],"sourcesContent":["export enum ActionType {\n UPDATE_STATE = 'UPDATE_STATE',\n}\n\nexport type TAction = {\n type: ActionType;\n payload?: any;\n};\n"],"mappings":";;;;;;IAAYA,UAAU,GAAAC,OAAA,CAAAD,UAAA
|
|
1
|
+
{"version":3,"names":["ActionType","exports"],"sources":["action.ts"],"sourcesContent":["export enum ActionType {\n UPDATE_STATE = 'UPDATE_STATE',\n}\n\nexport type TAction = {\n type: ActionType;\n payload?: any;\n};\n"],"mappings":";;;;;;IAAYA,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_nativeModule","require","_GlobalContext","useRownd","state","useRowndContext","access_token","auth","getAccessToken","firebase","getIdToken","getFirebaseIdToken","is_authenticated","is_initializing","app_id","manageAccount","requestSignIn","signOut","user","data","setValue","setUserDataValue","set","setUserData","isLoading"],"sources":["rownd.ts"],"sourcesContent":["import {\n requestSignIn,\n signOut,\n manageAccount,\n getAccessToken,\n getFirebaseIdToken,\n setUserDataValue,\n setUserData,\n} from '../utils/nativeModule';\nimport { useRowndContext } from '../components/GlobalContext';\n\nexport type TRowndContext = {\n access_token: string | null;\n auth: AuthContext;\n is_authenticated: boolean;\n is_initializing: boolean;\n firebase: {\n getIdToken: () => Promise<string>;\n }
|
|
1
|
+
{"version":3,"names":["_nativeModule","require","_GlobalContext","useRownd","state","useRowndContext","access_token","auth","getAccessToken","firebase","getIdToken","getFirebaseIdToken","is_authenticated","is_initializing","app_id","manageAccount","requestSignIn","signOut","user","data","setValue","setUserDataValue","set","setUserData","isLoading"],"sources":["rownd.ts"],"sourcesContent":["import {\n requestSignIn,\n signOut,\n manageAccount,\n getAccessToken,\n getFirebaseIdToken,\n setUserDataValue,\n setUserData,\n} from '../utils/nativeModule';\nimport { useRowndContext } from '../components/GlobalContext';\n\nexport type TRowndContext = {\n access_token: string | null;\n auth: AuthContext;\n is_authenticated: boolean;\n is_initializing: boolean;\n firebase: {\n getIdToken: () => Promise<string>;\n };\n getAccessToken: (token?: string) => Promise<string>;\n manageAccount: () => void;\n requestSignIn: (e?: RequestSignIn) => void;\n signOut: () => void;\n user: UserContext;\n};\n\ntype UserContext = {\n data: {\n user_id?: string;\n email?: string | null;\n phone?: string | null;\n [key: string]: any;\n };\n set: (data: Record<string, any>) => void;\n setValue: (key: string, value: any) => void;\n isLoading: boolean;\n};\n\ntype AuthContext = {\n access_token: string | null;\n app_id: string | null;\n is_verified_user?: boolean;\n};\n\nexport type RequestSignInMethods =\n | 'google'\n | 'apple'\n | 'default'\n | 'guest'\n | 'passkey';\nexport type RequestSignInIntent = 'sign_in' | 'sign_up';\nexport type RequestSignIn = {\n method?: RequestSignInMethods;\n postSignInRedirect?: string;\n intent?: RequestSignInIntent;\n};\n\nexport function useRownd(): TRowndContext {\n const { state } = useRowndContext();\n\n return {\n access_token: state.auth.access_token,\n auth: state.auth,\n getAccessToken,\n firebase: {\n getIdToken: getFirebaseIdToken,\n },\n is_authenticated: !!state.auth.access_token,\n is_initializing: !state.auth.app_id,\n manageAccount,\n requestSignIn,\n signOut,\n user: {\n data: state.user.data,\n setValue: setUserDataValue,\n set: setUserData,\n isLoading: state.user.isLoading,\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AASA,IAAAC,cAAA,GAAAD,OAAA;AAgDO,SAASE,QAAQA,CAAA,EAAkB;EACxC,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,8BAAe,EAAC,CAAC;EAEnC,OAAO;IACLC,YAAY,EAAEF,KAAK,CAACG,IAAI,CAACD,YAAY;IACrCC,IAAI,EAAEH,KAAK,CAACG,IAAI;IAChBC,cAAc,EAAdA,4BAAc;IACdC,QAAQ,EAAE;MACRC,UAAU,EAAEC;IACd,CAAC;IACDC,gBAAgB,EAAE,CAAC,CAACR,KAAK,CAACG,IAAI,CAACD,YAAY;IAC3CO,eAAe,EAAE,CAACT,KAAK,CAACG,IAAI,CAACO,MAAM;IACnCC,aAAa,EAAbA,2BAAa;IACbC,aAAa,EAAbA,2BAAa;IACbC,OAAO,EAAPA,qBAAO;IACPC,IAAI,EAAE;MACJC,IAAI,EAAEf,KAAK,CAACc,IAAI,CAACC,IAAI;MACrBC,QAAQ,EAAEC,8BAAgB;MAC1BC,GAAG,EAAEC,yBAAW;MAChBC,SAAS,EAAEpB,KAAK,CAACc,IAAI,CAACM;IACxB;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","useRownd","requestSignIn","signOut","getAccessToken","is_authenticated","is_initializing","auth","access_token","user","manageAccount","setUser","setUserValue","useReactRownd","app_id","is_verified_user","opts","post_login_redirect","postSignInRedirect","data","setValue","set","isLoading"],"sources":["rownd.web.ts"],"sourcesContent":["import { useRownd as useReactRownd } from '@rownd/react';\nimport type { TRowndContext } from './rownd';\n\nexport function useRownd(): TRowndContext {\n const {\n requestSignIn,\n signOut,\n getAccessToken,\n is_authenticated,\n is_initializing,\n auth,\n access_token,\n user,\n manageAccount,\n setUser,\n setUserValue
|
|
1
|
+
{"version":3,"names":["_react","require","useRownd","requestSignIn","signOut","getAccessToken","is_authenticated","is_initializing","auth","access_token","user","manageAccount","setUser","setUserValue","useReactRownd","app_id","is_verified_user","opts","post_login_redirect","postSignInRedirect","data","setValue","set","isLoading"],"sources":["rownd.web.ts"],"sourcesContent":["import { useRownd as useReactRownd } from '@rownd/react';\nimport type { TRowndContext } from './rownd';\n\nexport function useRownd(): TRowndContext {\n const {\n requestSignIn,\n signOut,\n getAccessToken,\n is_authenticated,\n is_initializing,\n auth,\n access_token,\n user,\n manageAccount,\n setUser,\n setUserValue,\n } = useReactRownd();\n\n return {\n access_token,\n auth: {\n access_token,\n app_id: auth.app_id || null,\n is_verified_user: auth.is_verified_user,\n },\n // @ts-ignore\n getAccessToken,\n is_authenticated,\n is_initializing,\n manageAccount,\n requestSignIn: (opts) =>\n requestSignIn({ ...opts, post_login_redirect: opts?.postSignInRedirect }),\n signOut,\n user: {\n data: user.data,\n setValue: setUserValue,\n set: setUser,\n isLoading: false, // Waiting for react sdk update\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGO,SAASC,QAAQA,CAAA,EAAkB;EACxC,MAAM;IACJC,aAAa;IACbC,OAAO;IACPC,cAAc;IACdC,gBAAgB;IAChBC,eAAe;IACfC,IAAI;IACJC,YAAY;IACZC,IAAI;IACJC,aAAa;IACbC,OAAO;IACPC;EACF,CAAC,GAAG,IAAAC,eAAa,EAAC,CAAC;EAEnB,OAAO;IACLL,YAAY;IACZD,IAAI,EAAE;MACJC,YAAY;MACZM,MAAM,EAAEP,IAAI,CAACO,MAAM,IAAI,IAAI;MAC3BC,gBAAgB,EAAER,IAAI,CAACQ;IACzB,CAAC;IACD;IACAX,cAAc;IACdC,gBAAgB;IAChBC,eAAe;IACfI,aAAa;IACbR,aAAa,EAAGc,IAAI,IAClBd,aAAa,CAAC;MAAE,GAAGc,IAAI;MAAEC,mBAAmB,EAAED,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEE;IAAmB,CAAC,CAAC;IAC3Ef,OAAO;IACPM,IAAI,EAAE;MACJU,IAAI,EAAEV,IAAI,CAACU,IAAI;MACfC,QAAQ,EAAER,YAAY;MACtBS,GAAG,EAAEV,OAAO;MACZW,SAAS,EAAE,KAAK,CAAE;IACpB;EACF,CAAC;AACH","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -38,5 +38,5 @@ var _rownd = require("./hooks/rownd");
|
|
|
38
38
|
var _RequireSignIn = _interopRequireDefault(require("./components/RequireSignIn"));
|
|
39
39
|
var _SignedIn = _interopRequireDefault(require("./components/SignedIn"));
|
|
40
40
|
var _SignedOut = _interopRequireDefault(require("./components/SignedOut"));
|
|
41
|
-
function _interopRequireDefault(
|
|
41
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
42
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_GlobalContext","require","_rownd","_RequireSignIn","_interopRequireDefault","_SignedIn","_SignedOut","
|
|
1
|
+
{"version":3,"names":["_GlobalContext","require","_rownd","_RequireSignIn","_interopRequireDefault","_SignedIn","_SignedOut","e","__esModule","default"],"sources":["index.tsx"],"sourcesContent":["import { RowndProvider } from './components/GlobalContext';\nimport { useRownd } from './hooks/rownd';\nimport RequireSignIn from './components/RequireSignIn';\nimport SignedIn from './components/SignedIn';\nimport SignedOut from './components/SignedOut';\n\nexport { RowndProvider, useRownd, RequireSignIn, SignedIn, SignedOut };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,UAAA,GAAAF,sBAAA,CAAAH,OAAA;AAA+C,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_action","require","initialRowndState","exports","user","data","email","isLoading","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","_action$payload","_action$payload2","_action$payload3","_action$payload4","_action$payload5","_action$payload6","_action$payload$appCo","newState","type","ActionType","UPDATE_STATE","payload","Boolean","appConfig","id"],"sources":["rowndReducer.ts"],"sourcesContent":["import type { GlobalState } from '../components/GlobalContext.types';\nimport { ActionType, TAction } from '../constants/action';\n\nexport const initialRowndState: GlobalState = {\n // is_initializing: false,\n user: {\n data: {\n email: null,\n },\n isLoading: false
|
|
1
|
+
{"version":3,"names":["_action","require","initialRowndState","exports","user","data","email","isLoading","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","_action$payload","_action$payload2","_action$payload3","_action$payload4","_action$payload5","_action$payload6","_action$payload$appCo","newState","type","ActionType","UPDATE_STATE","payload","Boolean","appConfig","id"],"sources":["rowndReducer.ts"],"sourcesContent":["import type { GlobalState } from '../components/GlobalContext.types';\nimport { ActionType, TAction } from '../constants/action';\n\nexport const initialRowndState: GlobalState = {\n // is_initializing: false,\n user: {\n data: {\n email: null,\n },\n isLoading: false,\n // meta: {}\n },\n auth: {\n access_token: null,\n refresh_token: null,\n app_id: null,\n },\n app: {\n schema: null,\n config: null,\n },\n // is_saving_user_data: false,\n // config,\n};\n\nexport function rowndReducer(state: GlobalState, action: TAction): GlobalState {\n let newState: GlobalState;\n\n switch (action.type) {\n case ActionType.UPDATE_STATE:\n newState = {\n user: {\n data: {\n ...action.payload?.user?.data,\n email: action.payload?.user?.data?.email,\n },\n isLoading: Boolean(action.payload?.user?.isLoading),\n // meta: {}\n },\n auth: {\n access_token: action.payload?.auth?.access_token,\n refresh_token: action.payload?.auth?.refresh_token,\n app_id: action.payload?.appConfig?.id || null,\n },\n app: {\n schema: action.payload.appConfig?.schema,\n config: null,\n },\n // is_saving_user_data: false,\n // config\n };\n return newState;\n default:\n newState = state;\n return newState;\n }\n}\n"],"mappings":";;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,iBAA8B,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC5C;EACAE,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,KAAK,EAAE;IACT,CAAC;IACDC,SAAS,EAAE;IACX;EACF,CAAC;EACDC,IAAI,EAAE;IACJC,YAAY,EAAE,IAAI;IAClBC,aAAa,EAAE,IAAI;IACnBC,MAAM,EAAE;EACV,CAAC;EACDC,GAAG,EAAE;IACHC,MAAM,EAAE,IAAI;IACZC,MAAM,EAAE;EACV;EACA;EACA;AACF,CAAC;AAEM,SAASC,YAAYA,CAACC,KAAkB,EAAEC,MAAe,EAAe;EAAA,IAAAC,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,E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S,EAAE,KAAI;QAC3C,CAAC;QACDpB,GAAG,EAAE;UACHC,MAAM,GAAAW,qBAAA,GAAEP,MAAM,CAACY,OAAO,CAACE,SAAS,cAAAP,qBAAA,uBAAxBA,qBAAA,CAA0BX,MAAM;UACxCC,MAAM,EAAE;QACV;QACA;QACA;MACF,CAAC;MACD,OAAOW,QAAQ;IACjB;MACEA,QAAQ,GAAGT,KAAK;MAChB,OAAOS,QAAQ;EACnB;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","exports","Platform","select","ios","default","Rownd","NativeModules","RowndPlugin","Proxy","get","Error","IOSRowndEventEmitter","OS","RowndPluginEventEmitter","configure","config","customizations","customizationConfig","requestSignIn","method","postSignInRedirect","intent","signOut","manageAccount","getAccessToken","token","getFirebaseIdToken","setUserDataValue","key","value","setUserData","data","handleSignInLink","url"],"sources":["nativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport type { RequestSignIn } from 'src/hooks/rownd';\nimport type { Customizations, IConfig } from './config';\n\nexport const LINKING_ERROR =\n `The package '@rownd/react-native' 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\nexport const Rownd = NativeModules.RowndPlugin\n ? NativeModules.RowndPlugin\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport const IOSRowndEventEmitter =\n Platform.OS !== 'ios'\n ? null\n : NativeModules.RowndPluginEventEmitter\n ? NativeModules.RowndPluginEventEmitter\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function configure(config: IConfig): Promise<string> {\n return Rownd.configure(config);\n}\n\nexport function customizations(customizationConfig: Customizations) {\n return Rownd.customizations(customizationConfig);\n}\n\nexport function requestSignIn(config?: RequestSignIn) {\n if (!config) {\n return Rownd.requestSignIn({ method: 'default' });\n }\n return Rownd.requestSignIn({\n method: config?.method,\n postSignInRedirect: config?.postSignInRedirect,\n intent: config?.intent
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","exports","Platform","select","ios","default","Rownd","NativeModules","RowndPlugin","Proxy","get","Error","IOSRowndEventEmitter","OS","RowndPluginEventEmitter","configure","config","customizations","customizationConfig","requestSignIn","method","postSignInRedirect","intent","signOut","manageAccount","getAccessToken","token","getFirebaseIdToken","setUserDataValue","key","value","setUserData","data","handleSignInLink","url"],"sources":["nativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport type { RequestSignIn } from 'src/hooks/rownd';\nimport type { Customizations, IConfig } from './config';\n\nexport const LINKING_ERROR =\n `The package '@rownd/react-native' 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\nexport const Rownd = NativeModules.RowndPlugin\n ? NativeModules.RowndPlugin\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport const IOSRowndEventEmitter =\n Platform.OS !== 'ios'\n ? null\n : NativeModules.RowndPluginEventEmitter\n ? NativeModules.RowndPluginEventEmitter\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function configure(config: IConfig): Promise<string> {\n return Rownd.configure(config);\n}\n\nexport function customizations(customizationConfig: Customizations) {\n return Rownd.customizations(customizationConfig);\n}\n\nexport function requestSignIn(config?: RequestSignIn) {\n if (!config) {\n return Rownd.requestSignIn({ method: 'default' });\n }\n return Rownd.requestSignIn({\n method: config?.method,\n postSignInRedirect: config?.postSignInRedirect,\n intent: config?.intent,\n });\n}\n\nexport function signOut() {\n return Rownd.signOut();\n}\n\nexport function manageAccount() {\n return Rownd.manageAccount();\n}\n\nexport function getAccessToken(token?: string): Promise<string> {\n return Rownd.getAccessToken(token || null);\n}\n\nexport function getFirebaseIdToken(): Promise<string> {\n return Rownd.getFirebaseIdToken();\n}\n\nexport function setUserDataValue(key: string, value: any) {\n return Rownd.setUserDataValue(\n key,\n Platform.OS === 'android' ? { value } : value\n );\n}\n\nexport function setUserData(data: Record<string, any>) {\n return Rownd.setUserData(data);\n}\n\nexport function handleSignInLink(url: string) {\n return Rownd.handleSignInLink(url);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIO,MAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GACxB,8EAA8E,GAC9EE,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAExC,MAAMC,KAAK,GAAAL,OAAA,CAAAK,KAAA,GAAGC,0BAAa,CAACC,WAAW,GAC1CD,0BAAa,CAACC,WAAW,GACzB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACX,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEE,MAAMY,oBAAoB,GAAAX,OAAA,CAAAW,oBAAA,GAC/BV,qBAAQ,CAACW,EAAE,KAAK,KAAK,GACjB,IAAI,GACJN,0BAAa,CAACO,uBAAuB,GACrCP,0BAAa,CAACO,uBAAuB,GACrC,IAAIL,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACX,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEA,SAASe,SAASA,CAACC,MAAe,EAAmB;EAC1D,OAAOV,KAAK,CAACS,SAAS,CAACC,MAAM,CAAC;AAChC;AAEO,SAASC,cAAcA,CAACC,mBAAmC,EAAE;EAClE,OAAOZ,KAAK,CAACW,cAAc,CAACC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
1
|
import React, { useReducer, createContext, useEffect, useContext } from 'react';
|
|
2
|
-
import { NativeEventEmitter,
|
|
2
|
+
import { NativeEventEmitter, LogBox, Platform, Linking } from 'react-native';
|
|
3
3
|
import { initialRowndState, rowndReducer } from '../reducer/rowndReducer';
|
|
4
4
|
import * as NativeRowndModules from '../utils/nativeModule';
|
|
5
5
|
import { Rownd, IOSRowndEventEmitter } from '../utils/nativeModule';
|
|
6
6
|
import { ActionType } from '../constants/action';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
LogBox.ignoreLogs(['Sending `update_state` with no listeners registered.']);
|
|
8
|
+
LogBox.ignoreLogs(['YellowBox has been replaced with LogBox.']);
|
|
9
9
|
export const GlobalContext = /*#__PURE__*/createContext(undefined);
|
|
10
10
|
const eventEmitter = new NativeEventEmitter(IOSRowndEventEmitter || Rownd);
|
|
11
11
|
const RowndProvider = ({
|
|
@@ -23,7 +23,7 @@ const RowndProvider = ({
|
|
|
23
23
|
if (customizations) {
|
|
24
24
|
NativeRowndModules.customizations(customizations);
|
|
25
25
|
}
|
|
26
|
-
}, [config
|
|
26
|
+
}, [config, customizations]);
|
|
27
27
|
useEffect(() => {
|
|
28
28
|
const onSessionConnect = event => {
|
|
29
29
|
dispatch({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useReducer","createContext","useEffect","useContext","NativeEventEmitter","
|
|
1
|
+
{"version":3,"names":["React","useReducer","createContext","useEffect","useContext","NativeEventEmitter","LogBox","Platform","Linking","initialRowndState","rowndReducer","NativeRowndModules","Rownd","IOSRowndEventEmitter","ActionType","ignoreLogs","GlobalContext","undefined","eventEmitter","RowndProvider","children","config","customizations","state","dispatch","value","configure","onSessionConnect","event","type","UPDATE_STATE","payload","OS","JSON","parse","subscription","addListener","remove","addEventListener","handleSignInLink","url","initialUrl","getInitialURL","createElement","Provider","useRowndContext","context","Error"],"sources":["GlobalContext.tsx"],"sourcesContent":["import React, {\n useReducer,\n createContext,\n FunctionComponent,\n useEffect,\n useContext,\n} from 'react';\nimport { NativeEventEmitter, LogBox, Platform, Linking } from 'react-native';\nimport { initialRowndState, rowndReducer } from '../reducer/rowndReducer';\n\nimport * as NativeRowndModules from '../utils/nativeModule';\nimport { Rownd, IOSRowndEventEmitter } from '../utils/nativeModule';\nimport type { ContextProps, GlobalState } from './GlobalContext.types';\nimport type { TAction } from '../constants/action';\nimport { ActionType } from '../constants/action';\n\nLogBox.ignoreLogs(['Sending `update_state` with no listeners registered.']);\nLogBox.ignoreLogs(['YellowBox has been replaced with LogBox.']);\n\nexport const GlobalContext = createContext<\n { state: GlobalState; dispatch: React.Dispatch<TAction> } | undefined\n>(undefined);\n\nconst eventEmitter = new NativeEventEmitter(IOSRowndEventEmitter || Rownd);\n\nconst RowndProvider: FunctionComponent<ContextProps> = ({\n children,\n config,\n customizations,\n}) => {\n const [state, dispatch] = useReducer(rowndReducer, initialRowndState);\n const value = { state, dispatch };\n\n useEffect(() => {\n NativeRowndModules.configure(config);\n if (customizations) {\n NativeRowndModules.customizations(customizations);\n }\n }, [config, customizations]);\n\n useEffect(() => {\n const onSessionConnect = (event: any) => {\n dispatch({\n type: ActionType.UPDATE_STATE,\n payload: Platform.OS === 'android' ? JSON.parse(event.state) : event,\n });\n };\n const subscription = eventEmitter.addListener(\n 'update_state',\n onSessionConnect\n );\n\n if (!subscription) return;\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n // Handle deep linking\n useEffect(() => {\n if (Platform.OS !== 'ios') {\n return;\n }\n\n Linking.addEventListener('url', (event) =>\n NativeRowndModules.handleSignInLink(event.url)\n );\n\n (async () => {\n const initialUrl = await Linking.getInitialURL();\n if (initialUrl) {\n NativeRowndModules.handleSignInLink(initialUrl);\n }\n })();\n }, []);\n\n return (\n <GlobalContext.Provider value={value}>{children}</GlobalContext.Provider>\n );\n};\n\nfunction useRowndContext() {\n const context = useContext(GlobalContext);\n\n if (context === undefined) {\n throw new Error(\n 'useGlobalContext must be used within a GlobalContext Provider'\n );\n }\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AACyB,EAAE,KAAK,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACN,KAAK,CAACL,KAAK,CAAC,GAAGK;MACjE,CAAC,CAAC;IACJ,CAAC;IACD,MAAMO,YAAY,GAAGjB,YAAY,CAACkB,WAAW,CAC3C,cAAc,EACdT,gBACF,CAAC;IAED,IAAI,CAACQ,YAAY,EAAE;IAEnB,OAAO,MAAM;MACXA,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;;EAEN;EACAlC,SAAS,CAAC,MAAM;IACd,IAAII,QAAQ,CAACyB,EAAE,KAAK,KAAK,EAAE;MACzB;IACF;IAEAxB,OAAO,CAAC8B,gBAAgB,CAAC,KAAK,EAAGV,KAAK,IACpCjB,kBAAkB,CAAC4B,gBAAgB,CAACX,KAAK,CAACY,GAAG,CAC/C,CAAC;IAED,CAAC,YAAY;MACX,MAAMC,UAAU,GAAG,MAAMjC,OAAO,CAACkC,aAAa,CAAC,CAAC;MAChD,IAAID,UAAU,EAAE;QACd9B,kBAAkB,CAAC4B,gBAAgB,CAACE,UAAU,CAAC;MACjD;IACF,CAAC,EAAE,CAAC;EACN,CAAC,EAAE,EAAE,CAAC;EAEN,oBACEzC,KAAA,CAAA2C,aAAA,CAAC3B,aAAa,CAAC4B,QAAQ;IAACnB,KAAK,EAAEA;EAAM,GAAEL,QAAiC,CAAC;AAE7E,CAAC;AAED,SAASyB,eAAeA,CAAA,EAAG;EACzB,MAAMC,OAAO,GAAG1C,UAAU,CAACY,aAAa,CAAC;EAEzC,IAAI8B,OAAO,KAAK7B,SAAS,EAAE;IACzB,MAAM,IAAI8B,KAAK,CACb,+DACF,CAAC;EACH;EAEA,OAAOD,OAAO;AAChB;AAEA,SAAS3B,aAAa,EAAE0B,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","RowndProvider","RowndReactProvider","children","config","createElement","appKey","apiUrl"],"sources":["GlobalContext.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { ContextProps } from './GlobalContext.types';\nimport {
|
|
1
|
+
{"version":3,"names":["React","RowndProvider","RowndReactProvider","children","config","createElement","appKey","apiUrl"],"sources":["GlobalContext.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { ContextProps } from './GlobalContext.types';\nimport { RowndProvider as RowndReactProvider } from '@rownd/react';\n\nconst RowndProvider: React.FC<ContextProps> = ({ children, config }) => {\n return (\n <RowndReactProvider appKey={config.appKey} apiUrl={config.apiUrl}>\n {children}\n </RowndReactProvider>\n );\n};\n\nexport { RowndProvider };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,aAAa,IAAIC,kBAAkB,QAAQ,cAAc;AAElE,MAAMD,aAAqC,GAAGA,CAAC;EAAEE,QAAQ;EAAEC;AAAO,CAAC,KAAK;EACtE,oBACEJ,KAAA,CAAAK,aAAA,CAACH,kBAAkB;IAACI,MAAM,EAAEF,MAAM,CAACE,MAAO;IAACC,MAAM,EAAEH,MAAM,CAACG;EAAO,GAC9DJ,QACiB,CAAC;AAEzB,CAAC;AAED,SAASF,aAAa","ignoreList":[]}
|
|
@@ -20,7 +20,7 @@ const RequireSignIn = ({
|
|
|
20
20
|
...signInProps
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
}, [is_authenticated, is_initializing, signInProps]);
|
|
23
|
+
}, [is_authenticated, is_initializing, signInProps, requestSignIn]);
|
|
24
24
|
if (is_initializing && initializing) {
|
|
25
25
|
return /*#__PURE__*/React.createElement(React.Fragment, null, initializing);
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRownd","Platform","RequireSignIn","children","initializing","signInProps","is_authenticated","is_initializing","requestSignIn","OS","prevent_closing","undefined","createElement","Fragment"],"sources":["RequireSignIn.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { useRownd } from '../hooks/rownd';\nimport type { RequestSignIn } from '../hooks/rownd';\nimport { Platform } from 'react-native';\n\nexport type ContextProps = {\n children?: React.ReactNode;\n initializing?: React.ReactNode;\n signInProps?: RequestSignIn;\n};\n\nconst RequireSignIn: React.FC<ContextProps> = ({\n children,\n initializing,\n signInProps,\n}) => {\n const { is_authenticated, is_initializing, requestSignIn } = useRownd();\n\n useEffect(() => {\n if (!is_authenticated && !is_initializing) {\n requestSignIn({\n ...(Platform.OS === 'web' ? { prevent_closing: true } : undefined),\n ...signInProps,\n });\n }\n }, [is_authenticated, is_initializing, signInProps]);\n\n if (is_initializing && initializing) {\n return <>{initializing}</>;\n }\n\n return <>{children}</>;\n};\n\nexport default RequireSignIn;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,SAASC,QAAQ,QAAQ,cAAc;AAQvC,MAAMC,aAAqC,GAAGA,CAAC;EAC7CC,QAAQ;EACRC,YAAY;EACZC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC,gBAAgB;IAAEC,eAAe;IAAEC;EAAc,CAAC,GAAGR,QAAQ,CAAC,CAAC;EAEvED,SAAS,CAAC,MAAM;IACd,IAAI,CAACO,gBAAgB,IAAI,CAACC,eAAe,EAAE;MACzCC,aAAa,CAAC;QACZ,IAAIP,QAAQ,CAACQ,EAAE,KAAK,KAAK,GAAG;UAAEC,eAAe,EAAE;QAAK,CAAC,GAAGC,SAAS,CAAC;QAClE,GAAGN;MACL,CAAC,CAAC;IACJ;EACF,CAAC,EAAE,CAACC,gBAAgB,EAAEC,eAAe,EAAEF,WAAW,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRownd","Platform","RequireSignIn","children","initializing","signInProps","is_authenticated","is_initializing","requestSignIn","OS","prevent_closing","undefined","createElement","Fragment"],"sources":["RequireSignIn.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { useRownd } from '../hooks/rownd';\nimport type { RequestSignIn } from '../hooks/rownd';\nimport { Platform } from 'react-native';\n\nexport type ContextProps = {\n children?: React.ReactNode;\n initializing?: React.ReactNode;\n signInProps?: RequestSignIn;\n};\n\nconst RequireSignIn: React.FC<ContextProps> = ({\n children,\n initializing,\n signInProps,\n}) => {\n const { is_authenticated, is_initializing, requestSignIn } = useRownd();\n\n useEffect(() => {\n if (!is_authenticated && !is_initializing) {\n requestSignIn({\n ...(Platform.OS === 'web' ? { prevent_closing: true } : undefined),\n ...signInProps,\n });\n }\n }, [is_authenticated, is_initializing, signInProps, requestSignIn]);\n\n if (is_initializing && initializing) {\n return <>{initializing}</>;\n }\n\n return <>{children}</>;\n};\n\nexport default RequireSignIn;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,SAASC,QAAQ,QAAQ,cAAc;AAQvC,MAAMC,aAAqC,GAAGA,CAAC;EAC7CC,QAAQ;EACRC,YAAY;EACZC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC,gBAAgB;IAAEC,eAAe;IAAEC;EAAc,CAAC,GAAGR,QAAQ,CAAC,CAAC;EAEvED,SAAS,CAAC,MAAM;IACd,IAAI,CAACO,gBAAgB,IAAI,CAACC,eAAe,EAAE;MACzCC,aAAa,CAAC;QACZ,IAAIP,QAAQ,CAACQ,EAAE,KAAK,KAAK,GAAG;UAAEC,eAAe,EAAE;QAAK,CAAC,GAAGC,SAAS,CAAC;QAClE,GAAGN;MACL,CAAC,CAAC;IACJ;EACF,CAAC,EAAE,CAACC,gBAAgB,EAAEC,eAAe,EAAEF,WAAW,EAAEG,aAAa,CAAC,CAAC;EAEnE,IAAID,eAAe,IAAIH,YAAY,EAAE;IACnC,oBAAON,KAAA,CAAAc,aAAA,CAAAd,KAAA,CAAAe,QAAA,QAAGT,YAAe,CAAC;EAC5B;EAEA,oBAAON,KAAA,CAAAc,aAAA,CAAAd,KAAA,CAAAe,QAAA,QAAGV,QAAW,CAAC;AACxB,CAAC;AAED,eAAeD,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRownd","SignedIn","children","is_authenticated","createElement","Fragment"],"sources":["SignedIn.tsx"],"sourcesContent":["import React from 'react';\nimport { useRownd } from '../hooks/rownd';\n\ninterface SignedInProps {\n children: React.ReactNode;\n}\n\nconst SignedIn: React.FC<SignedInProps> = ({ children }) => {\n const { is_authenticated } = useRownd();\n\n if (!is_authenticated) {\n return null;\n }\n return <>{children}</>;\n};\n\nexport default SignedIn
|
|
1
|
+
{"version":3,"names":["React","useRownd","SignedIn","children","is_authenticated","createElement","Fragment"],"sources":["SignedIn.tsx"],"sourcesContent":["import React from 'react';\nimport { useRownd } from '../hooks/rownd';\n\ninterface SignedInProps {\n children: React.ReactNode;\n}\n\nconst SignedIn: React.FC<SignedInProps> = ({ children }) => {\n const { is_authenticated } = useRownd();\n\n if (!is_authenticated) {\n return null;\n }\n return <>{children}</>;\n};\n\nexport default SignedIn;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,gBAAgB;AAMzC,MAAMC,QAAiC,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EAC1D,MAAM;IAAEC;EAAiB,CAAC,GAAGH,QAAQ,CAAC,CAAC;EAEvC,IAAI,CAACG,gBAAgB,EAAE;IACrB,OAAO,IAAI;EACb;EACA,oBAAOJ,KAAA,CAAAK,aAAA,CAAAL,KAAA,CAAAM,QAAA,QAAGH,QAAW,CAAC;AACxB,CAAC;AAED,eAAeD,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRownd","SignedOut","children","is_authenticated","createElement","Fragment"],"sources":["SignedOut.tsx"],"sourcesContent":["import React from 'react'
|
|
1
|
+
{"version":3,"names":["React","useRownd","SignedOut","children","is_authenticated","createElement","Fragment"],"sources":["SignedOut.tsx"],"sourcesContent":["import React from 'react';\nimport { useRownd } from '../hooks/rownd';\n\ninterface SignedOutProps {\n children: React.ReactNode;\n}\n\nconst SignedOut: React.FC<SignedOutProps> = ({ children }) => {\n const { is_authenticated } = useRownd();\n\n if (is_authenticated) {\n return null;\n }\n return <>{children}</>;\n};\n\nexport default SignedOut;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,gBAAgB;AAMzC,MAAMC,SAAmC,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EAC5D,MAAM;IAAEC;EAAiB,CAAC,GAAGH,QAAQ,CAAC,CAAC;EAEvC,IAAIG,gBAAgB,EAAE;IACpB,OAAO,IAAI;EACb;EACA,oBAAOJ,KAAA,CAAAK,aAAA,CAAAL,KAAA,CAAAM,QAAA,QAAGH,QAAW,CAAC;AACxB,CAAC;AAED,eAAeD,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ActionType"],"sources":["action.ts"],"sourcesContent":["export enum ActionType {\n UPDATE_STATE = 'UPDATE_STATE',\n}\n\nexport type TAction = {\n type: ActionType;\n payload?: any;\n};\n"],"mappings":"AAAA,WAAYA,UAAU
|
|
1
|
+
{"version":3,"names":["ActionType"],"sources":["action.ts"],"sourcesContent":["export enum ActionType {\n UPDATE_STATE = 'UPDATE_STATE',\n}\n\nexport type TAction = {\n type: ActionType;\n payload?: any;\n};\n"],"mappings":"AAAA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["requestSignIn","signOut","manageAccount","getAccessToken","getFirebaseIdToken","setUserDataValue","setUserData","useRowndContext","useRownd","state","access_token","auth","firebase","getIdToken","is_authenticated","is_initializing","app_id","user","data","setValue","set","isLoading"],"sources":["rownd.ts"],"sourcesContent":["import {\n requestSignIn,\n signOut,\n manageAccount,\n getAccessToken,\n getFirebaseIdToken,\n setUserDataValue,\n setUserData,\n} from '../utils/nativeModule';\nimport { useRowndContext } from '../components/GlobalContext';\n\nexport type TRowndContext = {\n access_token: string | null;\n auth: AuthContext;\n is_authenticated: boolean;\n is_initializing: boolean;\n firebase: {\n getIdToken: () => Promise<string>;\n }
|
|
1
|
+
{"version":3,"names":["requestSignIn","signOut","manageAccount","getAccessToken","getFirebaseIdToken","setUserDataValue","setUserData","useRowndContext","useRownd","state","access_token","auth","firebase","getIdToken","is_authenticated","is_initializing","app_id","user","data","setValue","set","isLoading"],"sources":["rownd.ts"],"sourcesContent":["import {\n requestSignIn,\n signOut,\n manageAccount,\n getAccessToken,\n getFirebaseIdToken,\n setUserDataValue,\n setUserData,\n} from '../utils/nativeModule';\nimport { useRowndContext } from '../components/GlobalContext';\n\nexport type TRowndContext = {\n access_token: string | null;\n auth: AuthContext;\n is_authenticated: boolean;\n is_initializing: boolean;\n firebase: {\n getIdToken: () => Promise<string>;\n };\n getAccessToken: (token?: string) => Promise<string>;\n manageAccount: () => void;\n requestSignIn: (e?: RequestSignIn) => void;\n signOut: () => void;\n user: UserContext;\n};\n\ntype UserContext = {\n data: {\n user_id?: string;\n email?: string | null;\n phone?: string | null;\n [key: string]: any;\n };\n set: (data: Record<string, any>) => void;\n setValue: (key: string, value: any) => void;\n isLoading: boolean;\n};\n\ntype AuthContext = {\n access_token: string | null;\n app_id: string | null;\n is_verified_user?: boolean;\n};\n\nexport type RequestSignInMethods =\n | 'google'\n | 'apple'\n | 'default'\n | 'guest'\n | 'passkey';\nexport type RequestSignInIntent = 'sign_in' | 'sign_up';\nexport type RequestSignIn = {\n method?: RequestSignInMethods;\n postSignInRedirect?: string;\n intent?: RequestSignInIntent;\n};\n\nexport function useRownd(): TRowndContext {\n const { state } = useRowndContext();\n\n return {\n access_token: state.auth.access_token,\n auth: state.auth,\n getAccessToken,\n firebase: {\n getIdToken: getFirebaseIdToken,\n },\n is_authenticated: !!state.auth.access_token,\n is_initializing: !state.auth.app_id,\n manageAccount,\n requestSignIn,\n signOut,\n user: {\n data: state.user.data,\n setValue: setUserDataValue,\n set: setUserData,\n isLoading: state.user.isLoading,\n },\n };\n}\n"],"mappings":"AAAA,SACEA,aAAa,EACbC,OAAO,EACPC,aAAa,EACbC,cAAc,EACdC,kBAAkB,EAClBC,gBAAgB,EAChBC,WAAW,QACN,uBAAuB;AAC9B,SAASC,eAAe,QAAQ,6BAA6B;AAgD7D,OAAO,SAASC,QAAQA,CAAA,EAAkB;EACxC,MAAM;IAAEC;EAAM,CAAC,GAAGF,eAAe,CAAC,CAAC;EAEnC,OAAO;IACLG,YAAY,EAAED,KAAK,CAACE,IAAI,CAACD,YAAY;IACrCC,IAAI,EAAEF,KAAK,CAACE,IAAI;IAChBR,cAAc;IACdS,QAAQ,EAAE;MACRC,UAAU,EAAET;IACd,CAAC;IACDU,gBAAgB,EAAE,CAAC,CAACL,KAAK,CAACE,IAAI,CAACD,YAAY;IAC3CK,eAAe,EAAE,CAACN,KAAK,CAACE,IAAI,CAACK,MAAM;IACnCd,aAAa;IACbF,aAAa;IACbC,OAAO;IACPgB,IAAI,EAAE;MACJC,IAAI,EAAET,KAAK,CAACQ,IAAI,CAACC,IAAI;MACrBC,QAAQ,EAAEd,gBAAgB;MAC1Be,GAAG,EAAEd,WAAW;MAChBe,SAAS,EAAEZ,KAAK,CAACQ,IAAI,CAACI;IACxB;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRownd","useReactRownd","requestSignIn","signOut","getAccessToken","is_authenticated","is_initializing","auth","access_token","user","manageAccount","setUser","setUserValue","app_id","is_verified_user","opts","post_login_redirect","postSignInRedirect","data","setValue","set","isLoading"],"sources":["rownd.web.ts"],"sourcesContent":["import { useRownd as useReactRownd } from '@rownd/react';\nimport type { TRowndContext } from './rownd';\n\nexport function useRownd(): TRowndContext {\n const {\n requestSignIn,\n signOut,\n getAccessToken,\n is_authenticated,\n is_initializing,\n auth,\n access_token,\n user,\n manageAccount,\n setUser,\n setUserValue
|
|
1
|
+
{"version":3,"names":["useRownd","useReactRownd","requestSignIn","signOut","getAccessToken","is_authenticated","is_initializing","auth","access_token","user","manageAccount","setUser","setUserValue","app_id","is_verified_user","opts","post_login_redirect","postSignInRedirect","data","setValue","set","isLoading"],"sources":["rownd.web.ts"],"sourcesContent":["import { useRownd as useReactRownd } from '@rownd/react';\nimport type { TRowndContext } from './rownd';\n\nexport function useRownd(): TRowndContext {\n const {\n requestSignIn,\n signOut,\n getAccessToken,\n is_authenticated,\n is_initializing,\n auth,\n access_token,\n user,\n manageAccount,\n setUser,\n setUserValue,\n } = useReactRownd();\n\n return {\n access_token,\n auth: {\n access_token,\n app_id: auth.app_id || null,\n is_verified_user: auth.is_verified_user,\n },\n // @ts-ignore\n getAccessToken,\n is_authenticated,\n is_initializing,\n manageAccount,\n requestSignIn: (opts) =>\n requestSignIn({ ...opts, post_login_redirect: opts?.postSignInRedirect }),\n signOut,\n user: {\n data: user.data,\n setValue: setUserValue,\n set: setUser,\n isLoading: false, // Waiting for react sdk update\n },\n };\n}\n"],"mappings":"AAAA,SAASA,QAAQ,IAAIC,aAAa,QAAQ,cAAc;AAGxD,OAAO,SAASD,QAAQA,CAAA,EAAkB;EACxC,MAAM;IACJE,aAAa;IACbC,OAAO;IACPC,cAAc;IACdC,gBAAgB;IAChBC,eAAe;IACfC,IAAI;IACJC,YAAY;IACZC,IAAI;IACJC,aAAa;IACbC,OAAO;IACPC;EACF,CAAC,GAAGX,aAAa,CAAC,CAAC;EAEnB,OAAO;IACLO,YAAY;IACZD,IAAI,EAAE;MACJC,YAAY;MACZK,MAAM,EAAEN,IAAI,CAACM,MAAM,IAAI,IAAI;MAC3BC,gBAAgB,EAAEP,IAAI,CAACO;IACzB,CAAC;IACD;IACAV,cAAc;IACdC,gBAAgB;IAChBC,eAAe;IACfI,aAAa;IACbR,aAAa,EAAGa,IAAI,IAClBb,aAAa,CAAC;MAAE,GAAGa,IAAI;MAAEC,mBAAmB,EAAED,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEE;IAAmB,CAAC,CAAC;IAC3Ed,OAAO;IACPM,IAAI,EAAE;MACJS,IAAI,EAAET,IAAI,CAACS,IAAI;MACfC,QAAQ,EAAEP,YAAY;MACtBQ,GAAG,EAAET,OAAO;MACZU,SAAS,EAAE,KAAK,CAAE;IACpB;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ActionType","initialRowndState","user","data","email","isLoading","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","_action$payload","_action$payload2","_action$payload3","_action$payload4","_action$payload5","_action$payload6","_action$payload$appCo","newState","type","UPDATE_STATE","payload","Boolean","appConfig","id"],"sources":["rowndReducer.ts"],"sourcesContent":["import type { GlobalState } from '../components/GlobalContext.types';\nimport { ActionType, TAction } from '../constants/action';\n\nexport const initialRowndState: GlobalState = {\n // is_initializing: false,\n user: {\n data: {\n email: null,\n },\n isLoading: false
|
|
1
|
+
{"version":3,"names":["ActionType","initialRowndState","user","data","email","isLoading","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","_action$payload","_action$payload2","_action$payload3","_action$payload4","_action$payload5","_action$payload6","_action$payload$appCo","newState","type","UPDATE_STATE","payload","Boolean","appConfig","id"],"sources":["rowndReducer.ts"],"sourcesContent":["import type { GlobalState } from '../components/GlobalContext.types';\nimport { ActionType, TAction } from '../constants/action';\n\nexport const initialRowndState: GlobalState = {\n // is_initializing: false,\n user: {\n data: {\n email: null,\n },\n isLoading: false,\n // meta: {}\n },\n auth: {\n access_token: null,\n refresh_token: null,\n app_id: null,\n },\n app: {\n schema: null,\n config: null,\n },\n // is_saving_user_data: false,\n // config,\n};\n\nexport function rowndReducer(state: GlobalState, action: TAction): GlobalState {\n let newState: GlobalState;\n\n switch (action.type) {\n case ActionType.UPDATE_STATE:\n newState = {\n user: {\n data: {\n ...action.payload?.user?.data,\n email: action.payload?.user?.data?.email,\n },\n isLoading: Boolean(action.payload?.user?.isLoading),\n // meta: {}\n },\n auth: {\n access_token: action.payload?.auth?.access_token,\n refresh_token: action.payload?.auth?.refresh_token,\n app_id: action.payload?.appConfig?.id || null,\n },\n app: {\n schema: action.payload.appConfig?.schema,\n config: null,\n },\n // is_saving_user_data: false,\n // config\n };\n return newState;\n default:\n newState = state;\n return newState;\n }\n}\n"],"mappings":"AACA,SAASA,UAAU,QAAiB,qBAAqB;AAEzD,OAAO,MAAMC,iBAA8B,GAAG;EAC5C;EACAC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,KAAK,EAAE;IACT,CAAC;IACDC,SAAS,EAAE;IACX;EACF,CAAC;EACDC,IAAI,EAAE;IACJC,YAAY,EAAE,IAAI;IAClBC,aAAa,EAAE,IAAI;IACnBC,MAAM,EAAE;EACV,CAAC;EACDC,GAAG,EAAE;IACHC,MAAM,EAAE,IAAI;IACZC,MAAM,EAAE;EACV;EACA;EACA;AACF,CAAC;AAED,OAAO,SAASC,YAAYA,CAACC,KAAkB,EAAEC,MAAe,EAAe;EAAA,IAAAC,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,qBAAA;EAC7E,IAAIC,QAAqB;EAEzB,QAAQR,MAAM,CAACS,IAAI;IACjB,KAAKxB,UAAU,CAACyB,YAAY;MAC1BF,QAAQ,GAAG;QACTrB,IAAI,EAAE;UACJC,IAAI,EAAE;YACJ,KAAAa,eAAA,GAAGD,MAAM,CAACW,OAAO,cAAAV,eAAA,gBAAAA,eAAA,GAAdA,eAAA,CAAgBd,IAAI,cAAAc,eAAA,uBAApBA,eAAA,CAAsBb,IAAI;YAC7BC,KAAK,GAAAa,gBAAA,GAAEF,MAAM,CAACW,OAAO,cAAAT,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBf,IAAI,cAAAe,gBAAA,gBAAAA,gBAAA,GAApBA,gBAAA,CAAsBd,IAAI,cAAAc,gBAAA,uBAA1BA,gBAAA,CAA4Bb;UACrC,CAAC;UACDC,SAAS,EAAEsB,OAAO,EAAAT,gBAAA,GAACH,MAAM,CAACW,OAAO,cAAAR,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBhB,IAAI,cAAAgB,gBAAA,uBAApBA,gBAAA,CAAsBb,SAAS;UAClD;QACF,CAAC;QACDC,IAAI,EAAE;UACJC,YAAY,GAAAY,gBAAA,GAAEJ,MAAM,CAACW,OAAO,cAAAP,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBb,IAAI,cAAAa,gBAAA,uBAApBA,gBAAA,CAAsBZ,YAAY;UAChDC,aAAa,GAAAY,gBAAA,GAAEL,MAAM,CAACW,OAAO,cAAAN,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBd,IAAI,cAAAc,gBAAA,uBAApBA,gBAAA,CAAsBZ,aAAa;UAClDC,MAAM,EAAE,EAAAY,gBAAA,GAAAN,MAAM,CAACW,OAAO,cAAAL,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBO,SAAS,cAAAP,gBAAA,uBAAzBA,gBAAA,CAA2BQ,EAAE,KAAI;QAC3C,CAAC;QACDnB,GAAG,EAAE;UACHC,MAAM,GAAAW,qBAAA,GAAEP,MAAM,CAACW,OAAO,CAACE,SAAS,cAAAN,qBAAA,uBAAxBA,qBAAA,CAA0BX,MAAM;UACxCC,MAAM,EAAE;QACV;QACA;QACA;MACF,CAAC;MACD,OAAOW,QAAQ;IACjB;MACEA,QAAQ,GAAGT,KAAK;MAChB,OAAOS,QAAQ;EACnB;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Rownd","RowndPlugin","Proxy","get","Error","IOSRowndEventEmitter","OS","RowndPluginEventEmitter","configure","config","customizations","customizationConfig","requestSignIn","method","postSignInRedirect","intent","signOut","manageAccount","getAccessToken","token","getFirebaseIdToken","setUserDataValue","key","value","setUserData","data","handleSignInLink","url"],"sources":["nativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport type { RequestSignIn } from 'src/hooks/rownd';\nimport type { Customizations, IConfig } from './config';\n\nexport const LINKING_ERROR =\n `The package '@rownd/react-native' 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\nexport const Rownd = NativeModules.RowndPlugin\n ? NativeModules.RowndPlugin\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport const IOSRowndEventEmitter =\n Platform.OS !== 'ios'\n ? null\n : NativeModules.RowndPluginEventEmitter\n ? NativeModules.RowndPluginEventEmitter\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function configure(config: IConfig): Promise<string> {\n return Rownd.configure(config);\n}\n\nexport function customizations(customizationConfig: Customizations) {\n return Rownd.customizations(customizationConfig);\n}\n\nexport function requestSignIn(config?: RequestSignIn) {\n if (!config) {\n return Rownd.requestSignIn({ method: 'default' });\n }\n return Rownd.requestSignIn({\n method: config?.method,\n postSignInRedirect: config?.postSignInRedirect,\n intent: config?.intent
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Rownd","RowndPlugin","Proxy","get","Error","IOSRowndEventEmitter","OS","RowndPluginEventEmitter","configure","config","customizations","customizationConfig","requestSignIn","method","postSignInRedirect","intent","signOut","manageAccount","getAccessToken","token","getFirebaseIdToken","setUserDataValue","key","value","setUserData","data","handleSignInLink","url"],"sources":["nativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport type { RequestSignIn } from 'src/hooks/rownd';\nimport type { Customizations, IConfig } from './config';\n\nexport const LINKING_ERROR =\n `The package '@rownd/react-native' 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\nexport const Rownd = NativeModules.RowndPlugin\n ? NativeModules.RowndPlugin\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport const IOSRowndEventEmitter =\n Platform.OS !== 'ios'\n ? null\n : NativeModules.RowndPluginEventEmitter\n ? NativeModules.RowndPluginEventEmitter\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function configure(config: IConfig): Promise<string> {\n return Rownd.configure(config);\n}\n\nexport function customizations(customizationConfig: Customizations) {\n return Rownd.customizations(customizationConfig);\n}\n\nexport function requestSignIn(config?: RequestSignIn) {\n if (!config) {\n return Rownd.requestSignIn({ method: 'default' });\n }\n return Rownd.requestSignIn({\n method: config?.method,\n postSignInRedirect: config?.postSignInRedirect,\n intent: config?.intent,\n });\n}\n\nexport function signOut() {\n return Rownd.signOut();\n}\n\nexport function manageAccount() {\n return Rownd.manageAccount();\n}\n\nexport function getAccessToken(token?: string): Promise<string> {\n return Rownd.getAccessToken(token || null);\n}\n\nexport function getFirebaseIdToken(): Promise<string> {\n return Rownd.getFirebaseIdToken();\n}\n\nexport function setUserDataValue(key: string, value: any) {\n return Rownd.setUserDataValue(\n key,\n Platform.OS === 'android' ? { value } : value\n );\n}\n\nexport function setUserData(data: Record<string, any>) {\n return Rownd.setUserData(data);\n}\n\nexport function handleSignInLink(url: string) {\n return Rownd.handleSignInLink(url);\n}\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAItD,OAAO,MAAMC,aAAa,GACxB,8EAA8E,GAC9ED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,OAAO,MA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Aa,CAAC,CAAC;AAC9B;AAEA,OAAO,SAASC,cAAcA,CAACC,KAAc,EAAmB;EAC9D,OAAOnB,KAAK,CAACkB,cAAc,CAACC,KAAK,IAAI,IAAI,CAAC;AAC5C;AAEA,OAAO,SAASC,kBAAkBA,CAAA,EAAoB;EACpD,OAAOpB,KAAK,CAACoB,kBAAkB,CAAC,CAAC;AACnC;AAEA,OAAO,SAASC,gBAAgBA,CAACC,GAAW,EAAEC,KAAU,EAAE;EACxD,OAAOvB,KAAK,CAACqB,gBAAgB,CAC3BC,GAAG,EACH3B,QAAQ,CAACW,EAAE,KAAK,SAAS,GAAG;IAAEiB;EAAM,CAAC,GAAGA,KAC1C,CAAC;AACH;AAEA,OAAO,SAASC,WAAWA,CAACC,IAAyB,EAAE;EACrD,OAAOzB,KAAK,CAACwB,WAAW,CAACC,IAAI,CAAC;AAChC;AAEA,OAAO,SAASC,gBAAgBA,CAACC,GAAW,EAAE;EAC5C,OAAO3B,KAAK,CAAC0B,gBAAgB,CAACC,GAAG,CAAC;AACpC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rownd/react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "test",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"eslint": "^8.4.1",
|
|
62
62
|
"eslint-config-prettier": "^8.5.0",
|
|
63
63
|
"eslint-plugin-prettier": "^4.0.0",
|
|
64
|
-
"expo": "
|
|
64
|
+
"expo": "~52.0.0",
|
|
65
65
|
"jest": "^28.1.1",
|
|
66
66
|
"pod-install": "^0.1.0",
|
|
67
67
|
"prettier": "^2.0.5",
|
|
@@ -78,13 +78,6 @@
|
|
|
78
78
|
"react": "*",
|
|
79
79
|
"react-native": "*"
|
|
80
80
|
},
|
|
81
|
-
"jest": {
|
|
82
|
-
"preset": "react-native",
|
|
83
|
-
"modulePathIgnorePatterns": [
|
|
84
|
-
"<rootDir>/example/node_modules",
|
|
85
|
-
"<rootDir>/lib/"
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
81
|
"commitlint": {
|
|
89
82
|
"extends": [
|
|
90
83
|
"@commitlint/config-conventional"
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
require "json"
|
|
2
2
|
|
|
3
|
+
unless defined?(install_modules_dependencies)
|
|
4
|
+
absolute_react_native_path = File.dirname(`node --print "require.resolve('react-native/package.json')"`)
|
|
5
|
+
require File.join(absolute_react_native_path, "scripts/react_native_pods")
|
|
6
|
+
end
|
|
7
|
+
|
|
3
8
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
9
|
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
10
|
|
|
@@ -17,20 +22,17 @@ Pod::Spec.new do |s|
|
|
|
17
22
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
23
|
|
|
19
24
|
s.dependency "React-Core"
|
|
20
|
-
s.dependency "Rownd", "~> 3.
|
|
25
|
+
s.dependency "Rownd", "~> 3.14.2"
|
|
26
|
+
s.dependency "lottie-ios", "~> 4.3.3"
|
|
21
27
|
|
|
22
|
-
#
|
|
28
|
+
# Use install_modules_dependencies to properly handle New Architecture dependencies
|
|
29
|
+
# See: https://github.com/react-native-community/discussions-and-proposals/discussions/912
|
|
23
30
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
24
31
|
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
25
|
-
s.pod_target_xcconfig
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
s.pod_target_xcconfig = {
|
|
33
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
34
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
28
35
|
}
|
|
29
|
-
|
|
30
|
-
s.dependency "React-Codegen"
|
|
31
|
-
s.dependency "RCT-Folly"
|
|
32
|
-
s.dependency "RCTRequired"
|
|
33
|
-
s.dependency "RCTTypeSafety"
|
|
34
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
36
|
+
install_modules_dependencies(s)
|
|
35
37
|
end
|
|
36
38
|
end
|
|
@@ -5,7 +5,7 @@ import React, {
|
|
|
5
5
|
useEffect,
|
|
6
6
|
useContext,
|
|
7
7
|
} from 'react';
|
|
8
|
-
import { NativeEventEmitter,
|
|
8
|
+
import { NativeEventEmitter, LogBox, Platform, Linking } from 'react-native';
|
|
9
9
|
import { initialRowndState, rowndReducer } from '../reducer/rowndReducer';
|
|
10
10
|
|
|
11
11
|
import * as NativeRowndModules from '../utils/nativeModule';
|
|
@@ -14,10 +14,8 @@ import type { ContextProps, GlobalState } from './GlobalContext.types';
|
|
|
14
14
|
import type { TAction } from '../constants/action';
|
|
15
15
|
import { ActionType } from '../constants/action';
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
]);
|
|
20
|
-
YellowBox.ignoreWarnings(['YellowBox has been replaced with LogBox.']);
|
|
17
|
+
LogBox.ignoreLogs(['Sending `update_state` with no listeners registered.']);
|
|
18
|
+
LogBox.ignoreLogs(['YellowBox has been replaced with LogBox.']);
|
|
21
19
|
|
|
22
20
|
export const GlobalContext = createContext<
|
|
23
21
|
{ state: GlobalState; dispatch: React.Dispatch<TAction> } | undefined
|
|
@@ -28,7 +26,7 @@ const eventEmitter = new NativeEventEmitter(IOSRowndEventEmitter || Rownd);
|
|
|
28
26
|
const RowndProvider: FunctionComponent<ContextProps> = ({
|
|
29
27
|
children,
|
|
30
28
|
config,
|
|
31
|
-
customizations
|
|
29
|
+
customizations,
|
|
32
30
|
}) => {
|
|
33
31
|
const [state, dispatch] = useReducer(rowndReducer, initialRowndState);
|
|
34
32
|
const value = { state, dispatch };
|
|
@@ -38,7 +36,7 @@ const RowndProvider: FunctionComponent<ContextProps> = ({
|
|
|
38
36
|
if (customizations) {
|
|
39
37
|
NativeRowndModules.customizations(customizations);
|
|
40
38
|
}
|
|
41
|
-
}, [config
|
|
39
|
+
}, [config, customizations]);
|
|
42
40
|
|
|
43
41
|
useEffect(() => {
|
|
44
42
|
const onSessionConnect = (event: any) => {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ContextProps } from './GlobalContext.types';
|
|
3
|
-
import {
|
|
4
|
-
RowndProvider as RowndReactProvider,
|
|
5
|
-
} from '@rownd/react';
|
|
3
|
+
import { RowndProvider as RowndReactProvider } from '@rownd/react';
|
|
6
4
|
|
|
7
5
|
const RowndProvider: React.FC<ContextProps> = ({ children, config }) => {
|
|
8
6
|
return (
|
|
@@ -12,5 +10,4 @@ const RowndProvider: React.FC<ContextProps> = ({ children, config }) => {
|
|
|
12
10
|
);
|
|
13
11
|
};
|
|
14
12
|
|
|
15
|
-
|
|
16
13
|
export { RowndProvider };
|
|
@@ -23,7 +23,7 @@ const RequireSignIn: React.FC<ContextProps> = ({
|
|
|
23
23
|
...signInProps,
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
}, [is_authenticated, is_initializing, signInProps]);
|
|
26
|
+
}, [is_authenticated, is_initializing, signInProps, requestSignIn]);
|
|
27
27
|
|
|
28
28
|
if (is_initializing && initializing) {
|
|
29
29
|
return <>{initializing}</>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { useRownd } from '../hooks/rownd';
|
|
3
3
|
|
|
4
4
|
interface SignedOutProps {
|
|
@@ -14,4 +14,4 @@ const SignedOut: React.FC<SignedOutProps> = ({ children }) => {
|
|
|
14
14
|
return <>{children}</>;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export default SignedOut
|
|
17
|
+
export default SignedOut;
|
package/src/hooks/rownd.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type TRowndContext = {
|
|
|
16
16
|
is_initializing: boolean;
|
|
17
17
|
firebase: {
|
|
18
18
|
getIdToken: () => Promise<string>;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
getAccessToken: (token?: string) => Promise<string>;
|
|
21
21
|
manageAccount: () => void;
|
|
22
22
|
requestSignIn: (e?: RequestSignIn) => void;
|
|
@@ -42,9 +42,18 @@ type AuthContext = {
|
|
|
42
42
|
is_verified_user?: boolean;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
export type RequestSignInMethods =
|
|
45
|
+
export type RequestSignInMethods =
|
|
46
|
+
| 'google'
|
|
47
|
+
| 'apple'
|
|
48
|
+
| 'default'
|
|
49
|
+
| 'guest'
|
|
50
|
+
| 'passkey';
|
|
46
51
|
export type RequestSignInIntent = 'sign_in' | 'sign_up';
|
|
47
|
-
export type RequestSignIn = {
|
|
52
|
+
export type RequestSignIn = {
|
|
53
|
+
method?: RequestSignInMethods;
|
|
54
|
+
postSignInRedirect?: string;
|
|
55
|
+
intent?: RequestSignInIntent;
|
|
56
|
+
};
|
|
48
57
|
|
|
49
58
|
export function useRownd(): TRowndContext {
|
|
50
59
|
const { state } = useRowndContext();
|
|
@@ -65,7 +74,7 @@ export function useRownd(): TRowndContext {
|
|
|
65
74
|
data: state.user.data,
|
|
66
75
|
setValue: setUserDataValue,
|
|
67
76
|
set: setUserData,
|
|
68
|
-
isLoading: state.user.isLoading
|
|
69
|
-
},
|
|
77
|
+
isLoading: state.user.isLoading,
|
|
78
|
+
},
|
|
70
79
|
};
|
|
71
80
|
}
|
package/src/hooks/rownd.web.ts
CHANGED
|
@@ -13,7 +13,7 @@ export function useRownd(): TRowndContext {
|
|
|
13
13
|
user,
|
|
14
14
|
manageAccount,
|
|
15
15
|
setUser,
|
|
16
|
-
setUserValue
|
|
16
|
+
setUserValue,
|
|
17
17
|
} = useReactRownd();
|
|
18
18
|
|
|
19
19
|
return {
|
|
@@ -35,7 +35,7 @@ export function useRownd(): TRowndContext {
|
|
|
35
35
|
data: user.data,
|
|
36
36
|
setValue: setUserValue,
|
|
37
37
|
set: setUser,
|
|
38
|
-
isLoading: false // Waiting for react sdk update
|
|
38
|
+
isLoading: false, // Waiting for react sdk update
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
41
|
}
|
|
@@ -7,7 +7,7 @@ export const initialRowndState: GlobalState = {
|
|
|
7
7
|
data: {
|
|
8
8
|
email: null,
|
|
9
9
|
},
|
|
10
|
-
isLoading: false
|
|
10
|
+
isLoading: false,
|
|
11
11
|
// meta: {}
|
|
12
12
|
},
|
|
13
13
|
auth: {
|
|
@@ -34,7 +34,7 @@ export function rowndReducer(state: GlobalState, action: TAction): GlobalState {
|
|
|
34
34
|
...action.payload?.user?.data,
|
|
35
35
|
email: action.payload?.user?.data?.email,
|
|
36
36
|
},
|
|
37
|
-
isLoading: Boolean(action.payload?.user?.isLoading)
|
|
37
|
+
isLoading: Boolean(action.payload?.user?.isLoading),
|
|
38
38
|
// meta: {}
|
|
39
39
|
},
|
|
40
40
|
auth: {
|