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.
@@ -7048,6 +7048,7 @@ function useCodeReviewLineSelection(reviewContentRef, props, mouseMoveCb, mouseu
7048
7048
  let isClickedLeft;
7049
7049
  let shouldClear;
7050
7050
  let isMouseMoved;
7051
+ let startClientY;
7051
7052
  const onMousedown = (e) => {
7052
7053
  if (e.button === 0) {
7053
7054
  const composedPath = e.composedPath();
@@ -7080,6 +7081,7 @@ function useCodeReviewLineSelection(reviewContentRef, props, mouseMoveCb, mouseu
7080
7081
  dragging = true;
7081
7082
  shouldClear = true;
7082
7083
  isMouseMoved = false;
7084
+ startClientY = e.clientY;
7083
7085
  e.preventDefault();
7084
7086
  e.stopPropagation();
7085
7087
  document.addEventListener("mousemove", onMousemove);
@@ -7112,7 +7114,7 @@ function useCodeReviewLineSelection(reviewContentRef, props, mouseMoveCb, mouseu
7112
7114
  if (endIndex === -1) {
7113
7115
  return;
7114
7116
  }
7115
- mouseMoveCb();
7117
+ mouseMoveCb(e.clientY > startClientY ? "down" : "up");
7116
7118
  if (startIndex > endIndex) {
7117
7119
  [startIndex, endIndex] = [endIndex, startIndex];
7118
7120
  }
@@ -7277,7 +7279,7 @@ function useCodeReviewComment(reviewContentRef, props, ctx) {
7277
7279
  resetLeftTop();
7278
7280
  }
7279
7281
  };
7280
- const getLineNumbers = (currentNumber, currentNumbers) => {
7282
+ const getLineNumbers = (currentNumber, currentNumbers, moveDirection) => {
7281
7283
  if (currentNumber === -1) {
7282
7284
  return currentNumbers;
7283
7285
  }
@@ -7287,12 +7289,12 @@ function useCodeReviewComment(reviewContentRef, props, ctx) {
7287
7289
  const numbers = [...currentNumbers];
7288
7290
  let max = Math.max(...numbers);
7289
7291
  let min = Math.min(...numbers);
7290
- if (currentNumber < min) {
7291
- min = currentNumber;
7292
- }
7293
- if (currentNumber > max) {
7292
+ if (moveDirection === "down") {
7294
7293
  max = currentNumber;
7295
7294
  }
7295
+ if (moveDirection === "up") {
7296
+ min = currentNumber;
7297
+ }
7296
7298
  return Array.from({ length: max - min + 1 }, (_, i) => i + min);
7297
7299
  };
7298
7300
  const getCommonClassAndJudge = () => {
@@ -7361,9 +7363,9 @@ function useCodeReviewComment(reviewContentRef, props, ctx) {
7361
7363
  }
7362
7364
  getDoubleCheckedLineCode(shouldRenderClass);
7363
7365
  }
7364
- function updateLineNumbers() {
7365
- currentLeftLineNumbers = currentLeftLineNumber === -1 ? currentLeftLineNumbers : getLineNumbers(currentLeftLineNumber, currentLeftLineNumbers);
7366
- currentRightLineNumbers = currentRightLineNumber === -1 ? currentRightLineNumbers : getLineNumbers(currentRightLineNumber, currentRightLineNumbers);
7366
+ function updateLineNumbers(moveDirection) {
7367
+ currentLeftLineNumbers = currentLeftLineNumber === -1 ? currentLeftLineNumbers : getLineNumbers(currentLeftLineNumber, currentLeftLineNumbers, moveDirection);
7368
+ currentRightLineNumbers = currentRightLineNumber === -1 ? currentRightLineNumbers : getLineNumbers(currentRightLineNumber, currentRightLineNumbers, moveDirection);
7367
7369
  getCheckedLineCode(false);
7368
7370
  afterCheckLinesEmitData = {
7369
7371
  left: currentLeftLineNumber,