@vue-dnd-kit/core 0.5.4 → 0.5.6

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 CHANGED
@@ -1,21 +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
+ 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.
package/README.md CHANGED
@@ -1,274 +1,252 @@
1
- # Vue Drag & Drop Library - Core Package
2
-
3
- [![Beta](https://img.shields.io/badge/status-beta-yellow.svg)](https://github.com/zizigy/vue-dnd-kit)
4
-
5
- > ⚠️ **Warning**: This project is in active development (beta). The API may change between minor versions. Not recommended for production use until version 1.0.0.
6
-
7
- <p align="center">
8
- <a href="https://zizigy.github.io/vue-dnd-hooks/">
9
- <img src="https://raw.githubusercontent.com/ZiZiGY/vue-dnd-hooks/master/public/logo.svg" width="400" alt="Vue Drag & Drop Logo">
10
- </a>
11
- </p>
12
-
13
- <p align="center">
14
- Core package of the Vue Drag & Drop library with essential hooks and functionality.
15
- </p>
16
-
17
- <p align="center">
18
- <a href="https://zizigy.github.io/vue-dnd-hooks/" target="_blank">
19
- <img src="https://img.shields.io/badge/Documentation-Visit-blue?style=flat-square" alt="Documentation">
20
- </a>
21
- </p>
22
-
23
- <p align="center">
24
- Inspired by the popular <a href="https://dndkit.com/" target="_blank">React DnD Kit</a> library, adapted for Vue.js
25
- </p>
26
-
27
- ## Project Status
28
-
29
- This project is in active development. We're working toward a stable API, but until version 1.0.0, there may be breaking changes.
30
-
31
- Roadmap:
32
-
33
- - [x] Basic drag & drop functionality
34
- - [x] Complete documentation
35
- - [ ] Tests
36
- - [ ] Stable API (version 1.0.0)
37
-
38
- ## Features
39
-
40
- ### Core Capabilities
41
-
42
- - 🎯 **Simple Composables API**
43
-
44
- - Intuitive hooks-based approach
45
- - Clean and declarative syntax
46
- - Minimal boilerplate code
47
-
48
- - 🎨 **Full Customization**
49
-
50
- - Custom drag overlays
51
- - Flexible styling system
52
- - Animation support
53
- - Custom drag handles
54
-
55
- - 📱 **Advanced Input Support**
56
-
57
- - Touch devices support
58
- - Mouse events
59
- - Multi-touch gestures
60
-
61
- ### Performance
62
-
63
- - **Optimized Rendering**
64
-
65
- - Virtual DOM friendly
66
- - Minimal re-renders
67
- - Efficient DOM updates
68
- - Memory leak prevention
69
-
70
- - 🔄 **Smart Auto-scrolling**
71
-
72
- - Smooth scroll animations
73
- - Configurable thresholds
74
- - Performance-optimized
75
- - Works with nested scrollable containers
76
-
77
- ### Developer Experience
78
-
79
- - 🔍 **TypeScript Ready**
80
-
81
- - Full type coverage
82
- - Type inference
83
- - IDE autocompletion
84
- - Type-safe events
85
-
86
- - 📐 **Layout Features**
87
-
88
- - Grid system support
89
- - Flex layout compatible
90
- - Responsive design ready
91
- - Dynamic constraints
92
-
93
- ### Advanced Features
94
-
95
- - 🎯 **Smart Grouping**
96
-
97
- - Element groups
98
- - Zone filtering
99
- - Nested groups
100
- - Dynamic group validation
101
-
102
- - 📊 **Rich Events System**
103
-
104
- - Comprehensive lifecycle events
105
- - Custom event handlers
106
- - Drag state tracking
107
- - Position coordinates
108
-
109
- - 🛡️ **Built-in Utilities**
110
-
111
- - Geometry calculations
112
- - Bounding box tracking
113
- - Position management
114
- - Intersection detection
115
-
116
- ### Integration
117
-
118
- - 🔌 **Framework Integration**
119
- - Vue 3 Composition API
120
- - Nuxt.js compatible
121
- - Works with SSR
122
- - Plugin ecosystem ready
123
-
124
- ## Installation
125
-
126
- Choose your preferred package manager:
127
-
128
- ```bash
129
- npm install @vue-dnd-kit/core
130
- ```
131
-
132
- ```bash
133
- yarn add @vue-dnd-kit/core
134
- ```
135
-
136
- ```bash
137
- pnpm install @vue-dnd-kit/core
138
- ```
139
-
140
- ## Setup
141
-
142
- Register the plugin in your main.js/ts file:
143
-
144
- ```js
145
- import { createApp } from 'vue';
146
- import App from './App.vue';
147
- import VueDnDKitPlugin from '@vue-dnd-kit/core';
148
-
149
- const app = createApp(App);
150
- app.use(VueDnDKitPlugin);
151
- app.mount('#app');
152
- ```
153
-
154
- ## Basic Usage
155
-
156
- ### App.vue
157
-
158
- <sup>📄 Root Application Component</sup>
159
-
160
- ```vue
161
- <script setup lang="ts">
162
- import { ref } from 'vue';
163
- import { DragOverlay } from '@vue-dnd-kit/core';
164
- import Draggable from './components/Draggable.vue';
165
- import Droppable from './components/Droppable.vue';
166
-
167
- const handleDrop = () => (elementInDropZone.value = true);
168
-
169
- const handleEnd = () => (elementInDropZone.value = false);
170
-
171
- const elementInDropZone = ref<boolean>(false);
172
- </script>
173
-
174
- <template>
175
- <div>
176
- <Draggable v-if="!elementInDropZone"> drag me </Draggable>
177
- <Droppable @drop="handleDrop">
178
- <Draggable
179
- v-if="elementInDropZone"
180
- @end="handleEnd"
181
- >
182
- im in drop zone
183
- </Draggable>
184
- </Droppable>
185
-
186
- <DragOverlay />
187
- </div>
188
- </template>
189
- ```
190
-
191
- ### Draggable.vue
192
-
193
- <sup>🧩 components/Draggable.vue</sup>
194
-
195
- ```vue
196
- <script setup lang="ts">
197
- import { useDraggable } from '@vue-dnd-kit/core';
198
-
199
- const emit = defineEmits<{
200
- (e: 'end'): void;
201
- }>();
202
-
203
- const { elementRef, handleDragStart, isDragging } = useDraggable({
204
- events: { onEnd: () => emit('end') },
205
- });
206
- </script>
207
-
208
- <template>
209
- <div
210
- ref="elementRef"
211
- @pointerdown="handleDragStart"
212
- :class="{ dragging: isDragging }"
213
- >
214
- <slot />
215
- </div>
216
- </template>
217
-
218
- <style scoped>
219
- .dragging {
220
- opacity: 0.5;
221
- }
222
- </style>
223
- ```
224
-
225
- ### Droppable.vue
226
-
227
- <sup>🧩 components/Droppable.vue</sup>
228
-
229
- ```vue
230
- <script setup lang="ts">
231
- import { useDroppable } from '@vue-dnd-kit/core';
232
-
233
- const emit = defineEmits<{
234
- (e: 'drop'): void;
235
- }>();
236
-
237
- const { elementRef, isOvered } = useDroppable({
238
- events: { onDrop: () => emit('drop') },
239
- });
240
- </script>
241
-
242
- <template>
243
- <div
244
- ref="elementRef"
245
- :class="{
246
- droppable: true,
247
- 'is-overed': isOvered,
248
- }"
249
- >
250
- drop here
251
- <slot />
252
- </div>
253
- </template>
254
-
255
- <style scoped>
256
- .droppable {
257
- width: 100px;
258
- height: 100px;
259
- border: 1px solid black;
260
- }
261
- .is-overed {
262
- background-color: #f0f0f0;
263
- border: 1px dashed red;
264
- }
265
- </style>
266
- ```
267
-
268
- ## 📄 License
269
-
270
- [MIT](LICENSE) © [ZiZiGY](https://github.com/ZiZiGY)
271
-
272
- ---
273
-
274
- <p align="center">Made with ❤️ for the Vue.js community</p>
1
+ # Vue Drag & Drop Library - Core Package
2
+
3
+ [![Beta](https://img.shields.io/badge/status-beta-yellow.svg)](https://github.com/zizigy/vue-dnd-kit)
4
+ > ⚠️ **Warning**: This project is in active development (beta). The API may change between minor versions. Not recommended for production use until version 1.0.0.
5
+
6
+ <p align="center">
7
+ <a href="https://zizigy.github.io/vue-dnd-hooks/">
8
+ <img src="https://raw.githubusercontent.com/ZiZiGY/vue-dnd-hooks/master/public/logo.svg" width="400" alt="Vue Drag & Drop Logo">
9
+ </a>
10
+ </p>
11
+
12
+ <p align="center">
13
+ Core package of the Vue Drag & Drop library with essential hooks and functionality.
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="https://zizigy.github.io/vue-dnd-hooks/" target="_blank">
18
+ <img src="https://img.shields.io/badge/Documentation-Visit-blue?style=flat-square" alt="Documentation">
19
+ </a>
20
+ </p>
21
+
22
+ <p align="center">
23
+ Inspired by the popular <a href="https://dndkit.com/" target="_blank">React DnD Kit</a> library, adapted for Vue.js
24
+ </p>
25
+
26
+ ## Project Status
27
+
28
+ This project is in active development. We're working toward a stable API, but until version 1.0.0, there may be breaking changes.
29
+
30
+ Roadmap:
31
+ - [x] Basic drag & drop functionality
32
+ - [x] Complete documentation
33
+ - [ ] Tests
34
+ - [ ] Stable API (version 1.0.0)
35
+
36
+ ## Features
37
+
38
+ ### Core Capabilities
39
+
40
+ - 🎯 **Simple Composables API**
41
+
42
+ - Intuitive hooks-based approach
43
+ - Clean and declarative syntax
44
+ - Minimal boilerplate code
45
+ - 🎨 **Full Customization**
46
+
47
+ - Custom drag overlays
48
+ - Flexible styling system
49
+ - Animation support
50
+ - Custom drag handles
51
+ - 📱 **Advanced Input Support**
52
+
53
+ - Touch devices support
54
+ - Mouse events
55
+ - Multi-touch gestures
56
+
57
+ ### Performance
58
+
59
+ - **Optimized Rendering**
60
+
61
+ - Virtual DOM friendly
62
+ - Minimal re-renders
63
+ - Efficient DOM updates
64
+ - Memory leak prevention
65
+ - 🔄 **Smart Auto-scrolling**
66
+
67
+ - Smooth scroll animations
68
+ - Configurable thresholds
69
+ - Performance-optimized
70
+ - Works with nested scrollable containers
71
+
72
+ ### Developer Experience
73
+
74
+ - 🔍 **TypeScript Ready**
75
+
76
+ - Full type coverage
77
+ - Type inference
78
+ - IDE autocompletion
79
+ - Type-safe events
80
+ - 📐 **Layout Features**
81
+
82
+ - Grid system support
83
+ - Flex layout compatible
84
+ - Responsive design ready
85
+ - Dynamic constraints
86
+
87
+ ### Advanced Features
88
+
89
+ - 🎯 **Smart Grouping**
90
+
91
+ - Element groups
92
+ - Zone filtering
93
+ - Nested groups
94
+ - Dynamic group validation
95
+ - 📊 **Rich Events System**
96
+
97
+ - Comprehensive lifecycle events
98
+ - Custom event handlers
99
+ - Drag state tracking
100
+ - Position coordinates
101
+ - 🛡️ **Built-in Utilities**
102
+
103
+ - Geometry calculations
104
+ - Bounding box tracking
105
+ - Position management
106
+ - Intersection detection
107
+
108
+ ### Integration
109
+
110
+ - 🔌 **Framework Integration**
111
+ - Vue 3 Composition API
112
+ - Nuxt.js compatible
113
+ - Works with SSR
114
+ - Plugin ecosystem ready
115
+
116
+ ## Installation
117
+
118
+ Choose your preferred package manager:
119
+
120
+ ```bash
121
+ npm install @vue-dnd-kit/core
122
+ ```
123
+
124
+ ```bash
125
+ yarn add @vue-dnd-kit/core
126
+ ```
127
+
128
+ ```bash
129
+ pnpm install @vue-dnd-kit/core
130
+ ```
131
+
132
+ ## Basic Usage
133
+
134
+ ### App.vue
135
+
136
+ <sup>📄 Root Application Component</sup>
137
+
138
+ ```vue
139
+ <script setup lang="ts">
140
+ import { ref } from 'vue';
141
+ import { DragOverlay } from '@vue-dnd-kit/core';
142
+ import Draggable from './components/Draggable.vue';
143
+ import Droppable from './components/Droppable.vue';
144
+
145
+ const handleDrop = () => (elementInDropZone.value = true);
146
+
147
+ const handleEnd = () => (elementInDropZone.value = false);
148
+
149
+ const elementInDropZone = ref<boolean>(false);
150
+ </script>
151
+
152
+ <template>
153
+ <div>
154
+ <Draggable v-if="!elementInDropZone"> drag me </Draggable>
155
+ <Droppable @drop="handleDrop">
156
+ <Draggable
157
+ v-if="elementInDropZone"
158
+ @end="handleEnd"
159
+ >
160
+ im in drop zone
161
+ </Draggable>
162
+ </Droppable>
163
+
164
+ <DragOverlay />
165
+ </div>
166
+ </template>
167
+ ```
168
+
169
+ ### Draggable.vue
170
+
171
+ <sup>🧩 components/Draggable.vue</sup>
172
+
173
+ ```vue
174
+ <script setup lang="ts">
175
+ import { useDraggable } from '@vue-dnd-kit/core';
176
+
177
+ const emit = defineEmits<{
178
+ (e: 'end'): void;
179
+ }>();
180
+
181
+ const { elementRef, handleDragStart, isDragging } = useDraggable({
182
+ events: { onEnd: () => emit('end') },
183
+ });
184
+ </script>
185
+
186
+ <template>
187
+ <div
188
+ ref="elementRef"
189
+ @pointerdown="handleDragStart"
190
+ :class="{ dragging: isDragging }"
191
+ >
192
+ <slot />
193
+ </div>
194
+ </template>
195
+
196
+ <style scoped>
197
+ .dragging {
198
+ opacity: 0.5;
199
+ }
200
+ </style>
201
+ ```
202
+
203
+ ### Droppable.vue
204
+
205
+ <sup>🧩 components/Droppable.vue</sup>
206
+
207
+ ```vue
208
+ <script setup lang="ts">
209
+ import { useDroppable } from '@vue-dnd-kit/core';
210
+
211
+ const emit = defineEmits<{
212
+ (e: 'drop'): void;
213
+ }>();
214
+
215
+ const { elementRef, isOvered } = useDroppable({
216
+ events: { onDrop: () => emit('drop') },
217
+ });
218
+ </script>
219
+
220
+ <template>
221
+ <div
222
+ ref="elementRef"
223
+ :class="{
224
+ droppable: true,
225
+ 'is-overed': isOvered,
226
+ }"
227
+ >
228
+ drop here
229
+ <slot />
230
+ </div>
231
+ </template>
232
+
233
+ <style scoped>
234
+ .droppable {
235
+ width: 100px;
236
+ height: 100px;
237
+ border: 1px solid black;
238
+ }
239
+ .is-overed {
240
+ background-color: #f0f0f0;
241
+ border: 1px dashed red;
242
+ }
243
+ </style>
244
+ ```
245
+
246
+ ## 📄 License
247
+
248
+ [MIT](LICENSE) © [ZiZiGY](https://github.com/ZiZiGY)
249
+
250
+ ---
251
+
252
+ <p align="center">Made with ❤️ for the Vue.js community</p>