@onekeyfe/inpage-providers-hub 2.2.1 → 2.2.3

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.
@@ -18,12 +18,12 @@ const images_1 = require("./images");
18
18
  let isInjected = false;
19
19
  let i18n = {};
20
20
  const logoStyle = {
21
- width: '28px',
22
- height: '28px',
21
+ width: '24px',
22
+ height: '24px',
23
23
  };
24
24
  const textStyle = {
25
25
  color: 'rgba(0, 0, 0, 0.61)',
26
- fontSize: '13px',
26
+ fontSize: '14px',
27
27
  marginLeft: '8px',
28
28
  };
29
29
  const containerId = 'onekey-floating-widget';
@@ -35,8 +35,7 @@ const removeIcon = () => {
35
35
  const useOutsideClick = (ref, callback) => {
36
36
  (0, hooks_1.useEffect)(() => {
37
37
  const handleClickOutside = (event) => {
38
- if (ref.current &&
39
- !ref.current.contains(event.target)) {
38
+ if (ref.current && !ref.current.contains(event.target)) {
40
39
  callback();
41
40
  }
42
41
  };
@@ -63,41 +62,43 @@ function CloseDialog({ onClose }) {
63
62
  removeIcon();
64
63
  }, []);
65
64
  return ((0, jsx_runtime_1.jsxs)("div", { style: {
66
- background: 'rgba(255, 255, 255, 1)',
67
- padding: '14px',
65
+ display: 'flex',
66
+ flexDirection: 'column',
67
+ gap: '8px',
68
+ padding: '12px',
68
69
  position: 'absolute',
69
- right: '134px',
70
- border: '1px rgba(0, 0, 0, 0.13) solid',
71
- top: '60px',
72
- width: '170px',
73
- borderRadius: '15px',
74
- }, ref: dialogRef, children: [(0, jsx_runtime_1.jsx)("div", { style: {
75
- color: 'rgba(0, 0, 0, 1)',
76
- fontSize: '12px',
77
- fontWeight: '400',
70
+ right: '100%',
71
+ background: '#fff',
72
+ top: '40px',
73
+ width: '196px',
74
+ borderRadius: '12px',
75
+ boxShadow: '0px 0px 0px 1px rgba(0, 0, 0, 0.05),0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',
76
+ color: 'rgba(0, 0, 0, 1)',
77
+ fontSize: '12px',
78
+ lineHeight: '16px',
79
+ }, ref: dialogRef, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
80
+ display: 'flex',
81
+ alignItems: 'center',
78
82
  cursor: 'pointer',
79
- }, onClick: handleHideOnSite, children: i18n.hideOnThisSite }), (0, jsx_runtime_1.jsx)("div", { style: {
80
- marginTop: '4px',
81
- marginBottom: '8px',
82
- color: 'rgba(0, 0, 0, 1)',
83
- fontSize: '12px',
84
- fontWeight: '400',
83
+ gap: '8px',
84
+ }, onClick: handleHideOnSite, children: [(0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M2.29312 2.2929C2.68364 1.90237 3.31681 1.90237 3.70734 2.29289L7.35069 5.9362L21.7073 20.2929C22.0979 20.6834 22.0979 21.3166 21.7073 21.7071C21.3168 22.0976 20.6836 22.0976 20.2931 21.7071L17.2031 18.617C14.684 20.0216 11.8704 20.363 9.19337 19.6107C6.27083 18.7893 3.59188 16.6894 1.6441 13.4178C1.12514 12.5461 1.12292 11.4579 1.64298 10.5841C2.63083 8.92441 3.8063 7.56606 5.10844 6.52239L2.29313 3.70711C1.9026 3.31659 1.9026 2.68342 2.29312 2.2929ZM6.53283 7.94678L7.41812 8.8321L8.5542 9.96818C8.20253 10.5636 8.00023 11.2586 8.00023 12C8.00023 14.2091 9.79109 16 12.0002 16C12.7416 16 13.4366 15.7977 14.0321 15.446L15.7203 17.1343C13.7862 18.0642 11.7083 18.24 9.73447 17.6852C7.37839 17.0231 5.08952 15.2953 3.36259 12.3947C3.21773 12.1514 3.21796 11.8483 3.36159 11.607C4.28389 10.0575 5.36713 8.84257 6.53283 7.94678ZM12.5184 13.9324L10.0678 11.4818C10.0237 11.647 10.0002 11.8207 10.0002 12C10.0002 13.1046 10.8957 14 12.0002 14C12.1796 14 12.3532 13.9765 12.5184 13.9324ZM20.6388 11.6068C18.1001 7.34166 14.3527 5.6013 10.8782 6.07652C10.331 6.15137 9.82679 5.76845 9.75195 5.22126C9.67711 4.67407 10.06 4.16981 10.6072 4.09497C15.0162 3.49193 19.4849 5.75792 22.3574 10.5838C22.8767 11.4564 22.8771 12.5429 22.3576 13.4157C21.9613 14.0815 21.535 14.6987 21.0823 15.2666C20.738 15.6985 20.1088 15.7695 19.677 15.4253C19.2451 15.081 19.1741 14.4519 19.5183 14.02C19.9123 13.5257 20.2873 12.9836 20.6389 12.3928C20.7831 12.1507 20.7831 11.8493 20.6388 11.6068Z", fill: "rgba(0, 0, 0, 0.61)" }) }), (0, jsx_runtime_1.jsx)("div", { children: i18n.hideOnThisSite })] }), (0, jsx_runtime_1.jsxs)("div", { style: {
85
+ display: 'flex',
86
+ alignItems: 'center',
85
87
  cursor: 'pointer',
86
- }, onClick: handleDisable, children: i18n.disable }), (0, jsx_runtime_1.jsx)("div", { style: {
87
- color: 'rgb(156, 156, 156)',
88
- fontSize: '10px',
89
- fontWeight: '400',
90
- }, children: i18n.canBeReEnabledInSettings })] }));
88
+ gap: '8px',
89
+ }, onClick: handleDisable, children: [(0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M12 4C7.58172 4 4 7.58172 4 12C4 13.8491 4.62644 15.5506 5.68009 16.9057L16.9057 5.68009C15.5506 4.62644 13.8491 4 12 4ZM18.3199 7.0943L7.0943 18.3199C8.44939 19.3736 10.1509 20 12 20C16.4183 20 20 16.4183 20 12C20 10.1509 19.3736 8.44939 18.3199 7.0943ZM2 12C2 6.47715 6.47715 2 12 2C14.7611 2 17.2625 3.12038 19.0711 4.92893C20.8796 6.73748 22 9.23885 22 12C22 17.5228 17.5228 22 12 22C9.23885 22 6.73748 20.8796 4.92893 19.0711C3.12038 17.2625 2 14.7611 2 12Z", fill: "rgba(0, 0, 0, 0.61)" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { children: i18n.disable }), (0, jsx_runtime_1.jsx)("div", { style: {
90
+ color: 'rgba(0, 0, 0, 0.61)',
91
+ fontSize: '12px',
92
+ lineHeight: '16px',
93
+ }, children: i18n.canBeReEnabledInSettings })] })] })] }));
91
94
  }
92
95
  function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCloseDialog, }) {
93
96
  const [showCloseButton, setIsShowCloseButton] = (0, hooks_1.useState)(false);
94
97
  return ((0, jsx_runtime_1.jsxs)("div", { style: {
95
98
  display: 'flex',
96
99
  alignItems: 'center',
97
- width: '184px',
98
100
  position: 'relative',
99
101
  cursor: 'pointer',
100
- padding: '8px',
101
102
  }, onMouseEnter: () => {
102
103
  if (isExpanded || isShowCloseDialog) {
103
104
  return;
@@ -109,32 +110,36 @@ function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCl
109
110
  }
110
111
  setIsShowCloseButton(false);
111
112
  onClick();
112
- }, children: [(0, jsx_runtime_1.jsx)(images_1.Logo, { style: logoStyle }), !dataLoaded && ((0, jsx_runtime_1.jsx)("span", { style: textStyle, children: isExpanded ? i18n.fetchingDAppInfo : '' })), (0, jsx_runtime_1.jsx)("div", { style: {
113
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center', padding: '8px' }, children: [(0, jsx_runtime_1.jsx)(images_1.Logo, { style: logoStyle }), !dataLoaded && (0, jsx_runtime_1.jsx)("span", { style: textStyle, children: isExpanded ? i18n.fetchingDAppInfo : '' })] }), (0, jsx_runtime_1.jsx)("div", { style: {
114
+ display: 'flex',
115
+ padding: '$4',
113
116
  position: 'absolute',
114
- left: '0px',
117
+ left: '-6px',
115
118
  bottom: '-10px',
119
+ transition: 'all 150ms cubic-bezier(0.4, 0, 0.2, 1)',
116
120
  opacity: showCloseButton ? 1 : 0,
121
+ borderRadius: '9999px',
122
+ backgroundColor: '#fff',
123
+ border: '1px solid rgba(0, 0, 0, 0.1)',
117
124
  }, onClick: (event) => {
118
125
  event.stopPropagation();
119
126
  setIsShowCloseButton(false);
120
127
  showCloseDialog();
121
- }, children: (0, jsx_runtime_1.jsx)("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5ZM0.25 6.5C0.25 3.04822 3.04822 0.25 6.5 0.25C9.95178 0.25 12.75 3.04822 12.75 6.5C12.75 9.95178 9.95178 12.75 6.5 12.75C3.04822 12.75 0.25 9.95178 0.25 6.5ZM4.18306 4.18306C4.42714 3.93898 4.82286 3.93898 5.06694 4.18306L6.5 5.61612L7.93306 4.18306C8.17714 3.93898 8.57286 3.93898 8.81694 4.18306C9.06102 4.42714 9.06102 4.82286 8.81694 5.06694L7.38388 6.5L8.81694 7.93306C9.06102 8.17714 9.06102 8.57286 8.81694 8.81694C8.57286 9.06102 8.17714 9.06102 7.93306 8.81694L6.5 7.38388L5.06694 8.81694C4.82286 9.06102 4.42714 9.06102 4.18306 8.81694C3.93898 8.57286 3.93898 8.17714 4.18306 7.93306L5.61612 6.5L4.18306 5.06694C3.93898 4.82286 3.93898 4.42714 4.18306 4.18306Z", fill: "#C8C8C8" }) }) })] }));
128
+ }, children: (0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.29289 7.29289C7.68342 6.90237 8.31658 6.90237 8.70711 7.29289L12 10.5858L15.2929 7.29289C15.6834 6.90237 16.3166 6.90237 16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711L13.4142 12L16.7071 15.2929C17.0976 15.6834 17.0976 16.3166 16.7071 16.7071C16.3166 17.0976 15.6834 17.0976 15.2929 16.7071L12 13.4142L8.70711 16.7071C8.31658 17.0976 7.68342 17.0976 7.29289 16.7071C6.90237 16.3166 6.90237 15.6834 7.29289 15.2929L10.5858 12L7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289Z", fill: "rgba(0, 0, 0, 0.61)" }) }) })] }));
122
129
  }
