@rownd/react-native 3.0.1 → 3.2.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/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +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/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/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnativerowndplugin/RowndPluginModule.kt +2 -2
- package/expo/plugin.js +2 -2
- package/ios/RowndPlugin.swift +1 -1
- package/lib/commonjs/components/GlobalContext.js +13 -33
- package/lib/commonjs/components/GlobalContext.js.map +1 -1
- package/lib/commonjs/components/GlobalContext.types.js.map +1 -1
- package/lib/commonjs/components/GlobalContext.web.js +4 -10
- package/lib/commonjs/components/GlobalContext.web.js.map +1 -1
- package/lib/commonjs/components/RequireSignIn.js +10 -20
- package/lib/commonjs/components/RequireSignIn.js.map +1 -1
- package/lib/commonjs/components/SignedIn.js +4 -13
- package/lib/commonjs/components/SignedIn.js.map +1 -1
- package/lib/commonjs/components/SignedOut.js +4 -13
- package/lib/commonjs/components/SignedOut.js.map +1 -1
- package/lib/commonjs/constants/action.js +1 -3
- package/lib/commonjs/constants/action.js.map +1 -1
- package/lib/commonjs/hooks/rownd.js +2 -4
- package/lib/commonjs/hooks/rownd.js.map +1 -1
- package/lib/commonjs/hooks/rownd.web.js +4 -4
- package/lib/commonjs/hooks/rownd.web.js.map +1 -1
- package/lib/commonjs/index.js +0 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/reducer/rowndReducer.js +18 -22
- package/lib/commonjs/reducer/rowndReducer.js.map +1 -1
- package/lib/commonjs/utils/config.js.map +1 -1
- package/lib/commonjs/utils/nativeModule.js +3 -21
- package/lib/commonjs/utils/nativeModule.js.map +1 -1
- package/lib/module/components/GlobalContext.js +7 -17
- package/lib/module/components/GlobalContext.js.map +1 -1
- package/lib/module/components/GlobalContext.types.js.map +1 -1
- package/lib/module/components/GlobalContext.web.js +4 -7
- package/lib/module/components/GlobalContext.web.js.map +1 -1
- package/lib/module/components/RequireSignIn.js +7 -11
- package/lib/module/components/RequireSignIn.js.map +1 -1
- package/lib/module/components/SignedIn.js +3 -8
- package/lib/module/components/SignedIn.js.map +1 -1
- package/lib/module/components/SignedOut.js +3 -8
- package/lib/module/components/SignedOut.js.map +1 -1
- package/lib/module/constants/action.js +0 -1
- package/lib/module/constants/action.js.map +1 -1
- package/lib/module/hooks/rownd.js +2 -1
- package/lib/module/hooks/rownd.js.map +1 -1
- package/lib/module/hooks/rownd.web.js +4 -2
- package/lib/module/hooks/rownd.web.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/reducer/rowndReducer.js +17 -17
- package/lib/module/reducer/rowndReducer.js.map +1 -1
- package/lib/module/utils/config.js.map +1 -1
- package/lib/module/utils/nativeModule.js +0 -3
- package/lib/module/utils/nativeModule.js.map +1 -1
- package/lib/typescript/components/GlobalContext.types.d.ts +1 -0
- package/lib/typescript/hooks/rownd.d.ts +2 -1
- package/package.json +2 -1
- package/rownd-react-native.podspec +1 -1
- package/src/components/GlobalContext.types.ts +1 -0
- package/src/hooks/rownd.ts +3 -1
- package/src/hooks/rownd.web.ts +1 -0
- package/src/reducer/rowndReducer.ts +2 -0
|
@@ -5,16 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.initialRowndState = void 0;
|
|
7
7
|
exports.rowndReducer = rowndReducer;
|
|
8
|
-
|
|
9
8
|
var _action = require("../constants/action");
|
|
10
|
-
|
|
11
|
-
const initialRowndState = {
|
|
9
|
+
const initialRowndState = exports.initialRowndState = {
|
|
12
10
|
// is_initializing: false,
|
|
13
11
|
user: {
|
|
14
12
|
data: {
|
|
15
13
|
email: null
|
|
16
|
-
}
|
|
17
|
-
|
|
14
|
+
},
|
|
15
|
+
isLoading: false
|
|
16
|
+
// meta: {}
|
|
18
17
|
},
|
|
19
18
|
auth: {
|
|
20
19
|
access_token: null,
|
|
@@ -24,40 +23,37 @@ const initialRowndState = {
|
|
|
24
23
|
app: {
|
|
25
24
|
schema: null,
|
|
26
25
|
config: null
|
|
27
|
-
}
|
|
26
|
+
}
|
|
27
|
+
// is_saving_user_data: false,
|
|
28
28
|
// config,
|
|
29
|
-
|
|
30
29
|
};
|
|
31
|
-
exports.initialRowndState = initialRowndState;
|
|
32
|
-
|
|
33
30
|
function rowndReducer(state, action) {
|
|
34
|
-
var _action$payload, _action$
|
|
35
|
-
|
|
31
|
+
var _action$payload, _action$payload2, _action$payload3, _action$payload4, _action$payload5, _action$payload6, _action$payload$appCo;
|
|
36
32
|
let newState;
|
|
37
|
-
|
|
38
33
|
switch (action.type) {
|
|
39
34
|
case _action.ActionType.UPDATE_STATE:
|
|
40
35
|
newState = {
|
|
41
36
|
user: {
|
|
42
|
-
data: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
data: {
|
|
38
|
+
...((_action$payload = action.payload) === null || _action$payload === void 0 || (_action$payload = _action$payload.user) === null || _action$payload === void 0 ? void 0 : _action$payload.data),
|
|
39
|
+
email: (_action$payload2 = action.payload) === null || _action$payload2 === void 0 || (_action$payload2 = _action$payload2.user) === null || _action$payload2 === void 0 || (_action$payload2 = _action$payload2.data) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.email
|
|
40
|
+
},
|
|
41
|
+
isLoading: Boolean((_action$payload3 = action.payload) === null || _action$payload3 === void 0 || (_action$payload3 = _action$payload3.user) === null || _action$payload3 === void 0 ? void 0 : _action$payload3.isLoading)
|
|
42
|
+
// meta: {}
|
|
46
43
|
},
|
|
47
44
|
auth: {
|
|
48
|
-
access_token: (_action$
|
|
49
|
-
refresh_token: (_action$
|
|
50
|
-
app_id: ((_action$
|
|
45
|
+
access_token: (_action$payload4 = action.payload) === null || _action$payload4 === void 0 || (_action$payload4 = _action$payload4.auth) === null || _action$payload4 === void 0 ? void 0 : _action$payload4.access_token,
|
|
46
|
+
refresh_token: (_action$payload5 = action.payload) === null || _action$payload5 === void 0 || (_action$payload5 = _action$payload5.auth) === null || _action$payload5 === void 0 ? void 0 : _action$payload5.refresh_token,
|
|
47
|
+
app_id: ((_action$payload6 = action.payload) === null || _action$payload6 === void 0 || (_action$payload6 = _action$payload6.appConfig) === null || _action$payload6 === void 0 ? void 0 : _action$payload6.id) || null
|
|
51
48
|
},
|
|
52
49
|
app: {
|
|
53
50
|
schema: (_action$payload$appCo = action.payload.appConfig) === null || _action$payload$appCo === void 0 ? void 0 : _action$payload$appCo.schema,
|
|
54
51
|
config: null
|
|
55
|
-
}
|
|
52
|
+
}
|
|
53
|
+
// is_saving_user_data: false,
|
|
56
54
|
// config
|
|
57
|
-
|
|
58
55
|
};
|
|
59
56
|
return newState;
|
|
60
|
-
|
|
61
57
|
default:
|
|
62
58
|
newState = state;
|
|
63
59
|
return newState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["initialRowndState","user","data","email","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","newState","type","ActionType","UPDATE_STATE","payload","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 // 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 // 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":"
|
|
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":[],"sources":["config.ts"],"sourcesContent":["export interface IConfig {\n appKey: string;\n apiUrl?: string;\n baseUrl?: string;\n}\n\nexport interface Customizations {\n sheetBackgroundHexColor?: string;\n sheetCornerBorderRadius?: string;\n loadingAnimation?: string;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["config.ts"],"sourcesContent":["export interface IConfig {\n appKey: string;\n apiUrl?: string;\n baseUrl?: string;\n}\n\nexport interface Customizations {\n sheetBackgroundHexColor?: string;\n sheetCornerBorderRadius?: string;\n loadingAnimation?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -14,77 +14,59 @@ exports.requestSignIn = requestSignIn;
|
|
|
14
14
|
exports.setUserData = setUserData;
|
|
15
15
|
exports.setUserDataValue = setUserDataValue;
|
|
16
16
|
exports.signOut = signOut;
|
|
17
|
-
|
|
18
17
|
var _reactNative = require("react-native");
|
|
19
|
-
|
|
20
|
-
const LINKING_ERROR = `The package '@rownd/react-native' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
18
|
+
const LINKING_ERROR = exports.LINKING_ERROR = `The package '@rownd/react-native' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
21
19
|
ios: "- You have run 'pod install'\n",
|
|
22
20
|
default: ''
|
|
23
21
|
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
24
|
-
exports.
|
|
25
|
-
const Rownd = _reactNative.NativeModules.RowndPlugin ? _reactNative.NativeModules.RowndPlugin : new Proxy({}, {
|
|
22
|
+
const Rownd = exports.Rownd = _reactNative.NativeModules.RowndPlugin ? _reactNative.NativeModules.RowndPlugin : new Proxy({}, {
|
|
26
23
|
get() {
|
|
27
24
|
throw new Error(LINKING_ERROR);
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
});
|
|
31
|
-
exports.
|
|
32
|
-
const IOSRowndEventEmitter = _reactNative.Platform.OS !== 'ios' ? null : _reactNative.NativeModules.RowndPluginEventEmitter ? _reactNative.NativeModules.RowndPluginEventEmitter : new Proxy({}, {
|
|
27
|
+
const IOSRowndEventEmitter = exports.IOSRowndEventEmitter = _reactNative.Platform.OS !== 'ios' ? null : _reactNative.NativeModules.RowndPluginEventEmitter ? _reactNative.NativeModules.RowndPluginEventEmitter : new Proxy({}, {
|
|
33
28
|
get() {
|
|
34
29
|
throw new Error(LINKING_ERROR);
|
|
35
30
|
}
|
|
36
|
-
|
|
37
31
|
});
|
|
38
|
-
exports.IOSRowndEventEmitter = IOSRowndEventEmitter;
|
|
39
|
-
|
|
40
32
|
function configure(config) {
|
|
41
33
|
return Rownd.configure(config);
|
|
42
34
|
}
|
|
43
|
-
|
|
44
35
|
function customizations(customizationConfig) {
|
|
45
36
|
return Rownd.customizations(customizationConfig);
|
|
46
37
|
}
|
|
47
|
-
|
|
48
38
|
function requestSignIn(config) {
|
|
49
39
|
if (!config) {
|
|
50
40
|
return Rownd.requestSignIn({
|
|
51
41
|
method: 'default'
|
|
52
42
|
});
|
|
53
43
|
}
|
|
54
|
-
|
|
55
44
|
return Rownd.requestSignIn({
|
|
56
45
|
method: config === null || config === void 0 ? void 0 : config.method,
|
|
57
46
|
postSignInRedirect: config === null || config === void 0 ? void 0 : config.postSignInRedirect,
|
|
58
47
|
intent: config === null || config === void 0 ? void 0 : config.intent
|
|
59
48
|
});
|
|
60
49
|
}
|
|
61
|
-
|
|
62
50
|
function signOut() {
|
|
63
51
|
return Rownd.signOut();
|
|
64
52
|
}
|
|
65
|
-
|
|
66
53
|
function manageAccount() {
|
|
67
54
|
return Rownd.manageAccount();
|
|
68
55
|
}
|
|
69
|
-
|
|
70
56
|
function getAccessToken(token) {
|
|
71
57
|
return Rownd.getAccessToken(token || null);
|
|
72
58
|
}
|
|
73
|
-
|
|
74
59
|
function getFirebaseIdToken() {
|
|
75
60
|
return Rownd.getFirebaseIdToken();
|
|
76
61
|
}
|
|
77
|
-
|
|
78
62
|
function setUserDataValue(key, value) {
|
|
79
63
|
return Rownd.setUserDataValue(key, _reactNative.Platform.OS === 'android' ? {
|
|
80
64
|
value
|
|
81
65
|
} : value);
|
|
82
66
|
}
|
|
83
|
-
|
|
84
67
|
function setUserData(data) {
|
|
85
68
|
return Rownd.setUserData(data);
|
|
86
69
|
}
|
|
87
|
-
|
|
88
70
|
function handleSignInLink(url) {
|
|
89
71
|
return Rownd.handleSignInLink(url);
|
|
90
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LINKING_ERROR","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":"
|
|
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,GACvB,8EAA6E,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,mBAAmB,CAAC;AAClD;AAEO,SAASC,aAAaA,CAACH,MAAsB,EAAE;EACpD,IAAI,CAACA,MAAM,EAAE;IACX,OAAOV,KAAK,CAACa,aAAa,CAAC;MAAEC,MAAM,EAAE;IAAU,CAAC,CAAC;EACnD;EACA,OAAOd,KAAK,CAACa,aAAa,CAAC;IACzBC,MAAM,EAAEJ,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEI,MAAM;IACtBC,kBAAkB,EAAEL,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEK,kBAAkB;IAC9CC,MAAM,EAAEN,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEM;EAClB,CAAC,CAAC;AACJ;AAEO,SAASC,OAAOA,CAAA,EAAG;EACxB,OAAOjB,KAAK,CAACiB,OAAO,CAAC,CAAC;AACxB;AAEO,SAASC,aAAaA,CAAA,EAAG;EAC9B,OAAOlB,KAAK,CAACkB,aAAa,CAAC,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":[]}
|
|
@@ -8,13 +8,11 @@ YellowBox.ignoreWarnings(['Sending `update_state` with no listeners registered.'
|
|
|
8
8
|
YellowBox.ignoreWarnings(['YellowBox has been replaced with LogBox.']);
|
|
9
9
|
export const GlobalContext = /*#__PURE__*/createContext(undefined);
|
|
10
10
|
const eventEmitter = new NativeEventEmitter(IOSRowndEventEmitter || Rownd);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
customizations
|
|
17
|
-
} = _ref;
|
|
11
|
+
const RowndProvider = ({
|
|
12
|
+
children,
|
|
13
|
+
config,
|
|
14
|
+
customizations
|
|
15
|
+
}) => {
|
|
18
16
|
const [state, dispatch] = useReducer(rowndReducer, initialRowndState);
|
|
19
17
|
const value = {
|
|
20
18
|
state,
|
|
@@ -22,7 +20,6 @@ const RowndProvider = _ref => {
|
|
|
22
20
|
};
|
|
23
21
|
useEffect(() => {
|
|
24
22
|
NativeRowndModules.configure(config);
|
|
25
|
-
|
|
26
23
|
if (customizations) {
|
|
27
24
|
NativeRowndModules.customizations(customizations);
|
|
28
25
|
}
|
|
@@ -34,24 +31,21 @@ const RowndProvider = _ref => {
|
|
|
34
31
|
payload: Platform.OS === 'android' ? JSON.parse(event.state) : event
|
|
35
32
|
});
|
|
36
33
|
};
|
|
37
|
-
|
|
38
34
|
const subscription = eventEmitter.addListener('update_state', onSessionConnect);
|
|
39
35
|
if (!subscription) return;
|
|
40
36
|
return () => {
|
|
41
37
|
subscription.remove();
|
|
42
38
|
};
|
|
43
|
-
}, []);
|
|
39
|
+
}, []);
|
|
44
40
|
|
|
41
|
+
// Handle deep linking
|
|
45
42
|
useEffect(() => {
|
|
46
43
|
if (Platform.OS !== 'ios') {
|
|
47
44
|
return;
|
|
48
45
|
}
|
|
49
|
-
|
|
50
46
|
Linking.addEventListener('url', event => NativeRowndModules.handleSignInLink(event.url));
|
|
51
|
-
|
|
52
47
|
(async () => {
|
|
53
48
|
const initialUrl = await Linking.getInitialURL();
|
|
54
|
-
|
|
55
49
|
if (initialUrl) {
|
|
56
50
|
NativeRowndModules.handleSignInLink(initialUrl);
|
|
57
51
|
}
|
|
@@ -61,16 +55,12 @@ const RowndProvider = _ref => {
|
|
|
61
55
|
value: value
|
|
62
56
|
}, children);
|
|
63
57
|
};
|
|
64
|
-
|
|
65
58
|
function useRowndContext() {
|
|
66
59
|
const context = useContext(GlobalContext);
|
|
67
|
-
|
|
68
60
|
if (context === undefined) {
|
|
69
61
|
throw new Error('useGlobalContext must be used within a GlobalContext Provider');
|
|
70
62
|
}
|
|
71
|
-
|
|
72
63
|
return context;
|
|
73
64
|
}
|
|
74
|
-
|
|
75
65
|
export { RowndProvider, useRowndContext };
|
|
76
66
|
//# sourceMappingURL=GlobalContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useReducer","createContext","useEffect","useContext","NativeEventEmitter","YellowBox","Platform","Linking","initialRowndState","rowndReducer","NativeRowndModules","Rownd","IOSRowndEventEmitter","ActionType","ignoreWarnings","GlobalContext","undefined","eventEmitter","RowndProvider","children","config","customizations","state","dispatch","value","configure","appKey","onSessionConnect","event","type","UPDATE_STATE","payload","OS","JSON","parse","subscription","addListener","remove","addEventListener","handleSignInLink","url","initialUrl","getInitialURL","useRowndContext","context","Error"],"sources":["GlobalContext.tsx"],"sourcesContent":["import React, {\n useReducer,\n createContext,\n FunctionComponent,\n useEffect,\n useContext,\n} from 'react';\nimport { NativeEventEmitter, YellowBox, 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\nYellowBox.ignoreWarnings([\n 'Sending `update_state` with no listeners registered.',\n]);\nYellowBox.ignoreWarnings(['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.appKey]);\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,
|
|
1
|
+
{"version":3,"names":["React","useReducer","createContext","useEffect","useContext","NativeEventEmitter","YellowBox","Platform","Linking","initialRowndState","rowndReducer","NativeRowndModules","Rownd","IOSRowndEventEmitter","ActionType","ignoreWarnings","GlobalContext","undefined","eventEmitter","RowndProvider","children","config","customizations","state","dispatch","value","configure","appKey","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, YellowBox, 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\nYellowBox.ignoreWarnings([\n 'Sending `update_state` with no listeners registered.',\n]);\nYellowBox.ignoreWarnings(['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.appKey]);\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,SAAS,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,cAAc;AAC/E,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,SAAS,CAACS,cAAc,CAAC,CACvB,sDAAsD,CACvD,CAAC;AACFT,SAAS,CAACS,cAAc,CAAC,CAAC,0CAA0C,CAAC,CAAC;AAEtE,OAAO,MAAMC,aAAa,gBAAGd,aAAa,CAExCe,SAAS,CAAC;AAEZ,MAAMC,YAAY,GAAG,IAAIb,kBAAkB,CAACQ,oBAAoB,IAAID,KAAK,CAAC;AAE1E,MAAMO,aAA8C,GAAGA,CAAC;EACtDC,QAAQ;EACRC,MAAM;EACNC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGvB,UAAU,CAACS,YAAY,EAAED,iBAAiB,CAAC;EACrE,MAAMgB,KAAK,GAAG;IAAEF,KAAK;IAAEC;EAAS,CAAC;EAEjCrB,SAAS,CAAC,MAAM;IACdQ,kBAAkB,CAACe,SAAS,CAACL,MAAM,CAAC;IACpC,IAAIC,cAAc,EAAE;MAClBX,kBAAkB,CAACW,cAAc,CAACA,cAAc,CAAC;IACnD;EACF,CAAC,EAAE,CAACD,MAAM,CAACM,MAAM,CAAC,CAAC;EAEnBxB,SAAS,CAAC,MAAM;IACd,MAAMyB,gBAAgB,GAAIC,KAAU,IAAK;MACvCL,QAAQ,CAAC;QACPM,IAAI,EAAEhB,UAAU,CAACiB,YAAY;QAC7BC,OAAO,EAAEzB,QAAQ,CAAC0B,EAAE,KAAK,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACN,KAAK,CAACN,KAAK,CAAC,GAAGM;MACjE,CAAC,CAAC;IACJ,CAAC;IACD,MAAMO,YAAY,GAAGlB,YAAY,CAACmB,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;EACAnC,SAAS,CAAC,MAAM;IACd,IAAII,QAAQ,CAAC0B,EAAE,KAAK,KAAK,EAAE;MACzB;IACF;IAEAzB,OAAO,CAAC+B,gBAAgB,CAAC,KAAK,EAAGV,KAAK,IACpClB,kBAAkB,CAAC6B,gBAAgB,CAACX,KAAK,CAACY,GAAG,CAC/C,CAAC;IAED,CAAC,YAAY;MACX,MAAMC,UAAU,GAAG,MAAMlC,OAAO,CAACmC,aAAa,CAAC,CAAC;MAChD,IAAID,UAAU,EAAE;QACd/B,kBAAkB,CAAC6B,gBAAgB,CAACE,UAAU,CAAC;MACjD;IACF,CAAC,EAAE,CAAC;EACN,CAAC,EAAE,EAAE,CAAC;EAEN,oBACE1C,KAAA,CAAA4C,aAAA,CAAC5B,aAAa,CAAC6B,QAAQ;IAACpB,KAAK,EAAEA;EAAM,GAAEL,QAAiC,CAAC;AAE7E,CAAC;AAED,SAAS0B,eAAeA,CAAA,EAAG;EACzB,MAAMC,OAAO,GAAG3C,UAAU,CAACY,aAAa,CAAC;EAEzC,IAAI+B,OAAO,KAAK9B,SAAS,EAAE;IACzB,MAAM,IAAI+B,KAAK,CACb,+DACF,CAAC;EACH;EAEA,OAAOD,OAAO;AAChB;AAEA,SAAS5B,aAAa,EAAE2B,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["GlobalContext.types.ts"],"sourcesContent":["import type { TAction } from '../constants/action';\nimport type { Customizations, IConfig } from '../utils/config';\n\nexport type ContextProps = {\n config: IConfig;\n customizations?: Customizations;\n children?: React.ReactNode;\n};\n\nexport type Dispatch = (action: TAction) => void;\n\nexport type GlobalState = {\n // is_initializing: boolean;\n // is_container_visible: boolean;\n // use_modal: boolean;\n // nav: {\n // current_route: string;\n // route_trigger: string;\n // event_id: string;\n // section: string;\n // options?: any;\n // };\n user: {\n data: {\n id?: string;\n email?: string | null;\n [key: string]: any;\n };\n // needs_refresh?: boolean;\n // redacted: string[];\n };\n auth: {\n access_token: string | null;\n refresh_token: string | null;\n app_id: string | null;\n init_data?: Record<string, any>;\n is_verified_user?: boolean;\n };\n app: {\n id?: string;\n icon?: string;\n icon_content_type?: string;\n config: AppConfig | null;\n schema: AppSchema | null;\n user_verification_field?: string;\n user_verification_fields?: string[];\n };\n // local_acls: Record<string, { shared: boolean }> | null;\n // is_saving_user_data: boolean;\n config?: IConfig;\n};\n\ntype AppSchema = Record<string, SchemaField>;\n\nexport interface SchemaField {\n display_name: string;\n type: string;\n data_category: string;\n required: boolean;\n owned_by: string;\n user_visible: boolean;\n revoke_after: string;\n required_retention: string;\n collection_justification: string;\n opt_out_warning: string;\n}\n\nexport interface AppConfig {\n customizations: {\n primary_color: string;\n };\n default_user_id_format?: string;\n hub: {\n auth: {\n allow_unverified_users?: boolean;\n additional_fields: [\n {\n name: string;\n type: string;\n label: string;\n placeholder?: string;\n options: [\n {\n value: string;\n label: string;\n }\n ];\n }\n ];\n email: {\n from_address: string;\n image: string;\n };\n show_app_icon: boolean;\n };\n customizations: HubCustomizations;\n };\n}\n\nexport interface HubCustomizations {\n rounded_corners: boolean;\n primary_color: string;\n placement: 'bottom-left' | 'hidden';\n offset_x: number;\n offset_y: number;\n property_overrides: Record<string, string>;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["GlobalContext.types.ts"],"sourcesContent":["import type { TAction } from '../constants/action';\nimport type { Customizations, IConfig } from '../utils/config';\n\nexport type ContextProps = {\n config: IConfig;\n customizations?: Customizations;\n children?: React.ReactNode;\n};\n\nexport type Dispatch = (action: TAction) => void;\n\nexport type GlobalState = {\n // is_initializing: boolean;\n // is_container_visible: boolean;\n // use_modal: boolean;\n // nav: {\n // current_route: string;\n // route_trigger: string;\n // event_id: string;\n // section: string;\n // options?: any;\n // };\n user: {\n data: {\n id?: string;\n email?: string | null;\n [key: string]: any;\n };\n isLoading: boolean;\n // needs_refresh?: boolean;\n // redacted: string[];\n };\n auth: {\n access_token: string | null;\n refresh_token: string | null;\n app_id: string | null;\n init_data?: Record<string, any>;\n is_verified_user?: boolean;\n };\n app: {\n id?: string;\n icon?: string;\n icon_content_type?: string;\n config: AppConfig | null;\n schema: AppSchema | null;\n user_verification_field?: string;\n user_verification_fields?: string[];\n };\n // local_acls: Record<string, { shared: boolean }> | null;\n // is_saving_user_data: boolean;\n config?: IConfig;\n};\n\ntype AppSchema = Record<string, SchemaField>;\n\nexport interface SchemaField {\n display_name: string;\n type: string;\n data_category: string;\n required: boolean;\n owned_by: string;\n user_visible: boolean;\n revoke_after: string;\n required_retention: string;\n collection_justification: string;\n opt_out_warning: string;\n}\n\nexport interface AppConfig {\n customizations: {\n primary_color: string;\n };\n default_user_id_format?: string;\n hub: {\n auth: {\n allow_unverified_users?: boolean;\n additional_fields: [\n {\n name: string;\n type: string;\n label: string;\n placeholder?: string;\n options: [\n {\n value: string;\n label: string;\n }\n ];\n }\n ];\n email: {\n from_address: string;\n image: string;\n };\n show_app_icon: boolean;\n };\n customizations: HubCustomizations;\n };\n}\n\nexport interface HubCustomizations {\n rounded_corners: boolean;\n primary_color: string;\n placement: 'bottom-left' | 'hidden';\n offset_x: number;\n offset_y: number;\n property_overrides: Record<string, string>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RowndProvider as RowndReactProvider } from '@rownd/react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
config
|
|
8
|
-
} = _ref;
|
|
3
|
+
const RowndProvider = ({
|
|
4
|
+
children,
|
|
5
|
+
config
|
|
6
|
+
}) => {
|
|
9
7
|
return /*#__PURE__*/React.createElement(RowndReactProvider, {
|
|
10
8
|
appKey: config.appKey,
|
|
11
9
|
apiUrl: config.apiUrl
|
|
12
10
|
}, children);
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
export { RowndProvider };
|
|
16
13
|
//# sourceMappingURL=GlobalContext.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","RowndProvider","RowndReactProvider","children","config","appKey","apiUrl"],"sources":["GlobalContext.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { ContextProps } from './GlobalContext.types';\nimport {\n RowndProvider as RowndReactProvider,\n} 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\n\nexport { RowndProvider };\n"],"mappings":"AAAA,OAAOA,
|
|
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 {\n RowndProvider as RowndReactProvider,\n} 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\n\nexport { RowndProvider };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SACEC,aAAa,IAAIC,kBAAkB,QAC9B,cAAc;AAErB,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;AAGD,SAASF,aAAa","ignoreList":[]}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { useRownd } from '../hooks/rownd';
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
signInProps
|
|
10
|
-
} = _ref;
|
|
4
|
+
const RequireSignIn = ({
|
|
5
|
+
children,
|
|
6
|
+
initializing,
|
|
7
|
+
signInProps
|
|
8
|
+
}) => {
|
|
11
9
|
const {
|
|
12
10
|
is_authenticated,
|
|
13
11
|
is_initializing,
|
|
@@ -15,20 +13,18 @@ const RequireSignIn = _ref => {
|
|
|
15
13
|
} = useRownd();
|
|
16
14
|
useEffect(() => {
|
|
17
15
|
if (!is_authenticated && !is_initializing) {
|
|
18
|
-
requestSignIn({
|
|
16
|
+
requestSignIn({
|
|
17
|
+
...(Platform.OS === 'web' ? {
|
|
19
18
|
prevent_closing: true
|
|
20
19
|
} : undefined),
|
|
21
20
|
...signInProps
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
23
|
}, [is_authenticated, is_initializing, signInProps]);
|
|
25
|
-
|
|
26
24
|
if (is_initializing && initializing) {
|
|
27
25
|
return /*#__PURE__*/React.createElement(React.Fragment, null, initializing);
|
|
28
26
|
}
|
|
29
|
-
|
|
30
27
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
31
28
|
};
|
|
32
|
-
|
|
33
29
|
export default RequireSignIn;
|
|
34
30
|
//# sourceMappingURL=RequireSignIn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRownd","Platform","RequireSignIn","children","initializing","signInProps","is_authenticated","is_initializing","requestSignIn","OS","prevent_closing","undefined"],"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,
|
|
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;EAEpD,IAAIE,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,20 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useRownd } from '../hooks/rownd';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
children
|
|
7
|
-
} = _ref;
|
|
3
|
+
const SignedIn = ({
|
|
4
|
+
children
|
|
5
|
+
}) => {
|
|
8
6
|
const {
|
|
9
7
|
is_authenticated
|
|
10
8
|
} = useRownd();
|
|
11
|
-
|
|
12
9
|
if (!is_authenticated) {
|
|
13
10
|
return null;
|
|
14
11
|
}
|
|
15
|
-
|
|
16
12
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
17
13
|
};
|
|
18
|
-
|
|
19
14
|
export default SignedIn;
|
|
20
15
|
//# sourceMappingURL=SignedIn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRownd","SignedIn","children","is_authenticated"],"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;"],"mappings":"AAAA,OAAOA,
|
|
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;"],"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,20 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useRownd } from '../hooks/rownd';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
children
|
|
7
|
-
} = _ref;
|
|
3
|
+
const SignedOut = ({
|
|
4
|
+
children
|
|
5
|
+
}) => {
|
|
8
6
|
const {
|
|
9
7
|
is_authenticated
|
|
10
8
|
} = useRownd();
|
|
11
|
-
|
|
12
9
|
if (is_authenticated) {
|
|
13
10
|
return null;
|
|
14
11
|
}
|
|
15
|
-
|
|
16
12
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
17
13
|
};
|
|
18
|
-
|
|
19
14
|
export default SignedOut;
|
|
20
15
|
//# sourceMappingURL=SignedOut.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRownd","SignedOut","children","is_authenticated"],"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"],"mappings":"AAAA,OAAOA,
|
|
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"],"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,
|
|
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;AAErB,WAFWA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,KAAVA,UAAU","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"],"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
|
|
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 = 'google' | 'apple' | 'default' | 'guest' | 'passkey';\nexport type RequestSignInIntent = 'sign_in' | 'sign_up';\nexport type RequestSignIn = {method?: RequestSignInMethods, postSignInRedirect?: string, intent?: RequestSignInIntent}\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;AAuC7D,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":[]}
|
|
@@ -25,14 +25,16 @@ export function useRownd() {
|
|
|
25
25
|
is_authenticated,
|
|
26
26
|
is_initializing,
|
|
27
27
|
manageAccount,
|
|
28
|
-
requestSignIn: opts => requestSignIn({
|
|
28
|
+
requestSignIn: opts => requestSignIn({
|
|
29
|
+
...opts,
|
|
29
30
|
post_login_redirect: opts === null || opts === void 0 ? void 0 : opts.postSignInRedirect
|
|
30
31
|
}),
|
|
31
32
|
signOut,
|
|
32
33
|
user: {
|
|
33
34
|
data: user.data,
|
|
34
35
|
setValue: setUserValue,
|
|
35
|
-
set: setUser
|
|
36
|
+
set: setUser,
|
|
37
|
+
isLoading: false // Waiting for react sdk update
|
|
36
38
|
}
|
|
37
39
|
};
|
|
38
40
|
}
|
|
@@ -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"],"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 },\n };\n}\n"],"mappings":"AAAA,SAASA,QAAQ,IAAIC,
|
|
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,CAAC;IACnB;EACF,CAAC;AACH","ignoreList":[]}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RowndProvider","useRownd","RequireSignIn","SignedIn","SignedOut"],"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,SAASA,
|
|
1
|
+
{"version":3,"names":["RowndProvider","useRownd","RequireSignIn","SignedIn","SignedOut"],"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,SAASA,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,QAAQ,QAAQ,eAAe;AACxC,OAAOC,aAAa,MAAM,4BAA4B;AACtD,OAAOC,QAAQ,MAAM,uBAAuB;AAC5C,OAAOC,SAAS,MAAM,wBAAwB;AAE9C,SAASJ,aAAa,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,SAAS","ignoreList":[]}
|