vue-devui 1.6.24 → 1.6.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-devui",
3
- "version": "1.6.24",
3
+ "version": "1.6.25",
4
4
  "license": "MIT",
5
5
  "description": "DevUI components based on Vite and Vue3",
6
6
  "keywords": [
@@ -1,5 +1,5 @@
1
1
  import type { Ref } from 'vue';
2
2
  import type { CodeReviewProps } from '../code-review-types';
3
- export declare function useCodeReviewLineSelection(reviewContentRef: Ref<HTMLElement>, props: CodeReviewProps, mouseMoveCb: () => void, mouseupCb: () => void): {
3
+ export declare function useCodeReviewLineSelection(reviewContentRef: Ref<HTMLElement>, props: CodeReviewProps, mouseMoveCb: (moveDirection: 'up' | 'down') => void, mouseupCb: () => void): {
4
4
  onMousedown: (e: MouseEvent) => void;
5
5
  };
package/vue-devui.es.js CHANGED
@@ -17758,6 +17758,7 @@ function useCodeReviewLineSelection(reviewContentRef, props, mouseMoveCb, mouseu
17758
17758
  let isClickedLeft;
17759
17759
  let shouldClear;
17760
17760
  let isMouseMoved;
17761
+ let startClientY;
17761
17762
  const onMousedown2 = (e) => {
17762
17763
  if (e.button === 0) {
17763
17764
  const composedPath = e.composedPath();
@@ -17790,6 +17791,7 @@ function useCodeReviewLineSelection(reviewContentRef, props, mouseMoveCb, mouseu
17790
17791
  dragging = true;
17791
17792
  shouldClear = true;
17792
17793
  isMouseMoved = false;
17794
+ startClientY = e.clientY;
17793
17795
  e.preventDefault();
17794
17796
  e.stopPropagation();
17795
17797
  document.addEventListener("mousemove", onMousemove);
@@ -17822,7 +17824,7 @@ function useCodeReviewLineSelection(reviewContentRef, props, mouseMoveCb, mouseu
17822
17824
  if (endIndex === -1) {
17823
17825
  return;
17824
17826
  }
17825
- mouseMoveCb();
17827
+ mouseMoveCb(e.clientY > startClientY ? "down" : "up");
17826
17828
  if (startIndex > endIndex) {
17827
17829
  [startIndex, endIndex] = [endIndex, startIndex];
17828
17830
  }
@@ -17987,7 +17989,7 @@ function useCodeReviewComment(reviewContentRef, props, ctx2) {
17987
17989
  resetLeftTop();
17988
17990
  }
17989
17991
  };
17990
- const getLineNumbers = (currentNumber, currentNumbers) => {
17992
+ const getLineNumbers = (currentNumber, currentNumbers, moveDirection) => {
17991
17993
  if (currentNumber === -1) {
17992
17994
  return currentNumbers;
17993
17995
  }
@@ -17997,12 +17999,12 @@ function useCodeReviewComment(reviewContentRef, props, ctx2) {
17997
17999
  const numbers = [...currentNumbers];
17998
18000
  let max = Math.max(...numbers);
17999
18001
  let min = Math.min(...numbers);
18000
- if (currentNumber < min) {
18001
- min = currentNumber;
18002
- }
18003
- if (currentNumber > max) {
18002
+ if (moveDirection === "down") {
18004
18003
  max = currentNumber;
18005
18004
  }
18005
+ if (moveDirection === "up") {
18006
+ min = currentNumber;
18007
+ }
18006
18008
  return Array.from({ length: max - min + 1 }, (_, i) => i + min);
18007
18009
  };
18008
18010
  const getCommonClassAndJudge = () => {
@@ -18071,9 +18073,9 @@ function useCodeReviewComment(reviewContentRef, props, ctx2) {
18071
18073
  }
18072
18074
  getDoubleCheckedLineCode(shouldRenderClass);
18073
18075
  }
18074
- function updateLineNumbers() {
18075
- currentLeftLineNumbers = currentLeftLineNumber === -1 ? currentLeftLineNumbers : getLineNumbers(currentLeftLineNumber, currentLeftLineNumbers);
18076
- currentRightLineNumbers = currentRightLineNumber === -1 ? currentRightLineNumbers : getLineNumbers(currentRightLineNumber, currentRightLineNumbers);
18076
+ function updateLineNumbers(moveDirection) {
18077
+ currentLeftLineNumbers = currentLeftLineNumber === -1 ? currentLeftLineNumbers : getLineNumbers(currentLeftLineNumber, currentLeftLineNumbers, moveDirection);
18078
+ currentRightLineNumbers = currentRightLineNumber === -1 ? currentRightLineNumbers : getLineNumbers(currentRightLineNumber, currentRightLineNumbers, moveDirection);
18077
18079
  getCheckedLineCode(false);
18078
18080
  afterCheckLinesEmitData = {
18079
18081
  left: currentLeftLineNumber,
@@ -54285,7 +54287,7 @@ const installs = [
54285
54287
  VirtualListInstall
54286
54288
  ];
54287
54289
  var vueDevui = {
54288
- version: "1.6.24",
54290
+ version: "1.6.25",
54289
54291
  install(app) {
54290
54292
  installs.forEach((p) => app.use(p));
54291
54293
  }