123
- function SecurityInfoRow({ title, children, }) {
130
+ function SecurityInfoRow({ title, children }) {
124
131
  return ((0, jsx_runtime_1.jsxs)("div", { style: {
125
132
  display: 'flex',
126
- height: '16px',
127
133
  flexDirection: 'row',
128
134
  justifyContent: 'space-between',
129
135
  alignItems: 'center',
130
- padding: '0 8px',
131
136
  }, children: [(0, jsx_runtime_1.jsx)("span", { style: {
132
137
  color: 'rgba(0, 0, 0, 0.61)',
133
- fontWeight: '500',
134
- fontSize: '11.2px',
138
+ fontSize: '12px',
139
+ lineHeight: '16px',
135
140
  }, children: title }), children] }));
136
141
  }
137
- function SecurityRiskDetectionRow({ securityInfo, }) {
142
+ function SecurityRiskDetectionRow({ securityInfo }) {
138
143
  const { securityElement, securityStatus } = (0, hooks_1.useMemo)(() => {
139
144
  const security = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === type_1.EHostSecurityLevel.Security).map((item) => item.name).join(' & ')) || '';
140
145
  if (security) {
@@ -143,8 +148,9 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
143
148
  securityElement: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { style: {
144
149
  color: 'rgba(0, 0, 0, 0.88)',
145
150
  fontWeight: '500',
146
- fontSize: '11.2px',
147
- }, children: i18n.verifiedSite }), (0, jsx_runtime_1.jsx)("svg", { width: "13", height: "14", viewBox: "0 0 13 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.7827 2.03938C6.21439 1.54254 6.98582 1.54254 7.41751 2.03938L8.14191 2.87311C8.14557 2.87733 8.15115 2.87935 8.15666 2.87848L9.2475 2.70544C9.89755 2.60232 10.4885 3.09819 10.4998 3.75627L10.5188 4.86059C10.5189 4.86617 10.5219 4.8713 10.5267 4.87418L11.4735 5.4428C12.0378 5.78165 12.1718 6.54136 11.7574 7.05277L11.0622 7.91094C11.0586 7.91528 11.0576 7.92112 11.0594 7.9264L11.4193 8.97061C11.6337 9.59289 11.248 10.261 10.6019 10.3864L9.51762 10.5969C9.51214 10.5979 9.5076 10.6018 9.5056 10.607L9.11004 11.6382C8.87432 12.2527 8.14941 12.5166 7.57382 12.1973L6.60796 11.6616C6.60307 11.6589 6.59714 11.6589 6.59226 11.6616L5.62639 12.1973C5.05081 12.5166 4.3259 12.2527 4.09017 11.6382L3.69462 10.607C3.69262 10.6018 3.68807 10.5979 3.68259 10.5969L2.59836 10.3864C1.95224 10.261 1.56652 9.59289 1.78095 8.97061L2.14079 7.9264C2.14261 7.92112 2.14158 7.91528 2.13806 7.91094L1.44279 7.05277C1.02846 6.54137 1.16241 5.78165 1.72667 5.4428L2.67353 4.87418C2.67831 4.8713 2.68128 4.86617 2.68137 4.86059L2.70038 3.75628C2.71171 3.09819 3.30266 2.60232 3.95272 2.70544L5.04355 2.87848C5.04907 2.87935 5.05464 2.87733 5.0583 2.87311L5.7827 2.03938ZM8.31057 6.5772C8.51885 6.36893 8.51885 6.03124 8.31057 5.82296C8.10229 5.61468 7.76461 5.61468 7.55633 5.82296L6.06678 7.3125L5.6439 6.88962C5.43562 6.68134 5.09794 6.68134 4.88966 6.88962C4.68138 7.0979 4.68138 7.43559 4.88966 7.64387L5.5011 8.25531C5.81352 8.56773 6.32005 8.56773 6.63247 8.25531L8.31057 6.5772Z", fill: "#006B3B", fillOpacity: "0.906" }) })] })),
151
+ fontSize: '12px',
152
+ lineHeight: '16px',
153
+ }, children: i18n.verifiedSite }), (0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { width: "16", height: "16", viewBox: "0 0 24 24", d: "M10.4673 2.69869C11.2767 1.76711 12.7232 1.7671 13.5326 2.69868L14.8908 4.26193C14.8977 4.26983 14.9082 4.27364 14.9185 4.272L16.9638 3.94755C18.1827 3.7542 19.2907 4.68395 19.3119 5.91786L19.3476 7.98845C19.3478 7.99891 19.3533 8.00854 19.3623 8.01393L21.1377 9.08009C22.1956 9.71544 22.4468 11.1399 21.6699 12.0988L20.3663 13.7079C20.3597 13.716 20.3578 13.7269 20.3612 13.7368L21.0359 15.6947C21.4379 16.8615 20.7147 18.1142 19.5032 18.3493L17.4703 18.744C17.46 18.746 17.4515 18.7531 17.4478 18.7629L16.7061 20.6964C16.2641 21.8487 14.9049 22.3434 13.8257 21.7448L12.0147 20.7404C12.0055 20.7353 11.9944 20.7353 11.9852 20.7404L10.1742 21.7448C9.09503 22.3434 7.73582 21.8487 7.29383 20.6964L6.55216 18.7629C6.54841 18.7531 6.53989 18.746 6.52962 18.744L4.49668 18.3493C3.2852 18.1142 2.56198 16.8615 2.96404 15.6947L3.63873 13.7368C3.64214 13.7269 3.64021 13.716 3.63362 13.7079L2.32998 12.0988C1.55311 11.1399 1.80428 9.71544 2.86226 9.08009L4.63762 8.01393C4.64659 8.00854 4.65215 7.99891 4.65233 7.98845L4.68797 5.91786C4.70921 4.68395 5.81725 3.7542 7.0361 3.94755L9.08142 4.272C9.09176 4.27364 9.10221 4.26983 9.10907 4.26193L10.4673 2.69869ZM15.2071 11.2071C15.5976 10.8166 15.5976 10.1834 15.2071 9.79289C14.8166 9.40237 14.1834 9.40237 13.7929 9.79289L11 12.5858L10.2071 11.7929C9.81655 11.4024 9.18339 11.4024 8.79286 11.7929C8.40234 12.1834 8.40234 12.8166 8.79286 13.2071L9.93931 14.3536C10.5251 14.9393 11.4748 14.9393 12.0606 14.3536L15.2071 11.2071Z", fill: "#006B3B", fillOpacity: "0.906" }) })] })),
148
154
  };
149
155
  }
150
156
  const highSecurity = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === type_1.EHostSecurityLevel.High).map((item) => item.name).join(' & ')) || '';
@@ -154,7 +160,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
154
160
  securityElement: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { style: {
155
161
  color: 'rgba(0, 0, 0, 0.88)',
156
162
  fontWeight: '500',
157
- fontSize: '11.2px',
163
+ fontSize: '12px',
164
+ lineHeight: '16px',
158
165
  }, children: i18n.maliciousSiteWarning }), (0, jsx_runtime_1.jsx)("svg", { width: "18", height: "16", viewBox: "0 0 18 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.83981 2.21151C7.8045 0.557753 10.194 0.557748 11.1587 2.21151L17.007 12.2371C17.9792 13.9038 16.777 15.9968 14.8475 15.9968H3.15098C1.22151 15.9968 0.0193263 13.9038 0.991535 12.2371L6.83981 2.21151ZM9.00008 5.99683C9.46032 5.99683 9.83342 6.36992 9.83342 6.83016V9.33016C9.83342 9.7904 9.46032 10.1635 9.00008 10.1635C8.53984 10.1635 8.16675 9.7904 8.16675 9.33016V6.83016C8.16675 6.36992 8.53984 5.99683 9.00008 5.99683ZM7.95842 11.8302C7.95842 11.2549 8.42478 10.7885 9.00008 10.7885C9.57538 10.7885 10.0417 11.2549 10.0417 11.8302C10.0417 12.4055 9.57538 12.8718 9.00008 12.8718C8.42478 12.8718 7.95842 12.4055 7.95842 11.8302Z", fill: "#BB0007", fillOpacity: "0.836" }) })] })),
159
166
  };
160
167
  }
@@ -165,7 +172,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
165
172
  securityElement: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { style: {
166
173
  color: 'rgba(0, 0, 0, 0.88)',
167
174
  fontWeight: '500',
168
- fontSize: '11.2px',
175
+ fontSize: '12px',
176
+ lineHeight: '16px',
169
177
  }, children: i18n.suspectedMaliciousBehavior }), (0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.96786 0.159913C3.52858 0.159899 3.14962 0.159886 2.83748 0.185389C2.50802 0.212306 2.18034 0.271736 1.86503 0.432398C1.39462 0.672081 1.01217 1.05453 0.772486 1.52494C0.611824 1.84025 0.552394 2.16794 0.525477 2.49739C0.499974 2.80953 0.499986 3.18849 0.500001 3.62776V11.692C0.499986 12.1313 0.499974 12.5103 0.525477 12.8224C0.552394 13.1519 0.611824 13.4796 0.772486 13.7949C1.01217 14.2653 1.39462 14.6477 1.86503 14.8874C2.18034 15.0481 2.50802 15.1075 2.83748 15.1344C3.14962 15.1599 3.52858 15.1599 3.96786 15.1599H12.0321C12.4714 15.1599 12.8504 15.1599 13.1625 15.1344C13.492 15.1075 13.8197 15.0481 14.135 14.8874C14.6054 14.6477 14.9878 14.2653 15.2275 13.7949C15.3882 13.4796 15.4476 13.1519 15.4745 12.8224C15.5 12.5103 15.5 12.1313 15.5 11.6921V3.62778C15.5 3.18849 15.5 2.80953 15.4745 2.49739C15.4476 2.16794 15.3882 1.84025 15.2275 1.52494C14.9878 1.05453 14.6054 0.672081 14.135 0.432398C13.8197 0.271736 13.492 0.212306 13.1625 0.185389C12.8504 0.159886 12.4714 0.159899 12.0322 0.159913H3.96786ZM6.33333 6.82658C6.33333 6.36634 6.70643 5.99325 7.16667 5.99325H8C8.46024 5.99325 8.83333 6.36634 8.83333 6.82658V10.9932C8.83333 11.4535 8.46024 11.8266 8 11.8266C7.53976 11.8266 7.16667 11.4535 7.16667 10.9932V7.65991C6.70643 7.65991 6.33333 7.28682 6.33333 6.82658ZM8 3.49325C7.53976 3.49325 7.16667 3.86634 7.16667 4.32658C7.16667 4.78682 7.53976 5.15991 8 5.15991C8.46024 5.15991 8.83333 4.78682 8.83333 4.32658C8.83333 3.86634 8.46024 3.49325 8 3.49325Z", fill: "#5E4200", fillOpacity: "0.844" }) })] })),
170
178
  };
