@vue-dnd-kit/core 2.1.3 → 2.1.5

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/README.md CHANGED
@@ -1,74 +1,74 @@
1
- # Vue DnD Kit - Core Package
2
-
3
- [![Release](https://img.shields.io/badge/status-release-green.svg)](https://github.com/zizigy/vue-dnd-kit)
4
- [![npm version](https://img.shields.io/npm/v/@vue-dnd-kit/core.svg)](https://www.npmjs.com/package/@vue-dnd-kit/core)
5
-
6
- <p align="center">
7
- <a href="https://zizigy.github.io/vue-dnd-kit/">
8
- <img src="https://raw.githubusercontent.com/ZiZiGY/vue-dnd-kit/v2/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 composables and provider-based API.
14
- </p>
15
-
16
- <p align="center">
17
- <a href="https://zizigy.github.io/vue-dnd-kit/" 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 <a href="https://dndkit.com/" target="_blank">React DnD Kit</a>, adapted for Vue.js
24
- </p>
25
-
26
- ---
27
-
28
- ## About
29
-
30
- **Vue DnD Kit** — lightweight drag & drop library for Vue 3. Built around a provider (`DnDProvider`) and composables: `makeDraggable`, `makeDroppable`, `makeSelectionArea`, `makeConstraintArea`.
31
-
32
- - **Lightweight** — small bundle size, no extra dependencies (Vue as peer only)
33
- - **Flexible** — works with any layout and design system
34
- - **Accessible** — full keyboard support (start, move, cancel, drop)
35
- - **TypeScript** — fully typed
36
-
37
- ---
38
-
39
- ## Features
40
-
41
- - **Composables API** — `makeDraggable`, `makeDroppable`, `makeSelectionArea`, `makeConstraintArea`
42
- - **Provider-based** — `DnDProvider` + `useDnDProvider` for state access
43
- - **Keyboard support** — Enter/Space for start and drop, arrows for movement, Escape to cancel
44
- - **Modifier keys** — drag only when modifier held (e.g. Ctrl)
45
- - **Custom overlay** — custom drag preview via slot or `render` option
46
-
47
- ---
48
-
49
- ## Installation
50
-
51
- ```bash
52
- npm install @vue-dnd-kit/core
53
- ```
54
-
55
- ```bash
56
- yarn add @vue-dnd-kit/core
57
- ```
58
-
59
- ```bash
60
- pnpm add @vue-dnd-kit/core
61
- ```
62
-
63
- **Peer dependency:** Vue 3
64
-
65
- ---
66
-
67
- ## License
68
-
69
- [MIT](LICENSE) © [ZiZiGY](https://github.com/ZiZiGY)
70
-
71
- ---
72
-
73
- <p align="center">🎉 Congratulations on the official release! 🎉</p>
74
- <p align="center">Made with ❤️ for the Vue.js community</p>
1
+ # Vue DnD Kit - Core Package
2
+
3
+ [![Release](https://img.shields.io/badge/status-release-green.svg)](https://github.com/zizigy/vue-dnd-kit)
4
+ [![npm version](https://img.shields.io/npm/v/@vue-dnd-kit/core.svg)](https://www.npmjs.com/package/@vue-dnd-kit/core)
5
+
6
+ <p align="center">
7
+ <a href="https://zizigy.github.io/vue-dnd-kit/">
8
+ <img src="https://raw.githubusercontent.com/ZiZiGY/vue-dnd-kit/v2/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 composables and provider-based API.
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="https://zizigy.github.io/vue-dnd-kit/" 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 <a href="https://dndkit.com/" target="_blank">React DnD Kit</a>, adapted for Vue.js
24
+ </p>
25
+
26
+ ---
27
+
28
+ ## About
29
+
30
+ **Vue DnD Kit** — lightweight drag & drop library for Vue 3. Built around a provider (`DnDProvider`) and composables: `makeDraggable`, `makeDroppable`, `makeSelectionArea`, `makeConstraintArea`.
31
+
32
+ - **Lightweight** — small bundle size, no extra dependencies (Vue as peer only)
33
+ - **Flexible** — works with any layout and design system
34
+ - **Accessible** — full keyboard support (start, move, cancel, drop)
35
+ - **TypeScript** — fully typed
36
+
37
+ ---
38
+
39
+ ## Features
40
+
41
+ - **Composables API** — `makeDraggable`, `makeDroppable`, `makeSelectionArea`, `makeConstraintArea`
42
+ - **Provider-based** — `DnDProvider` + `useDnDProvider` for state access
43
+ - **Keyboard support** — Enter/Space for start and drop, arrows for movement, Escape to cancel
44
+ - **Modifier keys** — drag only when modifier held (e.g. Ctrl)
45
+ - **Custom overlay** — custom drag preview via slot or `render` option
46
+
47
+ ---
48
+
49
+ ## Installation
50
+
51
+ ```bash
52
+ npm install @vue-dnd-kit/core
53
+ ```
54
+
55
+ ```bash
56
+ yarn add @vue-dnd-kit/core
57
+ ```
58
+
59
+ ```bash
60
+ pnpm add @vue-dnd-kit/core
61
+ ```
62
+
63
+ **Peer dependency:** Vue 3
64
+
65
+ ---
66
+
67
+ ## License
68
+
69
+ [MIT](LICENSE) © [ZiZiGY](https://github.com/ZiZiGY)
70
+
71
+ ---
72
+
73
+ <p align="center">🎉 Congratulations on the official release! 🎉</p>
74
+ <p align="center">Made with ❤️ for the Vue.js community</p>
@@ -3,18 +3,18 @@ declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  default?(_: {}): any;
6
- overlay?(_: {
7
- overlay: import('vue').Component;
6
+ preview?(_: {
7
+ preview: import('vue').Component;
8
8
  }): any;
9
9
  };
10
10
  refs: {
11
- overlayRef: HTMLDivElement;
11
+ previewRef: HTMLDivElement;
12
12
  };
13
13
  rootEl: any;
14
14
  };
15
15
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
16
  declare const __VLS_component: import('vue').DefineComponent<IDnDProviderProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IDnDProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
17
- overlayRef: HTMLDivElement;
17
+ previewRef: HTMLDivElement;
18
18
  }, any>;
19
19
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
20
20
  export default _default;
@@ -0,0 +1,81 @@
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {
5
+ draggingMap: Map<HTMLElement, {
6
+ initialHTML: string;
7
+ initialRect: {
8
+ height: number;
9
+ width: number;
10
+ x: number;
11
+ y: number;
12
+ readonly bottom: number;
13
+ readonly left: number;
14
+ readonly right: number;
15
+ readonly top: number;
16
+ toJSON: () => any;
17
+ };
18
+ initialOuterHTML: string;
19
+ render?: Component;
20
+ events?: {
21
+ onSelfDragStart?: ((event: import('..').IDragEvent) => void) | undefined;
22
+ onSelfDragMove?: ((event: import('..').IDragEvent) => void) | undefined;
23
+ onSelfDragEnd?: ((event: import('..').IDragEvent) => void) | undefined;
24
+ onSelfDragCancel?: ((event: import('..').IDragEvent) => void) | undefined;
25
+ onDragStart?: ((event: import('..').IDragEvent) => void) | undefined;
26
+ onDragMove?: ((event: import('..').IDragEvent) => void) | undefined;
27
+ onDragEnd?: ((event: import('..').IDragEvent) => void) | undefined;
28
+ onDragCancel?: ((event: import('..').IDragEvent) => void) | undefined;
29
+ onHover?: ((event: import('..').IDragEvent) => void) | undefined;
30
+ onLeave?: ((event: import('..').IDragEvent) => void) | undefined;
31
+ } | undefined;
32
+ payload?: import('..').TDraggablePayload | undefined;
33
+ data?: (() => unknown) | undefined;
34
+ modifier?: {
35
+ keys: string[];
36
+ method: import('..').TModifierMethod;
37
+ } | undefined;
38
+ dragHandle?: string | undefined;
39
+ activation?: {
40
+ distance?: number | {
41
+ x?: number | undefined;
42
+ y?: number | undefined;
43
+ condition?: import('..').TCondition | undefined;
44
+ } | undefined;
45
+ delay?: number | undefined;
46
+ condition?: import('..').TCondition | undefined;
47
+ } | undefined;
48
+ placementMargins?: {
49
+ top?: number | undefined;
50
+ right?: number | undefined;
51
+ bottom?: number | undefined;
52
+ left?: number | undefined;
53
+ } | undefined;
54
+ hoveredPlacement?: {
55
+ top: boolean;
56
+ right: boolean;
57
+ bottom: boolean;
58
+ left: boolean;
59
+ center: boolean;
60
+ } | undefined;
61
+ disabled?: boolean | undefined;
62
+ groups?: string[] | undefined;
63
+ }> & Omit<Map<HTMLElement, import('..').IDraggingEntity>, keyof Map<any, any>>;
64
+ }): any;
65
+ };
66
+ refs: {
67
+ contentRef: HTMLDivElement;
68
+ };
69
+ rootEl: any;
70
+ };
71
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
72
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
73
+ contentRef: HTMLDivElement;
74
+ }, any>;
75
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
76
+ export default _default;
77
+ type __VLS_WithTemplateSlots<T, S> = T & {
78
+ new (): {
79
+ $slots: S;
80
+ };
81
+ };
@@ -1,5 +1,6 @@
1
1
  import { default as DnDProvider } from './components/DnDProvider.vue';
2
- export { DnDProvider };
2
+ import { default as DragPreview } from './components/DragPreview.vue';
3
+ export { DnDProvider, DragPreview };
3
4
  export { makeDraggable } from './composables/makeDraggable';
4
5
  export { makeSelectionArea } from './composables/makeSelectionArea';
5
6
  export { makeConstraintArea } from './composables/makeConstraintArea';