@aurora-is-near/intents-swap-widget 3.16.0 → 3.16.1

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.
Files changed (90) hide show
  1. package/dist/{config-DQMHUj5z.js → config-DJ258QoC.js} +387 -389
  2. package/dist/{config-DQMHUj5z.js.map → config-DJ258QoC.js.map} +1 -1
  3. package/dist/config.js +1 -1
  4. package/dist/errors.js +1 -1
  5. package/dist/ext/alchemy/index.js +1 -1
  6. package/dist/ext/index.js +1 -1
  7. package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
  8. package/dist/features/BalanceRpcLoader/index.js +1 -1
  9. package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
  10. package/dist/features/ChainsDropdown/index.js +1 -1
  11. package/dist/features/DepositMethodSwitcher.js +1 -1
  12. package/dist/features/ErrorBoundary.js +1 -1
  13. package/dist/features/ExternalDeposit.js +1 -1
  14. package/dist/features/SendAddress/index.js +1 -1
  15. package/dist/features/SendAddress/useNotification.js +1 -1
  16. package/dist/features/SubmitButton/index.js +1 -1
  17. package/dist/features/SuccessScreen/index.js +1 -1
  18. package/dist/features/SwapDirectionSwitcher.js +1 -1
  19. package/dist/features/SwapQuote/SwapQuote.js +1 -1
  20. package/dist/features/SwapQuote/index.js +1 -1
  21. package/dist/features/TokenInput/TokenInput.js +1 -1
  22. package/dist/features/TokenInput/TokenInputEmpty.js +1 -1
  23. package/dist/features/TokenInput/TokenInputSource.js +1 -1
  24. package/dist/features/TokenInput/TokenInputTarget.js +1 -1
  25. package/dist/features/TokenInput/WalletBalance.js +1 -1
  26. package/dist/features/TokenInput/hooks/index.js +1 -1
  27. package/dist/features/TokenInput/hooks/useTokenInputBalance.js +1 -1
  28. package/dist/features/TokenInput/index.js +1 -1
  29. package/dist/features/TokensList/TokenItem.js +1 -1
  30. package/dist/features/TokensList/TokensList.js +1 -1
  31. package/dist/features/TokensList/index.js +1 -1
  32. package/dist/features/TokensModal.js +1 -1
  33. package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +1 -1
  34. package/dist/features/WalletCompatibilityCheck/index.js +1 -1
  35. package/dist/features/index.js +1 -1
  36. package/dist/hooks/index.js +1 -1
  37. package/dist/hooks/useAllTokens.js +1 -1
  38. package/dist/hooks/useChains.js +1 -1
  39. package/dist/hooks/useCompatibilityCheck.js +1 -1
  40. package/dist/hooks/useDefaultToken.js +1 -1
  41. package/dist/hooks/useExternalDepositStatus/index.js +1 -1
  42. package/dist/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.js +1 -1
  43. package/dist/hooks/useIntentsBalance.js +1 -1
  44. package/dist/hooks/useIsCompatibilityCheckRequired.js +1 -1
  45. package/dist/hooks/useMakeDepositAddress.js +1 -1
  46. package/dist/hooks/useMakeIntentsTransfer.js +1 -1
  47. package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
  48. package/dist/hooks/useMakeQuote.js +1 -1
  49. package/dist/hooks/useMakeQuoteTransfer.js +1 -1
  50. package/dist/hooks/useMakeTransfer.js +1 -1
  51. package/dist/hooks/useMergedBalance.js +1 -1
  52. package/dist/hooks/useSwitchChain.js +1 -1
  53. package/dist/hooks/useTheme.js +1 -1
  54. package/dist/hooks/useToggleTheme.js +19 -21
  55. package/dist/hooks/useToggleTheme.js.map +1 -1
  56. package/dist/hooks/useTokenInputPair.js +1 -1
  57. package/dist/hooks/useTokens.js +1 -1
  58. package/dist/hooks/useTokensFiltered.js +1 -1
  59. package/dist/hooks/useTokensIntentsUnique.js +1 -1
  60. package/dist/index.js +1 -1
  61. package/dist/machine/effects/index.js +1 -1
  62. package/dist/machine/effects/useAlchemyBalanceEffect.js +1 -1
  63. package/dist/machine/effects/useBalancesUpdateEffect.js +1 -1
  64. package/dist/machine/effects/useMakeQuoteEffect.js +1 -1
  65. package/dist/machine/effects/useSelectedTokensEffect.js +1 -1
  66. package/dist/machine/effects/useSetTokenBalanceEffect.js +1 -1
  67. package/dist/machine/effects/useSetTokenIntentsTargetEffect.js +1 -1
  68. package/dist/machine/effects/useWalletConnEffect.js +1 -1
  69. package/dist/machine/events/index.js +1 -1
  70. package/dist/machine/events/tokenSelect.js +1 -1
  71. package/dist/machine/events/validateInputAndMoveTo.js +1 -1
  72. package/dist/machine/events/validateInputs.js +1 -1
  73. package/dist/machine/index.js +1 -1
  74. package/dist/machine/snap.js +1 -1
  75. package/dist/machine/subscriptions/checkers/isSendAddressAsConnected.js +1 -1
  76. package/dist/machine/subscriptions/index.js +1 -1
  77. package/dist/theme/ThemeProvider.js +3 -4
  78. package/dist/theme/ThemeProvider.js.map +1 -1
  79. package/dist/utils/intents/signers/near.js +1 -1
  80. package/dist/utils/intents/signers/privy.js +1 -1
  81. package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
  82. package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +1 -1
  83. package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
  84. package/dist/widgets/WidgetSwap/WidgetSwapContent.js +1 -1
  85. package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
  86. package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +1 -1
  87. package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
  88. package/package.json +1 -1
  89. package/src/hooks/useToggleTheme.ts +23 -27
  90. package/src/theme/ThemeProvider.tsx +8 -11