171
179
  }
@@ -174,7 +182,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
174
182
  securityElement: ((0, jsx_runtime_1.jsx)("span", { style: {
175
183
  color: 'rgba(0, 0, 0, 0.88)',
176
184
  fontWeight: '500',
177
- fontSize: '11.2px',
185
+ fontSize: '12px',
186
+ lineHeight: '16px',
178
187
  }, children: i18n.unknown })),
179
188
  };
180
189
  }, [securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources]);
@@ -184,96 +193,93 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
184
193
  gap: '3.2px',
185
194
  }, children: securityElement }) }));
186
195
  }
187
- function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
196
+ function SecurityInfo({ securityInfo, onClose, }) {
188
197
  var _a, _b, _c, _d, _e, _f;
189
198
  const viewRef = (0, hooks_1.useRef)(null);
190
199
  useOutsideClick(viewRef, onClose);
191
200
  return ((0, jsx_runtime_1.jsxs)("div", { ref: viewRef, style: {
192
201
  display: 'flex',
193
202
  flexDirection: 'column',
194
- width: '234px',
195
- borderTopLeftRadius: '12px',
196
- borderBottomLeftRadius: '12px',
197
- paddingTop: '8px',
198
203
  }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
199
204
  display: 'flex',
200
205
  flexDirection: 'column',
201
- gap: '8px',
202
206
  }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
203
- padding: '0 8px',
207
+ padding: '8px',
204
208
  display: 'flex',
205
209
  alignItems: 'center',
206
210
  flexDirection: 'row',
207
211
  justifyContent: 'space-between',
212
+ borderBottom: '1px solid rgba(0, 0, 0, 0.05)',
208
213
  }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
209
214
  display: 'flex',
210
215
  flexDirection: 'row',
211
216
  alignItems: 'center',
212
217
  gap: '8px',
213
218
  color: 'rgba(0, 0, 0, 0.88)',
214
- fontSize: '13px',
219
+ fontSize: '14px',
215
220
  fontWeight: '500',
216
221
  overflow: 'hidden',
217
222
  }, children: [((_a = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _a === void 0 ? void 0 : _a.logo) ? ((0, jsx_runtime_1.jsx)("img", { src: (_b = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _b === void 0 ? void 0 : _b.logo, style: {
218
223
  height: '24px',
219
224
  width: '24px',
220
- borderRadius: '4px',
221
- } })) : ((0, jsx_runtime_1.jsxs)("svg", { width: "18", height: "19", viewBox: "0 0 18 19", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: {
222
- width: '24px',
225
+ borderRadius: '8px',
226
+ } })) : ((0, jsx_runtime_1.jsx)("div", { style: {
227
+ transform: 'translate(4px, 3px)',
223
228
  height: '24px',
224
- }, children: [(0, jsx_runtime_1.jsx)("path", { d: "M6.6234 6.17768C6.6234 4.79769 7.73338 3.66333 9.1234 3.66333C10.5134 3.66333 11.6234 4.79769 11.6234 6.17768C11.6234 7.30559 10.8798 7.89399 10.4435 8.19056C10.3054 8.28442 10.2138 8.36716 10.1499 8.45311C10.092 8.53086 10.0368 8.63774 10.0107 8.81185C9.92866 9.35801 9.41941 9.73426 8.87325 9.65224C8.3271 9.57021 7.95084 9.06096 8.03287 8.5148C8.19122 7.4605 8.81104 6.8819 9.31912 6.53656C9.47624 6.42975 9.54878 6.36136 9.58594 6.31084C9.60107 6.29027 9.60813 6.27529 9.61242 6.26261C9.61657 6.25036 9.6234 6.22488 9.6234 6.17768C9.6234 5.88426 9.39093 5.66333 9.1234 5.66333C8.85586 5.66333 8.6234 5.88426 8.6234 6.17768C8.6234 6.72996 8.17568 7.17768 7.6234 7.17768C7.07111 7.17768 6.6234 6.72996 6.6234 6.17768Z", fill: "#3C3C3C" }), (0, jsx_runtime_1.jsx)("path", { d: "M7.74976 11.5C7.74976 12.1904 8.3094 12.75 8.99976 12.75C9.69011 12.75 10.2498 12.1904 10.2498 11.5C10.2498 10.8096 9.69011 10.25 8.99976 10.25C8.3094 10.25 7.74976 10.8096 7.74976 11.5Z", fill: "#3C3C3C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.00195 2.00272e-05L15.0019 0C16.6588 -2.7418e-06 18.002 1.34314 18.002 3V13.0358C18.002 14.6926 16.6588 16.0357 15.002 16.0358L12.3757 16.0358L8.99393 18.8375L5.65157 16.0358H3.00195C1.3451 16.0358 0.00195312 14.6926 0.00195312 13.0358V3.00002C0.00195312 1.34317 1.34509 2.2769e-05 3.00195 2.00272e-05ZM15.002 2L3.00195 2.00002C2.44967 2.00002 2.00195 2.44774 2.00195 3.00002V13.0358C2.00195 13.5881 2.44967 14.0358 3.00195 14.0358H5.65157C6.12143 14.0358 6.57629 14.2012 6.93638 14.503L9.00143 16.2341L11.0997 14.4957C11.4585 14.1984 11.9098 14.0358 12.3757 14.0358L15.002 14.0358C15.5542 14.0358 16.002 13.588 16.002 13.0358V3C16.002 2.44772 15.5542 2 15.002 2Z", fill: "#3C3C3C" })] })), (0, jsx_runtime_1.jsx)("span", { style: {
229
+ width: '24px',
230
+ display: 'flex',
231
+ alignItems: 'center',
232
+ justifyContent: 'center'
233
+ }, children: (0, jsx_runtime_1.jsxs)("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", style: {
234
+ width: '24px',
235
+ height: '24px',
236
+ }, children: [(0, jsx_runtime_1.jsx)("path", { d: "M6.6234 6.17768C6.6234 4.79769 7.73338 3.66333 9.1234 3.66333C10.5134 3.66333 11.6234 4.79769 11.6234 6.17768C11.6234 7.30559 10.8798 7.89399 10.4435 8.19056C10.3054 8.28442 10.2138 8.36716 10.1499 8.45311C10.092 8.53086 10.0368 8.63774 10.0107 8.81185C9.92866 9.35801 9.41941 9.73426 8.87325 9.65224C8.3271 9.57021 7.95084 9.06096 8.03287 8.5148C8.19122 7.4605 8.81104 6.8819 9.31912 6.53656C9.47624 6.42975 9.54878 6.36136 9.58594 6.31084C9.60107 6.29027 9.60813 6.27529 9.61242 6.26261C9.61657 6.25036 9.6234 6.22488 9.6234 6.17768C9.6234 5.88426 9.39093 5.66333 9.1234 5.66333C8.85586 5.66333 8.6234 5.88426 8.6234 6.17768C8.6234 6.72996 8.17568 7.17768 7.6234 7.17768C7.07111 7.17768 6.6234 6.72996 6.6234 6.17768Z", fill: "#3C3C3C" }), (0, jsx_runtime_1.jsx)("path", { d: "M7.74976 11.5C7.74976 12.1904 8.3094 12.75 8.99976 12.75C9.69011 12.75 10.2498 12.1904 10.2498 11.5C10.2498 10.8096 9.69011 10.25 8.99976 10.25C8.3094 10.25 7.74976 10.8096 7.74976 11.5Z", fill: "#3C3C3C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.00195 2.00272e-05L15.0019 0C16.6588 -2.7418e-06 18.002 1.34314 18.002 3V13.0358C18.002 14.6926 16.6588 16.0357 15.002 16.0358L12.3757 16.0358L8.99393 18.8375L5.65157 16.0358H3.00195C1.3451 16.0358 0.00195312 14.6926 0.00195312 13.0358V3.00002C0.00195312 1.34317 1.34509 2.2769e-05 3.00195 2.00272e-05ZM15.002 2L3.00195 2.00002C2.44967 2.00002 2.00195 2.44774 2.00195 3.00002V13.0358C2.00195 13.5881 2.44967 14.0358 3.00195 14.0358H5.65157C6.12143 14.0358 6.57629 14.2012 6.93638 14.503L9.00143 16.2341L11.0997 14.4957C11.4585 14.1984 11.9098 14.0358 12.3757 14.0358L15.002 14.0358C15.5542 14.0358 16.002 13.588 16.002 13.0358V3C16.002 2.44772 15.5542 2 15.002 2Z", fill: "#3C3C3C" })] }) })), (0, jsx_runtime_1.jsx)("span", { style: {
225
237
  width: '100%',
226
238
  overflow: 'hidden',
227
239
  textOverflow: 'ellipsis'
228
240
  }, children: ((_c = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _c === void 0 ? void 0 : _c.name) || (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.host) })] }), (0, jsx_runtime_1.jsx)("div", { style: {
229
- width: "24",
230
- height: "24",
231
- cursor: "pointer",
232
241
  display: 'flex',
233
- alignItems: 'center',
234
- }, onClick: () => {
235
- onClose();
236
- setTimeout(() => {
237
- showCloseDialog();
238
- }, 200);
239
- }, children: (0, jsx_runtime_1.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.29289 7.29289C7.68342 6.90237 8.31658 6.90237 8.70711 7.29289L12 10.5858L15.2929 7.29289C15.6834 6.90237 16.3166 6.90237 16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711L13.4142 12L16.7071 15.2929C17.0976 15.6834 17.0976 16.3166 16.7071 16.7071C16.3166 17.0976 15.6834 17.0976 15.2929 16.7071L12 13.4142L8.70711 16.7071C8.31658 17.0976 7.68342 17.0976 7.29289 16.7071C6.90237 16.3166 6.90237 15.6834 7.29289 15.2929L10.5858 12L7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289Z", fill: "#BABABA" }) }) })] }), (0, jsx_runtime_1.jsx)("div", { style: {
240
- background: 'rgba(0, 0, 0, 0.13)',
241
- height: '0.33px',
242
- width: '100%',
243
- } }), ((_d = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _d === void 0 ? void 0 : _d.origins.length) ? ((0, jsx_runtime_1.jsx)(SecurityInfoRow, { title: i18n.dappListedBy, children: (0, jsx_runtime_1.jsx)("div", { style: {
244
- display: 'flex',
245
- alignItems: 'center',
246
- gap: '2px',
247
- }, children: (_e = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _e === void 0 ? void 0 : _e.origins.map((item) => ((0, jsx_runtime_1.jsx)("img", { src: item.logo, style: {
248
- width: '16px',
249
- height: '16px',
250
- } }))) }) })) : null, (0, jsx_runtime_1.jsx)(SecurityRiskDetectionRow, { securityInfo: securityInfo }), ((_f = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _f === void 0 ? void 0 : _f.origins.length) ? ((0, jsx_runtime_1.jsx)(SecurityInfoRow, { title: i18n.lastVerifiedAt, children: (0, jsx_runtime_1.jsx)("span", { style: {
251
- fontWeight: '500',
252
- fontSize: '11.2px',
253
- color: 'rgba(0, 0, 0, 0.88)',
254
- }, children: securityInfo.updatedAt }) })) : null] }), (0, jsx_runtime_1.jsxs)("div", { style: {
255
- marginTop: '8px',
256
- textAlign: 'center',
257
- padding: '8px 0',
258
- background: 'rgba(249, 249, 249, 1)',
242
+ width: '24',
243
+ height: '24',
244
+ cursor: 'pointer',
245
+ }, onClick: onClose, children: (0, jsx_runtime_1.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.29289 7.29289C7.68342 6.90237 8.31658 6.90237 8.70711 7.29289L12 10.5858L15.2929 7.29289C15.6834 6.90237 16.3166 6.90237 16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711L13.4142 12L16.7071 15.2929C17.0976 15.6834 17.0976 16.3166 16.7071 16.7071C16.3166 17.0976 15.6834 17.0976 15.2929 16.7071L12 13.4142L8.70711 16.7071C8.31658 17.0976 7.68342 17.0976 7.29289 16.7071C6.90237 16.3166 6.90237 15.6834 7.29289 15.2929L10.5858 12L7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289Z", fill: "rgba(0, 0, 0, 0.61)" }) }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', padding: '12px 8px', gap: '12px' }, children: [((_d = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _d === void 0 ? void 0 : _d.origins.length) ? ((0, jsx_runtime_1.jsx)(SecurityInfoRow, { title: i18n.dappListedBy, children: (0, jsx_runtime_1.jsx)("div", { style: {
246
+ display: 'flex',
247
+ alignItems: 'center',
248
+ gap: '2px',
249
+ }, children: (_e = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _e === void 0 ? void 0 : _e.origins.map((item) => ((0, jsx_runtime_1.jsx)("img", { src: item.logo, style: {
250
+ border: '1px solid rgba(0, 0, 0, 0.1)',
251
+ borderRadius: '9999px',
252
+ width: '16px',
253
+ height: '16px',
254
+ } }))) }) })) : null, (0, jsx_runtime_1.jsx)(SecurityRiskDetectionRow, { securityInfo: securityInfo }), ((_f = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _f === void 0 ? void 0 : _f.origins.length) ? ((0, jsx_runtime_1.jsx)(SecurityInfoRow, { title: i18n.lastVerifiedAt, children: (0, jsx_runtime_1.jsx)("span", { style: {
255
+ fontWeight: '500',
256
+ fontSize: '12px',
257
+ lineHeight: '16px',
258
+ color: 'rgba(0, 0, 0, 0.88)',
259
+ }, children: securityInfo.updatedAt }) })) : null] })] }), (0, jsx_runtime_1.jsxs)("div", { style: {
260
+ display: 'flex',
261
+ gap: '8px',
262
+ padding: '12px 8px',
263
+ alignItems: 'center',
264
+ justifyContent: 'center',
265
+ backgroundColor: '#F9F9F9',
259
266
  borderBottomLeftRadius: '12px',
260
- display: "flex",
261
- alignItems: "center",
262
- justifyContent: "center",
267
+ borderBottomRightRadius: '12px',
268
+ borderTop: '1px solid rgba(0, 0, 0, 0.05)',
263
269
  }, children: [(0, jsx_runtime_1.jsx)("span", { style: {
270
+ flex: 1,
264
271
  color: 'rgba(0, 0, 0, 0.61)',
265
272
  fontWeight: '400',
266
- fontSize: '11.2px',
267
- }, children: "Powered by" }), (0, jsx_runtime_1.jsx)(images_1.Logo, { style: {
268
- width: '12.83px',
269
- height: '12.83px',
270
- marginLeft: '5.6px',
271
- marginRight: '4.2px',
272
- verticalAlign: 'middle',
273
+ fontSize: '12px',
274
+ lineHeight: '16px',
275
+ }, children: i18n.maliciousDappWarningSourceMessage }), (0, jsx_runtime_1.jsx)(images_1.Logo, { style: {
276
+ width: '14px',
277
+ height: '14px',
273
278
  } }), (0, jsx_runtime_1.jsx)("span", { style: {
274
279
  color: 'rgba(0, 0, 0, 0.88)',
275
- fontWeight: '600',
276
- fontSize: '11.2px',
280
+ fontWeight: '500',
281
+ fontSize: '12px',
282
+ lineHeight: '16px',
277
283
  }, children: "OneKey" })] })] }));
