@coinbase/cdp-react 0.0.61 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as m, useContext as l, useMemo as i } from "react";
|
|
3
3
|
import { useAppConfig as f } from "../CDPReactProvider/index.js";
|
|
4
4
|
import "@coinbase/cdp-hooks";
|
|
5
5
|
import { useSignInReducer as p } from "./useSignInReducer.js";
|
|
6
|
-
const
|
|
6
|
+
const a = {
|
|
7
7
|
authMethod: "email",
|
|
8
8
|
authMethods: ["email"],
|
|
9
9
|
canResetOTP: !1,
|
|
@@ -15,28 +15,31 @@ const r = {
|
|
|
15
15
|
otp: "",
|
|
16
16
|
phoneNumber: "",
|
|
17
17
|
step: "credentials"
|
|
18
|
-
},
|
|
19
|
-
state:
|
|
18
|
+
}, u = m({
|
|
19
|
+
state: a,
|
|
20
20
|
dispatch: () => {
|
|
21
21
|
}
|
|
22
|
-
}),
|
|
23
|
-
const t =
|
|
22
|
+
}), M = () => {
|
|
23
|
+
const t = l(u);
|
|
24
24
|
if (!t)
|
|
25
25
|
throw new Error("useSignInContext must be used within a SignInProvider");
|
|
26
26
|
return t;
|
|
27
|
-
},
|
|
27
|
+
}, v = ({
|
|
28
28
|
children: t,
|
|
29
|
-
authMethods:
|
|
29
|
+
authMethods: n
|
|
30
30
|
}) => {
|
|
31
|
-
const { authMethods:
|
|
32
|
-
...
|
|
33
|
-
authMethod:
|
|
34
|
-
authMethods:
|
|
35
|
-
}),
|
|
36
|
-
|
|
31
|
+
const { authMethods: o } = f(), e = i(() => n?.filter((d) => o.includes(d)) ?? o, [n, o]), [s, r] = p({
|
|
32
|
+
...a,
|
|
33
|
+
authMethod: e?.[0] || "email",
|
|
34
|
+
authMethods: e
|
|
35
|
+
}), c = i(
|
|
36
|
+
() => ({ state: { ...s, authMethods: e }, dispatch: r }),
|
|
37
|
+
[s, r, e]
|
|
38
|
+
);
|
|
39
|
+
return /* @__PURE__ */ h(u.Provider, { value: c, children: t });
|
|
37
40
|
};
|
|
38
41
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
u as SignInContext,
|
|
43
|
+
v as SignInProvider,
|
|
44
|
+
M as useSignInContext
|
|
42
45
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { useReducer as
|
|
1
|
+
import { useReducer as u } from "react";
|
|
2
2
|
import "@coinbase/cdp-hooks";
|
|
3
3
|
import "../CDPReactProvider/index.js";
|
|
4
4
|
function l(e, r) {
|
|
5
5
|
switch (r.type) {
|
|
6
|
+
case "SET_AUTH_METHODS":
|
|
7
|
+
return {
|
|
8
|
+
...e,
|
|
9
|
+
authMethods: r.payload.authMethods
|
|
10
|
+
};
|
|
6
11
|
case "SET_AUTH_METHOD":
|
|
7
12
|
return {
|
|
8
13
|
...e,
|
|
@@ -87,7 +92,7 @@ function l(e, r) {
|
|
|
87
92
|
throw new Error("Unknown action type");
|
|
88
93
|
}
|
|
89
94
|
}
|
|
90
|
-
const s = (e) =>
|
|
95
|
+
const s = (e) => u(l, e);
|
|
91
96
|
export {
|
|
92
97
|
s as useSignInReducer
|
|
93
98
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.62",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@internationalized/number": "3.6.4",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": ">=18.2.0 <19.2.0",
|
|
18
|
-
"@coinbase/cdp-core": "^0.0.
|
|
19
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
18
|
+
"@coinbase/cdp-core": "^0.0.62",
|
|
19
|
+
"@coinbase/cdp-hooks": "^0.0.62"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@size-limit/preset-big-lib": "^11.2.0",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"vite": "^7.0.4",
|
|
47
47
|
"vite-plugin-dts": "^4.5.4",
|
|
48
48
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
49
|
-
"@coinbase/cdp-core": "^0.0.
|
|
50
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
49
|
+
"@coinbase/cdp-core": "^0.0.62",
|
|
50
|
+
"@coinbase/cdp-hooks": "^0.0.62"
|
|
51
51
|
},
|
|
52
52
|
"size-limit": [
|
|
53
53
|
{
|