@@ -1,7 +1,7 @@
1
1
  import "react";
2
2
  import "../../logger.js";
3
3
  import "../guards/checks/isDryQuote.js";
4
- import { P as a } from "../../config-DQMHUj5z.js";
4
+ import { P as a } from "../../config-DJ258QoC.js";
5
5
  import "../guards/index.js";
6
6
  import "../machine.js";
7
7
  import "../events/utils/fireEvent.js";
@@ -2,7 +2,7 @@ import "react";
2
2
  import "../../utils/solana/isSolanaAddress.js";
3
3
  import "../../utils/evm/isEvmAddress.js";
4
4
  import "../../utils/near/isNearAddress.js";
5
- import { R as l } from "../../config-DQMHUj5z.js";
5
+ import { R as l } from "../../config-DJ258QoC.js";
6
6
  import "../../utils/tokens/getMainTokenByChain.js";
7
7
  import "../../utils/tokens/getDefaultIntentsToken.js";
8
8
  import "../../utils/tokens/getTokenWithHighBalance.js";
@@ -1,5 +1,5 @@
1
1
  import "react";
2
- import { G as a } from "../../config-DQMHUj5z.js";
2
+ import { G as a } from "../../config-DJ258QoC.js";
3
3
  import "../../utils/intents/getTokenBalanceKey.js";
4
4
  import "ethers";
5
5
  import "../machine.js";
@@ -1,5 +1,5 @@
1
1
  import "react";
2
- import { H as i } from "../../config-DQMHUj5z.js";
2
+ import { H as i } from "../../config-DJ258QoC.js";
3
3
  import "ethers";
4
4
  import "../machine.js";
5
5
  import "../events/utils/fireEvent.js";
@@ -1,6 +1,6 @@
1
1
  import "react";
2
2
  import "../../hooks/useWalletAddressForToken.js";
3
- import { I as f } from "../../config-DQMHUj5z.js";
3
+ import { I as f } from "../../config-DJ258QoC.js";
4
4
  import "../guards/index.js";
5
5
  import "../machine.js";
6
6
  import "../events/utils/fireEvent.js";
@@ -3,7 +3,7 @@ import "./tokenSelectRotate.js";
3
3
  import "./errorSet.js";
4
4
  import "./quoteSet.js";
5
5
  import "./addressSet.js";
6
- import { _ as b } from "../../config-DQMHUj5z.js";
6
+ import { _ as b } from "../../config-DJ258QoC.js";
7
7
  import "./tokenSetAmount.js";
8
8
  import "./quoteSetStatus.js";
9
9
  import "./depositTypeSet.js";
@@ -1,6 +1,6 @@
1
1
  import "valtio";
2
2
  import "./tokenSelectRotate.js";
3
- import { Z as p } from "../../config-DQMHUj5z.js";
3
+ import { Z as p } from "../../config-DJ258QoC.js";
4
4
  import "../../utils/notReachable.js";