278
284
  }
279
285
  function App() {
@@ -295,19 +301,21 @@ function App() {
295
301
  setSecurityInfo(result.securityInfo);
296
302
  }
297
303
  }), [isExpanded, securityInfo]);
298
- const borderStyle = (0, hooks_1.useMemo)(() => isExpanded
299
- ? {
300
- borderTopLeftRadius: '12px',
301
- borderBottomLeftRadius: '12px',
302
- borderTopRightRadius: '0px',
303
- borderBottomRightRadius: '0px',
304
- }
305
- : {
306
- boxShadow: '0px 8.57px 17.14px 0px rgba(0, 0, 0, 0.09)',
307
- transition: 'transform 0.3s ease-in-out',
308
- borderRadius: '100px',
309
- }, [isExpanded]);
310
- return ((0, jsx_runtime_1.jsxs)("div", { id: containerId, style: Object.assign({ position: 'fixed', zIndex: 999999, bottom: '25%', right: '-146px', background: 'rgba(255, 255, 255, 1)', borderWidth: '0.33px', borderColor: 'rgba(0, 0, 0, 0.13)', borderStyle: 'solid', boxShadow: '0px 8.57px 17.14px 0px rgba(0, 0, 0, 0.09)', transition: 'transform 0.3s ease-in-out', transform: isExpanded ? 'translateX(-146px)' : 'translateX(0)' }, borderStyle), children: [showSecurityInfo && securityInfo ? ((0, jsx_runtime_1.jsx)(SecurityInfo, { securityInfo: securityInfo, showCloseDialog: handleShowCloseDialog, onClose: () => {
304
+ return ((0, jsx_runtime_1.jsxs)("div", { id: containerId, style: {
305
+ position: 'fixed',
306
+ zIndex: 999999,
307
+ bottom: '25%',
308
+ right: '0px',
309
+ width: '256px',
310
+ background: '#fff',
311
+ borderRadius: '12px',
312
+ transition: 'all 150ms cubic-bezier(0.4, 0, 0.2, 1)',
313
+ boxShadow: '0px 0px 0px 1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',
314
+ transform: isExpanded ? 'translateX(-20px)' : 'translateX(216px)',
315
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
316
+ WebkitTextSizeAdjust: '100%',
317
+ fontSmooth: 'antialiased',
318
+ }, children: [showSecurityInfo && securityInfo ? ((0, jsx_runtime_1.jsx)(SecurityInfo, { securityInfo: securityInfo, onClose: () => {
311
319
  setIsExpanded(false);
312
320
  setIsShowSecurityInfo(false);
313
321
  } })) : ((0, jsx_runtime_1.jsx)(IconButton, { onClick: handleClick, isExpanded: isExpanded, isShowCloseDialog: showCloseDialog, showCloseDialog: handleShowCloseDialog, dataLoaded: !!securityInfo })), !isExpanded && showCloseDialog && ((0, jsx_runtime_1.jsx)(CloseDialog, { onClose: () => {
@@ -10,17 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
11
11
  import { render } from 'preact';
12
12
  import { useEffect, useMemo, useCallback, useRef, useState } from 'preact/hooks';
13
- import { EHostSecurityLevel, } from './type';
13
+ import { EHostSecurityLevel } from './type';
14
14
  import { Logo } from './images';
15
15
  let isInjected = false;
16
16
  let i18n = {};
17
17
  const logoStyle = {
18
- width: '28px',
19
- height: '28px',
18
+ width: '24px',
19
+ height: '24px',
20
20
  };
21
21
  const textStyle = {
22
22
  color: 'rgba(0, 0, 0, 0.61)',
23
- fontSize: '13px',
23
+ fontSize: '14px',
24
24
  marginLeft: '8px',
25
25
  };
26
26
  const containerId = 'onekey-floating-widget';
@@ -32,8 +32,7 @@ const removeIcon = () => {
32
32
  const useOutsideClick = (ref, callback) => {
33
33
  useEffect(() => {
34
34
  const handleClickOutside = (event) => {
35
- if (ref.current &&
36
- !ref.current.contains(event.target)) {
35
+ if (ref.current && !ref.current.contains(event.target)) {
37
36
  callback();
38
37
  }
39
38
  };
@@ -60,41 +59,43 @@ function CloseDialog({ onClose }) {
60
59
  removeIcon();
61
60
  }, []);
62
61
  return (_jsxs("div", { style: {
63
- background: 'rgba(255, 255, 255, 1)',
64
- padding: '14px',
62
+ display: 'flex',
63
+ flexDirection: 'column',
64
+ gap: '8px',
65
+ padding: '12px',
65
66
  position: 'absolute',
66
- right: '134px',
67
- border: '1px rgba(0, 0, 0, 0.13) solid',
68
- top: '60px',
69
- width: '170px',
70
- borderRadius: '15px',
71
- }, ref: dialogRef, children: [_jsx("div", { style: {
72
- color: 'rgba(0, 0, 0, 1)',
73
- fontSize: '12px',
74
- fontWeight: '400',
67
+ right: '100%',
68
+ background: '#fff',
69
+ top: '40px',
70
+ width: '196px',
71
+ borderRadius: '12px',
72
+ boxShadow: '0px 0px 0px 1px rgba(0, 0, 0, 0.05),0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',
73
+ color: 'rgba(0, 0, 0, 1)',
74
+ fontSize: '12px',
75
+ lineHeight: '16px',
76
+ }, ref: dialogRef, children: [_jsxs("div", { style: {
77
+ display: 'flex',
78
+ alignItems: 'center',
75
79
  cursor: 'pointer',
76
- }, onClick: handleHideOnSite, children: i18n.hideOnThisSite }), _jsx("div", { style: {
77
- marginTop: '4px',
78
- marginBottom: '8px',
79
- color: 'rgba(0, 0, 0, 1)',
80
- fontSize: '12px',
81
- fontWeight: '400',
80
+ gap: '8px',
81
+ }, onClick: handleHideOnSite, children: [_jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M2.29312 2.2929C2.68364 1.90237 3.31681 1.90237 3.70734 2.29289L7.35069 5.9362L21.7073 20.2929C22.0979 20.6834 22.0979 21.3166 21.7073 21.7071C21.3168 22.0976 20.6836 22.0976 20.2931 21.7071L17.2031 18.617C14.684 20.0216 11.8704 20.363 9.19337 19.6107C6.27083 18.7893 3.59188 16.6894 1.6441 13.4178C1.12514 12.5461 1.12292 11.4579 1.64298 10.5841C2.63083 8.92441 3.8063 7.56606 5.10844 6.52239L2.29313 3.70711C1.9026 3.31659 1.9026 2.68342 2.29312 2.2929ZM6.53283 7.94678L7.41812 8.8321L8.5542 9.96818C8.20253 10.5636 8.00023 11.2586 8.00023 12C8.00023 14.2091 9.79109 16 12.0002 16C12.7416 16 13.4366 15.7977 14.0321 15.446L15.7203 17.1343C13.7862 18.0642 11.7083 18.24 9.73447 17.6852C7.37839 17.0231 5.08952 15.2953 3.36259 12.3947C3.21773 12.1514 3.21796 11.8483 3.36159 11.607C4.28389 10.0575 5.36713 8.84257 6.53283 7.94678ZM12.5184 13.9324L10.0678 11.4818C10.0237 11.647 10.0002 11.8207 10.0002 12C10.0002 13.1046 10.8957 14 12.0002 14C12.1796 14 12.3532 13.9765 12.5184 13.9324ZM20.6388 11.6068C18.1001 7.34166 14.3527 5.6013 10.8782 6.07652C10.331 6.15137 9.82679 5.76845 9.75195 5.22126C9.67711 4.67407 10.06 4.16981 10.6072 4.09497C15.0162 3.49193 19.4849 5.75792 22.3574 10.5838C22.8767 11.4564 22.8771 12.5429 22.3576 13.4157C21.9613 14.0815 21.535 14.6987 21.0823 15.2666C20.738 15.6985 20.1088 15.7695 19.677 15.4253C19.2451 15.081 19.1741 14.4519 19.5183 14.02C19.9123 13.5257 20.2873 12.9836 20.6389 12.3928C20.7831 12.1507 20.7831 11.8493 20.6388 11.6068Z", fill: "rgba(0, 0, 0, 0.61)" }) }), _jsx("div", { children: i18n.hideOnThisSite })] }), _jsxs("div", { style: {
82
+ display: 'flex',
83
+ alignItems: 'center',
82
84
  cursor: 'pointer',
83
- }, onClick: handleDisable, children: i18n.disable }), _jsx("div", { style: {
84
- color: 'rgb(156, 156, 156)',
85
- fontSize: '10px',
86
- fontWeight: '400',
87
- }, children: i18n.canBeReEnabledInSettings })] }));
85
+ gap: '8px',
86
+ }, onClick: handleDisable, children: [_jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M12 4C7.58172 4 4 7.58172 4 12C4 13.8491 4.62644 15.5506 5.68009 16.9057L16.9057 5.68009C15.5506 4.62644 13.8491 4 12 4ZM18.3199 7.0943L7.0943 18.3199C8.44939 19.3736 10.1509 20 12 20C16.4183 20 20 16.4183 20 12C20 10.1509 19.3736 8.44939 18.3199 7.0943ZM2 12C2 6.47715 6.47715 2 12 2C14.7611 2 17.2625 3.12038 19.0711 4.92893C20.8796 6.73748 22 9.23885 22 12C22 17.5228 17.5228 22 12 22C9.23885 22 6.73748 20.8796 4.92893 19.0711C3.12038 17.2625 2 14.7611 2 12Z", fill: "rgba(0, 0, 0, 0.61)" }) }), _jsxs("div", { children: [_jsx("div", { children: i18n.disable }), _jsx("div", { style: {
87
+ color: 'rgba(0, 0, 0, 0.61)',
88
+ fontSize: '12px',
89
+ lineHeight: '16px',
90
+ }, children: i18n.canBeReEnabledInSettings })] })] })] }));
88
91
  }
89
92
  function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCloseDialog, }) {
90
93
  const [showCloseButton, setIsShowCloseButton] = useState(false);
91
94
  return (_jsxs("div", { style: {
92
95
  display: 'flex',
93
96
  alignItems: 'center',
94
- width: '184px',
95
97
  position: 'relative',
96
98
  cursor: 'pointer',
97
- padding: '8px',
98
99
  }, onMouseEnter: () => {
99
100
  if (isExpanded || isShowCloseDialog) {
100
101
  return;
@@ -106,32 +107,36 @@ function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCl
106
107
  }
107
108
  setIsShowCloseButton(false);
108
109
  onClick();
109
- }, children: [_jsx(Logo, { style: logoStyle }), !dataLoaded && (_jsx("span", { style: textStyle, children: isExpanded ? i18n.fetchingDAppInfo : '' })), _jsx("div", { style: {
110
+ }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', padding: '8px' }, children: [_jsx(Logo, { style: logoStyle }), !dataLoaded && _jsx("span", { style: textStyle, children: isExpanded ? i18n.fetchingDAppInfo : '' })] }), _jsx("div", { style: {
111
+ display: 'flex',
112
+ padding: '$4',
110
113
  position: 'absolute',
111
- left: '0px',
114
+ left: '-6px',
112
115
  bottom: '-10px',
116
+ transition: 'all 150ms cubic-bezier(0.4, 0, 0.2, 1)',
113
117
  opacity: showCloseButton ? 1 : 0,
118
+ borderRadius: '9999px',
119
+ backgroundColor: '#fff',
120
+ border: '1px solid rgba(0, 0, 0, 0.1)',
114
121
  }, onClick: (event) => {
115
122
  event.stopPropagation();
116
123
  setIsShowCloseButton(false);
117
124
  showCloseDialog();
118
- }, children: _jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5ZM0.25 6.5C0.25 3.04822 3.04822 0.25 6.5 0.25C9.95178 0.25 12.75 3.04822 12.75 6.5C12.75 9.95178 9.95178 12.75 6.5 12.75C3.04822 12.75 0.25 9.95178 0.25 6.5ZM4.18306 4.18306C4.42714 3.93898 4.82286 3.93898 5.06694 4.18306L6.5 5.61612L7.93306 4.18306C8.17714 3.93898 8.57286 3.93898 8.81694 4.18306C9.06102 4.42714 9.06102 4.82286 8.81694 5.06694L7.38388 6.5L8.81694 7.93306C9.06102 8.17714 9.06102 8.57286 8.81694 8.81694C8.57286 9.06102 8.17714 9.06102 7.93306 8.81694L6.5 7.38388L5.06694 8.81694C4.82286 9.06102 4.42714 9.06102 4.18306 8.81694C3.93898 8.57286 3.93898 8.17714 4.18306 7.93306L5.61612 6.5L4.18306 5.06694C3.93898 4.82286 3.93898 4.42714 4.18306 4.18306Z", fill: "#C8C8C8" }) }) })] }));
125
+ }, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.29289 7.29289C7.68342 6.90237 8.31658 6.90237 8.70711 7.29289L12 10.5858L15.2929 7.29289C15.6834 6.90237 16.3166 6.90237 16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711L13.4142 12L16.7071 15.2929C17.0976 15.6834 17.0976 16.3166 16.7071 16.7071C16.3166 17.0976 15.6834 17.0976 15.2929 16.7071L12 13.4142L8.70711 16.7071C8.31658 17.0976 7.68342 17.0976 7.29289 16.7071C6.90237 16.3166 6.90237 15.6834 7.29289 15.2929L10.5858 12L7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289Z", fill: "rgba(0, 0, 0, 0.61)" }) }) })] }));
119
126
  }
120
- function SecurityInfoRow({ title, children, }) {
127
+ function SecurityInfoRow({ title, children }) {
121
128
  return (_jsxs("div", { style: {
122
129
  display: 'flex',
123
- height: '16px',
124
130
  flexDirection: 'row',
125
131
  justifyContent: 'space-between',
126
132
  alignItems: 'center',
127
- padding: '0 8px',
128
133
  }, children: [_jsx("span", { style: {
129
134
  color: 'rgba(0, 0, 0, 0.61)',
130
- fontWeight: '500',
131
- fontSize: '11.2px',
135
+ fontSize: '12px',
136
+ lineHeight: '16px',
132
137
  }, children: title }), children] }));
133
138
  }
134
- function SecurityRiskDetectionRow({ securityInfo, }) {
139
+ function SecurityRiskDetectionRow({ securityInfo }) {
135
140
  const { securityElement, securityStatus } = useMemo(() => {
136
141
  const security = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === EHostSecurityLevel.Security).map((item) => item.name).join(' & ')) || '';
137
142
  if (security) {
@@ -140,8 +145,9 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
140
145
  securityElement: (_jsxs(_Fragment, { children: [_jsx("span", { style: {
141
146
  color: 'rgba(0, 0, 0, 0.88)',
142
147
  fontWeight: '500',
143
- fontSize: '11.2px',
144
- }, children: i18n.verifiedSite }), _jsx("svg", { width: "13", height: "14", viewBox: "0 0 13 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.7827 2.03938C6.21439 1.54254 6.98582 1.54254 7.41751 2.03938L8.14191 2.87311C8.14557 2.87733 8.15115 2.87935 8.15666 2.87848L9.2475 2.70544C9.89755 2.60232 10.4885 3.09819 10.4998 3.75627L10.5188 4.86059C10.5189 4.86617 10.5219 4.8713 10.5267 4.87418L11.4735 5.4428C12.0378 5.78165 12.1718 6.54136 11.7574 7.05277L11.0622 7.91094C11.0586 7.91528 11.0576 7.92112 11.0594 7.9264L11.4193 8.97061C11.6337 9.59289 11.248 10.261 10.6019 10.3864L9.51762 10.5969C9.51214 10.5979 9.5076 10.6018 9.5056 10.607L9.11004 11.6382C8.87432 12.2527 8.14941 12.5166 7.57382 12.1973L6.60796 11.6616C6.60307 11.6589 6.59714 11.6589 6.59226 11.6616L5.62639 12.1973C5.05081 12.5166 4.3259 12.2527 4.09017 11.6382L3.69462 10.607C3.69262 10.6018 3.68807 10.5979 3.68259 10.5969L2.59836 10.3864C1.95224 10.261 1.56652 9.59289 1.78095 8.97061L2.14079 7.9264C2.14261 7.92112 2.14158 7.91528 2.13806 7.91094L1.44279 7.05277C1.02846 6.54137 1.16241 5.78165 1.72667 5.4428L2.67353 4.87418C2.67831 4.8713 2.68128 4.86617 2.68137 4.86059L2.70038 3.75628C2.71171 3.09819 3.30266 2.60232 3.95272 2.70544L5.04355 2.87848C5.04907 2.87935 5.05464 2.87733 5.0583 2.87311L5.7827 2.03938ZM8.31057 6.5772C8.51885 6.36893 8.51885 6.03124 8.31057 5.82296C8.10229 5.61468 7.76461 5.61468 7.55633 5.82296L6.06678 7.3125L5.6439 6.88962C5.43562 6.68134 5.09794 6.68134 4.88966 6.88962C4.68138 7.0979 4.68138 7.43559 4.88966 7.64387L5.5011 8.25531C5.81352 8.56773 6.32005 8.56773 6.63247 8.25531L8.31057 6.5772Z", fill: "#006B3B", fillOpacity: "0.906" }) })] })),
148
+ fontSize: '12px',
149
+ lineHeight: '16px',
150
+ }, children: i18n.verifiedSite }), _jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { width: "16", height: "16", viewBox: "0 0 24 24", d: "M10.4673 2.69869C11.2767 1.76711 12.7232 1.7671 13.5326 2.69868L14.8908 4.26193C14.8977 4.26983 14.9082 4.27364 14.9185 4.272L16.9638 3.94755C18.1827 3.7542 19.2907 4.68395 19.3119 5.91786L19.3476 7.98845C19.3478 7.99891 19.3533 8.00854 19.3623 8.01393L21.1377 9.08009C22.1956 9.71544 22.4468 11.1399 21.6699 12.0988L20.3663 13.7079C20.3597 13.716 20.3578 13.7269 20.3612 13.7368L21.0359 15.6947C21.4379 16.8615 20.7147 18.1142 19.5032 18.3493L17.4703 18.744C17.46 18.746 17.4515 18.7531 17.4478 18.7629L16.7061 20.6964C16.2641 21.8487 14.9049 22.3434 13.8257 21.7448L12.0147 20.7404C12.0055 20.7353 11.9944 20.7353 11.9852 20.7404L10.1742 21.7448C9.09503 22.3434 7.73582 21.8487 7.29383 20.6964L6.55216 18.7629C6.54841 18.7531 6.53989 18.746 6.52962 18.744L4.49668 18.3493C3.2852 18.1142 2.56198 16.8615 2.96404 15.6947L3.63873 13.7368C3.64214 13.7269 3.64021 13.716 3.63362 13.7079L2.32998 12.0988C1.55311 11.1399 1.80428 9.71544 2.86226 9.08009L4.63762 8.01393C4.64659 8.00854 4.65215 7.99891 4.65233 7.98845L4.68797 5.91786C4.70921 4.68395 5.81725 3.7542 7.0361 3.94755L9.08142 4.272C9.09176 4.27364 9.10221 4.26983 9.10907 4.26193L10.4673 2.69869ZM15.2071 11.2071C15.5976 10.8166 15.5976 10.1834 15.2071 9.79289C14.8166 9.40237 14.1834 9.40237 13.7929 9.79289L11 12.5858L10.2071 11.7929C9.81655 11.4024 9.18339 11.4024 8.79286 11.7929C8.40234 12.1834 8.40234 12.8166 8.79286 13.2071L9.93931 14.3536C10.5251 14.9393 11.4748 14.9393 12.0606 14.3536L15.2071 11.2071Z", fill: "#006B3B", fillOpacity: "0.906" }) })] })),
145
151
  };
146
152
  }
147
153
  const highSecurity = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === EHostSecurityLevel.High).map((item) => item.name).join(' & ')) || '';
