@0xsquid/react-hooks 8.0.1 → 8.0.2

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.
@@ -27497,7 +27497,7 @@ const filterViewableTokens = (tokens, config, direction) => {
27497
27497
  };
27498
27498
  const getSecretNetworkBalances = async (chainData, cosmosAddress, squidTokens, keplrTypeWallet) => {
27499
27499
  const squidSecretTokens = squidTokens.filter((t) => t.chainId === CHAIN_IDS.SECRET);
27500
- const { fetchAllSecretBalances } = await Promise.resolve().then(function () { return require('./secretService-DBxDcfuA.js'); });
27500
+ const { fetchAllSecretBalances } = await Promise.resolve().then(function () { return require('./secretService-DT8cWLsm.js'); });
27501
27501
  return fetchAllSecretBalances(chainData, cosmosAddress, squidSecretTokens, keplrTypeWallet);
27502
27502
  };
27503
27503
  function getTokenAssetsKey(token) {
@@ -30653,7 +30653,7 @@ function useStellarWallets() {
30653
30653
  return;
30654
30654
  try {
30655
30655
  const { allowAllModules: initializeAllModules } = await import('@creit.tech/stellar-wallets-kit');
30656
- const { formatStellarWallet } = await Promise.resolve().then(function () { return require('./stellarService.client-DTFEi5m2.js'); });
30656
+ const { formatStellarWallet } = await Promise.resolve().then(function () { return require('./stellarService.client-DH1Yp2nE.js'); });
30657
30657
  const modules = initializeAllModules();
30658
30658
  const promises = modules.map(async (module) => {
30659
30659
  const isAvailable = await module.isAvailable();
@@ -31953,64 +31953,13 @@ function useTrackSearchEmpty({ searchQuery, resultsLength, context, debounceMs =
31953
31953
  }, [context, debounceMs, resultsLength, searchQuery]);
31954
31954
  }
31955
31955
 
31956
- const useKeyboardNavigation = (props) => {
31957
- const { itemsListRef, activeListItemClassName = "", onEscape } = props ?? {};
31956
+ const useKeyboardNavigation = ({ onEscape }) => {
31958
31957
  const onKeyDown = React.useCallback((event) => {
31959
31958
  if (event.key === "Escape") {
31960
31959
  onEscape?.();
31961
31960
  return;
31962
31961
  }
31963
- if (activeListItemClassName.trim() === "")
31964
- return;
31965
- const itemsList = itemsListRef?.current;
31966
- const separatedActiveItemClassNames = activeListItemClassName.split(" ");
31967
- const defaultActiveItem = itemsList?.querySelector(`.${separatedActiveItemClassNames.join(".")}`);
31968
- if (event.key === "ArrowUp") {
31969
- if (!itemsList)
31970
- return;
31971
- event.preventDefault();
31972
- const activeItem = defaultActiveItem ?? itemsList.lastElementChild;
31973
- if (!activeItem)
31974
- return;
31975
- const previousItem = activeItem.previousElementSibling;
31976
- if (previousItem) {
31977
- activeItem.classList.remove(...separatedActiveItemClassNames);
31978
- previousItem.classList.add(...separatedActiveItemClassNames);
31979
- // scroll to previous item
31980
- itemsList.scrollTo({
31981
- top: (previousItem.offsetTop ?? 0) -
31982
- itemsList.clientHeight,
31983
- behavior: "smooth",
31984
- });
31985
- }
31986
- }
31987
- else if (event.key === "ArrowDown") {
31988
- if (!itemsList)
31989
- return;
31990
- event.preventDefault();
31991
- const activeItem = defaultActiveItem ?? itemsList.firstElementChild;
31992
- if (!activeItem)
31993
- return;
31994
- const nextItem = activeItem.nextElementSibling;
31995
- if (nextItem) {
31996
- activeItem.classList.remove(...separatedActiveItemClassNames);
31997
- nextItem.classList.add(...separatedActiveItemClassNames);
31998
- // scroll to next item
31999
- itemsList.scrollTo({
32000
- top: (nextItem.offsetTop ?? 0) -
32001
- itemsList.clientHeight,
32002
- behavior: "smooth",
32003
- });
32004
- }
32005
- }
32006
- else if (event.key === "Enter") {
32007
- event.preventDefault();
32008
- if (defaultActiveItem) {
32009
- // select active item
32010
- defaultActiveItem.querySelector("button")?.click();
32011
- }
32012
- }
32013
- }, [itemsListRef, activeListItemClassName]);
31962
+ }, [onEscape]);
32014
31963
  React.useEffect(() => {
32015
31964
  document.addEventListener("keydown", onKeyDown, false);
32016
31965
  return () => {
@@ -41095,4 +41044,4 @@ exports.useWallets = useWallets;
41095
41044
  exports.useXrplTrustLine = useXrplTrustLine;
41096
41045
  exports.walletIconBaseUrl = walletIconBaseUrl;
41097
41046
  exports.walletSupportsChainType = walletSupportsChainType;
41098
- //# sourceMappingURL=index-DVmnHUzP.js.map
41047
+ //# sourceMappingURL=index-BjIFR_GS.js.map