btc-wallet 0.5.57-beta → 0.5.58-beta
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/index.js +25 -8
- package/dist/index.js.map +2 -2
- package/esm/index.js +25 -8
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -4518,7 +4518,20 @@ function createFloatingButtonWithIframe({
|
|
4518
4518
|
let startY = 0;
|
4519
4519
|
let initialRight = 0;
|
4520
4520
|
let initialBottom = 0;
|
4521
|
-
let
|
4521
|
+
let isLongPress = false;
|
4522
|
+
button.addEventListener(
|
4523
|
+
"click",
|
4524
|
+
(e) => {
|
4525
|
+
if (isLongPress) {
|
4526
|
+
isLongPress = false;
|
4527
|
+
return;
|
4528
|
+
}
|
4529
|
+
handleButtonClick();
|
4530
|
+
e.preventDefault();
|
4531
|
+
e.stopPropagation();
|
4532
|
+
},
|
4533
|
+
{ capture: true }
|
4534
|
+
);
|
4522
4535
|
const handleMouseDown = (e) => {
|
4523
4536
|
startDrag(e.clientX, e.clientY);
|
4524
4537
|
e.preventDefault();
|
@@ -4540,13 +4553,17 @@ function createFloatingButtonWithIframe({
|
|
4540
4553
|
startY = clientY;
|
4541
4554
|
initialRight = parseInt(button.style.right);
|
4542
4555
|
initialBottom = parseInt(button.style.bottom);
|
4543
|
-
dragStartTime = Date.now();
|
4544
4556
|
button.style.cursor = "grabbing";
|
4545
4557
|
button.style.transition = "none";
|
4546
4558
|
}
|
4547
4559
|
const handleMouseMove = (e) => {
|
4548
4560
|
if (!isDragging)
|
4549
4561
|
return;
|
4562
|
+
const deltaX = Math.abs(startX - e.clientX);
|
4563
|
+
const deltaY = Math.abs(startY - e.clientY);
|
4564
|
+
if (deltaX > 5 || deltaY > 5) {
|
4565
|
+
isLongPress = true;
|
4566
|
+
}
|
4550
4567
|
moveButton(e.clientX, e.clientY);
|
4551
4568
|
e.preventDefault();
|
4552
4569
|
e.stopPropagation();
|
@@ -4555,6 +4572,11 @@ function createFloatingButtonWithIframe({
|
|
4555
4572
|
if (!isDragging || e.touches.length !== 1)
|
4556
4573
|
return;
|
4557
4574
|
const touch = e.touches[0];
|
4575
|
+
const deltaX = Math.abs(startX - touch.clientX);
|
4576
|
+
const deltaY = Math.abs(startY - touch.clientY);
|
4577
|
+
if (deltaX > 5 || deltaY > 5) {
|
4578
|
+
isLongPress = true;
|
4579
|
+
}
|
4558
4580
|
moveButton(touch.clientX, touch.clientY);
|
4559
4581
|
e.preventDefault();
|
4560
4582
|
e.stopPropagation();
|
@@ -4604,8 +4626,6 @@ function createFloatingButtonWithIframe({
|
|
4604
4626
|
function endDrag() {
|
4605
4627
|
if (!isDragging)
|
4606
4628
|
return;
|
4607
|
-
const dragEndTime = Date.now();
|
4608
|
-
const isDragEvent = dragEndTime - dragStartTime > 200;
|
4609
4629
|
isDragging = false;
|
4610
4630
|
button.style.cursor = "grab";
|
4611
4631
|
button.style.transition = "transform 0.15s ease";
|
@@ -4613,9 +4633,6 @@ function createFloatingButtonWithIframe({
|
|
4613
4633
|
right: button.style.right,
|
4614
4634
|
bottom: button.style.bottom
|
4615
4635
|
});
|
4616
|
-
if (!isDragEvent) {
|
4617
|
-
handleButtonClick();
|
4618
|
-
}
|
4619
4636
|
}
|
4620
4637
|
const handleButtonClick = () => {
|
4621
4638
|
const isCurrentlyVisible = iframe.style.display === "block";
|
@@ -5167,7 +5184,7 @@ function getGroup(state) {
|
|
5167
5184
|
|
5168
5185
|
// src/index.ts
|
5169
5186
|
var getVersion = () => {
|
5170
|
-
return "0.5.
|
5187
|
+
return "0.5.58-beta";
|
5171
5188
|
};
|
5172
5189
|
if (typeof window !== "undefined") {
|
5173
5190
|
window.__BTC_WALLET_VERSION = getVersion();
|