@@ -151,7 +157,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
151
157
  securityElement: (_jsxs(_Fragment, { children: [_jsx("span", { style: {
152
158
  color: 'rgba(0, 0, 0, 0.88)',
153
159
  fontWeight: '500',
154
- fontSize: '11.2px',
160
+ fontSize: '12px',
161
+ lineHeight: '16px',
155
162
  }, children: i18n.maliciousSiteWarning }), _jsx("svg", { width: "18", height: "16", viewBox: "0 0 18 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.83981 2.21151C7.8045 0.557753 10.194 0.557748 11.1587 2.21151L17.007 12.2371C17.9792 13.9038 16.777 15.9968 14.8475 15.9968H3.15098C1.22151 15.9968 0.0193263 13.9038 0.991535 12.2371L6.83981 2.21151ZM9.00008 5.99683C9.46032 5.99683 9.83342 6.36992 9.83342 6.83016V9.33016C9.83342 9.7904 9.46032 10.1635 9.00008 10.1635C8.53984 10.1635 8.16675 9.7904 8.16675 9.33016V6.83016C8.16675 6.36992 8.53984 5.99683 9.00008 5.99683ZM7.95842 11.8302C7.95842 11.2549 8.42478 10.7885 9.00008 10.7885C9.57538 10.7885 10.0417 11.2549 10.0417 11.8302C10.0417 12.4055 9.57538 12.8718 9.00008 12.8718C8.42478 12.8718 7.95842 12.4055 7.95842 11.8302Z", fill: "#BB0007", fillOpacity: "0.836" }) })] })),
