@swype-org/react-sdk 0.1.213 → 0.1.215

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
@@ -665,14 +665,12 @@ declare function PoweredByFooter(): react_jsx_runtime.JSX.Element;
665
665
  interface PrimaryButtonProps {
666
666
  children: ReactNode;
667
667
  onClick?: () => void;
668
- /** When set, renders as an `<a>` tag instead of `<button>`. */
669
- href?: string;
670
668
  disabled?: boolean;
671
669
  loading?: boolean;
672
670
  /** Optional icon element rendered left of the label */
673
671
  icon?: ReactNode;
674
672
  }
675
- declare function PrimaryButton({ children, onClick, href, disabled, loading, icon }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
673
+ declare function PrimaryButton({ children, onClick, disabled, loading, icon }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
676
674
 
677
675
  interface OutlineButtonProps {
678
676
  children: ReactNode;
package/dist/index.d.ts CHANGED
@@ -665,14 +665,12 @@ declare function PoweredByFooter(): react_jsx_runtime.JSX.Element;
665
665
  interface PrimaryButtonProps {
666
666
  children: ReactNode;
667
667
  onClick?: () => void;
668
- /** When set, renders as an `<a>` tag instead of `<button>`. */
669
- href?: string;
670
668
  disabled?: boolean;
671
669
  loading?: boolean;
672
670
  /** Optional icon element rendered left of the label */
673
671
  icon?: ReactNode;
674
672
  }
675
- declare function PrimaryButton({ children, onClick, href, disabled, loading, icon }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
673
+ declare function PrimaryButton({ children, onClick, disabled, loading, icon }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
676
674
 
677
675
  interface OutlineButtonProps {
678
676
  children: ReactNode;
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { createContext, useRef, useState, useCallback, useMemo, useContext, useEffect, useReducer, Component } from 'react';
1
+ import { createContext, useRef, useEffect, useState, useCallback, useMemo, useContext, useReducer, Component } from 'react';
2
2
  import { PrivyProvider, usePrivy, useLoginWithOAuth, useLoginWithEmail, useLoginWithSms } from '@privy-io/react-auth';
3
3
  import { createConfig, http, WagmiProvider, useConfig, useConnect, useSwitchChain } from 'wagmi';
4
4
  import { mainnet, arbitrum, base, polygon, bsc } from 'wagmi/chains';
5
- import { injected } from 'wagmi/connectors';
5
+ import { injected as injected$1 } from 'wagmi/connectors';
6
6
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import { recoverTypedDataAddress, decodeAbiParameters, walletActions, createClient, custom } from 'viem';
@@ -14,6 +14,19 @@ var __export = (target, all) => {
14
14
  __defProp(target, name, { get: all[name], enumerable: true });
15
15
  };
16
16
 
17
+ // src/contentsquare.ts
18
+ var SCRIPT_SRC = "https://t.contentsquare.net/uxa/9537de3817f8f.js";
19
+ var injected = false;
20
+ function loadContentsquare() {
21
+ if (injected) return;
22
+ if (typeof document === "undefined") return;
23
+ injected = true;
24
+ const script = document.createElement("script");
25
+ script.src = SCRIPT_SRC;
26
+ script.async = true;
27
+ document.head.appendChild(script);
28
+ }
29
+
17
30
  // src/theme.ts
18
31
  var darkTheme = {
19
32
  bg: "#071216",
@@ -75,7 +88,7 @@ function getTheme(mode) {
75
88
  var BLINK_PRIVY_APP_ID = "cmlil87uv004n0ck0blwumwek";
76
89
  var wagmiConfig = createConfig({
77
90
  chains: [mainnet, arbitrum, base, polygon, bsc],
78
- connectors: [injected({ shimDisconnect: true, unstable_shimAsyncInject: 2e3 })],
91
+ connectors: [injected$1({ shimDisconnect: true, unstable_shimAsyncInject: 2e3 })],
79
92
  transports: {
80
93
  [mainnet.id]: http(),
81
94
  [arbitrum.id]: http(),
@@ -94,6 +107,9 @@ function BlinkProvider({
94
107
  if (!queryClientRef.current) {
95
108
  queryClientRef.current = new QueryClient();
96
109
  }
110
+ useEffect(() => {
111
+ loadContentsquare();
112
+ }, []);
97
113
  const [depositAmount, setDepositAmountRaw] = useState(null);
98
114
  const setDepositAmount = useCallback((amount) => {
99
115
  setDepositAmountRaw(amount);
@@ -2507,32 +2523,20 @@ var rowStyle = {
2507
2523
  alignItems: "center",
2508
2524
  gap: 6
2509
2525
  };
2510
- function PrimaryButton({ children, onClick, href, disabled, loading, icon }) {
2526
+ function PrimaryButton({ children, onClick, disabled, loading, icon }) {
2511
2527
  const { tokens } = useBlinkConfig();
2512
2528
  const isDisabled = disabled || loading;
2513
- const content = /* @__PURE__ */ jsxs(Fragment, { children: [
2514
- icon && /* @__PURE__ */ jsx("span", { style: iconWrapStyle, children: icon }),
2515
- loading ? "Please wait..." : children
2516
- ] });
2517
- if (href && !isDisabled) {
2518
- return /* @__PURE__ */ jsx(
2519
- "a",
2520
- {
2521
- href,
2522
- onClick,
2523
- style: linkButtonStyle(tokens),
2524
- children: content
2525
- }
2526
- );
2527
- }
2528
- return /* @__PURE__ */ jsx(
2529
+ return /* @__PURE__ */ jsxs(
2529
2530
  "button",
2530
2531
  {
2531
2532
  type: "button",
2532
2533
  onClick,
2533
2534
  disabled: isDisabled,
2534
2535
  style: buttonStyle(tokens, isDisabled),
2535
- children: content
2536
+ children: [
2537
+ icon && /* @__PURE__ */ jsx("span", { style: iconWrapStyle, children: icon }),
2538
+ loading ? "Please wait..." : children
2539
+ ]
2536
2540
  }
2537
2541
  );
2538
2542
  }
@@ -2555,10 +2559,6 @@ var buttonStyle = (tokens, disabled) => ({
2555
2559
  justifyContent: "center",
2556
2560
  gap: 8
2557
2561
  });
2558
- var linkButtonStyle = (tokens) => ({
2559
- ...buttonStyle(tokens, false),
2560
- textDecoration: "none"
2561
- });
2562
2562
  var iconWrapStyle = {
2563
2563
  display: "flex",
2564
2564
  alignItems: "center"
@@ -4996,13 +4996,10 @@ function OpenWalletScreen({
4996
4996
  {
4997
4997
  footer: /* @__PURE__ */ jsxs("div", { style: footerContentStyle, children: [
4998
4998
  error && /* @__PURE__ */ jsx(InfoBanner, { children: error }),
4999
- !loading && (isCustomSchemeUri(deeplinkUri) ? /* @__PURE__ */ jsxs(PrimaryButton, { onClick: handleOpen, children: [
5000
- "Open ",
5001
- displayName
5002
- ] }) : /* @__PURE__ */ jsxs(PrimaryButton, { href: deeplinkUri, children: [
4999
+ !loading && /* @__PURE__ */ jsxs(PrimaryButton, { onClick: handleOpen, children: [
5003
5000
  "Open ",
5004
5001
  displayName
5005
- ] })),
5002
+ ] }),
5006
5003
  error && onRetryStatus && /* @__PURE__ */ jsx(OutlineButton, { onClick: onRetryStatus, children: "Retry status check" }),
5007
5004
  /* @__PURE__ */ 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" }),
5008
5005
  /* @__PURE__ */ jsx(PoweredByFooter, {})