@rash2x/bridge-widget 0.7.7 → 0.7.9

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.
@@ -2,6 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
5
+ import * as React from "react";
5
6
  import { useEffect, useState, useCallback, useMemo, forwardRef, createContext, useContext, useRef, useLayoutEffect } from "react";
6
7
  import { initReactI18next, I18nextProvider, useTranslation } from "react-i18next";
7
8
  import i18n from "i18next";
@@ -3024,11 +3025,54 @@ const InfoIcon = (props) => {
3024
3025
  }
3025
3026
  );
3026
3027
  };
3028
+ const MOBILE_BREAKPOINT = 768;
3029
+ function useIsMobile() {
3030
+ const [isMobile2, setIsMobile] = React.useState(
3031
+ void 0
3032
+ );
3033
+ React.useEffect(() => {
3034
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
3035
+ const onChange = () => {
3036
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
3037
+ };
3038
+ mql.addEventListener("change", onChange);
3039
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
3040
+ return () => mql.removeEventListener("change", onChange);
3041
+ }, []);
3042
+ return !!isMobile2;
3043
+ }
3027
3044
  const Tip = (props) => {
3028
3045
  const { children, text } = props;
3029
- return /* @__PURE__ */ jsxs(Tooltip, { children: [
3030
- /* @__PURE__ */ jsx(TooltipTrigger, { className: "w-4 h-4 rounded-full bg-muted text-muted-foreground", children }),
3031
- /* @__PURE__ */ jsx(TooltipContent, { children: text })
3046
+ const [open, setOpen] = useState(false);
3047
+ const isMobile2 = useIsMobile();
3048
+ const tooltipRef = useRef(null);
3049
+ const handleToggle = () => {
3050
+ setOpen((prev) => !prev);
3051
+ };
3052
+ useEffect(() => {
3053
+ const handleClickOutside = (event) => {
3054
+ if (tooltipRef.current && !tooltipRef.current.contains(event.target)) {
3055
+ setOpen(false);
3056
+ }
3057
+ };
3058
+ document.addEventListener("mousedown", handleClickOutside);
3059
+ return () => {
3060
+ document.removeEventListener("mousedown", handleClickOutside);
3061
+ };
3062
+ }, []);
3063
+ return /* @__PURE__ */ jsxs(Tooltip, { open: isMobile2 ? open : void 0, children: [
3064
+ /* @__PURE__ */ jsx(
3065
+ TooltipTrigger,
3066
+ {
3067
+ onClick: (e2) => {
3068
+ e2.preventDefault();
3069
+ handleToggle();
3070
+ },
3071
+ className: "w-4 h-4 rounded-full bg-muted text-muted-foreground",
3072
+ children
3073
+ }
3074
+ ),
3075
+ /* @__PURE__ */ jsx(TooltipContent, { ref: tooltipRef, children: text })
3032
3076
  ] });
3033
3077
  };
3034
3078
  const BASE_URL = "https://icons-ckg.pages.dev/stargate-light/tokens";
@@ -6603,7 +6647,30 @@ const EVM_CHAIN_KEY_TO_ID = {
6603
6647
  optimism: 10,
6604
6648
  polygon: 137,
6605
6649
  base: 8453,
6606
- bsc: 56
6650
+ bsc: 56,
6651
+ manta: 169,
6652
+ opbnb: 204,
6653
+ conflux: 1030,
6654
+ mantle: 5e3,
6655
+ plasma: 9745,
6656
+ monad: 143,
6657
+ celo: 42220,
6658
+ linea: 59144,
6659
+ blast: 81457,
6660
+ scroll: 534352,
6661
+ cronosevm: 25,
6662
+ gnosis: 100,
6663
+ sonic: 146,
6664
+ fantom: 250,
6665
+ zksync: 324,
6666
+ metis: 1088,
6667
+ zkevm: 1101,
6668
+ moonbeam: 1284,
6669
+ moonriver: 1285,
6670
+ kava: 2222,
6671
+ klaytn: 8217,
6672
+ avalanche: 43114,
6673
+ aurora: 1313161554
6607
6674
  };
6608
6675
  function ChainStrategyProvider({
6609
6676
  children,
@@ -26086,7 +26153,7 @@ class WalletConnectModal {
26086
26153
  }
26087
26154
  async initUi() {
26088
26155
  if (typeof window !== "undefined") {
26089
- await import("./index-D2IOd6mV.js");
26156
+ await import("./index-ClSyIB0n.js");
26090
26157
  const modal = document.createElement("wcm-modal");
26091
26158
  document.body.insertAdjacentElement("beforeend", modal);
26092
26159
  OptionsCtrl.setIsUiLoaded(true);
@@ -26990,4 +27057,4 @@ export {
26990
27057
  calculateMinReceived as y,
26991
27058
  getQuoteDetails as z
26992
27059
  };
26993
- //# sourceMappingURL=index-KQ4SsUup.js.map
27060
+ //# sourceMappingURL=index-D7lsGQY9.js.map