156
163
  };
157
164
  }
@@ -162,7 +169,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
162
169
  securityElement: (_jsxs(_Fragment, { children: [_jsx("span", { style: {
163
170
  color: 'rgba(0, 0, 0, 0.88)',
164
171
  fontWeight: '500',
165
- fontSize: '11.2px',
172
+ fontSize: '12px',
173
+ lineHeight: '16px',
166
174
  }, children: i18n.suspectedMaliciousBehavior }), _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.96786 0.159913C3.52858 0.159899 3.14962 0.159886 2.83748 0.185389C2.50802 0.212306 2.18034 0.271736 1.86503 0.432398C1.39462 0.672081 1.01217 1.05453 0.772486 1.52494C0.611824 1.84025 0.552394 2.16794 0.525477 2.49739C0.499974 2.80953 0.499986 3.18849 0.500001 3.62776V11.692C0.499986 12.1313 0.499974 12.5103 0.525477 12.8224C0.552394 13.1519 0.611824 13.4796 0.772486 13.7949C1.01217 14.2653 1.39462 14.6477 1.86503 14.8874C2.18034 15.0481 2.50802 15.1075 2.83748 15.1344C3.14962 15.1599 3.52858 15.1599 3.96786 15.1599H12.0321C12.4714 15.1599 12.8504 15.1599 13.1625 15.1344C13.492 15.1075 13.8197 15.0481 14.135 14.8874C14.6054 14.6477 14.9878 14.2653 15.2275 13.7949C15.3882 13.4796 15.4476 13.1519 15.4745 12.8224C15.5 12.5103 15.5 12.1313 15.5 11.6921V3.62778C15.5 3.18849 15.5 2.80953 15.4745 2.49739C15.4476 2.16794 15.3882 1.84025 15.2275 1.52494C14.9878 1.05453 14.6054 0.672081 14.135 0.432398C13.8197 0.271736 13.492 0.212306 13.1625 0.185389C12.8504 0.159886 12.4714 0.159899 12.0322 0.159913H3.96786ZM6.33333 6.82658C6.33333 6.36634 6.70643 5.99325 7.16667 5.99325H8C8.46024 5.99325 8.83333 6.36634 8.83333 6.82658V10.9932C8.83333 11.4535 8.46024 11.8266 8 11.8266C7.53976 11.8266 7.16667 11.4535 7.16667 10.9932V7.65991C6.70643 7.65991 6.33333 7.28682 6.33333 6.82658ZM8 3.49325C7.53976 3.49325 7.16667 3.86634 7.16667 4.32658C7.16667 4.78682 7.53976 5.15991 8 5.15991C8.46024 5.15991 8.83333 4.78682 8.83333 4.32658C8.83333 3.86634 8.46024 3.49325 8 3.49325Z", fill: "#5E4200", fillOpacity: "0.844" }) })] })),
167
175
  };
168
176
  }
@@ -171,7 +179,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
171
179
  securityElement: (_jsx("span", { style: {
172
180
  color: 'rgba(0, 0, 0, 0.88)',
173
181
  fontWeight: '500',
174
- fontSize: '11.2px',
182
+ fontSize: '12px',
183
+ lineHeight: '16px',
175
184
  }, children: i18n.unknown })),
176
185
  };
177
186
  }, [securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources]);