5
5
  export {
6
6
  p as tokenSelect
@@ -1,4 +1,4 @@
1
- import { O as m } from "../../config-DQMHUj5z.js";
1
+ import { O as m } from "../../config-DJ258QoC.js";
2
2
  import "ethers";
3
3
  import "../machine.js";
4
4
  import "../guards/checks/isDryQuote.js";
@@ -3,7 +3,7 @@ import "../../utils/near/checkNearAccountExists.js";
3
3
  import "../../utils/checkers/isNotEmptyAmount.js";
4
4
  import "../../utils/checkers/isValidBigint.js";
5
5
  import "../../utils/near/isNearAddress.js";
6
- import { K as I, L as d, N as u } from "../../config-DQMHUj5z.js";
6
+ import { K as I, L as d, N as u } from "../../config-DJ258QoC.js";
7
7
  import "../guards/index.js";
8
8
  import "../machine.js";
9
9
  import "../guards/checks/isBalanceSufficient.js";
@@ -1,4 +1,4 @@
1
- import { r as o, u as t, a as r, c as a, b as f } from "../config-DQMHUj5z.js";
1
+ import { r as o, u as t, a as r, c as a, b as f } from "../config-DJ258QoC.js";
2
2
  import { guardStates as S } from "./guards/index.js";
3
3
  import { machine as n, moveTo as u } from "./machine.js";
4
4
  import { fireEvent as i } from "./events/utils/fireEvent.js";
@@ -2,7 +2,7 @@ import "valtio";
2
2
  import "derive-valtio";
3
3
  import "./computed/getIsNativeNearDeposit.js";
4
4
  import "./computed/getIsDirectTokenOnNearDeposit.js";
5
- import { u as h, a as b, b as d } from "../config-DQMHUj5z.js";
5
+ import { u as h, a as b, b as d } from "../config-DJ258QoC.js";
6
6
  import "./machine.js";
7
7
  import "./guards/index.js";
8
8
  import "./computed/getUsdTradeDelta.js";
@@ -1,5 +1,5 @@
1
1
  import "valtio";
2
- import { V as o } from "../../../config-DQMHUj5z.js";
2
+ import { V as o } from "../../../config-DJ258QoC.js";
3
3
  export {
4
4
  o as isSendAddressAsConnected
5
5
  };
@@ -5,7 +5,7 @@ import "./checkers/isOnlyErrorChanged.js";
5
5
  import "./checkers/isValidInitialState.js";
6
6
  import "./checkers/isWalletDisconnected.js";
7
7
  import "./checkers/isSendAddressForbidden.js";
8
- import { X as g, Y as u } from "../../config-DQMHUj5z.js";
8
+ import { X as g, Y as u } from "../../config-DJ258QoC.js";
9
9
  import "./checkers/isAmountChangedFromQuote.js";
10
10
  import "ethers";
11
11
  import "../machine.js";
@@ -1,10 +1,9 @@
1
1
  import "react/jsx-runtime";
2
- import "browser-or-node";
3
2
  import "react";
4
3
  import "./createColorPalette.js";
5
- import { C as p, ae as a } from "../config-DQMHUj5z.js";
4
+ import { C as i, ae as p } from "../config-DJ258QoC.js";
6
5
  export {
7
- p as ThemeContext,
8
- a as ThemeProvider
6
+ i as ThemeContext,
7
+ p as ThemeProvider
9
8
  };
10
9
  //# sourceMappingURL=ThemeProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
1
+ {"version":3,"file":"ThemeProvider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,6 +1,6 @@
1
1
  import "../../../index-DEq3oXQF.js";
2
2
  import "@defuse-protocol/bridge-sdk";
3
- import { a2 as o } from "../../../config-DQMHUj5z.js";
3
+ import { a2 as o } from "../../../config-DJ258QoC.js";
4
4
  export {
5
5
  o as createNearWalletSigner
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import "@defuse-protocol/internal-utils";
2
- import { a1 as i } from "../../../config-DQMHUj5z.js";
2
+ import { a1 as i } from "../../../config-DJ258QoC.js";
3
3
  export {
4
4
  i as IntentSignerPrivy
5
5
  };
@@ -2,7 +2,7 @@ import "../../index-DEq3oXQF.js";
2
2
  import "zod";
3
3
  import "./decodeQueryResult.js";
4
4
  import "./rpc.js";
5
- import { $ as m } from "../../config-DQMHUj5z.js";
5
+ import { $ as m } from "../../config-DJ258QoC.js";
6
6
  export {
7
7
  m as getNearNep141StorageBalance
8
8
  };
@@ -3,7 +3,7 @@ import { useState as y, useEffect as l, useCallback as B } from "react";
3
3
  import { useTokenModal as R } from "../../hooks/useTokenModal.js";
4
4
  import { useTypedTranslation as A } from "../../localisation.js";
5
5
  import { WidgetDepositSkeleton as b } from "./WidgetDepositSkeleton.js";
6
- import { b as F, u as q, y as j, n as N, c as O, p as Q, o as U, S as K } from "../../config-DQMHUj5z.js";
6
+ import { b as F, u as q, y as j, n as N, c as O, p as Q, o as U, S as K } from "../../config-DJ258QoC.js";
7
7
  import "@tanstack/react-query";
8
8
  import "@headlessui/react";
9
9
  import "framer-motion";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
2
  import a from "clsx";
3
3
  import { SkeletonBox as s } from "../../components/SkeletonBox.js";
4
- import { y as i } from "../../config-DQMHUj5z.js";
4
+ import { y as i } from "../../config-DJ258QoC.js";
5
5
  const p = () => {
6
6
  const { hideTokenInputHeadings: l } = i();
7
7
  return /* @__PURE__ */ o("div", { className: "w-full gap-sw-xl relative flex flex-col", children: [
@@ -3,7 +3,7 @@ import { useState as b, useEffect as y } from "react";
3
3
  import { useTokenModal as R } from "../../hooks/useTokenModal.js";
4
4
  import { WidgetSwapSkeleton as S } from "./WidgetSwapSkeleton.js";
5
5
  import { useTypedTranslation as D } from "../../localisation.js";
6
- import { b as N, u as O, y as Q, n as j, c as q, p as w, o as F, S as U } from "../../config-DQMHUj5z.js";
6
+ import { b as N, u as O, y as Q, n as j, c as q, p as w, o as F, S as U } from "../../config-DJ258QoC.js";
7
7
  import "@tanstack/react-query";
8
8
  import "@headlessui/react";
9
9
  import "framer-motion";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as a, jsx as l } from "react/jsx-runtime";
2
2
  import o from "clsx";
3
3
  import { SkeletonBox as s } from "../../components/SkeletonBox.js";
4
- import { y as i } from "../../config-DQMHUj5z.js";
4
+ import { y as i } from "../../config-DJ258QoC.js";
5
5
  const m = () => {
6
6
  const { hideTokenInputHeadings: e } = i();
7
7
  return /* @__PURE__ */ a("div", { className: "w-full gap-sw-lg relative flex flex-col", children: [
@@ -3,7 +3,7 @@ import { useState as w, useEffect as b } from "react";
3
3
  import { useTokenModal as B } from "../../hooks/useTokenModal.js";
4
4
  import { WidgetWithdrawSkeleton as y } from "./WidgetWithdrawSkeleton.js";
5
5
  import { useTypedTranslation as D } from "../../localisation.js";
6
- import { b as N, u as O, y as Q, n as j, c as q, p as S, o as F, S as U } from "../../config-DQMHUj5z.js";
6
+ import { b as N, u as O, y as Q, n as j, c as q, p as S, o as F, S as U } from "../../config-DJ258QoC.js";
7
7
  import "@tanstack/react-query";
8
8
  import "@headlessui/react";
9
9
  import "framer-motion";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import o from "clsx";
3
3
  import { SkeletonBox as l } from "../../components/SkeletonBox.js";
4
- import { y as x } from "../../config-DQMHUj5z.js";
4
+ import { y as x } from "../../config-DJ258QoC.js";
5
5
  const p = () => {
6
6
  const { hideTokenInputHeadings: s } = x();
7
7
  return /* @__PURE__ */ a("div", { className: "w-full gap-sw-xl relative flex flex-col", children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurora-is-near/intents-swap-widget",
3
- "version": "3.16.0",
3
+ "version": "3.16.1",
4
4
  "description": "Provides components and hooks to build your own Intents swap widget",
5
5
  "author": "Maksim Vashchuk",
6
6
  "license": "MIT",
@@ -4,9 +4,7 @@ import { isBrowser } from 'browser-or-node';
4
4
  type ThemeMode = 'light' | 'dark' | 'auto';
5
5
 
6
6
  const applyThemeDataAttr = (theme: ThemeMode, parentEl: Element | null) => {
7
- if (isBrowser) {
8
- (parentEl ?? document.body).setAttribute('data-sw-theme', theme);
9
- }
7
+ (parentEl ?? document.body).setAttribute('data-sw-theme', theme);
10
8
  };
11
9
 
12
10
  type Args = {
@@ -30,34 +28,32 @@ export const useToggleTheme = ({
30
28
  });
31
29
 
32
30
  useEffect(() => {
33
- if (isBrowser) {
34
- const themeParentElement = themeParentElementSelector
35
- ? document.querySelector(themeParentElementSelector)
36
- : null;
31
+ const themeParentElement = themeParentElementSelector
32
+ ? document.querySelector(themeParentElementSelector)
33
+ : null;
37
34
 
38
- if (theme === undefined) {
39
- setTheme((localStorage.getItem('theme') as ThemeMode) || 'dark');
40
- } else if (theme === 'auto') {
41
- const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
42
- const updateTheme = () => {
43
- const palette = mediaQuery.matches ? 'dark' : 'light';
35
+ if (theme === undefined) {
36
+ setTheme((localStorage.getItem('theme') as ThemeMode) || 'dark');
37
+ } else if (theme === 'auto') {
38
+ const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
39
+ const updateTheme = () => {
40
+ const palette = mediaQuery.matches ? 'dark' : 'light';
44
41
 
45
- applyThemeDataAttr(palette, themeParentElement);
46
- setColorPalette(palette);
47
- onChange?.(palette);
48
- };
42
+ applyThemeDataAttr(palette, themeParentElement);
43
+ setColorPalette(palette);
44
+ onChange?.(palette);
45
+ };
49
46
 
50
- updateTheme();
51
- mediaQuery.addEventListener('change', updateTheme);
52
- localStorage.setItem('theme', 'auto');
47
+ updateTheme();
48
+ mediaQuery.addEventListener('change', updateTheme);
49
+ localStorage.setItem('theme', 'auto');
53
50
 
54
- return () => mediaQuery.removeEventListener('change', updateTheme);
55
- } else {
56
- localStorage.setItem('theme', theme);
57
- applyThemeDataAttr(theme, themeParentElement);
58
- setColorPalette(theme);
59
- onChange?.(theme);
60
- }
51
+ return () => mediaQuery.removeEventListener('change', updateTheme);
52
+ } else {
53
+ localStorage.setItem('theme', theme);
54
+ applyThemeDataAttr(theme, themeParentElement);
55
+ setColorPalette(theme);
56
+ onChange?.(theme);
61
57
  }
62
58
  }, [theme]);
63
59
 
@@ -1,4 +1,3 @@
1
- import { isBrowser } from 'browser-or-node';
2
1
  import { createContext, type ReactNode, useEffect, useMemo } from 'react';
3
2
 
4
3
  import { ColorPalette, ColorScheme, HexColor, Theme } from '../types/theme';
@@ -10,17 +9,15 @@ const setColorVariables = (
10
9
  colorKey: string,
11
10
  parentEl: Element | null,
12
11
  ) => {
13
- if (isBrowser) {
14
- let parentElement = document.body;
12
+ let parentElement = document.body;
15
13
 
16
- if (parentEl instanceof HTMLElement) {
17
- parentElement = parentEl;
18
- }
19
-
20
- Object.entries(palette).forEach(([key, value]) => {
21
- parentElement.style.setProperty(`--c-sw-${colorKey}-${key}`, value);
22
- });
14
+ if (parentEl instanceof HTMLElement) {
15
+ parentElement = parentEl;
23
16
  }
17
+
18
+ Object.entries(palette).forEach(([key, value]) => {
19
+ parentElement.style.setProperty(`--c-sw-${colorKey}-${key}`, value);
20
+ });
24
21
  };
25
22
 
26
23
  const setColorPalette = (
@@ -63,7 +60,7 @@ export const ThemeProvider = ({ children, theme }: ThemeProviderProps) => {
63
60
  const value = useMemo((): Theme | undefined => theme, [theme]);
64
61
 
65
62
  useEffect(() => {
66
- if (theme && isBrowser) {
63
+ if (theme) {
67
64
  const themeParentElement = themeParentElementSelector
68
65
  ? document.querySelector(themeParentElementSelector)
69
66
  : null;