@rownd/react-native 3.4.0 → 4.0.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/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 +21 -9
- 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 -12
- 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
- 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/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.4/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.4/gc.properties +0 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/ios/ReactNative.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/ReactNative.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/ReactNative.xcodeproj/project.xcworkspace/xcuserdata/mhamann.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/ReactNative.xcodeproj/xcuserdata/mhamann.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/lib/package.json +0 -173
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
|
@@ -7,21 +7,17 @@ import SwiftUI
|
|
|
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
|
-
withName: "update_state", body: try newState.toDictionary())
|
|
21
|
-
} catch {
|
|
22
|
-
print("Failed to encode Rownd state: \(String(describing: error))")
|
|
23
|
-
}
|
|
24
|
-
}
|
|
18
|
+
deinit {
|
|
19
|
+
// Cancel the state subscription to prevent memory leaks
|
|
20
|
+
stateCancellable?.cancel()
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
@objc(configure:withResolver:withRejecter:)
|
|
@@ -42,6 +38,22 @@ class RowndPlugin: NSObject {
|
|
|
42
38
|
await Rownd.configure(launchOptions: nil, appKey: appKey)
|
|
43
39
|
}
|
|
44
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
|
+
}
|
|
45
57
|
}
|
|
46
58
|
}
|
|
47
59
|
|
|
@@ -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,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAO,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,G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CAACR,KAAK,CAACT,KAAK,CAAC,GAAGS;MACjE,CAAC,CAAC;IACJ,CAAC;IACD,MAAMS,YAAY,GAAG1B,YAAY,CAAC2B,WAAW,CAC3C,cAAc,EACdX,gBACF,CAAC;IAED,IAAI,CAACU,YAAY,EAAE;IAEnB,OAAO,MAAM;MACXA,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;;EAEN;EACA,IAAAd,gBAAS,EAAC,MAAM;IACd,IAAIQ,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzB;IACF;IAEAM,oBAAO,CAACC,gBAAgB,CAAC,KAAK,EAAGb,KAAK,IACpC5C,kBAAkB,CAAC0D,gBAAgB,CAACd,KAAK,CAACe,GAAG,CAC/C,CAAC;IAED,CAAC,YAAY;MACX,MAAMC,UAAU,GAAG,MAAMJ,oBAAO,CAACK,aAAa,CAAC,CAAC;MAChD,IAAID,UAAU,EAAE;QACd5D,kBAAkB,CAAC0D,gBAAgB,CAACE,UAAU,CAAC;MACjD;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,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AAAwC,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAA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AAW,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,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,qBAAA;EAC7E,IAAIC,QAAqB;EAEzB,QAAQR,MAAM,CAACS,IAAI;IACjB,KAAKC,kBAAU,CAACC,YAAY;MAC1BH,QAAQ,GAAG;QACTrB,IAAI,EAAE;UACJC,IAAI,EAAE;YACJ,KAAAa,eAAA,GAAGD,MAAM,CAACY,OAAO,cAAAX,eAAA,gBAAAA,eAAA,GAAdA,eAAA,CAAgBd,IAAI,cAAAc,eAAA,uBAApBA,eAAA,CAAsBb,IAAI;YAC7BC,KAAK,GAAAa,gBAAA,GAAEF,MAAM,CAACY,OAAO,cAAAV,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBf,IAAI,cAAAe,gBAAA,gBAAAA,gBAAA,GAApBA,gBAAA,CAAsBd,IAAI,cAAAc,gBAAA,uBAA1BA,gBAAA,CAA4Bb;UACrC,CAAC;UACDC,SAAS,EAAEuB,OAAO,EAAAV,gBAAA,GAACH,MAAM,CAACY,OAAO,cAAAT,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,CAACY,OAAO,cAAAR,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBb,IAAI,cAAAa,gBAAA,uBAApBA,gBAAA,CAAsBZ,YAAY;UAChDC,aAAa,GAAAY,gBAAA,GAAEL,MAAM,CAACY,OAAO,cAAAP,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBd,IAAI,cAAAc,gBAAA,uBAApBA,gBAAA,CAAsBZ,aAAa;UAClDC,MAAM,EAAE,EAAAY,gBAAA,GAAAN,MAAM,CAACY,OAAO,cAAAN,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBQ,SAAS,cAAAR,gBAAA,uBAAzBA,gBAAA,CAA2BS,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,CAA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AAC,CAAC;AAC9B;AAEO,SAASC,cAAcA,CAACC,KAAc,EAAmB;EAC9D,OAAOpB,KAAK,CAACmB,cAAc,CAACC,KAAK,IAAI,IAAI,CAAC;AAC5C;AAEO,SAASC,kBAAkBA,CAAA,EAAoB;EACpD,OAAOrB,KAAK,CAACqB,kBAAkB,CAAC,CAAC;AACnC;AAEO,SAASC,gBAAgBA,CAACC,GAAW,EAAEC,KAAU,EAAE;EACxD,OAAOxB,KAAK,CAACsB,gBAAgB,CAC3BC,GAAG,EACH3B,qBAAQ,CAACW,EAAE,KAAK,SAAS,GAAG;IAAEiB;EAAM,CAAC,GAAGA,KAC1C,CAAC;AACH;AAEO,SAASC,WAAWA,CAACC,IAAyB,EAAE;EACrD,OAAO1B,KAAK,CAACyB,WAAW,CAACC,IAAI,CAAC;AAChC;AAEO,SAASC,gBAAgBA,CAACC,GAAW,EAAE;EAC5C,OAAO5B,KAAK,CAAC2B,gBAAgB,CAACC,GAAG,CAAC;AACpC","ignoreList":[]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
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 }\n\n return context;\n}\n\nexport { RowndProvider, useRowndContext };\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,UAAU,EACVC,aAAa,EAEbC,SAAS,EACTC,UAAU,QACL,OAAO;AACd,SAASC,kBAAkB,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,cAAc;AAC5E,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,yBAAyB;AAEzE,OAAO,KAAKC,kBAAkB,MAAM,uBAAuB;AAC3D,SAASC,KAAK,EAAEC,oBAAoB,QAAQ,uBAAuB;AAGnE,SAASC,UAAU,QAAQ,qBAAqB;AAEhDR,MAAM,CAACS,UAAU,CAAC,CAAC,sDAAsD,CAAC,CAAC;AAC3ET,MAAM,CAACS,UAAU,CAAC,CAAC,0CAA0C,CAAC,CAAC;AAE/D,OAAO,MAAMC,aAAa,gBAAGd,aAAa,CAExCe,SAAS,CAAC;AAEZ,MAAMC,YAA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AAG,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":[]}
|