@@ -181,96 +190,93 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
181
190
  gap: '3.2px',
182
191
  }, children: securityElement }) }));
183
192
  }
184
- function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
193
+ function SecurityInfo({ securityInfo, onClose, }) {
185
194
  var _a, _b, _c, _d, _e, _f;
186
195
  const viewRef = useRef(null);
187
196
  useOutsideClick(viewRef, onClose);
188
197
  return (_jsxs("div", { ref: viewRef, style: {
189
198
  display: 'flex',
190
199
  flexDirection: 'column',
191
- width: '234px',
192
- borderTopLeftRadius: '12px',
193
- borderBottomLeftRadius: '12px',
194
- paddingTop: '8px',
195
200
  }, children: [_jsxs("div", { style: {
196
201
  display: 'flex',
197
202
  flexDirection: 'column',
198
- gap: '8px',
199
203
  }, children: [_jsxs("div", { style: {
200
- padding: '0 8px',
204
+ padding: '8px',
201
205
  display: 'flex',
202
206
  alignItems: 'center',
203
207
  flexDirection: 'row',
204
208
  justifyContent: 'space-between',
209
+ borderBottom: '1px solid rgba(0, 0, 0, 0.05)',
205
210
  }, children: [_jsxs("div", { style: {
206
211
  display: 'flex',
207
212
  flexDirection: 'row',
208
213
  alignItems: 'center',
209
214
  gap: '8px',
210
215
  color: 'rgba(0, 0, 0, 0.88)',
211
- fontSize: '13px',
216
+ fontSize: '14px',
212
217
  fontWeight: '500',
213
218
  overflow: 'hidden',
214
219
  }, children: [((_a = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _a === void 0 ? void 0 : _a.logo) ? (_jsx("img", { src: (_b = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _b === void 0 ? void 0 : _b.logo, style: {
215
220
  height: '24px',
216
221
  width: '24px',
217
- borderRadius: '4px',
218
- } })) : (_jsxs("svg", { width: "18", height: "19", viewBox: "0 0 18 19", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: {
219
- width: '24px',
222
+ borderRadius: '8px',
223
+ } })) : (_jsx("div", { style: {
224
+ transform: 'translate(4px, 3px)',
220
225
  height: '24px',
221
- }, children: [_jsx("path", { d: "M6.6234 6.17768C6.6234 4.79769 7.73338 3.66333 9.1234 3.66333C10.5134 3.66333 11.6234 4.79769 11.6234 6.17768C11.6234 7.30559 10.8798 7.89399 10.4435 8.19056C10.3054 8.28442 10.2138 8.36716 10.1499 8.45311C10.092 8.53086 10.0368 8.63774 10.0107 8.81185C9.92866 9.35801 9.41941 9.73426 8.87325 9.65224C8.3271 9.57021 7.95084 9.06096 8.03287 8.5148C8.19122 7.4605 8.81104 6.8819 9.31912 6.53656C9.47624 6.42975 9.54878 6.36136 9.58594 6.31084C9.60107 6.29027 9.60813 6.27529 9.61242 6.26261C9.61657 6.25036 9.6234 6.22488 9.6234 6.17768C9.6234 5.88426 9.39093 5.66333 9.1234 5.66333C8.85586 5.66333 8.6234 5.88426 8.6234 6.17768C8.6234 6.72996 8.17568 7.17768 7.6234 7.17768C7.07111 7.17768 6.6234 6.72996 6.6234 6.17768Z", fill: "#3C3C3C" }), _jsx("path", { d: "M7.74976 11.5C7.74976 12.1904 8.3094 12.75 8.99976 12.75C9.69011 12.75 10.2498 12.1904 10.2498 11.5C10.2498 10.8096 9.69011 10.25 8.99976 10.25C8.3094 10.25 7.74976 10.8096 7.74976 11.5Z", fill: "#3C3C3C" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.00195 2.00272e-05L15.0019 0C16.6588 -2.7418e-06 18.002 1.34314 18.002 3V13.0358C18.002 14.6926 16.6588 16.0357 15.002 16.0358L12.3757 16.0358L8.99393 18.8375L5.65157 16.0358H3.00195C1.3451 16.0358 0.00195312 14.6926 0.00195312 13.0358V3.00002C0.00195312 1.34317 1.34509 2.2769e-05 3.00195 2.00272e-05ZM15.002 2L3.00195 2.00002C2.44967 2.00002 2.00195 2.44774 2.00195 3.00002V13.0358C2.00195 13.5881 2.44967 14.0358 3.00195 14.0358H5.65157C6.12143 14.0358 6.57629 14.2012 6.93638 14.503L9.00143 16.2341L11.0997 14.4957C11.4585 14.1984 11.9098 14.0358 12.3757 14.0358L15.002 14.0358C15.5542 14.0358 16.002 13.588 16.002 13.0358V3C16.002 2.44772 15.5542 2 15.002 2Z", fill: "#3C3C3C" })] })), _jsx("span", { style: {
226
+ width: '24px',
227
+ display: 'flex',
228
+ alignItems: 'center',
229
+ justifyContent: 'center'
230
+ }, children: _jsxs("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", style: {
231
+ width: '24px',
232
+ height: '24px',
233
+ }, children: [_jsx("path", { d: "M6.6234 6.17768C6.6234 4.79769 7.73338 3.66333 9.1234 3.66333C10.5134 3.66333 11.6234 4.79769 11.6234 6.17768C11.6234 7.30559 10.8798 7.89399 10.4435 8.19056C10.3054 8.28442 10.2138 8.36716 10.1499 8.45311C10.092 8.53086 10.0368 8.63774 10.0107 8.81185C9.92866 9.35801 9.41941 9.73426 8.87325 9.65224C8.3271 9.57021 7.95084 9.06096 8.03287 8.5148C8.19122 7.4605 8.81104 6.8819 9.31912 6.53656C9.47624 6.42975 9.54878 6.36136 9.58594 6.31084C9.60107 6.29027 9.60813 6.27529 9.61242 6.26261C9.61657 6.25036 9.6234 6.22488 9.6234 6.17768C9.6234 5.88426 9.39093 5.66333 9.1234 5.66333C8.85586 5.66333 8.6234 5.88426 8.6234 6.17768C8.6234 6.72996 8.17568 7.17768 7.6234 7.17768C7.07111 7.17768 6.6234 6.72996 6.6234 6.17768Z", fill: "#3C3C3C" }), _jsx("path", { d: "M7.74976 11.5C7.74976 12.1904 8.3094 12.75 8.99976 12.75C9.69011 12.75 10.2498 12.1904 10.2498 11.5C10.2498 10.8096 9.69011 10.25 8.99976 10.25C8.3094 10.25 7.74976 10.8096 7.74976 11.5Z", fill: "#3C3C3C" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.00195 2.00272e-05L15.0019 0C16.6588 -2.7418e-06 18.002 1.34314 18.002 3V13.0358C18.002 14.6926 16.6588 16.0357 15.002 16.0358L12.3757 16.0358L8.99393 18.8375L5.65157 16.0358H3.00195C1.3451 16.0358 0.00195312 14.6926 0.00195312 13.0358V3.00002C0.00195312 1.34317 1.34509 2.2769e-05 3.00195 2.00272e-05ZM15.002 2L3.00195 2.00002C2.44967 2.00002 2.00195 2.44774 2.00195 3.00002V13.0358C2.00195 13.5881 2.44967 14.0358 3.00195 14.0358H5.65157C6.12143 14.0358 6.57629 14.2012 6.93638 14.503L9.00143 16.2341L11.0997 14.4957C11.4585 14.1984 11.9098 14.0358 12.3757 14.0358L15.002 14.0358C15.5542 14.0358 16.002 13.588 16.002 13.0358V3C16.002 2.44772 15.5542 2 15.002 2Z", fill: "#3C3C3C" })] }) })), _jsx("span", { style: {
222
234
  width: '100%',
223
235
  overflow: 'hidden',
224
236
  textOverflow: 'ellipsis'
225
237
  }, children: ((_c = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _c === void 0 ? void 0 : _c.name) || (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.host) })] }), _jsx("div", { style: {
226
- width: "24",
227
- height: "24",
228
- cursor: "pointer",
229
238
  display: 'flex',
230
- alignItems: 'center',
231
- }, onClick: () => {
232
- onClose();
233
- setTimeout(() => {
234
- showCloseDialog();
235
- }, 200);
236
- }, children: _jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.29289 7.29289C7.68342 6.90237 8.31658 6.90237 8.70711 7.29289L12 10.5858L15.2929 7.29289C15.6834 6.90237 16.3166 6.90237 16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711L13.4142 12L16.7071 15.2929C17.0976 15.6834 17.0976 16.3166 16.7071 16.7071C16.3166 17.0976 15.6834 17.0976 15.2929 16.7071L12 13.4142L8.70711 16.7071C8.31658 17.0976 7.68342 17.0976 7.29289 16.7071C6.90237 16.3166 6.90237 15.6834 7.29289 15.2929L10.5858 12L7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289Z", fill: "#BABABA" }) }) })] }), _jsx("div", { style: {
237
- background: 'rgba(0, 0, 0, 0.13)',
238
- height: '0.33px',
239
- width: '100%',
240
- } }), ((_d = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _d === void 0 ? void 0 : _d.origins.length) ? (_jsx(SecurityInfoRow, { title: i18n.dappListedBy, children: _jsx("div", { style: {
241
- display: 'flex',
242
- alignItems: 'center',
243
- gap: '2px',
244
- }, children: (_e = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _e === void 0 ? void 0 : _e.origins.map((item) => (_jsx("img", { src: item.logo, style: {
245
- width: '16px',
246
- height: '16px',
247
- } }))) }) })) : null, _jsx(SecurityRiskDetectionRow, { securityInfo: securityInfo }), ((_f = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _f === void 0 ? void 0 : _f.origins.length) ? (_jsx(SecurityInfoRow, { title: i18n.lastVerifiedAt, children: _jsx("span", { style: {
248
- fontWeight: '500',
249
- fontSize: '11.2px',
250
- color: 'rgba(0, 0, 0, 0.88)',
251
- }, children: securityInfo.updatedAt }) })) : null] }), _jsxs("div", { style: {
252
- marginTop: '8px',
253
- textAlign: 'center',
254
- padding: '8px 0',
255
- background: 'rgba(249, 249, 249, 1)',
239
+ width: '24',
240
+ height: '24',
241
+ cursor: 'pointer',
242
+ }, onClick: onClose, children: _jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.29289 7.29289C7.68342 6.90237 8.31658 6.90237 8.70711 7.29289L12 10.5858L15.2929 7.29289C15.6834 6.90237 16.3166 6.90237 16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711L13.4142 12L16.7071 15.2929C17.0976 15.6834 17.0976 16.3166 16.7071 16.7071C16.3166 17.0976 15.6834 17.0976 15.2929 16.7071L12 13.4142L8.70711 16.7071C8.31658 17.0976 7.68342 17.0976 7.29289 16.7071C6.90237 16.3166 6.90237 15.6834 7.29289 15.2929L10.5858 12L7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289Z", fill: "rgba(0, 0, 0, 0.61)" }) }) })] }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', padding: '12px 8px', gap: '12px' }, children: [((_d = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _d === void 0 ? void 0 : _d.origins.length) ? (_jsx(SecurityInfoRow, { title: i18n.dappListedBy, children: _jsx("div", { style: {
243
+ display: 'flex',
244
+ alignItems: 'center',
245
+ gap: '2px',
246
+ }, children: (_e = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _e === void 0 ? void 0 : _e.origins.map((item) => (_jsx("img", { src: item.logo, style: {
247
+ border: '1px solid rgba(0, 0, 0, 0.1)',
248
+ borderRadius: '9999px',
249
+ width: '16px',
250
+ height: '16px',
251
+ } }))) }) })) : null, _jsx(SecurityRiskDetectionRow, { securityInfo: securityInfo }), ((_f = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _f === void 0 ? void 0 : _f.origins.length) ? (_jsx(SecurityInfoRow, { title: i18n.lastVerifiedAt, children: _jsx("span", { style: {
252
+ fontWeight: '500',
253
+ fontSize: '12px',
254
+ lineHeight: '16px',
255
+ color: 'rgba(0, 0, 0, 0.88)',
256
+ }, children: securityInfo.updatedAt }) })) : null] })] }), _jsxs("div", { style: {
257
+ display: 'flex',
258
+ gap: '8px',
259
+ padding: '12px 8px',
260
+ alignItems: 'center',
261
+ justifyContent: 'center',
262
+ backgroundColor: '#F9F9F9',
256
263
  borderBottomLeftRadius: '12px',
257
- display: "flex",
258
- alignItems: "center",
259
- justifyContent: "center",
264
+ borderBottomRightRadius: '12px',
265
+ borderTop: '1px solid rgba(0, 0, 0, 0.05)',
260
266
  }, children: [_jsx("span", { style: {
267
+ flex: 1,
261
268
  color: 'rgba(0, 0, 0, 0.61)',
262
269
  fontWeight: '400',
263
- fontSize: '11.2px',
264
- }, children: "Powered by" }), _jsx(Logo, { style: {
265
- width: '12.83px',
266
- height: '12.83px',
267
- marginLeft: '5.6px',
268
- marginRight: '4.2px',
269
- verticalAlign: 'middle',
270
+ fontSize: '12px',
271
+ lineHeight: '16px',
272
+ }, children: i18n.maliciousDappWarningSourceMessage }), _jsx(Logo, { style: {
273
+ width: '14px',
274
+ height: '14px',
270
275
  } }), _jsx("span", { style: {
271
276
  color: 'rgba(0, 0, 0, 0.88)',
272
- fontWeight: '600',
273
- fontSize: '11.2px',
277
+ fontWeight: '500',
278
+ fontSize: '12px',
279
+ lineHeight: '16px',
274
280
  }, children: "OneKey" })] })] }));
275
281
  }
276
282
  function App() {
@@ -292,19 +298,21 @@ function App() {
292
298
  setSecurityInfo(result.securityInfo);
293
299
  }
294
300
  }), [isExpanded, securityInfo]);
295
- const borderStyle = useMemo(() => isExpanded
296
- ? {
297
- borderTopLeftRadius: '12px',
298
- borderBottomLeftRadius: '12px',
299
- borderTopRightRadius: '0px',
300
- borderBottomRightRadius: '0px',
301
- }
302
- : {
303
- boxShadow: '0px 8.57px 17.14px 0px rgba(0, 0, 0, 0.09)',
304
- transition: 'transform 0.3s ease-in-out',
305
- borderRadius: '100px',
306
- }, [isExpanded]);
307
- return (_jsxs("div", { id: containerId, style: Object.assign({ position: 'fixed', zIndex: 999999, bottom: '25%', right: '-146px', background: 'rgba(255, 255, 255, 1)', borderWidth: '0.33px', borderColor: 'rgba(0, 0, 0, 0.13)', borderStyle: 'solid', boxShadow: '0px 8.57px 17.14px 0px rgba(0, 0, 0, 0.09)', transition: 'transform 0.3s ease-in-out', transform: isExpanded ? 'translateX(-146px)' : 'translateX(0)' }, borderStyle), children: [showSecurityInfo && securityInfo ? (_jsx(SecurityInfo, { securityInfo: securityInfo, showCloseDialog: handleShowCloseDialog, onClose: () => {
301
+ return (_jsxs("div", { id: containerId, style: {
302
+ position: 'fixed',
303
+ zIndex: 999999,
304
+ bottom: '25%',
305
+ right: '0px',
306
+ width: '256px',
307
+ background: '#fff',
308
+ borderRadius: '12px',
309
+ transition: 'all 150ms cubic-bezier(0.4, 0, 0.2, 1)',
310
+ boxShadow: '0px 0px 0px 1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',
311
+ transform: isExpanded ? 'translateX(-20px)' : 'translateX(216px)',
312
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
313
+ WebkitTextSizeAdjust: '100%',
314
+ fontSmooth: 'antialiased',
315
+ }, children: [showSecurityInfo && securityInfo ? (_jsx(SecurityInfo, { securityInfo: securityInfo, onClose: () => {
308
316
  setIsExpanded(false);
309
317
  setIsShowSecurityInfo(false);
310
318
  } })) : (_jsx(IconButton, { onClick: handleClick, isExpanded: isExpanded, isShowCloseDialog: showCloseDialog, showCloseDialog: handleShowCloseDialog, dataLoaded: !!securityInfo })), !isExpanded && showCloseDialog && (_jsx(CloseDialog, { onClose: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/inpage-providers-hub",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -30,26 +30,26 @@
30
30
  "start": "tsc --watch"
31
31
  },
32
32
  "dependencies": {
33
- "@onekeyfe/cross-inpage-provider-core": "2.2.1",
34
- "@onekeyfe/cross-inpage-provider-types": "2.2.1",
35
- "@onekeyfe/onekey-algo-provider": "2.2.1",
36
- "@onekeyfe/onekey-alph-provider": "2.2.1",
37
- "@onekeyfe/onekey-aptos-provider": "2.2.1",
38
- "@onekeyfe/onekey-bfc-provider": "2.2.1",
39
- "@onekeyfe/onekey-btc-provider": "2.2.1",
40
- "@onekeyfe/onekey-cardano-provider": "2.2.1",
41
- "@onekeyfe/onekey-conflux-provider": "2.2.1",
42
- "@onekeyfe/onekey-cosmos-provider": "2.2.1",
43
- "@onekeyfe/onekey-eth-provider": "2.2.1",
44
- "@onekeyfe/onekey-nostr-provider": "2.2.1",
45
- "@onekeyfe/onekey-polkadot-provider": "2.2.1",
46
- "@onekeyfe/onekey-private-provider": "2.2.1",
47
- "@onekeyfe/onekey-scdo-provider": "2.2.1",
48
- "@onekeyfe/onekey-solana-provider": "2.2.1",
49
- "@onekeyfe/onekey-sui-provider": "2.2.1",
50
- "@onekeyfe/onekey-ton-provider": "2.2.1",
51
- "@onekeyfe/onekey-tron-provider": "2.2.1",
52
- "@onekeyfe/onekey-webln-provider": "2.2.1",
33
+ "@onekeyfe/cross-inpage-provider-core": "2.2.3",
34
+ "@onekeyfe/cross-inpage-provider-types": "2.2.3",
35
+ "@onekeyfe/onekey-algo-provider": "2.2.3",
36
+ "@onekeyfe/onekey-alph-provider": "2.2.3",
37
+ "@onekeyfe/onekey-aptos-provider": "2.2.3",
38
+ "@onekeyfe/onekey-bfc-provider": "2.2.3",
39
+ "@onekeyfe/onekey-btc-provider": "2.2.3",
40
+ "@onekeyfe/onekey-cardano-provider": "2.2.3",
41
+ "@onekeyfe/onekey-conflux-provider": "2.2.3",
42
+ "@onekeyfe/onekey-cosmos-provider": "2.2.3",
43
+ "@onekeyfe/onekey-eth-provider": "2.2.3",
44
+ "@onekeyfe/onekey-nostr-provider": "2.2.3",
45
+ "@onekeyfe/onekey-polkadot-provider": "2.2.3",
46
+ "@onekeyfe/onekey-private-provider": "2.2.3",
47
+ "@onekeyfe/onekey-scdo-provider": "2.2.3",
48
+ "@onekeyfe/onekey-solana-provider": "2.2.3",
49
+ "@onekeyfe/onekey-sui-provider": "2.2.3",
50
+ "@onekeyfe/onekey-ton-provider": "2.2.3",
51
+ "@onekeyfe/onekey-tron-provider": "2.2.3",
52
+ "@onekeyfe/onekey-webln-provider": "2.2.3",
53
53
  "preact": "^10.25.1",
54
54
  "web3": "^1.7.3"
55
55
  },
@@ -58,5 +58,5 @@
58
58
  "@types/node": "^20.12.7",
59
59
  "playwright": "^1.43.1"
60
60
  },
61
- "gitHead": "00563062ab442fa313c5c6428e9ad05b93ee0950"
61
+ "gitHead": "92771cee3c1af62a38b945a4f96a33649aee591f"
62
62
  }