@plait/core 0.9.0 → 0.10.0

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.
@@ -1779,6 +1779,7 @@ function createBoard(children, options) {
1779
1779
  onChange: () => { },
1780
1780
  mousedown: (event) => { },
1781
1781
  mousemove: (event) => { },
1782
+ mouseleave: (event) => { },
1782
1783
  globalMousemove: (event) => { },
1783
1784
  mouseup: (event) => { },
1784
1785
  globalMouseup: (event) => { },
@@ -1976,7 +1977,6 @@ function withSelection(board) {
1976
1977
  const range = { anchor: point, focus: point };
1977
1978
  const hitElements = getHitElements(board, { ranges: [range] });
1978
1979
  if (PlaitBoard.isPointer(board, PlaitPointerType.selection) &&
1979
- getHitElements(board, { ranges: [range] }).length === 0 &&
1980
1980
  hitElements.length === 0 &&
1981
1981
  options.isMultiple &&
1982
1982
  !options.isDisabledSelect) {
@@ -2470,7 +2470,6 @@ class PlaitBoardComponent {
2470
2470
  this.initializeHookListener();
2471
2471
  this.viewportScrollListener();
2472
2472
  this.elementResizeListener();
2473
- this.mouseLeaveListener();
2474
2473
  });
2475
2474
  BOARD_TO_COMPONENT.set(this.board, this);
2476
2475
  BOARD_TO_ROUGH_SVG.set(this.board, roughSVG);
@@ -2541,6 +2540,12 @@ class PlaitBoardComponent {
2541
2540
  BOARD_TO_MOVING_POINT.set(this.board, [event.x, event.y]);
2542
2541
  this.board.mousemove(event);
2543
2542
  });
2543
+ fromEvent(this.host, 'mouseleave')
2544
+ .pipe(takeUntil(this.destroy$))
2545
+ .subscribe((event) => {
2546
+ BOARD_TO_MOVING_POINT.delete(this.board);
2547
+ this.board.mouseleave(event);
2548
+ });
2544
2549
  fromEvent(document, 'mousemove')
2545
2550
  .pipe(takeUntil(this.destroy$))
2546
2551
  .subscribe((event) => {
@@ -2646,13 +2651,6 @@ class PlaitBoardComponent {
2646
2651
  });
2647
2652
  this.resizeObserver.observe(this.nativeElement);
2648
2653
  }
2649
- mouseLeaveListener() {
2650
- fromEvent(this.host, 'mouseleave')
2651
- .pipe(takeUntil(this.destroy$))
2652
- .subscribe((event) => {
2653
- BOARD_TO_MOVING_POINT.delete(this.board);
2654
- });
2655
- }
2656
2654
  initializeIslands() {
2657
2655
  this.islands?.forEach(island => {
2658
2656
  island.initialize(this.board);