@vuer-ai/vuer-uikit 0.0.48 → 0.0.49

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.
Files changed (112) hide show
  1. package/dist/{chunk-25I4OTUA.js → chunk-2FCKLHWA.js} +1 -1
  2. package/dist/{chunk-UZFOWGVD.mjs → chunk-5CWWM4L7.mjs} +9 -2
  3. package/dist/{chunk-XPHG4P4D.mjs → chunk-AJKD26TR.mjs} +1 -1
  4. package/dist/{chunk-QQMHPZFI.js → chunk-JIRSHP3D.js} +9 -2
  5. package/dist/highlight-cursor/enhanced-components.js +1 -1
  6. package/dist/highlight-cursor/enhanced-components.mjs +1 -1
  7. package/dist/highlight-cursor/index.js +1 -1
  8. package/dist/highlight-cursor/index.mjs +1 -1
  9. package/dist/hooks/index.js +2 -2
  10. package/dist/hooks/index.mjs +1 -1
  11. package/dist/hooks/useDragSelect.js +2 -2
  12. package/dist/hooks/useDragSelect.mjs +1 -1
  13. package/dist/index.js +4 -4
  14. package/dist/index.mjs +2 -2
  15. package/dist/ui/avatar.js +1 -1
  16. package/dist/ui/avatar.mjs +1 -1
  17. package/dist/ui/badge.js +1 -1
  18. package/dist/ui/badge.mjs +1 -1
  19. package/dist/ui/button.js +1 -1
  20. package/dist/ui/button.mjs +1 -1
  21. package/dist/ui/card.js +1 -1
  22. package/dist/ui/card.mjs +1 -1
  23. package/dist/ui/checkbox.js +1 -1
  24. package/dist/ui/checkbox.mjs +1 -1
  25. package/dist/ui/collapsible.js +1 -1
  26. package/dist/ui/collapsible.mjs +1 -1
  27. package/dist/ui/drawer.js +1 -1
  28. package/dist/ui/drawer.mjs +1 -1
  29. package/dist/ui/dropdown.js +1 -1
  30. package/dist/ui/dropdown.mjs +1 -1
  31. package/dist/ui/form/CmInput.js +1 -1
  32. package/dist/ui/form/CmInput.mjs +1 -1
  33. package/dist/ui/form/DegInput.js +1 -1
  34. package/dist/ui/form/DegInput.mjs +1 -1
  35. package/dist/ui/form/EulerDegInput.js +1 -1
  36. package/dist/ui/form/EulerDegInput.mjs +1 -1
  37. package/dist/ui/form/EulerInput.js +1 -1
  38. package/dist/ui/form/EulerInput.mjs +1 -1
  39. package/dist/ui/form/EulerRadInput.js +1 -1
  40. package/dist/ui/form/EulerRadInput.mjs +1 -1
  41. package/dist/ui/form/InchInput.js +1 -1
  42. package/dist/ui/form/InchInput.mjs +1 -1
  43. package/dist/ui/form/IntInput.js +1 -1
  44. package/dist/ui/form/IntInput.mjs +1 -1
  45. package/dist/ui/form/KVectorInput.js +1 -1
  46. package/dist/ui/form/KVectorInput.mjs +1 -1
  47. package/dist/ui/form/NumberInput.js +1 -1
  48. package/dist/ui/form/NumberInput.mjs +1 -1
  49. package/dist/ui/form/QuaternionInput.js +1 -1
  50. package/dist/ui/form/QuaternionInput.mjs +1 -1
  51. package/dist/ui/form/RadInput.js +1 -1
  52. package/dist/ui/form/RadInput.mjs +1 -1
  53. package/dist/ui/form/TimeInput.js +1 -1
  54. package/dist/ui/form/TimeInput.mjs +1 -1
  55. package/dist/ui/form/Vec3Input.js +1 -1
  56. package/dist/ui/form/Vec3Input.mjs +1 -1
  57. package/dist/ui/form/VectorInput.js +1 -1
  58. package/dist/ui/form/VectorInput.mjs +1 -1
  59. package/dist/ui/form/index.js +1 -1
  60. package/dist/ui/form/index.mjs +1 -1
  61. package/dist/ui/index.js +3 -3
  62. package/dist/ui/index.mjs +2 -2
  63. package/dist/ui/input-numbers.js +1 -1
  64. package/dist/ui/input-numbers.mjs +1 -1
  65. package/dist/ui/input.js +1 -1
  66. package/dist/ui/input.mjs +1 -1
  67. package/dist/ui/layout.js +1 -1
  68. package/dist/ui/layout.mjs +1 -1
  69. package/dist/ui/modal.js +1 -1
  70. package/dist/ui/modal.mjs +1 -1
  71. package/dist/ui/pagination.js +1 -1
  72. package/dist/ui/pagination.mjs +1 -1
  73. package/dist/ui/popover.js +1 -1
  74. package/dist/ui/popover.mjs +1 -1
  75. package/dist/ui/radio-group.js +1 -1
  76. package/dist/ui/radio-group.mjs +1 -1
  77. package/dist/ui/resizable.js +1 -1
  78. package/dist/ui/resizable.mjs +1 -1
  79. package/dist/ui/select.js +1 -1
  80. package/dist/ui/select.mjs +1 -1
  81. package/dist/ui/separator.js +1 -1
  82. package/dist/ui/separator.mjs +1 -1
  83. package/dist/ui/sheet.js +1 -1
  84. package/dist/ui/sheet.mjs +1 -1
  85. package/dist/ui/sidebar.js +1 -1
  86. package/dist/ui/sidebar.mjs +1 -1
  87. package/dist/ui/skeleton.js +1 -1
  88. package/dist/ui/skeleton.mjs +1 -1
  89. package/dist/ui/slider.js +1 -1
  90. package/dist/ui/slider.mjs +1 -1
  91. package/dist/ui/switch.js +1 -1
  92. package/dist/ui/switch.mjs +1 -1
  93. package/dist/ui/tabs.js +1 -1
  94. package/dist/ui/tabs.mjs +1 -1
  95. package/dist/ui/textarea.js +1 -1
  96. package/dist/ui/textarea.mjs +1 -1
  97. package/dist/ui/timeline.js +1 -1
  98. package/dist/ui/timeline.mjs +1 -1
  99. package/dist/ui/toggle-group.js +1 -1
  100. package/dist/ui/toggle-group.mjs +1 -1
  101. package/dist/ui/toggle.js +1 -1
  102. package/dist/ui/toggle.mjs +1 -1
  103. package/dist/ui/tooltip.js +1 -1
  104. package/dist/ui/tooltip.mjs +1 -1
  105. package/dist/ui/tree-view-v2.js +1 -1
  106. package/dist/ui/tree-view-v2.mjs +1 -1
  107. package/dist/ui/tree-view.js +1 -1
  108. package/dist/ui/tree-view.mjs +1 -1
  109. package/dist/ui/version-badge.js +3 -3
  110. package/dist/ui/version-badge.mjs +2 -2
  111. package/package.json +1 -1
  112. package/src/hooks/useDragSelect.ts +12 -2
