decane-connect-kit 2.2.3 → 2.2.5
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/dist/index.cjs +108 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +108 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -752,6 +752,9 @@ interface SocialWalletModalProps {
|
|
|
752
752
|
authMethods?: Array<"google" | "email">;
|
|
753
753
|
customAuthLabel?: string;
|
|
754
754
|
onCustomAuthSignIn?: () => Promise<void>;
|
|
755
|
+
canUsePasskey?: boolean;
|
|
756
|
+
passkeyAddress?: string | null;
|
|
757
|
+
onPasskeySignIn?: () => Promise<unknown>;
|
|
755
758
|
onRotateShares: (opts: {
|
|
756
759
|
password: string;
|
|
757
760
|
passwordHint?: string;
|
|
@@ -763,7 +766,7 @@ interface SocialWalletModalProps {
|
|
|
763
766
|
rpcUrls?: Record<string, string>;
|
|
764
767
|
chains?: string[];
|
|
765
768
|
}
|
|
766
|
-
declare function SocialWalletModal({ open, onClose, theme, socialAuth, onUnlock, onDisconnect, onGoogleSignIn, onEmailStart, onEmailVerify, authMethods, customAuthLabel, onCustomAuthSignIn, onRotateShares, onExportPortableBackup, rpcUrls, chains, }: SocialWalletModalProps): React.ReactPortal | null;
|
|
769
|
+
declare function SocialWalletModal({ open, onClose, theme, socialAuth, onUnlock, onDisconnect, onGoogleSignIn, onEmailStart, onEmailVerify, authMethods, customAuthLabel, onCustomAuthSignIn, canUsePasskey, passkeyAddress, onPasskeySignIn, onRotateShares, onExportPortableBackup, rpcUrls, chains, }: SocialWalletModalProps): React.ReactPortal | null;
|
|
767
770
|
|
|
768
771
|
declare function DecaneMark({ size, muted }: {
|
|
769
772
|
size?: number;
|
|
@@ -787,6 +790,7 @@ declare function useSocialAuth(): {
|
|
|
787
790
|
solana?: string;
|
|
788
791
|
} | null;
|
|
789
792
|
sessionExpiresAt: number | null;
|
|
793
|
+
canUsePasskey: boolean;
|
|
790
794
|
needsReconnect: boolean;
|
|
791
795
|
googleLoading: boolean;
|
|
792
796
|
emailLoading: boolean;
|
|
@@ -804,6 +808,7 @@ declare function useSocialAuth(): {
|
|
|
804
808
|
providerId?: string;
|
|
805
809
|
}) => Promise<void>;
|
|
806
810
|
signInWithCustomAuth: (() => Promise<void>) | undefined;
|
|
811
|
+
signInWithPasskey: () => Promise<void>;
|
|
807
812
|
unlock: () => Promise<void>;
|
|
808
813
|
disconnect: () => Promise<void>;
|
|
809
814
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -752,6 +752,9 @@ interface SocialWalletModalProps {
|
|
|
752
752
|
authMethods?: Array<"google" | "email">;
|
|
753
753
|
customAuthLabel?: string;
|
|
754
754
|
onCustomAuthSignIn?: () => Promise<void>;
|
|
755
|
+
canUsePasskey?: boolean;
|
|
756
|
+
passkeyAddress?: string | null;
|
|
757
|
+
onPasskeySignIn?: () => Promise<unknown>;
|
|
755
758
|
onRotateShares: (opts: {
|
|
756
759
|
password: string;
|
|
757
760
|
passwordHint?: string;
|
|
@@ -763,7 +766,7 @@ interface SocialWalletModalProps {
|
|
|
763
766
|
rpcUrls?: Record<string, string>;
|
|
764
767
|
chains?: string[];
|
|
765
768
|
}
|
|
766
|
-
declare function SocialWalletModal({ open, onClose, theme, socialAuth, onUnlock, onDisconnect, onGoogleSignIn, onEmailStart, onEmailVerify, authMethods, customAuthLabel, onCustomAuthSignIn, onRotateShares, onExportPortableBackup, rpcUrls, chains, }: SocialWalletModalProps): React.ReactPortal | null;
|
|
769
|
+
declare function SocialWalletModal({ open, onClose, theme, socialAuth, onUnlock, onDisconnect, onGoogleSignIn, onEmailStart, onEmailVerify, authMethods, customAuthLabel, onCustomAuthSignIn, canUsePasskey, passkeyAddress, onPasskeySignIn, onRotateShares, onExportPortableBackup, rpcUrls, chains, }: SocialWalletModalProps): React.ReactPortal | null;
|
|
767
770
|
|
|
768
771
|
declare function DecaneMark({ size, muted }: {
|
|
769
772
|
size?: number;
|
|
@@ -787,6 +790,7 @@ declare function useSocialAuth(): {
|
|
|
787
790
|
solana?: string;
|
|
788
791
|
} | null;
|
|
789
792
|
sessionExpiresAt: number | null;
|
|
793
|
+
canUsePasskey: boolean;
|
|
790
794
|
needsReconnect: boolean;
|
|
791
795
|
googleLoading: boolean;
|
|
792
796
|
emailLoading: boolean;
|
|
@@ -804,6 +808,7 @@ declare function useSocialAuth(): {
|
|
|
804
808
|
providerId?: string;
|
|
805
809
|
}) => Promise<void>;
|
|
806
810
|
signInWithCustomAuth: (() => Promise<void>) | undefined;
|
|
811
|
+
signInWithPasskey: () => Promise<void>;
|
|
807
812
|
unlock: () => Promise<void>;
|
|
808
813
|
disconnect: () => Promise<void>;
|
|
809
814
|
};
|
package/dist/index.js
CHANGED
|
@@ -3790,11 +3790,25 @@ var CSS_VARS = {
|
|
|
3790
3790
|
|
|
3791
3791
|
// src/ui/icons.tsx
|
|
3792
3792
|
import React from "react";
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
const
|
|
3797
|
-
|
|
3793
|
+
function DecaneMark({ size = 28, muted = false }) {
|
|
3794
|
+
const uid = React.useId().replace(/:/g, "");
|
|
3795
|
+
const fid = `dl_logo_f_${uid}`;
|
|
3796
|
+
const w = size;
|
|
3797
|
+
const h = Math.round(size * 64 / 68);
|
|
3798
|
+
return /* @__PURE__ */ React.createElement(
|
|
3799
|
+
"svg",
|
|
3800
|
+
{
|
|
3801
|
+
width: w,
|
|
3802
|
+
height: h,
|
|
3803
|
+
viewBox: "0 0 68 64",
|
|
3804
|
+
fill: "none",
|
|
3805
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3806
|
+
"aria-hidden": true,
|
|
3807
|
+
style: { display: "block", flexShrink: 0, opacity: muted ? 0.55 : 1 }
|
|
3808
|
+
},
|
|
3809
|
+
/* @__PURE__ */ React.createElement("g", { filter: `url(#${fid})` }, /* @__PURE__ */ React.createElement("path", { d: "M32.8031 10.2986C33.1971 9.68929 34.0886 9.68929 34.4826 10.2986L35.7297 12.2273C36.1599 12.8926 35.6823 13.7703 34.89 13.7703H32.3957C31.6034 13.7703 31.1257 12.8926 31.556 12.2273L32.8031 10.2986Z", fill: "#FFD700" }), /* @__PURE__ */ React.createElement("path", { d: "M16.6095 20.8798C25.5139 8.28662 47.0755 12.2298 51.4641 20.5617C54.9502 24.0479 55.2167 30.8018 55.2167 30.8018C55.2167 30.8018 58.8421 37.862 57.4428 41.3601C55.7891 56.7522 13.9381 57.0066 11.3304 41.3601C9.93111 37.0351 13.4293 31.3744 13.4293 31.3744C13.4293 31.3744 12.9841 27.2404 16.6095 20.8798Z", fill: "#FFD700" }), /* @__PURE__ */ React.createElement("ellipse", { cx: "48.9999", cy: "39.2669", rx: "2.38155", ry: "1.89957", transform: "rotate(-22.395 48.9999 39.2669)", fill: "#FFE55F", fillOpacity: "0.45" }), /* @__PURE__ */ React.createElement("ellipse", { cx: "18.9785", cy: "39.2671", rx: "2.38155", ry: "1.89958", transform: "rotate(15.8893 18.9785 39.2671)", fill: "#FFE55F", fillOpacity: "0.26" }), /* @__PURE__ */ React.createElement("path", { d: "M43.5977 30.7344C43.1619 30.7344 42.6943 30.9653 42.3027 31.4824C41.9107 32.0001 41.6388 32.7597 41.6387 33.6406C41.6387 34.5217 41.9107 35.2821 42.3027 35.7998C42.6943 36.3168 43.1619 36.5479 43.5977 36.5479C44.0332 36.5477 44.5002 36.3166 44.8916 35.7998C45.2837 35.2821 45.5557 34.5217 45.5557 33.6406C45.5556 32.7597 45.2836 32.0001 44.8916 31.4824C44.5002 30.9656 44.0333 30.7345 43.5977 30.7344Z", fill: "#1A1A1A", stroke: "#F4EBBC", strokeWidth: "2" }), /* @__PURE__ */ React.createElement("path", { d: "M25.1514 30.7344C25.5871 30.7344 26.0547 30.9653 26.4463 31.4824C26.8383 32.0001 27.1103 32.7597 27.1104 33.6406C27.1104 34.5217 26.8384 35.2821 26.4463 35.7998C26.0547 36.3168 25.5871 36.5479 25.1514 36.5479C24.7158 36.5477 24.2489 36.3166 23.8574 35.7998C23.4654 35.2821 23.1934 34.5217 23.1934 33.6406C23.1934 32.7597 23.4654 32.0001 23.8574 31.4824C24.2489 30.9656 24.7157 30.7345 25.1514 30.7344Z", fill: "#1A1A1A", stroke: "#F4EBBC", strokeWidth: "2" }), /* @__PURE__ */ React.createElement("path", { d: "M26.0107 41.6924C26.0107 41.6924 28.0937 46.399 34.759 46.399C41.008 46.399 43.3109 41.6924 43.3109 41.6924", stroke: "#1A1A1A", strokeLinecap: "round" })),
|
|
3810
|
+
/* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("filter", { id: fid, x: "0.589964", y: "0.334365", width: "66.5809", height: "62.9754", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ React.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ React.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }), /* @__PURE__ */ React.createElement("feOffset", { dx: "-0.501447", dy: "0.401157" }), /* @__PURE__ */ React.createElement("feGaussianBlur", { stdDeviation: "4.95429" }), /* @__PURE__ */ React.createElement("feComposite", { in2: "hardAlpha", operator: "out" }), /* @__PURE__ */ React.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0.996078 0 0 0 0 0.996078 0 0 0 0 0.996078 0 0 0 0.12 0" }), /* @__PURE__ */ React.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ React.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })))
|
|
3811
|
+
);
|
|
3798
3812
|
}
|
|
3799
3813
|
function DecaneWordmark({ size = 15, muted = false }) {
|
|
3800
3814
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -4803,7 +4817,10 @@ function SignInView({
|
|
|
4803
4817
|
authMethods,
|
|
4804
4818
|
resumeHint,
|
|
4805
4819
|
customAuthLabel,
|
|
4806
|
-
onCustomAuthSignIn
|
|
4820
|
+
onCustomAuthSignIn,
|
|
4821
|
+
canUsePasskey,
|
|
4822
|
+
passkeyAddress,
|
|
4823
|
+
onPasskeySignIn
|
|
4807
4824
|
}) {
|
|
4808
4825
|
const [googleLoading, setGoogleLoading] = useState2(false);
|
|
4809
4826
|
const [email, setEmail] = useState2("");
|
|
@@ -4811,7 +4828,25 @@ function SignInView({
|
|
|
4811
4828
|
const [emailSent, setEmailSent] = useState2(false);
|
|
4812
4829
|
const [emailLoading, setEmailLoading] = useState2(false);
|
|
4813
4830
|
const [customLoading, setCustomLoading] = useState2(false);
|
|
4831
|
+
const [passkeyLoading, setPasskeyLoading] = useState2(false);
|
|
4832
|
+
const [showOtherMethods, setShowOtherMethods] = useState2(false);
|
|
4814
4833
|
const [error, setError] = useState2("");
|
|
4834
|
+
const passkeyFirst = !!canUsePasskey && !!onPasskeySignIn && !showOtherMethods;
|
|
4835
|
+
async function handlePasskey() {
|
|
4836
|
+
if (!onPasskeySignIn) return;
|
|
4837
|
+
setError("");
|
|
4838
|
+
setPasskeyLoading(true);
|
|
4839
|
+
try {
|
|
4840
|
+
await onPasskeySignIn();
|
|
4841
|
+
} catch (e) {
|
|
4842
|
+
const err = e;
|
|
4843
|
+
if (err?.name !== "UserCancelledError") {
|
|
4844
|
+
setError(err?.message ?? "Passkey sign-in failed");
|
|
4845
|
+
setShowOtherMethods(true);
|
|
4846
|
+
}
|
|
4847
|
+
setPasskeyLoading(false);
|
|
4848
|
+
}
|
|
4849
|
+
}
|
|
4815
4850
|
async function handleGoogle() {
|
|
4816
4851
|
setError("");
|
|
4817
4852
|
setGoogleLoading(true);
|
|
@@ -4871,7 +4906,47 @@ function SignInView({
|
|
|
4871
4906
|
fontFamily: "inherit",
|
|
4872
4907
|
boxSizing: "border-box"
|
|
4873
4908
|
};
|
|
4874
|
-
return /* @__PURE__ */ React3.createElement("div", { style: { padding: "0 16px 16px" } }, resumeHint && /* @__PURE__ */ React3.createElement("div", { style: { fontSize: 12, color: "var(--dc-text-muted)", marginBottom: 12, textAlign: "center" } }, "Welcome back \u2014 sign in again to resume ", resumeHint),
|
|
4909
|
+
return /* @__PURE__ */ React3.createElement("div", { style: { padding: "0 16px 16px" } }, resumeHint && !passkeyFirst && /* @__PURE__ */ React3.createElement("div", { style: { fontSize: 12, color: "var(--dc-text-muted)", marginBottom: 12, textAlign: "center" } }, "Welcome back \u2014 sign in again to resume ", resumeHint), passkeyFirst && /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement("div", { style: { fontSize: 12, color: "var(--dc-text-muted)", marginBottom: 12, textAlign: "center" } }, "Welcome back \u2014 unlock to resume", passkeyAddress ? ` ${passkeyAddress.slice(0, 6)}\u2026${passkeyAddress.slice(-4)}` : ""), /* @__PURE__ */ React3.createElement(
|
|
4910
|
+
"button",
|
|
4911
|
+
{
|
|
4912
|
+
onClick: handlePasskey,
|
|
4913
|
+
disabled: passkeyLoading,
|
|
4914
|
+
style: {
|
|
4915
|
+
width: "100%",
|
|
4916
|
+
padding: "11px 0",
|
|
4917
|
+
background: "var(--dc-accent)",
|
|
4918
|
+
color: "var(--dc-accent-text)",
|
|
4919
|
+
border: "none",
|
|
4920
|
+
borderRadius: 10,
|
|
4921
|
+
fontSize: 13,
|
|
4922
|
+
fontWeight: 700,
|
|
4923
|
+
cursor: passkeyLoading ? "not-allowed" : "pointer",
|
|
4924
|
+
opacity: passkeyLoading ? 0.7 : 1,
|
|
4925
|
+
fontFamily: "inherit",
|
|
4926
|
+
display: "flex",
|
|
4927
|
+
alignItems: "center",
|
|
4928
|
+
justifyContent: "center",
|
|
4929
|
+
gap: 7
|
|
4930
|
+
}
|
|
4931
|
+
},
|
|
4932
|
+
passkeyLoading ? "Verifying\u2026" : "\u{1F513} Continue with passkey"
|
|
4933
|
+
), /* @__PURE__ */ React3.createElement(
|
|
4934
|
+
"button",
|
|
4935
|
+
{
|
|
4936
|
+
onClick: () => setShowOtherMethods(true),
|
|
4937
|
+
style: {
|
|
4938
|
+
width: "100%",
|
|
4939
|
+
marginTop: 10,
|
|
4940
|
+
background: "none",
|
|
4941
|
+
border: "none",
|
|
4942
|
+
color: "var(--dc-text-muted)",
|
|
4943
|
+
fontSize: 12,
|
|
4944
|
+
cursor: "pointer",
|
|
4945
|
+
fontFamily: "inherit"
|
|
4946
|
+
}
|
|
4947
|
+
},
|
|
4948
|
+
"Use email or Google instead"
|
|
4949
|
+
), error && /* @__PURE__ */ React3.createElement("div", { style: { marginTop: 10, fontSize: 12, color: "var(--dc-danger, #ff5533)" } }, error)), !passkeyFirst && authMethods.includes("google") && /* @__PURE__ */ React3.createElement(
|
|
4875
4950
|
"button",
|
|
4876
4951
|
{
|
|
4877
4952
|
onClick: handleGoogle,
|
|
@@ -4892,7 +4967,7 @@ function SignInView({
|
|
|
4892
4967
|
}
|
|
4893
4968
|
},
|
|
4894
4969
|
googleLoading ? "Redirecting\u2026" : "Continue with Google"
|
|
4895
|
-
), authMethods.includes("email") && /* @__PURE__ */ React3.createElement(React3.Fragment, null, authMethods.includes("google") && /* @__PURE__ */ React3.createElement("div", { style: { textAlign: "center", color: "var(--dc-text-muted)", fontSize: 12, margin: "10px 0" } }, "\u2014 or \u2014"), !emailSent ? /* @__PURE__ */ React3.createElement("form", { onSubmit: handleEmailStart, style: { display: "flex", gap: 8 } }, /* @__PURE__ */ React3.createElement(
|
|
4970
|
+
), !passkeyFirst && authMethods.includes("email") && /* @__PURE__ */ React3.createElement(React3.Fragment, null, authMethods.includes("google") && /* @__PURE__ */ React3.createElement("div", { style: { textAlign: "center", color: "var(--dc-text-muted)", fontSize: 12, margin: "10px 0" } }, "\u2014 or \u2014"), !emailSent ? /* @__PURE__ */ React3.createElement("form", { onSubmit: handleEmailStart, style: { display: "flex", gap: 8 } }, /* @__PURE__ */ React3.createElement(
|
|
4896
4971
|
"input",
|
|
4897
4972
|
{
|
|
4898
4973
|
type: "email",
|
|
@@ -4931,7 +5006,7 @@ function SignInView({
|
|
|
4931
5006
|
fontWeight: 700,
|
|
4932
5007
|
cursor: "pointer",
|
|
4933
5008
|
fontFamily: "inherit"
|
|
4934
|
-
} }, emailLoading ? "\u2026" : "Verify"))), customAuthLabel && onCustomAuthSignIn && /* @__PURE__ */ React3.createElement(React3.Fragment, null, (authMethods.includes("google") || authMethods.includes("email")) && /* @__PURE__ */ React3.createElement("div", { style: { textAlign: "center", color: "var(--dc-text-muted)", fontSize: 12, margin: "10px 0" } }, "\u2014 or \u2014"), /* @__PURE__ */ React3.createElement(
|
|
5009
|
+
} }, emailLoading ? "\u2026" : "Verify"))), !passkeyFirst && customAuthLabel && onCustomAuthSignIn && /* @__PURE__ */ React3.createElement(React3.Fragment, null, (authMethods.includes("google") || authMethods.includes("email")) && /* @__PURE__ */ React3.createElement("div", { style: { textAlign: "center", color: "var(--dc-text-muted)", fontSize: 12, margin: "10px 0" } }, "\u2014 or \u2014"), /* @__PURE__ */ React3.createElement(
|
|
4935
5010
|
"button",
|
|
4936
5011
|
{
|
|
4937
5012
|
onClick: handleCustomAuth,
|
|
@@ -5070,6 +5145,9 @@ function SocialWalletModal({
|
|
|
5070
5145
|
authMethods = ["google", "email"],
|
|
5071
5146
|
customAuthLabel,
|
|
5072
5147
|
onCustomAuthSignIn,
|
|
5148
|
+
canUsePasskey,
|
|
5149
|
+
passkeyAddress,
|
|
5150
|
+
onPasskeySignIn,
|
|
5073
5151
|
onRotateShares,
|
|
5074
5152
|
onExportPortableBackup,
|
|
5075
5153
|
rpcUrls,
|
|
@@ -5171,17 +5249,7 @@ function SocialWalletModal({
|
|
|
5171
5249
|
top: 0,
|
|
5172
5250
|
zIndex: 1,
|
|
5173
5251
|
background: "linear-gradient(90deg, transparent, var(--dc-accent) 30%, var(--dc-accent) 70%, transparent)"
|
|
5174
|
-
} }), /* @__PURE__ */ React3.createElement("div", { style: { padding: "18px 20px 16px", display: "flex", alignItems: "center", gap: 11 } }, /* @__PURE__ */ React3.createElement("div", { style: {
|
|
5175
|
-
width: 38,
|
|
5176
|
-
height: 38,
|
|
5177
|
-
borderRadius: 11,
|
|
5178
|
-
background: "var(--dc-surface)",
|
|
5179
|
-
border: "1px solid var(--dc-border)",
|
|
5180
|
-
display: "flex",
|
|
5181
|
-
alignItems: "center",
|
|
5182
|
-
justifyContent: "center",
|
|
5183
|
-
flexShrink: 0
|
|
5184
|
-
} }, /* @__PURE__ */ React3.createElement(DecaneMark, { size: 22 })), /* @__PURE__ */ React3.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", alignItems: "baseline", gap: 6 } }, /* @__PURE__ */ React3.createElement(DecaneWordmark, { size: 15 }), /* @__PURE__ */ React3.createElement("span", { style: { fontSize: 13, fontWeight: 700, color: "var(--dc-text-muted)", letterSpacing: "-0.01em" } }, "wallet")), /* @__PURE__ */ React3.createElement("div", { style: { fontSize: 11, color: "var(--dc-text-muted)", marginTop: 2 } }, "Non-custodial \xB7 key split three ways")), /* @__PURE__ */ React3.createElement(
|
|
5252
|
+
} }), /* @__PURE__ */ React3.createElement("div", { style: { padding: "18px 20px 16px", display: "flex", alignItems: "center", gap: 11 } }, /* @__PURE__ */ React3.createElement(DecaneMark, { size: 38 }), /* @__PURE__ */ React3.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", alignItems: "baseline", gap: 6 } }, /* @__PURE__ */ React3.createElement(DecaneWordmark, { size: 15 }), /* @__PURE__ */ React3.createElement("span", { style: { fontSize: 13, fontWeight: 700, color: "var(--dc-text-muted)", letterSpacing: "-0.01em" } }, "wallet")), /* @__PURE__ */ React3.createElement("div", { style: { fontSize: 11, color: "var(--dc-text-muted)", marginTop: 2 } }, "Non-custodial \xB7 key split three ways")), /* @__PURE__ */ React3.createElement(
|
|
5185
5253
|
"button",
|
|
5186
5254
|
{
|
|
5187
5255
|
onClick: onClose,
|
|
@@ -5210,7 +5278,10 @@ function SocialWalletModal({
|
|
|
5210
5278
|
authMethods,
|
|
5211
5279
|
resumeHint: socialAuth.needsReconnect ? "your wallet" : void 0,
|
|
5212
5280
|
customAuthLabel,
|
|
5213
|
-
onCustomAuthSignIn
|
|
5281
|
+
onCustomAuthSignIn,
|
|
5282
|
+
canUsePasskey,
|
|
5283
|
+
passkeyAddress,
|
|
5284
|
+
onPasskeySignIn
|
|
5214
5285
|
}
|
|
5215
5286
|
) : /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("div", { style: {
|
|
5216
5287
|
margin: "0 16px 14px",
|
|
@@ -5605,6 +5676,9 @@ function DecaneKit({ config, children }) {
|
|
|
5605
5676
|
onEmailStart: connectWithEmail,
|
|
5606
5677
|
onEmailVerify: verifyEmailCode2,
|
|
5607
5678
|
authMethods: config?.social?.authMethods ?? ["google", "email"],
|
|
5679
|
+
canUsePasskey: socialAuth.canUsePasskey,
|
|
5680
|
+
passkeyAddress: socialAuth.addresses?.evm ?? socialAuth.addresses?.solana ?? null,
|
|
5681
|
+
onPasskeySignIn: signInWithPasskey,
|
|
5608
5682
|
onRotateShares: socialRotateShares,
|
|
5609
5683
|
onExportPortableBackup: socialExportPortableBackup,
|
|
5610
5684
|
rpcUrls: config?.social?.rpcUrls,
|
|
@@ -5634,6 +5708,7 @@ function useSocialAuth() {
|
|
|
5634
5708
|
connectWithToken,
|
|
5635
5709
|
customAuthLabel,
|
|
5636
5710
|
connectWithCustomAuth,
|
|
5711
|
+
signInWithPasskey: ctxSignInWithPasskey,
|
|
5637
5712
|
socialUnlock,
|
|
5638
5713
|
socialDisconnect
|
|
5639
5714
|
} = useDecaneContext();
|
|
@@ -5702,6 +5777,15 @@ function useSocialAuth() {
|
|
|
5702
5777
|
setCustomLoading(false);
|
|
5703
5778
|
}
|
|
5704
5779
|
}, [connectWithCustomAuth]);
|
|
5780
|
+
const signInWithPasskey = useCallback4(async () => {
|
|
5781
|
+
setError(null);
|
|
5782
|
+
try {
|
|
5783
|
+
await ctxSignInWithPasskey();
|
|
5784
|
+
} catch (e) {
|
|
5785
|
+
setError(e.message);
|
|
5786
|
+
throw e;
|
|
5787
|
+
}
|
|
5788
|
+
}, [ctxSignInWithPasskey]);
|
|
5705
5789
|
const unlock = useCallback4(async () => {
|
|
5706
5790
|
setError(null);
|
|
5707
5791
|
try {
|
|
@@ -5726,6 +5810,8 @@ function useSocialAuth() {
|
|
|
5726
5810
|
isNewUser: socialAuth.isNewUser,
|
|
5727
5811
|
addresses: socialAuth.addresses,
|
|
5728
5812
|
sessionExpiresAt: socialAuth.sessionExpiresAt,
|
|
5813
|
+
// True when this device can skip the full sign-in and resume with a passkey.
|
|
5814
|
+
canUsePasskey: socialAuth.canUsePasskey,
|
|
5729
5815
|
// True when addresses are known (from a previous visit) but there's no
|
|
5730
5816
|
// live session — unlock() will always throw in this state (every
|
|
5731
5817
|
// unlock requires a fresh JWT, and JWTs are never persisted). Route
|
|
@@ -5743,6 +5829,7 @@ function useSocialAuth() {
|
|
|
5743
5829
|
confirmEmailCode,
|
|
5744
5830
|
signInWithToken,
|
|
5745
5831
|
signInWithCustomAuth: connectWithCustomAuth ? signInWithCustomAuth : void 0,
|
|
5832
|
+
signInWithPasskey,
|
|
5746
5833
|
unlock,
|
|
5747
5834
|
disconnect
|
|
5748
5835
|
};
|