vim-web 0.3.44-dev.82 → 0.3.44-dev.84

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/vim-web.js CHANGED
@@ -52455,6 +52455,7 @@ class MouseHandler extends BaseInputHandler {
52455
52455
  __publicField(this, "_lastMouseDownPosition", new Vector2(0, 0));
52456
52456
  __publicField(this, "_capture");
52457
52457
  __publicField(this, "_dragHandler");
52458
+ __publicField(this, "_doubleClickHandler", new DoubleClickHandler());
52458
52459
  __publicField(this, "onButtonDown");
52459
52460
  __publicField(this, "onButtonUp");
52460
52461
  __publicField(this, "onMouseMove");
@@ -52464,29 +52465,26 @@ class MouseHandler extends BaseInputHandler {
52464
52465
  __publicField(this, "onDoubleClick");
52465
52466
  __publicField(this, "onWheel");
52466
52467
  this._capture = new CaptureStateMachine(canvas);
52467
- this._dragHandler = new DragHandler(canvas, (delta, button) => this.onDrag(delta, button));
52468
+ this._dragHandler = new DragHandler((delta, button) => this.onDrag(delta, button));
52468
52469
  }
52469
52470
  addListeners() {
52470
52471
  this.reg(this._canvas, "pointerdown", (e) => {
52471
- this.onPointerDown(e);
52472
+ this.handlePointerDown(e);
52472
52473
  });
52473
52474
  this.reg(this._canvas, "pointerup", (e) => {
52474
- this.onPointerUp(e);
52475
+ this.handlePointerUp(e);
52475
52476
  });
52476
52477
  this.reg(this._canvas, "pointermove", (e) => {
52477
- this.onPointerMove(e);
52478
+ this.handlePointerMove(e);
52478
52479
  });
52479
52480
  this.reg(this._canvas, "wheel", (e) => {
52480
52481
  this.onMouseScroll(e);
52481
52482
  });
52482
- this.reg(this._canvas, "dblclick", (e) => {
52483
- this._onDoubleClick(e);
52484
- });
52485
52483
  }
52486
52484
  dispose() {
52487
52485
  this.unregister();
52488
52486
  }
52489
- onPointerDown(event) {
52487
+ handlePointerDown(event) {
52490
52488
  var _a3;
52491
52489
  if (event.pointerType !== "mouse") return;
52492
52490
  const pos = this.relativePosition(event);
@@ -52496,14 +52494,18 @@ class MouseHandler extends BaseInputHandler {
52496
52494
  this._capture.onPointerDown(event);
52497
52495
  event.preventDefault();
52498
52496
  }
52499
- onPointerUp(event) {
52497
+ handlePointerUp(event) {
52500
52498
  var _a3;
52501
52499
  if (event.pointerType !== "mouse") return;
52502
52500
  const pos = this.relativePosition(event);
52503
52501
  (_a3 = this.onButtonUp) == null ? void 0 : _a3.call(this, pos, event.button);
52504
- this.handleMouseClick(event);
52505
52502
  this._capture.onPointerUp(event);
52506
52503
  this._dragHandler.onPointerUp();
52504
+ if (this._doubleClickHandler.checkForDoubleClick(event)) {
52505
+ this.handleDoubleClick(event);
52506
+ } else {
52507
+ this.handleMouseClick(event);
52508
+ }
52507
52509
  event.preventDefault();
52508
52510
  }
52509
52511
  async handleMouseClick(event) {
@@ -52517,7 +52519,7 @@ class MouseHandler extends BaseInputHandler {
52517
52519
  const modif = event.getModifierState("Shift") || event.getModifierState("Control");
52518
52520
  (_a3 = this.onClick) == null ? void 0 : _a3.call(this, pos, modif);
52519
52521
  }
52520
- onPointerMove(event) {
52522
+ handlePointerMove(event) {
52521
52523
  var _a3;
52522
52524
  if (event.pointerType !== "mouse") return;
52523
52525
  this._canvas.focus();
@@ -52526,7 +52528,7 @@ class MouseHandler extends BaseInputHandler {
52526
52528
  this._dragHandler.onPointerMove(pos);
52527
52529
  (_a3 = this.onMouseMove) == null ? void 0 : _a3.call(this, pos);
52528
52530
  }
52529
- async _onDoubleClick(event) {
52531
+ async handleDoubleClick(event) {
52530
52532
  var _a3;
52531
52533
  const pos = this.relativePosition(event);
52532
52534
  (_a3 = this.onDoubleClick) == null ? void 0 : _a3.call(this, pos);
@@ -52575,13 +52577,24 @@ class CaptureStateMachine {
52575
52577
  }
52576
52578
  }
52577
52579
  }
52580
+ class DoubleClickHandler {
52581
+ constructor() {
52582
+ __publicField(this, "_lastClickTime", 0);
52583
+ __publicField(this, "_clickDelay", 300);
52584
+ }
52585
+ // Delay in milliseconds to consider a double click
52586
+ checkForDoubleClick(event) {
52587
+ const currentTime = Date.now();
52588
+ const timeDiff = currentTime - this._lastClickTime;
52589
+ this._lastClickTime = currentTime;
52590
+ return timeDiff < this._clickDelay;
52591
+ }
52592
+ }
52578
52593
  class DragHandler {
52579
- constructor(canvas, onDrag) {
52580
- __publicField(this, "_canvas");
52594
+ constructor(onDrag) {
52581
52595
  __publicField(this, "_lastDragPosition", null);
52582
52596
  __publicField(this, "_button");
52583
52597
  __publicField(this, "_onDrag");
52584
- this._canvas = canvas;
52585
52598
  this._onDrag = onDrag;
52586
52599
  }
52587
52600
  /**
@@ -52611,9 +52624,6 @@ class DragHandler {
52611
52624
  onPointerUp() {
52612
52625
  this._lastDragPosition = null;
52613
52626
  }
52614
- getCanvasSize() {
52615
- return new Vector2(this._canvas.clientWidth, this._canvas.clientHeight);
52616
- }
52617
52627
  }
52618
52628
  class TouchHandler extends BaseInputHandler {
52619
52629
  constructor(canvas) {
@@ -63703,7 +63713,8 @@ function getDefaultSettings() {
63703
63713
  capacity: {
63704
63714
  canFollowUrl: true,
63705
63715
  canGoFullScreen: true,
63706
- canDownload: true
63716
+ canDownload: true,
63717
+ canReadLocalStorage: true
63707
63718
  },
63708
63719
  ui: {
63709
63720
  logo: true,