@onekeyfe/inpage-providers-hub 2.2.2 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/floatingButton/index.js +24 -20
- package/dist/floatingButton/index.js +24 -20
- package/package.json +22 -22
|
@@ -86,13 +86,11 @@ function CloseDialog({ onClose }) {
|
|
|
86
86
|
alignItems: 'center',
|
|
87
87
|
cursor: 'pointer',
|
|
88
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 })
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
borderTop: '1px solid rgba(0, 0, 0, 0.05)',
|
|
95
|
-
}, children: i18n.canBeReEnabledInSettings })] }));
|
|
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 })] })] })] }));
|
|
96
94
|
}
|
|
97
95
|
function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCloseDialog, }) {
|
|
98
96
|
const [showCloseButton, setIsShowCloseButton] = (0, hooks_1.useState)(false);
|
|
@@ -195,7 +193,7 @@ function SecurityRiskDetectionRow({ securityInfo }) {
|
|
|
195
193
|
gap: '3.2px',
|
|
196
194
|
}, children: securityElement }) }));
|
|
197
195
|
}
|
|
198
|
-
function SecurityInfo({ securityInfo, onClose,
|
|
196
|
+
function SecurityInfo({ securityInfo, onClose, }) {
|
|
199
197
|
var _a, _b, _c, _d, _e, _f;
|
|
200
198
|
const viewRef = (0, hooks_1.useRef)(null);
|
|
201
199
|
useOutsideClick(viewRef, onClose);
|
|
@@ -225,10 +223,17 @@ function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
|
|
|
225
223
|
height: '24px',
|
|
226
224
|
width: '24px',
|
|
227
225
|
borderRadius: '8px',
|
|
228
|
-
} })) : ((0, jsx_runtime_1.
|
|
229
|
-
|
|
226
|
+
} })) : ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
227
|
+
transform: 'translate(4px, 3px)',
|
|
230
228
|
height: '24px',
|
|
231
|
-
|
|
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: {
|
|
232
237
|
width: '100%',
|
|
233
238
|
overflow: 'hidden',
|
|
234
239
|
textOverflow: 'ellipsis'
|
|
@@ -237,12 +242,7 @@ function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
|
|
|
237
242
|
width: '24',
|
|
238
243
|
height: '24',
|
|
239
244
|
cursor: 'pointer',
|
|
240
|
-
}, onClick: ()
|
|
241
|
-
onClose();
|
|
242
|
-
setTimeout(() => {
|
|
243
|
-
showCloseDialog();
|
|
244
|
-
}, 200);
|
|
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: {
|
|
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
246
|
display: 'flex',
|
|
247
247
|
alignItems: 'center',
|
|
248
248
|
gap: '2px',
|
|
@@ -272,7 +272,7 @@ function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
|
|
|
272
272
|
fontWeight: '400',
|
|
273
273
|
fontSize: '12px',
|
|
274
274
|
lineHeight: '16px',
|
|
275
|
-
}, children:
|
|
275
|
+
}, children: i18n.maliciousDappWarningSourceMessage }), (0, jsx_runtime_1.jsx)(images_1.Logo, { style: {
|
|
276
276
|
width: '14px',
|
|
277
277
|
height: '14px',
|
|
278
278
|
} }), (0, jsx_runtime_1.jsx)("span", { style: {
|
|
@@ -304,7 +304,7 @@ function App() {
|
|
|
304
304
|
return ((0, jsx_runtime_1.jsxs)("div", { id: containerId, style: {
|
|
305
305
|
position: 'fixed',
|
|
306
306
|
zIndex: 999999,
|
|
307
|
-
|
|
307
|
+
bottom: '25%',
|
|
308
308
|
right: '0px',
|
|
309
309
|
width: '256px',
|
|
310
310
|
background: '#fff',
|
|
@@ -315,7 +315,7 @@ function App() {
|
|
|
315
315
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
|
|
316
316
|
WebkitTextSizeAdjust: '100%',
|
|
317
317
|
fontSmooth: 'antialiased',
|
|
318
|
-
}, children: [showSecurityInfo && securityInfo ? ((0, jsx_runtime_1.jsx)(SecurityInfo, { securityInfo: securityInfo,
|
|
318
|
+
}, children: [showSecurityInfo && securityInfo ? ((0, jsx_runtime_1.jsx)(SecurityInfo, { securityInfo: securityInfo, onClose: () => {
|
|
319
319
|
setIsExpanded(false);
|
|
320
320
|
setIsShowSecurityInfo(false);
|
|
321
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: () => {
|
|
@@ -345,6 +345,10 @@ function injectIcon() {
|
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
347
|
function injectFloatingButton() {
|
|
348
|
+
// Check if the current window is an iframe
|
|
349
|
+
if (window.top !== window.self) {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
348
352
|
globalThis.$onekey.$private.onNotifyFloatingIconChanged(({ showFloatingIcon }) => {
|
|
349
353
|
if (showFloatingIcon) {
|
|
350
354
|
void injectIcon();
|
|
@@ -83,13 +83,11 @@ function CloseDialog({ onClose }) {
|
|
|
83
83
|
alignItems: 'center',
|
|
84
84
|
cursor: 'pointer',
|
|
85
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 })
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
borderTop: '1px solid rgba(0, 0, 0, 0.05)',
|
|
92
|
-
}, children: i18n.canBeReEnabledInSettings })] }));
|
|
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 })] })] })] }));
|
|
93
91
|
}
|
|
94
92
|
function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCloseDialog, }) {
|
|
95
93
|
const [showCloseButton, setIsShowCloseButton] = useState(false);
|
|
@@ -192,7 +190,7 @@ function SecurityRiskDetectionRow({ securityInfo }) {
|
|
|
192
190
|
gap: '3.2px',
|
|
193
191
|
}, children: securityElement }) }));
|
|
194
192
|
}
|
|
195
|
-
function SecurityInfo({ securityInfo, onClose,
|
|
193
|
+
function SecurityInfo({ securityInfo, onClose, }) {
|
|
196
194
|
var _a, _b, _c, _d, _e, _f;
|
|
197
195
|
const viewRef = useRef(null);
|
|
198
196
|
useOutsideClick(viewRef, onClose);
|
|
@@ -222,10 +220,17 @@ function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
|
|
|
222
220
|
height: '24px',
|
|
223
221
|
width: '24px',
|
|
224
222
|
borderRadius: '8px',
|
|
225
|
-
} })) : (
|
|
226
|
-
|
|
223
|
+
} })) : (_jsx("div", { style: {
|
|
224
|
+
transform: 'translate(4px, 3px)',
|
|
227
225
|
height: '24px',
|
|
228
|
-
|
|
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: {
|
|
229
234
|
width: '100%',
|
|
230
235
|
overflow: 'hidden',
|
|
231
236
|
textOverflow: 'ellipsis'
|
|
@@ -234,12 +239,7 @@ function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
|
|
|
234
239
|
width: '24',
|
|
235
240
|
height: '24',
|
|
236
241
|
cursor: 'pointer',
|
|
237
|
-
}, onClick: ()
|
|
238
|
-
onClose();
|
|
239
|
-
setTimeout(() => {
|
|
240
|
-
showCloseDialog();
|
|
241
|
-
}, 200);
|
|
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: {
|
|
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
243
|
display: 'flex',
|
|
244
244
|
alignItems: 'center',
|
|
245
245
|
gap: '2px',
|
|
@@ -269,7 +269,7 @@ function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
|
|
|
269
269
|
fontWeight: '400',
|
|
270
270
|
fontSize: '12px',
|
|
271
271
|
lineHeight: '16px',
|
|
272
|
-
}, children:
|
|
272
|
+
}, children: i18n.maliciousDappWarningSourceMessage }), _jsx(Logo, { style: {
|
|
273
273
|
width: '14px',
|
|
274
274
|
height: '14px',
|
|
275
275
|
} }), _jsx("span", { style: {
|
|
@@ -301,7 +301,7 @@ function App() {
|
|
|
301
301
|
return (_jsxs("div", { id: containerId, style: {
|
|
302
302
|
position: 'fixed',
|
|
303
303
|
zIndex: 999999,
|
|
304
|
-
|
|
304
|
+
bottom: '25%',
|
|
305
305
|
right: '0px',
|
|
306
306
|
width: '256px',
|
|
307
307
|
background: '#fff',
|
|
@@ -312,7 +312,7 @@ function App() {
|
|
|
312
312
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
|
|
313
313
|
WebkitTextSizeAdjust: '100%',
|
|
314
314
|
fontSmooth: 'antialiased',
|
|
315
|
-
}, children: [showSecurityInfo && securityInfo ? (_jsx(SecurityInfo, { securityInfo: securityInfo,
|
|
315
|
+
}, children: [showSecurityInfo && securityInfo ? (_jsx(SecurityInfo, { securityInfo: securityInfo, onClose: () => {
|
|
316
316
|
setIsExpanded(false);
|
|
317
317
|
setIsShowSecurityInfo(false);
|
|
318
318
|
} })) : (_jsx(IconButton, { onClick: handleClick, isExpanded: isExpanded, isShowCloseDialog: showCloseDialog, showCloseDialog: handleShowCloseDialog, dataLoaded: !!securityInfo })), !isExpanded && showCloseDialog && (_jsx(CloseDialog, { onClose: () => {
|
|
@@ -342,6 +342,10 @@ function injectIcon() {
|
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
export function injectFloatingButton() {
|
|
345
|
+
// Check if the current window is an iframe
|
|
346
|
+
if (window.top !== window.self) {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
345
349
|
globalThis.$onekey.$private.onNotifyFloatingIconChanged(({ showFloatingIcon }) => {
|
|
346
350
|
if (showFloatingIcon) {
|
|
347
351
|
void injectIcon();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/inpage-providers-hub",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
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.
|
|
34
|
-
"@onekeyfe/cross-inpage-provider-types": "2.2.
|
|
35
|
-
"@onekeyfe/onekey-algo-provider": "2.2.
|
|
36
|
-
"@onekeyfe/onekey-alph-provider": "2.2.
|
|
37
|
-
"@onekeyfe/onekey-aptos-provider": "2.2.
|
|
38
|
-
"@onekeyfe/onekey-bfc-provider": "2.2.
|
|
39
|
-
"@onekeyfe/onekey-btc-provider": "2.2.
|
|
40
|
-
"@onekeyfe/onekey-cardano-provider": "2.2.
|
|
41
|
-
"@onekeyfe/onekey-conflux-provider": "2.2.
|
|
42
|
-
"@onekeyfe/onekey-cosmos-provider": "2.2.
|
|
43
|
-
"@onekeyfe/onekey-eth-provider": "2.2.
|
|
44
|
-
"@onekeyfe/onekey-nostr-provider": "2.2.
|
|
45
|
-
"@onekeyfe/onekey-polkadot-provider": "2.2.
|
|
46
|
-
"@onekeyfe/onekey-private-provider": "2.2.
|
|
47
|
-
"@onekeyfe/onekey-scdo-provider": "2.2.
|
|
48
|
-
"@onekeyfe/onekey-solana-provider": "2.2.
|
|
49
|
-
"@onekeyfe/onekey-sui-provider": "2.2.
|
|
50
|
-
"@onekeyfe/onekey-ton-provider": "2.2.
|
|
51
|
-
"@onekeyfe/onekey-tron-provider": "2.2.
|
|
52
|
-
"@onekeyfe/onekey-webln-provider": "2.2.
|
|
33
|
+
"@onekeyfe/cross-inpage-provider-core": "2.2.4",
|
|
34
|
+
"@onekeyfe/cross-inpage-provider-types": "2.2.4",
|
|
35
|
+
"@onekeyfe/onekey-algo-provider": "2.2.4",
|
|
36
|
+
"@onekeyfe/onekey-alph-provider": "2.2.4",
|
|
37
|
+
"@onekeyfe/onekey-aptos-provider": "2.2.4",
|
|
38
|
+
"@onekeyfe/onekey-bfc-provider": "2.2.4",
|
|
39
|
+
"@onekeyfe/onekey-btc-provider": "2.2.4",
|
|
40
|
+
"@onekeyfe/onekey-cardano-provider": "2.2.4",
|
|
41
|
+
"@onekeyfe/onekey-conflux-provider": "2.2.4",
|
|
42
|
+
"@onekeyfe/onekey-cosmos-provider": "2.2.4",
|
|
43
|
+
"@onekeyfe/onekey-eth-provider": "2.2.4",
|
|
44
|
+
"@onekeyfe/onekey-nostr-provider": "2.2.4",
|
|
45
|
+
"@onekeyfe/onekey-polkadot-provider": "2.2.4",
|
|
46
|
+
"@onekeyfe/onekey-private-provider": "2.2.4",
|
|
47
|
+
"@onekeyfe/onekey-scdo-provider": "2.2.4",
|
|
48
|
+
"@onekeyfe/onekey-solana-provider": "2.2.4",
|
|
49
|
+
"@onekeyfe/onekey-sui-provider": "2.2.4",
|
|
50
|
+
"@onekeyfe/onekey-ton-provider": "2.2.4",
|
|
51
|
+
"@onekeyfe/onekey-tron-provider": "2.2.4",
|
|
52
|
+
"@onekeyfe/onekey-webln-provider": "2.2.4",
|
|
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": "
|
|
61
|
+
"gitHead": "8ed8855808d05d30e4fdc1aa4da99ac2e5bf4edb"
|
|
62
62
|
}
|