@multiversx/sdk-dapp-liquidity 1.0.12 → 1.0.14
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/ConstantsUtil-BinYIDR2.mjs +8 -0
- package/ConstantsUtil-CbnVdQ5P.js +8 -0
- package/add-D-ECcdUh.mjs +19 -0
- package/add-Diz8heiY.js +20 -0
- package/all-wallets-_iOQf3bl.js +11 -0
- package/all-wallets-puIIQy3Y.mjs +10 -0
- package/app-store-BGTKFL27.js +22 -0
- package/app-store-Bsf7w3pv.mjs +21 -0
- package/apple-Cw8e8IGH.mjs +22 -0
- package/apple-DF7n_Yzl.js +23 -0
- package/arrow-bottom-Cp2C4fQv.mjs +12 -0
- package/arrow-bottom-DTvIR3s3.js +13 -0
- package/arrow-bottom-circle-CN6i5mHz.mjs +15 -0
- package/arrow-bottom-circle-CzPwiwWH.js +16 -0
- package/arrow-left-9VFYHQSW.js +13 -0
- package/arrow-left-BDQHoEvX.mjs +12 -0
- package/arrow-right-BxkuSpWU.mjs +12 -0
- package/arrow-right-DBLQ6w92.js +13 -0
- package/arrow-top-BiQd5Aey.js +13 -0
- package/arrow-top-BrLVX4Rj.mjs +12 -0
- package/bank-B7EC6Kdz.mjs +18 -0
- package/bank-CvPn9sfV.js +19 -0
- package/{bignumber-CKZkoo0g.mjs → bignumber-2Z7uapuD.mjs} +6 -6
- package/{bignumber-B8vjg9qn.js → bignumber-D1Wl54dL.js} +6 -6
- package/bin-BXO1kNZh.js +9 -0
- package/bin-CwiYVJ1L.mjs +8 -0
- package/bitcoin-C3kBVar_.mjs +17 -0
- package/bitcoin-DAvQGpeP.js +3251 -0
- package/bitcoin-dNBGbS2B.mjs +3251 -0
- package/bitcoin-k6bvmzMA.js +18 -0
- package/browser-ShRLuKKz.mjs +18 -0
- package/browser-t7nfT7HL.js +19 -0
- package/card-BJg5bdoM.mjs +18 -0
- package/card-hxUDXttT.js +19 -0
- package/checkmark-BpR0Yy93.mjs +15 -0
- package/checkmark-D9AVWgl5.js +16 -0
- package/checkmark-bold-D3Xcby1U.mjs +12 -0
- package/checkmark-bold-De02hde8.js +13 -0
- package/chevron-bottom-DcBf7T5F.js +13 -0
- package/chevron-bottom-DfGpWIz7.mjs +12 -0
- package/chevron-left-BKvYVnUo.js +13 -0
- package/chevron-left-DGSG9WJQ.mjs +12 -0
- package/chevron-right-BLgYIEeO.js +13 -0
- package/chevron-right-C2nsTx_Y.mjs +12 -0
- package/chevron-top-CwFOEFy8.js +13 -0
- package/chevron-top-vk-9DvUU.mjs +12 -0
- package/chrome-store-4H_ie3vA.mjs +65 -0
- package/chrome-store-BWarxVMl.js +66 -0
- package/circle-BtqWJU0_.mjs +8 -0
- package/circle-DYjG6o7-.js +9 -0
- package/clock-Ba5SM-pl.mjs +12 -0
- package/clock-DPzNREdU.js +13 -0
- package/close-CJHKFOyp.mjs +12 -0
- package/close-DDWnJdJe.js +13 -0
- package/coinPlaceholder-Cbba3D1H.mjs +12 -0
- package/coinPlaceholder-DdxQIc2D.js +13 -0
- package/compass-CugCxeSC.js +13 -0
- package/compass-DbN5DkTl.mjs +12 -0
- package/copy-CHSZprYJ.mjs +19 -0
- package/copy-En5h5Uhu.js +20 -0
- package/cursor-DCRkvEhr.mjs +7 -0
- package/cursor-DnEQtrUK.js +8 -0
- package/cursor-transparent-CU8lk-xg.js +17 -0
- package/cursor-transparent-CliETg4d.mjs +16 -0
- package/desktop-BgD7aypB.js +14 -0
- package/desktop-Cg5I32-p.mjs +13 -0
- package/disconnect-CCyMbAdw.js +13 -0
- package/disconnect-Cp2vRWB2.mjs +12 -0
- package/discord-B1d-qeSk.mjs +21 -0
- package/discord-BEB5klec.js +22 -0
- package/email-CorlePKz.js +873 -0
- package/email-Znno7H8_.mjs +878 -0
- package/embedded-wallet-B9ro9Tel.js +549 -0
- package/embedded-wallet-CnTWeseG.mjs +552 -0
- package/ethereum-BRcsRjUU.mjs +14 -0
- package/ethereum-CZ_xe09e.js +15 -0
- package/etherscan-BZKGpKp8.mjs +10 -0
- package/etherscan-DtLi-C3z.js +11 -0
- package/exclamation-triangle-BLNnBLEc.js +9 -0
- package/exclamation-triangle-CFThXxRT.mjs +8 -0
- package/extension-CwUepr-W.mjs +12 -0
- package/extension-DOD67G1k.js +13 -0
- package/external-link-CZkQS5XK.js +13 -0
- package/external-link-ClYNKSPt.mjs +12 -0
- package/facebook-CFjrd4my.mjs +30 -0
- package/facebook-CbE6K6AK.js +31 -0
- package/farcaster-Ba7_C-Vm.js +17 -0
- package/farcaster-DyVJtVS9.mjs +16 -0
- package/filters-CpHaFNjT.mjs +12 -0
- package/filters-w5LC-r6e.js +13 -0
- package/github-CeO70C3E.mjs +22 -0
- package/github-uLFBWAa5.js +23 -0
- package/google-CyOdUlbw.mjs +22 -0
- package/google-ILGK-opP.js +23 -0
- package/help-circle-Dh3dRNoB.mjs +16 -0
- package/help-circle-HUMbz_KN.js +17 -0
- package/id-Cy3Qkrvb.js +17 -0
- package/id-D-Q0uPFM.mjs +16 -0
- package/if-defined-CJ5EZLw2.js +815 -0
- package/if-defined-DjC5UMfF.mjs +815 -0
- package/image-BTGOf8bb.mjs +8 -0
- package/image-WFQO5bWa.js +9 -0
- package/index--O5ypTeK.mjs +70 -0
- package/index--Vg7VI9t.js +173 -0
- package/index-2iRSO1sa.mjs +9964 -0
- package/index-42Rpweo5.mjs +95 -0
- package/index-70kjE43k.mjs +90 -0
- package/index-8VyNYS01.js +273 -0
- package/index-B-dx8l0g.mjs +82 -0
- package/index-BB0nW9RB.mjs +198 -0
- package/index-BBwuv2SS.js +97 -0
- package/index-BIe-kofv.mjs +273 -0
- package/index-BQf6VHil.js +278 -0
- package/index-BWIZXhFv.mjs +630 -0
- package/index-BXkamf-I.js +337 -0
- package/index-BYTxCmKH.js +64 -0
- package/index-BYoOxo0S.js +218 -0
- package/index-Ba0tVdql.js +200 -0
- package/index-BdOAPWyt.mjs +210 -0
- package/index-BirWzf8c.mjs +71 -0
- package/index-BnCJUHtW.mjs +346 -0
- package/index-BuL2FC61.mjs +216 -0
- package/index-BxSUTfaY.js +88 -0
- package/index-C49C5Rxf.js +743 -0
- package/index-CNMDBpW7.js +346 -0
- package/index-CP0CGjqQ.mjs +263 -0
- package/index-CQaHcTZM.mjs +86 -0
- package/index-CRGXQei1.js +178 -0
- package/index-CSykUIfV.mjs +176 -0
- package/index-CWIHaLkQ.mjs +101 -0
- package/index-CZSDJd0P.mjs +1070 -0
- package/index-CZaV8JgR.mjs +49 -0
- package/index-CZjdy6QP.js +101 -0
- package/index-C_lIGGlC.js +632 -0
- package/index-CcgeRPs2.mjs +57 -0
- package/index-CeY_DRuc.js +566 -0
- package/index-ChFNkSxT.js +92 -0
- package/index-CkjZc20w.js +677 -0
- package/index-CtFcWwAd.js +72 -0
- package/index-D0mOfznC.mjs +362 -0
- package/index-DAtWLY21.js +84 -0
- package/index-DEs8H3w2.js +262 -0
- package/index-DLnxotbC.mjs +566 -0
- package/index-DN4fGDgg.mjs +743 -0
- package/index-DT_mc1hV.mjs +335 -0
- package/index-DZEwxUMS.js +59 -0
- package/index-DaRH_4bD.js +9939 -0
- package/index-Daok2ZKn.js +73 -0
- package/index-DomzHmwk.js +210 -0
- package/index-Dx7NyDyv.mjs +101 -0
- package/index-DyGir6_2.mjs +675 -0
- package/index-GglJmM2C.js +2237 -0
- package/index-H5b7UTeJ.mjs +173 -0
- package/index-NNZ1lNuc.mjs +168 -0
- package/index-RJd-gQcv.mjs +2235 -0
- package/index-dnFzVpGy.js +103 -0
- package/index-kwVLu8EV.js +168 -0
- package/index-miQwZPmn.js +51 -0
- package/index-oCj_SpOa.mjs +62 -0
- package/index-pNK-h_x9.js +1069 -0
- package/index-r6Kre1rx.js +362 -0
- package/index-xBD0nXoB.mjs +276 -0
- package/index.js +3 -3
- package/index.mjs +3 -3
- package/info-BKNAiN0k.js +8 -0
- package/info-DQE0s-A4.mjs +7 -0
- package/info-circle-C3uTocjH.js +17 -0
- package/info-circle-CIn6yeQo.mjs +16 -0
- package/lightbulb-CB-BmIop.js +8 -0
- package/lightbulb-Gv7IbnzO.mjs +7 -0
- package/mail-CFYm95wn.mjs +12 -0
- package/mail-GEwk-Fzr.js +13 -0
- package/mobile-CZ7ZBfa5.js +14 -0
- package/mobile-OIbnpFsU.mjs +13 -0
- package/more-C8N_RV55.mjs +15 -0
- package/more-CiQpPZwq.js +16 -0
- package/network-placeholder-CxEcczEx.mjs +18 -0
- package/network-placeholder-DwR8E8hP.js +19 -0
- package/nftPlaceholder-BFexVcGX.js +13 -0
- package/nftPlaceholder-MiYL110I.mjs +12 -0
- package/off-BNiMlpUU.mjs +8 -0
- package/off-iJHSK3Z7.js +9 -0
- package/onramp-Bs8HHFFY.js +1474 -0
- package/onramp-C6fuQfX7.mjs +1480 -0
- package/package.json +11 -11
- package/play-store-B4ssIYUA.js +37 -0
- package/play-store-D6nmQXhX.mjs +36 -0
- package/plus-Bh7z7Oc0.js +18 -0
- package/plus-C8ioZuCD.mjs +17 -0
- package/qr-code-CSVwaBLf.mjs +10 -0
- package/qr-code-YgtXPokK.js +11 -0
- package/react-BWxe90Ar.mjs +6342 -0
- package/react-BzZcQig5.js +6342 -0
- package/react-C_wTMVq_.js +23003 -0
- package/react-M-DnxvZl.mjs +23003 -0
- package/reactjs/components/BridgeForm/BridgeForm.js +2 -1
- package/reactjs/components/BridgeForm/BridgeForm.mjs +2 -1
- package/reactjs/components/Connect/BridgeAccountDisplay.js +3 -2
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +3 -2
- package/reactjs/components/Connect/CustomConnectButton.js +3 -2
- package/reactjs/components/Connect/CustomConnectButton.mjs +3 -2
- package/reactjs/components/Connect/SwitchChainButton.js +4 -3
- package/reactjs/components/Connect/SwitchChainButton.mjs +4 -3
- package/reactjs/components/DisplayAmount/DisplayAmount.js +1 -1
- package/reactjs/components/DisplayAmount/DisplayAmount.mjs +1 -1
- package/reactjs/components/TokenSelector/components/TokenItem.js +1 -1
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +1 -1
- package/reactjs/hooks/useAccount.d.ts +4 -4
- package/reactjs/hooks/useAccount.js +3 -2
- package/reactjs/hooks/useAccount.mjs +3 -2
- package/reactjs/hooks/useGetChainId.js +1 -1
- package/reactjs/hooks/useGetChainId.mjs +1 -1
- package/reactjs/index.js +3 -3
- package/reactjs/index.mjs +3 -3
- package/reactjs/init/init.js +4 -3
- package/reactjs/init/init.mjs +4 -3
- package/reactjs/init/tests/init.spec.js +2 -2
- package/reactjs/init/tests/init.spec.mjs +2 -2
- package/reactjs/queries/useGetEvmTokensBalances.query.js +3 -2
- package/reactjs/queries/useGetEvmTokensBalances.query.mjs +3 -2
- package/reactjs/reexports.js +3 -3
- package/reactjs/reexports.mjs +3 -3
- package/reactjs/utils/getCleanStringAmount.js +1 -1
- package/reactjs/utils/getCleanStringAmount.mjs +1 -1
- package/reactjs/utils/hasEnoughFunds.js +1 -1
- package/reactjs/utils/hasEnoughFunds.mjs +1 -1
- package/reactjs/utils/isStringFloat.js +1 -1
- package/reactjs/utils/isStringFloat.mjs +1 -1
- package/reactjs/utils/roundAmount.js +1 -1
- package/reactjs/utils/roundAmount.mjs +1 -1
- package/receive-CK0hRQPr.js +212 -0
- package/receive-CQcD6bZf.mjs +212 -0
- package/recycle-horizontal--x5cMoTE.js +14 -0
- package/recycle-horizontal-QI0xtDHK.mjs +13 -0
- package/ref-CqxfRkBm.mjs +41 -0
- package/ref-FGI2cUQB.js +41 -0
- package/refresh-CFNHjhDi.js +13 -0
- package/refresh-CSOC1NUY.mjs +12 -0
- package/reown-logo-BfU5xFX5.js +17 -0
- package/reown-logo-CZAEp1jU.mjs +16 -0
- package/search-Do_rb-9-.mjs +12 -0
- package/search-V9CGMHkm.js +13 -0
- package/send-D-5G7tDL.mjs +1204 -0
- package/send-D4yYsIHV.mjs +19 -0
- package/send-DoiSHLsX.js +1202 -0
- package/send-_jfNFrys.js +20 -0
- package/socials-BL7-97fT.mjs +758 -0
- package/socials-DF0CK9cN.js +756 -0
- package/solana-BQ0Jh8lh.js +18 -0
- package/solana-YAkDp6j_.mjs +17 -0
- package/swapHorizontal-DOIo-Ccx.mjs +12 -0
- package/swapHorizontal-OHKtz4Gu.js +13 -0
- package/swapHorizontalBold-D7QmFj-c.js +13 -0
- package/swapHorizontalBold-DDroA0Af.mjs +12 -0
- package/swapHorizontalMedium-CU_v0kFz.mjs +20 -0
- package/swapHorizontalMedium-D-yMmtml.js +21 -0
- package/swapHorizontalRoundedBold-CHvbmnjw.js +13 -0
- package/swapHorizontalRoundedBold-DXMH0sgK.mjs +12 -0
- package/swapVertical-CH7fTK6w.js +13 -0
- package/swapVertical-HJZ6rFcr.mjs +12 -0
- package/swaps-CETflhdU.js +1952 -0
- package/swaps-DRUV6d3p.mjs +1954 -0
- package/telegram-CsCauOwj.mjs +20 -0
- package/telegram-DKEcF_Tq.js +21 -0
- package/three-dots-B-7hr8Nl.js +10 -0
- package/three-dots-LNZ_fjP7.mjs +9 -0
- package/transactions-BTTsGV2W.mjs +37 -0
- package/transactions-mpNNlClw.js +37 -0
- package/twitch-CCWVT2ij.js +23 -0
- package/twitch-Dg1CCQvd.mjs +22 -0
- package/twitterIcon-BjR09Cj9.mjs +10 -0
- package/twitterIcon-CeEs0iDJ.js +11 -0
- package/verify-B8WZq7kt.mjs +12 -0
- package/verify-filled-BeqC1imk.mjs +12 -0
- package/verify-filled-C-mv3ApD.js +13 -0
- package/verify-yATdPqt-.js +13 -0
- package/w3m-modal-3GziKj7h.js +1254 -0
- package/w3m-modal-81Z5PngE.mjs +1255 -0
- package/wallet-BMXEH23x.js +13 -0
- package/wallet-CNAVQCfm.mjs +12 -0
- package/wallet-placeholder-CQ-7CmVN.mjs +18 -0
- package/wallet-placeholder-CdoQy2e6.js +19 -0
- package/walletconnect-ACr-R1QZ.mjs +38 -0
- package/walletconnect-BWSkiS2F.js +39 -0
- package/warning-circle-CYnuYwpt.js +17 -0
- package/warning-circle-HV2lOiCj.mjs +16 -0
- package/x-CW5dozRj.js +17 -0
- package/x-Cgm2OFpL.mjs +16 -0
- package/x-mark-CR8SpZvu.js +8 -0
- package/x-mark-u0KJjUJ1.mjs +7 -0
- package/index-B4Eq5P3w.mjs +0 -91
- package/index-C4WV9nam.js +0 -329
- package/index-CWMcKi_X.js +0 -107
- package/index-D8E0O3qL.mjs +0 -68744
- package/index-DJ8CdHSw.mjs +0 -107
- package/index-nigVQYBu.js +0 -68665
- package/react-C43nEIqn.js +0 -3133
- package/react-DKUsVej7.js +0 -50
- package/react-Dp0H8q2z.mjs +0 -50
- package/react-wMhOUFOm.mjs +0 -3133
- package/w3m-modal-DLyg7Voy.js +0 -356
- package/w3m-modal-hC-B8qZP.mjs +0 -356
package/w3m-modal-DLyg7Voy.js
DELETED
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const index = require("./index-nigVQYBu.js");
|
|
5
|
-
const styles = index.i`
|
|
6
|
-
:host {
|
|
7
|
-
z-index: var(--w3m-z-index);
|
|
8
|
-
display: block;
|
|
9
|
-
backface-visibility: hidden;
|
|
10
|
-
will-change: opacity;
|
|
11
|
-
position: fixed;
|
|
12
|
-
top: 0;
|
|
13
|
-
left: 0;
|
|
14
|
-
right: 0;
|
|
15
|
-
bottom: 0;
|
|
16
|
-
pointer-events: none;
|
|
17
|
-
opacity: 0;
|
|
18
|
-
background-color: var(--wui-cover);
|
|
19
|
-
transition: opacity 0.2s var(--wui-ease-out-power-2);
|
|
20
|
-
will-change: opacity;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
:host(.open) {
|
|
24
|
-
opacity: 1;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
:host(.embedded) {
|
|
28
|
-
position: relative;
|
|
29
|
-
pointer-events: unset;
|
|
30
|
-
background: none;
|
|
31
|
-
width: 100%;
|
|
32
|
-
opacity: 1;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
wui-card {
|
|
36
|
-
max-width: var(--w3m-modal-width);
|
|
37
|
-
width: 100%;
|
|
38
|
-
position: relative;
|
|
39
|
-
animation: zoom-in 0.2s var(--wui-ease-out-power-2);
|
|
40
|
-
animation-fill-mode: backwards;
|
|
41
|
-
outline: none;
|
|
42
|
-
transition:
|
|
43
|
-
border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1),
|
|
44
|
-
background-color var(--wui-duration-lg) var(--wui-ease-out-power-1);
|
|
45
|
-
will-change: border-radius, background-color;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
:host(.embedded) wui-card {
|
|
49
|
-
max-width: 400px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
wui-card[shake='true'] {
|
|
53
|
-
animation:
|
|
54
|
-
zoom-in 0.2s var(--wui-ease-out-power-2),
|
|
55
|
-
w3m-shake 0.5s var(--wui-ease-out-power-2);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
wui-flex {
|
|
59
|
-
overflow-x: hidden;
|
|
60
|
-
overflow-y: auto;
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
justify-content: center;
|
|
64
|
-
width: 100%;
|
|
65
|
-
height: 100%;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@media (max-height: 700px) and (min-width: 431px) {
|
|
69
|
-
wui-flex {
|
|
70
|
-
align-items: flex-start;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
wui-card {
|
|
74
|
-
margin: var(--wui-spacing-xxl) 0px;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@media (max-width: 430px) {
|
|
79
|
-
wui-flex {
|
|
80
|
-
align-items: flex-end;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
wui-card {
|
|
84
|
-
max-width: 100%;
|
|
85
|
-
border-bottom-left-radius: var(--local-border-bottom-mobile-radius);
|
|
86
|
-
border-bottom-right-radius: var(--local-border-bottom-mobile-radius);
|
|
87
|
-
border-bottom: none;
|
|
88
|
-
animation: slide-in 0.2s var(--wui-ease-out-power-2);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
wui-card[shake='true'] {
|
|
92
|
-
animation:
|
|
93
|
-
slide-in 0.2s var(--wui-ease-out-power-2),
|
|
94
|
-
w3m-shake 0.5s var(--wui-ease-out-power-2);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
@keyframes zoom-in {
|
|
99
|
-
0% {
|
|
100
|
-
transform: scale(0.95) translateY(0);
|
|
101
|
-
}
|
|
102
|
-
100% {
|
|
103
|
-
transform: scale(1) translateY(0);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
@keyframes slide-in {
|
|
108
|
-
0% {
|
|
109
|
-
transform: scale(1) translateY(50px);
|
|
110
|
-
}
|
|
111
|
-
100% {
|
|
112
|
-
transform: scale(1) translateY(0);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@keyframes w3m-shake {
|
|
117
|
-
0% {
|
|
118
|
-
transform: scale(1) rotate(0deg);
|
|
119
|
-
}
|
|
120
|
-
20% {
|
|
121
|
-
transform: scale(1) rotate(-1deg);
|
|
122
|
-
}
|
|
123
|
-
40% {
|
|
124
|
-
transform: scale(1) rotate(1.5deg);
|
|
125
|
-
}
|
|
126
|
-
60% {
|
|
127
|
-
transform: scale(1) rotate(-1.5deg);
|
|
128
|
-
}
|
|
129
|
-
80% {
|
|
130
|
-
transform: scale(1) rotate(1deg);
|
|
131
|
-
}
|
|
132
|
-
100% {
|
|
133
|
-
transform: scale(1) rotate(0deg);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
@keyframes w3m-view-height {
|
|
138
|
-
from {
|
|
139
|
-
height: var(--prev-height);
|
|
140
|
-
}
|
|
141
|
-
to {
|
|
142
|
-
height: var(--new-height);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`;
|
|
146
|
-
var __decorate = function(decorators, target, key, desc) {
|
|
147
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
148
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
149
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
150
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
151
|
-
};
|
|
152
|
-
const SCROLL_LOCK = "scroll-lock";
|
|
153
|
-
exports.W3mModal = class W3mModal extends index.r {
|
|
154
|
-
constructor() {
|
|
155
|
-
super();
|
|
156
|
-
this.unsubscribe = [];
|
|
157
|
-
this.abortController = void 0;
|
|
158
|
-
this.hasPrefetched = false;
|
|
159
|
-
this.enableEmbedded = index.OptionsController.state.enableEmbedded;
|
|
160
|
-
this.open = index.ModalController.state.open;
|
|
161
|
-
this.caipAddress = index.ChainController.state.activeCaipAddress;
|
|
162
|
-
this.caipNetwork = index.ChainController.state.activeCaipNetwork;
|
|
163
|
-
this.shake = index.ModalController.state.shake;
|
|
164
|
-
this.initializeTheming();
|
|
165
|
-
index.ApiController.prefetchAnalyticsConfig();
|
|
166
|
-
this.unsubscribe.push(...[
|
|
167
|
-
index.ModalController.subscribeKey("open", (val) => val ? this.onOpen() : this.onClose()),
|
|
168
|
-
index.ModalController.subscribeKey("shake", (val) => this.shake = val),
|
|
169
|
-
index.ChainController.subscribeKey("activeCaipNetwork", (val) => this.onNewNetwork(val)),
|
|
170
|
-
index.ChainController.subscribeKey("activeCaipAddress", (val) => this.onNewAddress(val)),
|
|
171
|
-
index.OptionsController.subscribeKey("enableEmbedded", (val) => this.enableEmbedded = val)
|
|
172
|
-
]);
|
|
173
|
-
}
|
|
174
|
-
firstUpdated() {
|
|
175
|
-
var _a, _b;
|
|
176
|
-
index.AssetUtil.fetchNetworkImage((_b = (_a = this.caipNetwork) == null ? void 0 : _a.assets) == null ? void 0 : _b.imageId);
|
|
177
|
-
if (this.caipAddress) {
|
|
178
|
-
if (this.enableEmbedded) {
|
|
179
|
-
index.ModalController.close();
|
|
180
|
-
this.prefetch();
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
this.onNewAddress(this.caipAddress);
|
|
184
|
-
}
|
|
185
|
-
if (this.open) {
|
|
186
|
-
this.onOpen();
|
|
187
|
-
}
|
|
188
|
-
if (this.enableEmbedded) {
|
|
189
|
-
this.prefetch();
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
disconnectedCallback() {
|
|
193
|
-
this.unsubscribe.forEach((unsubscribe) => unsubscribe());
|
|
194
|
-
this.onRemoveKeyboardListener();
|
|
195
|
-
}
|
|
196
|
-
render() {
|
|
197
|
-
this.style.cssText = `
|
|
198
|
-
--local-border-bottom-mobile-radius: ${this.enableEmbedded ? "clamp(0px, var(--wui-border-radius-l), 44px)" : "0px"};
|
|
199
|
-
`;
|
|
200
|
-
if (this.enableEmbedded) {
|
|
201
|
-
return index.x`${this.contentTemplate()}
|
|
202
|
-
<w3m-tooltip></w3m-tooltip> `;
|
|
203
|
-
}
|
|
204
|
-
return this.open ? index.x`
|
|
205
|
-
<wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
|
|
206
|
-
${this.contentTemplate()}
|
|
207
|
-
</wui-flex>
|
|
208
|
-
<w3m-tooltip></w3m-tooltip>
|
|
209
|
-
` : null;
|
|
210
|
-
}
|
|
211
|
-
contentTemplate() {
|
|
212
|
-
return index.x` <wui-card
|
|
213
|
-
shake="${this.shake}"
|
|
214
|
-
data-embedded="${index.o(this.enableEmbedded)}"
|
|
215
|
-
role="alertdialog"
|
|
216
|
-
aria-modal="true"
|
|
217
|
-
tabindex="0"
|
|
218
|
-
data-testid="w3m-modal-card"
|
|
219
|
-
>
|
|
220
|
-
<w3m-header></w3m-header>
|
|
221
|
-
<w3m-router></w3m-router>
|
|
222
|
-
<w3m-snackbar></w3m-snackbar>
|
|
223
|
-
<w3m-alertbar></w3m-alertbar>
|
|
224
|
-
</wui-card>`;
|
|
225
|
-
}
|
|
226
|
-
async onOverlayClick(event) {
|
|
227
|
-
if (event.target === event.currentTarget) {
|
|
228
|
-
await this.handleClose();
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
async handleClose() {
|
|
232
|
-
const isUnsupportedChain = index.RouterController.state.view === "UnsupportedChain";
|
|
233
|
-
if (isUnsupportedChain || await index.SIWXUtil.isSIWXCloseDisabled()) {
|
|
234
|
-
index.ModalController.shake();
|
|
235
|
-
} else {
|
|
236
|
-
index.ModalController.close();
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
initializeTheming() {
|
|
240
|
-
const { themeVariables, themeMode } = index.ThemeController.state;
|
|
241
|
-
const defaultThemeMode = index.UiHelperUtil.getColorTheme(themeMode);
|
|
242
|
-
index.initializeTheming(themeVariables, defaultThemeMode);
|
|
243
|
-
}
|
|
244
|
-
onClose() {
|
|
245
|
-
this.open = false;
|
|
246
|
-
this.classList.remove("open");
|
|
247
|
-
this.onScrollUnlock();
|
|
248
|
-
index.SnackController.hide();
|
|
249
|
-
this.onRemoveKeyboardListener();
|
|
250
|
-
}
|
|
251
|
-
onOpen() {
|
|
252
|
-
this.prefetch();
|
|
253
|
-
this.open = true;
|
|
254
|
-
this.classList.add("open");
|
|
255
|
-
this.onScrollLock();
|
|
256
|
-
this.onAddKeyboardListener();
|
|
257
|
-
}
|
|
258
|
-
onScrollLock() {
|
|
259
|
-
const styleTag = document.createElement("style");
|
|
260
|
-
styleTag.dataset["w3m"] = SCROLL_LOCK;
|
|
261
|
-
styleTag.textContent = `
|
|
262
|
-
body {
|
|
263
|
-
touch-action: none;
|
|
264
|
-
overflow: hidden;
|
|
265
|
-
overscroll-behavior: contain;
|
|
266
|
-
}
|
|
267
|
-
w3m-modal {
|
|
268
|
-
pointer-events: auto;
|
|
269
|
-
}
|
|
270
|
-
`;
|
|
271
|
-
document.head.appendChild(styleTag);
|
|
272
|
-
}
|
|
273
|
-
onScrollUnlock() {
|
|
274
|
-
const styleTag = document.head.querySelector(`style[data-w3m="${SCROLL_LOCK}"]`);
|
|
275
|
-
if (styleTag) {
|
|
276
|
-
styleTag.remove();
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
onAddKeyboardListener() {
|
|
280
|
-
var _a;
|
|
281
|
-
this.abortController = new AbortController();
|
|
282
|
-
const card = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("wui-card");
|
|
283
|
-
card == null ? void 0 : card.focus();
|
|
284
|
-
window.addEventListener("keydown", (event) => {
|
|
285
|
-
if (event.key === "Escape") {
|
|
286
|
-
this.handleClose();
|
|
287
|
-
} else if (event.key === "Tab") {
|
|
288
|
-
const { tagName } = event.target;
|
|
289
|
-
if (tagName && !tagName.includes("W3M-") && !tagName.includes("WUI-")) {
|
|
290
|
-
card == null ? void 0 : card.focus();
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}, this.abortController);
|
|
294
|
-
}
|
|
295
|
-
onRemoveKeyboardListener() {
|
|
296
|
-
var _a;
|
|
297
|
-
(_a = this.abortController) == null ? void 0 : _a.abort();
|
|
298
|
-
this.abortController = void 0;
|
|
299
|
-
}
|
|
300
|
-
async onNewAddress(caipAddress) {
|
|
301
|
-
const isSwitchingNamespace = index.ChainController.state.isSwitchingNamespace;
|
|
302
|
-
const nextConnected = index.CoreHelperUtil.getPlainAddress(caipAddress);
|
|
303
|
-
const isDisconnectedInSameNamespace = !nextConnected && !isSwitchingNamespace;
|
|
304
|
-
const isSwitchingNamespaceAndConnected = isSwitchingNamespace && nextConnected;
|
|
305
|
-
if (isDisconnectedInSameNamespace) {
|
|
306
|
-
index.ModalController.close();
|
|
307
|
-
} else if (isSwitchingNamespaceAndConnected) {
|
|
308
|
-
index.RouterController.goBack();
|
|
309
|
-
}
|
|
310
|
-
await index.SIWXUtil.initializeIfEnabled();
|
|
311
|
-
this.caipAddress = caipAddress;
|
|
312
|
-
index.ChainController.setIsSwitchingNamespace(false);
|
|
313
|
-
}
|
|
314
|
-
onNewNetwork(nextCaipNetwork) {
|
|
315
|
-
var _a, _b, _c, _d, _e;
|
|
316
|
-
index.AssetUtil.fetchNetworkImage((_a = nextCaipNetwork == null ? void 0 : nextCaipNetwork.assets) == null ? void 0 : _a.imageId);
|
|
317
|
-
const prevCaipNetworkId = (_c = (_b = this.caipNetwork) == null ? void 0 : _b.caipNetworkId) == null ? void 0 : _c.toString();
|
|
318
|
-
const nextNetworkId = (_d = nextCaipNetwork == null ? void 0 : nextCaipNetwork.caipNetworkId) == null ? void 0 : _d.toString();
|
|
319
|
-
const networkChanged = prevCaipNetworkId && nextNetworkId && prevCaipNetworkId !== nextNetworkId;
|
|
320
|
-
const isSwitchingNamespace = index.ChainController.state.isSwitchingNamespace;
|
|
321
|
-
const isUnsupportedNetwork = ((_e = this.caipNetwork) == null ? void 0 : _e.name) === index.ConstantsUtil.UNSUPPORTED_NETWORK_NAME;
|
|
322
|
-
const isConnectingExternal = index.RouterController.state.view === "ConnectingExternal";
|
|
323
|
-
const isNotConnected = !this.caipAddress;
|
|
324
|
-
const isNetworkChangedInSameNamespace = networkChanged && !isUnsupportedNetwork && !isSwitchingNamespace;
|
|
325
|
-
const isUnsupportedNetworkScreen = index.RouterController.state.view === "UnsupportedChain";
|
|
326
|
-
if (!isConnectingExternal && (isNotConnected || isUnsupportedNetworkScreen || isNetworkChangedInSameNamespace)) {
|
|
327
|
-
index.RouterController.goBack();
|
|
328
|
-
}
|
|
329
|
-
this.caipNetwork = nextCaipNetwork;
|
|
330
|
-
}
|
|
331
|
-
prefetch() {
|
|
332
|
-
if (!this.hasPrefetched) {
|
|
333
|
-
this.hasPrefetched = true;
|
|
334
|
-
index.ApiController.prefetch();
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
exports.W3mModal.styles = styles;
|
|
339
|
-
__decorate([
|
|
340
|
-
index.n({ type: Boolean })
|
|
341
|
-
], exports.W3mModal.prototype, "enableEmbedded", void 0);
|
|
342
|
-
__decorate([
|
|
343
|
-
index.r$1()
|
|
344
|
-
], exports.W3mModal.prototype, "open", void 0);
|
|
345
|
-
__decorate([
|
|
346
|
-
index.r$1()
|
|
347
|
-
], exports.W3mModal.prototype, "caipAddress", void 0);
|
|
348
|
-
__decorate([
|
|
349
|
-
index.r$1()
|
|
350
|
-
], exports.W3mModal.prototype, "caipNetwork", void 0);
|
|
351
|
-
__decorate([
|
|
352
|
-
index.r$1()
|
|
353
|
-
], exports.W3mModal.prototype, "shake", void 0);
|
|
354
|
-
exports.W3mModal = __decorate([
|
|
355
|
-
index.customElement("w3m-modal")
|
|
356
|
-
], exports.W3mModal);
|
package/w3m-modal-hC-B8qZP.mjs
DELETED
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
import { aE as i, aF as r, aG as OptionsController, aH as ModalController, aA as ChainController, aI as ApiController, aJ as AssetUtil, aK as x, aL as o, aM as RouterController, aN as SIWXUtil, aO as ThemeController, U as UiHelperUtil, i as initializeTheming, aP as SnackController, aC as CoreHelperUtil, aQ as ConstantsUtil, aR as n, aS as r$1, c as customElement } from "./index-D8E0O3qL.mjs";
|
|
2
|
-
const styles = i`
|
|
3
|
-
:host {
|
|
4
|
-
z-index: var(--w3m-z-index);
|
|
5
|
-
display: block;
|
|
6
|
-
backface-visibility: hidden;
|
|
7
|
-
will-change: opacity;
|
|
8
|
-
position: fixed;
|
|
9
|
-
top: 0;
|
|
10
|
-
left: 0;
|
|
11
|
-
right: 0;
|
|
12
|
-
bottom: 0;
|
|
13
|
-
pointer-events: none;
|
|
14
|
-
opacity: 0;
|
|
15
|
-
background-color: var(--wui-cover);
|
|
16
|
-
transition: opacity 0.2s var(--wui-ease-out-power-2);
|
|
17
|
-
will-change: opacity;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
:host(.open) {
|
|
21
|
-
opacity: 1;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
:host(.embedded) {
|
|
25
|
-
position: relative;
|
|
26
|
-
pointer-events: unset;
|
|
27
|
-
background: none;
|
|
28
|
-
width: 100%;
|
|
29
|
-
opacity: 1;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
wui-card {
|
|
33
|
-
max-width: var(--w3m-modal-width);
|
|
34
|
-
width: 100%;
|
|
35
|
-
position: relative;
|
|
36
|
-
animation: zoom-in 0.2s var(--wui-ease-out-power-2);
|
|
37
|
-
animation-fill-mode: backwards;
|
|
38
|
-
outline: none;
|
|
39
|
-
transition:
|
|
40
|
-
border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1),
|
|
41
|
-
background-color var(--wui-duration-lg) var(--wui-ease-out-power-1);
|
|
42
|
-
will-change: border-radius, background-color;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host(.embedded) wui-card {
|
|
46
|
-
max-width: 400px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
wui-card[shake='true'] {
|
|
50
|
-
animation:
|
|
51
|
-
zoom-in 0.2s var(--wui-ease-out-power-2),
|
|
52
|
-
w3m-shake 0.5s var(--wui-ease-out-power-2);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
wui-flex {
|
|
56
|
-
overflow-x: hidden;
|
|
57
|
-
overflow-y: auto;
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
justify-content: center;
|
|
61
|
-
width: 100%;
|
|
62
|
-
height: 100%;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@media (max-height: 700px) and (min-width: 431px) {
|
|
66
|
-
wui-flex {
|
|
67
|
-
align-items: flex-start;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
wui-card {
|
|
71
|
-
margin: var(--wui-spacing-xxl) 0px;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@media (max-width: 430px) {
|
|
76
|
-
wui-flex {
|
|
77
|
-
align-items: flex-end;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
wui-card {
|
|
81
|
-
max-width: 100%;
|
|
82
|
-
border-bottom-left-radius: var(--local-border-bottom-mobile-radius);
|
|
83
|
-
border-bottom-right-radius: var(--local-border-bottom-mobile-radius);
|
|
84
|
-
border-bottom: none;
|
|
85
|
-
animation: slide-in 0.2s var(--wui-ease-out-power-2);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
wui-card[shake='true'] {
|
|
89
|
-
animation:
|
|
90
|
-
slide-in 0.2s var(--wui-ease-out-power-2),
|
|
91
|
-
w3m-shake 0.5s var(--wui-ease-out-power-2);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
@keyframes zoom-in {
|
|
96
|
-
0% {
|
|
97
|
-
transform: scale(0.95) translateY(0);
|
|
98
|
-
}
|
|
99
|
-
100% {
|
|
100
|
-
transform: scale(1) translateY(0);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@keyframes slide-in {
|
|
105
|
-
0% {
|
|
106
|
-
transform: scale(1) translateY(50px);
|
|
107
|
-
}
|
|
108
|
-
100% {
|
|
109
|
-
transform: scale(1) translateY(0);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
@keyframes w3m-shake {
|
|
114
|
-
0% {
|
|
115
|
-
transform: scale(1) rotate(0deg);
|
|
116
|
-
}
|
|
117
|
-
20% {
|
|
118
|
-
transform: scale(1) rotate(-1deg);
|
|
119
|
-
}
|
|
120
|
-
40% {
|
|
121
|
-
transform: scale(1) rotate(1.5deg);
|
|
122
|
-
}
|
|
123
|
-
60% {
|
|
124
|
-
transform: scale(1) rotate(-1.5deg);
|
|
125
|
-
}
|
|
126
|
-
80% {
|
|
127
|
-
transform: scale(1) rotate(1deg);
|
|
128
|
-
}
|
|
129
|
-
100% {
|
|
130
|
-
transform: scale(1) rotate(0deg);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
@keyframes w3m-view-height {
|
|
135
|
-
from {
|
|
136
|
-
height: var(--prev-height);
|
|
137
|
-
}
|
|
138
|
-
to {
|
|
139
|
-
height: var(--new-height);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
`;
|
|
143
|
-
var __decorate = function(decorators, target, key, desc) {
|
|
144
|
-
var c = arguments.length, r2 = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
145
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
146
|
-
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c < 3 ? d(r2) : c > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
147
|
-
return c > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
148
|
-
};
|
|
149
|
-
const SCROLL_LOCK = "scroll-lock";
|
|
150
|
-
let W3mModal = class W3mModal2 extends r {
|
|
151
|
-
constructor() {
|
|
152
|
-
super();
|
|
153
|
-
this.unsubscribe = [];
|
|
154
|
-
this.abortController = void 0;
|
|
155
|
-
this.hasPrefetched = false;
|
|
156
|
-
this.enableEmbedded = OptionsController.state.enableEmbedded;
|
|
157
|
-
this.open = ModalController.state.open;
|
|
158
|
-
this.caipAddress = ChainController.state.activeCaipAddress;
|
|
159
|
-
this.caipNetwork = ChainController.state.activeCaipNetwork;
|
|
160
|
-
this.shake = ModalController.state.shake;
|
|
161
|
-
this.initializeTheming();
|
|
162
|
-
ApiController.prefetchAnalyticsConfig();
|
|
163
|
-
this.unsubscribe.push(...[
|
|
164
|
-
ModalController.subscribeKey("open", (val) => val ? this.onOpen() : this.onClose()),
|
|
165
|
-
ModalController.subscribeKey("shake", (val) => this.shake = val),
|
|
166
|
-
ChainController.subscribeKey("activeCaipNetwork", (val) => this.onNewNetwork(val)),
|
|
167
|
-
ChainController.subscribeKey("activeCaipAddress", (val) => this.onNewAddress(val)),
|
|
168
|
-
OptionsController.subscribeKey("enableEmbedded", (val) => this.enableEmbedded = val)
|
|
169
|
-
]);
|
|
170
|
-
}
|
|
171
|
-
firstUpdated() {
|
|
172
|
-
var _a, _b;
|
|
173
|
-
AssetUtil.fetchNetworkImage((_b = (_a = this.caipNetwork) == null ? void 0 : _a.assets) == null ? void 0 : _b.imageId);
|
|
174
|
-
if (this.caipAddress) {
|
|
175
|
-
if (this.enableEmbedded) {
|
|
176
|
-
ModalController.close();
|
|
177
|
-
this.prefetch();
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
this.onNewAddress(this.caipAddress);
|
|
181
|
-
}
|
|
182
|
-
if (this.open) {
|
|
183
|
-
this.onOpen();
|
|
184
|
-
}
|
|
185
|
-
if (this.enableEmbedded) {
|
|
186
|
-
this.prefetch();
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
disconnectedCallback() {
|
|
190
|
-
this.unsubscribe.forEach((unsubscribe) => unsubscribe());
|
|
191
|
-
this.onRemoveKeyboardListener();
|
|
192
|
-
}
|
|
193
|
-
render() {
|
|
194
|
-
this.style.cssText = `
|
|
195
|
-
--local-border-bottom-mobile-radius: ${this.enableEmbedded ? "clamp(0px, var(--wui-border-radius-l), 44px)" : "0px"};
|
|
196
|
-
`;
|
|
197
|
-
if (this.enableEmbedded) {
|
|
198
|
-
return x`${this.contentTemplate()}
|
|
199
|
-
<w3m-tooltip></w3m-tooltip> `;
|
|
200
|
-
}
|
|
201
|
-
return this.open ? x`
|
|
202
|
-
<wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
|
|
203
|
-
${this.contentTemplate()}
|
|
204
|
-
</wui-flex>
|
|
205
|
-
<w3m-tooltip></w3m-tooltip>
|
|
206
|
-
` : null;
|
|
207
|
-
}
|
|
208
|
-
contentTemplate() {
|
|
209
|
-
return x` <wui-card
|
|
210
|
-
shake="${this.shake}"
|
|
211
|
-
data-embedded="${o(this.enableEmbedded)}"
|
|
212
|
-
role="alertdialog"
|
|
213
|
-
aria-modal="true"
|
|
214
|
-
tabindex="0"
|
|
215
|
-
data-testid="w3m-modal-card"
|
|
216
|
-
>
|
|
217
|
-
<w3m-header></w3m-header>
|
|
218
|
-
<w3m-router></w3m-router>
|
|
219
|
-
<w3m-snackbar></w3m-snackbar>
|
|
220
|
-
<w3m-alertbar></w3m-alertbar>
|
|
221
|
-
</wui-card>`;
|
|
222
|
-
}
|
|
223
|
-
async onOverlayClick(event) {
|
|
224
|
-
if (event.target === event.currentTarget) {
|
|
225
|
-
await this.handleClose();
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
async handleClose() {
|
|
229
|
-
const isUnsupportedChain = RouterController.state.view === "UnsupportedChain";
|
|
230
|
-
if (isUnsupportedChain || await SIWXUtil.isSIWXCloseDisabled()) {
|
|
231
|
-
ModalController.shake();
|
|
232
|
-
} else {
|
|
233
|
-
ModalController.close();
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
initializeTheming() {
|
|
237
|
-
const { themeVariables, themeMode } = ThemeController.state;
|
|
238
|
-
const defaultThemeMode = UiHelperUtil.getColorTheme(themeMode);
|
|
239
|
-
initializeTheming(themeVariables, defaultThemeMode);
|
|
240
|
-
}
|
|
241
|
-
onClose() {
|
|
242
|
-
this.open = false;
|
|
243
|
-
this.classList.remove("open");
|
|
244
|
-
this.onScrollUnlock();
|
|
245
|
-
SnackController.hide();
|
|
246
|
-
this.onRemoveKeyboardListener();
|
|
247
|
-
}
|
|
248
|
-
onOpen() {
|
|
249
|
-
this.prefetch();
|
|
250
|
-
this.open = true;
|
|
251
|
-
this.classList.add("open");
|
|
252
|
-
this.onScrollLock();
|
|
253
|
-
this.onAddKeyboardListener();
|
|
254
|
-
}
|
|
255
|
-
onScrollLock() {
|
|
256
|
-
const styleTag = document.createElement("style");
|
|
257
|
-
styleTag.dataset["w3m"] = SCROLL_LOCK;
|
|
258
|
-
styleTag.textContent = `
|
|
259
|
-
body {
|
|
260
|
-
touch-action: none;
|
|
261
|
-
overflow: hidden;
|
|
262
|
-
overscroll-behavior: contain;
|
|
263
|
-
}
|
|
264
|
-
w3m-modal {
|
|
265
|
-
pointer-events: auto;
|
|
266
|
-
}
|
|
267
|
-
`;
|
|
268
|
-
document.head.appendChild(styleTag);
|
|
269
|
-
}
|
|
270
|
-
onScrollUnlock() {
|
|
271
|
-
const styleTag = document.head.querySelector(`style[data-w3m="${SCROLL_LOCK}"]`);
|
|
272
|
-
if (styleTag) {
|
|
273
|
-
styleTag.remove();
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
onAddKeyboardListener() {
|
|
277
|
-
var _a;
|
|
278
|
-
this.abortController = new AbortController();
|
|
279
|
-
const card = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("wui-card");
|
|
280
|
-
card == null ? void 0 : card.focus();
|
|
281
|
-
window.addEventListener("keydown", (event) => {
|
|
282
|
-
if (event.key === "Escape") {
|
|
283
|
-
this.handleClose();
|
|
284
|
-
} else if (event.key === "Tab") {
|
|
285
|
-
const { tagName } = event.target;
|
|
286
|
-
if (tagName && !tagName.includes("W3M-") && !tagName.includes("WUI-")) {
|
|
287
|
-
card == null ? void 0 : card.focus();
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}, this.abortController);
|
|
291
|
-
}
|
|
292
|
-
onRemoveKeyboardListener() {
|
|
293
|
-
var _a;
|
|
294
|
-
(_a = this.abortController) == null ? void 0 : _a.abort();
|
|
295
|
-
this.abortController = void 0;
|
|
296
|
-
}
|
|
297
|
-
async onNewAddress(caipAddress) {
|
|
298
|
-
const isSwitchingNamespace = ChainController.state.isSwitchingNamespace;
|
|
299
|
-
const nextConnected = CoreHelperUtil.getPlainAddress(caipAddress);
|
|
300
|
-
const isDisconnectedInSameNamespace = !nextConnected && !isSwitchingNamespace;
|
|
301
|
-
const isSwitchingNamespaceAndConnected = isSwitchingNamespace && nextConnected;
|
|
302
|
-
if (isDisconnectedInSameNamespace) {
|
|
303
|
-
ModalController.close();
|
|
304
|
-
} else if (isSwitchingNamespaceAndConnected) {
|
|
305
|
-
RouterController.goBack();
|
|
306
|
-
}
|
|
307
|
-
await SIWXUtil.initializeIfEnabled();
|
|
308
|
-
this.caipAddress = caipAddress;
|
|
309
|
-
ChainController.setIsSwitchingNamespace(false);
|
|
310
|
-
}
|
|
311
|
-
onNewNetwork(nextCaipNetwork) {
|
|
312
|
-
var _a, _b, _c, _d, _e;
|
|
313
|
-
AssetUtil.fetchNetworkImage((_a = nextCaipNetwork == null ? void 0 : nextCaipNetwork.assets) == null ? void 0 : _a.imageId);
|
|
314
|
-
const prevCaipNetworkId = (_c = (_b = this.caipNetwork) == null ? void 0 : _b.caipNetworkId) == null ? void 0 : _c.toString();
|
|
315
|
-
const nextNetworkId = (_d = nextCaipNetwork == null ? void 0 : nextCaipNetwork.caipNetworkId) == null ? void 0 : _d.toString();
|
|
316
|
-
const networkChanged = prevCaipNetworkId && nextNetworkId && prevCaipNetworkId !== nextNetworkId;
|
|
317
|
-
const isSwitchingNamespace = ChainController.state.isSwitchingNamespace;
|
|
318
|
-
const isUnsupportedNetwork = ((_e = this.caipNetwork) == null ? void 0 : _e.name) === ConstantsUtil.UNSUPPORTED_NETWORK_NAME;
|
|
319
|
-
const isConnectingExternal = RouterController.state.view === "ConnectingExternal";
|
|
320
|
-
const isNotConnected = !this.caipAddress;
|
|
321
|
-
const isNetworkChangedInSameNamespace = networkChanged && !isUnsupportedNetwork && !isSwitchingNamespace;
|
|
322
|
-
const isUnsupportedNetworkScreen = RouterController.state.view === "UnsupportedChain";
|
|
323
|
-
if (!isConnectingExternal && (isNotConnected || isUnsupportedNetworkScreen || isNetworkChangedInSameNamespace)) {
|
|
324
|
-
RouterController.goBack();
|
|
325
|
-
}
|
|
326
|
-
this.caipNetwork = nextCaipNetwork;
|
|
327
|
-
}
|
|
328
|
-
prefetch() {
|
|
329
|
-
if (!this.hasPrefetched) {
|
|
330
|
-
this.hasPrefetched = true;
|
|
331
|
-
ApiController.prefetch();
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
W3mModal.styles = styles;
|
|
336
|
-
__decorate([
|
|
337
|
-
n({ type: Boolean })
|
|
338
|
-
], W3mModal.prototype, "enableEmbedded", void 0);
|
|
339
|
-
__decorate([
|
|
340
|
-
r$1()
|
|
341
|
-
], W3mModal.prototype, "open", void 0);
|
|
342
|
-
__decorate([
|
|
343
|
-
r$1()
|
|
344
|
-
], W3mModal.prototype, "caipAddress", void 0);
|
|
345
|
-
__decorate([
|
|
346
|
-
r$1()
|
|
347
|
-
], W3mModal.prototype, "caipNetwork", void 0);
|
|
348
|
-
__decorate([
|
|
349
|
-
r$1()
|
|
350
|
-
], W3mModal.prototype, "shake", void 0);
|
|
351
|
-
W3mModal = __decorate([
|
|
352
|
-
customElement("w3m-modal")
|
|
353
|
-
], W3mModal);
|
|
354
|
-
export {
|
|
355
|
-
W3mModal
|
|
356
|
-
};
|