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