@swype-org/react-sdk 0.1.159 → 0.1.161
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 +30 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -48
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2110,12 +2110,24 @@ function maskAuthIdentifier(identifier) {
|
|
|
2110
2110
|
const visibleSuffix = digits.slice(-4);
|
|
2111
2111
|
return `***-***-${visibleSuffix}`;
|
|
2112
2112
|
}
|
|
2113
|
+
|
|
2114
|
+
// src/walletFlow.ts
|
|
2115
|
+
var MOBILE_USER_AGENT_PATTERN = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
2116
|
+
function isMobileUserAgent(userAgent) {
|
|
2117
|
+
if (!userAgent) {
|
|
2118
|
+
return false;
|
|
2119
|
+
}
|
|
2120
|
+
return MOBILE_USER_AGENT_PATTERN.test(userAgent);
|
|
2121
|
+
}
|
|
2122
|
+
function shouldUseWalletConnector(options) {
|
|
2123
|
+
return options.useWalletConnector ?? !isMobileUserAgent(options.userAgent);
|
|
2124
|
+
}
|
|
2113
2125
|
var ACCENT = "#28b67a";
|
|
2114
2126
|
var BG_RING = "#d2e4ea";
|
|
2115
2127
|
function SwypeLoadingScreen() {
|
|
2116
2128
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle, children: [
|
|
2117
2129
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle, children: [
|
|
2118
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: wordmarkStyle, children: "
|
|
2130
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: wordmarkStyle, children: "BLINK" }),
|
|
2119
2131
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: spinnerStyle })
|
|
2120
2132
|
] }),
|
|
2121
2133
|
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
@@ -3432,6 +3444,7 @@ function WalletPickerScreen({
|
|
|
3432
3444
|
providers,
|
|
3433
3445
|
pendingConnections,
|
|
3434
3446
|
loading,
|
|
3447
|
+
useDeeplink,
|
|
3435
3448
|
onPrepareProvider,
|
|
3436
3449
|
onSelectProvider,
|
|
3437
3450
|
onContinueConnection,
|
|
@@ -3485,7 +3498,7 @@ function WalletPickerScreen({
|
|
|
3485
3498
|
{
|
|
3486
3499
|
onClick: () => {
|
|
3487
3500
|
const session = preparedSession?.providerId === selectedProvider.id ? preparedSession : void 0;
|
|
3488
|
-
if (session) {
|
|
3501
|
+
if (session && useDeeplink) {
|
|
3489
3502
|
const opened = window.open(session.uri, "_blank");
|
|
3490
3503
|
if (!opened && window === window.parent) {
|
|
3491
3504
|
window.location.href = session.uri;
|
|
@@ -4205,13 +4218,10 @@ function DepositScreen({
|
|
|
4205
4218
|
remainingLimit.toFixed(2),
|
|
4206
4219
|
". Increase your limit to continue."
|
|
4207
4220
|
] })
|
|
4208
|
-
] }) : /* @__PURE__ */ jsxRuntime.
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
] }),
|
|
4213
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: noApprovalStyle(tokens.textMuted), children: "No approval needed \xB7 within your One-Tap limit" })
|
|
4214
|
-
] }),
|
|
4221
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(PrimaryButton, { onClick: () => onDeposit(amount), disabled: !canDeposit, loading: processing, children: [
|
|
4222
|
+
"Deposit $",
|
|
4223
|
+
amount.toFixed(2)
|
|
4224
|
+
] }) }),
|
|
4215
4225
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: routeStyle(tokens.textMuted), children: [
|
|
4216
4226
|
"From ",
|
|
4217
4227
|
sourceName,
|
|
@@ -4269,22 +4279,13 @@ function DepositScreen({
|
|
|
4269
4279
|
}
|
|
4270
4280
|
)
|
|
4271
4281
|
] }),
|
|
4272
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
] }),
|
|
4280
|
-
estimatedFeeUsd != null && estimatedFeePct != null ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: detailRowStyle(tokens.textMuted), children: [
|
|
4281
|
-
"Fee: ~$",
|
|
4282
|
-
estimatedFeeUsd.toFixed(2),
|
|
4283
|
-
" (",
|
|
4284
|
-
estimatedFeePct.toFixed(1),
|
|
4285
|
-
"%)"
|
|
4286
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: detailRowStyle(tokens.textMuted), children: "Fees calculated at time of transfer" })
|
|
4287
|
-
] }),
|
|
4282
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: detailsStyle, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: detailRowStyle(tokens.textMuted), children: [
|
|
4283
|
+
"Remaining limit: ",
|
|
4284
|
+
/* @__PURE__ */ jsxRuntime.jsxs("strong", { style: { color: tokens.text }, children: [
|
|
4285
|
+
"$",
|
|
4286
|
+
remainingLimit.toFixed(2)
|
|
4287
|
+
] })
|
|
4288
|
+
] }) }),
|
|
4288
4289
|
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle5(tokens), children: error })
|
|
4289
4290
|
]
|
|
4290
4291
|
}
|
|
@@ -4366,12 +4367,6 @@ var errorBannerStyle5 = (tokens) => ({
|
|
|
4366
4367
|
marginTop: 8,
|
|
4367
4368
|
lineHeight: 1.5
|
|
4368
4369
|
});
|
|
4369
|
-
var noApprovalStyle = (color) => ({
|
|
4370
|
-
textAlign: "center",
|
|
4371
|
-
fontSize: "0.78rem",
|
|
4372
|
-
color,
|
|
4373
|
-
margin: "12px 0 2px"
|
|
4374
|
-
});
|
|
4375
4370
|
var limitExceededHintStyle = (color) => ({
|
|
4376
4371
|
textAlign: "center",
|
|
4377
4372
|
fontSize: "0.78rem",
|
|
@@ -5596,6 +5591,9 @@ function StepRenderer({
|
|
|
5596
5591
|
providers: state.providers,
|
|
5597
5592
|
pendingConnections,
|
|
5598
5593
|
loading: state.creatingTransfer,
|
|
5594
|
+
useDeeplink: !shouldUseWalletConnector({
|
|
5595
|
+
userAgent: typeof navigator === "undefined" ? void 0 : navigator.userAgent
|
|
5596
|
+
}),
|
|
5599
5597
|
onPrepareProvider: handlers.onPrepareProvider,
|
|
5600
5598
|
onSelectProvider: handlers.onSelectProvider,
|
|
5601
5599
|
onContinueConnection: handlers.onContinueConnection,
|
|
@@ -6500,20 +6498,6 @@ function useMobileFlowHandlers(dispatch, polling, reloadAccounts, pollingTransfe
|
|
|
6500
6498
|
handleRetryMobileStatus
|
|
6501
6499
|
};
|
|
6502
6500
|
}
|
|
6503
|
-
|
|
6504
|
-
// src/walletFlow.ts
|
|
6505
|
-
var MOBILE_USER_AGENT_PATTERN = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
6506
|
-
function isMobileUserAgent(userAgent) {
|
|
6507
|
-
if (!userAgent) {
|
|
6508
|
-
return false;
|
|
6509
|
-
}
|
|
6510
|
-
return MOBILE_USER_AGENT_PATTERN.test(userAgent);
|
|
6511
|
-
}
|
|
6512
|
-
function shouldUseWalletConnector(options) {
|
|
6513
|
-
return options.useWalletConnector ?? !isMobileUserAgent(options.userAgent);
|
|
6514
|
-
}
|
|
6515
|
-
|
|
6516
|
-
// src/hooks/useProviderHandlers.ts
|
|
6517
6501
|
function useProviderHandlers(deps) {
|
|
6518
6502
|
const {
|
|
6519
6503
|
dispatch,
|
|
@@ -6618,9 +6602,7 @@ function useProviderHandlers(deps) {
|
|
|
6618
6602
|
providerId,
|
|
6619
6603
|
isSetup: true
|
|
6620
6604
|
});
|
|
6621
|
-
|
|
6622
|
-
triggerDeeplink(sessionUri);
|
|
6623
|
-
}
|
|
6605
|
+
triggerDeeplink(sessionUri);
|
|
6624
6606
|
dispatch({ type: "MOBILE_DEEPLINK_READY", deeplinkUri: sessionUri });
|
|
6625
6607
|
} else {
|
|
6626
6608
|
await authExecutor.executeSessionById(sessionId);
|