@onekeyfe/inpage-providers-hub 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,24 +18,24 @@ 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';
30
- const removeApp = () => {
30
+ const removeIcon = () => {
31
31
  var _a;
32
32
  (_a = document.getElementById(containerId)) === null || _a === void 0 ? void 0 : _a.remove();
33
+ isInjected = false;
33
34
  };
34
35
  const useOutsideClick = (ref, callback) => {
35
36
  (0, hooks_1.useEffect)(() => {
36
37
  const handleClickOutside = (event) => {
37
- if (ref.current &&
38
- !ref.current.contains(event.target)) {
38
+ if (ref.current && !ref.current.contains(event.target)) {
39
39
  callback();
40
40
  }
41
41
  };
@@ -52,40 +52,46 @@ function CloseDialog({ onClose }) {
52
52
  void globalThis.$onekey.$private.request({
53
53
  method: 'wallet_disableFloatingButton',
54
54
  });
55
- removeApp();
55
+ removeIcon();
56
56
  }, []);
57
57
  const handleHideOnSite = (0, hooks_1.useCallback)(() => {
58
58
  void globalThis.$onekey.$private.request({
59
59
  method: 'wallet_hideFloatingButtonOnSite',
60
60
  params: { url: window.location.origin },
61
61
  });
62
- removeApp();
62
+ removeIcon();
63
63
  }, []);
64
64
  return ((0, jsx_runtime_1.jsxs)("div", { style: {
65
- background: 'rgba(255, 255, 255, 1)',
66
- padding: '14px',
65
+ display: 'flex',
66
+ flexDirection: 'column',
67
+ gap: '8px',
68
+ padding: '12px',
67
69
  position: 'absolute',
68
- right: '134px',
69
- border: '1px rgba(0, 0, 0, 0.13) solid',
70
- top: '60px',
71
- width: '170px',
72
- borderRadius: '15px',
73
- }, ref: dialogRef, children: [(0, jsx_runtime_1.jsx)("div", { style: {
74
- color: 'rgba(0, 0, 0, 1)',
75
- fontSize: '12px',
76
- 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',
77
82
  cursor: 'pointer',
78
- }, onClick: handleHideOnSite, children: i18n.hideOnThisSite }), (0, jsx_runtime_1.jsx)("div", { style: {
79
- marginTop: '4px',
80
- marginBottom: '8px',
81
- color: 'rgba(0, 0, 0, 1)',
82
- fontSize: '12px',
83
- 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',
84
87
  cursor: 'pointer',
85
- }, onClick: handleDisable, children: i18n.disable }), (0, jsx_runtime_1.jsx)("div", { style: {
86
- color: 'rgb(156, 156, 156)',
87
- fontSize: '10px',
88
- fontWeight: '400',
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.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
+ paddingTop: '8px',
94
+ borderTop: '1px solid rgba(0, 0, 0, 0.05)',
89
95
  }, children: i18n.canBeReEnabledInSettings })] }));
90
96
  }
91
97
  function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCloseDialog, }) {
@@ -93,10 +99,8 @@ function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCl
93
99
  return ((0, jsx_runtime_1.jsxs)("div", { style: {
94
100
  display: 'flex',
95
101
  alignItems: 'center',
96
- width: '184px',
97
102
  position: 'relative',
98
103
  cursor: 'pointer',
99
- padding: '8px',
100
104
  }, onMouseEnter: () => {
101
105
  if (isExpanded || isShowCloseDialog) {
102
106
  return;
@@ -108,32 +112,36 @@ function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCl
108
112
  }
109
113
  setIsShowCloseButton(false);
110
114
  onClick();
111
- }, 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: {
115
+ }, 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: {
116
+ display: 'flex',
117
+ padding: '$4',
112
118
  position: 'absolute',
113
- left: '0px',
119
+ left: '-6px',
114
120
  bottom: '-10px',
121
+ transition: 'all 150ms cubic-bezier(0.4, 0, 0.2, 1)',
115
122
  opacity: showCloseButton ? 1 : 0,
123
+ borderRadius: '9999px',
124
+ backgroundColor: '#fff',
125
+ border: '1px solid rgba(0, 0, 0, 0.1)',
116
126
  }, onClick: (event) => {
117
127
  event.stopPropagation();
118
128
  setIsShowCloseButton(false);
119
129
  showCloseDialog();
120
- }, 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" }) }) })] }));
130
+ }, 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)" }) }) })] }));
121
131
  }
122
- function SecurityInfoRow({ title, children, }) {
132
+ function SecurityInfoRow({ title, children }) {
123
133
  return ((0, jsx_runtime_1.jsxs)("div", { style: {
124
134
  display: 'flex',
125
- height: '16px',
126
135
  flexDirection: 'row',
127
136
  justifyContent: 'space-between',
128
137
  alignItems: 'center',
129
- padding: '0 8px',
130
138
  }, children: [(0, jsx_runtime_1.jsx)("span", { style: {
131
139
  color: 'rgba(0, 0, 0, 0.61)',
132
- fontWeight: '500',
133
- fontSize: '11.2px',
140
+ fontSize: '12px',
141
+ lineHeight: '16px',
134
142
  }, children: title }), children] }));
135
143
  }
136
- function SecurityRiskDetectionRow({ securityInfo, }) {
144
+ function SecurityRiskDetectionRow({ securityInfo }) {
137
145
  const { securityElement, securityStatus } = (0, hooks_1.useMemo)(() => {
138
146
  const security = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === type_1.EHostSecurityLevel.Security).map((item) => item.name).join(' & ')) || '';
139
147
  if (security) {
@@ -142,8 +150,9 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
142
150
  securityElement: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { style: {
143
151
  color: 'rgba(0, 0, 0, 0.88)',
144
152
  fontWeight: '500',
145
- fontSize: '11.2px',
146
- }, 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" }) })] })),
153
+ fontSize: '12px',
154
+ lineHeight: '16px',
155
+ }, 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" }) })] })),
147
156
  };
148
157
  }
149
158
  const highSecurity = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === type_1.EHostSecurityLevel.High).map((item) => item.name).join(' & ')) || '';
@@ -153,7 +162,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
153
162
  securityElement: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { style: {
154
163
  color: 'rgba(0, 0, 0, 0.88)',
155
164
  fontWeight: '500',
156
- fontSize: '11.2px',
165
+ fontSize: '12px',
166
+ lineHeight: '16px',
157
167
  }, 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" }) })] })),
158
168
  };
159
169
  }
@@ -164,7 +174,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
164
174
  securityElement: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { style: {
165
175
  color: 'rgba(0, 0, 0, 0.88)',
166
176
  fontWeight: '500',
167
- fontSize: '11.2px',
177
+ fontSize: '12px',
178
+ lineHeight: '16px',
168
179
  }, 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" }) })] })),
169
180
  };
170
181
  }
