@vue-dnd-kit/core 0.1.4-beta → 0.2.4-beta

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,252 +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
- > ⚠️ **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>
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>