@cookill/wallet-adapter 3.1.2 → 3.1.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/react.cjs +299 -195
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +299 -195
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -1047,7 +1047,6 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1047
1047
|
const [dragY, setDragY] = useState(0);
|
|
1048
1048
|
const [isDragging, setIsDragging] = useState(false);
|
|
1049
1049
|
const dragStartRef = useRef(0);
|
|
1050
|
-
const sheetRef = useRef(null);
|
|
1051
1050
|
const sheepWallet = wallets.find((w) => w.id === "sheep-wallet");
|
|
1052
1051
|
useEffect(() => {
|
|
1053
1052
|
const check = () => setIsMobile(window.innerWidth < 640);
|
|
@@ -1061,7 +1060,10 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1061
1060
|
setIsDragging(false);
|
|
1062
1061
|
}
|
|
1063
1062
|
}, [state.isModalOpen]);
|
|
1064
|
-
const
|
|
1063
|
+
const stop = (e) => e.stopPropagation();
|
|
1064
|
+
const handleConnect = async (e) => {
|
|
1065
|
+
e.stopPropagation();
|
|
1066
|
+
e.preventDefault();
|
|
1065
1067
|
try {
|
|
1066
1068
|
await connect();
|
|
1067
1069
|
} catch {
|
|
@@ -1086,7 +1088,6 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1086
1088
|
canvas.height = size;
|
|
1087
1089
|
ctx.fillStyle = "#FFFFFF";
|
|
1088
1090
|
ctx.fillRect(0, 0, size, size);
|
|
1089
|
-
const data = generatedURI;
|
|
1090
1091
|
ctx.fillStyle = "#011B29";
|
|
1091
1092
|
const gridSize = 25;
|
|
1092
1093
|
const cellSize = size / gridSize;
|
|
@@ -1096,16 +1097,12 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1096
1097
|
if (isFinderArea) {
|
|
1097
1098
|
const isOuter = x === 0 || y === 0 || x === 6 || y === 6 || x === gridSize - 7 || x === gridSize - 1 || y === gridSize - 7 || y === gridSize - 1;
|
|
1098
1099
|
const isInner = x >= 2 && x <= 4 && y >= 2 && y <= 4 || x >= gridSize - 5 && x <= gridSize - 3 && y >= 2 && y <= 4 || x >= 2 && x <= 4 && y >= gridSize - 5 && y <= gridSize - 3;
|
|
1099
|
-
if (isOuter || isInner)
|
|
1100
|
-
ctx.fillRect(x * cellSize, y * cellSize, cellSize, cellSize);
|
|
1101
|
-
}
|
|
1100
|
+
if (isOuter || isInner) ctx.fillRect(x * cellSize, y * cellSize, cellSize, cellSize);
|
|
1102
1101
|
continue;
|
|
1103
1102
|
}
|
|
1104
|
-
const charIndex = (y * gridSize + x) %
|
|
1105
|
-
const charCode =
|
|
1106
|
-
if (charCode % 3 !== 0)
|
|
1107
|
-
ctx.fillRect(x * cellSize, y * cellSize, cellSize, cellSize);
|
|
1108
|
-
}
|
|
1103
|
+
const charIndex = (y * gridSize + x) % generatedURI.length;
|
|
1104
|
+
const charCode = generatedURI.charCodeAt(charIndex);
|
|
1105
|
+
if (charCode % 3 !== 0) ctx.fillRect(x * cellSize, y * cellSize, cellSize, cellSize);
|
|
1109
1106
|
}
|
|
1110
1107
|
}
|
|
1111
1108
|
const logoSize = 40;
|
|
@@ -1115,17 +1112,17 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1115
1112
|
ctx.arc(size / 2, size / 2, logoSize / 2 + 4, 0, Math.PI * 2);
|
|
1116
1113
|
ctx.fillStyle = "#FFFFFF";
|
|
1117
1114
|
ctx.fill();
|
|
1118
|
-
const radius = 6;
|
|
1119
1115
|
ctx.beginPath();
|
|
1120
|
-
|
|
1121
|
-
ctx.
|
|
1122
|
-
ctx.
|
|
1123
|
-
ctx.
|
|
1124
|
-
ctx.
|
|
1125
|
-
ctx.
|
|
1126
|
-
ctx.
|
|
1127
|
-
ctx.
|
|
1128
|
-
ctx.
|
|
1116
|
+
const r = 6;
|
|
1117
|
+
ctx.moveTo(logoX + r, logoY);
|
|
1118
|
+
ctx.lineTo(logoX + logoSize - r, logoY);
|
|
1119
|
+
ctx.quadraticCurveTo(logoX + logoSize, logoY, logoX + logoSize, logoY + r);
|
|
1120
|
+
ctx.lineTo(logoX + logoSize, logoY + logoSize - r);
|
|
1121
|
+
ctx.quadraticCurveTo(logoX + logoSize, logoY + logoSize, logoX + logoSize - r, logoY + logoSize);
|
|
1122
|
+
ctx.lineTo(logoX + r, logoY + logoSize);
|
|
1123
|
+
ctx.quadraticCurveTo(logoX, logoY + logoSize, logoX, logoY + logoSize - r);
|
|
1124
|
+
ctx.lineTo(logoX, logoY + r);
|
|
1125
|
+
ctx.quadraticCurveTo(logoX, logoY, logoX + r, logoY);
|
|
1129
1126
|
ctx.fillStyle = "#6EB9A8";
|
|
1130
1127
|
ctx.fill();
|
|
1131
1128
|
ctx.fillStyle = "#FFFFFF";
|
|
@@ -1147,64 +1144,95 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1147
1144
|
const handleTouchMove = (e) => {
|
|
1148
1145
|
if (!isDragging || !isMobile) return;
|
|
1149
1146
|
const delta = e.touches[0].clientY - dragStartRef.current;
|
|
1150
|
-
if (delta > 0)
|
|
1151
|
-
setDragY(delta);
|
|
1152
|
-
}
|
|
1147
|
+
if (delta > 0) setDragY(delta);
|
|
1153
1148
|
};
|
|
1154
1149
|
const handleTouchEnd = () => {
|
|
1155
1150
|
if (!isMobile) return;
|
|
1156
1151
|
setIsDragging(false);
|
|
1157
|
-
if (dragY > 120)
|
|
1158
|
-
closeModal();
|
|
1159
|
-
}
|
|
1152
|
+
if (dragY > 120) closeModal();
|
|
1160
1153
|
setDragY(0);
|
|
1161
1154
|
};
|
|
1162
1155
|
if (!state.isModalOpen) return null;
|
|
1156
|
+
const ExtensionIcon = () => /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1157
|
+
/* @__PURE__ */ jsx("path", { d: "M16 3h5v5" }),
|
|
1158
|
+
/* @__PURE__ */ jsx("path", { d: "M8 3H3v5" }),
|
|
1159
|
+
/* @__PURE__ */ jsx("path", { d: "M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3" }),
|
|
1160
|
+
/* @__PURE__ */ jsx("path", { d: "m15 9 6-6" })
|
|
1161
|
+
] });
|
|
1162
|
+
const QrIcon = () => /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1163
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "7", height: "7" }),
|
|
1164
|
+
/* @__PURE__ */ jsx("rect", { x: "14", y: "3", width: "7", height: "7" }),
|
|
1165
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "14", width: "7", height: "7" }),
|
|
1166
|
+
/* @__PURE__ */ jsx("path", { d: "M14 14h7v7h-7z" })
|
|
1167
|
+
] });
|
|
1168
|
+
const CameraIcon = () => /* @__PURE__ */ jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1169
|
+
/* @__PURE__ */ jsx("path", { d: "M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z" }),
|
|
1170
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "13", r: "3" })
|
|
1171
|
+
] });
|
|
1172
|
+
const RefreshIcon = () => /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1173
|
+
/* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }),
|
|
1174
|
+
/* @__PURE__ */ jsx("path", { d: "M21 3v5h-5" })
|
|
1175
|
+
] });
|
|
1176
|
+
const tabBaseStyle = {
|
|
1177
|
+
flex: 1,
|
|
1178
|
+
padding: "10px 0",
|
|
1179
|
+
border: "none",
|
|
1180
|
+
borderRadius: "10px",
|
|
1181
|
+
fontSize: "13px",
|
|
1182
|
+
cursor: "pointer",
|
|
1183
|
+
transition: "all 0.2s",
|
|
1184
|
+
display: "flex",
|
|
1185
|
+
alignItems: "center",
|
|
1186
|
+
justifyContent: "center",
|
|
1187
|
+
gap: "6px"
|
|
1188
|
+
};
|
|
1163
1189
|
const renderContent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1164
1190
|
/* @__PURE__ */ jsxs("div", { style: {
|
|
1165
1191
|
display: "flex",
|
|
1166
1192
|
gap: "4px",
|
|
1167
1193
|
padding: "4px",
|
|
1168
|
-
backgroundColor: "
|
|
1169
|
-
borderRadius: "
|
|
1194
|
+
backgroundColor: "rgba(255,255,255,0.04)",
|
|
1195
|
+
borderRadius: "14px",
|
|
1170
1196
|
marginBottom: "20px"
|
|
1171
1197
|
}, children: [
|
|
1172
|
-
/* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ jsxs(
|
|
1173
1199
|
"button",
|
|
1174
1200
|
{
|
|
1201
|
+
type: "button",
|
|
1202
|
+
onClick: (e) => {
|
|
1203
|
+
stop(e);
|
|
1204
|
+
setActiveTab("extension");
|
|
1205
|
+
},
|
|
1175
1206
|
style: {
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
borderRadius: "8px",
|
|
1181
|
-
color: activeTab === "extension" ? "#6EB9A8" : "#64748b",
|
|
1182
|
-
fontSize: "13px",
|
|
1183
|
-
fontWeight: activeTab === "extension" ? 600 : 400,
|
|
1184
|
-
cursor: "pointer",
|
|
1185
|
-
transition: "all 0.2s"
|
|
1207
|
+
...tabBaseStyle,
|
|
1208
|
+
backgroundColor: activeTab === "extension" ? "rgba(255,255,255,0.08)" : "transparent",
|
|
1209
|
+
color: activeTab === "extension" ? "#6EB9A8" : "rgba(255,255,255,0.4)",
|
|
1210
|
+
fontWeight: activeTab === "extension" ? 600 : 400
|
|
1186
1211
|
},
|
|
1187
|
-
|
|
1188
|
-
|
|
1212
|
+
children: [
|
|
1213
|
+
/* @__PURE__ */ jsx(ExtensionIcon, {}),
|
|
1214
|
+
" Extension"
|
|
1215
|
+
]
|
|
1189
1216
|
}
|
|
1190
1217
|
),
|
|
1191
|
-
/* @__PURE__ */
|
|
1218
|
+
/* @__PURE__ */ jsxs(
|
|
1192
1219
|
"button",
|
|
1193
1220
|
{
|
|
1221
|
+
type: "button",
|
|
1222
|
+
onClick: (e) => {
|
|
1223
|
+
stop(e);
|
|
1224
|
+
setActiveTab("scan");
|
|
1225
|
+
},
|
|
1194
1226
|
style: {
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
borderRadius: "8px",
|
|
1200
|
-
color: activeTab === "scan" ? "#6EB9A8" : "#64748b",
|
|
1201
|
-
fontSize: "13px",
|
|
1202
|
-
fontWeight: activeTab === "scan" ? 600 : 400,
|
|
1203
|
-
cursor: "pointer",
|
|
1204
|
-
transition: "all 0.2s"
|
|
1227
|
+
...tabBaseStyle,
|
|
1228
|
+
backgroundColor: activeTab === "scan" ? "rgba(255,255,255,0.08)" : "transparent",
|
|
1229
|
+
color: activeTab === "scan" ? "#6EB9A8" : "rgba(255,255,255,0.4)",
|
|
1230
|
+
fontWeight: activeTab === "scan" ? 600 : 400
|
|
1205
1231
|
},
|
|
1206
|
-
|
|
1207
|
-
|
|
1232
|
+
children: [
|
|
1233
|
+
/* @__PURE__ */ jsx(QrIcon, {}),
|
|
1234
|
+
" Scan to Connect"
|
|
1235
|
+
]
|
|
1208
1236
|
}
|
|
1209
1237
|
)
|
|
1210
1238
|
] }),
|
|
@@ -1212,86 +1240,151 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1212
1240
|
sheepWallet && /* @__PURE__ */ jsxs(
|
|
1213
1241
|
"button",
|
|
1214
1242
|
{
|
|
1215
|
-
|
|
1243
|
+
type: "button",
|
|
1244
|
+
onClick: installed ? handleConnect : (e) => {
|
|
1245
|
+
stop(e);
|
|
1246
|
+
window.open(sheepWallet.downloadUrl, "_blank");
|
|
1247
|
+
},
|
|
1216
1248
|
disabled: state.status === "connecting",
|
|
1217
1249
|
style: {
|
|
1218
1250
|
width: "100%",
|
|
1219
1251
|
display: "flex",
|
|
1220
1252
|
alignItems: "center",
|
|
1221
|
-
gap: "
|
|
1253
|
+
gap: "14px",
|
|
1222
1254
|
padding: "16px",
|
|
1223
|
-
backgroundColor:
|
|
1224
|
-
border: "1px solid
|
|
1225
|
-
borderRadius: "
|
|
1255
|
+
backgroundColor: "rgba(255,255,255,0.04)",
|
|
1256
|
+
border: "1px solid rgba(255,255,255,0.08)",
|
|
1257
|
+
borderRadius: "14px",
|
|
1226
1258
|
cursor: state.status === "connecting" ? "wait" : "pointer",
|
|
1227
|
-
transition: "all 0.
|
|
1259
|
+
transition: "all 0.15s"
|
|
1260
|
+
},
|
|
1261
|
+
onMouseEnter: (e) => {
|
|
1262
|
+
e.currentTarget.style.backgroundColor = "rgba(255,255,255,0.07)";
|
|
1263
|
+
},
|
|
1264
|
+
onMouseLeave: (e) => {
|
|
1265
|
+
e.currentTarget.style.backgroundColor = "rgba(255,255,255,0.04)";
|
|
1228
1266
|
},
|
|
1229
1267
|
children: [
|
|
1230
|
-
/* @__PURE__ */ jsx("
|
|
1268
|
+
/* @__PURE__ */ jsx("div", { style: {
|
|
1269
|
+
width: "44px",
|
|
1270
|
+
height: "44px",
|
|
1271
|
+
borderRadius: "12px",
|
|
1272
|
+
background: "linear-gradient(135deg, #6EB9A8, #4a9a8a)",
|
|
1273
|
+
display: "flex",
|
|
1274
|
+
alignItems: "center",
|
|
1275
|
+
justifyContent: "center",
|
|
1276
|
+
color: "#fff",
|
|
1277
|
+
fontWeight: 700,
|
|
1278
|
+
fontSize: "18px"
|
|
1279
|
+
}, children: "S" }),
|
|
1231
1280
|
/* @__PURE__ */ jsxs("div", { style: { flex: 1, textAlign: "left" }, children: [
|
|
1232
|
-
/* @__PURE__ */ jsx("div", { style: { color: "#
|
|
1233
|
-
/* @__PURE__ */ jsx("div", { style: {
|
|
1281
|
+
/* @__PURE__ */ jsx("div", { style: { color: "#fff", fontWeight: 500, fontSize: "15px", marginBottom: "2px" }, children: sheepWallet.name }),
|
|
1282
|
+
/* @__PURE__ */ jsx("div", { style: {
|
|
1283
|
+
fontSize: "12px",
|
|
1284
|
+
color: installed ? "#6EB9A8" : "rgba(255,255,255,0.4)",
|
|
1285
|
+
display: "flex",
|
|
1286
|
+
alignItems: "center",
|
|
1287
|
+
gap: "5px"
|
|
1288
|
+
}, children: state.status === "connecting" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1289
|
+
/* @__PURE__ */ jsx("span", { style: {
|
|
1290
|
+
display: "inline-block",
|
|
1291
|
+
width: "6px",
|
|
1292
|
+
height: "6px",
|
|
1293
|
+
borderRadius: "50%",
|
|
1294
|
+
backgroundColor: "#F59E0B",
|
|
1295
|
+
animation: "walletModalPulse 1.2s infinite"
|
|
1296
|
+
} }),
|
|
1297
|
+
"Connecting..."
|
|
1298
|
+
] }) : installed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1299
|
+
/* @__PURE__ */ jsx("span", { style: {
|
|
1300
|
+
display: "inline-block",
|
|
1301
|
+
width: "6px",
|
|
1302
|
+
height: "6px",
|
|
1303
|
+
borderRadius: "50%",
|
|
1304
|
+
backgroundColor: "#6EB9A8"
|
|
1305
|
+
} }),
|
|
1306
|
+
"Detected \u2014 Click to connect"
|
|
1307
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1308
|
+
/* @__PURE__ */ jsx("span", { style: {
|
|
1309
|
+
display: "inline-block",
|
|
1310
|
+
width: "6px",
|
|
1311
|
+
height: "6px",
|
|
1312
|
+
borderRadius: "50%",
|
|
1313
|
+
backgroundColor: "rgba(255,255,255,0.2)"
|
|
1314
|
+
} }),
|
|
1315
|
+
"Not installed"
|
|
1316
|
+
] }) })
|
|
1234
1317
|
] }),
|
|
1235
|
-
!installed && /* @__PURE__ */ jsx("span", { style: {
|
|
1318
|
+
!installed && /* @__PURE__ */ jsx("span", { style: {
|
|
1319
|
+
color: "#6EB9A8",
|
|
1320
|
+
fontSize: "12px",
|
|
1321
|
+
fontWeight: 500,
|
|
1322
|
+
padding: "4px 10px",
|
|
1323
|
+
borderRadius: "8px",
|
|
1324
|
+
backgroundColor: "rgba(110,185,168,0.1)"
|
|
1325
|
+
}, children: "Install" })
|
|
1236
1326
|
]
|
|
1237
1327
|
}
|
|
1238
1328
|
),
|
|
1239
|
-
/* @__PURE__ */ jsx("div", { style: {
|
|
1329
|
+
/* @__PURE__ */ jsx("div", { style: {
|
|
1330
|
+
display: "flex",
|
|
1331
|
+
gap: "8px",
|
|
1332
|
+
marginTop: "16px",
|
|
1333
|
+
flexWrap: "wrap"
|
|
1334
|
+
}, children: [
|
|
1240
1335
|
{ label: "REX", desc: "Confidential TX", color: "#8B5CF6" },
|
|
1241
1336
|
{ label: "SfS", desc: "Gasless TX", color: "#F59E0B" },
|
|
1242
1337
|
{ label: "QR", desc: "Scan Connect", color: "#6EB9A8" }
|
|
1243
1338
|
].map((badge) => /* @__PURE__ */ jsxs("div", { style: {
|
|
1244
|
-
padding: "
|
|
1245
|
-
backgroundColor: `${badge.color}
|
|
1339
|
+
padding: "5px 10px",
|
|
1340
|
+
backgroundColor: `${badge.color}10`,
|
|
1246
1341
|
borderRadius: "8px",
|
|
1247
|
-
border: `1px solid ${badge.color}
|
|
1342
|
+
border: `1px solid ${badge.color}18`,
|
|
1248
1343
|
display: "flex",
|
|
1249
1344
|
alignItems: "center",
|
|
1250
1345
|
gap: "6px"
|
|
1251
1346
|
}, children: [
|
|
1252
1347
|
/* @__PURE__ */ jsx("span", { style: { color: badge.color, fontSize: "11px", fontWeight: 600 }, children: badge.label }),
|
|
1253
|
-
/* @__PURE__ */ jsx("span", { style: { color: "
|
|
1348
|
+
/* @__PURE__ */ jsx("span", { style: { color: "rgba(255,255,255,0.35)", fontSize: "10px" }, children: badge.desc })
|
|
1254
1349
|
] }, badge.label)) })
|
|
1255
1350
|
] }),
|
|
1256
1351
|
activeTab === "scan" && /* @__PURE__ */ jsxs("div", { children: [
|
|
1257
|
-
/* @__PURE__ */
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
)
|
|
1292
|
-
] }),
|
|
1352
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", gap: "8px", marginBottom: "16px" }, children: ["show-qr", "scan-qr"].map((mode) => /* @__PURE__ */ jsx(
|
|
1353
|
+
"button",
|
|
1354
|
+
{
|
|
1355
|
+
type: "button",
|
|
1356
|
+
onClick: (e) => {
|
|
1357
|
+
stop(e);
|
|
1358
|
+
setScanMode(mode);
|
|
1359
|
+
},
|
|
1360
|
+
style: {
|
|
1361
|
+
flex: 1,
|
|
1362
|
+
padding: "8px",
|
|
1363
|
+
display: "flex",
|
|
1364
|
+
alignItems: "center",
|
|
1365
|
+
justifyContent: "center",
|
|
1366
|
+
gap: "6px",
|
|
1367
|
+
backgroundColor: scanMode === mode ? "rgba(110,185,168,0.1)" : "transparent",
|
|
1368
|
+
border: `1px solid ${scanMode === mode ? "rgba(110,185,168,0.25)" : "rgba(255,255,255,0.08)"}`,
|
|
1369
|
+
borderRadius: "10px",
|
|
1370
|
+
color: scanMode === mode ? "#6EB9A8" : "rgba(255,255,255,0.4)",
|
|
1371
|
+
fontSize: "12px",
|
|
1372
|
+
fontWeight: scanMode === mode ? 500 : 400,
|
|
1373
|
+
cursor: "pointer",
|
|
1374
|
+
transition: "all 0.15s"
|
|
1375
|
+
},
|
|
1376
|
+
children: mode === "show-qr" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1377
|
+
/* @__PURE__ */ jsx(QrIcon, {}),
|
|
1378
|
+
" Show QR"
|
|
1379
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1380
|
+
/* @__PURE__ */ jsx(CameraIcon, {}),
|
|
1381
|
+
" Scan QR"
|
|
1382
|
+
] })
|
|
1383
|
+
},
|
|
1384
|
+
mode
|
|
1385
|
+
)) }),
|
|
1293
1386
|
scanMode === "show-qr" && /* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
|
|
1294
|
-
/* @__PURE__ */ jsx("p", { style: { color: "
|
|
1387
|
+
/* @__PURE__ */ jsx("p", { style: { color: "rgba(255,255,255,0.45)", fontSize: "13px", marginBottom: "16px", lineHeight: 1.5 }, children: "Scan this QR code with Sheep Wallet on your mobile device to connect" }),
|
|
1295
1388
|
/* @__PURE__ */ jsxs("div", { style: {
|
|
1296
1389
|
display: "inline-block",
|
|
1297
1390
|
padding: "16px",
|
|
@@ -1309,13 +1402,13 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1309
1402
|
] }),
|
|
1310
1403
|
/* @__PURE__ */ jsxs("div", { style: { marginTop: "16px", display: "flex", alignItems: "center", justifyContent: "center", gap: "8px" }, children: [
|
|
1311
1404
|
/* @__PURE__ */ jsx("div", { style: {
|
|
1312
|
-
width: "
|
|
1313
|
-
height: "
|
|
1405
|
+
width: "7px",
|
|
1406
|
+
height: "7px",
|
|
1314
1407
|
borderRadius: "50%",
|
|
1315
1408
|
backgroundColor: state.scanConnectStatus === "waiting" ? "#6EB9A8" : "#F59E0B",
|
|
1316
1409
|
animation: "walletModalPulse 2s infinite"
|
|
1317
1410
|
} }),
|
|
1318
|
-
/* @__PURE__ */ jsxs("span", { style: { color: "
|
|
1411
|
+
/* @__PURE__ */ jsxs("span", { style: { color: "rgba(255,255,255,0.4)", fontSize: "12px" }, children: [
|
|
1319
1412
|
state.scanConnectStatus === "generating" && "Generating session...",
|
|
1320
1413
|
state.scanConnectStatus === "waiting" && "Waiting for wallet to scan...",
|
|
1321
1414
|
state.scanConnectStatus === "scanned" && "Scanned! Waiting for approval...",
|
|
@@ -1324,51 +1417,64 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1324
1417
|
state.scanConnectStatus === "idle" && "Initializing..."
|
|
1325
1418
|
] })
|
|
1326
1419
|
] }),
|
|
1327
|
-
/* @__PURE__ */
|
|
1420
|
+
/* @__PURE__ */ jsxs(
|
|
1328
1421
|
"button",
|
|
1329
1422
|
{
|
|
1330
|
-
|
|
1423
|
+
type: "button",
|
|
1424
|
+
onClick: (e) => {
|
|
1425
|
+
stop(e);
|
|
1426
|
+
generateScanSession();
|
|
1427
|
+
},
|
|
1331
1428
|
style: {
|
|
1332
1429
|
marginTop: "12px",
|
|
1333
1430
|
padding: "8px 16px",
|
|
1334
1431
|
backgroundColor: "transparent",
|
|
1335
|
-
border: "1px solid
|
|
1336
|
-
borderRadius: "
|
|
1432
|
+
border: "1px solid rgba(255,255,255,0.08)",
|
|
1433
|
+
borderRadius: "10px",
|
|
1337
1434
|
color: "#6EB9A8",
|
|
1338
1435
|
fontSize: "12px",
|
|
1339
|
-
cursor: "pointer"
|
|
1436
|
+
cursor: "pointer",
|
|
1437
|
+
display: "inline-flex",
|
|
1438
|
+
alignItems: "center",
|
|
1439
|
+
gap: "6px",
|
|
1440
|
+
transition: "all 0.15s"
|
|
1340
1441
|
},
|
|
1341
|
-
children:
|
|
1442
|
+
children: [
|
|
1443
|
+
/* @__PURE__ */ jsx(RefreshIcon, {}),
|
|
1444
|
+
" Refresh QR"
|
|
1445
|
+
]
|
|
1342
1446
|
}
|
|
1343
1447
|
)
|
|
1344
1448
|
] }),
|
|
1345
1449
|
scanMode === "scan-qr" && /* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
|
|
1346
|
-
/* @__PURE__ */ jsx("p", { style: { color: "
|
|
1450
|
+
/* @__PURE__ */ jsx("p", { style: { color: "rgba(255,255,255,0.45)", fontSize: "13px", marginBottom: "16px", lineHeight: 1.5 }, children: "Open Sheep Wallet on another device, go to Settings \u2192 Show Connect QR, then scan it here" }),
|
|
1347
1451
|
/* @__PURE__ */ jsxs("div", { style: {
|
|
1348
1452
|
width: "100%",
|
|
1349
1453
|
height: "200px",
|
|
1350
|
-
backgroundColor: "
|
|
1351
|
-
borderRadius: "
|
|
1352
|
-
border: "
|
|
1454
|
+
backgroundColor: "rgba(255,255,255,0.02)",
|
|
1455
|
+
borderRadius: "14px",
|
|
1456
|
+
border: "1px dashed rgba(255,255,255,0.1)",
|
|
1353
1457
|
display: "flex",
|
|
1354
1458
|
flexDirection: "column",
|
|
1355
1459
|
alignItems: "center",
|
|
1356
1460
|
justifyContent: "center",
|
|
1357
1461
|
gap: "12px"
|
|
1358
1462
|
}, children: [
|
|
1359
|
-
/* @__PURE__ */ jsx("
|
|
1360
|
-
/* @__PURE__ */ jsx("span", { style: { color: "
|
|
1463
|
+
/* @__PURE__ */ jsx("div", { style: { color: "rgba(255,255,255,0.2)" }, children: /* @__PURE__ */ jsx(CameraIcon, {}) }),
|
|
1464
|
+
/* @__PURE__ */ jsx("span", { style: { color: "rgba(255,255,255,0.3)", fontSize: "13px" }, children: "Camera access required" }),
|
|
1361
1465
|
/* @__PURE__ */ jsx(
|
|
1362
1466
|
"button",
|
|
1363
1467
|
{
|
|
1364
|
-
|
|
1468
|
+
type: "button",
|
|
1469
|
+
onClick: (e) => {
|
|
1470
|
+
stop(e);
|
|
1365
1471
|
alert("Camera scanning requires HTTPS and camera permissions. This feature works in the installed extension.");
|
|
1366
1472
|
},
|
|
1367
1473
|
style: {
|
|
1368
|
-
padding: "8px
|
|
1474
|
+
padding: "8px 20px",
|
|
1369
1475
|
backgroundColor: "#6EB9A8",
|
|
1370
1476
|
border: "none",
|
|
1371
|
-
borderRadius: "
|
|
1477
|
+
borderRadius: "10px",
|
|
1372
1478
|
color: "#011B29",
|
|
1373
1479
|
fontSize: "13px",
|
|
1374
1480
|
fontWeight: 500,
|
|
@@ -1382,14 +1488,38 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1382
1488
|
] }),
|
|
1383
1489
|
state.error && /* @__PURE__ */ jsx("div", { style: {
|
|
1384
1490
|
marginTop: "16px",
|
|
1385
|
-
padding: "12px",
|
|
1386
|
-
backgroundColor: "rgba(239,
|
|
1387
|
-
border: "1px solid rgba(239,
|
|
1388
|
-
borderRadius: "
|
|
1389
|
-
color: "#
|
|
1390
|
-
fontSize: "13px"
|
|
1491
|
+
padding: "12px 14px",
|
|
1492
|
+
backgroundColor: "rgba(239,68,68,0.08)",
|
|
1493
|
+
border: "1px solid rgba(239,68,68,0.15)",
|
|
1494
|
+
borderRadius: "12px",
|
|
1495
|
+
color: "#f87171",
|
|
1496
|
+
fontSize: "13px",
|
|
1497
|
+
lineHeight: 1.4
|
|
1391
1498
|
}, children: state.error.message }),
|
|
1392
|
-
/* @__PURE__ */ jsx("div", { style: {
|
|
1499
|
+
/* @__PURE__ */ jsx("div", { style: {
|
|
1500
|
+
marginTop: "24px",
|
|
1501
|
+
textAlign: "center",
|
|
1502
|
+
color: "rgba(255,255,255,0.2)",
|
|
1503
|
+
fontSize: "11px",
|
|
1504
|
+
paddingTop: "16px",
|
|
1505
|
+
borderTop: "1px solid rgba(255,255,255,0.04)"
|
|
1506
|
+
}, children: "Powered by Rialo Network" })
|
|
1507
|
+
] });
|
|
1508
|
+
const closeBtn = {
|
|
1509
|
+
background: "none",
|
|
1510
|
+
border: "none",
|
|
1511
|
+
color: "rgba(255,255,255,0.3)",
|
|
1512
|
+
cursor: "pointer",
|
|
1513
|
+
padding: "6px",
|
|
1514
|
+
borderRadius: "8px",
|
|
1515
|
+
display: "flex",
|
|
1516
|
+
alignItems: "center",
|
|
1517
|
+
justifyContent: "center",
|
|
1518
|
+
transition: "all 0.15s"
|
|
1519
|
+
};
|
|
1520
|
+
const CloseIcon = () => /* @__PURE__ */ jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1521
|
+
/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }),
|
|
1522
|
+
/* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })
|
|
1393
1523
|
] });
|
|
1394
1524
|
if (isMobile) {
|
|
1395
1525
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1399,67 +1529,48 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1399
1529
|
position: "fixed",
|
|
1400
1530
|
inset: 0,
|
|
1401
1531
|
zIndex: 9999,
|
|
1402
|
-
backgroundColor: "rgba(0,
|
|
1403
|
-
backdropFilter: "blur(
|
|
1532
|
+
backgroundColor: "rgba(0,0,0,0.6)",
|
|
1533
|
+
backdropFilter: "blur(8px)",
|
|
1534
|
+
WebkitBackdropFilter: "blur(8px)"
|
|
1404
1535
|
},
|
|
1405
1536
|
onClick: (e) => {
|
|
1406
1537
|
if (e.target === e.currentTarget) closeModal();
|
|
1407
1538
|
},
|
|
1539
|
+
onPointerDown: (e) => {
|
|
1540
|
+
if (e.target !== e.currentTarget) e.stopPropagation();
|
|
1541
|
+
},
|
|
1408
1542
|
children: [
|
|
1409
1543
|
/* @__PURE__ */ jsxs(
|
|
1410
1544
|
"div",
|
|
1411
1545
|
{
|
|
1412
|
-
ref: sheetRef,
|
|
1413
1546
|
onTouchStart: handleTouchStart,
|
|
1414
1547
|
onTouchMove: handleTouchMove,
|
|
1415
1548
|
onTouchEnd: handleTouchEnd,
|
|
1549
|
+
onClick: stop,
|
|
1416
1550
|
style: {
|
|
1417
1551
|
position: "fixed",
|
|
1418
1552
|
bottom: 0,
|
|
1419
1553
|
left: 0,
|
|
1420
1554
|
right: 0,
|
|
1421
1555
|
backgroundColor: "#011B29",
|
|
1422
|
-
borderTopLeftRadius: "
|
|
1423
|
-
borderTopRightRadius: "
|
|
1424
|
-
padding: "0 20px
|
|
1556
|
+
borderTopLeftRadius: "24px",
|
|
1557
|
+
borderTopRightRadius: "24px",
|
|
1558
|
+
padding: "0 20px 28px",
|
|
1425
1559
|
maxHeight: "85vh",
|
|
1426
1560
|
overflow: "auto",
|
|
1427
|
-
boxShadow: "0 -
|
|
1561
|
+
boxShadow: "0 -8px 40px rgba(0,0,0,0.5)",
|
|
1428
1562
|
transform: `translateY(${dragY}px)`,
|
|
1429
|
-
transition: isDragging ? "none" : "transform 0.3s
|
|
1430
|
-
animation: isDragging ? "none" : "walletModalSlideUp 0.
|
|
1563
|
+
transition: isDragging ? "none" : "transform 0.3s cubic-bezier(0.4,0,0.2,1)",
|
|
1564
|
+
animation: isDragging ? "none" : "walletModalSlideUp 0.35s cubic-bezier(0.4,0,0.2,1)"
|
|
1431
1565
|
},
|
|
1432
1566
|
children: [
|
|
1433
|
-
/* @__PURE__ */ jsx("div", { style: {
|
|
1434
|
-
display: "flex",
|
|
1435
|
-
justifyContent: "center",
|
|
1436
|
-
padding: "12px 0 16px",
|
|
1437
|
-
cursor: "grab",
|
|
1438
|
-
touchAction: "none"
|
|
1439
|
-
}, children: /* @__PURE__ */ jsx("div", { style: {
|
|
1440
|
-
width: "36px",
|
|
1441
|
-
height: "4px",
|
|
1442
|
-
borderRadius: "2px",
|
|
1443
|
-
backgroundColor: "#2a4a5d"
|
|
1444
|
-
} }) }),
|
|
1567
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "center", padding: "12px 0 16px", cursor: "grab", touchAction: "none" }, children: /* @__PURE__ */ jsx("div", { style: { width: "36px", height: "4px", borderRadius: "2px", backgroundColor: "rgba(255,255,255,0.12)" } }) }),
|
|
1445
1568
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
|
|
1446
|
-
/* @__PURE__ */ jsx("h2", { style: { color: "#
|
|
1447
|
-
/* @__PURE__ */ jsx(
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
style: {
|
|
1452
|
-
background: "none",
|
|
1453
|
-
border: "none",
|
|
1454
|
-
color: "#64748b",
|
|
1455
|
-
fontSize: "24px",
|
|
1456
|
-
cursor: "pointer",
|
|
1457
|
-
padding: "4px",
|
|
1458
|
-
lineHeight: 1
|
|
1459
|
-
},
|
|
1460
|
-
children: "\u2715"
|
|
1461
|
-
}
|
|
1462
|
-
)
|
|
1569
|
+
/* @__PURE__ */ jsx("h2", { style: { color: "#fff", fontSize: "18px", fontWeight: 600, margin: 0, letterSpacing: "-0.01em" }, children: "Connect Wallet" }),
|
|
1570
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: (e) => {
|
|
1571
|
+
stop(e);
|
|
1572
|
+
closeModal();
|
|
1573
|
+
}, style: closeBtn, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
|
|
1463
1574
|
] }),
|
|
1464
1575
|
renderContent()
|
|
1465
1576
|
]
|
|
@@ -1472,7 +1583,7 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1472
1583
|
}
|
|
1473
1584
|
@keyframes walletModalPulse {
|
|
1474
1585
|
0%, 100% { opacity: 1; }
|
|
1475
|
-
50% { opacity: 0.
|
|
1586
|
+
50% { opacity: 0.3; }
|
|
1476
1587
|
}
|
|
1477
1588
|
` })
|
|
1478
1589
|
]
|
|
@@ -1489,47 +1600,40 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1489
1600
|
display: "flex",
|
|
1490
1601
|
alignItems: "center",
|
|
1491
1602
|
justifyContent: "center",
|
|
1492
|
-
backgroundColor: "rgba(0,
|
|
1493
|
-
backdropFilter: "blur(
|
|
1603
|
+
backgroundColor: "rgba(0,0,0,0.6)",
|
|
1604
|
+
backdropFilter: "blur(8px)",
|
|
1605
|
+
WebkitBackdropFilter: "blur(8px)"
|
|
1494
1606
|
},
|
|
1495
1607
|
onClick: (e) => {
|
|
1496
1608
|
if (e.target === e.currentTarget) closeModal();
|
|
1497
1609
|
},
|
|
1610
|
+
onPointerDown: (e) => {
|
|
1611
|
+
if (e.target !== e.currentTarget) e.stopPropagation();
|
|
1612
|
+
},
|
|
1498
1613
|
children: [
|
|
1499
1614
|
/* @__PURE__ */ jsxs(
|
|
1500
1615
|
"div",
|
|
1501
1616
|
{
|
|
1617
|
+
onClick: stop,
|
|
1502
1618
|
style: {
|
|
1503
1619
|
backgroundColor: "#011B29",
|
|
1504
|
-
borderRadius: "
|
|
1620
|
+
borderRadius: "20px",
|
|
1505
1621
|
padding: "24px",
|
|
1506
1622
|
width: "100%",
|
|
1507
1623
|
maxWidth: "400px",
|
|
1508
1624
|
margin: "16px",
|
|
1509
|
-
boxShadow: "0 25px
|
|
1625
|
+
boxShadow: "0 25px 60px -12px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05)",
|
|
1510
1626
|
maxHeight: "90vh",
|
|
1511
1627
|
overflow: "auto",
|
|
1512
|
-
animation: "walletModalFadeIn 0.
|
|
1628
|
+
animation: "walletModalFadeIn 0.25s cubic-bezier(0.4,0,0.2,1)"
|
|
1513
1629
|
},
|
|
1514
1630
|
children: [
|
|
1515
1631
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
|
|
1516
|
-
/* @__PURE__ */ jsx("h2", { style: { color: "#
|
|
1517
|
-
/* @__PURE__ */ jsx(
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
style: {
|
|
1522
|
-
background: "none",
|
|
1523
|
-
border: "none",
|
|
1524
|
-
color: "#64748b",
|
|
1525
|
-
fontSize: "24px",
|
|
1526
|
-
cursor: "pointer",
|
|
1527
|
-
padding: "4px",
|
|
1528
|
-
lineHeight: 1
|
|
1529
|
-
},
|
|
1530
|
-
children: "\u2715"
|
|
1531
|
-
}
|
|
1532
|
-
)
|
|
1632
|
+
/* @__PURE__ */ jsx("h2", { style: { color: "#fff", fontSize: "18px", fontWeight: 600, margin: 0, letterSpacing: "-0.01em" }, children: "Connect Wallet" }),
|
|
1633
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: (e) => {
|
|
1634
|
+
stop(e);
|
|
1635
|
+
closeModal();
|
|
1636
|
+
}, style: closeBtn, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
|
|
1533
1637
|
] }),
|
|
1534
1638
|
renderContent()
|
|
1535
1639
|
]
|
|
@@ -1537,12 +1641,12 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1537
1641
|
),
|
|
1538
1642
|
/* @__PURE__ */ jsx("style", { children: `
|
|
1539
1643
|
@keyframes walletModalFadeIn {
|
|
1540
|
-
from { opacity: 0; transform: scale(0.
|
|
1644
|
+
from { opacity: 0; transform: scale(0.97) translateY(8px); }
|
|
1541
1645
|
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
1542
1646
|
}
|
|
1543
1647
|
@keyframes walletModalPulse {
|
|
1544
1648
|
0%, 100% { opacity: 1; }
|
|
1545
|
-
50% { opacity: 0.
|
|
1649
|
+
50% { opacity: 0.3; }
|
|
1546
1650
|
}
|
|
1547
1651
|
` })
|
|
1548
1652
|
]
|