@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.js CHANGED
@@ -241,9 +241,6 @@ async function checkServerForPasskeyByToken(authToken, apiBaseUrl, verificationT
241
241
  function shouldUsePasskeySignupPopup() {
242
242
  return isSafari() && isInCrossOriginIframe();
243
243
  }
244
- function shouldUsePasskeyLoginPopup() {
245
- return isSafari() && isInCrossOriginIframe();
246
- }
247
244
  var SIGNUP_POPUP_TIMEOUT_MS = 12e4;
248
245
  function signupWithPasskeyViaPopup() {
249
246
  return new Promise((resolve, reject) => {
@@ -3498,7 +3495,7 @@ var FALLBACK = "Biometric verification";
3498
3495
  function getDeviceBiometricUnlockText() {
3499
3496
  const ua = typeof navigator !== "undefined" && typeof navigator.userAgent === "string" ? navigator.userAgent : "";
3500
3497
  if (/iPhone|iPad|iPod/i.test(ua)) {
3501
- return "Face ID or Touch ID";
3498
+ return "Face ID";
3502
3499
  }
3503
3500
  if (/Android/i.test(ua)) {
3504
3501
  return "Fingerprint or face unlock";
@@ -6655,7 +6652,7 @@ function isPreciseMoneyNonPositive(fee) {
6655
6652
  return Number.isFinite(n) && n <= 0;
6656
6653
  }
6657
6654
  function formatNonPositiveFeeDisplay(fee) {
6658
- return "Free";
6655
+ return "< $0.01";
6659
6656
  }
6660
6657
  function formatPreciseMoneyForDisplay(fee) {
6661
6658
  const raw = fee.value.trim();
@@ -6724,7 +6721,6 @@ function GuestTokenPickerScreen({
6724
6721
  const [limitInputValue, setLimitInputValue] = useState("");
6725
6722
  const limitInputRef = useRef(null);
6726
6723
  const [managingAllowance, setManagingAllowance] = useState(false);
6727
- const biometricText = getDeviceBiometricUnlockText();
6728
6724
  useEffect(() => {
6729
6725
  if (!tokenListOpen) return;
6730
6726
  const handleMouseDown = (e) => {
@@ -6758,8 +6754,6 @@ function GuestTokenPickerScreen({
6758
6754
  const canConfirm = Boolean(pendingEntry && !quoteLoading && (!confirmNeedsQuote || quoteFee));
6759
6755
  const ctaLabel = confirmLabel ?? (variant === "auth-setup" ? "Continue" : providerName ? `Open ${providerName} to Deposit` : "Open Wallet to Deposit");
6760
6756
  const tokenCardLabel = selectionLabel ?? (variant === "auth-setup" ? "Token for one-tap" : "Deposit");
6761
- const oneTapSubtitle = variant === "auth-setup" ? `Skip wallet next time \u2014 just ${biometricText}` : `Skip ${providerName ?? "wallet"} next time \u2014 just ${biometricText}`;
6762
- 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.`;
6763
6757
  const feeLine = (() => {
6764
6758
  if (quoteLoading && pendingEntry) {
6765
6759
  return /* @__PURE__ */ jsx("div", { style: feeRowContainerStyle2, "aria-live": "polite", children: /* @__PURE__ */ jsx("span", { style: feeRowLabelStyle2(t.textMuted), children: "Getting fee estimate\u2026" }) });
@@ -6976,10 +6970,25 @@ function GuestTokenPickerScreen({
6976
6970
  !tokenListOpen && !isBridging && /* @__PURE__ */ jsxs("div", { style: oneTapCardStyle(t, oneTapEnabled), children: [
6977
6971
  /* @__PURE__ */ jsxs("div", { style: oneTapHeaderRowStyle, children: [
6978
6972
  /* @__PURE__ */ jsxs("div", { style: oneTapHeaderLeftStyle, children: [
6979
- /* @__PURE__ */ jsx("div", { style: lightningIconStyle, children: /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M13 2L3 14h9l-1 8 10-12h-9l1-8z", fill: "#F5A623", stroke: "#F5A623", strokeWidth: "1", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
6973
+ /* @__PURE__ */ jsx("div", { style: lightningIconStyle, children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "36", height: "36", viewBox: "0 0 80 80", children: /* @__PURE__ */ jsx("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ jsx("g", { fill: "#000000", children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsxs("g", { children: [
6974
+ /* @__PURE__ */ jsxs("g", { fillRule: "nonzero", children: [
6975
+ /* @__PURE__ */ 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" }),
6976
+ /* @__PURE__ */ 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)" }),
6977
+ /* @__PURE__ */ 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)" }),
6978
+ /* @__PURE__ */ 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)" })
6979
+ ] }),
6980
+ /* @__PURE__ */ jsx("g", { transform: "translate(21.754386, 28.070175)", fillRule: "nonzero", children: /* @__PURE__ */ 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" }) }),
6981
+ /* @__PURE__ */ jsx("g", { transform: "translate(54.736842, 28.070175)", fillRule: "nonzero", children: /* @__PURE__ */ 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" }) }),
6982
+ /* @__PURE__ */ 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" }),
6983
+ /* @__PURE__ */ 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" })
6984
+ ] }) }) }) }) }) }),
6980
6985
  /* @__PURE__ */ jsxs("div", { children: [
6981
- /* @__PURE__ */ jsx("div", { style: oneTapTitleStyle(t.text), children: "Enable one-tap deposits" }),
6982
- /* @__PURE__ */ jsx("div", { style: oneTapSubtitleStyle(t.textMuted), children: oneTapSubtitle })
6986
+ /* @__PURE__ */ jsxs("div", { style: oneTapTitleStyle(t.text), children: [
6987
+ "Deposit with ",
6988
+ getDeviceBiometricUnlockText(),
6989
+ " next time"
6990
+ ] }),
6991
+ /* @__PURE__ */ jsx("div", { style: oneTapSubtitleStyle(t.textMuted), children: "No need to reopen your wallet every time. Your money stays under your control." })
6983
6992
  ] })
6984
6993
  ] }),
6985
6994
  /* @__PURE__ */ jsx(
@@ -6996,7 +7005,6 @@ function GuestTokenPickerScreen({
6996
7005
  )
6997
7006
  ] }),
6998
7007
  oneTapEnabled && /* @__PURE__ */ jsxs(Fragment, { children: [
6999
- /* @__PURE__ */ jsx("p", { style: oneTapBodyStyle(t.textMuted), children: oneTapBody }),
7000
7008
  /* @__PURE__ */ jsxs(
7001
7009
  "button",
7002
7010
  {
@@ -7321,8 +7329,6 @@ var oneTapHeaderLeftStyle = {
7321
7329
  var lightningIconStyle = {
7322
7330
  width: 36,
7323
7331
  height: 36,
7324
- borderRadius: 10,
7325
- background: "linear-gradient(135deg, #e8f5e9 0%, #fffde7 100%)",
7326
7332
  display: "flex",
7327
7333
  alignItems: "center",
7328
7334
  justifyContent: "center",
@@ -7364,12 +7370,6 @@ var toggleThumbStyle = (on) => ({
7364
7370
  transition: "transform 0.2s ease",
7365
7371
  transform: on ? "translateX(0)" : "translateX(0)"
7366
7372
  });
7367
- var oneTapBodyStyle = (color) => ({
7368
- fontSize: "0.84rem",
7369
- color,
7370
- lineHeight: 1.55,
7371
- margin: "10px 0 0"
7372
- });
7373
7373
  var manageAllowanceBtnStyle = (color) => ({
7374
7374
  display: "flex",
7375
7375
  alignItems: "center",
@@ -8142,10 +8142,6 @@ function useAuthHandlers(dispatch, apiBaseUrl, popupAuthRef) {
8142
8142
  },
8143
8143
  onError: (error) => {
8144
8144
  captureException(new Error(String(error)));
8145
- if (isInCrossOriginIframe()) {
8146
- handlePopupLogin();
8147
- return;
8148
- }
8149
8145
  dispatch({
8150
8146
  type: "SET_ERROR",
8151
8147
  error: typeof error === "string" ? error : "Passkey login failed. Try again or create an account."
@@ -8199,10 +8195,6 @@ function useAuthHandlers(dispatch, apiBaseUrl, popupAuthRef) {
8199
8195
  const passkeyAuthError = loginState.status === "error" ? loginState.error?.message ?? "Passkey login failed." : signupState.status === "error" ? signupState.error?.message ?? "Passkey signup failed." : null;
8200
8196
  const handleLoginWithPasskey = useCallback(() => {
8201
8197
  dispatch({ type: "SET_ERROR", error: null });
8202
- if (shouldUsePasskeyLoginPopup()) {
8203
- handlePopupLogin();
8204
- return;
8205
- }
8206
8198
  loginWithPasskey();
8207
8199
  }, [loginWithPasskey, dispatch, handlePopupLogin]);
8208
8200
  const handleSignupWithPasskey = useCallback(() => {