@@ -173,7 +184,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
173
184
  securityElement: ((0, jsx_runtime_1.jsx)("span", { style: {
174
185
  color: 'rgba(0, 0, 0, 0.88)',
175
186
  fontWeight: '500',
176
- fontSize: '11.2px',
187
+ fontSize: '12px',
188
+ lineHeight: '16px',
177
189
  }, children: i18n.unknown })),
178
190
  };
179
191
  }, [securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources]);
@@ -190,82 +202,84 @@ function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
190
202
  return ((0, jsx_runtime_1.jsxs)("div", { ref: viewRef, style: {
191
203
  display: 'flex',
192
204
  flexDirection: 'column',
193
- width: '234px',
194
- borderTopLeftRadius: '12px',
195
- borderBottomLeftRadius: '12px',
196
- paddingTop: '8px',
197
205
  }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
198
206
  display: 'flex',
199
207
  flexDirection: 'column',
200
- gap: '8px',
201
208
  }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
202
- padding: '0 8px',
209
+ padding: '8px',
203
210
  display: 'flex',
204
211
  alignItems: 'center',
205
212
  flexDirection: 'row',
206
213
  justifyContent: 'space-between',
214
+ borderBottom: '1px solid rgba(0, 0, 0, 0.05)',
207
215
  }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
208
216
  display: 'flex',
209
217
  flexDirection: 'row',
210
218
  alignItems: 'center',
211
219
  gap: '8px',
212
220
  color: 'rgba(0, 0, 0, 0.88)',
213
- fontSize: '13px',
221
+ fontSize: '14px',
214
222
  fontWeight: '500',
223
+ overflow: 'hidden',
215
224
  }, 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: {
216
225
  height: '24px',
217
226
  width: '24px',
218
- borderRadius: '4px',
219
- } })) : ((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: {
227
+ borderRadius: '8px',
228
+ } })) : ((0, jsx_runtime_1.jsxs)("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", style: {
220
229
  width: '24px',
221
230
  height: '24px',
222
- }, 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" })] })), ((_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: {
223
- width: "24",
224
- height: "24",
225
- cursor: "pointer"
231
+ }, 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: {
232
+ width: '100%',
233
+ overflow: 'hidden',
234
+ textOverflow: 'ellipsis'
235
+ }, 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: {
236
+ display: 'flex',
237
+ width: '24',
238
+ height: '24',
239
+ cursor: 'pointer',
226
240
  }, onClick: () => {
227
241
  onClose();
228
242
  setTimeout(() => {
229
243
  showCloseDialog();
230
244
  }, 200);
231
- }, 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: {
232
- background: 'rgba(0, 0, 0, 0.13)',
233
- height: '0.33px',
234
- width: '100%',
235
- } }), ((_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: {
236
- display: 'flex',
237
- alignItems: 'center',
238
- gap: '2px',
239
- }, 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: {
240
- width: '16px',
241
- height: '16px',
242
- } }))) }) })) : 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: {
243
- fontWeight: '500',
244
- fontSize: '11.2px',
245
- color: 'rgba(0, 0, 0, 0.88)',
246
- }, children: securityInfo.updatedAt }) })) : null] }), (0, jsx_runtime_1.jsxs)("div", { style: {
247
- marginTop: '8px',
248
- textAlign: 'center',
249
- padding: '8px 0',
250
- background: 'rgba(249, 249, 249, 1)',
245
+ }, 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',
251
266
  borderBottomLeftRadius: '12px',
252
- display: "flex",
253
- alignItems: "center",
254
- justifyContent: "center",
267
+ borderBottomRightRadius: '12px',
268
+ borderTop: '1px solid rgba(0, 0, 0, 0.05)',
255
269
  }, children: [(0, jsx_runtime_1.jsx)("span", { style: {
270
+ flex: 1,
256
271
  color: 'rgba(0, 0, 0, 0.61)',
257
272
  fontWeight: '400',
258
- fontSize: '11.2px',
273
+ fontSize: '12px',
274
+ lineHeight: '16px',
259
275
  }, children: "Powered by" }), (0, jsx_runtime_1.jsx)(images_1.Logo, { style: {
260
- width: '12.83px',
261
- height: '12.83px',
262
- marginLeft: '5.6px',
263
- marginRight: '4.2px',
264
- verticalAlign: 'middle',
276
+ width: '14px',
277
+ height: '14px',
265
278
  } }), (0, jsx_runtime_1.jsx)("span", { style: {
266
279
  color: 'rgba(0, 0, 0, 0.88)',
267
- fontWeight: '600',
268
- fontSize: '11.2px',
280
+ fontWeight: '500',
281
+ fontSize: '12px',
282
+ lineHeight: '16px',
269
283
  }, children: "OneKey" })] })] }));
