checkpoint-cli 0.3.2 → 0.3.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/index.js CHANGED
@@ -1606,7 +1606,7 @@ const program = new commander_1.Command();
1606
1606
  program
1607
1607
  .name('checkpoint')
1608
1608
  .description('Share your localhost with reviewers — get visual feedback directly on the page')
1609
- .version('0.3.2');
1609
+ .version('0.3.3');
1610
1610
  // ── checkpoint login ──
1611
1611
  program
1612
1612
  .command('login')
@@ -8,6 +8,7 @@ function buildMinimalTrackingScript() {
8
8
  var pickPointerDownHandler=null;
9
9
  var pickClickHandler=null;
10
10
  var pickEscHandler=null;
11
+ var pickKeydownHandler=null;
11
12
  var hoverRaf=0;
12
13
  var lastMouseX=0;
13
14
  var lastMouseY=0;
@@ -15,6 +16,7 @@ function buildMinimalTrackingScript() {
15
16
  var inspectLabel=null;
16
17
  var lastPath='';
17
18
  var mutationTick=false;
19
+ var pendingPickCommit=false;
18
20
 
19
21
  function getMetrics(){
20
22
  var de=document.documentElement;
@@ -446,10 +448,13 @@ function buildMinimalTrackingScript() {
446
448
  if(pickPointerDownHandler) window.removeEventListener('pointerdown',pickPointerDownHandler,true);
447
449
  if(pickClickHandler) window.removeEventListener('click',pickClickHandler,true);
448
450
  if(pickEscHandler) window.removeEventListener('keydown',pickEscHandler,true);
451
+ if(pickKeydownHandler) window.removeEventListener('keydown',pickKeydownHandler,true);
449
452
  pickMoveHandler=null;
450
453
  pickPointerDownHandler=null;
451
454
  pickClickHandler=null;
452
455
  pickEscHandler=null;
456
+ pickKeydownHandler=null;
457
+ pendingPickCommit=false;
453
458
  if(hoverRaf){
454
459
  cancelAnimationFrame(hoverRaf);
455
460
  hoverRaf=0;
@@ -478,22 +483,38 @@ function buildMinimalTrackingScript() {
478
483
  try{
479
484
  postPickResult(target,ev.clientX,ev.clientY);
480
485
  }catch(e){}
481
- setPickMode(false);
486
+ // Keep pick mode active until the subsequent click is swallowed,
487
+ // otherwise link/tab navigation can still fire.
488
+ pendingPickCommit=true;
482
489
  };
483
490
  pickClickHandler=function(ev){
484
491
  if(!pickMode) return;
485
492
  ev.preventDefault();
486
493
  ev.stopPropagation();
487
494
  if(typeof ev.stopImmediatePropagation==='function') ev.stopImmediatePropagation();
495
+ if(pendingPickCommit){
496
+ pendingPickCommit=false;
497
+ setPickMode(false);
498
+ }
488
499
  };
489
500
  pickEscHandler=function(ev){
490
501
  if(ev.key==='Escape') setPickMode(false);
491
502
  };
503
+ pickKeydownHandler=function(ev){
504
+ if(!pickMode) return;
505
+ // Block keyboard-activated interactions while choosing anchor.
506
+ if(ev.key==='Enter'||ev.key===' '||ev.key==='Spacebar'){
507
+ ev.preventDefault();
508
+ ev.stopPropagation();
509
+ if(typeof ev.stopImmediatePropagation==='function') ev.stopImmediatePropagation();
510
+ }
511
+ };
492
512
 
493
513
  document.addEventListener('mousemove',pickMoveHandler,true);
494
514
  window.addEventListener('pointerdown',pickPointerDownHandler,true);
495
515
  window.addEventListener('click',pickClickHandler,true);
496
516
  window.addEventListener('keydown',pickEscHandler,true);
517
+ window.addEventListener('keydown',pickKeydownHandler,true);
497
518
  }
498
519
 
499
520
  function reportScroll(){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "checkpoint-cli",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Share your localhost with reviewers — get visual feedback directly on the page",
5
5
  "keywords": [
6
6
  "checkpoint",