@swype-org/react-sdk 0.2.29 → 0.2.31
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 +20 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -28
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -244,9 +244,6 @@ async function checkServerForPasskeyByToken(authToken, apiBaseUrl, verificationT
|
|
|
244
244
|
function shouldUsePasskeySignupPopup() {
|
|
245
245
|
return isSafari() && isInCrossOriginIframe();
|
|
246
246
|
}
|
|
247
|
-
function shouldUsePasskeyLoginPopup() {
|
|
248
|
-
return isSafari() && isInCrossOriginIframe();
|
|
249
|
-
}
|
|
250
247
|
var SIGNUP_POPUP_TIMEOUT_MS = 12e4;
|
|
251
248
|
function signupWithPasskeyViaPopup() {
|
|
252
249
|
return new Promise((resolve, reject) => {
|
|
@@ -3501,7 +3498,7 @@ var FALLBACK = "Biometric verification";
|
|
|
3501
3498
|
function getDeviceBiometricUnlockText() {
|
|
3502
3499
|
const ua = typeof navigator !== "undefined" && typeof navigator.userAgent === "string" ? navigator.userAgent : "";
|
|
3503
3500
|
if (/iPhone|iPad|iPod/i.test(ua)) {
|
|
3504
|
-
return "Face ID
|
|
3501
|
+
return "Face ID";
|
|
3505
3502
|
}
|
|
3506
3503
|
if (/Android/i.test(ua)) {
|
|
3507
3504
|
return "Fingerprint or face unlock";
|
|
@@ -6658,7 +6655,7 @@ function isPreciseMoneyNonPositive(fee) {
|
|
|
6658
6655
|
return Number.isFinite(n) && n <= 0;
|
|
6659
6656
|
}
|
|
6660
6657
|
function formatNonPositiveFeeDisplay(fee) {
|
|
6661
|
-
return "
|
|
6658
|
+
return "< $0.01";
|
|
6662
6659
|
}
|
|
6663
6660
|
function formatPreciseMoneyForDisplay(fee) {
|
|
6664
6661
|
const raw = fee.value.trim();
|
|
@@ -6727,7 +6724,6 @@ function GuestTokenPickerScreen({
|
|
|
6727
6724
|
const [limitInputValue, setLimitInputValue] = react.useState("");
|
|
6728
6725
|
const limitInputRef = react.useRef(null);
|
|
6729
6726
|
const [managingAllowance, setManagingAllowance] = react.useState(false);
|
|
6730
|
-
const biometricText = getDeviceBiometricUnlockText();
|
|
6731
6727
|
react.useEffect(() => {
|
|
6732
6728
|
if (!tokenListOpen) return;
|
|
6733
6729
|
const handleMouseDown = (e) => {
|
|
@@ -6761,8 +6757,6 @@ function GuestTokenPickerScreen({
|
|
|
6761
6757
|
const canConfirm = Boolean(pendingEntry && !quoteLoading && (!confirmNeedsQuote || quoteFee));
|
|
6762
6758
|
const ctaLabel = confirmLabel ?? (variant === "auth-setup" ? "Continue" : providerName ? `Open ${providerName} to Deposit` : "Open Wallet to Deposit");
|
|
6763
6759
|
const tokenCardLabel = selectionLabel ?? (variant === "auth-setup" ? "Token for one-tap" : "Deposit");
|
|
6764
|
-
const oneTapSubtitle = variant === "auth-setup" ? `Skip wallet next time \u2014 just ${biometricText}` : `Skip ${providerName ?? "wallet"} next time \u2014 just ${biometricText}`;
|
|
6765
|
-
const oneTapBody = variant === "auth-setup" ? `Future deposits up to your allowance are confirmed with just ${biometricText} \u2014 no wallet pop-up.` : `Future deposits up to your allowance are confirmed with just ${biometricText} \u2014 no wallet pop-up. You'll re-authorize with ${providerName ?? "your wallet"} when you need to top up.`;
|
|
6766
6760
|
const feeLine = (() => {
|
|
6767
6761
|
if (quoteLoading && pendingEntry) {
|
|
6768
6762
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: feeRowContainerStyle2, "aria-live": "polite", children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: feeRowLabelStyle2(t.textMuted), children: "Getting fee estimate\u2026" }) });
|
|
@@ -6979,10 +6973,25 @@ function GuestTokenPickerScreen({
|
|
|
6979
6973
|
!tokenListOpen && !isBridging && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: oneTapCardStyle(t, oneTapEnabled), children: [
|
|
6980
6974
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: oneTapHeaderRowStyle, children: [
|
|
6981
6975
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: oneTapHeaderLeftStyle, children: [
|
|
6982
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: lightningIconStyle, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "
|
|
6976
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: lightningIconStyle, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "36", height: "36", viewBox: "0 0 80 80", children: /* @__PURE__ */ jsxRuntime.jsx("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ jsxRuntime.jsx("g", { fill: "#000000", children: /* @__PURE__ */ jsxRuntime.jsx("g", { children: /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
6977
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { fillRule: "nonzero", children: [
|
|
6978
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4.11428571,21.9428571 L4.11428571,13.0285714 C4.11428571,7.99327149 7.99327149,4.11428571 13.0285714,4.11428571 L21.9428571,4.11428571 C23.0789858,4.11428571 24,3.19327149 24,2.05714286 C24,0.921014229 23.0789858,0 21.9428571,0 L13.0285714,0 C5.72101423,0 0,5.72101423 0,13.0285714 L0,21.9428571 C0,23.0789858 0.921014229,24 2.05714286,24 C3.19327149,24 4.11428571,23.0789858 4.11428571,21.9428571 Z" }),
|
|
6979
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4.11428571,21.9428571 L4.11428571,13.0285714 C4.11428571,7.99327149 7.99327149,4.11428571 13.0285714,4.11428571 L21.9428571,4.11428571 C23.0789858,4.11428571 24,3.19327149 24,2.05714286 C24,0.921014229 23.0789858,0 21.9428571,0 L13.0285714,0 C5.72101423,0 0,5.72101423 0,13.0285714 L0,21.9428571 C0,23.0789858 0.921014229,24 2.05714286,24 C3.19327149,24 4.11428571,23.0789858 4.11428571,21.9428571 Z", transform: "translate(68.070175, 11.929825) scale(-1, 1) translate(-68.070175, -11.929825) translate(56.140351, 0.000000)" }),
|
|
6980
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4.11428571,21.9428571 L4.11428571,13.0285714 C4.11428571,7.99327149 7.99327149,4.11428571 13.0285714,4.11428571 L21.9428571,4.11428571 C23.0789858,4.11428571 24,3.19327149 24,2.05714286 C24,0.921014229 23.0789858,0 21.9428571,0 L13.0285714,0 C5.72101423,0 0,5.72101423 0,13.0285714 L0,21.9428571 C0,23.0789858 0.921014229,24 2.05714286,24 C3.19327149,24 4.11428571,23.0789858 4.11428571,21.9428571 Z", transform: "translate(11.929825, 68.070175) scale(1, -1) translate(-11.929825, -68.070175) translate(0.000000, 56.140351)" }),
|
|
6981
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4.11428571,21.9428571 L4.11428571,13.0285714 C4.11428571,7.99327149 7.99327149,4.11428571 13.0285714,4.11428571 L21.9428571,4.11428571 C23.0789858,4.11428571 24,3.19327149 24,2.05714286 C24,0.921014229 23.0789858,0 21.9428571,0 L13.0285714,0 C5.72101423,0 0,5.72101423 0,13.0285714 L0,21.9428571 C0,23.0789858 0.921014229,24 2.05714286,24 C3.19327149,24 4.11428571,23.0789858 4.11428571,21.9428571 Z", transform: "translate(68.070175, 68.070175) scale(-1, -1) translate(-68.070175, -68.070175) translate(56.140351, 56.140351)" })
|
|
6982
|
+
] }),
|
|
6983
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { transform: "translate(21.754386, 28.070175)", fillRule: "nonzero", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0,2.14285714 L0,7.86037654 C0,9.04384386 0.8954305,10.0032337 2,10.0032337 C3.1045695,10.0032337 4,9.04384386 4,7.86037654 L4,2.14285714 C4,0.959389822 3.1045695,0 2,0 C0.8954305,0 0,0.959389822 0,2.14285714 Z" }) }),
|
|
6984
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { transform: "translate(54.736842, 28.070175)", fillRule: "nonzero", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0,2.14285714 L0,7.86037654 C0,9.04384386 0.8954305,10.0032337 2,10.0032337 C3.1045695,10.0032337 4,9.04384386 4,7.86037654 L4,2.14285714 C4,0.959389822 3.1045695,0 2,0 C0.8954305,0 0,0.959389822 0,2.14285714 Z" }) }),
|
|
6985
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M25.9319616,59.0829234 C29.8331111,62.7239962 34.5578726,64.5614035 40,64.5614035 C45.4421274,64.5614035 50.1668889,62.7239962 54.0680384,59.0829234 C54.9180398,58.2895887 54.9639773,56.9574016 54.1706427,56.1074002 C53.377308,55.2573988 52.0451209,55.2114613 51.1951195,56.0047959 C48.0787251,58.9134307 44.382434,60.3508772 40,60.3508772 C35.617566,60.3508772 31.9212749,58.9134307 28.8048805,56.0047959 C27.9548791,55.2114613 26.622692,55.2573988 25.8293573,56.1074002 C25.0360227,56.9574016 25.0819602,58.2895887 25.9319616,59.0829234 Z", fillRule: "nonzero" }),
|
|
6986
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M40,30.1754386 L40,44.9122807 C40,45.85537 39.539042,46.3157895 38.5912711,46.3157895 L37.1929825,46.3157895 C36.0302777,46.3157895 35.0877193,47.2583479 35.0877193,48.4210526 C35.0877193,49.5837574 36.0302777,50.5263158 37.1929825,50.5263158 L38.5912711,50.5263158 C41.8633505,50.5263158 44.2105263,48.1818819 44.2105263,44.9122807 L44.2105263,30.1754386 C44.2105263,29.0127339 43.2679679,28.0701754 42.1052632,28.0701754 C40.9425584,28.0701754 40,29.0127339 40,30.1754386 Z", fillRule: "nonzero" })
|
|
6987
|
+
] }) }) }) }) }) }),
|
|
6983
6988
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6984
|
-
/* @__PURE__ */ jsxRuntime.
|
|
6985
|
-
|
|
6989
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: oneTapTitleStyle(t.text), children: [
|
|
6990
|
+
"Deposit with ",
|
|
6991
|
+
getDeviceBiometricUnlockText(),
|
|
6992
|
+
" next time"
|
|
6993
|
+
] }),
|
|
6994
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: oneTapSubtitleStyle(t.textMuted), children: "No need to reopen your wallet every time. Your money stays under your control." })
|
|
6986
6995
|
] })
|
|
6987
6996
|
] }),
|
|
6988
6997
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6999,7 +7008,6 @@ function GuestTokenPickerScreen({
|
|
|
6999
7008
|
)
|
|
7000
7009
|
] }),
|
|
7001
7010
|
oneTapEnabled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7002
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: oneTapBodyStyle(t.textMuted), children: oneTapBody }),
|
|
7003
7011
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7004
7012
|
"button",
|
|
7005
7013
|
{
|
|
@@ -7324,8 +7332,6 @@ var oneTapHeaderLeftStyle = {
|
|
|
7324
7332
|
var lightningIconStyle = {
|
|
7325
7333
|
width: 36,
|
|
7326
7334
|
height: 36,
|
|
7327
|
-
borderRadius: 10,
|
|
7328
|
-
background: "linear-gradient(135deg, #e8f5e9 0%, #fffde7 100%)",
|
|
7329
7335
|
display: "flex",
|
|
7330
7336
|
alignItems: "center",
|
|
7331
7337
|
justifyContent: "center",
|
|
@@ -7367,12 +7373,6 @@ var toggleThumbStyle = (on) => ({
|
|
|
7367
7373
|
transition: "transform 0.2s ease",
|
|
7368
7374
|
transform: on ? "translateX(0)" : "translateX(0)"
|
|
7369
7375
|
});
|
|
7370
|
-
var oneTapBodyStyle = (color) => ({
|
|
7371
|
-
fontSize: "0.84rem",
|
|
7372
|
-
color,
|
|
7373
|
-
lineHeight: 1.55,
|
|
7374
|
-
margin: "10px 0 0"
|
|
7375
|
-
});
|
|
7376
7376
|
var manageAllowanceBtnStyle = (color) => ({
|
|
7377
7377
|
display: "flex",
|
|
7378
7378
|
alignItems: "center",
|
|
@@ -8145,10 +8145,6 @@ function useAuthHandlers(dispatch, apiBaseUrl, popupAuthRef) {
|
|
|
8145
8145
|
},
|
|
8146
8146
|
onError: (error) => {
|
|
8147
8147
|
captureException(new Error(String(error)));
|
|
8148
|
-
if (isInCrossOriginIframe()) {
|
|
8149
|
-
handlePopupLogin();
|
|
8150
|
-
return;
|
|
8151
|
-
}
|
|
8152
8148
|
dispatch({
|
|
8153
8149
|
type: "SET_ERROR",
|
|
8154
8150
|
error: typeof error === "string" ? error : "Passkey login failed. Try again or create an account."
|
|
@@ -8202,10 +8198,6 @@ function useAuthHandlers(dispatch, apiBaseUrl, popupAuthRef) {
|
|
|
8202
8198
|
const passkeyAuthError = loginState.status === "error" ? loginState.error?.message ?? "Passkey login failed." : signupState.status === "error" ? signupState.error?.message ?? "Passkey signup failed." : null;
|
|
8203
8199
|
const handleLoginWithPasskey = react.useCallback(() => {
|
|
8204
8200
|
dispatch({ type: "SET_ERROR", error: null });
|
|
8205
|
-
if (shouldUsePasskeyLoginPopup()) {
|
|
8206
|
-
handlePopupLogin();
|
|
8207
|
-
return;
|
|
8208
|
-
}
|
|
8209
8201
|
loginWithPasskey();
|
|
8210
8202
|
}, [loginWithPasskey, dispatch, handlePopupLogin]);
|
|
8211
8203
|
const handleSignupWithPasskey = react.useCallback(() => {
|