270
284
  }
271
285
  function App() {
@@ -287,26 +301,28 @@ function App() {
287
301
  setSecurityInfo(result.securityInfo);
288
302
  }
289
303
  }), [isExpanded, securityInfo]);
290
- const borderStyle = (0, hooks_1.useMemo)(() => isExpanded
291
- ? {
292
- borderTopLeftRadius: '12px',
293
- borderBottomLeftRadius: '12px',
294
- borderTopRightRadius: '0px',
295
- borderBottomRightRadius: '0px',
296
- }
297
- : {
298
- boxShadow: '0px 8.57px 17.14px 0px rgba(0, 0, 0, 0.09)',
299
- transition: 'transform 0.3s ease-in-out',
300
- borderRadius: '100px',
301
- }, [isExpanded]);
302
- return ((0, jsx_runtime_1.jsxs)("div", { id: containerId, style: Object.assign({ position: 'fixed', zIndex: 999999, top: '20%', 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
+ top: '75%',
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, showCloseDialog: handleShowCloseDialog, onClose: () => {
303
319
  setIsExpanded(false);
304
320
  setIsShowSecurityInfo(false);
305
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: () => {
306
322
  setIsShowCloseDialog(false);
307
323
  } }))] }));
308
324
  }
309
- function injectFloatingButton() {
325
+ function injectIcon() {
310
326
  return __awaiter(this, void 0, void 0, function* () {
311
327
  const { isShow, i18n: i18nResponse } = yield globalThis.$onekey.$private.request({
312
328
  method: 'wallet_isShowFloatingButton',
@@ -328,3 +344,14 @@ function injectFloatingButton() {
328
344
  (0, preact_1.render)((0, jsx_runtime_1.jsx)(App, {}), document.body, div);
329
345
  });
330
346
  }
347
+ function injectFloatingButton() {
348
+ globalThis.$onekey.$private.onNotifyFloatingIconChanged(({ showFloatingIcon }) => {
349
+ if (showFloatingIcon) {
350
+ void injectIcon();
351
+ }
352
+ else {
353
+ removeIcon();
354
+ }
355
+ });
356
+ void injectIcon();
357
+ }
@@ -1 +1 @@
1
- export declare function injectFloatingButton(): Promise<void>;
1
+ export declare function injectFloatingButton(): void;
@@ -10,29 +10,29 @@ 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';
27
- const removeApp = () => {
27
+ const removeIcon = () => {
28
28
  var _a;
29
29
  (_a = document.getElementById(containerId)) === null || _a === void 0 ? void 0 : _a.remove();
30
+ isInjected = false;
30
31
  };
31
32
  const useOutsideClick = (ref, callback) => {
32
33
  useEffect(() => {
33
34
  const handleClickOutside = (event) => {
34
- if (ref.current &&
35
- !ref.current.contains(event.target)) {
35
+ if (ref.current && !ref.current.contains(event.target)) {
36
36
  callback();
37
37
  }
38
38
  };
@@ -49,40 +49,46 @@ function CloseDialog({ onClose }) {
49
49
  void globalThis.$onekey.$private.request({
50
50
  method: 'wallet_disableFloatingButton',
51
51
  });
52
- removeApp();
52
+ removeIcon();
53
53
  }, []);
54
54
  const handleHideOnSite = useCallback(() => {
55
55
  void globalThis.$onekey.$private.request({
56
56
  method: 'wallet_hideFloatingButtonOnSite',
57
57
  params: { url: window.location.origin },
58
58
  });
59
- removeApp();
59
+ removeIcon();
60
60
  }, []);
61
61
  return (_jsxs("div", { style: {
62
- background: 'rgba(255, 255, 255, 1)',
63
- padding: '14px',
62
+ display: 'flex',
63
+ flexDirection: 'column',
64
+ gap: '8px',
65
+ padding: '12px',
64
66
  position: 'absolute',
65
- right: '134px',
66
- border: '1px rgba(0, 0, 0, 0.13) solid',
67
- top: '60px',
68
- width: '170px',
69
- borderRadius: '15px',
70
- }, ref: dialogRef, children: [_jsx("div", { style: {
71
- color: 'rgba(0, 0, 0, 1)',
72
- fontSize: '12px',
73
- 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',
74
79
  cursor: 'pointer',
75
- }, onClick: handleHideOnSite, children: i18n.hideOnThisSite }), _jsx("div", { style: {
76
- marginTop: '4px',
77
- marginBottom: '8px',
78
- color: 'rgba(0, 0, 0, 1)',
79
- fontSize: '12px',
80
- 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',
81
84
  cursor: 'pointer',
82
- }, onClick: handleDisable, children: i18n.disable }), _jsx("div", { style: {
83
- color: 'rgb(156, 156, 156)',
84
- fontSize: '10px',
85
- fontWeight: '400',
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)" }) }), _jsx("div", { children: i18n.disable })] }), _jsx("div", { style: {
87
+ color: 'rgba(0, 0, 0, 0.61)',
88
+ fontSize: '12px',
89
+ lineHeight: '16px',
90
+ paddingTop: '8px',
91
+ borderTop: '1px solid rgba(0, 0, 0, 0.05)',
86
92
  }, children: i18n.canBeReEnabledInSettings })] }));
87
93
  }
88
94
  function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCloseDialog, }) {
@@ -90,10 +96,8 @@ function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCl
90
96
  return (_jsxs("div", { style: {
91
97
  display: 'flex',
92
98
  alignItems: 'center',
93
- width: '184px',
94
99
  position: 'relative',
95
100
  cursor: 'pointer',
96
- padding: '8px',
97
101
  }, onMouseEnter: () => {
98
102
  if (isExpanded || isShowCloseDialog) {
99
103
  return;
@@ -105,32 +109,36 @@ function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCl
105
109
  }
106
110
  setIsShowCloseButton(false);
107
111
  onClick();
108
- }, children: [_jsx(Logo, { style: logoStyle }), !dataLoaded && (_jsx("span", { style: textStyle, children: isExpanded ? i18n.fetchingDAppInfo : '' })), _jsx("div", { style: {
112
+ }, 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: {
113
+ display: 'flex',
114
+ padding: '$4',
109
115
  position: 'absolute',
110
- left: '0px',
116
+ left: '-6px',
111
117
  bottom: '-10px',
118
+ transition: 'all 150ms cubic-bezier(0.4, 0, 0.2, 1)',
112
119
  opacity: showCloseButton ? 1 : 0,
120
+ borderRadius: '9999px',
121
+ backgroundColor: '#fff',
122
+ border: '1px solid rgba(0, 0, 0, 0.1)',
113
123
  }, onClick: (event) => {
114
124
  event.stopPropagation();
115
125
  setIsShowCloseButton(false);
116
126
  showCloseDialog();
117
- }, 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" }) }) })] }));
127
+ }, 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)" }) }) })] }));
118
128
  }
119
- function SecurityInfoRow({ title, children, }) {
129
+ function SecurityInfoRow({ title, children }) {
120
130
  return (_jsxs("div", { style: {
121
131
  display: 'flex',
122
- height: '16px',
123
132
  flexDirection: 'row',
124
133
  justifyContent: 'space-between',
125
134
  alignItems: 'center',
126
- padding: '0 8px',
127
135
  }, children: [_jsx("span", { style: {
128
136
  color: 'rgba(0, 0, 0, 0.61)',
129
- fontWeight: '500',
130
- fontSize: '11.2px',
137
+ fontSize: '12px',
138
+ lineHeight: '16px',
131
139
  }, children: title }), children] }));
132
140
  }
133
- function SecurityRiskDetectionRow({ securityInfo, }) {
141
+ function SecurityRiskDetectionRow({ securityInfo }) {
134
142
  const { securityElement, securityStatus } = useMemo(() => {
135
143
  const security = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === EHostSecurityLevel.Security).map((item) => item.name).join(' & ')) || '';
136
144
  if (security) {
@@ -139,8 +147,9 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
139
147
  securityElement: (_jsxs(_Fragment, { children: [_jsx("span", { style: {
140
148
  color: 'rgba(0, 0, 0, 0.88)',
141
149
  fontWeight: '500',
142
- fontSize: '11.2px',
143
- }, 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" }) })] })),
150
+ fontSize: '12px',
151
+ lineHeight: '16px',
152
+ }, 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" }) })] })),
144
153
  };
145
154
  }
146
155
  const highSecurity = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === EHostSecurityLevel.High).map((item) => item.name).join(' & ')) || '';
@@ -150,7 +159,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
150
159
  securityElement: (_jsxs(_Fragment, { children: [_jsx("span", { style: {
151
160
  color: 'rgba(0, 0, 0, 0.88)',
152
161
  fontWeight: '500',
153
- fontSize: '11.2px',
162
+ fontSize: '12px',
163
+ lineHeight: '16px',
154
164
  }, 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" }) })] })),
155
165
  };
156
166
  }
@@ -161,7 +171,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
161
171
  securityElement: (_jsxs(_Fragment, { children: [_jsx("span", { style: {
162
172
  color: 'rgba(0, 0, 0, 0.88)',
163
173
  fontWeight: '500',
164
- fontSize: '11.2px',
174
+ fontSize: '12px',
175
+ lineHeight: '16px',
165
176
  }, 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" }) })] })),
166
177
  };
167
178
  }
@@ -170,7 +181,8 @@ function SecurityRiskDetectionRow({ securityInfo, }) {
170
181
  securityElement: (_jsx("span", { style: {
171
182
  color: 'rgba(0, 0, 0, 0.88)',
172
183
  fontWeight: '500',
173
- fontSize: '11.2px',
184
+ fontSize: '12px',
185
+ lineHeight: '16px',
174
186
  }, children: i18n.unknown })),
175
187
  };
176
188
  }, [securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources]);
@@ -187,82 +199,84 @@ function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
187
199
  return (_jsxs("div", { ref: viewRef, style: {
188
200
  display: 'flex',
189
201
  flexDirection: 'column',
190
- width: '234px',
191
- borderTopLeftRadius: '12px',
192
- borderBottomLeftRadius: '12px',
193
- paddingTop: '8px',
194
202
  }, children: [_jsxs("div", { style: {
195
203
  display: 'flex',
196
204
  flexDirection: 'column',
197
- gap: '8px',
198
205
  }, children: [_jsxs("div", { style: {
199
- padding: '0 8px',
206
+ padding: '8px',
200
207
  display: 'flex',
201
208
  alignItems: 'center',
202
209
  flexDirection: 'row',
203
210
  justifyContent: 'space-between',
211
+ borderBottom: '1px solid rgba(0, 0, 0, 0.05)',
204
212
  }, children: [_jsxs("div", { style: {
205
213
  display: 'flex',
206
214
  flexDirection: 'row',
207
215
  alignItems: 'center',
208
216
  gap: '8px',
209
217
  color: 'rgba(0, 0, 0, 0.88)',
210
- fontSize: '13px',
218
+ fontSize: '14px',
211
219
  fontWeight: '500',
220
+ overflow: 'hidden',
212
221
  }, 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: {
213
222
  height: '24px',
214
223
  width: '24px',
215
- borderRadius: '4px',
216
- } })) : (_jsxs("svg", { width: "18", height: "19", viewBox: "0 0 18 19", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: {
224
+ borderRadius: '8px',
225
+ } })) : (_jsxs("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", style: {
217
226
  width: '24px',
218
227
  height: '24px',
219
- }, 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" })] })), ((_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: {
220
- width: "24",
221
- height: "24",
222
- cursor: "pointer"
228
+ }, 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: {
229
+ width: '100%',
230
+ overflow: 'hidden',
231
+ textOverflow: 'ellipsis'
232
+ }, 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: {
233
+ display: 'flex',
234
+ width: '24',
235
+ height: '24',
236
+ cursor: 'pointer',
223
237
  }, onClick: () => {
224
238
  onClose();
225
239
  setTimeout(() => {
226
240
  showCloseDialog();
227
241
  }, 200);
228
- }, 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: {
229
- background: 'rgba(0, 0, 0, 0.13)',
230
- height: '0.33px',
231
- width: '100%',
232
- } }), ((_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: {
233
- display: 'flex',
234
- alignItems: 'center',
235
- gap: '2px',
236
- }, 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: {
237
- width: '16px',
238
- height: '16px',
239
- } }))) }) })) : 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: {
240
- fontWeight: '500',
241
- fontSize: '11.2px',
242
- color: 'rgba(0, 0, 0, 0.88)',
243
- }, children: securityInfo.updatedAt }) })) : null] }), _jsxs("div", { style: {
244
- marginTop: '8px',
245
- textAlign: 'center',
246
- padding: '8px 0',
247
- background: 'rgba(249, 249, 249, 1)',
242
+ }, 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',
248
263
  borderBottomLeftRadius: '12px',
249
- display: "flex",
250
- alignItems: "center",
251
- justifyContent: "center",
264
+ borderBottomRightRadius: '12px',
265
+ borderTop: '1px solid rgba(0, 0, 0, 0.05)',
252
266
  }, children: [_jsx("span", { style: {
267
+ flex: 1,
253
268
  color: 'rgba(0, 0, 0, 0.61)',
254
269
  fontWeight: '400',
255
- fontSize: '11.2px',
270
+ fontSize: '12px',
271
+ lineHeight: '16px',
256
272
  }, children: "Powered by" }), _jsx(Logo, { style: {
257
- width: '12.83px',
258
- height: '12.83px',
259
- marginLeft: '5.6px',
260
- marginRight: '4.2px',
261
- verticalAlign: 'middle',
273
+ width: '14px',
274
+ height: '14px',
262
275
  } }), _jsx("span", { style: {
263
276
  color: 'rgba(0, 0, 0, 0.88)',
264
- fontWeight: '600',
265
- fontSize: '11.2px',
277
+ fontWeight: '500',
278
+ fontSize: '12px',
279
+ lineHeight: '16px',
266
280
  }, children: "OneKey" })] })] }));
267
281
  }
268
282
  function App() {
@@ -284,26 +298,28 @@ function App() {
284
298
  setSecurityInfo(result.securityInfo);
285
299
  }
286
300
  }), [isExpanded, securityInfo]);
287
- const borderStyle = useMemo(() => isExpanded
288
- ? {
289
- borderTopLeftRadius: '12px',
290
- borderBottomLeftRadius: '12px',
291
- borderTopRightRadius: '0px',
292
- borderBottomRightRadius: '0px',
293
- }
294
- : {
295
- boxShadow: '0px 8.57px 17.14px 0px rgba(0, 0, 0, 0.09)',
296
- transition: 'transform 0.3s ease-in-out',
297
- borderRadius: '100px',
298
- }, [isExpanded]);
299
- return (_jsxs("div", { id: containerId, style: Object.assign({ position: 'fixed', zIndex: 999999, top: '20%', 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
+ top: '75%',
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, showCloseDialog: handleShowCloseDialog, onClose: () => {
300
316
  setIsExpanded(false);
301
317
  setIsShowSecurityInfo(false);
302
318
  } })) : (_jsx(IconButton, { onClick: handleClick, isExpanded: isExpanded, isShowCloseDialog: showCloseDialog, showCloseDialog: handleShowCloseDialog, dataLoaded: !!securityInfo })), !isExpanded && showCloseDialog && (_jsx(CloseDialog, { onClose: () => {
303
319
  setIsShowCloseDialog(false);
304
320
  } }))] }));
305
321
  }
306
- export function injectFloatingButton() {
322
+ function injectIcon() {
307
323
  return __awaiter(this, void 0, void 0, function* () {
308
324
  const { isShow, i18n: i18nResponse } = yield globalThis.$onekey.$private.request({
309
325
  method: 'wallet_isShowFloatingButton',
@@ -325,3 +341,14 @@ export function injectFloatingButton() {
325
341
  render(_jsx(App, {}), document.body, div);
326
342
  });
327
343
  }
344
+ export function injectFloatingButton() {
345
+ globalThis.$onekey.$private.onNotifyFloatingIconChanged(({ showFloatingIcon }) => {
346
+ if (showFloatingIcon) {
347
+ void injectIcon();
348
+ }
349
+ else {
350
+ removeIcon();
351
+ }
352
+ });
353
+ void injectIcon();
354
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/inpage-providers-hub",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
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.0",
34
- "@onekeyfe/cross-inpage-provider-types": "2.2.0",
35
- "@onekeyfe/onekey-algo-provider": "2.2.0",
36
- "@onekeyfe/onekey-alph-provider": "2.2.0",
37
- "@onekeyfe/onekey-aptos-provider": "2.2.0",
38
- "@onekeyfe/onekey-bfc-provider": "2.2.0",
39
- "@onekeyfe/onekey-btc-provider": "2.2.0",
40
- "@onekeyfe/onekey-cardano-provider": "2.2.0",
41
- "@onekeyfe/onekey-conflux-provider": "2.2.0",
42
- "@onekeyfe/onekey-cosmos-provider": "2.2.0",
43
- "@onekeyfe/onekey-eth-provider": "2.2.0",
44
- "@onekeyfe/onekey-nostr-provider": "2.2.0",
45
- "@onekeyfe/onekey-polkadot-provider": "2.2.0",
46
- "@onekeyfe/onekey-private-provider": "2.2.0",
47
- "@onekeyfe/onekey-scdo-provider": "2.2.0",
48
- "@onekeyfe/onekey-solana-provider": "2.2.0",
49
- "@onekeyfe/onekey-sui-provider": "2.2.0",
50
- "@onekeyfe/onekey-ton-provider": "2.2.0",
51
- "@onekeyfe/onekey-tron-provider": "2.2.0",
52
- "@onekeyfe/onekey-webln-provider": "2.2.0",
33
+ "@onekeyfe/cross-inpage-provider-core": "2.2.2",
34
+ "@onekeyfe/cross-inpage-provider-types": "2.2.2",
35
+ "@onekeyfe/onekey-algo-provider": "2.2.2",
36
+ "@onekeyfe/onekey-alph-provider": "2.2.2",
37
+ "@onekeyfe/onekey-aptos-provider": "2.2.2",
38
+ "@onekeyfe/onekey-bfc-provider": "2.2.2",
39
+ "@onekeyfe/onekey-btc-provider": "2.2.2",
40
+ "@onekeyfe/onekey-cardano-provider": "2.2.2",
41
+ "@onekeyfe/onekey-conflux-provider": "2.2.2",
42
+ "@onekeyfe/onekey-cosmos-provider": "2.2.2",
43
+ "@onekeyfe/onekey-eth-provider": "2.2.2",
44
+ "@onekeyfe/onekey-nostr-provider": "2.2.2",
45
+ "@onekeyfe/onekey-polkadot-provider": "2.2.2",
46
+ "@onekeyfe/onekey-private-provider": "2.2.2",
47
+ "@onekeyfe/onekey-scdo-provider": "2.2.2",
48
+ "@onekeyfe/onekey-solana-provider": "2.2.2",
49
+ "@onekeyfe/onekey-sui-provider": "2.2.2",
50
+ "@onekeyfe/onekey-ton-provider": "2.2.2",
51
+ "@onekeyfe/onekey-tron-provider": "2.2.2",
52
+ "@onekeyfe/onekey-webln-provider": "2.2.2",
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": "13b468b24dc8c075cd088d152c11a4b6c7c20dd2"
61
+ "gitHead": "c8e8c48be31f7ab33e4f38edd2cb5230a085563b"
62
62
  }