@layerswap/widget 0.1.16 → 0.1.17-beta.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.
Files changed (36) hide show
  1. package/dist/Models/Theme.d.ts +1 -1
  2. package/dist/Models/Theme.js +75 -75
  3. package/dist/components/ColorSchema.js +1 -0
  4. package/dist/components/Common/{AddressIcon.js → AddressIcon/index.js} +1 -1
  5. package/dist/components/Common/AddressIcon/jazzicon/colors.d.ts +2 -0
  6. package/dist/components/Common/AddressIcon/jazzicon/colors.js +12 -0
  7. package/dist/components/Common/AddressIcon/jazzicon/index.d.ts +2 -0
  8. package/dist/components/Common/AddressIcon/jazzicon/index.js +62 -0
  9. package/dist/components/Common/AddressIcon/jazzicon/mersenne-twister.d.ts +28 -0
  10. package/dist/components/Common/AddressIcon/jazzicon/mersenne-twister.js +201 -0
  11. package/dist/components/Common/AddressIcon/jazzicon/paper.d.ts +4 -0
  12. package/dist/components/Common/AddressIcon/jazzicon/paper.js +15 -0
  13. package/dist/components/HeaderWithMenu/index.js +1 -1
  14. package/dist/components/Input/Address/AddressNote.js +1 -1
  15. package/dist/components/Modal/leaflet.js +2 -2
  16. package/dist/components/Modal/modal.js +3 -3
  17. package/dist/components/Modal/vaulModal.js +10 -4
  18. package/dist/components/Pages/SwapPages/Form/FeeDetails/RefuelModal.js +6 -6
  19. package/dist/components/Pages/SwapPages/Form/Form.js +1 -1
  20. package/dist/components/Pages/SwapPages/Form/SecondaryComponents/FormButton.js +1 -1
  21. package/dist/components/Pages/SwapPages/Form/Select/Command/commandSelect.js +2 -2
  22. package/dist/components/Wallet/WalletModal/ConnectorsList.js +1 -1
  23. package/dist/components/Widget/Footer.js +2 -2
  24. package/dist/components/WidgetLoading.d.ts +2 -1
  25. package/dist/components/WidgetLoading.js +6 -4
  26. package/dist/components/themeWrapper.js +12 -12
  27. package/dist/context/LayerswapProvider.d.ts +3 -1
  28. package/dist/context/LayerswapProvider.js +11 -11
  29. package/dist/hooks/useWindowDimensions.d.ts +1 -0
  30. package/dist/hooks/useWindowDimensions.js +6 -2
  31. package/dist/index.css +5325 -1
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.js +1 -0
  34. package/dist/index.mjs +1 -0
  35. package/package.json +5 -4
  36. /package/dist/components/Common/{AddressIcon.d.ts → AddressIcon/index.d.ts} +0 -0
@@ -8,7 +8,7 @@ export type ThemeData = {
8
8
  secondary?: ThemeColor;
9
9
  headerLogo?: string;
10
10
  footerLogoHeight?: string;
11
- footerSticky?: boolean;
11
+ enablePortal?: boolean;
12
12
  borderRadius?: 'none' | 'small' | 'medium' | 'large' | 'extraLarge' | 'default';
13
13
  };
