@swype-org/react-sdk 0.1.212 → 0.1.213
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 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +30 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2510,20 +2510,32 @@ var rowStyle = {
|
|
|
2510
2510
|
alignItems: "center",
|
|
2511
2511
|
gap: 6
|
|
2512
2512
|
};
|
|
2513
|
-
function PrimaryButton({ children, onClick, disabled, loading, icon }) {
|
|
2513
|
+
function PrimaryButton({ children, onClick, href, disabled, loading, icon }) {
|
|
2514
2514
|
const { tokens } = useBlinkConfig();
|
|
2515
2515
|
const isDisabled = disabled || loading;
|
|
2516
|
-
|
|
2516
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2517
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { style: iconWrapStyle, children: icon }),
|
|
2518
|
+
loading ? "Please wait..." : children
|
|
2519
|
+
] });
|
|
2520
|
+
if (href && !isDisabled) {
|
|
2521
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2522
|
+
"a",
|
|
2523
|
+
{
|
|
2524
|
+
href,
|
|
2525
|
+
onClick,
|
|
2526
|
+
style: linkButtonStyle(tokens),
|
|
2527
|
+
children: content
|
|
2528
|
+
}
|
|
2529
|
+
);
|
|
2530
|
+
}
|
|
2531
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2517
2532
|
"button",
|
|
2518
2533
|
{
|
|
2519
2534
|
type: "button",
|
|
2520
2535
|
onClick,
|
|
2521
2536
|
disabled: isDisabled,
|
|
2522
2537
|
style: buttonStyle(tokens, isDisabled),
|
|
2523
|
-
children:
|
|
2524
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { style: iconWrapStyle, children: icon }),
|
|
2525
|
-
loading ? "Please wait..." : children
|
|
2526
|
-
]
|
|
2538
|
+
children: content
|
|
2527
2539
|
}
|
|
2528
2540
|
);
|
|
2529
2541
|
}
|
|
@@ -2546,6 +2558,10 @@ var buttonStyle = (tokens, disabled) => ({
|
|
|
2546
2558
|
justifyContent: "center",
|
|
2547
2559
|
gap: 8
|
|
2548
2560
|
});
|
|
2561
|
+
var linkButtonStyle = (tokens) => ({
|
|
2562
|
+
...buttonStyle(tokens, false),
|
|
2563
|
+
textDecoration: "none"
|
|
2564
|
+
});
|
|
2549
2565
|
var iconWrapStyle = {
|
|
2550
2566
|
display: "flex",
|
|
2551
2567
|
alignItems: "center"
|
|
@@ -4983,10 +4999,13 @@ function OpenWalletScreen({
|
|
|
4983
4999
|
{
|
|
4984
5000
|
footer: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: footerContentStyle, children: [
|
|
4985
5001
|
error && /* @__PURE__ */ jsxRuntime.jsx(InfoBanner, { children: error }),
|
|
4986
|
-
!loading && /* @__PURE__ */ jsxRuntime.jsxs(PrimaryButton, { onClick: handleOpen, children: [
|
|
5002
|
+
!loading && (isCustomSchemeUri(deeplinkUri) ? /* @__PURE__ */ jsxRuntime.jsxs(PrimaryButton, { onClick: handleOpen, children: [
|
|
4987
5003
|
"Open ",
|
|
4988
5004
|
displayName
|
|
4989
|
-
] }),
|
|
5005
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(PrimaryButton, { href: deeplinkUri, children: [
|
|
5006
|
+
"Open ",
|
|
5007
|
+
displayName
|
|
5008
|
+
] })),
|
|
4990
5009
|
error && onRetryStatus && /* @__PURE__ */ jsxRuntime.jsx(OutlineButton, { onClick: onRetryStatus, children: "Retry status check" }),
|
|
4991
5010
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: hintStyle(tokens.textMuted), children: loading ? "Preparing authorization..." : error ? "Retry the status check after returning to the browser, or reopen your wallet if needed." : "If your wallet didn't open automatically, tap the button above" }),
|
|
4992
5011
|
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
@@ -6550,11 +6569,7 @@ function useProviderHandlers(deps) {
|
|
|
6550
6569
|
providerId,
|
|
6551
6570
|
isSetup: true
|
|
6552
6571
|
});
|
|
6553
|
-
|
|
6554
|
-
triggerDeeplink(sessionUri);
|
|
6555
|
-
} else {
|
|
6556
|
-
window.location.href = sessionUri;
|
|
6557
|
-
}
|
|
6572
|
+
triggerDeeplink(sessionUri);
|
|
6558
6573
|
dispatch({ type: "MOBILE_DEEPLINK_READY", deeplinkUri: sessionUri });
|
|
6559
6574
|
} else {
|
|
6560
6575
|
await authExecutor.executeSessionById(sessionId);
|
|
@@ -6670,11 +6685,7 @@ function useProviderHandlers(deps) {
|
|
|
6670
6685
|
isReauthorization: true
|
|
6671
6686
|
});
|
|
6672
6687
|
dispatch({ type: "MOBILE_DEEPLINK_READY", deeplinkUri: session.uri });
|
|
6673
|
-
|
|
6674
|
-
triggerDeeplink(session.uri);
|
|
6675
|
-
} else {
|
|
6676
|
-
window.location.href = session.uri;
|
|
6677
|
-
}
|
|
6688
|
+
triggerDeeplink(session.uri);
|
|
6678
6689
|
} else {
|
|
6679
6690
|
dispatch({ type: "NAVIGATE", step: "open-wallet" });
|
|
6680
6691
|
await authExecutor.executeSessionById(session.id);
|
|
@@ -6767,11 +6778,7 @@ function useProviderHandlers(deps) {
|
|
|
6767
6778
|
reauthorizationToken: { walletId: _walletId, tokenSymbol }
|
|
6768
6779
|
});
|
|
6769
6780
|
dispatch({ type: "MOBILE_DEEPLINK_READY", deeplinkUri: session.uri });
|
|
6770
|
-
|
|
6771
|
-
triggerDeeplink(session.uri);
|
|
6772
|
-
} else {
|
|
6773
|
-
window.location.href = session.uri;
|
|
6774
|
-
}
|
|
6781
|
+
triggerDeeplink(session.uri);
|
|
6775
6782
|
} else {
|
|
6776
6783
|
dispatch({ type: "NAVIGATE", step: "open-wallet" });
|
|
6777
6784
|
await authExecutor.executeSessionById(session.id);
|