@@ -8,6 +8,7 @@ export function useDragSelect(options: UseDragSelectOptions = {}) {
8
8
  const [selectedItems, setSelectedItems] = useState<Set<string>>(new Set());
9
9
  const [isDragging, setIsDragging] = useState(false);
10
10
  const [dragMode, setDragMode] = useState<'toggle' | 'replace'>('toggle');
11
+ const [dragStartItem, setDragStartItem] = useState<string | null>(null);
11
12
 
12
13
  // Notify when selection changes
13
14
  useEffect(() => {
@@ -17,14 +18,17 @@ export function useDragSelect(options: UseDragSelectOptions = {}) {
17
18
  const handleMouseDown = useCallback((id: string, e: React.MouseEvent) => {
18
19
  e.preventDefault();
19
20
  setIsDragging(true);
21
+ setDragStartItem(id);
20
22
 
21
23
  // Determine drag mode based on modifier keys
22
24
  const mode = e.ctrlKey || e.metaKey ? 'replace' : 'toggle';
23
25
  setDragMode(mode);
24
26
 
25
27
  if (mode === 'replace') {
28
+ // In replace mode, start fresh selection
26
29
  setSelectedItems(new Set([id]));
27
30
  } else {
31
+ // In toggle mode, toggle the starting item
28
32
  setSelectedItems((prev) => {
29
33
  const newSet = new Set(prev);
30
34
  if (newSet.has(id)) {
@@ -40,10 +44,12 @@ export function useDragSelect(options: UseDragSelectOptions = {}) {
40
44
  const handleMouseEnter = useCallback(
41
45
  (id: string) => {
42
46
  if (!isDragging) return;
47
+ if (id === dragStartItem) return; // Don't re-process the starting item
43
48
 
44
49
  if (dragMode === 'replace') {
45
50
  setSelectedItems((prev) => new Set([...prev, id]));
46
51
  } else {
52
+ // In toggle mode, each item toggles its own state
47
53
  setSelectedItems((prev) => {
48
54
  const newSet = new Set(prev);
49
55
  if (newSet.has(id)) {
@@ -55,11 +61,12 @@ export function useDragSelect(options: UseDragSelectOptions = {}) {
55
61
  });
56
62
  }
57
63
  },
58
- [isDragging, dragMode]
64
+ [isDragging, dragMode, dragStartItem]
59
65
  );
60
66
 
61
67
  const handleMouseUp = useCallback(() => {
62
68
  setIsDragging(false);
69
+ setDragStartItem(null);
63
70
  }, []);
64
71
 
65
72
  const clearSelection = useCallback(() => {
@@ -82,7 +89,10 @@ export function useDragSelect(options: UseDragSelectOptions = {}) {
82
89
 
83
90
  // Handle global mouse up and escape key
84
91
  useEffect(() => {
85
- const handleGlobalMouseUp = () => setIsDragging(false);
92
+ const handleGlobalMouseUp = () => {
93
+ setIsDragging(false);
94
+ setDragStartItem(null);
95
+ };
86
96
  const handleEscape = (e: KeyboardEvent) => {
87
97
  if (e.key === 'Escape') {
88
98
  clearSelection();