@vue-dnd-kit/core 1.4.0 → 1.5.0
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/dist/index.d.ts
CHANGED
|
@@ -90,7 +90,10 @@ export declare interface IDropZone {
|
|
|
90
90
|
events: {
|
|
91
91
|
onHover?: (store: IDnDStore, payload: IDnDPayload) => void;
|
|
92
92
|
onLeave?: (store: IDnDStore, payload: IDnDPayload) => void;
|
|
93
|
-
onDrop?: (
|
|
93
|
+
onDrop?: (
|
|
94
|
+
store: IDnDStore,
|
|
95
|
+
payload: IDnDPayload
|
|
96
|
+
) => void | Promise<boolean>;
|
|
94
97
|
};
|
|
95
98
|
}
|
|
96
99
|
|
|
@@ -134,7 +137,10 @@ declare interface IUseDragOptions extends IUseSensorOptions {
|
|
|
134
137
|
declare interface IUseDropOptions {
|
|
135
138
|
groups?: string[];
|
|
136
139
|
events?: {
|
|
137
|
-
onDrop?: (
|
|
140
|
+
onDrop?: (
|
|
141
|
+
store: IDnDStore,
|
|
142
|
+
payload: IDnDPayload
|
|
143
|
+
) => void | Promise<boolean>;
|
|
138
144
|
onHover?: (store: IDnDStore, payload: IDnDPayload) => void;
|
|
139
145
|
onLeave?: (store: IDnDStore, payload: IDnDPayload) => void;
|
|
140
146
|
};
|
|
@@ -1449,7 +1455,7 @@ export declare const useDnDStore: () => {
|
|
|
1449
1455
|
events: {
|
|
1450
1456
|
onHover?: ((store: IDnDStore, payload: IDnDPayload) => void) | undefined;
|
|
1451
1457
|
onLeave?: ((store: IDnDStore, payload: IDnDPayload) => void) | undefined;
|
|
1452
|
-
onDrop?: ((store: IDnDStore, payload: IDnDPayload) => void) | undefined;
|
|
1458
|
+
onDrop?: ((store: IDnDStore, payload: IDnDPayload) => void | Promise<boolean>) | undefined;
|
|
1453
1459
|
};
|
|
1454
1460
|
}> & Omit<Map<HTMLElement | Element, IDropZone>, keyof Map<any, any>>, Map<HTMLElement | Element, IDropZone> | (Map<HTMLElement | Element, {
|
|
1455
1461
|
node: HTMLElement | Element | null;
|
|
@@ -1461,11 +1467,11 @@ export declare const useDnDStore: () => {
|
|
|
1461
1467
|
events: {
|
|
1462
1468
|
onHover?: ((store: IDnDStore, payload: IDnDPayload) => void) | undefined;
|
|
1463
1469
|
onLeave?: ((store: IDnDStore, payload: IDnDPayload) => void) | undefined;
|
|
1464
|
-
onDrop?: ((store: IDnDStore, payload: IDnDPayload) => void) | undefined;
|
|
1470
|
+
onDrop?: ((store: IDnDStore, payload: IDnDPayload) => void | Promise<boolean>) | undefined;
|
|
1465
1471
|
};
|
|
1466
1472
|
}> & Omit<Map<HTMLElement | Element, IDropZone>, keyof Map<any, any>>)>;
|
|
1467
|
-
visibleZones:
|
|
1468
|
-
visibleElements:
|
|
1473
|
+
visibleZones: ShallowRef<Set<HTMLElement | Element>, Set<HTMLElement | Element>>;
|
|
1474
|
+
visibleElements: ShallowRef<Set<HTMLElement | Element>, Set<HTMLElement | Element>>;
|
|
1469
1475
|
pointerPosition: {
|
|
1470
1476
|
start: ShallowRef<IPoint | null, IPoint | null>;
|
|
1471
1477
|
current: ShallowRef<IPoint | null, IPoint | null>;
|
|
@@ -1488,6 +1494,7 @@ export declare const useDnDStore: () => {
|
|
|
1488
1494
|
zone: ShallowRef<HTMLElement | Element | null, HTMLElement | Element | null>;
|
|
1489
1495
|
element: ShallowRef<HTMLElement | Element | null, HTMLElement | Element | null>;
|
|
1490
1496
|
};
|
|
1497
|
+
isPending: ShallowRef<boolean, boolean>;
|
|
1491
1498
|
handleDragElementIntersection: (action: 'add' | 'remove', element: HTMLElement | Element) => void;
|
|
1492
1499
|
handleDropZoneIntersection: (action: 'add' | 'remove', element: HTMLElement | Element) => void;
|
|
1493
1500
|
};
|
|
@@ -2056,6 +2063,7 @@ export declare const useDraggable: (options?: IUseDragOptions) => {
|
|
|
2056
2063
|
isDragging: ComputedRef<boolean>;
|
|
2057
2064
|
isOvered: ComputedRef<boolean>;
|
|
2058
2065
|
isAllowed: ComputedRef<boolean>;
|
|
2066
|
+
isLazyAllowed: ComputedRef<boolean>;
|
|
2059
2067
|
handleDragStart: (event: PointerEvent | KeyboardEvent) => void;
|
|
2060
2068
|
id: ShallowRef<string | number, string | number>;
|
|
2061
2069
|
};
|
|
@@ -2064,6 +2072,7 @@ export declare const useDroppable: (options?: IUseDropOptions) => {
|
|
|
2064
2072
|
elementRef: Ref<HTMLElement | null, HTMLElement | null>;
|
|
2065
2073
|
isOvered: ComputedRef<boolean>;
|
|
2066
2074
|
isAllowed: ComputedRef<boolean>;
|
|
2075
|
+
isLazyAllowed: ComputedRef<boolean>;
|
|
2067
2076
|
};
|
|
2068
2077
|
|
|
2069
2078
|
export declare const useSelection: (elementRef: Ref<HTMLElement | null>) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var re=Object.defineProperty;var ae=(n,e,t)=>e in n?re(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var _=(n,e,t)=>ae(n,typeof e!="symbol"?e+"":e,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),F=require("@vueuse/core"),M=class M{};_(M,"remove",(e,t)=>{if(!e||t===void 0)return;const[a]=e.splice(t,1);return a}),_(M,"insert",(e,t,a)=>{!e||t===void 0||e.splice(t,0,a)}),_(M,"move",(e,t,a,l)=>{if(!e||!a||t===void 0||l===void 0)return;const s=M.remove(e,t);M.insert(a,l,s)}),_(M,"swap",(e,t,a,l)=>{if(!e||!a||t===void 0||l===void 0)return;const s=e[t],i=a[l];e[t]=i,a[l]=s}),_(M,"copy",(e,t,a,l)=>{if(!e||t===void 0||!a||l===void 0)return;const s=e[t];M.insert(a,l,s)}),_(M,"applyTransfer",e=>{var l,s,i,m,u,c,d;const t=e.hovered.element.value,a=e.hovered.zone.value;if(t){const f=(s=(l=e.elementsMap.value.get(t))==null?void 0:l.data)==null?void 0:s.source,o=(m=(i=e.elementsMap.value.get(t))==null?void 0:i.data)==null?void 0:m.index,v=e.draggingElements.value.values().next().value,g=(u=v==null?void 0:v.data)==null?void 0:u.index,p=g!==void 0&&o!==void 0&&g>o?1:-1;Array.from(e.draggingElements.value.values()).sort((w,A)=>{var P,k;return p*((((P=w.data)==null?void 0:P.index)||0)-(((k=A.data)==null?void 0:k.index)||0))}).forEach(w=>{var A,P;return M.move((A=w.data)==null?void 0:A.source,(P=w.data)==null?void 0:P.index,f,o)})}else if(a){const f=(d=(c=e.zonesMap.value.get(a))==null?void 0:c.data)==null?void 0:d.source,o=f==null?void 0:f.length;Array.from(e.draggingElements.value.values()).sort((g,p)=>{var E,w;return(((E=p.data)==null?void 0:E.index)||0)-(((w=g.data)==null?void 0:w.index)||0)}).forEach(g=>{var p,E;return M.move((p=g.data)==null?void 0:p.source,(E=g.data)==null?void 0:E.index,f,o)})}}),_(M,"applyCopy",e=>{var l,s,i,m,u,c;const t=e.hovered.element.value,a=e.hovered.zone.value;if(t){const d=(s=(l=e.elementsMap.value.get(t))==null?void 0:l.data)==null?void 0:s.source,f=(m=(i=e.elementsMap.value.get(t))==null?void 0:i.data)==null?void 0:m.index;Array.from(e.draggingElements.value.values()).sort((v,g)=>{var p,E;return(((p=g.data)==null?void 0:p.index)||0)-(((E=v.data)==null?void 0:E.index)||0)}).forEach(v=>{var g,p;return M.copy((g=v.data)==null?void 0:g.source,(p=v.data)==null?void 0:p.index,d,f)})}else if(a){const d=(c=(u=e.zonesMap.value.get(a))==null?void 0:u.data)==null?void 0:c.source,f=d==null?void 0:d.length;Array.from(e.draggingElements.value.values()).sort((v,g)=>{var p,E;return(((p=g.data)==null?void 0:p.index)||0)-(((E=v.data)==null?void 0:E.index)||0)}).forEach(v=>{var g,p;return M.copy((g=v.data)==null?void 0:g.source,(p=v.data)==null?void 0:p.index,d,f)})}}),_(M,"applySwap",e=>{var l,s,i,m,u,c,d,f;const t=e.hovered.element.value,a=e.hovered.zone.value;if(t&&e.draggingElements.value.size===1){const o=e.draggingElements.value.values().next().value;M.swap((l=o==null?void 0:o.data)==null?void 0:l.source,(s=o==null?void 0:o.data)==null?void 0:s.index,(m=(i=e.elementsMap.value.get(t))==null?void 0:i.data)==null?void 0:m.source,(c=(u=e.elementsMap.value.get(t))==null?void 0:u.data)==null?void 0:c.index)}else if(a){const o=(f=(d=e.zonesMap.value.get(a))==null?void 0:d.data)==null?void 0:f.source,v=o==null?void 0:o.length;Array.from(e.draggingElements.value.values()).sort((p,E)=>{var w,A;return(((w=E.data)==null?void 0:w.index)||0)-(((A=p.data)==null?void 0:A.index)||0)}).forEach(p=>{var E,w;return M.move((E=p.data)==null?void 0:E.source,(w=p.data)==null?void 0:w.index,o,v)})}}),_(M,"applyRemove",e=>{Array.from(e.draggingElements.value.values()).sort((a,l)=>{var s,i;return(((s=l.data)==null?void 0:s.index)||0)-(((i=a.data)==null?void 0:i.index)||0)}).forEach(a=>{var l,s;(l=a.data)!=null&&l.source&&((s=a.data)==null?void 0:s.index)!==void 0&&M.remove(a.data.source,a.data.index)})}),_(M,"applyInsert",(e,t)=>{var s,i,m,u,c,d;const a=e.hovered.element.value,l=e.hovered.zone.value;if(a&&t.length>0){const f=(i=(s=e.elementsMap.value.get(a))==null?void 0:s.data)==null?void 0:i.source,o=(u=(m=e.elementsMap.value.get(a))==null?void 0:m.data)==null?void 0:u.index;t.forEach(v=>{M.insert(f,o,v)})}else if(l){const f=(d=(c=e.zonesMap.value.get(l))==null?void 0:c.data)==null?void 0:d.source,o=f==null?void 0:f.length;t.forEach(v=>{M.insert(f,o,v)})}});let N=M;const I=F.createGlobalState(()=>{const n=r.ref(new Map),e=r.computed(()=>n.value.size>0),t={component:r.ref(null),ref:r.shallowRef(null),options:r.shallowRef(null),animating:{enter:r.shallowRef(!1),leave:r.shallowRef(!1),appear:r.shallowRef(!1)}},a=r.ref(new Map),l=r.ref(new Set),s=r.ref(new Map),i=r.ref(new Set),m=r.ref(new Set),u=typeof window<"u"&&"IntersectionObserver"in window,c=u?new IntersectionObserver(h=>{h.forEach(y=>m.value[y.isIntersecting?"add":"delete"](y.target))}):null,d=u?new IntersectionObserver(h=>{h.forEach(y=>i.value[y.isIntersecting?"add":"delete"](y.target))}):null,f=(h,y)=>{c&&(h==="add"?c.observe(y):(c.unobserve(y),m.value.delete(y)))},o=(h,y)=>{d&&(h==="add"?d.observe(y):(d.unobserve(y),i.value.delete(y)))},v={start:r.shallowRef(null),current:r.shallowRef(null),offset:{percent:r.shallowRef(null),pixel:r.shallowRef(null)}},{w:g,s:p,a:E,d:w,ctrl:A,shift:P,alt:k,meta:O}=F.useMagicKeys(),V={zone:r.shallowRef(null),element:r.shallowRef(null)};return{draggingElements:n,isDragging:e,activeContainer:t,elementsMap:a,selectedElements:l,zonesMap:s,visibleZones:i,visibleElements:m,pointerPosition:v,keyboard:{w:g,s:p,a:E,d:w,ctrl:A,shift:P,alt:k,meta:O},hovered:V,handleDragElementIntersection:f,handleDropZoneIntersection:o}}),ne=n=>{const e=r.ref(null),{draggingElements:t,pointerPosition:a,isDragging:l,activeContainer:s}=I();return r.onMounted(()=>{s.ref=e,s.options.value=n??null}),r.onUnmounted(()=>{s.ref.value=null,s.options.value=null}),{elementRef:e,draggingElements:t,pointerPosition:a,isDragging:l,animating:s.animating}},le=["innerHTML"],oe=r.defineComponent({__name:"DefaultOverlay",props:{styles:{}},setup(n){const{elementRef:e,pointerPosition:t,isDragging:a,draggingElements:l}=ne(),s=r.computed(()=>{var i,m,u,c;return{transform:`translate3d(${(((i=t.current.value)==null?void 0:i.x)??0)-(((m=t.offset.pixel.value)==null?void 0:m.x)??0)}px, ${(((u=t.current.value)==null?void 0:u.y)??0)-(((c=t.offset.pixel.value)==null?void 0:c.y)??0)}px, 0)`,zIndex:1e3,position:"fixed",top:0,left:0,transition:"0.3s cubic-bezier(0.165, 0.84, 0.44, 1)",...n.styles}});return(i,m)=>r.unref(a)?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"elementRef",ref:e,style:r.normalizeStyle(s.value)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l),([u,c])=>{var d,f;return r.openBlock(),r.createElementBlock(r.Fragment,{key:c.id},[c.layer?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.layer),{key:0,node:u,data:c.data,id:c.id,groups:c.groups},null,8,["node","data","id","groups"])):(r.openBlock(),r.createElementBlock("div",{key:1,innerHTML:c.initialHTML,style:r.normalizeStyle({width:`${(d=c.initialRect)==null?void 0:d.width}px`,height:`${(f=c.initialRect)==null?void 0:f.height}px`})},null,12,le))],64)}),128))],4)):r.createCommentVNode("",!0)}}),J=r.defineComponent({__name:"DragOverlay",props:{styles:{}},setup(n){const e=n,{activeContainer:t}=I(),a=r.computed(()=>({component:t.component.value??oe,props:e}));return(l,s)=>r.unref(t).options.value?(r.openBlock(),r.createBlock(r.Transition,{key:0,name:r.unref(t).options.value.name,duration:r.unref(t).options.value.duration,"enter-from-class":r.unref(t).options.value.enterFromClass,"enter-to-class":r.unref(t).options.value.enterToClass,"enter-active-class":r.unref(t).options.value.enterActiveClass,"leave-from-class":r.unref(t).options.value.leaveFromClass,"leave-to-class":r.unref(t).options.value.leaveToClass,"leave-active-class":r.unref(t).options.value.leaveActiveClass,"appear-active-class":r.unref(t).options.value.appearActiveClass,"appear-from-class":r.unref(t).options.value.appearFromClass,"appear-to-class":r.unref(t).options.value.appearToClass,mode:r.unref(t).options.value.mode,type:r.unref(t).options.value.type,css:r.unref(t).options.value.css,appear:!0,persisted:r.unref(t).options.value.persisted,onEnter:r.unref(t).options.value.onEnter,onLeave:r.unref(t).options.value.onLeave,onBeforeEnter:r.unref(t).options.value.onBeforeEnter,onBeforeLeave:r.unref(t).options.value.onBeforeLeave,onBeforeAppear:r.unref(t).options.value.onBeforeAppear,onAfterEnter:r.unref(t).options.value.onAfterEnter,onAfterLeave:r.unref(t).options.value.onAfterLeave,onAfterAppear:r.unref(t).options.value.onAfterAppear},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(a.value.component||a.value),r.normalizeProps(r.guardReactiveProps(a.value.props||{})),null,16))]),_:1},8,["name","duration","enter-from-class","enter-to-class","enter-active-class","leave-from-class","leave-to-class","leave-active-class","appear-active-class","appear-from-class","appear-to-class","mode","type","css","persisted","onEnter","onLeave","onBeforeEnter","onBeforeLeave","onBeforeAppear","onAfterEnter","onAfterLeave","onAfterAppear"])):(r.openBlock(),r.createBlock(r.resolveDynamicComponent(a.value.component||a.value),r.normalizeProps(r.mergeProps({key:1},a.value.props||{})),null,16))}}),se={install(n,e){n.component("DragOverlay",J);const t=n.mount;n.mount=function(l){var m;const s=t.call(this,l),i=typeof l=="string"?document.querySelector(l):l;if(i&&i instanceof Element&&!i.querySelector("#vue-dnd-kit-overlay")){const u=document.createElement("div");u.id="vue-dnd-kit-overlay",u.style.pointerEvents="none",i.appendChild(u);const c=r.createVNode(J,{styles:(m=e==null?void 0:e.defaultOverlay)==null?void 0:m.styles});r.render(c,u),n.__VUE_DND_KIT_OVERLAY__={container:u,vnode:c,options:(e==null?void 0:e.defaultOverlay)||{}};const d=I();n.__VUE_DND_KIT_STORE__=d}return s};const a=n.unmount;n.unmount=function(){return n.__VUE_DND_KIT_OVERLAY__&&(r.render(null,n.__VUE_DND_KIT_OVERLAY__.container),delete n.__VUE_DND_KIT_OVERLAY__),a.call(this)}}},Q=(n,e)=>n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y,K=n=>{if(!n)return{x:0,y:0,width:0,height:0,bottom:0,left:0,right:0,top:0};const e=n.getBoundingClientRect();return{bottom:e.bottom,left:e.left,right:e.right,top:e.top,x:e.x,y:e.y,width:e.width,height:e.height}},X=n=>({x:n.x+n.width/2,y:n.y+n.height/2}),ue=(n,e)=>{const t=K(n);return{pixel:{x:e.x-t.x,y:e.y-t.y},percent:{x:(e.x-t.x)/t.width*100,y:(e.y-t.y)/t.height*100}}},W=(n,e)=>{const t=e.x-n.x,a=e.y-n.y;return Math.sqrt(t*t+a*a)},ee=(n,e)=>{const t=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),a=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y)),l=t*a,s=n.width*n.height,i=e.width*e.height;return(l/s*100+l/i*100)/2},te="data-vue-dnd-kit-draggable",C=n=>{n.preventDefault()},Z=n=>({items:Array.from(n.draggingElements.value.values())}),ie=n=>{const{elementsMap:e,draggingElements:t,hovered:a,selectedElements:l,isDragging:s,visibleElements:i,handleDragElementIntersection:m}=I(),u=r.ref(null),c=r.computed(()=>i.value.has(u.value)&&a.element.value===u.value),d=r.shallowRef((n==null?void 0:n.id)||r.useId()),f=r.computed(()=>!u.value||!e.value.has(u.value)?!1:t.value.has(u.value)),o=r.computed(()=>{if(!u.value||!s.value||!i.value.has(u.value))return!1;const p=e.value.get(u.value);return p!=null&&p.groups.length?!Array.from(t.value.entries()).some(([E,w])=>w.groups.length?!w.groups.some(A=>p.groups.includes(A)):!1):!0});return{elementRef:u,registerElement:()=>{if(!u.value)throw new Error("ElementRef is not set");e.value.set(u.value,{node:u.value,groups:(n==null?void 0:n.groups)??[],layer:(n==null?void 0:n.layer)??null,defaultLayer:(n==null?void 0:n.layer)??null,events:(n==null?void 0:n.events)??{},data:(n==null?void 0:n.data)??null,id:d.value}),m("add",u.value),u.value.addEventListener("dragstart",C),u.value.addEventListener("drag",C),u.value.setAttribute(te,"true"),u.value.setAttribute("draggable","false")},unregisterElement:()=>{u.value&&(e.value.delete(u.value),l.value.delete(u.value),u.value.removeEventListener("dragstart",C),u.value.removeEventListener("drag",C),u.value.removeAttribute(te),u.value.removeAttribute("draggable"))},isDragging:f,isOvered:c,isAllowed:o,id:d}},b=(n,e)=>n?e.contains(n):!1,ce=n=>{var d,f;const e=K(n.activeContainer.ref.value),t=X(e),a=((d=n.pointerPosition.current.value)==null?void 0:d.x)??0,l=((f=n.pointerPosition.current.value)==null?void 0:f.y)??0,i=!(e&&a>=e.x&&a<=e.x+e.width&&l>=e.y&&l<=e.y+e.height),m=Array.from(n.draggingElements.value.keys()),u=Array.from(n.visibleElements.value.entries()).filter(([o,v])=>{if(!o)return!1;const g=K(o);return g&&e&&Q(g,e)}).map(([o,v])=>{const g=K(o),p=X(g),E=a>=g.x&&a<=g.x+g.width&&l>=g.y&&l<=g.y+g.height,w=ee(g,e),A=W(t,p);let P=0;for(const[k,O]of n.visibleElements.value.entries())k!==o&&k&&o&&b(o,k)&&P++;return{element:v,node:o,isPointerInElement:E,overlapPercent:w,depth:P,centerDistance:A}}).sort((o,v)=>{if(!i){if(o.isPointerInElement&&v.isPointerInElement)return v.depth-o.depth;if(o.isPointerInElement!==v.isPointerInElement)return o.isPointerInElement?-1:1}return Math.abs(o.overlapPercent-v.overlapPercent)<=1?o.centerDistance-v.centerDistance:v.overlapPercent-o.overlapPercent}),c=Array.from(n.visibleZones.value.entries()).filter(([o,v])=>{if(!o||m.some(p=>p&&b(o,p)))return!1;const g=K(o);return g&&e&&Q(g,e)}).map(([o,v])=>{const g=K(o),p=X(g),E=a>=g.x&&a<=g.x+g.width&&l>=g.y&&l<=g.y+g.height,w=ee(g,e),A=W(t,p);let P=0;for(const[k,O]of n.visibleZones.value.entries())k!==o&&k&&o&&b(o,k)&&P++;return{zone:v,node:o,isPointerInElement:E,overlapPercent:w,depth:P,centerDistance:A}}).sort((o,v)=>{if(!i){if(o.isPointerInElement&&v.isPointerInElement)return v.depth-o.depth;if(o.isPointerInElement!==v.isPointerInElement)return o.isPointerInElement?-1:1}return Math.abs(o.overlapPercent-v.overlapPercent)<=1?o.centerDistance-v.centerDistance:v.overlapPercent-o.overlapPercent});return[...u.map(o=>o.node),...c.map(o=>o.node)]},ve=(n,e)=>{const{pointerPosition:t,keyboard:a}=I(),l=(e==null?void 0:e.moveStep)||10;return{onKeyboardStart:u=>{var o;C(u);const c=K(n.value);(o=n.value)==null||o.blur();const d=c.x+c.width/2,f=c.y+c.height/2;t.start.value={x:d,y:f},t.current.value={x:d,y:f},t.offset.pixel.value={x:c.width/2,y:c.height/2},t.offset.percent.value={x:50,y:50}},onKeyboardMove:()=>{if(!t.current.value)return;const u=t.current.value.x,c=t.current.value.y;let d=u,f=c;a.w.value&&(f-=l),a.s.value&&(f+=l),a.a.value&&(d-=l),a.d.value&&(d+=l),t.current.value={x:d,y:f}},onKeyboardEnd:()=>{t.current.value=null,t.start.value=null,t.offset.pixel.value=null,t.offset.percent.value=null}}},de=n=>{const e=I();return{onPointerStart:s=>{e.pointerPosition.start.value={x:s.clientX,y:s.clientY},e.pointerPosition.current.value={x:s.clientX,y:s.clientY};const{pixel:i,percent:m}=ue(n.value,{x:s.clientX,y:s.clientY});e.pointerPosition.offset.pixel.value=i,e.pointerPosition.offset.percent.value=m},onPointerMove:s=>{e.pointerPosition.current.value={x:s.clientX,y:s.clientY}},onPointerEnd:()=>{e.pointerPosition.current.value=null,e.pointerPosition.start.value=null,e.pointerPosition.offset.pixel.value=null,e.pointerPosition.offset.percent.value=null}}},fe=(n,e)=>{var O,V;const t=I(),{onPointerStart:a,onPointerMove:l,onPointerEnd:s}=de(n),{onKeyboardStart:i,onKeyboardMove:m,onKeyboardEnd:u}=ve(n,e==null?void 0:e.keyboard);let c=null;const d=h=>{var z,S;if(!h)return new Map;const y=t.selectedElements.value.has(h);if(t.selectedElements.value.size>0&&y){const D=new Map;return t.selectedElements.value.forEach(B=>{var R,U;const T=t.elementsMap.value.get(B);T&&D.set(B,{...T,initialHTML:((R=T.node)==null?void 0:R.outerHTML)??"",initialRect:(U=T.node)==null?void 0:U.getBoundingClientRect()})}),D}t.selectedElements.value.clear();const L=t.elementsMap.value.get(h);if(!L)return new Map;const x=new Map;return x.set(h,{...L,initialHTML:((z=L.node)==null?void 0:z.outerHTML)??"",initialRect:(S=L.node)==null?void 0:S.getBoundingClientRect()}),x},f=h=>{if(!h)return{element:null,zone:null};const y=Array.isArray(h)?h:[h],L=Array.from(t.draggingElements.value.keys()),x=y.find(S=>{if(!t.visibleZones.value.has(S))return!1;const D=t.zonesMap.value.get(S);return!(!D||L.some(B=>B&&(B===D.node||b(D.node,B)))||D.groups.length&&!!Array.from(t.draggingElements.value.values()).some(T=>T.groups.length?!T.groups.some(R=>D.groups.includes(R)):!1))});return x?{element:y.find(S=>t.visibleElements.value.has(S)&&t.elementsMap.value.has(S)&&!L.some(D=>D&&(D===S||b(S,D)||b(D,S)))&&(S===x||b(S,x)))||null,zone:x}:{element:null,zone:null}},o=((O=e==null?void 0:e.sensor)==null?void 0:O.setup)||ce,v=h=>{var S,D,B,T,R,U,q,Y,$,G,H,j;const y=t.hovered.element.value,L=t.hovered.zone.value,x=h.element,z=h.zone;t.hovered.element.value=x,t.hovered.zone.value=z,y!==x&&(y&&((B=(D=(S=t.elementsMap.value.get(y))==null?void 0:S.events)==null?void 0:D.onLeave)==null||B.call(D,t,Z(t))),x&&((U=(R=(T=t.elementsMap.value.get(x))==null?void 0:T.events)==null?void 0:R.onHover)==null||U.call(R,t,Z(t)))),L!==z&&(L&&(($=(Y=(q=t.zonesMap.value.get(L))==null?void 0:q.events)==null?void 0:Y.onLeave)==null||$.call(Y,t,Z(t))),z&&((j=(H=(G=t.zonesMap.value.get(z))==null?void 0:G.events)==null?void 0:H.onHover)==null||j.call(H,t,Z(t))))},g=F.useThrottleFn(()=>{const h=o(t),y=f(h);v(y)},((V=e==null?void 0:e.sensor)==null?void 0:V.throttle)??0),p=()=>{g(),c=requestAnimationFrame(p)},E=()=>p(),w=()=>{c!==null&&(cancelAnimationFrame(c),c=null)};return{activate:h=>{t.draggingElements.value=d(n.value),t.draggingElements.value.forEach(y=>{var L,x;return(x=(L=y.events).onStart)==null?void 0:x.call(L,t,Z(t))}),h instanceof PointerEvent?a(h):i(h),E()},track:h=>{t.draggingElements.value.forEach(y=>{var L,x;return(x=(L=y.events).onMove)==null?void 0:x.call(L,t,Z(t))}),h instanceof KeyboardEvent?m():l(h)},deactivate:(h=!0)=>{var y,L;if(s(),u(),h){if(t.hovered.zone.value){const x=t.zonesMap.value.get(t.hovered.zone.value);(L=x==null?void 0:(y=x.events).onDrop)==null||L.call(y,t,Z(t))}else t.draggingElements.value.forEach(x=>{var z,S;return(S=(z=x.events).onEnd)==null?void 0:S.call(z,t,Z(t))});t.selectedElements.value.clear()}t.draggingElements.value.clear(),t.hovered.zone.value=null,t.hovered.element.value=null,w()}}},ge=F.createGlobalState(()=>{let n="",e="",t="",a=null,l=null,s=null,i=null,m=null;const{activeContainer:u}=I(),c=()=>{const v=document.body;n=v.style.userSelect,v.style.userSelect="none",window.addEventListener("contextmenu",C),window.addEventListener("selectstart",C),window.addEventListener("touchstart",C),window.addEventListener("touchmove",C)},d=()=>{const v=document.body;v.style.userSelect=n,v.style.touchAction=e,v.style.overscrollBehavior=t,window.removeEventListener("contextmenu",C),window.removeEventListener("selectstart",C),window.removeEventListener("touchstart",C),window.removeEventListener("touchmove",C)},f=()=>{a&&(document.removeEventListener("pointermove",a),a=null),l&&(document.removeEventListener("pointerup",l),l=null),s&&(s=null),i&&(document.removeEventListener("wheel",i),i=null),m&&(document.removeEventListener("keydown",m),document.removeEventListener("keypress",m),document.removeEventListener("keyup",m),m=null)};return{handleDragStart:(v,g,p)=>{f(),v.target.blur(),p!=null&&p.container&&(u.component.value=p.container);const{activate:E,track:w,deactivate:A}=fe(g,p);l=()=>{u.component.value=null,d(),A(!0),f()},s=()=>{u.component.value=null,d(),A(!1),f()},a=P=>w(P),i=P=>w(P),m=P=>{P.type==="keyup"&&(P.code==="Escape"&&(s==null||s()),P.code==="Enter"&&(l==null||l())),w(P)},c(),E(v),document.addEventListener("pointermove",a),document.addEventListener("pointerup",l),document.addEventListener("wheel",i),document.addEventListener("keydown",m),document.addEventListener("keypress",m),document.addEventListener("keyup",m)}}}),me=n=>{const{id:e,elementRef:t,isDragging:a,isOvered:l,isAllowed:s,registerElement:i,unregisterElement:m}=ie(n),{pointerPosition:u}=I(),{handleDragStart:c}=ge(),d=f=>c(f,t,n);return r.onMounted(i),r.onBeforeUnmount(m),{pointerPosition:u,elementRef:t,isDragging:a,isOvered:l,isAllowed:s,handleDragStart:d,id:e}},pe=n=>{const{zonesMap:e,hovered:t,draggingElements:a,isDragging:l,handleDropZoneIntersection:s}=I(),i=r.ref(null),m=r.computed(()=>t.zone.value===i.value),u=r.computed(()=>{if(!i.value||!l.value)return!1;const f=e.value.get(i.value);return f!=null&&f.groups.length?!Array.from(a.value.values()).some(o=>o.groups.length?!o.groups.some(v=>f.groups.includes(v)):!1):!0});return{elementRef:i,registerZone:()=>{if(!i.value)throw new Error("elementRef is not set");s("add",i.value),e.value.set(i.value,{node:i.value,groups:(n==null?void 0:n.groups)??[],events:(n==null?void 0:n.events)??{},data:(n==null?void 0:n.data)??void 0}),i.value.setAttribute("data-dnd-droppable","true")},unregisterZone:()=>{i.value&&(s("remove",i.value),e.value.delete(i.value))},isOvered:m,isAllowed:u}},he=n=>{const{elementRef:e,registerZone:t,unregisterZone:a,isOvered:l,isAllowed:s}=pe(n);return r.onMounted(t),r.onBeforeUnmount(a),{elementRef:e,isOvered:l,isAllowed:s}},ye=n=>{const{selectedElements:e,elementsMap:t}=I(),a=r.computed(()=>n.value?e.value.has(n.value):!1),l=r.computed(()=>{if(!n.value)return!1;for(const c of e.value)if(c&&b(c,n.value))return!0;return!1}),s=r.computed(()=>{if(!n.value)return!1;for(const c of e.value)if(c&&b(n.value,c))return!0;return!1}),i=()=>{n.value&&e.value.delete(n.value)},m=()=>{if(!(!n.value||!t.value.get(n.value))){if(l.value)for(const d of e.value)d&&b(d,n.value)&&e.value.delete(d);if(s.value)for(const d of e.value)d&&b(n.value,d)&&e.value.delete(d);e.value.add(n.value)}};return{handleUnselect:i,handleSelect:m,handleToggleSelect:()=>{n.value&&(e.value.has(n.value)?i():m())},isSelected:a,isParentOfSelected:l}};exports.DnDOperations=N;exports.default=se;exports.getBoundingBox=K;exports.useDnDStore=I;exports.useDragContainer=ne;exports.useDraggable=me;exports.useDroppable=he;exports.useSelection=ye;
|
|
1
|
+
"use strict";var re=Object.defineProperty;var ae=(n,t,e)=>t in n?re(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var _=(n,t,e)=>ae(n,typeof t!="symbol"?t+"":t,e);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),F=require("@vueuse/core"),A=class A{};_(A,"remove",(t,e)=>{if(!t||e===void 0)return;const[l]=t.splice(e,1);return l}),_(A,"insert",(t,e,l)=>{!t||e===void 0||t.splice(e,0,l)}),_(A,"move",(t,e,l,o)=>{if(!t||!l||e===void 0||o===void 0)return;const u=A.remove(t,e);A.insert(l,o,u)}),_(A,"swap",(t,e,l,o)=>{if(!t||!l||e===void 0||o===void 0)return;const u=t[e],i=l[o];t[e]=i,l[o]=u}),_(A,"copy",(t,e,l,o)=>{if(!t||e===void 0||!l||o===void 0)return;const u=t[e];A.insert(l,o,u)}),_(A,"applyTransfer",t=>{var o,u,i,g,s,c,d;const e=t.hovered.element.value,l=t.hovered.zone.value;if(e){const m=(u=(o=t.elementsMap.value.get(e))==null?void 0:o.data)==null?void 0:u.source,a=(g=(i=t.elementsMap.value.get(e))==null?void 0:i.data)==null?void 0:g.index,f=t.draggingElements.value.values().next().value,v=(s=f==null?void 0:f.data)==null?void 0:s.index,h=v!==void 0&&a!==void 0&&v>a?1:-1;Array.from(t.draggingElements.value.values()).sort((E,P)=>{var S,M;return h*((((S=E.data)==null?void 0:S.index)||0)-(((M=P.data)==null?void 0:M.index)||0))}).forEach(E=>{var P,S;return A.move((P=E.data)==null?void 0:P.source,(S=E.data)==null?void 0:S.index,m,a)})}else if(l){const m=(d=(c=t.zonesMap.value.get(l))==null?void 0:c.data)==null?void 0:d.source,a=m==null?void 0:m.length;Array.from(t.draggingElements.value.values()).sort((v,h)=>{var p,E;return(((p=h.data)==null?void 0:p.index)||0)-(((E=v.data)==null?void 0:E.index)||0)}).forEach(v=>{var h,p;return A.move((h=v.data)==null?void 0:h.source,(p=v.data)==null?void 0:p.index,m,a)})}}),_(A,"applyCopy",t=>{var o,u,i,g,s,c;const e=t.hovered.element.value,l=t.hovered.zone.value;if(e){const d=(u=(o=t.elementsMap.value.get(e))==null?void 0:o.data)==null?void 0:u.source,m=(g=(i=t.elementsMap.value.get(e))==null?void 0:i.data)==null?void 0:g.index;Array.from(t.draggingElements.value.values()).sort((f,v)=>{var h,p;return(((h=v.data)==null?void 0:h.index)||0)-(((p=f.data)==null?void 0:p.index)||0)}).forEach(f=>{var v,h;return A.copy((v=f.data)==null?void 0:v.source,(h=f.data)==null?void 0:h.index,d,m)})}else if(l){const d=(c=(s=t.zonesMap.value.get(l))==null?void 0:s.data)==null?void 0:c.source,m=d==null?void 0:d.length;Array.from(t.draggingElements.value.values()).sort((f,v)=>{var h,p;return(((h=v.data)==null?void 0:h.index)||0)-(((p=f.data)==null?void 0:p.index)||0)}).forEach(f=>{var v,h;return A.copy((v=f.data)==null?void 0:v.source,(h=f.data)==null?void 0:h.index,d,m)})}}),_(A,"applySwap",t=>{var o,u,i,g,s,c,d,m;const e=t.hovered.element.value,l=t.hovered.zone.value;if(e&&t.draggingElements.value.size===1){const a=t.draggingElements.value.values().next().value;A.swap((o=a==null?void 0:a.data)==null?void 0:o.source,(u=a==null?void 0:a.data)==null?void 0:u.index,(g=(i=t.elementsMap.value.get(e))==null?void 0:i.data)==null?void 0:g.source,(c=(s=t.elementsMap.value.get(e))==null?void 0:s.data)==null?void 0:c.index)}else if(l){const a=(m=(d=t.zonesMap.value.get(l))==null?void 0:d.data)==null?void 0:m.source,f=a==null?void 0:a.length;Array.from(t.draggingElements.value.values()).sort((h,p)=>{var E,P;return(((E=p.data)==null?void 0:E.index)||0)-(((P=h.data)==null?void 0:P.index)||0)}).forEach(h=>{var p,E;return A.move((p=h.data)==null?void 0:p.source,(E=h.data)==null?void 0:E.index,a,f)})}}),_(A,"applyRemove",t=>{Array.from(t.draggingElements.value.values()).sort((l,o)=>{var u,i;return(((u=o.data)==null?void 0:u.index)||0)-(((i=l.data)==null?void 0:i.index)||0)}).forEach(l=>{var o,u;(o=l.data)!=null&&o.source&&((u=l.data)==null?void 0:u.index)!==void 0&&A.remove(l.data.source,l.data.index)})}),_(A,"applyInsert",(t,e)=>{var u,i,g,s,c,d;const l=t.hovered.element.value,o=t.hovered.zone.value;if(l&&e.length>0){const m=(i=(u=t.elementsMap.value.get(l))==null?void 0:u.data)==null?void 0:i.source,a=(s=(g=t.elementsMap.value.get(l))==null?void 0:g.data)==null?void 0:s.index;e.forEach(f=>{A.insert(m,a,f)})}else if(o){const m=(d=(c=t.zonesMap.value.get(o))==null?void 0:c.data)==null?void 0:d.source,a=m==null?void 0:m.length;e.forEach(f=>{A.insert(m,a,f)})}});let N=A;const I=F.createGlobalState(()=>{const n=r.shallowRef(!1),t=r.ref(new Map),e=r.computed(()=>t.value.size>0),l={component:r.ref(null),ref:r.shallowRef(null),options:r.shallowRef(null),animating:{enter:r.shallowRef(!1),leave:r.shallowRef(!1),appear:r.shallowRef(!1)}},o=r.ref(new Map),u=r.ref(new Set),i=r.ref(new Map),g=r.shallowRef(new Set),s=r.shallowRef(new Set),c=typeof window<"u"&&"IntersectionObserver"in window,d=c?new IntersectionObserver(x=>{x.forEach(y=>s.value[y.isIntersecting?"add":"delete"](y.target))}):null,m=c?new IntersectionObserver(x=>{x.forEach(y=>g.value[y.isIntersecting?"add":"delete"](y.target))}):null,a=(x,y)=>{d&&(x==="add"?d.observe(y):(d.unobserve(y),s.value.delete(y)))},f=(x,y)=>{m&&(x==="add"?m.observe(y):(m.unobserve(y),g.value.delete(y)))},v={start:r.shallowRef(null),current:r.shallowRef(null),offset:{percent:r.shallowRef(null),pixel:r.shallowRef(null)}},{w:h,s:p,a:E,d:P,ctrl:S,shift:M,alt:O,meta:V}=F.useMagicKeys(),w={zone:r.shallowRef(null),element:r.shallowRef(null)};return{draggingElements:t,isDragging:e,activeContainer:l,elementsMap:o,selectedElements:u,zonesMap:i,visibleZones:g,visibleElements:s,pointerPosition:v,keyboard:{w:h,s:p,a:E,d:P,ctrl:S,shift:M,alt:O,meta:V},hovered:w,isPending:n,handleDragElementIntersection:a,handleDropZoneIntersection:f}}),ne=n=>{const t=r.ref(null),{draggingElements:e,pointerPosition:l,isDragging:o,activeContainer:u}=I();return r.onMounted(()=>{u.ref=t,u.options.value=n??null}),r.onUnmounted(()=>{u.ref.value=null,u.options.value=null}),{elementRef:t,draggingElements:e,pointerPosition:l,isDragging:o,animating:u.animating}},le=["innerHTML"],oe=r.defineComponent({__name:"DefaultOverlay",props:{styles:{}},setup(n){const{elementRef:t,pointerPosition:e,isDragging:l,draggingElements:o}=ne(),u=r.computed(()=>{var i,g,s,c;return{transform:`translate3d(${(((i=e.current.value)==null?void 0:i.x)??0)-(((g=e.offset.pixel.value)==null?void 0:g.x)??0)}px, ${(((s=e.current.value)==null?void 0:s.y)??0)-(((c=e.offset.pixel.value)==null?void 0:c.y)??0)}px, 0)`,zIndex:1e3,position:"fixed",top:0,left:0,transition:"0.3s cubic-bezier(0.165, 0.84, 0.44, 1)",...n.styles}});return(i,g)=>r.unref(l)?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"elementRef",ref:t,style:r.normalizeStyle(u.value)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(o),([s,c])=>{var d,m;return r.openBlock(),r.createElementBlock(r.Fragment,{key:c.id},[c.layer?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.layer),{key:0,node:s,data:c.data,id:c.id,groups:c.groups},null,8,["node","data","id","groups"])):(r.openBlock(),r.createElementBlock("div",{key:1,innerHTML:c.initialHTML,style:r.normalizeStyle({width:`${(d=c.initialRect)==null?void 0:d.width}px`,height:`${(m=c.initialRect)==null?void 0:m.height}px`})},null,12,le))],64)}),128))],4)):r.createCommentVNode("",!0)}}),J=r.defineComponent({__name:"DragOverlay",props:{styles:{}},setup(n){const t=n,{activeContainer:e}=I(),l=r.computed(()=>({component:e.component.value??oe,props:t}));return(o,u)=>r.unref(e).options.value?(r.openBlock(),r.createBlock(r.Transition,{key:0,name:r.unref(e).options.value.name,duration:r.unref(e).options.value.duration,"enter-from-class":r.unref(e).options.value.enterFromClass,"enter-to-class":r.unref(e).options.value.enterToClass,"enter-active-class":r.unref(e).options.value.enterActiveClass,"leave-from-class":r.unref(e).options.value.leaveFromClass,"leave-to-class":r.unref(e).options.value.leaveToClass,"leave-active-class":r.unref(e).options.value.leaveActiveClass,"appear-active-class":r.unref(e).options.value.appearActiveClass,"appear-from-class":r.unref(e).options.value.appearFromClass,"appear-to-class":r.unref(e).options.value.appearToClass,mode:r.unref(e).options.value.mode,type:r.unref(e).options.value.type,css:r.unref(e).options.value.css,appear:!0,persisted:r.unref(e).options.value.persisted,onEnter:r.unref(e).options.value.onEnter,onLeave:r.unref(e).options.value.onLeave,onBeforeEnter:r.unref(e).options.value.onBeforeEnter,onBeforeLeave:r.unref(e).options.value.onBeforeLeave,onBeforeAppear:r.unref(e).options.value.onBeforeAppear,onAfterEnter:r.unref(e).options.value.onAfterEnter,onAfterLeave:r.unref(e).options.value.onAfterLeave,onAfterAppear:r.unref(e).options.value.onAfterAppear},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.value.component||l.value),r.normalizeProps(r.guardReactiveProps(l.value.props||{})),null,16))]),_:1},8,["name","duration","enter-from-class","enter-to-class","enter-active-class","leave-from-class","leave-to-class","leave-active-class","appear-active-class","appear-from-class","appear-to-class","mode","type","css","persisted","onEnter","onLeave","onBeforeEnter","onBeforeLeave","onBeforeAppear","onAfterEnter","onAfterLeave","onAfterAppear"])):(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.value.component||l.value),r.normalizeProps(r.mergeProps({key:1},l.value.props||{})),null,16))}}),se={install(n,t){n.component("DragOverlay",J);const e=n.mount;n.mount=function(o){var g;const u=e.call(this,o),i=typeof o=="string"?document.querySelector(o):o;if(i&&i instanceof Element&&!i.querySelector("#vue-dnd-kit-overlay")){const s=document.createElement("div");s.id="vue-dnd-kit-overlay",s.style.pointerEvents="none",i.appendChild(s);const c=r.createVNode(J,{styles:(g=t==null?void 0:t.defaultOverlay)==null?void 0:g.styles});r.render(c,s),n.__VUE_DND_KIT_OVERLAY__={container:s,vnode:c,options:(t==null?void 0:t.defaultOverlay)||{}};const d=I();n.__VUE_DND_KIT_STORE__=d}return u};const l=n.unmount;n.unmount=function(){return n.__VUE_DND_KIT_OVERLAY__&&(r.render(null,n.__VUE_DND_KIT_OVERLAY__.container),delete n.__VUE_DND_KIT_OVERLAY__),l.call(this)}}},Q=(n,t)=>n.x<t.x+t.width&&n.x+n.width>t.x&&n.y<t.y+t.height&&n.y+n.height>t.y,Z=n=>{if(!n)return{x:0,y:0,width:0,height:0,bottom:0,left:0,right:0,top:0};const t=n.getBoundingClientRect();return{bottom:t.bottom,left:t.left,right:t.right,top:t.top,x:t.x,y:t.y,width:t.width,height:t.height}},X=n=>({x:n.x+n.width/2,y:n.y+n.height/2}),ue=(n,t)=>{const e=Z(n);return{pixel:{x:t.x-e.x,y:t.y-e.y},percent:{x:(t.x-e.x)/e.width*100,y:(t.y-e.y)/e.height*100}}},W=(n,t)=>{const e=t.x-n.x,l=t.y-n.y;return Math.sqrt(e*e+l*l)},ee=(n,t)=>{const e=Math.max(0,Math.min(n.x+n.width,t.x+t.width)-Math.max(n.x,t.x)),l=Math.max(0,Math.min(n.y+n.height,t.y+t.height)-Math.max(n.y,t.y)),o=e*l,u=n.width*n.height,i=t.width*t.height;return(o/u*100+o/i*100)/2},te="data-vue-dnd-kit-draggable",C=n=>{n.preventDefault()},K=n=>({items:Array.from(n.draggingElements.value.values())}),ie=n=>{const{elementsMap:t,draggingElements:e,hovered:l,selectedElements:o,isDragging:u,visibleElements:i,handleDragElementIntersection:g}=I(),s=r.ref(null),c=r.computed(()=>i.value.has(s.value)&&l.element.value===s.value),d=r.shallowRef((n==null?void 0:n.id)||r.useId()),m=r.computed(()=>!s.value||!t.value.has(s.value)?!1:e.value.has(s.value)),a=r.computed(()=>{if(!s.value||!u.value||!i.value.has(s.value))return!1;const p=t.value.get(s.value);return p!=null&&p.groups.length?!Array.from(e.value.entries()).some(([E,P])=>P.groups.length?!P.groups.some(S=>p.groups.includes(S)):!1):!0}),f=r.computed(()=>{if(!s.value||!u.value||!i.value.has(s.value)||l.element.value!==s.value)return!1;const p=t.value.get(s.value);return p!=null&&p.groups.length?!Array.from(e.value.entries()).some(([E,P])=>P.groups.length?!P.groups.some(S=>p.groups.includes(S)):!1):!0});return{elementRef:s,registerElement:()=>{if(!s.value)throw new Error("ElementRef is not set");t.value.set(s.value,{node:s.value,groups:(n==null?void 0:n.groups)??[],layer:(n==null?void 0:n.layer)??null,defaultLayer:(n==null?void 0:n.layer)??null,events:(n==null?void 0:n.events)??{},data:(n==null?void 0:n.data)??null,id:d.value}),g("add",s.value),s.value.addEventListener("dragstart",C),s.value.addEventListener("drag",C),s.value.setAttribute(te,"true"),s.value.setAttribute("draggable","false")},unregisterElement:()=>{s.value&&(t.value.delete(s.value),o.value.delete(s.value),s.value.removeEventListener("dragstart",C),s.value.removeEventListener("drag",C),s.value.removeAttribute(te),s.value.removeAttribute("draggable"))},isDragging:m,isOvered:c,isAllowed:a,isLazyAllowed:f,id:d}},b=(n,t)=>n?t.contains(n):!1,ce=n=>{var d,m;const t=Z(n.activeContainer.ref.value),e=X(t),l=((d=n.pointerPosition.current.value)==null?void 0:d.x)??0,o=((m=n.pointerPosition.current.value)==null?void 0:m.y)??0,i=!(t&&l>=t.x&&l<=t.x+t.width&&o>=t.y&&o<=t.y+t.height),g=Array.from(n.draggingElements.value.keys()),s=Array.from(n.visibleElements.value.entries()).filter(([a,f])=>{if(!a)return!1;const v=Z(a);return v&&t&&Q(v,t)}).map(([a,f])=>{const v=Z(a),h=X(v),p=l>=v.x&&l<=v.x+v.width&&o>=v.y&&o<=v.y+v.height,E=ee(v,t),P=W(e,h);let S=0;for(const[M,O]of n.visibleElements.value.entries())M!==a&&M&&a&&b(a,M)&&S++;return{element:f,node:a,isPointerInElement:p,overlapPercent:E,depth:S,centerDistance:P}}).sort((a,f)=>{if(!i){if(a.isPointerInElement&&f.isPointerInElement)return f.depth-a.depth;if(a.isPointerInElement!==f.isPointerInElement)return a.isPointerInElement?-1:1}return Math.abs(a.overlapPercent-f.overlapPercent)<=1?a.centerDistance-f.centerDistance:f.overlapPercent-a.overlapPercent}),c=Array.from(n.visibleZones.value.entries()).filter(([a,f])=>{if(!a||g.some(h=>h&&b(a,h)))return!1;const v=Z(a);return v&&t&&Q(v,t)}).map(([a,f])=>{const v=Z(a),h=X(v),p=l>=v.x&&l<=v.x+v.width&&o>=v.y&&o<=v.y+v.height,E=ee(v,t),P=W(e,h);let S=0;for(const[M,O]of n.visibleZones.value.entries())M!==a&&M&&a&&b(a,M)&&S++;return{zone:f,node:a,isPointerInElement:p,overlapPercent:E,depth:S,centerDistance:P}}).sort((a,f)=>{if(!i){if(a.isPointerInElement&&f.isPointerInElement)return f.depth-a.depth;if(a.isPointerInElement!==f.isPointerInElement)return a.isPointerInElement?-1:1}return Math.abs(a.overlapPercent-f.overlapPercent)<=1?a.centerDistance-f.centerDistance:f.overlapPercent-a.overlapPercent});return[...s.map(a=>a.node),...c.map(a=>a.node)]},ve=(n,t)=>{const{pointerPosition:e,keyboard:l}=I(),o=(t==null?void 0:t.moveStep)||10;return{onKeyboardStart:s=>{var a;C(s);const c=Z(n.value);(a=n.value)==null||a.blur();const d=c.x+c.width/2,m=c.y+c.height/2;e.start.value={x:d,y:m},e.current.value={x:d,y:m},e.offset.pixel.value={x:c.width/2,y:c.height/2},e.offset.percent.value={x:50,y:50}},onKeyboardMove:()=>{if(!e.current.value)return;const s=e.current.value.x,c=e.current.value.y;let d=s,m=c;l.w.value&&(m-=o),l.s.value&&(m+=o),l.a.value&&(d-=o),l.d.value&&(d+=o),e.current.value={x:d,y:m}},onKeyboardEnd:()=>{e.current.value=null,e.start.value=null,e.offset.pixel.value=null,e.offset.percent.value=null}}},de=n=>{const t=I();return{onPointerStart:u=>{t.pointerPosition.start.value={x:u.clientX,y:u.clientY},t.pointerPosition.current.value={x:u.clientX,y:u.clientY};const{pixel:i,percent:g}=ue(n.value,{x:u.clientX,y:u.clientY});t.pointerPosition.offset.pixel.value=i,t.pointerPosition.offset.percent.value=g},onPointerMove:u=>{t.isPending.value||(t.pointerPosition.current.value={x:u.clientX,y:u.clientY})},onPointerEnd:()=>{t.pointerPosition.current.value=null,t.pointerPosition.start.value=null,t.pointerPosition.offset.pixel.value=null,t.pointerPosition.offset.percent.value=null}}},fe=(n,t)=>{var O,V;const e=I(),{onPointerStart:l,onPointerMove:o,onPointerEnd:u}=de(n),{onKeyboardStart:i,onKeyboardMove:g,onKeyboardEnd:s}=ve(n,t==null?void 0:t.keyboard);let c=null;const d=w=>{var k,z;if(!w)return new Map;const x=e.selectedElements.value.has(w);if(e.selectedElements.value.size>0&&x){const D=new Map;return e.selectedElements.value.forEach(R=>{var T,U;const B=e.elementsMap.value.get(R);B&&D.set(R,{...B,initialHTML:((T=B.node)==null?void 0:T.outerHTML)??"",initialRect:(U=B.node)==null?void 0:U.getBoundingClientRect()})}),D}e.selectedElements.value.clear();const y=e.elementsMap.value.get(w);if(!y)return new Map;const L=new Map;return L.set(w,{...y,initialHTML:((k=y.node)==null?void 0:k.outerHTML)??"",initialRect:(z=y.node)==null?void 0:z.getBoundingClientRect()}),L},m=w=>{if(!w)return{element:null,zone:null};const x=Array.isArray(w)?w:[w],y=Array.from(e.draggingElements.value.keys()),L=x.find(z=>{if(!e.visibleZones.value.has(z))return!1;const D=e.zonesMap.value.get(z);return!(!D||y.some(R=>R&&(R===D.node||b(D.node,R)))||D.groups.length&&!!Array.from(e.draggingElements.value.values()).some(B=>B.groups.length?!B.groups.some(T=>D.groups.includes(T)):!1))});return L?{element:x.find(z=>e.visibleElements.value.has(z)&&e.elementsMap.value.has(z)&&!y.some(D=>D&&(D===z||b(z,D)||b(D,z)))&&(z===L||b(z,L)))||null,zone:L}:{element:null,zone:null}},a=((O=t==null?void 0:t.sensor)==null?void 0:O.setup)||ce,f=w=>{var z,D,R,B,T,U,q,Y,$,G,H,j;const x=e.hovered.element.value,y=e.hovered.zone.value,L=w.element,k=w.zone;e.hovered.element.value=L,e.hovered.zone.value=k,x!==L&&(x&&((R=(D=(z=e.elementsMap.value.get(x))==null?void 0:z.events)==null?void 0:D.onLeave)==null||R.call(D,e,K(e))),L&&((U=(T=(B=e.elementsMap.value.get(L))==null?void 0:B.events)==null?void 0:T.onHover)==null||U.call(T,e,K(e)))),y!==k&&(y&&(($=(Y=(q=e.zonesMap.value.get(y))==null?void 0:q.events)==null?void 0:Y.onLeave)==null||$.call(Y,e,K(e))),k&&((j=(H=(G=e.zonesMap.value.get(k))==null?void 0:G.events)==null?void 0:H.onHover)==null||j.call(H,e,K(e))))},v=F.useThrottleFn(()=>{const w=a(e),x=m(w);f(x)},((V=t==null?void 0:t.sensor)==null?void 0:V.throttle)??0),h=()=>{v(),c=requestAnimationFrame(h)},p=()=>h(),E=()=>{c!==null&&(u(),s(),cancelAnimationFrame(c),c=null)};return{activate:w=>{e.draggingElements.value=d(n.value),e.draggingElements.value.forEach(x=>{var y,L;return(L=(y=x.events).onStart)==null?void 0:L.call(y,e,K(e))}),w instanceof PointerEvent?l(w):i(w),p()},track:w=>{e.draggingElements.value.forEach(x=>{var y,L;return(L=(y=x.events).onMove)==null?void 0:L.call(y,e,K(e))}),w instanceof KeyboardEvent?g():o(w)},deactivate:async(w=!0)=>{var x,y;if(e.hovered.zone.value){const L=e.zonesMap.value.get(e.hovered.zone.value),k=(y=L==null?void 0:(x=L.events).onDrop)==null?void 0:y.call(x,e,K(e));if(k instanceof Promise)try{e.isPending.value=!0;const z=await k;return z&&(w&&e.selectedElements.value.clear(),e.draggingElements.value.clear(),e.hovered.zone.value=null,e.hovered.element.value=null,E()),z}catch{return!1}finally{e.isPending.value=!1}else w&&e.selectedElements.value.clear(),e.draggingElements.value.clear(),e.hovered.zone.value=null,e.hovered.element.value=null,E()}else e.draggingElements.value.forEach(L=>{var k,z;return(z=(k=L.events).onEnd)==null?void 0:z.call(k,e,K(e))}),w&&e.selectedElements.value.clear(),e.draggingElements.value.clear(),e.hovered.zone.value=null,e.hovered.element.value=null,E()}}},ge=F.createGlobalState(()=>{let n="",t="",e="",l=null,o=null,u=null,i=null,g=null;const{activeContainer:s,isPending:c}=I(),d=()=>{const v=document.body;n=v.style.userSelect,v.style.userSelect="none",window.addEventListener("contextmenu",C),window.addEventListener("selectstart",C),window.addEventListener("touchstart",C),window.addEventListener("touchmove",C)},m=()=>{const v=document.body;v.style.userSelect=n,v.style.touchAction=t,v.style.overscrollBehavior=e,window.removeEventListener("contextmenu",C),window.removeEventListener("selectstart",C),window.removeEventListener("touchstart",C),window.removeEventListener("touchmove",C)},a=()=>{l&&(document.removeEventListener("pointermove",l),l=null),o&&(document.removeEventListener("pointerup",o),o=null),u&&(u=null),i&&(document.removeEventListener("wheel",i),i=null),g&&(document.removeEventListener("keydown",g),document.removeEventListener("keypress",g),document.removeEventListener("keyup",g),g=null)};return{handleDragStart:(v,h,p)=>{if(c.value)return;a(),v.target.blur(),p!=null&&p.container&&(s.component.value=p.container);const{activate:E,track:P,deactivate:S}=fe(h,p);o=()=>{S(!0).then(M=>{M!==!1&&(s.component.value=null,m(),S(!0),a())})},u=()=>{s.component.value=null,m(),S(!1),a()},l=M=>P(M),i=M=>P(M),g=M=>{M.type==="keyup"&&(M.code==="Escape"&&(u==null||u()),M.code==="Enter"&&(o==null||o())),P(M)},d(),E(v),document.addEventListener("pointermove",l),document.addEventListener("pointerup",o),document.addEventListener("wheel",i),document.addEventListener("keydown",g),document.addEventListener("keypress",g),document.addEventListener("keyup",g)}}}),me=n=>{const{id:t,elementRef:e,isDragging:l,isOvered:o,isAllowed:u,isLazyAllowed:i,registerElement:g,unregisterElement:s}=ie(n),{pointerPosition:c}=I(),{handleDragStart:d}=ge(),m=a=>d(a,e,n);return r.onMounted(g),r.onBeforeUnmount(s),{pointerPosition:c,elementRef:e,isDragging:l,isOvered:o,isAllowed:u,isLazyAllowed:i,handleDragStart:m,id:t}},pe=n=>{const{zonesMap:t,hovered:e,draggingElements:l,isDragging:o,handleDropZoneIntersection:u}=I(),i=r.ref(null),g=r.computed(()=>e.zone.value===i.value),s=r.computed(()=>{if(!i.value||!o.value)return!1;const a=t.value.get(i.value);return a!=null&&a.groups.length?!Array.from(l.value.values()).some(f=>f.groups.length?!f.groups.some(v=>a.groups.includes(v)):!1):!0}),c=r.computed(()=>{if(!i.value||!o.value||e.zone.value!==i.value)return!1;const a=t.value.get(i.value);return a!=null&&a.groups.length?!Array.from(l.value.values()).some(f=>!f.groups.some(v=>a.groups.includes(v))):!0});return{elementRef:i,registerZone:()=>{if(!i.value)throw new Error("elementRef is not set");u("add",i.value),t.value.set(i.value,{node:i.value,groups:(n==null?void 0:n.groups)??[],events:(n==null?void 0:n.events)??{},data:(n==null?void 0:n.data)??void 0}),i.value.setAttribute("data-dnd-droppable","true")},unregisterZone:()=>{i.value&&(u("remove",i.value),t.value.delete(i.value))},isOvered:g,isAllowed:s,isLazyAllowed:c}},he=n=>{const{elementRef:t,registerZone:e,unregisterZone:l,isOvered:o,isAllowed:u,isLazyAllowed:i}=pe(n);return r.onMounted(e),r.onBeforeUnmount(l),{elementRef:t,isOvered:o,isAllowed:u,isLazyAllowed:i}},ye=n=>{const{selectedElements:t,elementsMap:e}=I(),l=r.computed(()=>n.value?t.value.has(n.value):!1),o=r.computed(()=>{if(!n.value)return!1;for(const c of t.value)if(c&&b(c,n.value))return!0;return!1}),u=r.computed(()=>{if(!n.value)return!1;for(const c of t.value)if(c&&b(n.value,c))return!0;return!1}),i=()=>{n.value&&t.value.delete(n.value)},g=()=>{if(!(!n.value||!e.value.get(n.value))){if(o.value)for(const d of t.value)d&&b(d,n.value)&&t.value.delete(d);if(u.value)for(const d of t.value)d&&b(n.value,d)&&t.value.delete(d);t.value.add(n.value)}};return{handleUnselect:i,handleSelect:g,handleToggleSelect:()=>{n.value&&(t.value.has(n.value)?i():g())},isSelected:l,isParentOfSelected:o}};exports.DnDOperations=N;exports.default=se;exports.getBoundingBox=Z;exports.useDnDStore=I;exports.useDragContainer=ne;exports.useDraggable=me;exports.useDroppable=he;exports.useSelection=ye;
|
|
2
2
|
//# sourceMappingURL=vue-dnd-kit-core.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-dnd-kit-core.cjs.js","sources":["../src/utils/operations.ts","../src/composables/useDnDStore.ts","../src/composables/useDragContainer.ts","../src/components/DefaultOverlay.vue","../src/components/DragOverlay.vue","../src/plugin.ts","../src/utils/geometry.ts","../src/utils/namespaces.ts","../src/utils/events.ts","../src/managers/useElementManager.ts","../src/utils/dom.ts","../src/utils/sensor.ts","../src/composables/useKeyboard.ts","../src/composables/usePointer.ts","../src/composables/useSensor.ts","../src/managers/useEventManager.ts","../src/composables/useDraggable.ts","../src/managers/useZoneManager.ts","../src/composables/useDroppable.ts","../src/composables/useSelection.ts"],"sourcesContent":["import { IDnDStore } from '../types';\n\nexport class DnDOperations {\n static remove = (source?: any[], index?: number) => {\n if (!source || index === undefined) return;\n const [item] = source.splice(index, 1);\n return item;\n };\n static insert = (target?: any[], index?: number, item?: any) => {\n if (!target || index === undefined) return;\n target.splice(index, 0, item);\n };\n static move = (\n source?: any[],\n sourceIndex?: number,\n target?: any[],\n targetIndex?: number\n ) => {\n if (\n !source ||\n !target ||\n sourceIndex === undefined ||\n targetIndex === undefined\n )\n return;\n const item = DnDOperations.remove(source, sourceIndex);\n DnDOperations.insert(target, targetIndex, item);\n };\n static swap = (\n source?: any[],\n sourceIndex?: number,\n target?: any[],\n targetIndex?: number\n ) => {\n if (\n !source ||\n !target ||\n sourceIndex === undefined ||\n targetIndex === undefined\n )\n return;\n\n const sourceItem = source[sourceIndex];\n const targetItem = target[targetIndex];\n\n source[sourceIndex] = targetItem;\n target[targetIndex] = sourceItem;\n };\n static copy = (\n source?: any[],\n index?: number,\n target?: any[],\n targetIndex?: number\n ) => {\n if (!source || index === undefined || !target || targetIndex === undefined)\n return;\n const item = source[index];\n DnDOperations.insert(target, targetIndex, item);\n };\n static applyTransfer = (store: IDnDStore) => {\n const hoveredElement = store.hovered.element.value;\n const hoveredZone = store.hovered.zone.value;\n\n if (hoveredElement) {\n const targetSource =\n store.elementsMap.value.get(hoveredElement)?.data?.source;\n const targetIndex =\n store.elementsMap.value.get(hoveredElement)?.data?.index;\n\n const firstElement = store.draggingElements.value.values().next().value;\n const firstIndex = firstElement?.data?.index;\n\n const sortDirection =\n firstIndex !== undefined &&\n targetIndex !== undefined &&\n firstIndex > targetIndex\n ? 1\n : -1;\n\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort(\n (a, b) => sortDirection * ((a.data?.index || 0) - (b.data?.index || 0))\n );\n\n sortedElements.forEach((element) =>\n DnDOperations.move(\n element.data?.source,\n element.data?.index,\n targetSource,\n targetIndex\n )\n );\n } else if (hoveredZone) {\n const targetSource = store.zonesMap.value.get(hoveredZone)?.data?.source;\n const targetIndex = targetSource?.length;\n\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort((a, b) => (b.data?.index || 0) - (a.data?.index || 0));\n\n sortedElements.forEach((element) =>\n DnDOperations.move(\n element.data?.source,\n element.data?.index,\n targetSource,\n targetIndex\n )\n );\n }\n };\n\n static applyCopy = (store: IDnDStore) => {\n const hoveredElement = store.hovered.element.value;\n const hoveredZone = store.hovered.zone.value;\n\n if (hoveredElement) {\n const targetSource =\n store.elementsMap.value.get(hoveredElement)?.data?.source;\n const targetIndex =\n store.elementsMap.value.get(hoveredElement)?.data?.index;\n\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort((a, b) => (b.data?.index || 0) - (a.data?.index || 0));\n\n sortedElements.forEach((element) =>\n DnDOperations.copy(\n element.data?.source,\n element.data?.index,\n targetSource,\n targetIndex\n )\n );\n } else if (hoveredZone) {\n const targetSource = store.zonesMap.value.get(hoveredZone)?.data?.source;\n const targetIndex = targetSource?.length;\n\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort((a, b) => (b.data?.index || 0) - (a.data?.index || 0));\n\n sortedElements.forEach((element) =>\n DnDOperations.copy(\n element.data?.source,\n element.data?.index,\n targetSource,\n targetIndex\n )\n );\n }\n };\n static applySwap = (store: IDnDStore) => {\n const hoveredElement = store.hovered.element.value;\n const hoveredZone = store.hovered.zone.value;\n\n if (hoveredElement && store.draggingElements.value.size === 1) {\n const element = store.draggingElements.value.values().next().value;\n DnDOperations.swap(\n element?.data?.source,\n element?.data?.index,\n store.elementsMap.value.get(hoveredElement)?.data?.source,\n store.elementsMap.value.get(hoveredElement)?.data?.index\n );\n } else if (hoveredZone) {\n const targetSource = store.zonesMap.value.get(hoveredZone)?.data?.source;\n const targetIndex = targetSource?.length;\n\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort((a, b) => (b.data?.index || 0) - (a.data?.index || 0));\n\n sortedElements.forEach((element) =>\n DnDOperations.move(\n element.data?.source,\n element.data?.index,\n targetSource,\n targetIndex\n )\n );\n }\n };\n static applyRemove = (store: IDnDStore) => {\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort((a, b) => (b.data?.index || 0) - (a.data?.index || 0));\n\n sortedElements.forEach((element) => {\n if (element.data?.source && element.data?.index !== undefined) {\n DnDOperations.remove(element.data.source, element.data.index);\n }\n });\n };\n static applyInsert = (store: IDnDStore, items: any[]) => {\n const hoveredElement = store.hovered.element.value;\n const hoveredZone = store.hovered.zone.value;\n\n if (hoveredElement && items.length > 0) {\n const targetSource =\n store.elementsMap.value.get(hoveredElement)?.data?.source;\n const targetIndex =\n store.elementsMap.value.get(hoveredElement)?.data?.index;\n\n items.forEach((item) => {\n DnDOperations.insert(targetSource, targetIndex, item);\n });\n } else if (hoveredZone) {\n const targetSource = store.zonesMap.value.get(hoveredZone)?.data?.source;\n const targetIndex = targetSource?.length;\n\n items.forEach((item) => {\n DnDOperations.insert(targetSource, targetIndex, item);\n });\n }\n };\n}\n","import type {\n IDragElement,\n IDraggingElement,\n IDropZone,\n IPoint,\n} from '../types';\nimport {\n computed,\n ref,\n shallowRef,\n type Component,\n type TransitionProps,\n} from 'vue';\nimport { createGlobalState, useMagicKeys } from '@vueuse/core';\n\nexport const useDnDStore = createGlobalState(() => {\n const draggingElements = ref<Map<HTMLElement | Element, IDraggingElement>>(\n new Map()\n );\n const isDragging = computed<boolean>(() => draggingElements.value.size > 0);\n\n const activeContainer = {\n component: ref<Component | null>(null),\n ref: shallowRef<HTMLElement | null>(null),\n options: shallowRef<TransitionProps | null>(null),\n animating: {\n enter: shallowRef<boolean>(false),\n leave: shallowRef<boolean>(false),\n appear: shallowRef<boolean>(false),\n },\n };\n\n const elementsMap = ref<Map<HTMLElement | Element, IDragElement>>(new Map());\n const selectedElements = ref<Set<HTMLElement | Element>>(new Set());\n const zonesMap = ref<Map<HTMLElement | Element, IDropZone>>(new Map());\n const visibleZones = ref<Set<HTMLElement | Element>>(new Set());\n const visibleElements = ref<Set<HTMLElement | Element>>(new Set());\n\n const hasIntersectionObserver =\n typeof window !== 'undefined' && 'IntersectionObserver' in window;\n\n const elementObserver = hasIntersectionObserver\n ? new IntersectionObserver((entries) => {\n entries.forEach((entry) =>\n visibleElements.value[entry.isIntersecting ? 'add' : 'delete'](\n entry.target\n )\n );\n })\n : null;\n\n const zoneObserver = hasIntersectionObserver\n ? new IntersectionObserver((entries) => {\n entries.forEach((entry) =>\n visibleZones.value[entry.isIntersecting ? 'add' : 'delete'](\n entry.target\n )\n );\n })\n : null;\n\n const handleDragElementIntersection = (\n action: 'add' | 'remove',\n element: HTMLElement | Element\n ) => {\n if (!elementObserver) return;\n\n if (action === 'add') {\n elementObserver.observe(element);\n } else {\n elementObserver.unobserve(element);\n visibleElements.value.delete(element);\n }\n };\n\n const handleDropZoneIntersection = (\n action: 'add' | 'remove',\n element: HTMLElement | Element\n ) => {\n if (!zoneObserver) return;\n\n if (action === 'add') {\n zoneObserver.observe(element);\n } else {\n zoneObserver.unobserve(element);\n visibleZones.value.delete(element);\n }\n };\n\n const pointerPosition = {\n start: shallowRef<IPoint | null>(null),\n current: shallowRef<IPoint | null>(null),\n offset: {\n percent: shallowRef<IPoint | null>(null),\n pixel: shallowRef<IPoint | null>(null),\n },\n };\n\n const { w, s, a, d, ctrl, shift, alt, meta } = useMagicKeys();\n\n const hovered = {\n zone: shallowRef<HTMLElement | Element | null>(null),\n element: shallowRef<HTMLElement | Element | null>(null),\n };\n\n return {\n draggingElements,\n isDragging,\n activeContainer,\n elementsMap,\n selectedElements,\n zonesMap,\n visibleZones,\n visibleElements,\n pointerPosition,\n keyboard: {\n w,\n s,\n a,\n d,\n ctrl,\n shift,\n alt,\n meta,\n },\n hovered,\n handleDragElementIntersection,\n handleDropZoneIntersection,\n };\n});\n","import { onUnmounted, onMounted, ref, type TransitionProps } from 'vue';\n\nimport { useDnDStore } from './useDnDStore';\n\nexport const useDragContainer = (options?: Omit<TransitionProps, 'appear'>) => {\n const elementRef = ref<HTMLElement | null>(null);\n\n const { draggingElements, pointerPosition, isDragging, activeContainer } =\n useDnDStore();\n\n onMounted(() => {\n activeContainer.ref = elementRef;\n activeContainer.options.value = options ?? null;\n });\n\n onUnmounted(() => {\n activeContainer.ref.value = null;\n activeContainer.options.value = null;\n });\n\n return {\n elementRef,\n draggingElements,\n pointerPosition,\n isDragging,\n animating: activeContainer.animating,\n };\n};\n","<script setup lang=\"ts\">\n import { computed, CSSProperties } from 'vue';\n import { useDragContainer } from '../composables/useDragContainer';\n\n const { elementRef, pointerPosition, isDragging, draggingElements } =\n useDragContainer();\n\n const { styles } = defineProps<{\n styles?: CSSProperties;\n }>();\n\n const computedStyle = computed<CSSProperties>(() => ({\n transform: `translate3d(${\n (pointerPosition.current.value?.x ?? 0) -\n (pointerPosition.offset.pixel.value?.x ?? 0)\n }px, ${\n (pointerPosition.current.value?.y ?? 0) -\n (pointerPosition.offset.pixel.value?.y ?? 0)\n }px, 0)`,\n zIndex: 1000,\n position: 'fixed',\n top: 0,\n left: 0,\n transition: '0.3s cubic-bezier(0.165, 0.84, 0.44, 1)',\n ...styles,\n }));\n</script>\n\n<template>\n <div\n v-if=\"isDragging\"\n ref=\"elementRef\"\n :style=\"computedStyle\"\n >\n <template\n v-for=\"[node, element] in draggingElements\"\n :key=\"element.id\"\n >\n <component\n v-if=\"element.layer\"\n :is=\"element.layer\"\n :node=\"node\"\n :data=\"element.data\"\n :id=\"element.id\"\n :groups=\"element.groups\"\n />\n <div\n v-else\n v-html=\"element.initialHTML\"\n :style=\"{\n width: `${element.initialRect?.width}px`,\n height: `${element.initialRect?.height}px`,\n }\"\n />\n </template>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, CSSProperties } from 'vue';\n import { useDnDStore } from '../composables/useDnDStore';\n import DefaultOverlay from './DefaultOverlay.vue';\n\n const props = defineProps<{\n styles?: CSSProperties;\n }>();\n\n const { activeContainer } = useDnDStore();\n\n const overlay = computed(() => ({\n component: activeContainer.component.value ?? DefaultOverlay,\n props,\n }));\n</script>\n\n<template>\n <Transition\n v-if=\"activeContainer.options.value\"\n :name=\"activeContainer.options.value.name\"\n :duration=\"activeContainer.options.value.duration\"\n :enter-from-class=\"activeContainer.options.value.enterFromClass\"\n :enter-to-class=\"activeContainer.options.value.enterToClass\"\n :enter-active-class=\"activeContainer.options.value.enterActiveClass\"\n :leave-from-class=\"activeContainer.options.value.leaveFromClass\"\n :leave-to-class=\"activeContainer.options.value.leaveToClass\"\n :leave-active-class=\"activeContainer.options.value.leaveActiveClass\"\n :appear-active-class=\"activeContainer.options.value.appearActiveClass\"\n :appear-from-class=\"activeContainer.options.value.appearFromClass\"\n :appear-to-class=\"activeContainer.options.value.appearToClass\"\n :mode=\"activeContainer.options.value.mode\"\n :type=\"activeContainer.options.value.type\"\n :css=\"activeContainer.options.value.css\"\n :appear=\"true\"\n :persisted=\"activeContainer.options.value.persisted\"\n @enter=\"activeContainer.options.value.onEnter\"\n @leave=\"activeContainer.options.value.onLeave\"\n @before-enter=\"activeContainer.options.value.onBeforeEnter\"\n @before-leave=\"activeContainer.options.value.onBeforeLeave\"\n @before-appear=\"activeContainer.options.value.onBeforeAppear\"\n @after-enter=\"activeContainer.options.value.onAfterEnter\"\n @after-leave=\"activeContainer.options.value.onAfterLeave\"\n @after-appear=\"activeContainer.options.value.onAfterAppear\"\n >\n <component\n :is=\"overlay.component || overlay\"\n v-bind=\"overlay.props || {}\"\n />\n </Transition>\n\n <component\n v-else\n :is=\"overlay.component || overlay\"\n v-bind=\"overlay.props || {}\"\n />\n</template>\n","import { createVNode, render } from 'vue';\n\nimport type { App } from 'vue';\nimport DragOverlay from './components/DragOverlay.vue';\nimport { IPluginOptions } from './types';\nimport { useDnDStore } from './composables/useDnDStore';\n\nexport const VueDndKitPlugin = {\n install(app: App, options?: IPluginOptions) {\n app.component('DragOverlay', DragOverlay);\n const originalMount = app.mount;\n app.mount = function (rootContainer) {\n const instance = originalMount.call(this, rootContainer);\n\n const rootEl =\n typeof rootContainer === 'string'\n ? document.querySelector(rootContainer)\n : rootContainer;\n\n if (rootEl && rootEl instanceof Element) {\n if (!rootEl.querySelector('#vue-dnd-kit-overlay')) {\n const overlayContainer = document.createElement('div');\n\n overlayContainer.id = 'vue-dnd-kit-overlay';\n overlayContainer.style.pointerEvents = 'none';\n\n rootEl.appendChild(overlayContainer);\n\n // Передаем опции напрямую в компонент\n const vnode = createVNode(DragOverlay, {\n styles: options?.defaultOverlay?.styles,\n });\n render(vnode, overlayContainer);\n\n app.__VUE_DND_KIT_OVERLAY__ = {\n container: overlayContainer,\n vnode,\n options: options?.defaultOverlay || {},\n };\n\n const store = useDnDStore();\n app.__VUE_DND_KIT_STORE__ = store;\n }\n }\n\n return instance;\n };\n\n // Модифицируем метод unmount для очистки\n const originalUnmount = app.unmount;\n app.unmount = function () {\n if (app.__VUE_DND_KIT_OVERLAY__) {\n render(null, app.__VUE_DND_KIT_OVERLAY__.container);\n delete app.__VUE_DND_KIT_OVERLAY__;\n }\n return originalUnmount.call(this);\n };\n },\n};\n\ndeclare module '@vue/runtime-core' {\n export interface App {\n __VUE_DND_KIT_OVERLAY__?: {\n container: HTMLElement;\n vnode: any;\n options: IPluginOptions['defaultOverlay'];\n };\n __VUE_DND_KIT_STORE__?: ReturnType<typeof useDnDStore>;\n }\n}\n","import type { IBoundingBox, IPoint } from '../types';\n\nexport const checkCollision = (\n boxA: IBoundingBox,\n boxB: IBoundingBox\n): boolean => {\n return (\n boxA.x < boxB.x + boxB.width &&\n boxA.x + boxA.width > boxB.x &&\n boxA.y < boxB.y + boxB.height &&\n boxA.y + boxA.height > boxB.y\n );\n};\n\nexport const getBoundingBox = (element: HTMLElement | null): IBoundingBox => {\n if (!element)\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n };\n\n const rect = element.getBoundingClientRect();\n\n return {\n bottom: rect.bottom,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n };\n};\n\nexport const getCenter = (box: IBoundingBox): IPoint => ({\n x: box.x + box.width / 2,\n y: box.y + box.height / 2,\n});\n\nexport const getOffset = (element: HTMLElement | null, pointer: IPoint) => {\n const rect = getBoundingBox(element);\n return {\n pixel: {\n x: pointer.x - rect.x,\n y: pointer.y - rect.y,\n },\n percent: {\n x: ((pointer.x - rect.x) / rect.width) * 100,\n y: ((pointer.y - rect.y) / rect.height) * 100,\n },\n };\n};\n\nexport const getDistance = (pointA: IPoint, pointB: IPoint): number => {\n const dx = pointB.x - pointA.x;\n const dy = pointB.y - pointA.y;\n return Math.sqrt(dx * dx + dy * dy);\n};\n\nexport const getOverlapPercent = (\n boxA: IBoundingBox,\n boxB: IBoundingBox\n): number => {\n const xOverlap = Math.max(\n 0,\n Math.min(boxA.x + boxA.width, boxB.x + boxB.width) -\n Math.max(boxA.x, boxB.x)\n );\n const yOverlap = Math.max(\n 0,\n Math.min(boxA.y + boxA.height, boxB.y + boxB.height) -\n Math.max(boxA.y, boxB.y)\n );\n\n const overlapArea = xOverlap * yOverlap;\n\n const boxAArea = boxA.width * boxA.height;\n const boxBArea = boxB.width * boxB.height;\n\n // Возвращаем среднее значение процентов перекрытия относительно обоих элементов\n return ((overlapArea / boxAArea) * 100 + (overlapArea / boxBArea) * 100) / 2;\n};\n","export const draggableDataName = 'data-vue-dnd-kit-draggable';\nexport const droppableDataName = 'data-vue-dnd-kit-droppable';\n\nexport const VUE_DND_KIT_OPTIONS = Symbol('vue-dnd-kit-options');\n","import { IDnDPayload, IDnDStore } from '../types';\n\nexport const preventEvent = (event: Event) => {\n event.preventDefault();\n};\n\nexport const createPayload = (store: IDnDStore): IDnDPayload => {\n return {\n items: Array.from(store.draggingElements.value.values()),\n };\n};\n","import { computed, ref, shallowRef, useId } from 'vue';\n\nimport type { IUseDragOptions } from '../types';\nimport { draggableDataName } from '../utils/namespaces';\nimport { preventEvent } from '../utils/events';\nimport { useDnDStore } from '../composables/useDnDStore';\n\nexport const useElementManager = (options?: IUseDragOptions) => {\n const {\n elementsMap,\n draggingElements,\n hovered,\n selectedElements,\n isDragging: isDragStarted,\n visibleElements,\n handleDragElementIntersection,\n } = useDnDStore();\n\n const elementRef = ref<HTMLElement | null>(null);\n const isOvered = computed<boolean>(\n () =>\n visibleElements.value.has(elementRef.value as HTMLElement) &&\n hovered.element.value === elementRef.value\n );\n\n const id = shallowRef(options?.id || useId());\n\n const isDragging = computed<boolean>(() => {\n if (!elementRef.value) return false;\n if (!elementsMap.value.has(elementRef.value)) return false;\n return draggingElements.value.has(elementRef.value);\n });\n\n const isAllowed = computed<boolean>(() => {\n if (!elementRef.value) return false;\n if (!isDragStarted.value) return false;\n if (!visibleElements.value.has(elementRef.value)) return false;\n\n const currentElement = elementsMap.value.get(elementRef.value);\n if (!currentElement?.groups.length) return true;\n\n return !Array.from(draggingElements.value.entries()).some(\n ([_, draggingElement]) => {\n if (!draggingElement.groups.length) return false;\n return !draggingElement.groups.some((group) =>\n currentElement.groups.includes(group)\n );\n }\n );\n });\n\n const registerElement = () => {\n if (!elementRef.value) throw new Error('ElementRef is not set');\n\n elementsMap.value.set(elementRef.value, {\n node: elementRef.value,\n groups: options?.groups ?? [],\n layer: options?.layer ?? null,\n defaultLayer: options?.layer ?? null,\n events: options?.events ?? {},\n data: options?.data ?? null,\n id: id.value,\n });\n\n handleDragElementIntersection('add', elementRef.value);\n\n elementRef.value.addEventListener('dragstart', preventEvent);\n elementRef.value.addEventListener('drag', preventEvent);\n elementRef.value.setAttribute(draggableDataName, 'true');\n elementRef.value.setAttribute('draggable', 'false');\n };\n\n const unregisterElement = () => {\n if (!elementRef.value) return;\n\n elementsMap.value.delete(elementRef.value);\n selectedElements.value.delete(elementRef.value);\n\n elementRef.value.removeEventListener('dragstart', preventEvent);\n elementRef.value.removeEventListener('drag', preventEvent);\n elementRef.value.removeAttribute(draggableDataName);\n elementRef.value.removeAttribute('draggable');\n };\n\n return {\n elementRef,\n registerElement,\n unregisterElement,\n isDragging,\n isOvered,\n isAllowed,\n id,\n };\n};\n","export const isDescendant = (\n element: HTMLElement | Element | null,\n container: HTMLElement | Element\n): boolean => {\n if (!element) return false;\n return container.contains(element);\n};\n","import {\n checkCollision,\n getBoundingBox,\n getCenter,\n getDistance,\n getOverlapPercent,\n} from './geometry';\n\nimport { IDnDStore } from '../types';\nimport { isDescendant } from './dom';\n\nexport const defaultCollisionDetection = (store: IDnDStore) => {\n const containerRect = getBoundingBox(store.activeContainer.ref.value);\n const containerCenter = getCenter(containerRect);\n const pointerX = store.pointerPosition.current.value?.x ?? 0;\n const pointerY = store.pointerPosition.current.value?.y ?? 0;\n\n const isPointerInActiveContainer =\n containerRect &&\n pointerX >= containerRect.x &&\n pointerX <= containerRect.x + containerRect.width &&\n pointerY >= containerRect.y &&\n pointerY <= containerRect.y + containerRect.height;\n\n const shouldUseNormalPriority = !isPointerInActiveContainer;\n\n const activeDragNodes = Array.from(store.draggingElements.value.keys());\n\n const allCollidingElements = Array.from(store.visibleElements.value.entries())\n .filter(([node, _]) => {\n if (!node) return false;\n\n const rect = getBoundingBox(node as HTMLElement);\n return rect && containerRect && checkCollision(rect, containerRect);\n })\n .map(([node, element]) => {\n const rect = getBoundingBox(node as HTMLElement);\n const elementCenter = getCenter(rect);\n\n const isPointerInElement =\n pointerX >= rect.x &&\n pointerX <= rect.x + rect.width &&\n pointerY >= rect.y &&\n pointerY <= rect.y + rect.height;\n\n const overlapPercent = getOverlapPercent(rect, containerRect);\n const centerDistance = getDistance(containerCenter, elementCenter);\n\n // Вычисляем глубину вложенности\n let depth = 0;\n for (const [parentNode, _] of store.visibleElements.value.entries()) {\n if (\n parentNode !== node &&\n parentNode &&\n node &&\n isDescendant(node as HTMLElement, parentNode as HTMLElement)\n ) {\n depth++;\n }\n }\n\n return {\n element,\n node: node as HTMLElement,\n isPointerInElement,\n overlapPercent,\n depth,\n centerDistance,\n };\n })\n .sort((a, b) => {\n if (!shouldUseNormalPriority) {\n if (a.isPointerInElement && b.isPointerInElement)\n return b.depth - a.depth;\n if (a.isPointerInElement !== b.isPointerInElement)\n return a.isPointerInElement ? -1 : 1;\n }\n if (Math.abs(a.overlapPercent - b.overlapPercent) <= 1)\n return a.centerDistance - b.centerDistance;\n return b.overlapPercent - a.overlapPercent;\n });\n\n const allCollidingZones = Array.from(store.visibleZones.value.entries())\n .filter(([node, _]) => {\n if (\n !node ||\n activeDragNodes.some(\n (dragNode) =>\n dragNode &&\n isDescendant(node as HTMLElement, dragNode as HTMLElement)\n )\n )\n return false;\n\n const rect = getBoundingBox(node as HTMLElement);\n return rect && containerRect && checkCollision(rect, containerRect);\n })\n .map(([node, zone]) => {\n const rect = getBoundingBox(node as HTMLElement);\n const zoneCenter = getCenter(rect);\n\n const isPointerInElement =\n pointerX >= rect.x &&\n pointerX <= rect.x + rect.width &&\n pointerY >= rect.y &&\n pointerY <= rect.y + rect.height;\n\n const overlapPercent = getOverlapPercent(rect, containerRect);\n const centerDistance = getDistance(containerCenter, zoneCenter);\n\n // Вычисляем глубину вложенности\n let depth = 0;\n for (const [parentNode, _] of store.visibleZones.value.entries()) {\n if (\n parentNode !== node &&\n parentNode &&\n node &&\n isDescendant(node as HTMLElement, parentNode as HTMLElement)\n ) {\n depth++;\n }\n }\n\n return {\n zone,\n node: node as HTMLElement,\n isPointerInElement,\n overlapPercent,\n depth,\n centerDistance,\n };\n })\n .sort((a, b) => {\n if (!shouldUseNormalPriority) {\n if (a.isPointerInElement && b.isPointerInElement)\n return b.depth - a.depth;\n if (a.isPointerInElement !== b.isPointerInElement)\n return a.isPointerInElement ? -1 : 1;\n }\n if (Math.abs(a.overlapPercent - b.overlapPercent) <= 1)\n return a.centerDistance - b.centerDistance;\n return b.overlapPercent - a.overlapPercent;\n });\n\n return [\n ...allCollidingElements.map((item) => item.node),\n ...allCollidingZones.map((item) => item.node),\n ];\n};\n","import type { Ref } from 'vue';\nimport { getBoundingBox } from '../utils/geometry';\nimport { preventEvent } from '../utils/events';\nimport { useDnDStore } from './useDnDStore';\n\nexport interface IKeyboardOptions {\n moveStep?: number;\n}\n\nexport const useKeyboard = (\n elementRef: Ref<HTMLElement | null>,\n options?: IKeyboardOptions\n) => {\n const { pointerPosition, keyboard } = useDnDStore();\n const moveStep = options?.moveStep || 10;\n\n const onKeyboardStart = (event: KeyboardEvent) => {\n preventEvent(event);\n\n const rect = getBoundingBox(elementRef.value);\n\n elementRef.value?.blur();\n\n const centerX = rect.x + rect.width / 2;\n const centerY = rect.y + rect.height / 2;\n\n pointerPosition.start.value = {\n x: centerX,\n y: centerY,\n };\n\n pointerPosition.current.value = {\n x: centerX,\n y: centerY,\n };\n\n pointerPosition.offset.pixel.value = {\n x: rect.width / 2,\n y: rect.height / 2,\n };\n\n pointerPosition.offset.percent.value = {\n x: 50,\n y: 50,\n };\n };\n\n const onKeyboardMove = () => {\n if (!pointerPosition.current.value) return;\n\n const currentX = pointerPosition.current.value.x;\n const currentY = pointerPosition.current.value.y;\n\n let newX = currentX;\n let newY = currentY;\n\n if (keyboard.w.value) newY -= moveStep;\n if (keyboard.s.value) newY += moveStep;\n if (keyboard.a.value) newX -= moveStep;\n if (keyboard.d.value) newX += moveStep;\n\n pointerPosition.current.value = {\n x: newX,\n y: newY,\n };\n };\n\n const onKeyboardEnd = () => {\n pointerPosition.current.value = null;\n pointerPosition.start.value = null;\n pointerPosition.offset.pixel.value = null;\n pointerPosition.offset.percent.value = null;\n };\n\n return {\n onKeyboardStart,\n onKeyboardMove,\n onKeyboardEnd,\n };\n};\n","import type { Ref } from 'vue';\nimport { getOffset } from '../utils/geometry';\nimport { useDnDStore } from './useDnDStore';\n\nexport const usePointer = (elementRef: Ref<HTMLElement | null>) => {\n const store = useDnDStore();\n\n const onPointerStart = (event: PointerEvent) => {\n store.pointerPosition.start.value = { x: event.clientX, y: event.clientY };\n store.pointerPosition.current.value = {\n x: event.clientX,\n y: event.clientY,\n };\n\n const { pixel, percent } = getOffset(elementRef.value, {\n x: event.clientX,\n y: event.clientY,\n });\n\n store.pointerPosition.offset.pixel.value = pixel;\n store.pointerPosition.offset.percent.value = percent;\n };\n\n const onPointerMove = (event: PointerEvent | WheelEvent) => {\n store.pointerPosition.current.value = {\n x: event.clientX,\n y: event.clientY,\n };\n };\n\n const onPointerEnd = () => {\n store.pointerPosition.current.value = null;\n store.pointerPosition.start.value = null;\n store.pointerPosition.offset.pixel.value = null;\n store.pointerPosition.offset.percent.value = null;\n };\n\n return {\n onPointerStart,\n onPointerMove,\n onPointerEnd,\n };\n};\n","import type {\n ICollisionDetectionResult,\n IDraggingElement,\n IUseDragOptions,\n} from '../types';\n\nimport type { Ref } from 'vue';\nimport { createPayload } from '../utils/events';\nimport { defaultCollisionDetection } from '../utils/sensor';\nimport { isDescendant } from '../utils/dom';\nimport { useDnDStore } from './useDnDStore';\nimport { useKeyboard } from './useKeyboard';\nimport { usePointer } from './usePointer';\nimport { useThrottleFn } from '@vueuse/core';\n\nexport const useSensor = (\n elementRef: Ref<HTMLElement | null>,\n options?: IUseDragOptions\n) => {\n const store = useDnDStore();\n\n const { onPointerStart, onPointerMove, onPointerEnd } =\n usePointer(elementRef);\n\n const { onKeyboardStart, onKeyboardMove, onKeyboardEnd } = useKeyboard(\n elementRef,\n options?.keyboard\n );\n\n let animationFrameId: number | null = null;\n\n const getDraggingElements = (\n draggableElement: HTMLElement | null\n ): Map<HTMLElement | Element, IDraggingElement> => {\n if (!draggableElement) return new Map();\n\n const isDraggableInSelection =\n store.selectedElements.value.has(draggableElement);\n\n if (store.selectedElements.value.size > 0 && isDraggableInSelection) {\n const result = new Map<HTMLElement | Element, IDraggingElement>();\n\n store.selectedElements.value.forEach((node) => {\n const element = store.elementsMap.value.get(node);\n if (!element) return;\n\n result.set(node, {\n ...element,\n initialHTML: element.node?.outerHTML ?? '',\n initialRect: element.node?.getBoundingClientRect(),\n });\n });\n\n return result;\n }\n\n store.selectedElements.value.clear();\n\n const element = store.elementsMap.value.get(draggableElement);\n if (!element) return new Map();\n\n const result = new Map<HTMLElement | Element, IDraggingElement>();\n\n result.set(draggableElement, {\n ...element,\n initialHTML: element.node?.outerHTML ?? '',\n initialRect: element.node?.getBoundingClientRect(),\n });\n\n return result;\n };\n\n const validateCollisionResults = (\n htmlElements: HTMLElement | HTMLElement[] | Element | Element[] | null\n ) => {\n if (!htmlElements) {\n return { element: null, zone: null };\n }\n\n const elements = Array.isArray(htmlElements)\n ? htmlElements\n : [htmlElements];\n\n const activeDragNodes = Array.from(store.draggingElements.value.keys());\n\n const filteredZoneElement = elements.find((htmlElement) => {\n if (!store.visibleZones.value.has(htmlElement)) return false;\n\n const zone = store.zonesMap.value.get(htmlElement);\n if (!zone) return false;\n\n if (\n activeDragNodes.some(\n (dragNode) =>\n dragNode &&\n (dragNode === zone.node ||\n isDescendant(zone.node as HTMLElement, dragNode as HTMLElement))\n )\n )\n return false;\n\n if (zone.groups.length) {\n const isCompatible = !Array.from(\n store.draggingElements.value.values()\n ).some((element) => {\n if (!element.groups.length) return false;\n return !element.groups.some((group) => zone.groups.includes(group));\n });\n if (!isCompatible) return false;\n }\n\n return true;\n });\n\n if (!filteredZoneElement) {\n return { element: null, zone: null };\n }\n\n const possibleElement = elements.find(\n (htmlElement) =>\n store.visibleElements.value.has(htmlElement) &&\n store.elementsMap.value.has(htmlElement) &&\n !activeDragNodes.some(\n (dragNode) =>\n dragNode &&\n (dragNode === htmlElement ||\n isDescendant(\n htmlElement as HTMLElement,\n dragNode as HTMLElement\n ) ||\n isDescendant(dragNode as HTMLElement, htmlElement as HTMLElement))\n ) &&\n (htmlElement === filteredZoneElement ||\n isDescendant(\n htmlElement as HTMLElement,\n filteredZoneElement as HTMLElement\n ))\n );\n\n return {\n element: possibleElement || null,\n zone: filteredZoneElement,\n };\n };\n\n const detectCollisions = options?.sensor?.setup || defaultCollisionDetection;\n\n const processCollisionResults = (results: ICollisionDetectionResult) => {\n const previousElement = store.hovered.element.value;\n const previousZone = store.hovered.zone.value;\n\n const newElement = results.element;\n const newZone = results.zone;\n\n store.hovered.element.value = newElement;\n store.hovered.zone.value = newZone;\n\n if (previousElement !== newElement) {\n if (previousElement) {\n store.elementsMap.value\n .get(previousElement)\n ?.events?.onLeave?.(store, createPayload(store));\n }\n\n if (newElement) {\n store.elementsMap.value\n .get(newElement)\n ?.events?.onHover?.(store, createPayload(store));\n }\n }\n\n if (previousZone !== newZone) {\n if (previousZone) {\n store.zonesMap.value\n .get(previousZone)\n ?.events?.onLeave?.(store, createPayload(store));\n }\n\n if (newZone) {\n store.zonesMap.value\n .get(newZone)\n ?.events?.onHover?.(store, createPayload(store));\n }\n }\n };\n\n const throttledDetectAndProcess = useThrottleFn(() => {\n const htmlElements = detectCollisions(store);\n const processedResults = validateCollisionResults(htmlElements);\n processCollisionResults(processedResults);\n }, options?.sensor?.throttle ?? 0);\n\n const animationLoop = () => {\n throttledDetectAndProcess();\n\n animationFrameId = requestAnimationFrame(animationLoop);\n };\n\n const startDetection = () => animationLoop();\n\n const stopDetection = () => {\n if (animationFrameId !== null) {\n cancelAnimationFrame(animationFrameId);\n animationFrameId = null;\n }\n };\n\n const activate = (event: PointerEvent | KeyboardEvent) => {\n store.draggingElements.value = getDraggingElements(elementRef.value);\n store.draggingElements.value.forEach((element) =>\n element.events.onStart?.(store, createPayload(store))\n );\n\n if (event instanceof PointerEvent) {\n onPointerStart(event);\n } else {\n onKeyboardStart(event);\n }\n\n startDetection();\n };\n\n const track = (event: PointerEvent | WheelEvent | KeyboardEvent) => {\n store.draggingElements.value.forEach((element) =>\n element.events.onMove?.(store, createPayload(store))\n );\n\n if (event instanceof KeyboardEvent) {\n onKeyboardMove();\n } else {\n onPointerMove(event);\n }\n };\n\n const deactivate = (triggerEvents = true) => {\n onPointerEnd();\n onKeyboardEnd();\n\n if (triggerEvents) {\n if (store.hovered.zone.value) {\n const zone = store.zonesMap.value.get(store.hovered.zone.value);\n zone?.events.onDrop?.(store, createPayload(store));\n } else {\n store.draggingElements.value.forEach((element) =>\n element.events.onEnd?.(store, createPayload(store))\n );\n }\n\n store.selectedElements.value.clear();\n }\n\n store.draggingElements.value.clear();\n\n store.hovered.zone.value = null;\n store.hovered.element.value = null;\n\n stopDetection();\n };\n\n return {\n activate,\n track,\n deactivate,\n };\n};\n","import type { IUseDragOptions } from '../types';\nimport { Ref } from 'vue';\nimport { createGlobalState } from '@vueuse/core';\nimport { preventEvent } from '../utils/events';\nimport { useDnDStore } from '../composables/useDnDStore';\nimport { useSensor } from '../composables/useSensor';\n\nenum EKeyboardKey {\n ESCAPE = 'Escape',\n SPACE = 'Space',\n ENTER = 'Enter',\n W = 'KeyW',\n A = 'KeyA',\n S = 'KeyS',\n D = 'KeyD',\n CONTROL = 'ControlLeft',\n ALT = 'AltLeft',\n SHIFT = 'ShiftLeft',\n META = 'MetaLeft',\n}\n\nexport const useEventManager = createGlobalState(() => {\n let originalUserSelect = '';\n let originalTouchAction = '';\n let originalOverscrollBehavior = '';\n\n let currentMoveHandler: ((event: any) => void) | null = null;\n let currentEndHandler: (() => void) | null = null;\n let currentCancelHandler: (() => void) | null = null;\n let currentScrollHandler: ((event: WheelEvent) => void) | null = null;\n let currentKeyHandler: ((event: KeyboardEvent) => void) | null = null;\n\n const { activeContainer } = useDnDStore();\n\n const disableInteractions = () => {\n const body = document.body;\n\n originalUserSelect = body.style.userSelect;\n\n body.style.userSelect = 'none';\n\n window.addEventListener('contextmenu', preventEvent);\n window.addEventListener('selectstart', preventEvent);\n window.addEventListener('touchstart', preventEvent);\n window.addEventListener('touchmove', preventEvent);\n };\n\n const enableInteractions = () => {\n const body = document.body;\n\n body.style.userSelect = originalUserSelect;\n body.style.touchAction = originalTouchAction;\n body.style.overscrollBehavior = originalOverscrollBehavior;\n\n window.removeEventListener('contextmenu', preventEvent);\n window.removeEventListener('selectstart', preventEvent);\n window.removeEventListener('touchstart', preventEvent);\n window.removeEventListener('touchmove', preventEvent);\n };\n\n const clearAllListeners = () => {\n if (currentMoveHandler) {\n document.removeEventListener('pointermove', currentMoveHandler);\n currentMoveHandler = null;\n }\n\n if (currentEndHandler) {\n document.removeEventListener('pointerup', currentEndHandler);\n currentEndHandler = null;\n }\n\n if (currentCancelHandler) {\n currentCancelHandler = null;\n }\n\n if (currentScrollHandler) {\n document.removeEventListener('wheel', currentScrollHandler);\n currentScrollHandler = null;\n }\n\n if (currentKeyHandler) {\n document.removeEventListener('keydown', currentKeyHandler);\n document.removeEventListener('keypress', currentKeyHandler);\n document.removeEventListener('keyup', currentKeyHandler);\n currentKeyHandler = null;\n }\n };\n\n const handleDragStart = (\n event: PointerEvent | KeyboardEvent,\n elementRef: Ref<HTMLElement | null>,\n options?: IUseDragOptions\n ) => {\n clearAllListeners();\n\n (event.target as HTMLElement).blur();\n\n if (options?.container) activeContainer.component.value = options.container;\n\n const { activate, track, deactivate } = useSensor(elementRef, options);\n\n currentEndHandler = () => {\n activeContainer.component.value = null;\n enableInteractions();\n deactivate(true);\n clearAllListeners();\n };\n\n currentCancelHandler = () => {\n activeContainer.component.value = null;\n enableInteractions();\n deactivate(false);\n clearAllListeners();\n };\n\n currentMoveHandler = (event: PointerEvent | KeyboardEvent) => track(event);\n currentScrollHandler = (event: WheelEvent) => track(event);\n currentKeyHandler = (event: KeyboardEvent) => {\n if (event.type === 'keyup') {\n if (event.code === EKeyboardKey.ESCAPE) currentCancelHandler?.();\n if (event.code === EKeyboardKey.ENTER) currentEndHandler?.();\n }\n\n track(event);\n };\n\n disableInteractions();\n activate(event);\n\n document.addEventListener('pointermove', currentMoveHandler);\n document.addEventListener('pointerup', currentEndHandler);\n document.addEventListener('wheel', currentScrollHandler);\n document.addEventListener('keydown', currentKeyHandler);\n document.addEventListener('keypress', currentKeyHandler);\n document.addEventListener('keyup', currentKeyHandler);\n };\n\n return {\n handleDragStart,\n };\n});\n","import { onBeforeUnmount, onMounted } from 'vue';\n\nimport type { IUseDragOptions } from '../types';\nimport { useDnDStore } from './useDnDStore';\nimport { useElementManager } from '../managers/useElementManager';\nimport { useEventManager } from '../managers/useEventManager';\n\nexport const useDraggable = (options?: IUseDragOptions) => {\n const {\n id,\n elementRef,\n isDragging,\n isOvered,\n isAllowed,\n registerElement,\n unregisterElement,\n } = useElementManager(options);\n\n const { pointerPosition } = useDnDStore();\n const { handleDragStart: start } = useEventManager();\n\n const handleDragStart = (event: PointerEvent | KeyboardEvent) =>\n start(event, elementRef, options);\n\n onMounted(registerElement);\n onBeforeUnmount(unregisterElement);\n\n return {\n pointerPosition,\n elementRef,\n isDragging,\n isOvered,\n isAllowed,\n handleDragStart,\n id,\n };\n};\n","import { computed, ref } from 'vue';\n\nimport type { IUseDropOptions } from '../types';\nimport { useDnDStore } from '../composables/useDnDStore';\n\nexport const useZoneManager = (options?: IUseDropOptions) => {\n const {\n zonesMap,\n hovered,\n draggingElements,\n isDragging,\n handleDropZoneIntersection,\n } = useDnDStore();\n\n const elementRef = ref<HTMLElement | null>(null);\n\n const isOvered = computed<boolean>(() => {\n return hovered.zone.value === elementRef.value;\n });\n\n const isAllowed = computed<boolean>(() => {\n if (!elementRef.value || !isDragging.value) return false;\n\n const currentZone = zonesMap.value.get(elementRef.value);\n if (!currentZone?.groups.length) return true;\n\n return !Array.from(draggingElements.value.values()).some((element) => {\n if (!element.groups.length) return false;\n return !element.groups.some((group) =>\n currentZone.groups.includes(group)\n );\n });\n });\n\n const registerZone = () => {\n if (!elementRef.value) throw new Error('elementRef is not set');\n\n handleDropZoneIntersection('add', elementRef.value);\n\n zonesMap.value.set(elementRef.value, {\n node: elementRef.value,\n groups: options?.groups ?? [],\n events: options?.events ?? {},\n data: options?.data ?? undefined,\n });\n\n elementRef.value.setAttribute('data-dnd-droppable', 'true');\n };\n\n const unregisterZone = () => {\n if (!elementRef.value) return;\n\n handleDropZoneIntersection('remove', elementRef.value);\n\n zonesMap.value.delete(elementRef.value);\n };\n\n return { elementRef, registerZone, unregisterZone, isOvered, isAllowed };\n};\n","import { onBeforeUnmount, onMounted } from 'vue';\n\nimport type { IUseDropOptions } from '../types';\nimport { useZoneManager } from '../managers/useZoneManager';\n\nexport const useDroppable = (options?: IUseDropOptions) => {\n const { elementRef, registerZone, unregisterZone, isOvered, isAllowed } =\n useZoneManager(options);\n\n // Register/unregister drop zone with store\n onMounted(registerZone);\n onBeforeUnmount(unregisterZone);\n\n return { elementRef, isOvered, isAllowed };\n};\n","import { computed, type Ref } from 'vue';\nimport { useDnDStore } from './useDnDStore';\nimport { isDescendant } from '../utils/dom';\n\nexport const useSelection = (elementRef: Ref<HTMLElement | null>) => {\n const { selectedElements, elementsMap } = useDnDStore();\n\n const isSelected = computed<boolean>(() =>\n elementRef.value ? selectedElements.value.has(elementRef.value) : false\n );\n\n const isParentOfSelected = computed(() => {\n if (!elementRef.value) return false;\n\n for (const node of selectedElements.value) {\n if (\n node &&\n isDescendant(node as HTMLElement, elementRef.value as HTMLElement)\n ) {\n return true;\n }\n }\n return false;\n });\n\n const hasSelectedParent = computed(() => {\n if (!elementRef.value) return false;\n\n for (const node of selectedElements.value) {\n if (\n node &&\n isDescendant(elementRef.value as HTMLElement, node as HTMLElement)\n ) {\n return true;\n }\n }\n return false;\n });\n\n const handleUnselect = () => {\n if (!elementRef.value) return;\n selectedElements.value.delete(elementRef.value);\n };\n\n const handleSelect = () => {\n if (!elementRef.value) return;\n const element = elementsMap.value.get(elementRef.value);\n if (!element) return;\n\n if (isParentOfSelected.value) {\n // Удаляем все дочерние выбранные элементы\n for (const node of selectedElements.value) {\n if (\n node &&\n isDescendant(node as HTMLElement, elementRef.value as HTMLElement)\n ) {\n selectedElements.value.delete(node);\n }\n }\n }\n\n if (hasSelectedParent.value) {\n // Удаляем все родительские выбранные элементы\n for (const node of selectedElements.value) {\n if (\n node &&\n isDescendant(elementRef.value as HTMLElement, node as HTMLElement)\n ) {\n selectedElements.value.delete(node);\n }\n }\n }\n\n selectedElements.value.add(elementRef.value);\n };\n\n const handleToggleSelect = () => {\n if (!elementRef.value) return;\n\n selectedElements.value.has(elementRef.value)\n ? handleUnselect()\n : handleSelect();\n };\n\n return {\n handleUnselect,\n handleSelect,\n handleToggleSelect,\n isSelected,\n isParentOfSelected,\n };\n};\n"],"names":["_DnDOperations","__publicField","source","index","item","target","sourceIndex","targetIndex","sourceItem","targetItem","store","hoveredElement","hoveredZone","targetSource","_b","_a","_d","_c","firstElement","firstIndex","_e","sortDirection","a","b","element","_g","_f","_h","items","DnDOperations","useDnDStore","createGlobalState","draggingElements","ref","isDragging","computed","activeContainer","shallowRef","elementsMap","selectedElements","zonesMap","visibleZones","visibleElements","hasIntersectionObserver","elementObserver","entries","entry","zoneObserver","handleDragElementIntersection","action","handleDropZoneIntersection","pointerPosition","w","s","d","ctrl","shift","alt","meta","useMagicKeys","hovered","useDragContainer","options","elementRef","onMounted","onUnmounted","computedStyle","__props","props","overlay","DefaultOverlay","VueDndKitPlugin","app","DragOverlay","originalMount","rootContainer","instance","rootEl","overlayContainer","vnode","createVNode","render","originalUnmount","checkCollision","boxA","boxB","getBoundingBox","rect","getCenter","box","getOffset","pointer","getDistance","pointA","pointB","dx","dy","getOverlapPercent","xOverlap","yOverlap","overlapArea","boxAArea","boxBArea","draggableDataName","preventEvent","event","createPayload","useElementManager","isDragStarted","isOvered","id","useId","isAllowed","currentElement","_","draggingElement","group","isDescendant","container","defaultCollisionDetection","containerRect","containerCenter","pointerX","pointerY","shouldUseNormalPriority","activeDragNodes","allCollidingElements","node","elementCenter","isPointerInElement","overlapPercent","centerDistance","depth","parentNode","allCollidingZones","dragNode","zone","zoneCenter","useKeyboard","keyboard","moveStep","centerX","centerY","currentX","currentY","newX","newY","usePointer","pixel","percent","useSensor","onPointerStart","onPointerMove","onPointerEnd","onKeyboardStart","onKeyboardMove","onKeyboardEnd","animationFrameId","getDraggingElements","draggableElement","isDraggableInSelection","result","validateCollisionResults","htmlElements","elements","filteredZoneElement","htmlElement","detectCollisions","processCollisionResults","results","previousElement","previousZone","newElement","newZone","_i","_l","_k","_j","throttledDetectAndProcess","useThrottleFn","processedResults","animationLoop","startDetection","stopDetection","triggerEvents","useEventManager","originalUserSelect","originalTouchAction","originalOverscrollBehavior","currentMoveHandler","currentEndHandler","currentCancelHandler","currentScrollHandler","currentKeyHandler","disableInteractions","body","enableInteractions","clearAllListeners","activate","track","deactivate","useDraggable","registerElement","unregisterElement","start","handleDragStart","onBeforeUnmount","useZoneManager","currentZone","useDroppable","registerZone","unregisterZone","useSelection","isSelected","isParentOfSelected","hasSelectedParent","handleUnselect","handleSelect"],"mappings":"qUAEaA,EAAN,MAAMA,CAAc,CAqN3B,EApNEC,EADWD,EACJ,SAAS,CAACE,EAAgBC,IAAmB,CAC9C,GAAA,CAACD,GAAUC,IAAU,OAAW,OACpC,KAAM,CAACC,CAAI,EAAIF,EAAO,OAAOC,EAAO,CAAC,EAC9B,OAAAC,CACT,GACAH,EANWD,EAMJ,SAAS,CAACK,EAAgBF,EAAgBC,IAAe,CAC1D,CAACC,GAAUF,IAAU,QAClBE,EAAA,OAAOF,EAAO,EAAGC,CAAI,CAC9B,GACAH,EAVWD,EAUJ,OAAO,CACZE,EACAI,EACAD,EACAE,I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AatD,EAAW,MAAsBgE,CAAmB,EAE1D,MAAA,GAGJ,MAAA,EAAA,CACR,EAEKyF,EAAiB,IAAM,CACtBzJ,EAAW,OACCxB,EAAA,MAAM,OAAOwB,EAAW,KAAK,CAChD,EAEM0J,EAAe,IAAM,CAGzB,GAFI,GAAC1J,EAAW,OAEZ,CADYzB,EAAY,MAAM,IAAIyB,EAAW,KAAK,GAGtD,IAAIuJ,EAAmB,MAEV,UAAAvF,KAAQxF,EAAiB,MAEhCwF,GACAV,EAAaU,EAAqBhE,EAAW,KAAoB,GAEhDxB,EAAA,MAAM,OAAOwF,CAAI,EAKxC,GAAIwF,EAAkB,MAET,UAAAxF,KAAQxF,EAAiB,MAEhCwF,GACAV,EAAatD,EAAW,MAAsBgE,CAAmB,GAEhDxF,EAAA,MAAM,OAAOwF,CAAI,EAKvBxF,EAAA,MAAM,IAAIwB,EAAW,KAAK,EAC7C,EAUO,MAAA,CACL,eAAAyJ,EACA,aAAAC,EACA,mBAXyB,IAAM,CAC1B1J,EAAW,QAEhBxB,EAAiB,MAAM,IAAIwB,EAAW,KAAK,EACvCyJ,IACAC,EAAa,EACnB,EAME,WAAAJ,EACA,mBAAAC,CACF,CACF"}
|
|
1
|
+
{"version":3,"file":"vue-dnd-kit-core.cjs.js","sources":["../src/utils/operations.ts","../src/composables/useDnDStore.ts","../src/composables/useDragContainer.ts","../src/components/DefaultOverlay.vue","../src/components/DragOverlay.vue","../src/plugin.ts","../src/utils/geometry.ts","../src/utils/namespaces.ts","../src/utils/events.ts","../src/managers/useElementManager.ts","../src/utils/dom.ts","../src/utils/sensor.ts","../src/composables/useKeyboard.ts","../src/composables/usePointer.ts","../src/composables/useSensor.ts","../src/managers/useEventManager.ts","../src/composables/useDraggable.ts","../src/managers/useZoneManager.ts","../src/composables/useDroppable.ts","../src/composables/useSelection.ts"],"sourcesContent":["import { IDnDStore } from '../types';\n\nexport class DnDOperations {\n static remove = (source?: any[], index?: number) => {\n if (!source || index === undefined) return;\n const [item] = source.splice(index, 1);\n return item;\n };\n static insert = (target?: any[], index?: number, item?: any) => {\n if (!target || index === undefined) return;\n target.splice(index, 0, item);\n };\n static move = (\n source?: any[],\n sourceIndex?: number,\n target?: any[],\n targetIndex?: number\n ) => {\n if (\n !source ||\n !target ||\n sourceIndex === undefined ||\n targetIndex === undefined\n )\n return;\n const item = DnDOperations.remove(source, sourceIndex);\n DnDOperations.insert(target, targetIndex, item);\n };\n static swap = (\n source?: any[],\n sourceIndex?: number,\n target?: any[],\n targetIndex?: number\n ) => {\n if (\n !source ||\n !target ||\n sourceIndex === undefined ||\n targetIndex === undefined\n )\n return;\n\n const sourceItem = source[sourceIndex];\n const targetItem = target[targetIndex];\n\n source[sourceIndex] = targetItem;\n target[targetIndex] = sourceItem;\n };\n static copy = (\n source?: any[],\n index?: number,\n target?: any[],\n targetIndex?: number\n ) => {\n if (!source || index === undefined || !target || targetIndex === undefined)\n return;\n const item = source[index];\n DnDOperations.insert(target, targetIndex, item);\n };\n static applyTransfer = (store: IDnDStore) => {\n const hoveredElement = store.hovered.element.value;\n const hoveredZone = store.hovered.zone.value;\n\n if (hoveredElement) {\n const targetSource =\n store.elementsMap.value.get(hoveredElement)?.data?.source;\n const targetIndex =\n store.elementsMap.value.get(hoveredElement)?.data?.index;\n\n const firstElement = store.draggingElements.value.values().next().value;\n const firstIndex = firstElement?.data?.index;\n\n const sortDirection =\n firstIndex !== undefined &&\n targetIndex !== undefined &&\n firstIndex > targetIndex\n ? 1\n : -1;\n\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort(\n (a, b) => sortDirection * ((a.data?.index || 0) - (b.data?.index || 0))\n );\n\n sortedElements.forEach((element) =>\n DnDOperations.move(\n element.data?.source,\n element.data?.index,\n targetSource,\n targetIndex\n )\n );\n } else if (hoveredZone) {\n const targetSource = store.zonesMap.value.get(hoveredZone)?.data?.source;\n const targetIndex = targetSource?.length;\n\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort((a, b) => (b.data?.index || 0) - (a.data?.index || 0));\n\n sortedElements.forEach((element) =>\n DnDOperations.move(\n element.data?.source,\n element.data?.index,\n targetSource,\n targetIndex\n )\n );\n }\n };\n\n static applyCopy = (store: IDnDStore) => {\n const hoveredElement = store.hovered.element.value;\n const hoveredZone = store.hovered.zone.value;\n\n if (hoveredElement) {\n const targetSource =\n store.elementsMap.value.get(hoveredElement)?.data?.source;\n const targetIndex =\n store.elementsMap.value.get(hoveredElement)?.data?.index;\n\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort((a, b) => (b.data?.index || 0) - (a.data?.index || 0));\n\n sortedElements.forEach((element) =>\n DnDOperations.copy(\n element.data?.source,\n element.data?.index,\n targetSource,\n targetIndex\n )\n );\n } else if (hoveredZone) {\n const targetSource = store.zonesMap.value.get(hoveredZone)?.data?.source;\n const targetIndex = targetSource?.length;\n\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort((a, b) => (b.data?.index || 0) - (a.data?.index || 0));\n\n sortedElements.forEach((element) =>\n DnDOperations.copy(\n element.data?.source,\n element.data?.index,\n targetSource,\n targetIndex\n )\n );\n }\n };\n static applySwap = (store: IDnDStore) => {\n const hoveredElement = store.hovered.element.value;\n const hoveredZone = store.hovered.zone.value;\n\n if (hoveredElement && store.draggingElements.value.size === 1) {\n const element = store.draggingElements.value.values().next().value;\n DnDOperations.swap(\n element?.data?.source,\n element?.data?.index,\n store.elementsMap.value.get(hoveredElement)?.data?.source,\n store.elementsMap.value.get(hoveredElement)?.data?.index\n );\n } else if (hoveredZone) {\n const targetSource = store.zonesMap.value.get(hoveredZone)?.data?.source;\n const targetIndex = targetSource?.length;\n\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort((a, b) => (b.data?.index || 0) - (a.data?.index || 0));\n\n sortedElements.forEach((element) =>\n DnDOperations.move(\n element.data?.source,\n element.data?.index,\n targetSource,\n targetIndex\n )\n );\n }\n };\n static applyRemove = (store: IDnDStore) => {\n const sortedElements = Array.from(\n store.draggingElements.value.values()\n ).sort((a, b) => (b.data?.index || 0) - (a.data?.index || 0));\n\n sortedElements.forEach((element) => {\n if (element.data?.source && element.data?.index !== undefined) {\n DnDOperations.remove(element.data.source, element.data.index);\n }\n });\n };\n static applyInsert = (store: IDnDStore, items: any[]) => {\n const hoveredElement = store.hovered.element.value;\n const hoveredZone = store.hovered.zone.value;\n\n if (hoveredElement && items.length > 0) {\n const targetSource =\n store.elementsMap.value.get(hoveredElement)?.data?.source;\n const targetIndex =\n store.elementsMap.value.get(hoveredElement)?.data?.index;\n\n items.forEach((item) => {\n DnDOperations.insert(targetSource, targetIndex, item);\n });\n } else if (hoveredZone) {\n const targetSource = store.zonesMap.value.get(hoveredZone)?.data?.source;\n const targetIndex = targetSource?.length;\n\n items.forEach((item) => {\n DnDOperations.insert(targetSource, targetIndex, item);\n });\n }\n };\n}\n","import type {\n IDragElement,\n IDraggingElement,\n IDropZone,\n IPoint,\n} from '../types';\nimport {\n computed,\n ref,\n shallowRef,\n type Component,\n type TransitionProps,\n} from 'vue';\nimport { createGlobalState, useMagicKeys } from '@vueuse/core';\n\nexport const useDnDStore = createGlobalState(() => {\n const isPending = shallowRef<boolean>(false);\n const draggingElements = ref<Map<HTMLElement | Element, IDraggingElement>>(\n new Map()\n );\n const isDragging = computed<boolean>(() => draggingElements.value.size > 0);\n\n const activeContainer = {\n component: ref<Component | null>(null),\n ref: shallowRef<HTMLElement | null>(null),\n options: shallowRef<TransitionProps | null>(null),\n animating: {\n enter: shallowRef<boolean>(false),\n leave: shallowRef<boolean>(false),\n appear: shallowRef<boolean>(false),\n },\n };\n\n const elementsMap = ref<Map<HTMLElement | Element, IDragElement>>(new Map());\n const selectedElements = ref<Set<HTMLElement | Element>>(new Set());\n const zonesMap = ref<Map<HTMLElement | Element, IDropZone>>(new Map());\n const visibleZones = shallowRef<Set<HTMLElement | Element>>(new Set());\n const visibleElements = shallowRef<Set<HTMLElement | Element>>(new Set());\n\n const hasIntersectionObserver =\n typeof window !== 'undefined' && 'IntersectionObserver' in window;\n\n const elementObserver = hasIntersectionObserver\n ? new IntersectionObserver((entries) => {\n entries.forEach((entry) =>\n visibleElements.value[entry.isIntersecting ? 'add' : 'delete'](\n entry.target\n )\n );\n })\n : null;\n\n const zoneObserver = hasIntersectionObserver\n ? new IntersectionObserver((entries) => {\n entries.forEach((entry) =>\n visibleZones.value[entry.isIntersecting ? 'add' : 'delete'](\n entry.target\n )\n );\n })\n : null;\n\n const handleDragElementIntersection = (\n action: 'add' | 'remove',\n element: HTMLElement | Element\n ) => {\n if (!elementObserver) return;\n\n if (action === 'add') {\n elementObserver.observe(element);\n } else {\n elementObserver.unobserve(element);\n visibleElements.value.delete(element);\n }\n };\n\n const handleDropZoneIntersection = (\n action: 'add' | 'remove',\n element: HTMLElement | Element\n ) => {\n if (!zoneObserver) return;\n\n if (action === 'add') {\n zoneObserver.observe(element);\n } else {\n zoneObserver.unobserve(element);\n visibleZones.value.delete(element);\n }\n };\n\n const pointerPosition = {\n start: shallowRef<IPoint | null>(null),\n current: shallowRef<IPoint | null>(null),\n offset: {\n percent: shallowRef<IPoint | null>(null),\n pixel: shallowRef<IPoint | null>(null),\n },\n };\n\n const { w, s, a, d, ctrl, shift, alt, meta } = useMagicKeys();\n\n const hovered = {\n zone: shallowRef<HTMLElement | Element | null>(null),\n element: shallowRef<HTMLElement | Element | null>(null),\n };\n\n return {\n draggingElements,\n isDragging,\n activeContainer,\n elementsMap,\n selectedElements,\n zonesMap,\n visibleZones,\n visibleElements,\n pointerPosition,\n keyboard: {\n w,\n s,\n a,\n d,\n ctrl,\n shift,\n alt,\n meta,\n },\n hovered,\n isPending,\n handleDragElementIntersection,\n handleDropZoneIntersection,\n };\n});\n","import { onUnmounted, onMounted, ref, type TransitionProps } from 'vue';\n\nimport { useDnDStore } from './useDnDStore';\n\nexport const useDragContainer = (options?: Omit<TransitionProps, 'appear'>) => {\n const elementRef = ref<HTMLElement | null>(null);\n\n const { draggingElements, pointerPosition, isDragging, activeContainer } =\n useDnDStore();\n\n onMounted(() => {\n activeContainer.ref = elementRef;\n activeContainer.options.value = options ?? null;\n });\n\n onUnmounted(() => {\n activeContainer.ref.value = null;\n activeContainer.options.value = null;\n });\n\n return {\n elementRef,\n draggingElements,\n pointerPosition,\n isDragging,\n animating: activeContainer.animating,\n };\n};\n","<script setup lang=\"ts\">\n import { computed, CSSProperties } from 'vue';\n import { useDragContainer } from '../composables/useDragContainer';\n\n const { elementRef, pointerPosition, isDragging, draggingElements } =\n useDragContainer();\n\n const { styles } = defineProps<{\n styles?: CSSProperties;\n }>();\n\n const computedStyle = computed<CSSProperties>(() => ({\n transform: `translate3d(${\n (pointerPosition.current.value?.x ?? 0) -\n (pointerPosition.offset.pixel.value?.x ?? 0)\n }px, ${\n (pointerPosition.current.value?.y ?? 0) -\n (pointerPosition.offset.pixel.value?.y ?? 0)\n }px, 0)`,\n zIndex: 1000,\n position: 'fixed',\n top: 0,\n left: 0,\n transition: '0.3s cubic-bezier(0.165, 0.84, 0.44, 1)',\n ...styles,\n }));\n</script>\n\n<template>\n <div\n v-if=\"isDragging\"\n ref=\"elementRef\"\n :style=\"computedStyle\"\n >\n <template\n v-for=\"[node, element] in draggingElements\"\n :key=\"element.id\"\n >\n <component\n v-if=\"element.layer\"\n :is=\"element.layer\"\n :node=\"node\"\n :data=\"element.data\"\n :id=\"element.id\"\n :groups=\"element.groups\"\n />\n <div\n v-else\n v-html=\"element.initialHTML\"\n :style=\"{\n width: `${element.initialRect?.width}px`,\n height: `${element.initialRect?.height}px`,\n }\"\n />\n </template>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, CSSProperties } from 'vue';\n import { useDnDStore } from '../composables/useDnDStore';\n import DefaultOverlay from './DefaultOverlay.vue';\n\n const props = defineProps<{\n styles?: CSSProperties;\n }>();\n\n const { activeContainer } = useDnDStore();\n\n const overlay = computed(() => ({\n component: activeContainer.component.value ?? DefaultOverlay,\n props,\n }));\n</script>\n\n<template>\n <Transition\n v-if=\"activeContainer.options.value\"\n :name=\"activeContainer.options.value.name\"\n :duration=\"activeContainer.options.value.duration\"\n :enter-from-class=\"activeContainer.options.value.enterFromClass\"\n :enter-to-class=\"activeContainer.options.value.enterToClass\"\n :enter-active-class=\"activeContainer.options.value.enterActiveClass\"\n :leave-from-class=\"activeContainer.options.value.leaveFromClass\"\n :leave-to-class=\"activeContainer.options.value.leaveToClass\"\n :leave-active-class=\"activeContainer.options.value.leaveActiveClass\"\n :appear-active-class=\"activeContainer.options.value.appearActiveClass\"\n :appear-from-class=\"activeContainer.options.value.appearFromClass\"\n :appear-to-class=\"activeContainer.options.value.appearToClass\"\n :mode=\"activeContainer.options.value.mode\"\n :type=\"activeContainer.options.value.type\"\n :css=\"activeContainer.options.value.css\"\n :appear=\"true\"\n :persisted=\"activeContainer.options.value.persisted\"\n @enter=\"activeContainer.options.value.onEnter\"\n @leave=\"activeContainer.options.value.onLeave\"\n @before-enter=\"activeContainer.options.value.onBeforeEnter\"\n @before-leave=\"activeContainer.options.value.onBeforeLeave\"\n @before-appear=\"activeContainer.options.value.onBeforeAppear\"\n @after-enter=\"activeContainer.options.value.onAfterEnter\"\n @after-leave=\"activeContainer.options.value.onAfterLeave\"\n @after-appear=\"activeContainer.options.value.onAfterAppear\"\n >\n <component\n :is=\"overlay.component || overlay\"\n v-bind=\"overlay.props || {}\"\n />\n </Transition>\n\n <component\n v-else\n :is=\"overlay.component || overlay\"\n v-bind=\"overlay.props || {}\"\n />\n</template>\n","import { createVNode, render } from 'vue';\n\nimport type { App } from 'vue';\nimport DragOverlay from './components/DragOverlay.vue';\nimport { IPluginOptions } from './types';\nimport { useDnDStore } from './composables/useDnDStore';\n\nexport const VueDndKitPlugin = {\n install(app: App, options?: IPluginOptions) {\n app.component('DragOverlay', DragOverlay);\n const originalMount = app.mount;\n app.mount = function (rootContainer) {\n const instance = originalMount.call(this, rootContainer);\n\n const rootEl =\n typeof rootContainer === 'string'\n ? document.querySelector(rootContainer)\n : rootContainer;\n\n if (rootEl && rootEl instanceof Element) {\n if (!rootEl.querySelector('#vue-dnd-kit-overlay')) {\n const overlayContainer = document.createElement('div');\n\n overlayContainer.id = 'vue-dnd-kit-overlay';\n overlayContainer.style.pointerEvents = 'none';\n\n rootEl.appendChild(overlayContainer);\n\n // Передаем опции напрямую в компонент\n const vnode = createVNode(DragOverlay, {\n styles: options?.defaultOverlay?.styles,\n });\n render(vnode, overlayContainer);\n\n app.__VUE_DND_KIT_OVERLAY__ = {\n container: overlayContainer,\n vnode,\n options: options?.defaultOverlay || {},\n };\n\n const store = useDnDStore();\n app.__VUE_DND_KIT_STORE__ = store;\n }\n }\n\n return instance;\n };\n\n // Модифицируем метод unmount для очистки\n const originalUnmount = app.unmount;\n app.unmount = function () {\n if (app.__VUE_DND_KIT_OVERLAY__) {\n render(null, app.__VUE_DND_KIT_OVERLAY__.container);\n delete app.__VUE_DND_KIT_OVERLAY__;\n }\n return originalUnmount.call(this);\n };\n },\n};\n\ndeclare module '@vue/runtime-core' {\n export interface App {\n __VUE_DND_KIT_OVERLAY__?: {\n container: HTMLElement;\n vnode: any;\n options: IPluginOptions['defaultOverlay'];\n };\n __VUE_DND_KIT_STORE__?: ReturnType<typeof useDnDStore>;\n }\n}\n","import type { IBoundingBox, IPoint } from '../types';\n\nexport const checkCollision = (\n boxA: IBoundingBox,\n boxB: IBoundingBox\n): boolean => {\n return (\n boxA.x < boxB.x + boxB.width &&\n boxA.x + boxA.width > boxB.x &&\n boxA.y < boxB.y + boxB.height &&\n boxA.y + boxA.height > boxB.y\n );\n};\n\nexport const getBoundingBox = (element: HTMLElement | null): IBoundingBox => {\n if (!element)\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n };\n\n const rect = element.getBoundingClientRect();\n\n return {\n bottom: rect.bottom,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n };\n};\n\nexport const getCenter = (box: IBoundingBox): IPoint => ({\n x: box.x + box.width / 2,\n y: box.y + box.height / 2,\n});\n\nexport const getOffset = (element: HTMLElement | null, pointer: IPoint) => {\n const rect = getBoundingBox(element);\n return {\n pixel: {\n x: pointer.x - rect.x,\n y: pointer.y - rect.y,\n },\n percent: {\n x: ((pointer.x - rect.x) / rect.width) * 100,\n y: ((pointer.y - rect.y) / rect.height) * 100,\n },\n };\n};\n\nexport const getDistance = (pointA: IPoint, pointB: IPoint): number => {\n const dx = pointB.x - pointA.x;\n const dy = pointB.y - pointA.y;\n return Math.sqrt(dx * dx + dy * dy);\n};\n\nexport const getOverlapPercent = (\n boxA: IBoundingBox,\n boxB: IBoundingBox\n): number => {\n const xOverlap = Math.max(\n 0,\n Math.min(boxA.x + boxA.width, boxB.x + boxB.width) -\n Math.max(boxA.x, boxB.x)\n );\n const yOverlap = Math.max(\n 0,\n Math.min(boxA.y + boxA.height, boxB.y + boxB.height) -\n Math.max(boxA.y, boxB.y)\n );\n\n const overlapArea = xOverlap * yOverlap;\n\n const boxAArea = boxA.width * boxA.height;\n const boxBArea = boxB.width * boxB.height;\n\n // Возвращаем среднее значение процентов перекрытия относительно обоих элементов\n return ((overlapArea / boxAArea) * 100 + (overlapArea / boxBArea) * 100) / 2;\n};\n","export const draggableDataName = 'data-vue-dnd-kit-draggable';\nexport const droppableDataName = 'data-vue-dnd-kit-droppable';\n\nexport const VUE_DND_KIT_OPTIONS = Symbol('vue-dnd-kit-options');\n","import { IDnDPayload, IDnDStore } from '../types';\n\nexport const preventEvent = (event: Event) => {\n event.preventDefault();\n};\n\nexport const createPayload = (store: IDnDStore): IDnDPayload => {\n return {\n items: Array.from(store.draggingElements.value.values()),\n };\n};\n","import { computed, ref, shallowRef, useId } from 'vue';\n\nimport type { IUseDragOptions } from '../types';\nimport { draggableDataName } from '../utils/namespaces';\nimport { preventEvent } from '../utils/events';\nimport { useDnDStore } from '../composables/useDnDStore';\n\nexport const useElementManager = (options?: IUseDragOptions) => {\n const {\n elementsMap,\n draggingElements,\n hovered,\n selectedElements,\n isDragging: isDragStarted,\n visibleElements,\n handleDragElementIntersection,\n } = useDnDStore();\n\n const elementRef = ref<HTMLElement | null>(null);\n const isOvered = computed<boolean>(\n () =>\n visibleElements.value.has(elementRef.value as HTMLElement) &&\n hovered.element.value === elementRef.value\n );\n\n const id = shallowRef(options?.id || useId());\n\n const isDragging = computed<boolean>(() => {\n if (!elementRef.value) return false;\n if (!elementsMap.value.has(elementRef.value)) return false;\n return draggingElements.value.has(elementRef.value);\n });\n\n const isAllowed = computed<boolean>(() => {\n if (!elementRef.value || !isDragStarted.value) return false;\n if (!visibleElements.value.has(elementRef.value)) return false;\n\n const currentElement = elementsMap.value.get(elementRef.value);\n if (!currentElement?.groups.length) return true;\n\n return !Array.from(draggingElements.value.entries()).some(\n ([_, draggingElement]) => {\n if (!draggingElement.groups.length) return false;\n return !draggingElement.groups.some((group) =>\n currentElement.groups.includes(group)\n );\n }\n );\n });\n\n const isLazyAllowed = computed<boolean>(() => {\n if (!elementRef.value || !isDragStarted.value) return false;\n if (!visibleElements.value.has(elementRef.value)) return false;\n if (hovered.element.value !== elementRef.value) return false;\n\n const currentElement = elementsMap.value.get(elementRef.value);\n if (!currentElement?.groups.length) return true;\n\n return !Array.from(draggingElements.value.entries()).some(\n ([_, draggingElement]) => {\n if (!draggingElement.groups.length) return false;\n return !draggingElement.groups.some((group) =>\n currentElement.groups.includes(group)\n );\n }\n );\n });\n\n const registerElement = () => {\n if (!elementRef.value) throw new Error('ElementRef is not set');\n\n elementsMap.value.set(elementRef.value, {\n node: elementRef.value,\n groups: options?.groups ?? [],\n layer: options?.layer ?? null,\n defaultLayer: options?.layer ?? null,\n events: options?.events ?? {},\n data: options?.data ?? null,\n id: id.value,\n });\n\n handleDragElementIntersection('add', elementRef.value);\n\n elementRef.value.addEventListener('dragstart', preventEvent);\n elementRef.value.addEventListener('drag', preventEvent);\n elementRef.value.setAttribute(draggableDataName, 'true');\n elementRef.value.setAttribute('draggable', 'false');\n };\n\n const unregisterElement = () => {\n if (!elementRef.value) return;\n\n elementsMap.value.delete(elementRef.value);\n selectedElements.value.delete(elementRef.value);\n\n elementRef.value.removeEventListener('dragstart', preventEvent);\n elementRef.value.removeEventListener('drag', preventEvent);\n elementRef.value.removeAttribute(draggableDataName);\n elementRef.value.removeAttribute('draggable');\n };\n\n return {\n elementRef,\n registerElement,\n unregisterElement,\n isDragging,\n isOvered,\n isAllowed,\n isLazyAllowed,\n id,\n };\n};\n","export const isDescendant = (\n element: HTMLElement | Element | null,\n container: HTMLElement | Element\n): boolean => {\n if (!element) return false;\n return container.contains(element);\n};\n","import {\n checkCollision,\n getBoundingBox,\n getCenter,\n getDistance,\n getOverlapPercent,\n} from './geometry';\n\nimport { IDnDStore } from '../types';\nimport { isDescendant } from './dom';\n\nexport const defaultCollisionDetection = (store: IDnDStore) => {\n const containerRect = getBoundingBox(store.activeContainer.ref.value);\n const containerCenter = getCenter(containerRect);\n const pointerX = store.pointerPosition.current.value?.x ?? 0;\n const pointerY = store.pointerPosition.current.value?.y ?? 0;\n\n const isPointerInActiveContainer =\n containerRect &&\n pointerX >= containerRect.x &&\n pointerX <= containerRect.x + containerRect.width &&\n pointerY >= containerRect.y &&\n pointerY <= containerRect.y + containerRect.height;\n\n const shouldUseNormalPriority = !isPointerInActiveContainer;\n\n const activeDragNodes = Array.from(store.draggingElements.value.keys());\n\n const allCollidingElements = Array.from(store.visibleElements.value.entries())\n .filter(([node, _]) => {\n if (!node) return false;\n\n const rect = getBoundingBox(node as HTMLElement);\n return rect && containerRect && checkCollision(rect, containerRect);\n })\n .map(([node, element]) => {\n const rect = getBoundingBox(node as HTMLElement);\n const elementCenter = getCenter(rect);\n\n const isPointerInElement =\n pointerX >= rect.x &&\n pointerX <= rect.x + rect.width &&\n pointerY >= rect.y &&\n pointerY <= rect.y + rect.height;\n\n const overlapPercent = getOverlapPercent(rect, containerRect);\n const centerDistance = getDistance(containerCenter, elementCenter);\n\n // Вычисляем глубину вложенности\n let depth = 0;\n for (const [parentNode, _] of store.visibleElements.value.entries()) {\n if (\n parentNode !== node &&\n parentNode &&\n node &&\n isDescendant(node as HTMLElement, parentNode as HTMLElement)\n ) {\n depth++;\n }\n }\n\n return {\n element,\n node: node as HTMLElement,\n isPointerInElement,\n overlapPercent,\n depth,\n centerDistance,\n };\n })\n .sort((a, b) => {\n if (!shouldUseNormalPriority) {\n if (a.isPointerInElement && b.isPointerInElement)\n return b.depth - a.depth;\n if (a.isPointerInElement !== b.isPointerInElement)\n return a.isPointerInElement ? -1 : 1;\n }\n if (Math.abs(a.overlapPercent - b.overlapPercent) <= 1)\n return a.centerDistance - b.centerDistance;\n return b.overlapPercent - a.overlapPercent;\n });\n\n const allCollidingZones = Array.from(store.visibleZones.value.entries())\n .filter(([node, _]) => {\n if (\n !node ||\n activeDragNodes.some(\n (dragNode) =>\n dragNode &&\n isDescendant(node as HTMLElement, dragNode as HTMLElement)\n )\n )\n return false;\n\n const rect = getBoundingBox(node as HTMLElement);\n return rect && containerRect && checkCollision(rect, containerRect);\n })\n .map(([node, zone]) => {\n const rect = getBoundingBox(node as HTMLElement);\n const zoneCenter = getCenter(rect);\n\n const isPointerInElement =\n pointerX >= rect.x &&\n pointerX <= rect.x + rect.width &&\n pointerY >= rect.y &&\n pointerY <= rect.y + rect.height;\n\n const overlapPercent = getOverlapPercent(rect, containerRect);\n const centerDistance = getDistance(containerCenter, zoneCenter);\n\n // Вычисляем глубину вложенности\n let depth = 0;\n for (const [parentNode, _] of store.visibleZones.value.entries()) {\n if (\n parentNode !== node &&\n parentNode &&\n node &&\n isDescendant(node as HTMLElement, parentNode as HTMLElement)\n ) {\n depth++;\n }\n }\n\n return {\n zone,\n node: node as HTMLElement,\n isPointerInElement,\n overlapPercent,\n depth,\n centerDistance,\n };\n })\n .sort((a, b) => {\n if (!shouldUseNormalPriority) {\n if (a.isPointerInElement && b.isPointerInElement)\n return b.depth - a.depth;\n if (a.isPointerInElement !== b.isPointerInElement)\n return a.isPointerInElement ? -1 : 1;\n }\n if (Math.abs(a.overlapPercent - b.overlapPercent) <= 1)\n return a.centerDistance - b.centerDistance;\n return b.overlapPercent - a.overlapPercent;\n });\n\n return [\n ...allCollidingElements.map((item) => item.node),\n ...allCollidingZones.map((item) => item.node),\n ];\n};\n","import type { Ref } from 'vue';\nimport { getBoundingBox } from '../utils/geometry';\nimport { preventEvent } from '../utils/events';\nimport { useDnDStore } from './useDnDStore';\n\nexport interface IKeyboardOptions {\n moveStep?: number;\n}\n\nexport const useKeyboard = (\n elementRef: Ref<HTMLElement | null>,\n options?: IKeyboardOptions\n) => {\n const { pointerPosition, keyboard } = useDnDStore();\n const moveStep = options?.moveStep || 10;\n\n const onKeyboardStart = (event: KeyboardEvent) => {\n preventEvent(event);\n\n const rect = getBoundingBox(elementRef.value);\n\n elementRef.value?.blur();\n\n const centerX = rect.x + rect.width / 2;\n const centerY = rect.y + rect.height / 2;\n\n pointerPosition.start.value = {\n x: centerX,\n y: centerY,\n };\n\n pointerPosition.current.value = {\n x: centerX,\n y: centerY,\n };\n\n pointerPosition.offset.pixel.value = {\n x: rect.width / 2,\n y: rect.height / 2,\n };\n\n pointerPosition.offset.percent.value = {\n x: 50,\n y: 50,\n };\n };\n\n const onKeyboardMove = () => {\n if (!pointerPosition.current.value) return;\n\n const currentX = pointerPosition.current.value.x;\n const currentY = pointerPosition.current.value.y;\n\n let newX = currentX;\n let newY = currentY;\n\n if (keyboard.w.value) newY -= moveStep;\n if (keyboard.s.value) newY += moveStep;\n if (keyboard.a.value) newX -= moveStep;\n if (keyboard.d.value) newX += moveStep;\n\n pointerPosition.current.value = {\n x: newX,\n y: newY,\n };\n };\n\n const onKeyboardEnd = () => {\n pointerPosition.current.value = null;\n pointerPosition.start.value = null;\n pointerPosition.offset.pixel.value = null;\n pointerPosition.offset.percent.value = null;\n };\n\n return {\n onKeyboardStart,\n onKeyboardMove,\n onKeyboardEnd,\n };\n};\n","import type { Ref } from 'vue';\nimport { getOffset } from '../utils/geometry';\nimport { useDnDStore } from './useDnDStore';\n\nexport const usePointer = (elementRef: Ref<HTMLElement | null>) => {\n const store = useDnDStore();\n\n const onPointerStart = (event: PointerEvent) => {\n store.pointerPosition.start.value = { x: event.clientX, y: event.clientY };\n store.pointerPosition.current.value = {\n x: event.clientX,\n y: event.clientY,\n };\n\n const { pixel, percent } = getOffset(elementRef.value, {\n x: event.clientX,\n y: event.clientY,\n });\n\n store.pointerPosition.offset.pixel.value = pixel;\n store.pointerPosition.offset.percent.value = percent;\n };\n\n const onPointerMove = (event: PointerEvent | WheelEvent) => {\n if (store.isPending.value) return;\n\n store.pointerPosition.current.value = {\n x: event.clientX,\n y: event.clientY,\n };\n };\n\n const onPointerEnd = () => {\n store.pointerPosition.current.value = null;\n store.pointerPosition.start.value = null;\n store.pointerPosition.offset.pixel.value = null;\n store.pointerPosition.offset.percent.value = null;\n };\n\n return {\n onPointerStart,\n onPointerMove,\n onPointerEnd,\n };\n};\n","import type {\n ICollisionDetectionResult,\n IDraggingElement,\n IUseDragOptions,\n} from '../types';\n\nimport type { Ref } from 'vue';\nimport { createPayload } from '../utils/events';\nimport { defaultCollisionDetection } from '../utils/sensor';\nimport { isDescendant } from '../utils/dom';\nimport { useDnDStore } from './useDnDStore';\nimport { useKeyboard } from './useKeyboard';\nimport { usePointer } from './usePointer';\nimport { useThrottleFn } from '@vueuse/core';\n\nexport const useSensor = (\n elementRef: Ref<HTMLElement | null>,\n options?: IUseDragOptions\n) => {\n const store = useDnDStore();\n\n const { onPointerStart, onPointerMove, onPointerEnd } =\n usePointer(elementRef);\n\n const { onKeyboardStart, onKeyboardMove, onKeyboardEnd } = useKeyboard(\n elementRef,\n options?.keyboard\n );\n\n let animationFrameId: number | null = null;\n\n const getDraggingElements = (\n draggableElement: HTMLElement | null\n ): Map<HTMLElement | Element, IDraggingElement> => {\n if (!draggableElement) return new Map();\n\n const isDraggableInSelection =\n store.selectedElements.value.has(draggableElement);\n\n if (store.selectedElements.value.size > 0 && isDraggableInSelection) {\n const result = new Map<HTMLElement | Element, IDraggingElement>();\n\n store.selectedElements.value.forEach((node) => {\n const element = store.elementsMap.value.get(node);\n if (!element) return;\n\n result.set(node, {\n ...element,\n initialHTML: element.node?.outerHTML ?? '',\n initialRect: element.node?.getBoundingClientRect(),\n });\n });\n\n return result;\n }\n\n store.selectedElements.value.clear();\n\n const element = store.elementsMap.value.get(draggableElement);\n if (!element) return new Map();\n\n const result = new Map<HTMLElement | Element, IDraggingElement>();\n\n result.set(draggableElement, {\n ...element,\n initialHTML: element.node?.outerHTML ?? '',\n initialRect: element.node?.getBoundingClientRect(),\n });\n\n return result;\n };\n\n const validateCollisionResults = (\n htmlElements: HTMLElement | HTMLElement[] | Element | Element[] | null\n ) => {\n if (!htmlElements) {\n return { element: null, zone: null };\n }\n\n const elements = Array.isArray(htmlElements)\n ? htmlElements\n : [htmlElements];\n\n const activeDragNodes = Array.from(store.draggingElements.value.keys());\n\n const filteredZoneElement = elements.find((htmlElement) => {\n if (!store.visibleZones.value.has(htmlElement)) return false;\n\n const zone = store.zonesMap.value.get(htmlElement);\n if (!zone) return false;\n\n if (\n activeDragNodes.some(\n (dragNode) =>\n dragNode &&\n (dragNode === zone.node ||\n isDescendant(zone.node as HTMLElement, dragNode as HTMLElement))\n )\n )\n return false;\n\n if (zone.groups.length) {\n const isCompatible = !Array.from(\n store.draggingElements.value.values()\n ).some((element) => {\n if (!element.groups.length) return false;\n return !element.groups.some((group) => zone.groups.includes(group));\n });\n if (!isCompatible) return false;\n }\n\n return true;\n });\n\n if (!filteredZoneElement) {\n return { element: null, zone: null };\n }\n\n const possibleElement = elements.find(\n (htmlElement) =>\n store.visibleElements.value.has(htmlElement) &&\n store.elementsMap.value.has(htmlElement) &&\n !activeDragNodes.some(\n (dragNode) =>\n dragNode &&\n (dragNode === htmlElement ||\n isDescendant(\n htmlElement as HTMLElement,\n dragNode as HTMLElement\n ) ||\n isDescendant(dragNode as HTMLElement, htmlElement as HTMLElement))\n ) &&\n (htmlElement === filteredZoneElement ||\n isDescendant(\n htmlElement as HTMLElement,\n filteredZoneElement as HTMLElement\n ))\n );\n\n return {\n element: possibleElement || null,\n zone: filteredZoneElement,\n };\n };\n\n const detectCollisions = options?.sensor?.setup || defaultCollisionDetection;\n\n const processCollisionResults = (results: ICollisionDetectionResult) => {\n const previousElement = store.hovered.element.value;\n const previousZone = store.hovered.zone.value;\n\n const newElement = results.element;\n const newZone = results.zone;\n\n store.hovered.element.value = newElement;\n store.hovered.zone.value = newZone;\n\n if (previousElement !== newElement) {\n if (previousElement) {\n store.elementsMap.value\n .get(previousElement)\n ?.events?.onLeave?.(store, createPayload(store));\n }\n\n if (newElement) {\n store.elementsMap.value\n .get(newElement)\n ?.events?.onHover?.(store, createPayload(store));\n }\n }\n\n if (previousZone !== newZone) {\n if (previousZone) {\n store.zonesMap.value\n .get(previousZone)\n ?.events?.onLeave?.(store, createPayload(store));\n }\n\n if (newZone) {\n store.zonesMap.value\n .get(newZone)\n ?.events?.onHover?.(store, createPayload(store));\n }\n }\n };\n\n const throttledDetectAndProcess = useThrottleFn(() => {\n const htmlElements = detectCollisions(store);\n const processedResults = validateCollisionResults(htmlElements);\n processCollisionResults(processedResults);\n }, options?.sensor?.throttle ?? 0);\n\n const animationLoop = () => {\n throttledDetectAndProcess();\n\n animationFrameId = requestAnimationFrame(animationLoop);\n };\n\n const startDetection = () => animationLoop();\n\n const stopDetection = () => {\n if (animationFrameId !== null) {\n onPointerEnd();\n onKeyboardEnd();\n cancelAnimationFrame(animationFrameId);\n animationFrameId = null;\n }\n };\n\n const activate = (event: PointerEvent | KeyboardEvent) => {\n store.draggingElements.value = getDraggingElements(elementRef.value);\n store.draggingElements.value.forEach((element) =>\n element.events.onStart?.(store, createPayload(store))\n );\n\n if (event instanceof PointerEvent) {\n onPointerStart(event);\n } else {\n onKeyboardStart(event);\n }\n\n startDetection();\n };\n\n const track = (event: PointerEvent | WheelEvent | KeyboardEvent) => {\n store.draggingElements.value.forEach((element) =>\n element.events.onMove?.(store, createPayload(store))\n );\n\n if (event instanceof KeyboardEvent) {\n onKeyboardMove();\n } else {\n onPointerMove(event);\n }\n };\n\n const deactivate = async (triggerEvents = true) => {\n if (store.hovered.zone.value) {\n const zone = store.zonesMap.value.get(store.hovered.zone.value);\n const result = zone?.events.onDrop?.(store, createPayload(store));\n\n if (result instanceof Promise) {\n try {\n store.isPending.value = true;\n\n const promiseResult = await result;\n\n if (promiseResult) {\n if (triggerEvents) store.selectedElements.value.clear();\n\n store.draggingElements.value.clear();\n\n store.hovered.zone.value = null;\n store.hovered.element.value = null;\n\n stopDetection();\n }\n\n return promiseResult;\n } catch {\n return false;\n } finally {\n store.isPending.value = false;\n }\n } else {\n if (triggerEvents) store.selectedElements.value.clear();\n\n store.draggingElements.value.clear();\n\n store.hovered.zone.value = null;\n store.hovered.element.value = null;\n\n stopDetection();\n }\n } else {\n store.draggingElements.value.forEach((element) =>\n element.events.onEnd?.(store, createPayload(store))\n );\n\n if (triggerEvents) store.selectedElements.value.clear();\n\n store.draggingElements.value.clear();\n\n store.hovered.zone.value = null;\n store.hovered.element.value = null;\n\n stopDetection();\n }\n };\n\n return {\n activate,\n track,\n deactivate,\n };\n};\n","import type { IUseDragOptions } from '../types';\nimport { Ref } from 'vue';\nimport { createGlobalState } from '@vueuse/core';\nimport { preventEvent } from '../utils/events';\nimport { useDnDStore } from '../composables/useDnDStore';\nimport { useSensor } from '../composables/useSensor';\n\nenum EKeyboardKey {\n ESCAPE = 'Escape',\n SPACE = 'Space',\n ENTER = 'Enter',\n W = 'KeyW',\n A = 'KeyA',\n S = 'KeyS',\n D = 'KeyD',\n CONTROL = 'ControlLeft',\n ALT = 'AltLeft',\n SHIFT = 'ShiftLeft',\n META = 'MetaLeft',\n}\n\nexport const useEventManager = createGlobalState(() => {\n let originalUserSelect = '';\n let originalTouchAction = '';\n let originalOverscrollBehavior = '';\n\n let currentMoveHandler: ((event: any) => void) | null = null;\n let currentEndHandler: (() => void) | null = null;\n let currentCancelHandler: (() => void) | null = null;\n let currentScrollHandler: ((event: WheelEvent) => void) | null = null;\n let currentKeyHandler: ((event: KeyboardEvent) => void) | null = null;\n\n const { activeContainer, isPending } = useDnDStore();\n\n const disableInteractions = () => {\n const body = document.body;\n\n originalUserSelect = body.style.userSelect;\n\n body.style.userSelect = 'none';\n\n window.addEventListener('contextmenu', preventEvent);\n window.addEventListener('selectstart', preventEvent);\n window.addEventListener('touchstart', preventEvent);\n window.addEventListener('touchmove', preventEvent);\n };\n\n const enableInteractions = () => {\n const body = document.body;\n\n body.style.userSelect = originalUserSelect;\n body.style.touchAction = originalTouchAction;\n body.style.overscrollBehavior = originalOverscrollBehavior;\n\n window.removeEventListener('contextmenu', preventEvent);\n window.removeEventListener('selectstart', preventEvent);\n window.removeEventListener('touchstart', preventEvent);\n window.removeEventListener('touchmove', preventEvent);\n };\n\n const clearAllListeners = () => {\n if (currentMoveHandler) {\n document.removeEventListener('pointermove', currentMoveHandler);\n currentMoveHandler = null;\n }\n\n if (currentEndHandler) {\n document.removeEventListener('pointerup', currentEndHandler);\n currentEndHandler = null;\n }\n\n if (currentCancelHandler) {\n currentCancelHandler = null;\n }\n\n if (currentScrollHandler) {\n document.removeEventListener('wheel', currentScrollHandler);\n currentScrollHandler = null;\n }\n\n if (currentKeyHandler) {\n document.removeEventListener('keydown', currentKeyHandler);\n document.removeEventListener('keypress', currentKeyHandler);\n document.removeEventListener('keyup', currentKeyHandler);\n currentKeyHandler = null;\n }\n };\n\n const handleDragStart = (\n event: PointerEvent | KeyboardEvent,\n elementRef: Ref<HTMLElement | null>,\n options?: IUseDragOptions\n ) => {\n if (isPending.value) return;\n clearAllListeners();\n\n (event.target as HTMLElement).blur();\n\n if (options?.container) activeContainer.component.value = options.container;\n\n const { activate, track, deactivate } = useSensor(elementRef, options);\n\n currentEndHandler = () => {\n deactivate(true).then((response) => {\n if (response === false) return;\n\n activeContainer.component.value = null;\n enableInteractions();\n deactivate(true);\n clearAllListeners();\n });\n };\n\n currentCancelHandler = () => {\n activeContainer.component.value = null;\n enableInteractions();\n deactivate(false);\n clearAllListeners();\n };\n\n currentMoveHandler = (event: PointerEvent | KeyboardEvent) => track(event);\n currentScrollHandler = (event: WheelEvent) => track(event);\n currentKeyHandler = (event: KeyboardEvent) => {\n if (event.type === 'keyup') {\n if (event.code === EKeyboardKey.ESCAPE) currentCancelHandler?.();\n if (event.code === EKeyboardKey.ENTER) currentEndHandler?.();\n }\n\n track(event);\n };\n\n disableInteractions();\n activate(event);\n\n document.addEventListener('pointermove', currentMoveHandler);\n document.addEventListener('pointerup', currentEndHandler);\n document.addEventListener('wheel', currentScrollHandler);\n document.addEventListener('keydown', currentKeyHandler);\n document.addEventListener('keypress', currentKeyHandler);\n document.addEventListener('keyup', currentKeyHandler);\n };\n\n return {\n handleDragStart,\n };\n});\n","import { onBeforeUnmount, onMounted } from 'vue';\n\nimport type { IUseDragOptions } from '../types';\nimport { useDnDStore } from './useDnDStore';\nimport { useElementManager } from '../managers/useElementManager';\nimport { useEventManager } from '../managers/useEventManager';\n\nexport const useDraggable = (options?: IUseDragOptions) => {\n const {\n id,\n elementRef,\n isDragging,\n isOvered,\n isAllowed,\n isLazyAllowed,\n registerElement,\n unregisterElement,\n } = useElementManager(options);\n\n const { pointerPosition } = useDnDStore();\n const { handleDragStart: start } = useEventManager();\n\n const handleDragStart = (event: PointerEvent | KeyboardEvent) =>\n start(event, elementRef, options);\n\n onMounted(registerElement);\n onBeforeUnmount(unregisterElement);\n\n return {\n pointerPosition,\n elementRef,\n isDragging,\n isOvered,\n isAllowed,\n isLazyAllowed,\n handleDragStart,\n id,\n };\n};\n","import { computed, ref } from 'vue';\n\nimport type { IUseDropOptions } from '../types';\nimport { useDnDStore } from '../composables/useDnDStore';\n\nexport const useZoneManager = (options?: IUseDropOptions) => {\n const {\n zonesMap,\n hovered,\n draggingElements,\n isDragging,\n handleDropZoneIntersection,\n } = useDnDStore();\n\n const elementRef = ref<HTMLElement | null>(null);\n\n const isOvered = computed<boolean>(\n () => hovered.zone.value === elementRef.value\n );\n\n const isAllowed = computed<boolean>(() => {\n if (!elementRef.value || !isDragging.value) return false;\n\n const currentZone = zonesMap.value.get(elementRef.value);\n if (!currentZone?.groups.length) return true;\n\n return !Array.from(draggingElements.value.values()).some((element) => {\n if (!element.groups.length) return false;\n return !element.groups.some((group) =>\n currentZone.groups.includes(group)\n );\n });\n });\n\n const isLazyAllowed = computed<boolean>(() => {\n if (!elementRef.value || !isDragging.value) return false;\n if (hovered.zone.value !== elementRef.value) return false;\n\n const currentZone = zonesMap.value.get(elementRef.value);\n if (!currentZone?.groups.length) return true;\n\n return !Array.from(draggingElements.value.values()).some((element) => {\n return !element.groups.some((group) =>\n currentZone.groups.includes(group)\n );\n });\n });\n\n const registerZone = () => {\n if (!elementRef.value) throw new Error('elementRef is not set');\n\n handleDropZoneIntersection('add', elementRef.value);\n\n zonesMap.value.set(elementRef.value, {\n node: elementRef.value,\n groups: options?.groups ?? [],\n events: options?.events ?? {},\n data: options?.data ?? undefined,\n });\n\n elementRef.value.setAttribute('data-dnd-droppable', 'true');\n };\n\n const unregisterZone = () => {\n if (!elementRef.value) return;\n\n handleDropZoneIntersection('remove', elementRef.value);\n\n zonesMap.value.delete(elementRef.value);\n };\n\n return {\n elementRef,\n registerZone,\n unregisterZone,\n isOvered,\n isAllowed,\n isLazyAllowed,\n };\n};\n","import { onBeforeUnmount, onMounted } from 'vue';\n\nimport type { IUseDropOptions } from '../types';\nimport { useZoneManager } from '../managers/useZoneManager';\n\nexport const useDroppable = (options?: IUseDropOptions) => {\n const {\n elementRef,\n registerZone,\n unregisterZone,\n isOvered,\n isAllowed,\n isLazyAllowed,\n } = useZoneManager(options);\n\n // Register/unregister drop zone with store\n onMounted(registerZone);\n onBeforeUnmount(unregisterZone);\n\n return { elementRef, isOvered, isAllowed, isLazyAllowed };\n};\n","import { computed, type Ref } from 'vue';\nimport { useDnDStore } from './useDnDStore';\nimport { isDescendant } from '../utils/dom';\n\nexport const useSelection = (elementRef: Ref<HTMLElement | null>) => {\n const { selectedElements, elementsMap } = useDnDStore();\n\n const isSelected = computed<boolean>(() =>\n elementRef.value ? selectedElements.value.has(elementRef.value) : false\n );\n\n const isParentOfSelected = computed(() => {\n if (!elementRef.value) return false;\n\n for (const node of selectedElements.value) {\n if (\n node &&\n isDescendant(node as HTMLElement, elementRef.value as HTMLElement)\n ) {\n return true;\n }\n }\n return false;\n });\n\n const hasSelectedParent = computed(() => {\n if (!elementRef.value) return false;\n\n for (const node of selectedElements.value) {\n if (\n node &&\n isDescendant(elementRef.value as HTMLElement, node as HTMLElement)\n ) {\n return true;\n }\n }\n return false;\n });\n\n const handleUnselect = () => {\n if (!elementRef.value) return;\n selectedElements.value.delete(elementRef.value);\n };\n\n const handleSelect = () => {\n if (!elementRef.value) return;\n const element = elementsMap.value.get(elementRef.value);\n if (!element) return;\n\n if (isParentOfSelected.value) {\n // Удаляем все дочерние выбранные элементы\n for (const node of selectedElements.value) {\n if (\n node &&\n isDescendant(node as HTMLElement, elementRef.value as HTMLElement)\n ) {\n selectedElements.value.delete(node);\n }\n }\n }\n\n if (hasSelectedParent.value) {\n // Удаляем все родительские выбранные элементы\n for (const node of selectedElements.value) {\n if (\n node &&\n isDescendant(elementRef.value as HTMLElement, node as HTMLElement)\n ) {\n selectedElements.value.delete(node);\n }\n }\n }\n\n selectedElements.value.add(elementRef.value);\n };\n\n const handleToggleSelect = () => {\n if (!elementRef.value) return;\n\n selectedElements.value.has(elementRef.value)\n ? handleUnselect()\n : handleSelect();\n };\n\n return {\n handleUnselect,\n handleSelect,\n handleToggleSelect,\n isSelected,\n isParentOfSelected,\n };\n};\n"],"names":["_DnDOperations","__publicField","source","index","item","target","sourceIndex","targetIndex","sourceItem","targetItem","store","hoveredElement","hoveredZone","targetSource","_b","_a","_d","_c","firstElement","firstIndex","_e","sortDirection","a","b","element","_g","_f","_h","items","DnDOperations","useDnDStore","createGlobalState","isPending","shallowRef","draggingElements","ref","isDragging","computed","activeContainer","elementsMap","selectedElements","zonesMap","visibleZones","visibleElements","hasIntersectionObserver","elementObserver","entries","entry","zoneObserver","handleDragElementIntersection","action","handleDropZoneIntersection","pointerPosition","w","s","d","ctrl","shift","alt","meta","useMagicKeys","hovered","useDragContainer","options","elementRef","onMounted","onUnmounted","computedStyle","__props","props","overlay","DefaultOverlay","VueDndKitPlugin","app","DragOverlay","originalMount","rootContainer","instance","rootEl","overlayContainer","vnode","createVNode","render","originalUnmount","checkCollision","boxA","boxB","getBoundingBox","rect","getCenter","box","getOffset","pointer","getDistance","pointA","pointB","dx","dy","getOverlapPercent","xOverlap","yOverlap","overlapArea","boxAArea","boxBArea","draggableDataName","preventEvent","event","createPayload","useElementManager","isDragStarted","isOvered","id","useId","isAllowed","currentElement","_","draggingElement","group","isLazyAllowed","isDescendant","container","defaultCollisionDetection","containerRect","containerCenter","pointerX","pointerY","shouldUseNormalPriority","activeDragNodes","allCollidingElements","node","elementCenter","isPointerInElement","overlapPercent","centerDistance","depth","parentNode","allCollidingZones","dragNode","zone","zoneCenter","useKeyboard","keyboard","moveStep","centerX","centerY","currentX","currentY","newX","newY","usePointer","pixel","percent","useSensor","onPointerStart","onPointerMove","onPointerEnd","onKeyboardStart","onKeyboardMove","onKeyboardEnd","animationFrameId","getDraggingElements","draggableElement","isDraggableInSelection","result","validateCollisionResults","htmlElements","elements","filteredZoneElement","htmlElement","detectCollisions","processCollisionResults","results","previousElement","previousZone","newElement","newZone","_i","_l","_k","_j","throttledDetectAndProcess","useThrottleFn","processedResults","animationLoop","startDetection","stopDetection","triggerEvents","promiseResult","useEventManager","originalUserSelect","originalTouchAction","originalOverscrollBehavior","currentMoveHandler","currentEndHandler","currentCancelHandler","currentScrollHandler","currentKeyHandler","disableInteractions","body","enableInteractions","clearAllListeners","activate","track","deactivate","response","useDraggable","registerElement","unregisterElement","start","handleDragStart","onBeforeUnmount","useZoneManager","currentZone","useDroppable","registerZone","unregisterZone","useSelection","isSelected","isParentOfSelected","hasSelectedParent","handleUnselect","handleSel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