@swype-org/react-sdk 0.1.40 → 0.1.43
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 +11 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -559,6 +559,20 @@ interface SpinnerProps {
|
|
|
559
559
|
}
|
|
560
560
|
declare function Spinner({ size, label }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
561
561
|
|
|
562
|
+
interface SetupScreenProps {
|
|
563
|
+
availableBalance: number;
|
|
564
|
+
/** Number of tokens/chains available */
|
|
565
|
+
tokenCount: number;
|
|
566
|
+
/** Source wallet/account name */
|
|
567
|
+
sourceName?: string;
|
|
568
|
+
onSetupOneTap: (limit: number) => void;
|
|
569
|
+
onBack: () => void;
|
|
570
|
+
onLogout: () => void;
|
|
571
|
+
loading?: boolean;
|
|
572
|
+
error: string | null;
|
|
573
|
+
}
|
|
574
|
+
declare function SetupScreen({ availableBalance, tokenCount, sourceName, onSetupOneTap, onBack, onLogout, loading, error, }: SetupScreenProps): react_jsx_runtime.JSX.Element;
|
|
575
|
+
|
|
562
576
|
interface ChainChoice {
|
|
563
577
|
chainName: string;
|
|
564
578
|
balance: number;
|
|
@@ -582,4 +596,4 @@ interface SelectSourceScreenProps {
|
|
|
582
596
|
}
|
|
583
597
|
declare function SelectSourceScreen({ choices, selectedChainName, selectedTokenSymbol, recommended, onChainChange, onTokenChange, onConfirm, onLogout, }: SelectSourceScreenProps): react_jsx_runtime.JSX.Element;
|
|
584
598
|
|
|
585
|
-
export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, IconCircle, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, type PaymentStep, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, 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, createPasskeyCredential, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
|
599
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, IconCircle, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, 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, createPasskeyCredential, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
package/dist/index.d.ts
CHANGED
|
@@ -559,6 +559,20 @@ interface SpinnerProps {
|
|
|
559
559
|
}
|
|
560
560
|
declare function Spinner({ size, label }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
561
561
|
|
|
562
|
+
interface SetupScreenProps {
|
|
563
|
+
availableBalance: number;
|
|
564
|
+
/** Number of tokens/chains available */
|
|
565
|
+
tokenCount: number;
|
|
566
|
+
/** Source wallet/account name */
|
|
567
|
+
sourceName?: string;
|
|
568
|
+
onSetupOneTap: (limit: number) => void;
|
|
569
|
+
onBack: () => void;
|
|
570
|
+
onLogout: () => void;
|
|
571
|
+
loading?: boolean;
|
|
572
|
+
error: string | null;
|
|
573
|
+
}
|
|
574
|
+
declare function SetupScreen({ availableBalance, tokenCount, sourceName, onSetupOneTap, onBack, onLogout, loading, error, }: SetupScreenProps): react_jsx_runtime.JSX.Element;
|
|
575
|
+
|
|
562
576
|
interface ChainChoice {
|
|
563
577
|
chainName: string;
|
|
564
578
|
balance: number;
|
|
@@ -582,4 +596,4 @@ interface SelectSourceScreenProps {
|
|
|
582
596
|
}
|
|
583
597
|
declare function SelectSourceScreen({ choices, selectedChainName, selectedTokenSymbol, recommended, onChainChange, onTokenChange, onConfirm, onLogout, }: SelectSourceScreenProps): react_jsx_runtime.JSX.Element;
|
|
584
598
|
|
|
585
|
-
export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, IconCircle, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, type PaymentStep, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, 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, createPasskeyCredential, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
|
599
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, IconCircle, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, 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, createPasskeyCredential, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
package/dist/index.js
CHANGED
|
@@ -1477,11 +1477,16 @@ function isMobileUserAgent(userAgent) {
|
|
|
1477
1477
|
function shouldUseWalletConnector(options) {
|
|
1478
1478
|
return options.useWalletConnector ?? !isMobileUserAgent(options.userAgent);
|
|
1479
1479
|
}
|
|
1480
|
+
var FOOTER_CSS = `
|
|
1481
|
+
.swype-screen-footer {
|
|
1482
|
+
padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
|
|
1483
|
+
}`;
|
|
1480
1484
|
function ScreenLayout({ children, footer }) {
|
|
1481
1485
|
const { tokens } = useSwypeConfig();
|
|
1482
1486
|
return /* @__PURE__ */ jsxs("div", { style: containerStyle(tokens.bgCard), children: [
|
|
1483
1487
|
/* @__PURE__ */ jsx("div", { style: bodyStyle, children }),
|
|
1484
|
-
footer && /* @__PURE__ */ jsx("div", { style: footerStyle, children: footer })
|
|
1488
|
+
footer && /* @__PURE__ */ jsx("div", { className: "swype-screen-footer", style: footerStyle, children: footer }),
|
|
1489
|
+
/* @__PURE__ */ jsx("style", { children: FOOTER_CSS })
|
|
1485
1490
|
] });
|
|
1486
1491
|
}
|
|
1487
1492
|
var containerStyle = (bg) => ({
|
|
@@ -1502,7 +1507,7 @@ var bodyStyle = {
|
|
|
1502
1507
|
flexDirection: "column"
|
|
1503
1508
|
};
|
|
1504
1509
|
var footerStyle = {
|
|
1505
|
-
padding: "16px 24px
|
|
1510
|
+
padding: "16px 24px 0",
|
|
1506
1511
|
marginTop: "auto"
|
|
1507
1512
|
};
|
|
1508
1513
|
function ScreenHeader({ title, right, onBack, badge }) {
|
|
@@ -4429,7 +4434,9 @@ function SwypePayment({
|
|
|
4429
4434
|
setMobileFlow(true);
|
|
4430
4435
|
pollingTransferIdRef.current = t.id;
|
|
4431
4436
|
polling.startPolling(t.id);
|
|
4432
|
-
|
|
4437
|
+
if (!isActiveWallet) {
|
|
4438
|
+
window.location.href = t.authorizationSessions[0].uri;
|
|
4439
|
+
}
|
|
4433
4440
|
return;
|
|
4434
4441
|
} else {
|
|
4435
4442
|
await authExecutor.executeSession(t);
|
|
@@ -4822,6 +4829,6 @@ function SwypePayment({
|
|
|
4822
4829
|
return null;
|
|
4823
4830
|
}
|
|
4824
4831
|
|
|
4825
|
-
export { IconCircle, OutlineButton, PoweredByFooter, PrimaryButton, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, Spinner, StepList, SwypePayment, SwypeProvider, createPasskeyCredential, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api_exports as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
|
4832
|
+
export { IconCircle, OutlineButton, PoweredByFooter, PrimaryButton, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, Spinner, StepList, SwypePayment, SwypeProvider, createPasskeyCredential, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api_exports as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
|
4826
4833
|
//# sourceMappingURL=index.js.map
|
|
4827
4834
|
//# sourceMappingURL=index.js.map
|