@vue-dnd-kit/core 0.0.20 → 0.0.22

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 ZiZiGY
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,3 +1,5 @@
1
+ import { IDnDStore } from "../types";
2
+
1
3
  /**
2
4
  * Global store for managing drag and drop state.
3
5
  * Uses singleton pattern to ensure single source of truth across the application.
@@ -66,8 +66,8 @@
66
66
  * @property {Ref<boolean>} isDragging - Whether drag operation is in progress
67
67
  */
68
68
  export declare const useDragContainer: () => {
69
- elementRef: any;
70
- draggingElements: IDnDStore;
71
- pointerPosition: IDnDStore;
72
- isDragging: IDnDStore;
69
+ elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
70
+ draggingElements: import('vue').Ref<import('..').IDraggingElement[], import('..').IDraggingElement[]>;
71
+ pointerPosition: import('..').IPointerPosition;
72
+ isDragging: import('vue').Ref<boolean, boolean>;
73
73
  };
@@ -1,3 +1,5 @@
1
+ import { IUseDragOptions } from "../types";
2
+
1
3
  /**
2
4
  * Main hook for making elements draggable.
3
5
  * Provides all necessary functionality for drag and drop operations.
@@ -39,11 +41,11 @@
39
41
  * </script>
40
42
  * ```
41
43
  */
42
- export declare const useDraggable: (options?: any) => {
43
- pointerPosition: any;
44
- elementRef: any;
45
- isDragging: any;
46
- isOvered: any;
47
- isAllowed: any;
44
+ export declare const useDraggable: (options?: IUseDragOptions) => {
45
+ pointerPosition: import('../types').IPointerPosition;
46
+ elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
47
+ isDragging: import('vue').ComputedRef<boolean>;
48
+ isOvered: import('vue').ComputedRef<boolean>;
49
+ isAllowed: import('vue').ComputedRef<boolean>;
48
50
  handleDragStart: (event: PointerEvent) => void;
49
51
  };
@@ -1,3 +1,5 @@
1
+ import { IUseDropOptions } from "../types";
2
+
1
3
  /**
2
4
  * Hook for creating drop zones that can accept dragged elements.
3
5
  * Manages drop zone registration and interaction states.
@@ -82,8 +84,8 @@
82
84
  * </style>
83
85
  * ```
84
86
  */
85
- export declare const useDroppable: (options?: any) => {
86
- elementRef: any;
87
- isOvered: any;
88
- isAllowed: any;
87
+ export declare const useDroppable: (options?: IUseDropOptions) => {
88
+ elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
89
+ isOvered: import('vue').ComputedRef<boolean>;
90
+ isAllowed: import('vue').ComputedRef<boolean>;
89
91
  };
@@ -1,3 +1,5 @@
1
+ import { Ref } from 'vue';
2
+
1
3
  export declare const usePointer: (elementRef: Ref<HTMLElement | null>) => {
2
4
  onPointerStart: (event: PointerEvent) => void;
3
5
  onPointerMove: (event: PointerEvent | WheelEvent) => void;
@@ -1,3 +1,5 @@
1
+ import { Ref } from 'vue';
2
+
1
3
  /**
2
4
  * Hook for managing element selection in drag and drop interface
3
5
  * @param elementRef - Reference to the HTML element that can be selected
@@ -7,6 +9,6 @@ export declare const useSelection: (elementRef: Ref<HTMLElement | null>) => {
7
9
  handleUnselect: () => void;
8
10
  handleSelect: () => void;
9
11
  handleToggleSelect: () => void;
10
- isSelected: any;
11
- isParentOfSelected: any;
12
+ isSelected: import('vue').ComputedRef<boolean>;
13
+ isParentOfSelected: import('vue').ComputedRef<boolean>;
12
14
  };
@@ -1,3 +1,5 @@
1
+ import { Ref } from 'vue';
2
+
1
3
  export declare const useSensor: (elementRef: Ref<HTMLElement | null>) => {
2
4
  activate: (event: PointerEvent) => void;
3
5
  track: (event: PointerEvent | WheelEvent) => void;
@@ -1,3 +1,5 @@
1
+ import { IUseDragOptions } from "../types";
2
+
1
3
  /**
2
4
  * Hook for managing draggable elements and their interactions.
3
5
  * Provides methods for registering, unregistering elements,
@@ -6,11 +8,11 @@
6
8
  * @param options - Optional configuration object for element management
7
9
  * @returns Object containing element management state and methods
8
10
  */
9
- export declare const useElementManager: (options?: any) => {
10
- elementRef: any;
11
+ export declare const useElementManager: (options?: IUseDragOptions) => {
12
+ elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
11
13
  registerElement: () => void;
12
14
  unregisterElement: () => void;
13
- isDragging: any;
14
- isOvered: any;
15
- isAllowed: any;
15
+ isDragging: import('vue').ComputedRef<boolean>;
16
+ isOvered: import('vue').ComputedRef<boolean>;
17
+ isAllowed: import('vue').ComputedRef<boolean>;
16
18
  };
@@ -1,7 +1,9 @@
1
- export declare const useZoneManager: (options?: any) => {
2
- elementRef: any;
1
+ import { IUseDropOptions } from "../types";
2
+
3
+ export declare const useZoneManager: (options?: IUseDropOptions) => {
4
+ elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
3
5
  registerZone: () => void;
4
6
  unregisterZone: () => void;
5
- isOvered: any;
6
- isAllowed: any;
7
+ isOvered: import('vue').ComputedRef<boolean>;
8
+ isAllowed: import('vue').ComputedRef<boolean>;
7
9
  };
@@ -1,3 +1,5 @@
1
+ import { IBoundingBox, IPoint } from "../types";
2
+
1
3
  export declare const checkCollision: (boxA: IBoundingBox, boxB: IBoundingBox) => boolean;
2
4
  export declare const getBoundingBox: (element: HTMLElement | null) => IBoundingBox;
3
5
  export declare const getCenter: (box: IBoundingBox) => IPoint;
@@ -0,0 +1,5 @@
1
+ declare module '*' {
2
+ import type { DefineComponent } from 'vue';
3
+ const component: DefineComponent<{}, {}, any>;
4
+ export default component;
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-dnd-kit/core",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "Core functionality for Vue DnD Kit - a lightweight Vue 3 library for building performant and accessible drag and drop interfaces",
5
5
  "author": "ZiZIGY",
6
6
  "license": "MIT",
@@ -54,6 +54,7 @@
54
54
  "vue": "^3.5.13"
55
55
  },
56
56
  "devDependencies": {
57
+ "@types/node": "^22.13.14",
57
58
  "@vitejs/plugin-vue": "^4.2.3",
58
59
  "eslint": "^8.38.0",
59
60
  "typescript": "^4.9.5",