14
14
  export type ThemeColor = {
@@ -1,24 +1,24 @@
1
1
  export const THEME_COLORS = {
2
- "imxMarketplace": {
3
- backdrop: "0, 121, 133",
4
- actionButtonText: '0, 0, 0',
5
- buttonTextColor: '255, 255, 255',
2
+ "default": {
3
+ backdrop: "62, 18, 64",
6
4
  placeholderText: '140, 152, 192',
7
- logo: '255, 255, 255',
5
+ actionButtonText: '254, 255, 254',
6
+ buttonTextColor: '228, 229, 240',
7
+ logo: '255, 0, 147',
8
8
  borderRadius: 'small',
9
9
  primary: {
10
- DEFAULT: '46, 236, 255',
11
- '50': '230, 253, 255',
12
- '100': '209, 251, 255',
13
- '200': '168, 247, 255',
14
- '300': '128, 243, 255',
15
- '400': '87, 240, 255',
16
- '500': '46, 236, 255',
17
- '600': '0, 232, 255',
18
- '700': '0, 172, 189',
19
- '800': '0, 121, 133',
20
- '900': '0, 70, 77',
21
- 'text': '255, 255, 255',
10
+ DEFAULT: '228, 37, 117',
11
+ '50': '248, 200, 220',
12
+ '100': '246, 182, 209',
13
+ '200': '241, 146, 186',
14
+ '300': '237, 110, 163',
15
+ '400': '232, 73, 140',
16
+ '500': '228, 37, 117',
17
+ '600': '166, 51, 94',
18
+ '700': '136, 17, 67',
19
+ '800': '147, 8, 99',
20
+ '900': '110, 0, 64',
21
+ 'text': '254, 255, 254',
22
22
  'textMuted': '86, 97, 123',
23
23
  },
24
24
  secondary: {
@@ -34,47 +34,8 @@ export const THEME_COLORS = {
34
34
  '800': '15, 25, 47',
35
35
  '900': '12, 21, 39',
36
36
  '950': '11, 17, 35',
37
- 'text': '209, 251, 255',
38
- },
39
- },
40
- "ea7df14a1597407f9f755f05e25bab42": {
41
- backdrop: "0, 121, 133",
42
- placeholderText: '198, 242, 246',
43
- actionButtonText: '0, 0, 0',
44
- buttonTextColor: '255, 255, 255',
45
- logo: '255, 255, 255',
46
- borderRadius: 'small',
47
- primary: {
48
- DEFAULT: '128, 226, 235',
49
- '50': '255, 255, 255',
50
- '100': '255, 255, 255',
51
- '200': '234, 250, 252',
52
- '300': '198, 242, 246',
53
- '400': '163, 234, 241',
54
- '500': '128, 226, 235',
55
- '600': '80, 215, 227',
56
- '700': '34, 201, 217',
57
- '800': '26, 156, 168',
58
- '900': '19, 111, 120',
59
- '950': '15, 89, 96',
60
- 'text': '255, 255, 255',
61
- 'textMuted': '86, 97, 123',
37
+ 'text': '171, 181, 209',
62
38
  },
63
- secondary: {
64
- DEFAULT: '46, 89, 112',
65
- '50': '193, 217, 230',
66
- '100': '179, 208, 224',
67
- '200': '150, 191, 212',
68
- '300': '121, 173, 200',
69
- '400': '92, 155, 188',
70
- '500': '34, 66, 83',
71
- '600': '16, 35, 49',
72
- '700': '15, 29, 39',
73
- '800': '34, 66, 83',
74
- '900': '22, 43, 54',
75
- '950': '14, 27, 34',
76
- 'text': '209, 251, 255',
77
- }
78
39
  },
79
40
  "light": {
80
41
  placeholderText: '134, 134, 134',
@@ -113,26 +74,26 @@ export const THEME_COLORS = {
113
74
  'text': '108, 108, 108',
114
75
  },
115
76
  },
116
- "default": {
117
- backdrop: "62, 18, 64",
77
+ "imxMarketplace": {
78
+ backdrop: "0, 121, 133",
79
+ actionButtonText: '0, 0, 0',
80
+ buttonTextColor: '255, 255, 255',
118
81
  placeholderText: '140, 152, 192',
119
- actionButtonText: '254, 255, 254',
120
- buttonTextColor: '228, 229, 240',
121
- logo: '255, 0, 147',
82
+ logo: '255, 255, 255',
122
83
  borderRadius: 'small',
123
84
  primary: {
124
- DEFAULT: '228, 37, 117',
125
- '50': '248, 200, 220',
126
- '100': '246, 182, 209',
127
- '200': '241, 146, 186',
128
- '300': '237, 110, 163',
129
- '400': '232, 73, 140',
130
- '500': '228, 37, 117',
131
- '600': '166, 51, 94',
132
- '700': '136, 17, 67',
133
- '800': '147, 8, 99',
134
- '900': '110, 0, 64',
135
- 'text': '254, 255, 254',
85
+ DEFAULT: '46, 236, 255',
86
+ '50': '230, 253, 255',
87
+ '100': '209, 251, 255',
88
+ '200': '168, 247, 255',
89
+ '300': '128, 243, 255',
90
+ '400': '87, 240, 255',
91
+ '500': '46, 236, 255',
92
+ '600': '0, 232, 255',
93
+ '700': '0, 172, 189',
94
+ '800': '0, 121, 133',
95
+ '900': '0, 70, 77',
96
+ 'text': '255, 255, 255',
136
97
  'textMuted': '86, 97, 123',
137
98
  },
138
99
  secondary: {
@@ -148,9 +109,48 @@ export const THEME_COLORS = {
148
109
  '800': '15, 25, 47',
149
110
  '900': '12, 21, 39',
150
111
  '950': '11, 17, 35',
151
- 'text': '171, 181, 209',
112
+ 'text': '209, 251, 255',
152
113
  },
153
114
  },
115
+ "ea7df14a1597407f9f755f05e25bab42": {
116
+ backdrop: "0, 121, 133",
117
+ placeholderText: '198, 242, 246',
118
+ actionButtonText: '0, 0, 0',
119
+ buttonTextColor: '255, 255, 255',
120
+ logo: '255, 255, 255',
121
+ borderRadius: 'small',
122
+ primary: {
123
+ DEFAULT: '128, 226, 235',
124
+ '50': '255, 255, 255',
125
+ '100': '255, 255, 255',
126
+ '200': '234, 250, 252',
127
+ '300': '198, 242, 246',
128
+ '400': '163, 234, 241',
129
+ '500': '128, 226, 235',
130
+ '600': '80, 215, 227',
131
+ '700': '34, 201, 217',
132
+ '800': '26, 156, 168',
133
+ '900': '19, 111, 120',
134
+ '950': '15, 89, 96',
135
+ 'text': '255, 255, 255',
136
+ 'textMuted': '86, 97, 123',
137
+ },
138
+ secondary: {
139
+ DEFAULT: '46, 89, 112',
140
+ '50': '193, 217, 230',
141
+ '100': '179, 208, 224',
142
+ '200': '150, 191, 212',
143
+ '300': '121, 173, 200',
144
+ '400': '92, 155, 188',
145
+ '500': '34, 66, 83',
146
+ '600': '16, 35, 49',
147
+ '700': '15, 29, 39',
148
+ '800': '34, 66, 83',
149
+ '900': '22, 43, 54',
150
+ '950': '14, 27, 34',
151
+ 'text': '209, 251, 255',
152
+ }
153
+ },
154
154
  "evmos": {
155
155
  placeholderText: '128, 110, 107',
156
156
  actionButtonText: '254, 255, 254',
@@ -39,6 +39,7 @@ const ColorSchema = ({ themeData }) => {
39
39
  --ls-border-radius-md: ${adjustBorderRadius('medium', borderRadius)};
40
40
  --ls-border-radius-lg: ${adjustBorderRadius('large', borderRadius)};
41
41
  --ls-border-radius-xl: ${adjustBorderRadius('extraLarge', borderRadius)};
42
+ --ls-border-radius-full: 9999px;
42
43
  --ls-border-radius-default: ${adjustBorderRadius('small', borderRadius)};
43
44
 
44
45
  --ls-colors-backdrop: ${backdrop};
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import Jazzicon from "@metamask/jazzicon";
3
+ import Jazzicon from "./jazzicon";
4
4
  import { useEffect, useRef } from "react";
5
5
  const AddressIcon = ({ address, size, className }) => {
6
6
  const ref = useRef(null);
@@ -0,0 +1,2 @@
1
+ declare const _exports: string[];
2
+ export = _exports;
@@ -0,0 +1,12 @@
1
+ module.exports = [
2
+ '#01888C', // teal
3
+ '#FC7500', // bright orange
4
+ '#034F5D', // dark teal
5
+ '#F73F01', // orangered
6
+ '#FC1960', // magenta
7
+ '#C7144C', // raspberry
8
+ '#F3C100', // goldenrod
9
+ '#1598F2', // lightning blue
10
+ '#2465E1', // sail blue
11
+ '#F19E02', // gold
12
+ ];
@@ -0,0 +1,2 @@
1
+ export = generateIdenticon;
2
+ declare function generateIdenticon(diameter: any, seed: any): HTMLDivElement;
@@ -0,0 +1,62 @@
1
+ var MersenneTwister = require('./mersenne-twister');
2
+ var paperGen = require('./paper');
3
+ var Color = require('color');
4
+ var colors = require('./colors');
5
+ var shapeCount = 4;
6
+ var svgns = 'http://www.w3.org/2000/svg';
7
+ module.exports = generateIdenticon;
8
+ var generator;
9
+ function generateIdenticon(diameter, seed) {
10
+ generator = new MersenneTwister(seed);
11
+ var remainingColors = hueShift(colors.slice(), generator);
12
+ var elements = paperGen(diameter, genColor(remainingColors));
13
+ var container = elements.container;
14
+ var svg = document.createElementNS(svgns, 'svg');
15
+ svg.setAttributeNS(null, 'x', '0');
16
+ svg.setAttributeNS(null, 'y', '0');
17
+ svg.setAttributeNS(null, 'width', diameter);
18
+ svg.setAttributeNS(null, 'height', diameter);
19
+ container.appendChild(svg);
20
+ for (var i = 0; i < shapeCount - 1; i++) {
21
+ genShape(remainingColors, diameter, i, shapeCount - 1, svg);
22
+ }
23
+ return container;
24
+ }
25
+ function genShape(remainingColors, diameter, i, total, svg) {
26
+ var center = diameter / 2;
27
+ var shape = document.createElementNS(svgns, 'rect');
28
+ shape.setAttributeNS(null, 'x', '0');
29
+ shape.setAttributeNS(null, 'y', '0');
30
+ shape.setAttributeNS(null, 'width', diameter);
31
+ shape.setAttributeNS(null, 'height', diameter);
32
+ var firstRot = generator.random();
33
+ var angle = Math.PI * 2 * firstRot;
34
+ var velocity = diameter / total * generator.random() + (i * diameter / total);
35
+ var tx = (Math.cos(angle) * velocity);
36
+ var ty = (Math.sin(angle) * velocity);
37
+ var translate = 'translate(' + tx + ' ' + ty + ')';
38
+ // Third random is a shape rotation on top of all of that.
39
+ var secondRot = generator.random();
40
+ var rot = (firstRot * 360) + secondRot * 180;
41
+ var rotate = 'rotate(' + rot.toFixed(1) + ' ' + center + ' ' + center + ')';
42
+ var transform = translate + ' ' + rotate;
43
+ shape.setAttributeNS(null, 'transform', transform);
44
+ var fill = genColor(remainingColors);
45
+ shape.setAttributeNS(null, 'fill', fill);
46
+ svg.appendChild(shape);
47
+ }
48
+ function genColor(colors) {
49
+ var rand = generator.random();
50
+ var idx = Math.floor(colors.length * generator.random());
51
+ var color = colors.splice(idx, 1)[0];
52
+ return color;
53
+ }
54
+ var wobble = 30;
55
+ function hueShift(colors, generator) {
56
+ var amount = (generator.random() * 30) - (wobble / 2);
57
+ return colors.map(function (hex) {
58
+ var color = Color(hex);
59
+ color.rotate(amount);
60
+ return color.hex();
61
+ });
62
+ }
@@ -0,0 +1,28 @@
1
+ export = MersenneTwister;
2
+ /**
3
+ * @constructor
4
+ * @param {number|Array<number>} [seed] - Optional seed for the random number generator
5
+ */
6
+ declare function MersenneTwister(seed?: number | Array<number>): void;
7
+ declare class MersenneTwister {
8
+ /**
9
+ * @constructor
10
+ * @param {number|Array<number>} [seed] - Optional seed for the random number generator
11
+ */
12
+ constructor(seed?: number | Array<number>);
13
+ N: number;
14
+ M: number;
15
+ MATRIX_A: number;
16
+ UPPER_MASK: number;
17
+ LOWER_MASK: number;
18
+ mt: any[];
19
+ mti: number;
20
+ init_seed(s: any): void;
21
+ init_by_array(init_key: any, key_length: any): void;
22
+ random_int(): number;
23
+ random_int31(): number;
24
+ random_incl(): number;
25
+ random(): number;
26
+ random_excl(): number;
27
+ random_long(): number;
28
+ }
@@ -0,0 +1,201 @@
1
+ /*
2
+ https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
3
+ so it's better encapsulated. Now you can have multiple random number generators
4
+ and they won't stomp all over eachother's state.
5
+
6
+ If you want to use this as a substitute for Math.random(), use the random()
7
+ method like so:
8
+
9
+ var m = new MersenneTwister();
10
+ var randomNumber = m.random();
11
+
12
+ You can also call the other genrand_{foo}() methods on the instance.
13
+
14
+ If you want to use a specific seed in order to get a repeatable random
15
+ sequence, pass an integer into the constructor:
16
+
17
+ var m = new MersenneTwister(123);
18
+
19
+ and that will always produce the same random sequence.
20
+
21
+ Sean McCullough (banksean@gmail.com)
22
+ */
23
+ /*
24
+ A C-program for MT19937, with initialization improved 2002/1/26.
25
+ Coded by Takuji Nishimura and Makoto Matsumoto.
26
+
27
+ Before using, initialize the state by using init_seed(seed)
28
+ or init_by_array(init_key, key_length).
29
+
30
+ Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
31
+ All rights reserved.
32
+
33
+ Redistribution and use in source and binary forms, with or without
34
+ modification, are permitted provided that the following conditions
35
+ are met:
36
+
37
+ 1. Redistributions of source code must retain the above copyright
38
+ notice, this list of conditions and the following disclaimer.
39
+
40
+ 2. Redistributions in binary form must reproduce the above copyright
41
+ notice, this list of conditions and the following disclaimer in the
42
+ documentation and/or other materials provided with the distribution.
43
+
44
+ 3. The names of its contributors may not be used to endorse or promote
45
+ products derived from this software without specific prior written
46
+ permission.
47
+
48
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
49
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
50
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
51
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
52
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
53
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
54
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
55
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
56
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
57
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
58
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59
+
60
+
61
+ Any feedback is very welcome.
62
+ http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
63
+ email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
64
+ */
65
+ /**
66
+ * @constructor
67
+ * @param {number|Array<number>} [seed] - Optional seed for the random number generator
68
+ */
69
+ function MersenneTwister(seed) {
70
+ if (seed == undefined) {
71
+ seed = new Date().getTime();
72
+ }
73
+ /* Period parameters */
74
+ this.N = 624;
75
+ this.M = 397;
76
+ this.MATRIX_A = 0x9908b0df; /* constant vector a */
77
+ this.UPPER_MASK = 0x80000000; /* most significant w-r bits */
78
+ this.LOWER_MASK = 0x7fffffff; /* least significant r bits */
79
+ this.mt = new Array(this.N); /* the array for the state vector */
80
+ this.mti = this.N + 1; /* mti==N+1 means mt[N] is not initialized */
81
+ if (seed.constructor == Array) {
82
+ this.init_by_array(seed, seed.length);
83
+ }
84
+ else {
85
+ this.init_seed(seed);
86
+ }
87
+ }
88
+ /* initializes mt[N] with a seed */
89
+ /* origin name init_genrand */
90
+ MersenneTwister.prototype.init_seed = function (s) {
91
+ this.mt[0] = s >>> 0;
92
+ for (this.mti = 1; this.mti < this.N; this.mti++) {
93
+ var s = this.mt[this.mti - 1] ^ (this.mt[this.mti - 1] >>> 30);
94
+ this.mt[this.mti] = (((((s & 0xffff0000) >>> 16) * 1812433253) << 16) + (s & 0x0000ffff) * 1812433253)
95
+ + this.mti;
96
+ /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
97
+ /* In the previous versions, MSBs of the seed affect */
98
+ /* only MSBs of the array mt[]. */
99
+ /* 2002/01/09 modified by Makoto Matsumoto */
100
+ this.mt[this.mti] >>>= 0;
101
+ /* for >32 bit machines */
102
+ }
103
+ };
104
+ /* initialize by an array with array-length */
105
+ /* init_key is the array for initializing keys */
106
+ /* key_length is its length */
107
+ /* slight change for C++, 2004/2/26 */
108
+ MersenneTwister.prototype.init_by_array = function (init_key, key_length) {
109
+ var i, j, k;
110
+ this.init_seed(19650218);
111
+ i = 1;
112
+ j = 0;
113
+ k = (this.N > key_length ? this.N : key_length);
114
+ for (; k; k--) {
115
+ var s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);
116
+ this.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1664525) << 16) + ((s & 0x0000ffff) * 1664525)))
117
+ + init_key[j] + j; /* non linear */
118
+ this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */
119
+ i++;
120
+ j++;
121
+ if (i >= this.N) {
122
+ this.mt[0] = this.mt[this.N - 1];
123
+ i = 1;
124
+ }
125
+ if (j >= key_length)
126
+ j = 0;
127
+ }
128
+ for (k = this.N - 1; k; k--) {
129
+ var s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);
130
+ this.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) + (s & 0x0000ffff) * 1566083941))
131
+ - i; /* non linear */
132
+ this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */
133
+ i++;
134
+ if (i >= this.N) {
135
+ this.mt[0] = this.mt[this.N - 1];
136
+ i = 1;
137
+ }
138
+ }
139
+ this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */
140
+ };
141
+ /* generates a random number on [0,0xffffffff]-interval */
142
+ /* origin name genrand_int32 */
143
+ MersenneTwister.prototype.random_int = function () {
144
+ var y;
145
+ var mag01 = new Array(0x0, this.MATRIX_A);
146
+ /* mag01[x] = x * MATRIX_A for x=0,1 */
147
+ if (this.mti >= this.N) { /* generate N words at one time */
148
+ var kk;
149
+ if (this.mti == this.N + 1) /* if init_seed() has not been called, */
150
+ this.init_seed(5489); /* a default initial seed is used */
151
+ for (kk = 0; kk < this.N - this.M; kk++) {
152
+ y = (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);
153
+ this.mt[kk] = this.mt[kk + this.M] ^ (y >>> 1) ^ mag01[y & 0x1];
154
+ }
155
+ for (; kk < this.N - 1; kk++) {
156
+ y = (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);
157
+ this.mt[kk] = this.mt[kk + (this.M - this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];
158
+ }
159
+ y = (this.mt[this.N - 1] & this.UPPER_MASK) | (this.mt[0] & this.LOWER_MASK);
160
+ this.mt[this.N - 1] = this.mt[this.M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];
161
+ this.mti = 0;
162
+ }
163
+ y = this.mt[this.mti++];
164
+ /* Tempering */
165
+ y ^= (y >>> 11);
166
+ y ^= (y << 7) & 0x9d2c5680;
167
+ y ^= (y << 15) & 0xefc60000;
168
+ y ^= (y >>> 18);
169
+ return y >>> 0;
170
+ };
171
+ /* generates a random number on [0,0x7fffffff]-interval */
172
+ /* origin name genrand_int31 */
173
+ MersenneTwister.prototype.random_int31 = function () {
174
+ return (this.random_int() >>> 1);
175
+ };
176
+ /* generates a random number on [0,1]-real-interval */
177
+ /* origin name genrand_real1 */
178
+ MersenneTwister.prototype.random_incl = function () {
179
+ return this.random_int() * (1.0 / 4294967295.0);
180
+ /* divided by 2^32-1 */
181
+ };
182
+ /* generates a random number on [0,1)-real-interval */
183
+ MersenneTwister.prototype.random = function () {
184
+ return this.random_int() * (1.0 / 4294967296.0);
185
+ /* divided by 2^32 */
186
+ };
187
+ /* generates a random number on (0,1)-real-interval */
188
+ /* origin name genrand_real3 */
189
+ MersenneTwister.prototype.random_excl = function () {
190
+ return (this.random_int() + 0.5) * (1.0 / 4294967296.0);
191
+ /* divided by 2^32 */
192
+ };
193
+ /* generates a random number on [0,1) with 53-bit resolution*/
194
+ /* origin name genrand_res53 */
195
+ MersenneTwister.prototype.random_long = function () {
196
+ var a = this.random_int() >>> 5, b = this.random_int() >>> 6;
197
+ return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);
198
+ };
199
+ /** @type {typeof MersenneTwister} */
200
+ /* These real versions are due to Isaku Wada, 2002/01/09 added */
201
+ module.exports = MersenneTwister;
@@ -0,0 +1,4 @@
1
+ export = newPaper;
2
+ declare function newPaper(diameter: any, color: any): {
3
+ container: HTMLDivElement;
4
+ };
@@ -0,0 +1,15 @@
1
+ function newPaper(diameter, color) {
2
+ var container = document.createElement('div');
3
+ container.style.borderRadius = '50px';
4
+ container.style.overflow = 'hidden';
5
+ container.style.padding = '0px';
6
+ container.style.margin = '0px';
7
+ container.style.width = '' + diameter + 'px';
8
+ container.style.height = '' + diameter + 'px';
9
+ container.style.display = 'inline-block';
10
+ container.style.background = color;
11
+ return {
12
+ container: container,
13
+ };
14
+ }
15
+ module.exports = newPaper;
@@ -13,7 +13,7 @@ function HeaderWithMenu({ goBack }) {
13
13
  const { boot, show, update } = useIntercom();
14
14
  const updateWithProps = () => update({ userId, customAttributes: { email: email, } });
15
15
  const query = useQueryState();
16
- return (_jsxs("div", { className: "w-full grid grid-cols-5 px-6 mt-3 pb-2", children: [goBack &&
16
+ return (_jsxs("div", { className: "w-full grid grid-cols-5 px-6 pt-3 pb-2", children: [goBack &&
17
17
  _jsx(IconButton, { onClick: goBack, "aria-label": "Go back", className: "-ml-2", icon: _jsx(ArrowLeft, { strokeWidth: "2" }) }), _jsx("div", { className: "col-start-5 justify-self-end self-center flex items-center gap-x-1 -mr-2", children: _jsx("div", { className: "fixed-width-container", children: _jsx(LayerswapMenu, {}) }) })] }));
18
18
  }
19
19
  export default HeaderWithMenu;
@@ -5,7 +5,7 @@ import AddressIcon from "../../Common/AddressIcon";
5
5
  const AddressNote = ({ partner, values }) => {
6
6
  const { to: destination, destination_address } = values;
7
7
  return (destination && destination_address ?
8
- _jsxs("div", { className: "flex flex-col items-center gap-6 mt-2", children: [_jsx("div", { className: "h-24 w-24 rounded-2xl overflow-hidden", children: _jsx(AddressIcon, { className: "scale-150 h-24 w-24 blur-[1.5px]", address: destination_address, size: 96 }) }), _jsxs("div", { className: "text-center max-w-xs space-y-1", children: [_jsx("p", { className: "text-2xl", children: "Address Confirmation" }), _jsxs("p", { className: "text-secondary-text", children: [_jsx("span", { children: "Destination address was autofilled from URL" }), " ", partner && _jsxs(_Fragment, { children: [_jsx("span", { children: "by" }), " ", _jsxs("span", { children: [partner.display_name, "."] })] }), " ", _jsx("span", { children: "Please double-check its correctness." })] })] }), _jsxs("div", { className: "w-full rounded-lg bg-secondary-700 overflow-hidden px-4 py-3 space-y-2", children: [_jsx("div", { className: "gap-4 flex relative items-center outline-none w-full text-primary-text", children: _jsxs("div", { className: "flex items-center justify-between w-full", children: [_jsxs("div", { className: "text-secondary-text", children: [_jsx("span", { children: destination?.display_name }), " ", _jsx("span", { children: "address" })] }), _jsxs("div", { className: "flex items-center gap-4 text-secondary-text", children: [_jsx(CopyButton, { toCopy: destination_address }), _jsx("a", { href: destination?.account_explorer_template?.replace('{0}', destination_address) || '', target: "_blank", children: _jsx(ExternalLink, { className: "h-4 w-4" }) })] })] }) }), _jsxs("div", { className: 'flex gap-3 text-sm items-center', children: [_jsx("div", { className: 'flex flex-shrink-0 bg-secondary-400 text-primary-text items-center justify-center rounded-md h-9 overflow-hidden w-9', children: _jsx(AddressIcon, { className: "scale-150 h-9 w-9", address: destination_address, size: 36 }) }), _jsx("p", { className: "break-all text-sm", children: destination_address })] })] })] })
8
+ _jsxs("div", { className: "flex flex-col items-center gap-6 mt-2", children: [_jsx("div", { className: "h-24 w-24 rounded-xl overflow-hidden", children: _jsx(AddressIcon, { className: "scale-150 h-24 w-24 blur-[1.5px]", address: destination_address, size: 96 }) }), _jsxs("div", { className: "text-center max-w-xs space-y-1", children: [_jsx("p", { className: "text-2xl", children: "Address Confirmation" }), _jsxs("p", { className: "text-secondary-text", children: [_jsx("span", { children: "Destination address was autofilled from URL" }), " ", partner && _jsxs(_Fragment, { children: [_jsx("span", { children: "by" }), " ", _jsxs("span", { children: [partner.display_name, "."] })] }), " ", _jsx("span", { children: "Please double-check its correctness." })] })] }), _jsxs("div", { className: "w-full rounded-lg bg-secondary-700 overflow-hidden px-4 py-3 space-y-2", children: [_jsx("div", { className: "gap-4 flex relative items-center outline-none w-full text-primary-text", children: _jsxs("div", { className: "flex items-center justify-between w-full", children: [_jsxs("div", { className: "text-secondary-text", children: [_jsx("span", { children: destination?.display_name }), " ", _jsx("span", { children: "address" })] }), _jsxs("div", { className: "flex items-center gap-4 text-secondary-text", children: [_jsx(CopyButton, { toCopy: destination_address }), _jsx("a", { href: destination?.account_explorer_template?.replace('{0}', destination_address) || '', target: "_blank", children: _jsx(ExternalLink, { className: "h-4 w-4" }) })] })] }) }), _jsxs("div", { className: 'flex gap-3 text-sm items-center', children: [_jsx("div", { className: 'flex flex-shrink-0 bg-secondary-400 text-primary-text items-center justify-center rounded-md h-9 overflow-hidden w-9', children: _jsx(AddressIcon, { className: "scale-150 h-9 w-9", address: destination_address, size: 36 }) }), _jsx("p", { className: "break-all text-sm", children: destination_address })] })] })] })
9
9
  : null);
10
10
  };
11
11
  export default AddressNote;
@@ -10,7 +10,7 @@ export const Leaflet = forwardRef(function Leaflet({ show, setShow, children, ti
10
10
  const mobileModalRef = useRef(null);
11
11
  const controls = useAnimation();
12
12
  const transitionProps = { type: "spring", stiffness: 500, damping: 40 };
13
- const { isMobile } = useWindowDimensions();
13
+ const { isMobileWithPortal: isMobile } = useWindowDimensions();
14
14
  const handleDragEnd = useCallback(async (_, info) => {
15
15
  const offset = info.offset.y;
16
16
  const velocity = info.velocity.y;
@@ -60,5 +60,5 @@ export const Leaflet = forwardRef(function Leaflet({ show, setShow, children, ti
60
60
  default:
61
61
  wrapperHeightClass = '';
62
62
  }
63
- return (_jsxs("div", { ref: topmostRef, children: [_jsx(motion.div, { className: `${position} inset-0 z-40 bg-black/50 block`, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: handleCloseModal }, "backdrop"), _jsx(motion.div, { ref: mobileModalRef, animate: controls, className: `max-h-full overflow-y-hidden group ${position} inset-x-0 bottom-0 z-40 w-full ${height != 'full' ? 'rounded-t-2xl' : ''} bg-secondary-900 ${wrapperHeightClass} ${className} shadow-lg`, initial: { y: "20%" }, exit: { y: "100%" }, transition: transitionProps, drag: height != 'full' ? "y" : false, dragDirectionLock: true, onDragEnd: handleDragEnd, dragElastic: { top: 0, bottom: 1 }, dragConstraints: { top: 0, bottom: 0 }, children: _jsxs("div", { className: `py-3 overflow-y-auto flex flex-col h-full z-40 ${height != 'full' ? 'bg-secondary-900 rounded-t-2xl ' : ''} pb-6`, children: [_jsxs("div", { className: `px-6 pb-2 flex justify-between items-center ${height != 'full' && 'hover:cursor-grab'}`, children: [_jsx("div", { className: "text-lg text-secondary-text font-semibold", children: _jsx("div", { children: title }) }), _jsx("div", { className: '-mr-2', children: _jsx(IconButton, { onClick: handleCloseModal, icon: _jsx(X, { strokeWidth: 3 }) }) })] }), _jsx("div", { className: 'select-text max-h-full overflow-y-auto overflow-x-hidden styled-scroll px-6 h-full', id: "virtualListContainer", children: children })] }) }, "mobile-modal")] }));
63
+ return (_jsxs("div", { ref: topmostRef, children: [_jsx(motion.div, { className: `${position} inset-0 z-40 bg-black/50 block`, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: handleCloseModal }, "backdrop"), _jsx(motion.div, { ref: mobileModalRef, animate: controls, className: `max-h-full overflow-y-hidden group ${position} inset-x-0 bottom-0 z-40 w-full ${height != 'full' ? 'rounded-t-xl' : ''} bg-secondary-900 ${wrapperHeightClass} ${className} shadow-lg`, initial: { y: "20%" }, exit: { y: "100%" }, transition: transitionProps, drag: height != 'full' ? "y" : false, dragDirectionLock: true, onDragEnd: handleDragEnd, dragElastic: { top: 0, bottom: 1 }, dragConstraints: { top: 0, bottom: 0 }, children: _jsxs("div", { className: `py-3 overflow-y-auto flex flex-col h-full z-40 ${height != 'full' ? 'bg-secondary-900 rounded-t-xl ' : ''} pb-6`, children: [_jsxs("div", { className: `px-6 pb-2 flex justify-between items-center ${height != 'full' && 'hover:cursor-grab'}`, children: [_jsx("div", { className: "text-lg text-secondary-text font-semibold", children: _jsx("div", { children: title }) }), _jsx("div", { className: '-mr-2', children: _jsx(IconButton, { onClick: handleCloseModal, icon: _jsx(X, { strokeWidth: 3 }) }) })] }), _jsx("div", { className: 'select-text max-h-full overflow-y-auto overflow-x-hidden styled-scroll px-6 h-full', id: "virtualListContainer", children: children })] }) }, "mobile-modal")] }));
64
64
  });
@@ -5,15 +5,15 @@ import useWindowDimensions from "../../hooks/useWindowDimensions";
5
5
  import { Leaflet } from "./leaflet";
6
6
  import ReactPortal from "../Common/ReactPortal";
7
7
  const Modal = (({ header, height, className, children, subHeader, show, setShow, modalId, onClose }) => {
8
- const { isMobile, isDesktop } = useWindowDimensions();
8
+ const { isMobileWithPortal, isDesktop } = useWindowDimensions();
9
9
  const mobileModalRef = useRef(null);
10
10
  //Fixes draggebles closing
11
11
  const [delayedShow, setDelayedShow] = useState();
12
12
  useEffect(() => {
13
13
  setDelayedShow(show);
14
14
  }, [show]);
15
- return (_jsxs(_Fragment, { children: [isDesktop && (_jsx(ReactPortal, { wrapperId: "widget_root", children: _jsx(AnimatePresence, { children: delayedShow &&
16
- _jsx(Leaflet, { position: "absolute", height: height ?? 'full', show: delayedShow, setShow: setShow, title: header, description: subHeader, className: className, onClose: onClose, children: children }, modalId) }) })), isMobile && (_jsx(AnimatePresence, { children: delayedShow &&
15
+ return (_jsxs(_Fragment, { children: [(isDesktop || (!isDesktop && !isMobileWithPortal)) && (_jsx(ReactPortal, { wrapperId: "widget_root", children: _jsx(AnimatePresence, { children: delayedShow &&
16
+ _jsx(Leaflet, { position: "absolute", height: height ?? 'full', show: delayedShow, setShow: setShow, title: header, description: subHeader, className: className, onClose: onClose, children: children }, modalId) }) })), isMobileWithPortal && (_jsx(AnimatePresence, { children: delayedShow &&
17
17
  _jsx(Leaflet, { position: "fixed", height: height == 'full' ? '80%' : height == 'fit' ? 'fit' : (height == '80%' || height == '90%') ? height : 'full', ref: mobileModalRef, show: delayedShow, setShow: setShow, title: header, description: subHeader, className: className, onClose: onClose, children: children }, modalId) }))] }));
18
18
  });
19
19
  export default Modal;