@vue-dnd-kit/core 1.7.0 → 2.0.0-alpha2
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 +5 -305
- package/dist/external/components/DefaultOverlay.vue.d.ts +3 -0
- package/dist/external/components/DefaultOverlay.vue.d.ts.map +1 -0
- package/dist/external/components/DnDProvider.vue.d.ts +25 -0
- package/dist/external/components/DnDProvider.vue.d.ts.map +1 -0
- package/dist/external/composables/makeBoundingBox.d.ts +8 -0
- package/dist/external/composables/makeBoundingBox.d.ts.map +1 -0
- package/dist/external/composables/makeCustomOverlay.d.ts +2 -0
- package/dist/external/composables/makeCustomOverlay.d.ts.map +1 -0
- package/dist/external/composables/makeDraggable.d.ts +17 -0
- package/dist/external/composables/makeDraggable.d.ts.map +1 -0
- package/dist/external/composables/makeDroppable.d.ts +7 -0
- package/dist/external/composables/makeDroppable.d.ts.map +1 -0
- package/dist/external/composables/makeSelectableArea.d.ts +15 -0
- package/dist/external/composables/makeSelectableArea.d.ts.map +1 -0
- package/dist/external/composables/useDnDProvider.d.ts +3 -0
- package/dist/external/composables/useDnDProvider.d.ts.map +1 -0
- package/dist/external/index.d.ts +12 -0
- package/dist/external/index.d.ts.map +1 -0
- package/dist/external/types/entities.d.ts +144 -0
- package/dist/external/types/index.d.ts +4 -0
- package/dist/external/types/placement.d.ts +15 -0
- package/dist/external/types/pointer.d.ts +10 -0
- package/dist/external/types/provider.d.ts +64 -0
- package/dist/index.d.ts +2 -2141
- package/dist/internal/composables/useDnDProviderEvents.d.ts +3 -0
- package/dist/internal/composables/useDnDProviderEvents.d.ts.map +1 -0
- package/dist/internal/composables/useDnDProviderInternal.d.ts +3 -0
- package/dist/internal/composables/useDnDProviderInternal.d.ts.map +1 -0
- package/dist/internal/composables/useDnDProviderState.d.ts +4 -0
- package/dist/internal/composables/useDnDProviderState.d.ts.map +1 -0
- package/dist/internal/composables/useSizeObserver.d.ts +34 -0
- package/dist/internal/composables/useSizeObserver.d.ts.map +1 -0
- package/dist/internal/logic/hover.d.ts +8 -0
- package/dist/internal/logic/hover.d.ts.map +1 -0
- package/dist/internal/logic/keyboard.d.ts +7 -0
- package/dist/internal/logic/keyboard.d.ts.map +1 -0
- package/dist/internal/logic/payload.d.ts +8 -0
- package/dist/internal/logic/payload.d.ts.map +1 -0
- package/dist/internal/logic/pointer.d.ts +10 -0
- package/dist/internal/logic/pointer.d.ts.map +1 -0
- package/dist/internal/logic/scroll.d.ts +3 -0
- package/dist/internal/logic/scroll.d.ts.map +1 -0
- package/dist/internal/sensors/defaultCollision.d.ts +8 -0
- package/dist/internal/sensors/defaultCollision.d.ts.map +1 -0
- package/dist/internal/sensors/index.d.ts +3 -0
- package/dist/internal/sensors/index.d.ts.map +1 -0
- package/dist/internal/sensors/sensor.d.ts +53 -0
- package/dist/internal/sensors/sensor.d.ts.map +1 -0
- package/dist/internal/sensors/steps.d.ts +27 -0
- package/dist/internal/sensors/steps.d.ts.map +1 -0
- package/dist/internal/types/observer.d.ts +11 -0
- package/dist/internal/types/provider.d.ts +29 -0
- package/dist/internal/utils/constraints.d.ts +41 -0
- package/dist/internal/utils/constraints.d.ts.map +1 -0
- package/dist/internal/utils/disabled.d.ts +10 -0
- package/dist/internal/utils/disabled.d.ts.map +1 -0
- package/dist/internal/utils/dom.d.ts +45 -0
- package/dist/internal/utils/dom.d.ts.map +1 -0
- package/dist/internal/utils/drag-activation.d.ts +30 -0
- package/dist/internal/utils/drag-activation.d.ts.map +1 -0
- package/dist/internal/utils/events.d.ts +22 -0
- package/dist/internal/utils/events.d.ts.map +1 -0
- package/dist/internal/utils/geometry.d.ts +24 -0
- package/dist/internal/utils/geometry.d.ts.map +1 -0
- package/dist/internal/utils/groups.d.ts +9 -0
- package/dist/internal/utils/groups.d.ts.map +1 -0
- package/dist/internal/utils/keyboard.d.ts +6 -0
- package/dist/internal/utils/keyboard.d.ts.map +1 -0
- package/dist/internal/utils/namespaces.d.ts +19 -0
- package/dist/internal/utils/namespaces.d.ts.map +1 -0
- package/dist/internal/utils/observer.d.ts +28 -0
- package/dist/internal/utils/observer.d.ts.map +1 -0
- package/dist/internal/utils/placement.d.ts +29 -0
- package/dist/internal/utils/placement.d.ts.map +1 -0
- package/dist/internal/utils/pointer.d.ts +34 -0
- package/dist/internal/utils/pointer.d.ts.map +1 -0
- package/dist/internal/utils/provider.d.ts +13 -0
- package/dist/internal/utils/provider.d.ts.map +1 -0
- package/dist/internal/utils/selection.d.ts +28 -0
- package/dist/internal/utils/selection.d.ts.map +1 -0
- package/dist/internal/utils/session.d.ts +6 -0
- package/dist/internal/utils/session.d.ts.map +1 -0
- package/dist/vite.svg +1 -0
- package/dist/vue-dnd-kit-core.cjs.js +2 -1
- package/dist/vue-dnd-kit-core.cjs.js.map +1 -1
- package/dist/vue-dnd-kit-core.es.js +886 -857
- package/dist/vue-dnd-kit-core.es.js.map +1 -1
- package/package.json +78 -73
- package/LICENSE +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDnDProviderEvents.d.ts","sourceRoot":"","sources":["../../../src/internal/composables/useDnDProviderEvents.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,eAAO,MAAM,oBAAoB,GAAI,UAAU,oBAAoB,SAyBlE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDnDProviderInternal.d.ts","sourceRoot":"","sources":["../../../src/internal/composables/useDnDProviderInternal.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,eAAO,MAAM,sBAAsB,4BAKlC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDnDProviderState.d.ts","sourceRoot":"","sources":["../../../src/internal/composables/useDnDProviderState.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,GAAG,EACT,MAAM,KAAK,CAAC;AAeb,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAmB9D,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,GAClC,oBAAoB,CAuItB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Tracks element size via ResizeObserver, writes to returned ref
|
|
4
|
+
*
|
|
5
|
+
* @param elementRef - Ref to element to observe
|
|
6
|
+
* @returns { overlaySize, overlaySizeObserver } — ref with { width, height } and cleanup
|
|
7
|
+
*/
|
|
8
|
+
export declare const useSizeObserver: (elementRef: Ref<HTMLElement | null>) => {
|
|
9
|
+
overlaySize: Ref<{
|
|
10
|
+
height: number;
|
|
11
|
+
width: number;
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
readonly bottom: number;
|
|
15
|
+
readonly left: number;
|
|
16
|
+
readonly right: number;
|
|
17
|
+
readonly top: number;
|
|
18
|
+
toJSON: () => any;
|
|
19
|
+
} | null, DOMRect | {
|
|
20
|
+
height: number;
|
|
21
|
+
width: number;
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
readonly bottom: number;
|
|
25
|
+
readonly left: number;
|
|
26
|
+
readonly right: number;
|
|
27
|
+
readonly top: number;
|
|
28
|
+
toJSON: () => any;
|
|
29
|
+
} | null>;
|
|
30
|
+
overlaySizeObserver: {
|
|
31
|
+
disconnect: () => void;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=useSizeObserver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSizeObserver.d.ts","sourceRoot":"","sources":["../../../src/internal/composables/useSizeObserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAG3C;;;;;GAKG;AAEH,eAAO,MAAM,eAAe,GAC1B,YAAY,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAsBpC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IDnDProviderInternal } from '../types/provider';
|
|
2
|
+
import { IHovered } from '../../external/types/provider';
|
|
3
|
+
/** Applies collision result to hovered and triggers zone/draggable events */
|
|
4
|
+
export declare const applyCollisionResultToHovered: (provider: IDnDProviderInternal, hovered: IHovered, result: {
|
|
5
|
+
elements: HTMLElement[];
|
|
6
|
+
zones: HTMLElement[];
|
|
7
|
+
}) => void;
|
|
8
|
+
//# sourceMappingURL=hover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../../src/internal/logic/hover.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAS9D,6EAA6E;AAC7E,eAAO,MAAM,6BAA6B,GACxC,UAAU,oBAAoB,EAC9B,SAAS,QAAQ,EACjB,QAAQ;IAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;IAAC,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,KACxD,IA0DF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IDnDProviderInternal } from '../types/provider';
|
|
2
|
+
export declare const handleKeyboardEvents: {
|
|
3
|
+
keyDown: (provider: IDnDProviderInternal) => (event: KeyboardEvent) => void;
|
|
4
|
+
keyUp: (provider: IDnDProviderInternal) => (event: KeyboardEvent) => void;
|
|
5
|
+
clear: (provider: IDnDProviderInternal) => () => void;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../src/internal/logic/keyboard.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAgH9D,eAAO,MAAM,oBAAoB;wBAnGA,oBAAoB,MAAM,OAAO,aAAa;sBA2FhD,oBAAoB,MAAM,OAAO,aAAa;sBAI9C,oBAAoB;CAQlD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IDragPayload } from '../../external/types';
|
|
2
|
+
import { IDnDProviderInternal } from '../types/provider';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves payload from initiating draggable.
|
|
5
|
+
* Calls entity.payload() and returns { index, items, dropData }.
|
|
6
|
+
*/
|
|
7
|
+
export declare const createDragPayload: (provider: IDnDProviderInternal) => IDragPayload | undefined;
|
|
8
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/internal/logic/payload.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAqB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,oBAAoB,KAC7B,YAAY,GAAG,SAiBjB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IDnDProviderInternal } from '../types/provider';
|
|
2
|
+
export declare function handleDropAndFinish(provider: IDnDProviderInternal): Promise<boolean>;
|
|
3
|
+
export declare function finishDragSession(provider: IDnDProviderInternal): void;
|
|
4
|
+
export declare const createPointerHandlers: (provider: IDnDProviderInternal) => {
|
|
5
|
+
pointerDown: (event: PointerEvent) => void;
|
|
6
|
+
pointerUp: () => Promise<void>;
|
|
7
|
+
pointerMove: (event: PointerEvent) => void;
|
|
8
|
+
cleanup: () => void;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=pointer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointer.d.ts","sourceRoot":"","sources":["../../../src/internal/logic/pointer.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAwB9D,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,OAAO,CAAC,CA6BlB;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAKtE;AAWD,eAAO,MAAM,qBAAqB,GAAI,UAAU,oBAAoB;yBAsDtC,YAAY;;yBAtBZ,YAAY;;CA0FzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../src/internal/logic/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,eAAO,MAAM,iBAAiB,GAAI,UAAU,oBAAoB,eAK/D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default collision: same logic as vue-dnd-box reference
|
|
3
|
+
* - Filter: AABB overlap with container (overlay)
|
|
4
|
+
* - Sort: pointer outside container → isPointerInElement + depth; else overlap % + centerDistance
|
|
5
|
+
* - Returns full sorted list
|
|
6
|
+
*/
|
|
7
|
+
export declare const defaultCollisionDetection: import('./sensor').CollisionDetectionFn;
|
|
8
|
+
//# sourceMappingURL=defaultCollision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultCollision.d.ts","sourceRoot":"","sources":["../../../src/internal/sensors/defaultCollision.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,eAAO,MAAM,yBAAyB,yCAU5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/sensors/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { IBoundingBox } from '../utils/geometry';
|
|
2
|
+
import { IDnDProviderInternal } from '../types/provider';
|
|
3
|
+
export type CollisionDetectionFn = (provider: IDnDProviderInternal) => {
|
|
4
|
+
elements: HTMLElement[];
|
|
5
|
+
zones: HTMLElement[];
|
|
6
|
+
};
|
|
7
|
+
export type TContainerFn = (provider: IDnDProviderInternal) => HTMLElement | null;
|
|
8
|
+
export type TContainerBoxFn = (provider: IDnDProviderInternal) => IBoundingBox;
|
|
9
|
+
export type TCandidatesFn = (provider: IDnDProviderInternal) => Iterable<HTMLElement>;
|
|
10
|
+
export type TFilterFn = (node: HTMLElement, provider: IDnDProviderInternal) => boolean;
|
|
11
|
+
export type TCollisionContext = {
|
|
12
|
+
containerBox: IBoundingBox;
|
|
13
|
+
pointer: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type TCollisionCheckFn = (nodeBox: IBoundingBox, ctx: TCollisionContext) => boolean;
|
|
19
|
+
export type TSortCompareFn = (a: {
|
|
20
|
+
node: HTMLElement;
|
|
21
|
+
box: IBoundingBox;
|
|
22
|
+
meta: ICollisionMeta;
|
|
23
|
+
}, b: {
|
|
24
|
+
node: HTMLElement;
|
|
25
|
+
box: IBoundingBox;
|
|
26
|
+
meta: ICollisionMeta;
|
|
27
|
+
}, ctx: {
|
|
28
|
+
containerBox: IBoundingBox;
|
|
29
|
+
pointer: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
};
|
|
33
|
+
}) => number;
|
|
34
|
+
export interface ICollisionMeta {
|
|
35
|
+
isPointerInElement: boolean;
|
|
36
|
+
overlapPercent: number;
|
|
37
|
+
depth: number;
|
|
38
|
+
centerDistance: number;
|
|
39
|
+
}
|
|
40
|
+
export interface ISensorBuilder {
|
|
41
|
+
container(fn: TContainerFn): ISensorBuilder;
|
|
42
|
+
containerBox(fn: TContainerBoxFn): ISensorBuilder;
|
|
43
|
+
elements(fn: TCandidatesFn): ISensorBuilder;
|
|
44
|
+
zones(fn: TCandidatesFn): ISensorBuilder;
|
|
45
|
+
filterElements(fn: TFilterFn): ISensorBuilder;
|
|
46
|
+
filterZones(fn: TFilterFn): ISensorBuilder;
|
|
47
|
+
collision(fn: TCollisionCheckFn): ISensorBuilder;
|
|
48
|
+
sortElements(fn: TSortCompareFn): ISensorBuilder;
|
|
49
|
+
sortZones(fn: TSortCompareFn): ISensorBuilder;
|
|
50
|
+
build(): CollisionDetectionFn;
|
|
51
|
+
}
|
|
52
|
+
export declare const createSensor: () => ISensorBuilder;
|
|
53
|
+
//# sourceMappingURL=sensor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sensor.d.ts","sourceRoot":"","sources":["../../../src/internal/sensors/sensor.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,CACjC,QAAQ,EAAE,oBAAoB,KAC3B;IAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;IAAC,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,oBAAoB,KAAK,WAAW,GAAG,IAAI,CAAC;AAClF,MAAM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,oBAAoB,KAAK,YAAY,CAAC;AAC/E,MAAM,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,oBAAoB,KAAK,QAAQ,CAAC,WAAW,CAAC,CAAC;AACtF,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,oBAAoB,KAAK,OAAO,CAAC;AACvF,MAAM,MAAM,iBAAiB,GAAG;IAAE,YAAY,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAClG,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,iBAAiB,KAAK,OAAO,CAAC;AAC3F,MAAM,MAAM,cAAc,GAAG,CAC3B,CAAC,EAAE;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,EACjE,CAAC,EAAE;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,EACjE,GAAG,EAAE;IAAE,YAAY,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,KACnE,MAAM,CAAC;AAEZ,MAAM,WAAW,cAAc;IAC7B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;CACxB;AA0JD,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,EAAE,YAAY,GAAG,cAAc,CAAC;IAC5C,YAAY,CAAC,EAAE,EAAE,eAAe,GAAG,cAAc,CAAC;IAClD,QAAQ,CAAC,EAAE,EAAE,aAAa,GAAG,cAAc,CAAC;IAC5C,KAAK,CAAC,EAAE,EAAE,aAAa,GAAG,cAAc,CAAC;IACzC,cAAc,CAAC,EAAE,EAAE,SAAS,GAAG,cAAc,CAAC;IAC9C,WAAW,CAAC,EAAE,EAAE,SAAS,GAAG,cAAc,CAAC;IAC3C,SAAS,CAAC,EAAE,EAAE,iBAAiB,GAAG,cAAc,CAAC;IACjD,YAAY,CAAC,EAAE,EAAE,cAAc,GAAG,cAAc,CAAC;IACjD,SAAS,CAAC,EAAE,EAAE,cAAc,GAAG,cAAc,CAAC;IAC9C,KAAK,IAAI,oBAAoB,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,sBAAwB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IDnDProviderInternal } from '../types/provider';
|
|
2
|
+
import { TSortCompareFn, TFilterFn, TCollisionCheckFn, TContainerBoxFn } from './sensor';
|
|
3
|
+
/** Container from overlay ref */
|
|
4
|
+
export declare const overlayContainer: (p: IDnDProviderInternal) => HTMLElement | null;
|
|
5
|
+
/** Box from overlay style (x,y) + size — overlay uses fixed+transform, getBoundingClientRect is wrong */
|
|
6
|
+
export declare const overlayBoxFromStyle: TContainerBoxFn;
|
|
7
|
+
/** Visible draggables */
|
|
8
|
+
export declare const visibleElements: (p: IDnDProviderInternal) => Set<HTMLElement> & Omit<Set<HTMLElement>, keyof Set<any>>;
|
|
9
|
+
/** Visible droppables */
|
|
10
|
+
export declare const visibleZones: (p: IDnDProviderInternal) => Set<HTMLElement> & Omit<Set<HTMLElement>, keyof Set<any>>;
|
|
11
|
+
/** Exclude nodes being dragged */
|
|
12
|
+
export declare const filterNotDragging: TFilterFn;
|
|
13
|
+
/** Exclude nodes that are descendants of any dragged element (nesting into self) */
|
|
14
|
+
export declare const filterNotDescendantOfDragged: TFilterFn;
|
|
15
|
+
/** Exclude disabled draggables and zones (including those inside disabled parents) */
|
|
16
|
+
export declare const filterNotDisabled: TFilterFn;
|
|
17
|
+
/** Exclude: not dragging, not descendant of dragged, not disabled */
|
|
18
|
+
export declare const filterValidCollisionTarget: TFilterFn;
|
|
19
|
+
/** AABB overlap check (element vs container) — legacy */
|
|
20
|
+
export declare const aabbCollision: TCollisionCheckFn;
|
|
21
|
+
/** Pointer-in-element: cursor must be inside element (AABB of element) */
|
|
22
|
+
export declare const pointerInElementCollision: TCollisionCheckFn;
|
|
23
|
+
/** Sort: deepest first (topmost visible element under cursor) */
|
|
24
|
+
export declare const sortByDepth: TSortCompareFn;
|
|
25
|
+
/** Sort: pointer-in-element + depth when pointer INSIDE container; overlap % + centerDistance when OUTSIDE */
|
|
26
|
+
export declare const sortByOverlapAndPointer: TSortCompareFn;
|
|
27
|
+
//# sourceMappingURL=steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../../src/internal/sensors/steps.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB,iCAAiC;AACjC,eAAO,MAAM,gBAAgB,EAAE,CAC7B,CAAC,EAAE,oBAAoB,KACpB,WAAW,GAAG,IAAwD,CAAC;AAE5E,yGAAyG;AACzG,eAAO,MAAM,mBAAmB,EAAE,eAkBjC,CAAC;AAEF,yBAAyB;AACzB,eAAO,MAAM,eAAe,GAAI,GAAG,oBAAoB,8DACvB,CAAC;AAEjC,yBAAyB;AACzB,eAAO,MAAM,YAAY,GAAI,GAAG,oBAAoB,8DACpB,CAAC;AAEjC,kCAAkC;AAClC,eAAO,MAAM,iBAAiB,EAAE,SACU,CAAC;AAE3C,oFAAoF;AACpF,eAAO,MAAM,4BAA4B,EAAE,SAGxC,CAAC;AAEJ,sFAAsF;AACtF,eAAO,MAAM,iBAAiB,EAAE,SAM/B,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,0BAA0B,EAAE,SAGN,CAAC;AAEpC,yDAAyD;AACzD,eAAO,MAAM,aAAa,EAAE,iBACe,CAAC;AAE5C,0EAA0E;AAC1E,eAAO,MAAM,yBAAyB,EAAE,iBACc,CAAC;AAEvD,iEAAiE;AACjE,eAAO,MAAM,WAAW,EAAE,cACG,CAAC;AAE9B,8GAA8G;AAC9G,eAAO,MAAM,uBAAuB,EAAE,cAoBrC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ISizeObserverWrapper {
|
|
2
|
+
observe: (element: HTMLElement) => void;
|
|
3
|
+
unobserve: (element: HTMLElement) => void;
|
|
4
|
+
disconnect: () => void;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface IIntersectionObserverWrapper {
|
|
8
|
+
observe: (element: HTMLElement) => void;
|
|
9
|
+
unobserve: (element: HTMLElement) => void;
|
|
10
|
+
disconnect: () => void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { IDnDProviderExternal } from '../../external';
|
|
3
|
+
import { IIntersectionObserverWrapper } from './observer';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export interface IKeyboardKeys {
|
|
7
|
+
pressedKeys: Ref<Set<string>>;
|
|
8
|
+
forDrag: string[];
|
|
9
|
+
forCancel: string[];
|
|
10
|
+
forDrop: string[];
|
|
11
|
+
forMove: string[];
|
|
12
|
+
forMoveFaster: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface IKeyboardState {
|
|
16
|
+
keys: IKeyboardKeys;
|
|
17
|
+
step: number;
|
|
18
|
+
moveFaster: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface IDnDProviderInternal extends IDnDProviderExternal {
|
|
22
|
+
keyboard: IKeyboardState;
|
|
23
|
+
lib: {
|
|
24
|
+
draggableObserver: IIntersectionObserverWrapper;
|
|
25
|
+
droppableObserver: IIntersectionObserverWrapper;
|
|
26
|
+
selectableAreaObserver: IIntersectionObserverWrapper;
|
|
27
|
+
overlaySizeObserver: { disconnect: () => void };
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IConstraintsAreaEntity, TPointerState } from '../../external/types';
|
|
2
|
+
/**
|
|
3
|
+
* Finds constraint area for a draggable element
|
|
4
|
+
*/
|
|
5
|
+
export declare function findConstraintArea(draggable: HTMLElement, constraintsAreaMap: Map<HTMLElement, IConstraintsAreaEntity>): {
|
|
6
|
+
element: HTMLElement;
|
|
7
|
+
entity: IConstraintsAreaEntity;
|
|
8
|
+
} | null;
|
|
9
|
+
/**
|
|
10
|
+
* Applies axis constraint
|
|
11
|
+
*/
|
|
12
|
+
export declare function applyAxisConstraint(targetX: number, targetY: number, axis: 'x' | 'y' | 'both', draggableRect: DOMRect): {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Applies bounds constraint within container
|
|
18
|
+
*/
|
|
19
|
+
export declare function applyBoundsConstraint(targetX: number, targetY: number, axis: 'x' | 'y' | 'both', constraintRect: DOMRect, overlayRect: DOMRect): {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Calculates final overlay position with all constraints applied
|
|
25
|
+
*/
|
|
26
|
+
export declare function calculateConstrainedPosition(pointer: TPointerState, overlayElement: HTMLElement | null, firstDraggable: HTMLElement | null, constraintsAreaMap: Map<HTMLElement, IConstraintsAreaEntity>, overlaySizeFallback?: {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
} | null): {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Updates pointer.current with constraint-applied coordinates.
|
|
35
|
+
* When constraints exist, stores the "effective" position so pointer matches overlay.
|
|
36
|
+
*/
|
|
37
|
+
export declare function updatePointerWithConstraints(pointer: TPointerState, rawX: number, rawY: number, overlayElement: HTMLElement | null, firstDraggable: HTMLElement | null, constraintsAreaMap: Map<HTMLElement, IConstraintsAreaEntity>, overlaySizeFallback?: {
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
} | null): void;
|
|
41
|
+
//# sourceMappingURL=constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraints.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/constraints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACd,MAAM,sBAAsB,CAAC;AAG9B;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,WAAW,EACtB,kBAAkB,EAAE,GAAG,CAAC,WAAW,EAAE,sBAAsB,CAAC,GAC3D;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,sBAAsB,CAAA;CAAE,GAAG,IAAI,CAajE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,MAAM,EACxB,aAAa,EAAE,OAAO,GACrB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAU1B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,MAAM,EACxB,cAAc,EAAE,OAAO,EACvB,WAAW,EAAE,OAAO,GACnB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAqB1B;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,aAAa,EACtB,cAAc,EAAE,WAAW,GAAG,IAAI,EAClC,cAAc,EAAE,WAAW,GAAG,IAAI,EAClC,kBAAkB,EAAE,GAAG,CAAC,WAAW,EAAE,sBAAsB,CAAC,EAC5D,mBAAmB,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAC7D;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CA8C1B;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,WAAW,GAAG,IAAI,EAClC,cAAc,EAAE,WAAW,GAAG,IAAI,EAClC,kBAAkB,EAAE,GAAG,CAAC,WAAW,EAAE,sBAAsB,CAAC,EAC5D,mBAAmB,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAC7D,IAAI,CAuBN"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IEntities } from '../../external/types';
|
|
2
|
+
/** Minimal context for draggable/droppable checks */
|
|
3
|
+
export type IEffectivelyDisabledContext = {
|
|
4
|
+
entities: Pick<IEntities, 'draggableMap' | 'droppableMap'>;
|
|
5
|
+
};
|
|
6
|
+
/** True if node is disabled as draggable (self or inside disabled draggable). O(draggableMap.size) */
|
|
7
|
+
export declare const isEffectivelyDisabledDraggable: (node: HTMLElement, ctx: IEffectivelyDisabledContext) => boolean;
|
|
8
|
+
/** True if node is disabled as droppable (self or inside disabled droppable). O(droppableMap.size) */
|
|
9
|
+
export declare const isEffectivelyDisabledDroppable: (node: HTMLElement, ctx: IEffectivelyDisabledContext) => boolean;
|
|
10
|
+
//# sourceMappingURL=disabled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disabled.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/disabled.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,qDAAqD;AACrD,MAAM,MAAM,2BAA2B,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAAC,CAAA;CAAE,CAAC;AAEzG,sGAAsG;AACtG,eAAO,MAAM,8BAA8B,GACzC,MAAM,WAAW,EACjB,KAAK,2BAA2B,KAC/B,OAOF,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,8BAA8B,GACzC,MAAM,WAAW,EACjB,KAAK,2BAA2B,KAC/B,OAOF,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ICoordinates, TDnDNodeRef } from '../../external/types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves template ref to HTMLElement (handles both element and component refs)
|
|
4
|
+
*/
|
|
5
|
+
export declare const getNode: (node: TDnDNodeRef) => HTMLElement | null;
|
|
6
|
+
/**
|
|
7
|
+
* Checks if point (x, y) is inside rect
|
|
8
|
+
*/
|
|
9
|
+
export declare const containsPoint: (rect: DOMRect, x: number, y: number) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* True if child is a descendant of parent (parent.contains(child) and parent !== child)
|
|
12
|
+
*/
|
|
13
|
+
export declare const isDescendant: (parent: HTMLElement, child: HTMLElement) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Checks if two DOMRects intersect
|
|
16
|
+
*/
|
|
17
|
+
export declare const checkIntersection: (rect1: DOMRect, rect2: DOMRect) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Returns true if event target is outside the container
|
|
20
|
+
*/
|
|
21
|
+
export declare const isNotDirectClick: (event: Event, container: HTMLElement | null) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Returns scroll direction based on cursor proximity to container edges
|
|
24
|
+
*/
|
|
25
|
+
export declare const getAutoScrollDirection: (coords: ICoordinates, container: HTMLElement, threshold?: number) => {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Returns true if running in browser environment
|
|
31
|
+
*/
|
|
32
|
+
export declare const isClient: () => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Disables user interactions during drag (user-select, context menu, etc.)
|
|
35
|
+
*/
|
|
36
|
+
export declare const disableInteractions: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* Restores user interactions after drag ends
|
|
39
|
+
*/
|
|
40
|
+
export declare const enableInteractions: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Prevents default browser behavior for the event
|
|
43
|
+
*/
|
|
44
|
+
export declare const preventEvent: (event: Event) => void;
|
|
45
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/dom.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAMtE;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,WAAW,uBAQxC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,OACI,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,WAAW,EAAE,OAAO,WAAW,KAAG,OAC3B,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,EAAE,OAAO,OAAO,KAAG,OAQlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,KAAK,EACZ,WAAW,WAAW,GAAG,IAAI,KAC5B,OAMF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,YAAY,EACpB,WAAW,WAAW,EACtB,YAAW,MAAW,KACrB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAwBxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,eAAsC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,mBAAmB,YAW/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,YAW9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,SAA2B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IDragActivation, TPointerState } from '../../external/types';
|
|
2
|
+
import { IDnDProviderInternal } from '../types/provider';
|
|
3
|
+
/**
|
|
4
|
+
* Checks if the click target is within the drag handle (if specified)
|
|
5
|
+
* @param skipHandle - when true (e.g. keyboard drag), bypass handle check
|
|
6
|
+
*/
|
|
7
|
+
export declare function checkDragHandle(target: HTMLElement, draggable: HTMLElement, handleSelector?: string, skipHandle?: boolean): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Calculates distance progress (0-1) for activation threshold
|
|
10
|
+
*/
|
|
11
|
+
export declare function calculateDistanceProgress(pointer: TPointerState, distanceThreshold: IDragActivation['distance']): number;
|
|
12
|
+
/**
|
|
13
|
+
* Returns true if distance threshold is met
|
|
14
|
+
*/
|
|
15
|
+
export declare function isDistanceThresholdPassed(pointer: TPointerState, distanceThreshold: IDragActivation['distance']): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Returns true if activation conditions are met (distance + delay, respecting condition)
|
|
18
|
+
*/
|
|
19
|
+
export declare function isActivationComplete(distanceProgress: number, delayProgress: number, activation?: IDragActivation): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* If activation is complete, starts dragging. Returns true if drag was started
|
|
22
|
+
*/
|
|
23
|
+
export declare function tryStartDragIfActivationComplete(provider: IDnDProviderInternal): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Creates RAF-based delay timer that ticks until activation is complete, then calls onComplete
|
|
26
|
+
*/
|
|
27
|
+
export declare function createActivationDelayTimer(provider: IDnDProviderInternal, onComplete: () => void): {
|
|
28
|
+
cancel: () => void;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=drag-activation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag-activation.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/drag-activation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG9D;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,WAAW,EACtB,cAAc,CAAC,EAAE,MAAM,EACvB,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAQT;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,aAAa,EACtB,iBAAiB,EAAE,eAAe,CAAC,UAAU,CAAC,GAC7C,MAAM,CAyBR;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,aAAa,EACtB,iBAAiB,EAAE,eAAe,CAAC,UAAU,CAAC,GAC7C,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,eAAe,GAC3B,OAAO,CAcT;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAoBT;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,oBAAoB,EAC9B,UAAU,EAAE,MAAM,IAAI,GACrB;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CA4CxB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IDnDProviderInternal } from '../types/provider';
|
|
2
|
+
import { IHovered } from '../../external/types/provider';
|
|
3
|
+
export type TSelfDragEvent = 'onSelfDragStart' | 'onSelfDragMove' | 'onSelfDragEnd' | 'onSelfDragCancel';
|
|
4
|
+
/** First key from Map or undefined */
|
|
5
|
+
export declare const getFirstKey: <K>(map: Map<K, unknown>) => K | undefined;
|
|
6
|
+
/** Closest draggable from event target */
|
|
7
|
+
export declare const getClosestDraggableFromEvent: (event: PointerEvent) => HTMLElement | null;
|
|
8
|
+
/** Triggers onSelf* for element from event if it's in draggingMap */
|
|
9
|
+
export declare const triggerSelfDragFromEvent: (provider: IDnDProviderInternal, event: PointerEvent, eventName: TSelfDragEvent) => void;
|
|
10
|
+
/** Triggers onSelf* only for the initiating element (event.target.closest), skip if disabled */
|
|
11
|
+
export declare const triggerSelfDragForElement: (provider: IDnDProviderInternal, element: HTMLElement | undefined, eventName: TSelfDragEvent) => void;
|
|
12
|
+
/** Triggers onDrag* for ALL non-disabled draggable elements */
|
|
13
|
+
export declare const triggerDragForAll: (provider: IDnDProviderInternal, eventName: "onDragStart" | "onDragMove" | "onDragEnd" | "onDragCancel") => void;
|
|
14
|
+
/** Triggers zone onEnter/onLeave when zone changes, skip disabled zones */
|
|
15
|
+
export declare const triggerZoneEnterLeave: (provider: IDnDProviderInternal, prevZone: HTMLElement | undefined, newZone: HTMLElement | undefined) => void;
|
|
16
|
+
/** Triggers onHover/onLeave when hovered draggable changes, skip disabled */
|
|
17
|
+
export declare const triggerDraggableHoverChange: (provider: IDnDProviderInternal, prevEl: HTMLElement | undefined, newEl: HTMLElement | undefined) => void;
|
|
18
|
+
/** Triggers zone onLeave on drag end, skip disabled */
|
|
19
|
+
export declare const triggerZoneLeave: (provider: IDnDProviderInternal, hovered: IHovered) => void;
|
|
20
|
+
/** Triggers zone onLeave on drop failure, skip disabled */
|
|
21
|
+
export declare const triggerDropCancelEvents: (provider: IDnDProviderInternal, hovered: IHovered) => void;
|
|
22
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAc,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAE1E,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,eAAe,GAAG,kBAAkB,CAAC;AAEzG,sCAAsC;AACtC,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,KAAG,CAAC,GAAG,SACjC,CAAC;AAE1B,0CAA0C;AAC1C,eAAO,MAAM,4BAA4B,GAAI,OAAO,YAAY,KAAG,WAAW,GAAG,IACI,CAAC;AAOtF,qEAAqE;AACrE,eAAO,MAAM,wBAAwB,GACnC,UAAU,oBAAoB,EAC9B,OAAO,YAAY,EACnB,WAAW,cAAc,KACxB,IAKF,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,yBAAyB,GACpC,UAAU,oBAAoB,EAC9B,SAAS,WAAW,GAAG,SAAS,EAChC,WAAW,cAAc,KACxB,IAIF,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,GAC5B,UAAU,oBAAoB,EAC9B,WAAW,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,KACrE,IAMF,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,GAChC,UAAU,oBAAoB,EAC9B,UAAU,WAAW,GAAG,SAAS,EACjC,SAAS,WAAW,GAAG,SAAS,KAC/B,IAQF,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,2BAA2B,GACtC,UAAU,oBAAoB,EAC9B,QAAQ,WAAW,GAAG,SAAS,EAC/B,OAAO,WAAW,GAAG,SAAS,KAC7B,IAQF,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,GAAI,UAAU,oBAAoB,EAAE,SAAS,QAAQ,KAAG,IAMpF,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,uBAAuB,GAClC,UAAU,oBAAoB,EAC9B,SAAS,QAAQ,KAChB,IAMF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AABB geometry utilities for collision detection
|
|
3
|
+
*/
|
|
4
|
+
export interface IBoundingBox {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
top: number;
|
|
10
|
+
left: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
}
|
|
14
|
+
export interface IPoint {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const checkCollision: (boxA: IBoundingBox, boxB: IBoundingBox) => boolean;
|
|
19
|
+
export declare const getBoundingBox: (element: HTMLElement | null) => IBoundingBox;
|
|
20
|
+
export declare const getCenter: (box: IBoundingBox) => IPoint;
|
|
21
|
+
export declare const getDistance: (pointA: IPoint, pointB: IPoint) => number;
|
|
22
|
+
export declare const getOverlapPercent: (boxA: IBoundingBox, boxB: IBoundingBox) => number;
|
|
23
|
+
export declare const containsPoint: (box: IBoundingBox, x: number, y: number) => boolean;
|
|
24
|
+
//# sourceMappingURL=geometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/geometry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,YAAY;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,MAAM;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,YAAY,EAAE,MAAM,YAAY,KAAG,OAIzC,CAAC;AAEhC,eAAO,MAAM,cAAc,GAAI,SAAS,WAAW,GAAG,IAAI,KAAG,YAc5D,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,KAAK,YAAY,KAAG,MAG5C,CAAC;AAEH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,KAAG,MACP,CAAC;AAEvD,eAAO,MAAM,iBAAiB,GAAI,MAAM,YAAY,EAAE,MAAM,YAAY,KAAG,MAc1E,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,YAAY,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,OACO,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks compatibility between two group sets.
|
|
3
|
+
* Used for selection area, zones, droppable, etc.
|
|
4
|
+
*
|
|
5
|
+
* - Empty array = global (compatible with any)
|
|
6
|
+
* - Otherwise requires at least one shared group
|
|
7
|
+
*/
|
|
8
|
+
export declare const areGroupsCompatible: (groupsA: string[], groupsB: string[]) => boolean;
|
|
9
|
+
//# sourceMappingURL=groups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/groups.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EAAE,EACjB,SAAS,MAAM,EAAE,KAChB,OAGF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/keyboard.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DnD Kit data attributes and CSS selectors
|
|
3
|
+
*/
|
|
4
|
+
export declare const DnDAttributes: {
|
|
5
|
+
readonly SELECT_AREA: "data-dnd-kit-select-area";
|
|
6
|
+
readonly DRAGGABLE: "data-dnd-kit-draggable";
|
|
7
|
+
readonly DROPPABLE: "data-dnd-kit-droppable";
|
|
8
|
+
readonly CONSTRAINT_AREA: "data-dnd-kit-constraint-area";
|
|
9
|
+
readonly CONTAINER: "data-dnd-kit-container";
|
|
10
|
+
};
|
|
11
|
+
export declare const DnDSelectors: {
|
|
12
|
+
readonly SELECT_AREA: "[data-dnd-kit-select-area]";
|
|
13
|
+
readonly DRAGGABLE: "[data-dnd-kit-draggable]";
|
|
14
|
+
readonly DROPPABLE: "[data-dnd-kit-droppable]";
|
|
15
|
+
readonly CONSTRAINT_AREA: "[data-dnd-kit-constraint-area]";
|
|
16
|
+
readonly CONTAINER: "[data-dnd-kit-container]";
|
|
17
|
+
};
|
|
18
|
+
export declare const injectionKey: "VueDnDKitProvider";
|
|
19
|
+
//# sourceMappingURL=namespaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespaces.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/namespaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,eAAO,MAAM,YAAY,EAAG,mBAA4B,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Observers — IntersectionObserver (visibility) and ResizeObserver (size)
|
|
3
|
+
*/
|
|
4
|
+
export interface IObserverWrapper {
|
|
5
|
+
observe: (element: HTMLElement) => void;
|
|
6
|
+
unobserve: (element: HTMLElement) => void;
|
|
7
|
+
disconnect: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates an IntersectionObserver that manages a Set of visible elements
|
|
11
|
+
*
|
|
12
|
+
* @param targetSet - Set to add/remove elements
|
|
13
|
+
* @returns Object with observe/unobserve/disconnect methods
|
|
14
|
+
*/
|
|
15
|
+
export declare const createIntersectionObserver: (targetSet: Set<HTMLElement>) => IObserverWrapper;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a ResizeObserver that tracks element size and writes to target ref
|
|
18
|
+
*
|
|
19
|
+
* @param target - Ref to write { width, height } on resize
|
|
20
|
+
* @returns Object with observe/unobserve/disconnect methods
|
|
21
|
+
*/
|
|
22
|
+
export declare const createSizeObserver: (target: {
|
|
23
|
+
value: {
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
} | null;
|
|
27
|
+
}) => IObserverWrapper;
|
|
28
|
+
//# sourceMappingURL=observer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/observer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,SAAS,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GAAI,WAAW,GAAG,CAAC,WAAW,CAAC,KAAG,gBAaxE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ;IAAE,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,KAC1D,gBAaF,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IDnDProviderExternal, IPlacementMargins } from '../../external';
|
|
2
|
+
export interface IPlacement {
|
|
3
|
+
top: boolean;
|
|
4
|
+
right: boolean;
|
|
5
|
+
bottom: boolean;
|
|
6
|
+
left: boolean;
|
|
7
|
+
center?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface IRect {
|
|
10
|
+
top: number;
|
|
11
|
+
left: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates pointer box from coordinates (e.g. cursor as 5×5)
|
|
17
|
+
*/
|
|
18
|
+
export declare const createPointerBox: (x: number, y: number, size?: number) => IRect;
|
|
19
|
+
/**
|
|
20
|
+
* Creates pointer box from provider (cursor as 5×5)
|
|
21
|
+
*/
|
|
22
|
+
export declare const getPointerBoxFromProvider: (provider: IDnDProviderExternal) => IRect;
|
|
23
|
+
/**
|
|
24
|
+
* Returns which edge of element is closest to pointer box center.
|
|
25
|
+
* With placementMargins: if pointer in center zone, returns center: true.
|
|
26
|
+
* Else exactly one of top/right/bottom/left is true.
|
|
27
|
+
*/
|
|
28
|
+
export declare const getClosestPlacement: (pointerBox: IRect, elementRect: DOMRect, margins?: IPlacementMargins) => IPlacement;
|
|
29
|
+
//# sourceMappingURL=placement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placement.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/placement.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE9E,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,GAAG,MAAM,EACT,GAAG,MAAM,EACT,OAAM,MAAU,KACf,KAQF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAI,UAAU,oBAAoB,KAAG,KAK1E,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,YAAY,KAAK,EACjB,aAAa,OAAO,EACpB,UAAU,iBAAiB,KAC1B,UAsCF,CAAC"}
|