@yuneta/gobj-ui 7.26.19 → 7.26.20

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.
@@ -13590,7 +13590,7 @@ function install_long_press_contextmenu(graph, options) {
13590
13590
  pending = {
13591
13591
  x,
13592
13592
  y,
13593
- t0: Date.now(),
13593
+ t0: performance.now(),
13594
13594
  event: Object.assign({}, event),
13595
13595
  tick: setTimeout(announce, 500)
13596
13596
  };
@@ -13616,7 +13616,7 @@ function install_long_press_contextmenu(graph, options) {
13616
13616
  let y = event.client?.y;
13617
13617
  if (x === void 0) x = press.x;
13618
13618
  if (y === void 0) y = press.y;
13619
- if (classify_press(press, x, y, Date.now()) !== "long") return;
13619
+ if (classify_press(press, x, y, performance.now()) !== "long") return;
13620
13620
  fire(press.event);
13621
13621
  };
13622
13622
  let on_touch_cancel = () => {
@@ -13585,7 +13585,7 @@ function install_long_press_contextmenu(graph, options) {
13585
13585
  pending = {
13586
13586
  x,
13587
13587
  y,
13588
- t0: Date.now(),
13588
+ t0: performance.now(),
13589
13589
  event: Object.assign({}, event),
13590
13590
  tick: setTimeout(announce, 500)
13591
13591
  };
@@ -13611,7 +13611,7 @@ function install_long_press_contextmenu(graph, options) {
13611
13611
  let y = event.client?.y;
13612
13612
  if (x === void 0) x = press.x;
13613
13613
  if (y === void 0) y = press.y;
13614
- if (classify_press(press, x, y, Date.now()) !== "long") return;
13614
+ if (classify_press(press, x, y, performance.now()) !== "long") return;
13615
13615
  fire(press.event);
13616
13616
  };
13617
13617
  let on_touch_cancel = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.26.19",
3
+ "version": "7.26.20",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -461,7 +461,8 @@ export function install_long_press_contextmenu(graph, options)
461
461
  pending = {
462
462
  x: x,
463
463
  y: y,
464
- t0: Date.now(),
464
+ /* A monotonic clock: the wall clock may step mid-press. */
465
+ t0: performance.now(),
465
466
  event: Object.assign({}, event),
466
467
  tick: setTimeout(announce, LONG_PRESS_MS),
467
468
  };
@@ -505,7 +506,7 @@ export function install_long_press_contextmenu(graph, options)
505
506
  if(y === undefined) {
506
507
  y = press.y;
507
508
  }
508
- if(classify_press(press, x, y, Date.now()) !== "long") {
509
+ if(classify_press(press, x, y, performance.now()) !== "long") {
509
510
  return; /* a drag, or a tap: both are already served */
510
511
  }
511
512
  fire(press.event);