@swype-org/react-sdk 0.1.75 → 0.1.77
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 +25 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +25 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
@@ -1601,6 +1601,28 @@ function shouldUseWalletConnector(options) {
|
|
|
1601
1601
|
return options.useWalletConnector ?? !isMobileUserAgent(options.userAgent);
|
|
1602
1602
|
}
|
|
1603
1603
|
|
|
1604
|
+
// src/deeplink.ts
|
|
1605
|
+
var IFRAME_CLEANUP_DELAY_MS = 3e3;
|
|
1606
|
+
var LOCATION_FALLBACK_DELAY_MS = 100;
|
|
1607
|
+
function triggerDeeplink(uri) {
|
|
1608
|
+
try {
|
|
1609
|
+
const iframe = document.createElement("iframe");
|
|
1610
|
+
iframe.style.display = "none";
|
|
1611
|
+
iframe.src = uri;
|
|
1612
|
+
document.body.appendChild(iframe);
|
|
1613
|
+
setTimeout(() => {
|
|
1614
|
+
try {
|
|
1615
|
+
document.body.removeChild(iframe);
|
|
1616
|
+
} catch {
|
|
1617
|
+
}
|
|
1618
|
+
}, IFRAME_CLEANUP_DELAY_MS);
|
|
1619
|
+
} catch {
|
|
1620
|
+
}
|
|
1621
|
+
setTimeout(() => {
|
|
1622
|
+
window.location.href = uri;
|
|
1623
|
+
}, LOCATION_FALLBACK_DELAY_MS);
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1604
1626
|
// src/mobileFlow.ts
|
|
1605
1627
|
function hasActiveWallet(accounts) {
|
|
1606
1628
|
return accounts.some((account) => account.wallets.some((wallet) => wallet.status === "ACTIVE"));
|
|
@@ -4109,7 +4131,7 @@ function OpenWalletScreen({
|
|
|
4109
4131
|
useEffect(() => {
|
|
4110
4132
|
if (loading || !deeplinkUri || autoOpenedRef.current === deeplinkUri) return;
|
|
4111
4133
|
autoOpenedRef.current = deeplinkUri;
|
|
4112
|
-
|
|
4134
|
+
triggerDeeplink(deeplinkUri);
|
|
4113
4135
|
}, [loading, deeplinkUri]);
|
|
4114
4136
|
const handleOpen = useCallback(() => {
|
|
4115
4137
|
const opened = window.open(deeplinkUri, "_blank");
|
|
@@ -5133,7 +5155,7 @@ function SwypePaymentInner({
|
|
|
5133
5155
|
providerId: sourceOverrides?.sourceType === "providerId" ? sourceOverrides.sourceId : selectedProviderId,
|
|
5134
5156
|
isSetup: mobileSetupFlowRef.current
|
|
5135
5157
|
});
|
|
5136
|
-
|
|
5158
|
+
triggerDeeplink(uri);
|
|
5137
5159
|
return;
|
|
5138
5160
|
} else {
|
|
5139
5161
|
await authExecutor.executeSession(t);
|
|
@@ -5512,6 +5534,6 @@ function SwypePaymentInner({
|
|
|
5512
5534
|
return null;
|
|
5513
5535
|
}
|
|
5514
5536
|
|
|
5515
|
-
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 };
|
|
5537
|
+
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 };
|
|
5516
5538
|
//# sourceMappingURL=index.js.map
|
|
5517
5539
|
//# sourceMappingURL=index.js.map
|