@dnd-kit/core
Advanced tools
Comparing version 5.0.0-next-202209174015 to 5.0.0-next-202209232458
# @dnd-kit/core | ||
## 5.0.0-next-202209174015 | ||
## 5.0.0-next-202209232458 | ||
@@ -44,2 +44,12 @@ ### Major Changes | ||
Consumers can also access the array of collisions in components wrapped by `<DndContext>` via the `useDndContext()` hook: | ||
```ts | ||
import {useDndContext} from '@dnd-kit/core'; | ||
function MyComponent() { | ||
const {collisions} = useDndContext(); | ||
} | ||
``` | ||
- [#561](https://github.com/clauderic/dnd-kit/pull/561) [`02edd26`](https://github.com/clauderic/dnd-kit/commit/02edd2691b24bb49f2e7c9f9a3f282031bf658b7) Thanks [@clauderic](https://github.com/clauderic)! - Droppable containers now observe the node they are attached to via `setNodeRef` using `ResizeObserver` while dragging. | ||
@@ -94,2 +104,22 @@ | ||
- [#569](https://github.com/clauderic/dnd-kit/pull/569) [`e7ac3d4`](https://github.com/clauderic/dnd-kit/commit/e7ac3d45699dcc7b47191a67044a516929ac439c) Thanks [@clauderic](https://github.com/clauderic)! - Separated context into public and internal context providers. Certain properties that used to be available on the public `DndContextDescriptor` interface have been moved to the internal context provider and are no longer exposed to consumers: | ||
```ts | ||
interface DndContextDescriptor { | ||
- dispatch: React.Dispatch<Actions>; | ||
- activators: SyntheticListeners; | ||
- ariaDescribedById: { | ||
- draggable: UniqueIdentifier; | ||
- }; | ||
} | ||
``` | ||
Having two distinct context providers will allow to keep certain internals such as `dispatch` hidden from consumers. | ||
It also serves as an optimization until context selectors are implemented in React, properties that change often, such as the droppable containers and droppable rects, the transform value and array of collisions should be stored on a different context provider to limit un-necessary re-renders in `useDraggable`, `useDroppable` and `useSortable`. | ||
The `<InternalContext.Provider>` is also reset to its default values within `<DragOverlay>`. This paves the way towards being able to seamlessly use components that use hooks such as `useDraggable` and `useDroppable` as children of `<DragOverlay>` without causing interference or namespace collisions. | ||
Consumers can still make calls to `useDndContext()` to get the `active` or `over` properties if they wish to re-render the component rendered within `DragOverlay` in response to user interaction, since those use the `PublicContext` | ||
### Minor Changes | ||
@@ -103,3 +133,3 @@ | ||
- Updated dependencies [[`6310227`](https://github.com/clauderic/dnd-kit/commit/63102272d0d63dae349e2e9f638277e16a7d5970), [`528c67e`](https://github.com/clauderic/dnd-kit/commit/528c67e4c617dfc0ce5221496aa8b222ffc82ddb), [`02edd26`](https://github.com/clauderic/dnd-kit/commit/02edd2691b24bb49f2e7c9f9a3f282031bf658b7)]: | ||
- @dnd-kit/utilities@3.1.0-next-202209174015 | ||
- @dnd-kit/utilities@3.1.0-next-202209232458 | ||
@@ -106,0 +136,0 @@ ## 4.0.3 |
@@ -16,3 +16,3 @@ import React from 'react'; | ||
} | ||
export declare const DragOverlay: React.MemoExoticComponent<({ adjustScale, children, dropAnimation, style: styleProp, transition, modifiers, wrapperElement, className, zIndex, }: Props) => React.DOMElement<React.DOMAttributes<HTMLElement>, HTMLElement> | null>; | ||
export declare const DragOverlay: React.MemoExoticComponent<({ adjustScale, children, dropAnimation, style: styleProp, transition, modifiers, wrapperElement, className, zIndex, }: Props) => JSX.Element | null>; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-dom"),o=require("@dnd-kit/utilities"),i=require("@dnd-kit/accessibility");const s={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},a={onDragStart:e=>`Picked up draggable item ${e}.`,onDragOver:(e,t)=>t?`Draggable item ${e} was moved over droppable area ${t}.`:`Draggable item ${e} is no longer over a droppable area.`,onDragEnd:(e,t)=>t?`Draggable item ${e} was dropped over droppable area ${t}`:`Draggable item ${e} was dropped.`,onDragCancel:e=>`Dragging was cancelled. Draggable item ${e} was dropped.`};var l;function c(...e){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(l||(l={}));class d extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(({disabled:e})=>!e)}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const u=t.createContext({activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,activators:[],ariaDescribedById:{draggable:""},collisions:null,containerNodeRect:null,dispatch:c,draggableNodes:{},droppableRects:new Map,droppableContainers:new d,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:c},scrollableAncestors:[],scrollableAncestorRects:[],measureDroppableContainers:c,windowRect:null,measuringScheduled:!1});function h(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:{},translate:{x:0,y:0}},droppable:{containers:new d}}}function p(e,t){switch(t.type){case l.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case l.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case l.DragEnd:case l.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case l.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new d(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case l.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new d(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case l.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new d(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}const g=t.createContext({type:null,event:null});function v({onDragStart:e,onDragMove:n,onDragOver:r,onDragEnd:o,onDragCancel:i}){const s=t.useContext(g),a=t.useRef(s);t.useEffect(()=>{if(s!==a.current){const{type:t,event:c}=s;switch(t){case l.DragStart:null==e||e(c);break;case l.DragMove:null==n||n(c);break;case l.DragOver:null==r||r(c);break;case l.DragCancel:null==i||i(c);break;case l.DragEnd:null==o||o(c)}a.current=s}},[s,e,n,r,o,i])}function f({announcements:e=a,hiddenTextDescribedById:s,screenReaderInstructions:l}){const{announce:c,announcement:d}=i.useAnnouncement(),u=o.useUniqueId("DndLiveRegion"),[h,p]=t.useState(!1);return t.useEffect(()=>{p(!0)},[]),v(t.useMemo(()=>({onDragStart({active:t}){c(e.onDragStart(t.id))},onDragMove({active:t,over:n}){e.onDragMove&&c(e.onDragMove(t.id,null==n?void 0:n.id))},onDragOver({active:t,over:n}){c(e.onDragOver(t.id,null==n?void 0:n.id))},onDragEnd({active:t,over:n}){c(e.onDragEnd(t.id,null==n?void 0:n.id))},onDragCancel({active:t}){c(e.onDragCancel(t.id))}}),[c,e])),h?r.createPortal(n.createElement(n.Fragment,null,n.createElement(i.HiddenText,{id:s,value:l.draggable}),n.createElement(i.LiveRegion,{id:u,announcement:d})),document.body):null}const b=Object.freeze({x:0,y:0});function m(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function y(e,t){const n=o.getEventCoordinates(e);return n?`${(n.x-t.left)/t.width*100}% ${(n.y-t.top)/t.height*100}%`:"0 0"}function x({data:{value:e}},{data:{value:t}}){return e-t}function w({data:{value:e}},{data:{value:t}}){return t-e}function C({left:e,top:t,height:n,width:r}){return[{x:e,y:t},{x:e+r,y:t},{x:e,y:t+n},{x:e+r,y:t+n}]}function D(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function R(e,t=e.left,n=e.top){return{x:t+.5*e.width,y:n+.5*e.height}}function E(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height);if(r<o&&n<i){const s=(o-r)*(i-n);return Number((s/(t.width*t.height+e.width*e.height-s)).toFixed(4))}return 0}const S=({collisionRect:e,droppableContainers:t})=>{const n=[];for(const r of t){const{id:t,rect:{current:o}}=r;if(o){const i=E(o,e);i>0&&n.push({id:t,data:{droppableContainer:r,value:i}})}}return n.sort(w)};function M(e,t){const{top:n,left:r,bottom:o,right:i}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=i}function L(e){return function(t,...n){return n.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const A=L(1),N={ignoreTransform:!1};function O(e,t=N){let n=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:t}=o.getWindow(e),{transform:r,transformOrigin:i}=t(e);r&&(n=function(e,t,n){let r,o,i,s,a;if(t.startsWith("matrix3d("))r=t.slice(9,-1).split(/, /),o=+r[0],i=+r[5],s=+r[12],a=+r[13];else{if(!t.startsWith("matrix("))return e;r=t.slice(7,-1).split(/, /),o=+r[0],i=+r[3],s=+r[4],a=+r[5]}const l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(n,r,i))}const{top:r,left:i,width:s,height:a,bottom:l,right:c}=n;return{top:r,left:i,width:s,height:a,bottom:l,right:c}}function T(e){return O(e,{ignoreTransform:!0})}function k(e){const t=[];return e?function n(r){if(!r)return t;if(o.isDocument(r)&&null!=r.scrollingElement&&!t.includes(r.scrollingElement))return t.push(r.scrollingElement),t;if(!o.isHTMLElement(r)||o.isSVGElement(r))return t;if(t.includes(r))return t;const{getComputedStyle:i}=o.getWindow(r),s=i(r);return r!==e&&function(e,t=o.getWindow(e).getComputedStyle(e)){const n=/(auto|scroll|overlay)/;return null!=["overflow","overflowX","overflowY"].find(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(r,s)&&t.push(r),function(e,t=o.getWindow(e).getComputedStyle(e)){return"fixed"===t.position}(r,s)?t:n(r.parentNode)}(e):t}function K(e){return o.canUseDOM&&e?o.isWindow(e)?e:o.isNode(e)?o.isDocument(e)||e===o.getOwnerDocument(e).scrollingElement?window:o.isHTMLElement(e)?e:null:null:null}function I(e){return o.isWindow(e)?e.scrollX:e.scrollLeft}function B(e){return o.isWindow(e)?e.scrollY:e.scrollTop}function W(e){return{x:I(e),y:B(e)}}var z;function P(e){const t={x:0,y:0},n={x:e.scrollWidth-e.clientWidth,y:e.scrollHeight-e.clientHeight};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(z||(z={}));const U={x:.2,y:.2};function F(e,t,{top:n,left:r,right:i,bottom:s},a=10,l=U){const{clientHeight:c,clientWidth:d}=e,u=(h=e,o.canUseDOM&&h&&h===document.scrollingElement?{top:0,left:0,right:d,bottom:c,width:d,height:c}:t);var h;const{isTop:p,isBottom:g,isLeft:v,isRight:f}=P(e),b={x:0,y:0},m={x:0,y:0},y=u.height*l.y,x=u.width*l.x;return!p&&n<=u.top+y?(b.y=z.Backward,m.y=a*Math.abs((u.top+y-n)/y)):!g&&s>=u.bottom-y&&(b.y=z.Forward,m.y=a*Math.abs((u.bottom-y-s)/y)),!f&&i>=u.right-x?(b.x=z.Forward,m.x=a*Math.abs((u.right-x-i)/x)):!v&&r<=u.left+x&&(b.x=z.Backward,m.x=a*Math.abs((u.left+x-r)/x)),{direction:b,speed:m}}function q(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function j(e){return e.reduce((e,t)=>o.add(e,W(t)),b)}const H=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+I(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+B(t),0)}]];class ${constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=k(t),r=j(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of H)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n);return this.rect[i]+(r[e]-t)},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}var V,X,Y;(V=exports.AutoScrollActivator||(exports.AutoScrollActivator={}))[V.Pointer=0]="Pointer",V[V.DraggableRect=1]="DraggableRect",(X=exports.TraversalOrder||(exports.TraversalOrder={}))[X.TreeOrder=0]="TreeOrder",X[X.ReversedTreeOrder=1]="ReversedTreeOrder",(Y=exports.MeasuringStrategy||(exports.MeasuringStrategy={}))[Y.Always=0]="Always",Y[Y.BeforeDragging=1]="BeforeDragging",Y[Y.WhileDragging=2]="WhileDragging",(exports.MeasuringFrequency||(exports.MeasuringFrequency={})).Optimized="optimized";const _=new Map,G={measure:T,strategy:exports.MeasuringStrategy.WhileDragging,frequency:exports.MeasuringFrequency.Optimized},J=[],Q=te(T),Z=ne(T);function ee(e,n,r){const i=t.useRef(e);return o.useLazyMemo(t=>e?r||!t&&e||e!==i.current?o.isHTMLElement(e)&&null==e.parentNode?null:new $(n(e),e):null!=t?t:null:null,[e,r,n])}function te(e){return(t,n)=>ee(t,e,n)}function ne(e){const n=[];return function(r,i){const s=t.useRef(r);return o.useLazyMemo(t=>r.length?i||!t&&r.length||r!==s.current?r.map(t=>new $(e(t),t)):null!=t?t:n:n,[r,i])}}function re(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return o.isHTMLElement(t)?t:e}class oe{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ie(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var se,ae;function le(e){e.preventDefault()}function ce(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(se||(se={})),(ae=exports.KeyboardCode||(exports.KeyboardCode={})).Space="Space",ae.Down="ArrowDown",ae.Right="ArrowRight",ae.Left="ArrowLeft",ae.Up="ArrowUp",ae.Esc="Escape",ae.Enter="Enter";const de={start:[exports.KeyboardCode.Space,exports.KeyboardCode.Enter],cancel:[exports.KeyboardCode.Esc],end:[exports.KeyboardCode.Space,exports.KeyboardCode.Enter]},ue=(e,{currentCoordinates:t})=>{switch(e.code){case exports.KeyboardCode.Right:return{...t,x:t.x+25};case exports.KeyboardCode.Left:return{...t,x:t.x-25};case exports.KeyboardCode.Down:return{...t,y:t.y+25};case exports.KeyboardCode.Up:return{...t,y:t.y-25}}};class he{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.coordinates=b,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new oe(o.getOwnerDocument(t)),this.windowListeners=new oe(o.getWindow(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(se.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props;if(!e.node.current)throw new Error("Active draggable node is undefined");const n=T(e.node.current),r={x:n.left,y:n.top};this.coordinates=r,t(r)}handleKeyDown(e){if(o.isKeyboardEvent(e)){const{coordinates:t}=this,{active:n,context:r,options:i}=this.props,{keyboardCodes:s=de,coordinateGetter:a=ue,scrollBehavior:l="smooth"}=i,{code:c}=e;if(s.end.includes(c))return void this.handleEnd(e);if(s.cancel.includes(c))return void this.handleCancel(e);const d=a(e,{active:n,context:r.current,currentCoordinates:t});if(d){const n={x:0,y:0},{scrollableAncestors:i}=r.current;for(const r of i){const i=e.code,s=o.subtract(d,t),{isTop:a,isRight:c,isLeft:u,isBottom:h,maxScroll:p,minScroll:g}=P(r),v=q(r),f={x:Math.min(i===exports.KeyboardCode.Right?v.right-v.width/2:v.right,Math.max(i===exports.KeyboardCode.Right?v.left:v.left+v.width/2,d.x)),y:Math.min(i===exports.KeyboardCode.Down?v.bottom-v.height/2:v.bottom,Math.max(i===exports.KeyboardCode.Down?v.top:v.top+v.height/2,d.y))},b=i===exports.KeyboardCode.Right&&!c||i===exports.KeyboardCode.Left&&!u,m=i===exports.KeyboardCode.Down&&!h||i===exports.KeyboardCode.Up&&!a;if(b&&f.x!==d.x){if(i===exports.KeyboardCode.Right&&r.scrollLeft+s.x<=p.x||i===exports.KeyboardCode.Left&&r.scrollLeft+s.x>=g.x)return void r.scrollBy({left:s.x,behavior:l});n.x=i===exports.KeyboardCode.Right?r.scrollLeft-p.x:r.scrollLeft-g.x,r.scrollBy({left:-n.x,behavior:l});break}if(m&&f.y!==d.y){if(i===exports.KeyboardCode.Down&&r.scrollTop+s.y<=p.y||i===exports.KeyboardCode.Up&&r.scrollTop+s.y>=g.y)return void r.scrollBy({top:s.y,behavior:l});n.y=i===exports.KeyboardCode.Down?r.scrollTop-p.y:r.scrollTop-g.y,r.scrollBy({top:-n.y,behavior:l});break}}this.handleMove(e,o.add(d,n))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t),this.coordinates=t}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function pe(e){return Boolean(e&&"distance"in e)}function ge(e){return Boolean(e&&"delay"in e)}he.activators=[{eventName:"onKeyDown",handler:(e,{keyboardCodes:t=de,onActivation:n})=>{const{code:r}=e.nativeEvent;return!!t.start.includes(r)&&(e.preventDefault(),null==n||n({event:e.nativeEvent}),!0)}}];class ve{constructor(e,t,n=function(e){const{EventTarget:t}=o.getWindow(e);return e instanceof t?e:o.getOwnerDocument(e)}(e.event.target)){var r;this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:i}=e,{target:s}=i;this.props=e,this.events=t,this.document=o.getOwnerDocument(s),this.documentListeners=new oe(this.document),this.listeners=new oe(n),this.windowListeners=new oe(o.getWindow(s)),this.initialCoordinates=null!=(r=o.getEventCoordinates(i))?r:b,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.DragStart,le),this.windowListeners.add(se.VisibilityChange,this.handleCancel),this.windowListeners.add(se.ContextMenu,le),this.documentListeners.add(se.Keydown,this.handleKeydown),t){if(pe(t))return;if(ge(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(se.Click,ce,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(se.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!r)return;const l=null!=(t=o.getEventCoordinates(e))?t:b,c=o.subtract(r,l);if(!n&&a){if(ge(a))return ie(c,a.tolerance)?this.handleCancel():void 0;if(pe(a))return null!=a.tolerance&&ie(c,a.tolerance)?this.handleCancel():ie(c,a.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),s(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===exports.KeyboardCode.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const fe={move:{name:"pointermove"},end:{name:"pointerup"}};class be extends ve{constructor(e){const{event:t}=e,n=o.getOwnerDocument(t.target);super(e,fe,n)}}be.activators=[{eventName:"onPointerDown",handler:({nativeEvent:e},{onActivation:t})=>!(!e.isPrimary||0!==e.button||(null==t||t({event:e}),0))}];const me={move:{name:"mousemove"},end:{name:"mouseup"}};var ye;!function(e){e[e.RightClick=2]="RightClick"}(ye||(ye={}));class xe extends ve{constructor(e){super(e,me,o.getOwnerDocument(e.event.target))}}xe.activators=[{eventName:"onMouseDown",handler:({nativeEvent:e},{onActivation:t})=>e.button!==ye.RightClick&&(null==t||t({event:e}),!0)}];const we={move:{name:"touchmove"},end:{name:"touchend"}};class Ce extends ve{constructor(e){super(e,we)}static setup(){return window.addEventListener(we.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(we.move.name,e)};function e(){}}}function De(e,{transform:t,...n}){return(null==e?void 0:e.length)?e.reduce((e,t)=>t({transform:e,...n}),t):t}Ce.activators=[{eventName:"onTouchStart",handler:({nativeEvent:e},{onActivation:t})=>{const{touches:n}=e;return!(n.length>1||(null==t||t({event:e}),0))}}];const Re=[{sensor:be,options:{}},{sensor:he,options:{}}],Ee={current:{}},Se=t.createContext({...b,scaleX:1,scaleY:1}),Me=t.memo((function({id:e,autoScroll:i=!0,announcements:a,children:c,sensors:d=Re,collisionDetection:v=S,measuring:m,modifiers:y,screenReaderInstructions:x=s,...w}){var C,R,E,M,L,N,I;const B=t.useReducer(p,void 0,h),[z,P]=B,[U,q]=t.useState(()=>({type:null,event:null})),[H,V]=t.useState(!1),{draggable:{active:X,nodes:Y,translate:te},droppable:{containers:ne}}=z,oe=X?Y[X]:null,ie=t.useRef({initial:null,translated:null}),se=t.useMemo(()=>{var e;return null!=X?{id:X,data:null!=(e=null==oe?void 0:oe.data)?e:Ee,rect:ie}:null},[X,oe]),ae=t.useRef(null),[le,ce]=t.useState(null),[de,ue]=t.useState(null),he=t.useRef(w),pe=o.useUniqueId("DndDescribedBy",e),ge=t.useMemo(()=>ne.getEnabled(),[ne]),{droppableRects:ve,measureDroppableContainers:fe,measuringScheduled:be}=function(e,{dragging:n,dependencies:r,config:i}){const[s,a]=t.useState(null),l=null!=s,{frequency:c,measure:d,strategy:u}={...G,...i},h=t.useRef(e),p=t.useCallback((e=[])=>a(t=>t?t.concat(e):e),[]),g=t.useRef(null),v=function(){switch(u){case exports.MeasuringStrategy.Always:return!1;case exports.MeasuringStrategy.BeforeDragging:return n;default:return!n}}(),f=o.useLazyMemo(t=>{if(v&&!n)return _;const r=s;if(!t||t===_||h.current!==e||null!=r){const t=new Map;for(let n of e){if(!n)continue;if(r&&r.length>0&&!r.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new $(d(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t},[e,s,n,v,d]);return t.useEffect(()=>{h.current=e},[e]),t.useEffect(()=>{v||requestAnimationFrame(()=>p())},[n,v]),t.useEffect(()=>{l&&a(null)},[l]),t.useEffect(()=>{v||"number"!=typeof c||null!==g.current||(g.current=setTimeout(()=>{p(),g.current=null},c))},[c,v,p,...r]),{droppableRects:f,measureDroppableContainers:p,measuringScheduled:l}}(ge,{dragging:H,dependencies:[te.x,te.y],config:null==m?void 0:m.droppable}),me=function(e,t){const n=null!==t?e[t]:void 0,r=n?n.node.current:null;return o.useLazyMemo(e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(Y,X),ye=de?o.getEventCoordinates(de):null,xe=ee(me,null!=(C=null==m||null==(R=m.draggable)?void 0:R.measure)?C:T),we=Q(me?me.parentElement:null),Ce=t.useRef({active:null,activeNode:me,collisionRect:null,collisions:null,droppableRects:ve,draggableNodes:Y,draggingNode:null,draggingNodeRect:null,droppableContainers:ne,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Me=ne.getNodeFor(null==(E=Ce.current.over)?void 0:E.id),Le=function({measure:e=O}){const[n,r]=t.useState(null),i=t.useRef(e),s=t.useCallback(t=>{for(const{target:n}of t)if(o.isHTMLElement(n)){r(t=>{const r=e(n);return t?{...t,width:r.width,height:r.height}:r});break}},[e]),a=t.useMemo(()=>new ResizeObserver(s),[s]),l=t.useCallback(t=>{const n=re(t);a.disconnect(),n&&a.observe(n),r(n?e(n):null)},[e,a]),[c,d]=o.useNodeRef(l);return o.useIsomorphicLayoutEffect(()=>{i.current=e},[e]),t.useMemo(()=>({nodeRef:c,rect:n,setRef:d}),[n,c,d])}({measure:null==m||null==(M=m.dragOverlay)?void 0:M.measure}),Ae=null!=(L=Le.nodeRef.current)?L:me,Ne=null!=(N=Le.rect)?N:xe,Oe=t.useRef(null),Te=Ne===xe?(Ke=Oe.current,(ke=xe)&&Ke?{x:ke.left-Ke.left,y:ke.top-Ke.top}:b):b;var ke,Ke;const Ie=t.useMemo(()=>Be?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(Be):null,[Be=Ae?Ae.ownerDocument.defaultView:null]);var Be;const We=function(e){const n=t.useRef(e),r=o.useLazyMemo(t=>e?t&&e&&n.current&&e.parentNode===n.current.parentNode?t:k(e):J,[e]);return t.useEffect(()=>{n.current=e},[e]),r}(X?null!=Me?Me:Ae:null),ze=Z(We),Pe=De(y,{transform:{x:te.x-Te.x,y:te.y-Te.y,scaleX:1,scaleY:1},activatorEvent:de,active:se,activeNodeRect:xe,containerNodeRect:we,draggingNodeRect:Ne,over:Ce.current.over,overlayNodeRect:Le.rect,scrollableAncestors:We,scrollableAncestorRects:ze,windowRect:Ie}),Ue=ye?o.add(ye,te):null,Fe=function(e){const[n,r]=t.useState(null),i=t.useRef(e),s=t.useCallback(e=>{const t=K(e.target);t&&r(e=>e?(e.set(t,W(t)),new Map(e)):null)},[]);return t.useEffect(()=>{const t=i.current;if(e!==t){n(t);const o=e.map(e=>{const t=K(e);return t?(t.addEventListener("scroll",s,{passive:!0}),[t,W(t)]):null}).filter(e=>null!=e);r(o.length?new Map(o):null),i.current=e}return()=>{n(e),n(t)};function n(e){e.forEach(e=>{const t=K(e);null==t||t.removeEventListener("scroll",s)})}},[s,e]),t.useMemo(()=>e.length?n?Array.from(n.values()).reduce((e,t)=>o.add(e,t),b):j(e):b,[e,n])}(We),qe=o.add(Pe,Fe),je=Ne?A(Ne,Pe):null,He=se&&je?v({active:se,collisionRect:je,droppableContainers:ge,pointerCoordinates:Ue}):null,$e=D(He,"id"),[Ve,Xe]=t.useState(null),Ye=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Pe,null!=(I=null==Ve?void 0:Ve.rect)?I:null,xe),_e=t.useCallback((e,{sensor:t,options:n})=>{if(!ae.current)return;const o=Y[ae.current];if(!o)return;const i=new t({active:ae.current,activeNode:o,event:e.nativeEvent,options:n,context:Ce,onStart(e){const t=ae.current;if(!t)return;const n=Y[t];if(!n)return;const{onDragStart:o}=he.current,i={active:{id:t,data:n.data,rect:ie}};r.unstable_batchedUpdates(()=>{P({type:l.DragStart,initialCoordinates:e,active:t}),q({type:l.DragStart,event:i})}),null==o||o(i)},onMove(e){P({type:l.DragMove,coordinates:e})},onEnd:s(l.DragEnd),onCancel:s(l.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:i}=Ce.current;let s=null;if(t&&i){const{cancelDrop:r}=he.current;s={active:t,collisions:n,delta:i,over:o},e===l.DragEnd&&"function"==typeof r&&await Promise.resolve(r(s))&&(e=l.DragCancel)}ae.current=null,r.unstable_batchedUpdates(()=>{if(P({type:e}),Xe(null),V(!1),ce(null),ue(null),s&&q({type:e,event:s}),s){const{onDragCancel:t,onDragEnd:n}=he.current,r=e===l.DragEnd?n:t;null==r||r(s)}})}}r.unstable_batchedUpdates(()=>{ce(i),ue(e.nativeEvent)})},[P,Y]),Ge=function(e,n){return t.useMemo(()=>e.reduce((e,t)=>{const{sensor:r}=t;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:n(e.handler,t)}))]},[]),[e,n])}(d,t.useCallback((e,t)=>(n,r)=>{const o=n.nativeEvent;null!==ae.current||o.dndKit||o.defaultPrevented||!0===e(n,t.options)&&(o.dndKit={capturedBy:t.sensor},ae.current=r,_e(n,t))},[_e]));!function(e){t.useEffect(()=>{if(!o.canUseDOM)return;const t=e.map(({sensor:e})=>null==e.setup?void 0:e.setup());return()=>{for(const e of t)null==e||e()}},e.map(({sensor:e})=>e))}(d),o.useIsomorphicLayoutEffect(()=>{he.current=w},Object.values(w)),t.useEffect(()=>{null!=X&&V(!0)},[X]),t.useEffect(()=>{se||(Oe.current=null),se&&xe&&!Oe.current&&(Oe.current=xe)},[xe,se]),t.useEffect(()=>{const{onDragMove:e}=he.current,{active:t,collisions:n,over:r}=Ce.current;if(!t)return;const o={active:t,collisions:n,delta:{x:qe.x,y:qe.y},over:r};q({type:l.DragMove,event:o}),null==e||e(o)},[qe.x,qe.y]),t.useEffect(()=>{const{active:e,collisions:t,droppableContainers:n,scrollAdjustedTranslate:o}=Ce.current;if(!e||!ae.current||!o)return;const{onDragOver:i}=he.current,s=n.get($e),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,c={active:e,collisions:t,delta:{x:o.x,y:o.y},over:a};r.unstable_batchedUpdates(()=>{Xe(a),q({type:l.DragOver,event:c}),null==i||i(c)})},[$e]),o.useIsomorphicLayoutEffect(()=>{Ce.current={active:se,activeNode:me,collisionRect:je,collisions:He,droppableRects:ve,draggableNodes:Y,draggingNode:Ae,draggingNodeRect:Ne,droppableContainers:ne,over:Ve,scrollableAncestors:We,scrollAdjustedTranslate:qe},ie.current={initial:Ne,translated:je}},[se,me,He,je,Y,Ae,Ne,ve,ne,Ve,We,qe]),function({acceleration:e,activator:n=exports.AutoScrollActivator.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:a=5,order:l=exports.TraversalOrder.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,threshold:h}){const[p,g]=o.useInterval(),v=t.useRef({x:1,y:1}),f=t.useMemo(()=>{switch(n){case exports.AutoScrollActivator.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case exports.AutoScrollActivator.DraggableRect:return i}return null},[n,i,c]),m=t.useRef(b),y=t.useRef(null),x=t.useCallback(()=>{const e=y.current;e&&e.scrollBy(v.current.x*m.current.x,v.current.y*m.current.y)},[]),w=t.useMemo(()=>l===exports.TraversalOrder.TreeOrder?[...d].reverse():d,[l,d]);t.useEffect(()=>{if(s&&d.length&&f){for(const t of w){if(!1===(null==r?void 0:r(t)))continue;const n=d.indexOf(t),o=u[n];if(!o)continue;const{direction:i,speed:s}=F(t,o,f,e,h);if(s.x>0||s.y>0)return g(),y.current=t,p(x,a),v.current=s,void(m.current=i)}v.current={x:0,y:0},m.current={x:0,y:0},g()}else g()},[e,x,r,g,s,a,JSON.stringify(f),p,d,w,u,JSON.stringify(h)])}({...function(){const e=!(!1===(null==le?void 0:le.autoScrollEnabled)||("object"==typeof i?!1===i.enabled:!1===i));return"object"==typeof i?{...i,enabled:e}:{enabled:e}}(),draggingRect:je,pointerCoordinates:Ue,scrollableAncestors:We,scrollableAncestorRects:ze});const Je=t.useMemo(()=>({active:se,activeNode:me,activeNodeRect:xe,activatorEvent:de,activators:Ge,ariaDescribedById:{draggable:pe},collisions:He,containerNodeRect:we,dispatch:P,dragOverlay:Le,draggableNodes:Y,droppableContainers:ne,droppableRects:ve,over:Ve,measureDroppableContainers:fe,scrollableAncestors:We,scrollableAncestorRects:ze,measuringScheduled:be,windowRect:Ie}),[se,me,xe,de,Ge,He,we,Le,P,Y,pe,ne,ve,Ve,fe,We,ze,be,Ie]);return n.createElement(g.Provider,{value:U},n.createElement(u.Provider,{value:Je},n.createElement(Se.Provider,{value:Ye},c)),n.createElement(f,{announcements:a,hiddenTextDescribedById:pe,screenReaderInstructions:x}))})),Le=t.createContext(null),Ae="button";function Ne(){return t.useContext(u)}const Oe={timeout:25},Te={duration:250,easing:"ease",dragSourceOpacity:0},ke=e=>o.isKeyboardEvent(e)?"transform 250ms ease":void 0,Ke=n.memo(({adjustScale:e=!1,children:r,dropAnimation:i=Te,style:s,transition:a=ke,modifiers:l,wrapperElement:c="div",className:d,zIndex:u=999})=>{var h,p;const{active:g,activeNodeRect:v,containerNodeRect:f,draggableNodes:b,activatorEvent:m,over:x,dragOverlay:w,scrollableAncestors:C,scrollableAncestorRects:D,windowRect:R}=Ne(),E=t.useContext(Se),S=De(l,{activatorEvent:m,active:g,activeNodeRect:v,containerNodeRect:f,draggingNodeRect:w.rect,over:x,overlayNodeRect:w.rect,scrollableAncestors:C,scrollableAncestorRects:D,transform:E,windowRect:R}),M=null!==g,L=e?S:{...S,scaleX:1,scaleY:1},A=o.useLazyMemo(e=>M?e||(v?{...v}:null):null,[M,v]),N=A?{position:"fixed",width:A.width,height:A.height,top:A.top,left:A.left,zIndex:u,transform:o.CSS.Transform.toString(L),touchAction:"none",transformOrigin:e&&m?y(m,A):void 0,transition:"function"==typeof a?a(m):a,...s}:void 0,O=M?{style:N,children:r,className:d,transform:L}:void 0,k=t.useRef(O),K=null!=O?O:k.current,{children:I,...B}=null!=K?K:{},W=t.useRef(null!=(h=null==g?void 0:g.id)?h:null),z=function({animate:e,adjustScale:n,activeId:r,draggableNodes:i,duration:s,dragSourceOpacity:a,easing:l,node:c,transform:d}){const[u,h]=t.useState(!1);return o.useIsomorphicLayoutEffect(()=>{var t;if(!(e&&r&&l&&s))return void(e&&h(!0));const u=null==(t=i[r])?void 0:t.node.current;if(d&&c&&u&&null!==u.parentNode){const e=re(c);if(e){const t=e.getBoundingClientRect(),r=T(u),i={x:t.left-r.left,y:t.top-r.top};if(Math.abs(i.x)||Math.abs(i.y)){const e=o.CSS.Transform.toString({x:d.x-i.x,y:d.y-i.y,scaleX:n?r.width*d.scaleX/t.width:1,scaleY:n?r.height*d.scaleY/t.height:1}),p=u.style.opacity;return null!=a&&(u.style.opacity=""+a),void(c.animate([{transform:o.CSS.Transform.toString(d)},{transform:e}],{easing:l,duration:s}).onfinish=()=>{c.style.display="none",h(!0),u&&null!=a&&(u.style.opacity=p)})}}}h(!0)},[e,r,n,i,s,l,a,c,d]),o.useIsomorphicLayoutEffect(()=>{u&&h(!1)},[u]),u}({animate:Boolean(i&&W.current&&!g),adjustScale:e,activeId:W.current,draggableNodes:b,duration:null==i?void 0:i.duration,easing:null==i?void 0:i.easing,dragSourceOpacity:null==i?void 0:i.dragSourceOpacity,node:w.nodeRef.current,transform:null==(p=k.current)?void 0:p.transform}),P=Boolean(I&&(r||i&&!z));return t.useEffect(()=>{var e;(null==g?void 0:g.id)!==W.current&&(W.current=null!=(e=null==g?void 0:g.id)?e:null),g&&k.current!==O&&(k.current=O)},[g,O]),t.useEffect(()=>{z&&(k.current=void 0)},[z]),P?n.createElement(c,{...B,ref:w.setRef},I):null});exports.DndContext=Me,exports.DragOverlay=Ke,exports.KeyboardSensor=he,exports.MouseSensor=xe,exports.PointerSensor=be,exports.TouchSensor=Ce,exports.applyModifiers=De,exports.closestCenter=({collisionRect:e,droppableContainers:t})=>{const n=R(e,e.left,e.top),r=[];for(const e of t){const{id:t,rect:{current:o}}=e;if(o){const i=m(R(o),n);r.push({id:t,data:{droppableContainer:e,value:i}})}}return r.sort(x)},exports.closestCorners=({collisionRect:e,droppableContainers:t})=>{const n=C(e),r=[];for(const e of t){const{id:t,rect:{current:o}}=e;if(o){const i=C(o),s=n.reduce((e,t,n)=>e+m(i[n],t),0),a=Number((s/4).toFixed(4));r.push({id:t,data:{droppableContainer:e,value:a}})}}return r.sort(x)},exports.defaultAnnouncements=a,exports.defaultCoordinates=b,exports.defaultDropAnimation=Te,exports.getClientRect=O,exports.getFirstCollision=D,exports.getScrollableAncestors=k,exports.pointerWithin=({droppableContainers:e,pointerCoordinates:t})=>{if(!t)return[];const n=[];for(const r of e){const{id:e,rect:{current:o}}=r;if(o&&M(t,o)){const i=C(o).reduce((e,n)=>e+m(t,n),0),s=Number((i/4).toFixed(4));n.push({id:e,data:{droppableContainer:r,value:s}})}}return n.sort(x)},exports.rectIntersection=S,exports.useDndContext=Ne,exports.useDndMonitor=v,exports.useDraggable=function({id:e,data:n,disabled:r=!1,attributes:i}){const s=o.useUniqueId("Droppable"),{active:a,activeNodeRect:l,activatorEvent:c,ariaDescribedById:d,draggableNodes:h,droppableRects:p,activators:g,over:v}=t.useContext(u),{role:f=Ae,roleDescription:b="draggable",tabIndex:m=0}=null!=i?i:{},y=(null==a?void 0:a.id)===e,x=t.useContext(y?Se:Le),[w,C]=o.useNodeRef(),D=function(e,n){return t.useMemo(()=>e.reduce((e,{eventName:t,handler:r})=>(e[t]=e=>{r(e,n)},e),{}),[e,n])}(g,e),R=o.useLatestValue(n);return o.useIsomorphicLayoutEffect(()=>(h[e]={id:e,key:s,node:w,data:R},()=>{const t=h[e];t&&t.key===s&&delete h[e]}),[h,e]),{active:a,activeNodeRect:l,activatorEvent:c,attributes:t.useMemo(()=>({role:f,tabIndex:m,"aria-pressed":!(!y||f!==Ae)||void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[f,m,y,b,d.draggable]),droppableRects:p,isDragging:y,listeners:r?void 0:D,node:w,over:v,setNodeRef:C,transform:x}},exports.useDroppable=function({data:e,disabled:n=!1,id:r,resizeObserverConfig:i}){const s=o.useUniqueId("Droppable"),{active:a,collisions:c,dispatch:d,over:h,measureDroppableContainers:p}=t.useContext(u),g=t.useRef(!1),v=t.useRef(null),f=t.useRef(null),{disabled:b,updateMeasurementsFor:m,timeout:y}={...Oe,...i},x=o.useLatestValue(null!=m?m:r),w=t.useCallback(()=>{g.current?(null!=f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{p("string"==typeof x.current?[x.current]:x.current),f.current=null},y)):g.current=!0},[y]),C=t.useMemo(()=>!a||b?null:new ResizeObserver(w),[a,w,b]),D=t.useCallback((e,t)=>{C&&(t&&(C.unobserve(t),g.current=!1),e&&C.observe(e))},[C]),[R,E]=o.useNodeRef(D),S=o.useLatestValue(e);return t.useEffect(()=>{C&&R.current&&(C.disconnect(),g.current=!1,C.observe(R.current))},[R,C]),o.useIsomorphicLayoutEffect(()=>(d({type:l.RegisterDroppable,element:{id:r,key:s,disabled:n,node:R,rect:v,data:S}}),()=>d({type:l.UnregisterDroppable,key:s,id:r})),[r]),t.useEffect(()=>{d({type:l.SetDroppableDisabled,id:r,key:s,disabled:n})},[n]),{active:a,collisions:c,rect:v,isOver:(null==h?void 0:h.id)===r,node:R,over:h,setNodeRef:E}},exports.useSensor=function(e,n){return t.useMemo(()=>({sensor:e,options:null!=n?n:{}}),[e,n])},exports.useSensors=function(...e){return t.useMemo(()=>[...e].filter(e=>null!=e),[...e])}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-dom"),o=require("@dnd-kit/utilities"),i=require("@dnd-kit/accessibility");const s={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},a={onDragStart:e=>`Picked up draggable item ${e}.`,onDragOver:(e,t)=>t?`Draggable item ${e} was moved over droppable area ${t}.`:`Draggable item ${e} is no longer over a droppable area.`,onDragEnd:(e,t)=>t?`Draggable item ${e} was dropped over droppable area ${t}`:`Draggable item ${e} was dropped.`,onDragCancel:e=>`Dragging was cancelled. Draggable item ${e} was dropped.`};var l;function c(...e){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(l||(l={}));class d extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(({disabled:e})=>!e)}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const u={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:{},droppableRects:new Map,droppableContainers:new d,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:c},scrollableAncestors:[],scrollableAncestorRects:[],measureDroppableContainers:c,windowRect:null,measuringScheduled:!1},h={active:null,activeNodeRect:null,activators:[],ariaDescribedById:{draggable:""},dispatch:c,draggableNodes:{},over:null,measureDroppableContainers:c},p=t.createContext(h),g=t.createContext(u);function v(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:{},translate:{x:0,y:0}},droppable:{containers:new d}}}function f(e,t){switch(t.type){case l.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case l.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case l.DragEnd:case l.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case l.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new d(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case l.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new d(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case l.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new d(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}const b=t.createContext({type:null,event:null});function m({onDragStart:e,onDragMove:n,onDragOver:r,onDragEnd:o,onDragCancel:i}){const s=t.useContext(b),a=t.useRef(s);t.useEffect(()=>{if(s!==a.current){const{type:t,event:c}=s;switch(t){case l.DragStart:null==e||e(c);break;case l.DragMove:null==n||n(c);break;case l.DragOver:null==r||r(c);break;case l.DragCancel:null==i||i(c);break;case l.DragEnd:null==o||o(c)}a.current=s}},[s,e,n,r,o,i])}function y({announcements:e=a,hiddenTextDescribedById:s,screenReaderInstructions:l}){const{announce:c,announcement:d}=i.useAnnouncement(),u=o.useUniqueId("DndLiveRegion"),[h,p]=t.useState(!1);return t.useEffect(()=>{p(!0)},[]),m(t.useMemo(()=>({onDragStart({active:t}){c(e.onDragStart(t.id))},onDragMove({active:t,over:n}){e.onDragMove&&c(e.onDragMove(t.id,null==n?void 0:n.id))},onDragOver({active:t,over:n}){c(e.onDragOver(t.id,null==n?void 0:n.id))},onDragEnd({active:t,over:n}){c(e.onDragEnd(t.id,null==n?void 0:n.id))},onDragCancel({active:t}){c(e.onDragCancel(t.id))}}),[c,e])),h?r.createPortal(n.createElement(n.Fragment,null,n.createElement(i.HiddenText,{id:s,value:l.draggable}),n.createElement(i.LiveRegion,{id:u,announcement:d})),document.body):null}const x=Object.freeze({x:0,y:0});function w(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function C(e,t){const n=o.getEventCoordinates(e);return n?`${(n.x-t.left)/t.width*100}% ${(n.y-t.top)/t.height*100}%`:"0 0"}function D({data:{value:e}},{data:{value:t}}){return e-t}function R({data:{value:e}},{data:{value:t}}){return t-e}function E({left:e,top:t,height:n,width:r}){return[{x:e,y:t},{x:e+r,y:t},{x:e,y:t+n},{x:e+r,y:t+n}]}function S(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function M(e,t=e.left,n=e.top){return{x:t+.5*e.width,y:n+.5*e.height}}function N(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height);if(r<o&&n<i){const s=(o-r)*(i-n);return Number((s/(t.width*t.height+e.width*e.height-s)).toFixed(4))}return 0}const L=({collisionRect:e,droppableContainers:t})=>{const n=[];for(const r of t){const{id:t,rect:{current:o}}=r;if(o){const i=N(o,e);i>0&&n.push({id:t,data:{droppableContainer:r,value:i}})}}return n.sort(R)};function A(e,t){const{top:n,left:r,bottom:o,right:i}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=i}function O(e){return function(t,...n){return n.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const T=O(1),k={ignoreTransform:!1};function K(e,t=k){let n=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:t}=o.getWindow(e),{transform:r,transformOrigin:i}=t(e);r&&(n=function(e,t,n){let r,o,i,s,a;if(t.startsWith("matrix3d("))r=t.slice(9,-1).split(/, /),o=+r[0],i=+r[5],s=+r[12],a=+r[13];else{if(!t.startsWith("matrix("))return e;r=t.slice(7,-1).split(/, /),o=+r[0],i=+r[3],s=+r[4],a=+r[5]}const l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(n,r,i))}const{top:r,left:i,width:s,height:a,bottom:l,right:c}=n;return{top:r,left:i,width:s,height:a,bottom:l,right:c}}function I(e){return K(e,{ignoreTransform:!0})}function B(e){const t=[];return e?function n(r){if(!r)return t;if(o.isDocument(r)&&null!=r.scrollingElement&&!t.includes(r.scrollingElement))return t.push(r.scrollingElement),t;if(!o.isHTMLElement(r)||o.isSVGElement(r))return t;if(t.includes(r))return t;const{getComputedStyle:i}=o.getWindow(r),s=i(r);return r!==e&&function(e,t=o.getWindow(e).getComputedStyle(e)){const n=/(auto|scroll|overlay)/;return null!=["overflow","overflowX","overflowY"].find(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(r,s)&&t.push(r),function(e,t=o.getWindow(e).getComputedStyle(e)){return"fixed"===t.position}(r,s)?t:n(r.parentNode)}(e):t}function W(e){return o.canUseDOM&&e?o.isWindow(e)?e:o.isNode(e)?o.isDocument(e)||e===o.getOwnerDocument(e).scrollingElement?window:o.isHTMLElement(e)?e:null:null:null}function P(e){return o.isWindow(e)?e.scrollX:e.scrollLeft}function z(e){return o.isWindow(e)?e.scrollY:e.scrollTop}function U(e){return{x:P(e),y:z(e)}}var F;function q(e){const t={x:0,y:0},n={x:e.scrollWidth-e.clientWidth,y:e.scrollHeight-e.clientHeight};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(F||(F={}));const j={x:.2,y:.2};function H(e,t,{top:n,left:r,right:i,bottom:s},a=10,l=j){const{clientHeight:c,clientWidth:d}=e,u=(h=e,o.canUseDOM&&h&&h===document.scrollingElement?{top:0,left:0,right:d,bottom:c,width:d,height:c}:t);var h;const{isTop:p,isBottom:g,isLeft:v,isRight:f}=q(e),b={x:0,y:0},m={x:0,y:0},y=u.height*l.y,x=u.width*l.x;return!p&&n<=u.top+y?(b.y=F.Backward,m.y=a*Math.abs((u.top+y-n)/y)):!g&&s>=u.bottom-y&&(b.y=F.Forward,m.y=a*Math.abs((u.bottom-y-s)/y)),!f&&i>=u.right-x?(b.x=F.Forward,m.x=a*Math.abs((u.right-x-i)/x)):!v&&r<=u.left+x&&(b.x=F.Backward,m.x=a*Math.abs((u.left+x-r)/x)),{direction:b,speed:m}}function $(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function X(e){return e.reduce((e,t)=>o.add(e,U(t)),x)}const Y=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+P(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+z(t),0)}]];class V{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=B(t),r=X(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Y)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n);return this.rect[i]+(r[e]-t)},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}var _,G,J;(_=exports.AutoScrollActivator||(exports.AutoScrollActivator={}))[_.Pointer=0]="Pointer",_[_.DraggableRect=1]="DraggableRect",(G=exports.TraversalOrder||(exports.TraversalOrder={}))[G.TreeOrder=0]="TreeOrder",G[G.ReversedTreeOrder=1]="ReversedTreeOrder",(J=exports.MeasuringStrategy||(exports.MeasuringStrategy={}))[J.Always=0]="Always",J[J.BeforeDragging=1]="BeforeDragging",J[J.WhileDragging=2]="WhileDragging",(exports.MeasuringFrequency||(exports.MeasuringFrequency={})).Optimized="optimized";const Q=new Map,Z={measure:I,strategy:exports.MeasuringStrategy.WhileDragging,frequency:exports.MeasuringFrequency.Optimized},ee=[],te=oe(I),ne=ie(I);function re(e,n,r){const i=t.useRef(e);return o.useLazyMemo(t=>e?r||!t&&e||e!==i.current?o.isHTMLElement(e)&&null==e.parentNode?null:new V(n(e),e):null!=t?t:null:null,[e,r,n])}function oe(e){return(t,n)=>re(t,e,n)}function ie(e){const n=[];return function(r,i){const s=t.useRef(r);return o.useLazyMemo(t=>r.length?i||!t&&r.length||r!==s.current?r.map(t=>new V(e(t),t)):null!=t?t:n:n,[r,i])}}function se(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return o.isHTMLElement(t)?t:e}class ae{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function le(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var ce,de;function ue(e){e.preventDefault()}function he(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(ce||(ce={})),(de=exports.KeyboardCode||(exports.KeyboardCode={})).Space="Space",de.Down="ArrowDown",de.Right="ArrowRight",de.Left="ArrowLeft",de.Up="ArrowUp",de.Esc="Escape",de.Enter="Enter";const pe={start:[exports.KeyboardCode.Space,exports.KeyboardCode.Enter],cancel:[exports.KeyboardCode.Esc],end:[exports.KeyboardCode.Space,exports.KeyboardCode.Enter]},ge=(e,{currentCoordinates:t})=>{switch(e.code){case exports.KeyboardCode.Right:return{...t,x:t.x+25};case exports.KeyboardCode.Left:return{...t,x:t.x-25};case exports.KeyboardCode.Down:return{...t,y:t.y+25};case exports.KeyboardCode.Up:return{...t,y:t.y-25}}};class ve{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.coordinates=x,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ae(o.getOwnerDocument(t)),this.windowListeners=new ae(o.getWindow(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ce.Resize,this.handleCancel),this.windowListeners.add(ce.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ce.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props;if(!e.node.current)throw new Error("Active draggable node is undefined");const n=I(e.node.current),r={x:n.left,y:n.top};this.coordinates=r,t(r)}handleKeyDown(e){if(o.isKeyboardEvent(e)){const{coordinates:t}=this,{active:n,context:r,options:i}=this.props,{keyboardCodes:s=pe,coordinateGetter:a=ge,scrollBehavior:l="smooth"}=i,{code:c}=e;if(s.end.includes(c))return void this.handleEnd(e);if(s.cancel.includes(c))return void this.handleCancel(e);const d=a(e,{active:n,context:r.current,currentCoordinates:t});if(d){const n={x:0,y:0},{scrollableAncestors:i}=r.current;for(const r of i){const i=e.code,s=o.subtract(d,t),{isTop:a,isRight:c,isLeft:u,isBottom:h,maxScroll:p,minScroll:g}=q(r),v=$(r),f={x:Math.min(i===exports.KeyboardCode.Right?v.right-v.width/2:v.right,Math.max(i===exports.KeyboardCode.Right?v.left:v.left+v.width/2,d.x)),y:Math.min(i===exports.KeyboardCode.Down?v.bottom-v.height/2:v.bottom,Math.max(i===exports.KeyboardCode.Down?v.top:v.top+v.height/2,d.y))},b=i===exports.KeyboardCode.Right&&!c||i===exports.KeyboardCode.Left&&!u,m=i===exports.KeyboardCode.Down&&!h||i===exports.KeyboardCode.Up&&!a;if(b&&f.x!==d.x){if(i===exports.KeyboardCode.Right&&r.scrollLeft+s.x<=p.x||i===exports.KeyboardCode.Left&&r.scrollLeft+s.x>=g.x)return void r.scrollBy({left:s.x,behavior:l});n.x=i===exports.KeyboardCode.Right?r.scrollLeft-p.x:r.scrollLeft-g.x,r.scrollBy({left:-n.x,behavior:l});break}if(m&&f.y!==d.y){if(i===exports.KeyboardCode.Down&&r.scrollTop+s.y<=p.y||i===exports.KeyboardCode.Up&&r.scrollTop+s.y>=g.y)return void r.scrollBy({top:s.y,behavior:l});n.y=i===exports.KeyboardCode.Down?r.scrollTop-p.y:r.scrollTop-g.y,r.scrollBy({top:-n.y,behavior:l});break}}this.handleMove(e,o.add(d,n))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t),this.coordinates=t}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function fe(e){return Boolean(e&&"distance"in e)}function be(e){return Boolean(e&&"delay"in e)}ve.activators=[{eventName:"onKeyDown",handler:(e,{keyboardCodes:t=pe,onActivation:n})=>{const{code:r}=e.nativeEvent;return!!t.start.includes(r)&&(e.preventDefault(),null==n||n({event:e.nativeEvent}),!0)}}];class me{constructor(e,t,n=function(e){const{EventTarget:t}=o.getWindow(e);return e instanceof t?e:o.getOwnerDocument(e)}(e.event.target)){var r;this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:i}=e,{target:s}=i;this.props=e,this.events=t,this.document=o.getOwnerDocument(s),this.documentListeners=new ae(this.document),this.listeners=new ae(n),this.windowListeners=new ae(o.getWindow(s)),this.initialCoordinates=null!=(r=o.getEventCoordinates(i))?r:x,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(ce.Resize,this.handleCancel),this.windowListeners.add(ce.DragStart,ue),this.windowListeners.add(ce.VisibilityChange,this.handleCancel),this.windowListeners.add(ce.ContextMenu,ue),this.documentListeners.add(ce.Keydown,this.handleKeydown),t){if(fe(t))return;if(be(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(ce.Click,he,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ce.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!r)return;const l=null!=(t=o.getEventCoordinates(e))?t:x,c=o.subtract(r,l);if(!n&&a){if(be(a))return le(c,a.tolerance)?this.handleCancel():void 0;if(fe(a))return null!=a.tolerance&&le(c,a.tolerance)?this.handleCancel():le(c,a.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),s(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===exports.KeyboardCode.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ye={move:{name:"pointermove"},end:{name:"pointerup"}};class xe extends me{constructor(e){const{event:t}=e,n=o.getOwnerDocument(t.target);super(e,ye,n)}}xe.activators=[{eventName:"onPointerDown",handler:({nativeEvent:e},{onActivation:t})=>!(!e.isPrimary||0!==e.button||(null==t||t({event:e}),0))}];const we={move:{name:"mousemove"},end:{name:"mouseup"}};var Ce;!function(e){e[e.RightClick=2]="RightClick"}(Ce||(Ce={}));class De extends me{constructor(e){super(e,we,o.getOwnerDocument(e.event.target))}}De.activators=[{eventName:"onMouseDown",handler:({nativeEvent:e},{onActivation:t})=>e.button!==Ce.RightClick&&(null==t||t({event:e}),!0)}];const Re={move:{name:"touchmove"},end:{name:"touchend"}};class Ee extends me{constructor(e){super(e,Re)}static setup(){return window.addEventListener(Re.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Re.move.name,e)};function e(){}}}function Se(e,{transform:t,...n}){return(null==e?void 0:e.length)?e.reduce((e,t)=>t({transform:e,...n}),t):t}Ee.activators=[{eventName:"onTouchStart",handler:({nativeEvent:e},{onActivation:t})=>{const{touches:n}=e;return!(n.length>1||(null==t||t({event:e}),0))}}];const Me=[{sensor:xe,options:{}},{sensor:ve,options:{}}],Ne={current:{}},Le=t.createContext({...x,scaleX:1,scaleY:1}),Ae=t.memo((function({id:e,autoScroll:i=!0,announcements:a,children:c,sensors:d=Me,collisionDetection:u=L,measuring:h,modifiers:m,screenReaderInstructions:w=s,...C}){var D,R,E,M,N,A,O;const k=t.useReducer(f,void 0,v),[P,z]=k,[F,q]=t.useState(()=>({type:null,event:null})),[j,$]=t.useState(!1),{draggable:{active:Y,nodes:_,translate:G},droppable:{containers:J}}=P,oe=Y?_[Y]:null,ie=t.useRef({initial:null,translated:null}),ae=t.useMemo(()=>{var e;return null!=Y?{id:Y,data:null!=(e=null==oe?void 0:oe.data)?e:Ne,rect:ie}:null},[Y,oe]),le=t.useRef(null),[ce,de]=t.useState(null),[ue,he]=t.useState(null),pe=t.useRef(C),ge=o.useUniqueId("DndDescribedBy",e),ve=t.useMemo(()=>J.getEnabled(),[J]),{droppableRects:fe,measureDroppableContainers:be,measuringScheduled:me}=function(e,{dragging:n,dependencies:r,config:i}){const[s,a]=t.useState(null),l=null!=s,{frequency:c,measure:d,strategy:u}={...Z,...i},h=t.useRef(e),p=t.useCallback((e=[])=>a(t=>t?t.concat(e):e),[]),g=t.useRef(null),v=function(){switch(u){case exports.MeasuringStrategy.Always:return!1;case exports.MeasuringStrategy.BeforeDragging:return n;default:return!n}}(),f=o.useLazyMemo(t=>{if(v&&!n)return Q;const r=s;if(!t||t===Q||h.current!==e||null!=r){const t=new Map;for(let n of e){if(!n)continue;if(r&&r.length>0&&!r.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new V(d(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t},[e,s,n,v,d]);return t.useEffect(()=>{h.current=e},[e]),t.useEffect(()=>{v||requestAnimationFrame(()=>p())},[n,v]),t.useEffect(()=>{l&&a(null)},[l]),t.useEffect(()=>{v||"number"!=typeof c||null!==g.current||(g.current=setTimeout(()=>{p(),g.current=null},c))},[c,v,p,...r]),{droppableRects:f,measureDroppableContainers:p,measuringScheduled:l}}(ve,{dragging:j,dependencies:[G.x,G.y],config:null==h?void 0:h.droppable}),ye=function(e,t){const n=null!==t?e[t]:void 0,r=n?n.node.current:null;return o.useLazyMemo(e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(_,Y),xe=ue?o.getEventCoordinates(ue):null,we=re(ye,null!=(D=null==h||null==(R=h.draggable)?void 0:R.measure)?D:I),Ce=te(ye?ye.parentElement:null),De=t.useRef({active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:fe,draggableNodes:_,draggingNode:null,draggingNodeRect:null,droppableContainers:J,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Re=J.getNodeFor(null==(E=De.current.over)?void 0:E.id),Ee=function({measure:e=K}){const[n,r]=t.useState(null),i=t.useRef(e),s=t.useCallback(t=>{for(const{target:n}of t)if(o.isHTMLElement(n)){r(t=>{const r=e(n);return t?{...t,width:r.width,height:r.height}:r});break}},[e]),a=t.useMemo(()=>new ResizeObserver(s),[s]),l=t.useCallback(t=>{const n=se(t);a.disconnect(),n&&a.observe(n),r(n?e(n):null)},[e,a]),[c,d]=o.useNodeRef(l);return o.useIsomorphicLayoutEffect(()=>{i.current=e},[e]),t.useMemo(()=>({nodeRef:c,rect:n,setRef:d}),[n,c,d])}({measure:null==h||null==(M=h.dragOverlay)?void 0:M.measure}),Ae=null!=(N=Ee.nodeRef.current)?N:ye,Oe=null!=(A=Ee.rect)?A:we,Te=t.useRef(null),ke=Oe===we?(Ie=Te.current,(Ke=we)&&Ie?{x:Ke.left-Ie.left,y:Ke.top-Ie.top}:x):x;var Ke,Ie;const Be=t.useMemo(()=>We?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(We):null,[We=Ae?Ae.ownerDocument.defaultView:null]);var We;const Pe=function(e){const n=t.useRef(e),r=o.useLazyMemo(t=>e?t&&e&&n.current&&e.parentNode===n.current.parentNode?t:B(e):ee,[e]);return t.useEffect(()=>{n.current=e},[e]),r}(Y?null!=Re?Re:Ae:null),ze=ne(Pe),Ue=Se(m,{transform:{x:G.x-ke.x,y:G.y-ke.y,scaleX:1,scaleY:1},activatorEvent:ue,active:ae,activeNodeRect:we,containerNodeRect:Ce,draggingNodeRect:Oe,over:De.current.over,overlayNodeRect:Ee.rect,scrollableAncestors:Pe,scrollableAncestorRects:ze,windowRect:Be}),Fe=xe?o.add(xe,G):null,qe=function(e){const[n,r]=t.useState(null),i=t.useRef(e),s=t.useCallback(e=>{const t=W(e.target);t&&r(e=>e?(e.set(t,U(t)),new Map(e)):null)},[]);return t.useEffect(()=>{const t=i.current;if(e!==t){n(t);const o=e.map(e=>{const t=W(e);return t?(t.addEventListener("scroll",s,{passive:!0}),[t,U(t)]):null}).filter(e=>null!=e);r(o.length?new Map(o):null),i.current=e}return()=>{n(e),n(t)};function n(e){e.forEach(e=>{const t=W(e);null==t||t.removeEventListener("scroll",s)})}},[s,e]),t.useMemo(()=>e.length?n?Array.from(n.values()).reduce((e,t)=>o.add(e,t),x):X(e):x,[e,n])}(Pe),je=o.add(Ue,qe),He=Oe?T(Oe,Ue):null,$e=ae&&He?u({active:ae,collisionRect:He,droppableContainers:ve,pointerCoordinates:Fe}):null,Xe=S($e,"id"),[Ye,Ve]=t.useState(null),_e=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Ue,null!=(O=null==Ye?void 0:Ye.rect)?O:null,we),Ge=t.useCallback((e,{sensor:t,options:n})=>{if(!le.current)return;const o=_[le.current];if(!o)return;const i=new t({active:le.current,activeNode:o,event:e.nativeEvent,options:n,context:De,onStart(e){const t=le.current;if(!t)return;const n=_[t];if(!n)return;const{onDragStart:o}=pe.current,i={active:{id:t,data:n.data,rect:ie}};r.unstable_batchedUpdates(()=>{z({type:l.DragStart,initialCoordinates:e,active:t}),q({type:l.DragStart,event:i})}),null==o||o(i)},onMove(e){z({type:l.DragMove,coordinates:e})},onEnd:s(l.DragEnd),onCancel:s(l.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:i}=De.current;let s=null;if(t&&i){const{cancelDrop:r}=pe.current;s={active:t,collisions:n,delta:i,over:o},e===l.DragEnd&&"function"==typeof r&&await Promise.resolve(r(s))&&(e=l.DragCancel)}le.current=null,r.unstable_batchedUpdates(()=>{if(z({type:e}),Ve(null),$(!1),de(null),he(null),s&&q({type:e,event:s}),s){const{onDragCancel:t,onDragEnd:n}=pe.current,r=e===l.DragEnd?n:t;null==r||r(s)}})}}r.unstable_batchedUpdates(()=>{de(i),he(e.nativeEvent)})},[z,_]),Je=function(e,n){return t.useMemo(()=>e.reduce((e,t)=>{const{sensor:r}=t;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:n(e.handler,t)}))]},[]),[e,n])}(d,t.useCallback((e,t)=>(n,r)=>{const o=n.nativeEvent;null!==le.current||o.dndKit||o.defaultPrevented||!0===e(n,t.options)&&(o.dndKit={capturedBy:t.sensor},le.current=r,Ge(n,t))},[Ge]));!function(e){t.useEffect(()=>{if(!o.canUseDOM)return;const t=e.map(({sensor:e})=>null==e.setup?void 0:e.setup());return()=>{for(const e of t)null==e||e()}},e.map(({sensor:e})=>e))}(d),o.useIsomorphicLayoutEffect(()=>{pe.current=C},Object.values(C)),t.useEffect(()=>{null!=Y&&$(!0)},[Y]),t.useEffect(()=>{ae||(Te.current=null),ae&&we&&!Te.current&&(Te.current=we)},[we,ae]),t.useEffect(()=>{const{onDragMove:e}=pe.current,{active:t,collisions:n,over:r}=De.current;if(!t)return;const o={active:t,collisions:n,delta:{x:je.x,y:je.y},over:r};q({type:l.DragMove,event:o}),null==e||e(o)},[je.x,je.y]),t.useEffect(()=>{const{active:e,collisions:t,droppableContainers:n,scrollAdjustedTranslate:o}=De.current;if(!e||!le.current||!o)return;const{onDragOver:i}=pe.current,s=n.get(Xe),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,c={active:e,collisions:t,delta:{x:o.x,y:o.y},over:a};r.unstable_batchedUpdates(()=>{Ve(a),q({type:l.DragOver,event:c}),null==i||i(c)})},[Xe]),o.useIsomorphicLayoutEffect(()=>{De.current={active:ae,activeNode:ye,collisionRect:He,collisions:$e,droppableRects:fe,draggableNodes:_,draggingNode:Ae,draggingNodeRect:Oe,droppableContainers:J,over:Ye,scrollableAncestors:Pe,scrollAdjustedTranslate:je},ie.current={initial:Oe,translated:He}},[ae,ye,$e,He,_,Ae,Oe,fe,J,Ye,Pe,je]),function({acceleration:e,activator:n=exports.AutoScrollActivator.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:a=5,order:l=exports.TraversalOrder.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,threshold:h}){const[p,g]=o.useInterval(),v=t.useRef({x:1,y:1}),f=t.useMemo(()=>{switch(n){case exports.AutoScrollActivator.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case exports.AutoScrollActivator.DraggableRect:return i}return null},[n,i,c]),b=t.useRef(x),m=t.useRef(null),y=t.useCallback(()=>{const e=m.current;e&&e.scrollBy(v.current.x*b.current.x,v.current.y*b.current.y)},[]),w=t.useMemo(()=>l===exports.TraversalOrder.TreeOrder?[...d].reverse():d,[l,d]);t.useEffect(()=>{if(s&&d.length&&f){for(const t of w){if(!1===(null==r?void 0:r(t)))continue;const n=d.indexOf(t),o=u[n];if(!o)continue;const{direction:i,speed:s}=H(t,o,f,e,h);if(s.x>0||s.y>0)return g(),m.current=t,p(y,a),v.current=s,void(b.current=i)}v.current={x:0,y:0},b.current={x:0,y:0},g()}else g()},[e,y,r,g,s,a,JSON.stringify(f),p,d,w,u,JSON.stringify(h)])}({...function(){const e=!(!1===(null==ce?void 0:ce.autoScrollEnabled)||("object"==typeof i?!1===i.enabled:!1===i));return"object"==typeof i?{...i,enabled:e}:{enabled:e}}(),draggingRect:He,pointerCoordinates:Fe,scrollableAncestors:Pe,scrollableAncestorRects:ze});const Qe=t.useMemo(()=>({active:ae,activeNode:ye,activeNodeRect:we,activatorEvent:ue,collisions:$e,containerNodeRect:Ce,dragOverlay:Ee,draggableNodes:_,droppableContainers:J,droppableRects:fe,over:Ye,measureDroppableContainers:be,scrollableAncestors:Pe,scrollableAncestorRects:ze,measuringScheduled:me,windowRect:Be}),[ae,ye,we,ue,$e,Ce,Ee,_,J,fe,Ye,be,Pe,ze,me,Be]),Ze=t.useMemo(()=>({active:ae,activeNodeRect:we,activators:Je,ariaDescribedById:{draggable:ge},dispatch:z,draggableNodes:_,over:Ye,measureDroppableContainers:be}),[ae,we,Je,z,ge,_,Ye,be]);return n.createElement(b.Provider,{value:F},n.createElement(p.Provider,{value:Ze},n.createElement(g.Provider,{value:Qe},n.createElement(Le.Provider,{value:_e},c))),n.createElement(y,{announcements:a,hiddenTextDescribedById:ge,screenReaderInstructions:w}))})),Oe=t.createContext(null),Te="button";function ke(){return t.useContext(g)}const Ke={timeout:25},Ie={duration:250,easing:"ease",dragSourceOpacity:0},Be={x:0,y:0,scaleX:1,scaleY:1},We=e=>o.isKeyboardEvent(e)?"transform 250ms ease":void 0,Pe=n.memo(({adjustScale:e=!1,children:r,dropAnimation:i=Ie,style:s,transition:a=We,modifiers:l,wrapperElement:c="div",className:d,zIndex:u=999})=>{var g,v;const{active:f,activeNodeRect:b,containerNodeRect:m,draggableNodes:y,activatorEvent:x,over:w,dragOverlay:D,scrollableAncestors:R,scrollableAncestorRects:E,windowRect:S}=ke(),M=t.useContext(Le),N=Se(l,{activatorEvent:x,active:f,activeNodeRect:b,containerNodeRect:m,draggingNodeRect:D.rect,over:w,overlayNodeRect:D.rect,scrollableAncestors:R,scrollableAncestorRects:E,transform:M,windowRect:S}),L=null!==f,A=e?N:{...N,scaleX:1,scaleY:1},O=o.useLazyMemo(e=>L?e||(b?{...b}:null):null,[L,b]),T=O?{position:"fixed",width:O.width,height:O.height,top:O.top,left:O.left,zIndex:u,transform:o.CSS.Transform.toString(A),touchAction:"none",transformOrigin:e&&x?C(x,O):void 0,transition:"function"==typeof a?a(x):a,...s}:void 0,k=L?{style:T,children:r,className:d,transform:A}:void 0,K=t.useRef(k),B=null!=k?k:K.current,{children:W,...P}=null!=B?B:{},z=t.useRef(null!=(g=null==f?void 0:f.id)?g:null),U=function({animate:e,adjustScale:n,activeId:r,draggableNodes:i,duration:s,dragSourceOpacity:a,easing:l,node:c,transform:d}){const[u,h]=t.useState(!1);return o.useIsomorphicLayoutEffect(()=>{var t;if(!(e&&r&&l&&s))return void(e&&h(!0));const u=null==(t=i[r])?void 0:t.node.current;if(d&&c&&u&&null!==u.parentNode){const e=se(c);if(e){const t=e.getBoundingClientRect(),r=I(u),i={x:t.left-r.left,y:t.top-r.top};if(Math.abs(i.x)||Math.abs(i.y)){const e=o.CSS.Transform.toString({x:d.x-i.x,y:d.y-i.y,scaleX:n?r.width*d.scaleX/t.width:1,scaleY:n?r.height*d.scaleY/t.height:1}),p=u.style.opacity;return null!=a&&(u.style.opacity=""+a),void(c.animate([{transform:o.CSS.Transform.toString(d)},{transform:e}],{easing:l,duration:s}).onfinish=()=>{c.style.display="none",h(!0),u&&null!=a&&(u.style.opacity=p)})}}}h(!0)},[e,r,n,i,s,l,a,c,d]),o.useIsomorphicLayoutEffect(()=>{u&&h(!1)},[u]),u}({animate:Boolean(i&&z.current&&!f),adjustScale:e,activeId:z.current,draggableNodes:y,duration:null==i?void 0:i.duration,easing:null==i?void 0:i.easing,dragSourceOpacity:null==i?void 0:i.dragSourceOpacity,node:D.nodeRef.current,transform:null==(v=K.current)?void 0:v.transform}),F=Boolean(W&&(r||i&&!U));return t.useEffect(()=>{var e;(null==f?void 0:f.id)!==z.current&&(z.current=null!=(e=null==f?void 0:f.id)?e:null),f&&K.current!==k&&(K.current=k)},[f,k]),t.useEffect(()=>{U&&(K.current=void 0)},[U]),F?n.createElement(p.Provider,{value:h},n.createElement(Le.Provider,{value:Be},n.createElement(c,{...P,ref:D.setRef},W))):null});exports.DndContext=Ae,exports.DragOverlay=Pe,exports.KeyboardSensor=ve,exports.MouseSensor=De,exports.PointerSensor=xe,exports.TouchSensor=Ee,exports.applyModifiers=Se,exports.closestCenter=({collisionRect:e,droppableContainers:t})=>{const n=M(e,e.left,e.top),r=[];for(const e of t){const{id:t,rect:{current:o}}=e;if(o){const i=w(M(o),n);r.push({id:t,data:{droppableContainer:e,value:i}})}}return r.sort(D)},exports.closestCorners=({collisionRect:e,droppableContainers:t})=>{const n=E(e),r=[];for(const e of t){const{id:t,rect:{current:o}}=e;if(o){const i=E(o),s=n.reduce((e,t,n)=>e+w(i[n],t),0),a=Number((s/4).toFixed(4));r.push({id:t,data:{droppableContainer:e,value:a}})}}return r.sort(D)},exports.defaultAnnouncements=a,exports.defaultCoordinates=x,exports.defaultDropAnimation=Ie,exports.getClientRect=K,exports.getFirstCollision=S,exports.getScrollableAncestors=B,exports.pointerWithin=({droppableContainers:e,pointerCoordinates:t})=>{if(!t)return[];const n=[];for(const r of e){const{id:e,rect:{current:o}}=r;if(o&&A(t,o)){const i=E(o).reduce((e,n)=>e+w(t,n),0),s=Number((i/4).toFixed(4));n.push({id:e,data:{droppableContainer:r,value:s}})}}return n.sort(D)},exports.rectIntersection=L,exports.useDndContext=ke,exports.useDndMonitor=m,exports.useDraggable=function({id:e,data:n,disabled:r=!1,attributes:i}){const s=o.useUniqueId("Droppable"),{activators:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:h}=t.useContext(p),{role:g=Te,roleDescription:v="draggable",tabIndex:f=0}=null!=i?i:{},b=(null==l?void 0:l.id)===e,m=t.useContext(b?Le:Oe),[y,x]=o.useNodeRef(),w=function(e,n){return t.useMemo(()=>e.reduce((e,{eventName:t,handler:r})=>(e[t]=e=>{r(e,n)},e),{}),[e,n])}(a,e),C=o.useLatestValue(n);return o.useIsomorphicLayoutEffect(()=>(u[e]={id:e,key:s,node:y,data:C},()=>{const t=u[e];t&&t.key===s&&delete u[e]}),[u,e]),{active:l,activeNodeRect:c,attributes:t.useMemo(()=>({role:g,tabIndex:f,"aria-pressed":!(!b||g!==Te)||void 0,"aria-roledescription":v,"aria-describedby":d.draggable}),[g,f,b,v,d.draggable]),isDragging:b,listeners:r?void 0:w,node:y,over:h,setNodeRef:x,transform:m}},exports.useDroppable=function({data:e,disabled:n=!1,id:r,resizeObserverConfig:i}){const s=o.useUniqueId("Droppable"),{active:a,dispatch:c,over:d,measureDroppableContainers:u}=t.useContext(p),h=t.useRef(!1),g=t.useRef(null),v=t.useRef(null),{disabled:f,updateMeasurementsFor:b,timeout:m}={...Ke,...i},y=o.useLatestValue(null!=b?b:r),x=t.useCallback(()=>{h.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{u("string"==typeof y.current?[y.current]:y.current),v.current=null},m)):h.current=!0},[m]),w=t.useMemo(()=>!a||f?null:new ResizeObserver(x),[a,x,f]),C=t.useCallback((e,t)=>{w&&(t&&(w.unobserve(t),h.current=!1),e&&w.observe(e))},[w]),[D,R]=o.useNodeRef(C),E=o.useLatestValue(e);return t.useEffect(()=>{w&&D.current&&(w.disconnect(),h.current=!1,w.observe(D.current))},[D,w]),o.useIsomorphicLayoutEffect(()=>(c({type:l.RegisterDroppable,element:{id:r,key:s,disabled:n,node:D,rect:g,data:E}}),()=>c({type:l.UnregisterDroppable,key:s,id:r})),[r]),t.useEffect(()=>{c({type:l.SetDroppableDisabled,id:r,key:s,disabled:n})},[n]),{active:a,rect:g,isOver:(null==d?void 0:d.id)===r,node:D,over:d,setNodeRef:R}},exports.useSensor=function(e,n){return t.useMemo(()=>({sensor:e,options:null!=n?n:{}}),[e,n])},exports.useSensors=function(...e){return t.useMemo(()=>[...e].filter(e=>null!=e),[...e])}; | ||
//# sourceMappingURL=core.cjs.production.min.js.map |
import { ContextType } from 'react'; | ||
import { Context } from '../store'; | ||
export declare function useDndContext(): import("../store").DndContextDescriptor; | ||
export declare type UseDndContextReturnValue = ContextType<typeof Context>; | ||
import { PublicContext } from '../store'; | ||
export declare function useDndContext(): import("../store").PublicContextDescriptor; | ||
export declare type UseDndContextReturnValue = ContextType<typeof PublicContext>; |
@@ -19,3 +19,2 @@ /// <reference types="react" /> | ||
activeNodeRect: import("..").ClientRect | null; | ||
activatorEvent: Event | null; | ||
attributes: { | ||
@@ -28,3 +27,2 @@ role: string; | ||
}; | ||
droppableRects: import("../store").RectMap; | ||
isDragging: boolean; | ||
@@ -31,0 +29,0 @@ listeners: SyntheticListenerMap | undefined; |
@@ -23,3 +23,2 @@ /// <reference types="react" /> | ||
active: import("../store").Active | null; | ||
collisions: import("..").Collision[] | null; | ||
rect: import("react").MutableRefObject<ClientRect | null>; | ||
@@ -26,0 +25,0 @@ isOver: boolean; |
@@ -1,2 +0,2 @@ | ||
import type { DndContextDescriptor } from '../../store'; | ||
import type { PublicContextDescriptor } from '../../store'; | ||
import type { ClientRect } from '../../types'; | ||
@@ -6,3 +6,3 @@ interface Arguments { | ||
} | ||
export declare function useDragOverlayMeasuring({ measure, }: Arguments): DndContextDescriptor['dragOverlay']; | ||
export declare function useDragOverlayMeasuring({ measure, }: Arguments): PublicContextDescriptor['dragOverlay']; | ||
export {}; |
@@ -9,5 +9,5 @@ export { DndContext, DragOverlay, defaultAnnouncements, defaultDropAnimation, } from './components'; | ||
export type { Activator, Activators, PointerActivationConstraint, KeyboardCodes, KeyboardCoordinateGetter, KeyboardSensorOptions, KeyboardSensorProps, MouseSensorOptions, PointerEventHandlers, PointerSensorOptions, PointerSensorProps, Sensor, Sensors, SensorContext, SensorDescriptor, SensorHandler, SensorInstance, SensorOptions, SensorProps, SensorResponse, TouchSensorOptions, } from './sensors'; | ||
export type { Active, DndContextDescriptor, DraggableNode, DroppableContainers, DroppableContainer, Over, } from './store'; | ||
export type { Active, PublicContextDescriptor as DndContextDescriptor, DraggableNode, DroppableContainers, DroppableContainer, Over, } from './store'; | ||
export type { ClientRect, DistanceMeasurement, DragEndEvent, DragMoveEvent, DragOverEvent, DragStartEvent, DragCancelEvent, Translate, UniqueIdentifier, } from './types'; | ||
export { defaultCoordinates, getClientRect, getFirstCollision, getScrollableAncestors, closestCenter, closestCorners, rectIntersection, pointerWithin, } from './utilities'; | ||
export type { Collision, CollisionDescriptor, CollisionDetection, } from './utilities'; |
/// <reference types="react" /> | ||
import type { DndContextDescriptor } from './types'; | ||
export declare const Context: import("react").Context<DndContextDescriptor>; | ||
import type { InternalContextDescriptor, PublicContextDescriptor } from './types'; | ||
export declare const defaultPublicContext: PublicContextDescriptor; | ||
export declare const defaultInternalContext: InternalContextDescriptor; | ||
export declare const InternalContext: import("react").Context<InternalContextDescriptor>; | ||
export declare const PublicContext: import("react").Context<PublicContextDescriptor>; |
export { Action } from './actions'; | ||
export { Context } from './context'; | ||
export { PublicContext, InternalContext, defaultInternalContext, } from './context'; | ||
export { reducer, getInitialState } from './reducer'; | ||
export type { Active, Data, DataRef, DraggableElement, DraggableNode, DraggableNodes, DroppableContainer, DroppableContainers, DndContextDescriptor, RectMap, Over, State, } from './types'; | ||
export type { Active, Data, DataRef, DraggableElement, DraggableNode, DraggableNodes, DroppableContainer, DroppableContainers, PublicContextDescriptor, InternalContextDescriptor, RectMap, Over, State, } from './types'; |
@@ -58,5 +58,3 @@ import type { MutableRefObject } from 'react'; | ||
} | ||
export interface DndContextDescriptor { | ||
dispatch: React.Dispatch<Actions>; | ||
activators: SyntheticListeners; | ||
export interface PublicContextDescriptor { | ||
activatorEvent: Event | null; | ||
@@ -66,5 +64,2 @@ active: Active | null; | ||
activeNodeRect: ClientRect | null; | ||
ariaDescribedById: { | ||
draggable: UniqueIdentifier; | ||
}; | ||
collisions: Collision[] | null; | ||
@@ -87,1 +82,13 @@ containerNodeRect: ClientRect | null; | ||
} | ||
export interface InternalContextDescriptor { | ||
activators: SyntheticListeners; | ||
active: Active | null; | ||
activeNodeRect: ClientRect | null; | ||
ariaDescribedById: { | ||
draggable: UniqueIdentifier; | ||
}; | ||
dispatch: React.Dispatch<Actions>; | ||
draggableNodes: DraggableNodes; | ||
over: Over | null; | ||
measureDroppableContainers(ids: UniqueIdentifier[]): void; | ||
} |
{ | ||
"name": "@dnd-kit/core", | ||
"version": "5.0.0-next-202209174015", | ||
"version": "5.0.0-next-202209232458", | ||
"description": "dnd kit – a lightweight React library for building performant and accessible drag and drop experiences", | ||
@@ -35,3 +35,3 @@ "author": "Claudéric Demers", | ||
"@dnd-kit/accessibility": "^3.0.0", | ||
"@dnd-kit/utilities": "^3.1.0-next-202209174015" | ||
"@dnd-kit/utilities": "^3.1.0-next-202209232458" | ||
}, | ||
@@ -38,0 +38,0 @@ "publishConfig": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
867373
6699