@swype-org/react-sdk 0.1.76 → 0.1.79

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.d.cts CHANGED
@@ -592,6 +592,13 @@ interface OutlineButtonProps {
592
592
  }
593
593
  declare function OutlineButton({ children, onClick, disabled }: OutlineButtonProps): react_jsx_runtime.JSX.Element;
594
594
 
595
+ interface InfoBannerProps {
596
+ children: ReactNode;
597
+ /** SVG icon element. Defaults to a shield icon. */
598
+ icon?: ReactNode;
599
+ }
600
+ declare function InfoBanner({ children, icon }: InfoBannerProps): react_jsx_runtime.JSX.Element;
601
+
595
602
  type IconCircleVariant = 'accent' | 'success' | 'error';
596
603
  interface IconCircleProps {
597
604
  children: ReactNode;
@@ -692,4 +699,4 @@ interface AdvancedSourceScreenProps {
692
699
  }
693
700
  declare function AdvancedSourceScreen({ choices, selectedChainName, selectedTokenSymbol, onSelectSource, onBack, }: AdvancedSourceScreenProps): react_jsx_runtime.JSX.Element;
694
701
 
695
- export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, CreatePasskeyScreen, type Destination, type ErrorResponse, IconCircle, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, PasskeyIframeBlockedError, type PaymentStep, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, type SourceOption, type SourceSelection, type SourceType, Spinner, type StepItem, StepList, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
702
+ export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, CreatePasskeyScreen, type Destination, type ErrorResponse, IconCircle, InfoBanner, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, PasskeyIframeBlockedError, type PaymentStep, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, type SourceOption, type SourceSelection, type SourceType, Spinner, type StepItem, StepList, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
package/dist/index.d.ts CHANGED
@@ -592,6 +592,13 @@ interface OutlineButtonProps {
592
592
  }
593
593
  declare function OutlineButton({ children, onClick, disabled }: OutlineButtonProps): react_jsx_runtime.JSX.Element;
594
594
 
595
+ interface InfoBannerProps {
596
+ children: ReactNode;
597
+ /** SVG icon element. Defaults to a shield icon. */
598
+ icon?: ReactNode;
599
+ }
600
+ declare function InfoBanner({ children, icon }: InfoBannerProps): react_jsx_runtime.JSX.Element;
601
+
595
602
  type IconCircleVariant = 'accent' | 'success' | 'error';
596
603
  interface IconCircleProps {
597
604
  children: ReactNode;
@@ -692,4 +699,4 @@ interface AdvancedSourceScreenProps {
692
699
  }
693
700
  declare function AdvancedSourceScreen({ choices, selectedChainName, selectedTokenSymbol, onSelectSource, onBack, }: AdvancedSourceScreenProps): react_jsx_runtime.JSX.Element;
694
701
 
695
- export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, CreatePasskeyScreen, type Destination, type ErrorResponse, IconCircle, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, PasskeyIframeBlockedError, type PaymentStep, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, type SourceOption, type SourceSelection, type SourceType, Spinner, type StepItem, StepList, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
702
+ export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, CreatePasskeyScreen, type Destination, type ErrorResponse, IconCircle, InfoBanner, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, PasskeyIframeBlockedError, type PaymentStep, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, type SourceOption, type SourceSelection, type SourceType, Spinner, type StepItem, StepList, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
package/dist/index.js CHANGED
@@ -689,6 +689,11 @@ function isInCrossOriginIframe() {
689
689
  return true;
690
690
  }
691
691
  }
692
+ function isSafari() {
693
+ if (typeof navigator === "undefined") return false;
694
+ const ua = navigator.userAgent;
695
+ return /Safari/i.test(ua) && !/Chrome|CriOS|Chromium|Edg|OPR|Firefox/i.test(ua);
696
+ }
692
697
  var POPUP_RESULT_TIMEOUT_MS = 12e4;
693
698
  var POPUP_CLOSED_POLL_MS = 500;
694
699
  function createPasskeyViaPopup(options) {
@@ -4517,7 +4522,9 @@ function SwypePaymentInner({
4517
4522
  const [transfer, setTransfer] = useState(null);
4518
4523
  const [creatingTransfer, setCreatingTransfer] = useState(false);
4519
4524
  const [registeringPasskey, setRegisteringPasskey] = useState(false);
4520
- const [passkeyPopupNeeded, setPasskeyPopupNeeded] = useState(false);
4525
+ const [passkeyPopupNeeded, setPasskeyPopupNeeded] = useState(
4526
+ () => isSafari() && isInCrossOriginIframe()
4527
+ );
4521
4528
  const [activeCredentialId, setActiveCredentialId] = useState(() => {
4522
4529
  if (typeof window === "undefined") return null;
4523
4530
  return window.localStorage.getItem(ACTIVE_CREDENTIAL_STORAGE_KEY);
@@ -4584,7 +4591,7 @@ function SwypePaymentInner({
4584
4591
  try {
4585
4592
  await reloadAccounts();
4586
4593
  resetDataLoadingState();
4587
- setTransfer(null);
4594
+ setTransfer(authorizedTransfer);
4588
4595
  setError(null);
4589
4596
  setDeeplinkUri(null);
4590
4597
  setMobileFlow(false);
@@ -4723,6 +4730,17 @@ function SwypePaymentInner({
4723
4730
  if (resolved.clearPersistedFlow) {
4724
4731
  clearMobileFlowState();
4725
4732
  }
4733
+ if (resolved.step === "deposit" && persisted && persisted.isSetup) {
4734
+ try {
4735
+ const existingTransfer = await fetchTransfer(apiBaseUrl, token, persisted.transferId);
4736
+ if (cancelled) return;
4737
+ if (existingTransfer.status === "AUTHORIZED") {
4738
+ await handleAuthorizedMobileReturn(existingTransfer, true);
4739
+ return;
4740
+ }
4741
+ } catch {
4742
+ }
4743
+ }
4726
4744
  if (resolved.step === "open-wallet" && persisted) {
4727
4745
  try {
4728
4746
  const existingTransfer = await fetchTransfer(apiBaseUrl, token, persisted.transferId);
@@ -5534,6 +5552,6 @@ function SwypePaymentInner({
5534
5552
  return null;
5535
5553
  }
5536
5554
 
5537
- export { AdvancedSourceScreen, CreatePasskeyScreen, IconCircle, OutlineButton, PasskeyIframeBlockedError, PoweredByFooter, PrimaryButton, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, Spinner, StepList, SwypePayment, SwypeProvider, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api_exports as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
5555
+ export { AdvancedSourceScreen, CreatePasskeyScreen, IconCircle, InfoBanner, OutlineButton, PasskeyIframeBlockedError, PoweredByFooter, PrimaryButton, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, Spinner, StepList, SwypePayment, SwypeProvider, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api_exports as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
5538
5556
  //# sourceMappingURL=index.js.map
5539
5557
  //# sourceMappingURL=index.js.map