@dnd-kit/core
Advanced tools
Comparing version 4.0.3 to 5.0.0-next-202201012117
130
CHANGELOG.md
# @dnd-kit/core | ||
## 5.0.0-next-202201012117 | ||
### Major Changes | ||
- [#558](https://github.com/clauderic/dnd-kit/pull/558) [`f3ad20d`](https://github.com/clauderic/dnd-kit/commit/f3ad20d5b2c2f2ca7b82c193c9af5eef38c5ce11) Thanks [@clauderic](https://github.com/clauderic)! - Refactor of the `CollisionDetection` interface to return an array of `Collision`s: | ||
```diff | ||
+export interface Collision { | ||
+ id: UniqueIdentifier; | ||
+ data?: Record<string, any>; | ||
+} | ||
export type CollisionDetection = (args: { | ||
active: Active; | ||
collisionRect: ClientRect; | ||
droppableContainers: DroppableContainer[]; | ||
pointerCoordinates: Coordinates | null; | ||
-}) => UniqueIdentifier; | ||
+}) => Collision[]; | ||
``` | ||
This is a breaking change that requires all collision detection strategies to be updated to return an array of `Collision` rather than a single `UniqueIdentifier` | ||
The `over` property remains a single `UniqueIdentifier`, and is set to the first item in returned in the collisions array. | ||
Consumers can also access the `collisions` property which can be used to implement use-cases such as combining droppables in user-land. | ||
The `onDragMove`, `onDragOver` and `onDragEnd` callbacks are also updated to receive the collisions array property. | ||
Built-in collision detections such as rectIntersection, closestCenter, closestCorners and pointerWithin adhere to the CollisionDescriptor interface, which extends the Collision interface: | ||
```ts | ||
export interface CollisionDescriptor extends Collision { | ||
data: { | ||
droppableContainer: DroppableContainer; | ||
value: number; | ||
[key: string]: any; | ||
}; | ||
} | ||
``` | ||
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. | ||
This behaviour can be configured using the newly introduced `resizeObserverConfig` property. | ||
```ts | ||
interface ResizeObserverConfig { | ||
/** Whether the ResizeObserver should be disabled entirely */ | ||
disabled?: boolean; | ||
/** Resize events may affect the layout and position of other droppable containers. | ||
* Specify an array of `UniqueIdentifier` of droppable containers that should also be re-measured | ||
* when this droppable container resizes. Specifying an empty array re-measures all droppable containers. | ||
*/ | ||
updateMeasurementsFor?: UniqueIdentifier[]; | ||
/** Represents the debounce timeout between when resize events are observed and when elements are re-measured */ | ||
timeout?: number; | ||
} | ||
``` | ||
By default, only the current droppable is scheduled to be re-measured when a resize event is observed. However, this may not be suitable for all use-cases. When an element resizes, it can affect the layout and position of other elements, such that it may be necessary to re-measure other droppable nodes in response to that single resize event. The `recomputeIds` property can be used to specify which droppable `id`s should be re-measured in response to resize events being observed. | ||
For example, the `useSortable` preset re-computes the measurements of all sortable elements after the element that resizes, so long as they are within the same `SortableContext` as the element that resizes, since it's highly likely that their layout will also shift. | ||
Specifying an empty array for `recomputeIds` forces all droppable containers to be re-measured. | ||
For consumers that were relyings on the internals of `DndContext` using `useDndContext()`, the `willRecomputeLayouts` property has been renamed to `measuringScheduled`, and the `recomputeLayouts` method has been renamed to `measureDroppableContainers`, and now optionally accepts an array of droppable `UniqueIdentifier` that should be scheduled to be re-measured. | ||
- [#518](https://github.com/clauderic/dnd-kit/pull/518) [`6310227`](https://github.com/clauderic/dnd-kit/commit/63102272d0d63dae349e2e9f638277e16a7d5970) Thanks [@clauderic](https://github.com/clauderic)! - Major internal refactor of measuring and collision detection. | ||
### Summary of changes | ||
Previously, all collision detection algorithms were relative to the top and left points of the document. While this approach worked in most situations, it broke down in a number of different use-cases, such as fixed position droppable containers and trying to drag between containers that had different scroll positions. | ||
This new approach changes the frame of comparison to be relative to the viewport. This is a major breaking change, and will need to be released under a new major version bump. | ||
### Breaking changes: | ||
- By default, `@dnd-kit` now ignores only the transforms applied to the draggable / droppable node itself, but considers all the transforms applied to its ancestors. This should provide the right balance of flexibility for most consumers. | ||
- Transforms applied to the droppable and draggable nodes are ignored by default, because the recommended approach for moving items on the screen is to use the transform property, which can interfere with the calculation of collisions. | ||
- Consumers can choose an alternate approach that does consider transforms for specific use-cases if needed by configuring the measuring prop of <DndContext>. Refer to the <Switch> example. | ||
- Reduced the number of concepts related to measuring from `ViewRect`, `LayoutRect` to just a single concept of `ClientRect`. | ||
- The `ClientRect` interface no longer holds the `offsetTop` and `offsetLeft` properties. For most use-cases, you can replace `offsetTop` with `top` and `offsetLeft` with `left`. | ||
- Replaced the following exports from the `@dnd-kit/core` package with `getClientRect`: | ||
- `getBoundingClientRect` | ||
- `getViewRect` | ||
- `getLayoutRect` | ||
- `getViewportLayoutRect` | ||
- Removed `translatedRect` from the `SensorContext` interface. Replace usage with `collisionRect`. | ||
- Removed `activeNodeClientRect` on the `DndContext` interface. Replace with `activeNodeRect`. | ||
- [#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 | ||
- [#556](https://github.com/clauderic/dnd-kit/pull/556) [`c6c67cb`](https://github.com/clauderic/dnd-kit/commit/c6c67cb9cbc6e61027f7bb084fd2232160037d5e) Thanks [@avgrad](https://github.com/avgrad)! - - Added pointer coordinates to collision detection | ||
- Added `pointerWithin` collision algorithm | ||
### Patch Changes | ||
- 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-202201012117 | ||
## 4.0.3 | ||
@@ -4,0 +134,0 @@ |
import React from 'react'; | ||
import { Transform } from '@dnd-kit/utilities'; | ||
import type { ViewRect } from '../../types'; | ||
import type { AutoScrollOptions, DroppableMeasuring } from '../../hooks/utilities'; | ||
@@ -8,3 +7,3 @@ import { SensorDescriptor } from '../../sensors'; | ||
import { Modifiers } from '../../modifiers'; | ||
import type { DragStartEvent, DragCancelEvent, DragEndEvent, DragMoveEvent, DragOverEvent } from '../../types'; | ||
import type { ClientRect, DragStartEvent, DragCancelEvent, DragEndEvent, DragMoveEvent, DragOverEvent } from '../../types'; | ||
import { Announcements, ScreenReaderInstructions } from '../Accessibility'; | ||
@@ -28,8 +27,13 @@ export interface Props { | ||
} | ||
export interface DraggableMeasuring { | ||
measure(node: HTMLElement): ViewRect; | ||
interface Measuring { | ||
measure(node: HTMLElement): ClientRect; | ||
} | ||
export interface DraggableMeasuring extends Measuring { | ||
} | ||
export interface DragOverlayMeasuring extends Measuring { | ||
} | ||
export interface MeasuringConfiguration { | ||
draggable?: Partial<DraggableMeasuring>; | ||
droppable?: Partial<DroppableMeasuring>; | ||
dragOverlay?: Partial<DragOverlayMeasuring>; | ||
} | ||
@@ -41,1 +45,2 @@ export interface CancelDropArguments extends DragEndEvent { | ||
export declare const DndContext: React.NamedExoticComponent<Props>; | ||
export {}; |
@@ -16,4 +16,3 @@ import React from 'react'; | ||
} | ||
export declare const defaultDropAnimation: DropAnimation; | ||
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 @@ | ||
export { useDropAnimation } from './useDropAnimation'; | ||
export { useDropAnimation, defaultDropAnimation } from './useDropAnimation'; | ||
export type { DropAnimation } from './useDropAnimation'; |
@@ -20,3 +20,4 @@ import { Transform } from '@dnd-kit/utilities'; | ||
} | ||
export declare function useDropAnimation({ animate, adjustScale, activeId, draggableNodes, duration, easing, dragSourceOpacity, node, transform, }: Arguments): boolean; | ||
export declare const defaultDropAnimation: DropAnimation; | ||
export declare function useDropAnimation({ animate, adjustScale, activeId, draggableNodes, duration, dragSourceOpacity, easing, node, transform, }: Arguments): boolean; | ||
export {}; |
@@ -1,3 +0,4 @@ | ||
export { DragOverlay, defaultDropAnimation } from './DragOverlay'; | ||
export { DragOverlay } from './DragOverlay'; | ||
export type { Props } from './DragOverlay'; | ||
export { defaultDropAnimation } from './hooks'; | ||
export type { DropAnimation } from './hooks'; |
@@ -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"),a=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 "},i={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,activeNodeClientRect:null,activators:[],ariaDescribedById:{draggable:""},containerNodeRect:null,dispatch:c,draggableNodes:{},droppableRects:new Map,droppableContainers:new d,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:c},scrollableAncestors:[],scrollableAncestorRects:[],recomputeLayouts:c,windowRect:null,willRecomputeLayouts:!1});function f(){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,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const s=new d(e.droppable.containers);return s.set(n,{...a,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 a=new d(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}const h=t.createContext({type:null,event:null});function g({onDragStart:e,onDragMove:n,onDragOver:r,onDragEnd:o,onDragCancel:a}){const s=t.useContext(h),i=t.useRef(s);t.useEffect(()=>{if(s!==i.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==a||a(c);break;case l.DragEnd:null==o||o(c)}i.current=s}},[s,e,n,r,o,a])}function v({announcements:e=i,hiddenTextDescribedById:s,screenReaderInstructions:l}){const{announce:c,announcement:d}=a.useAnnouncement(),u=o.useUniqueId("DndLiveRegion"),[f,p]=t.useState(!1);return t.useEffect(()=>{p(!0)},[]),g(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])),f?r.createPortal(n.createElement(n.Fragment,null,n.createElement(a.HiddenText,{id:s,value:l.draggable}),n.createElement(a.LiveRegion,{id:u,announcement:d})),document.body):null}const y=Object.freeze({x:0,y:0});function b(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function m(e,t){if(o.isKeyboardEvent(e))return"0 0";const n=o.getEventCoordinates(e);return`${(n.x-t.left)/t.width*100}% ${(n.y-t.top)/t.height*100}%`}function x(e,t=e.offsetLeft,n=e.offsetTop){return{x:t+.5*e.width,y:n+.5*e.height}}function w(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,offsetLeft:t.offsetLeft+e*n.x,offsetTop:t.offsetTop+e*n.y}),{...t})}}const D=w(1);function C(e){const t=[];return e?function e(n){if(!n)return t;if(o.isDocument(n)&&null!=n.scrollingElement&&!t.includes(n.scrollingElement))return t.push(n.scrollingElement),t;if(!o.isHTMLElement(n)||o.isSVGElement(n))return t;if(t.includes(n))return t;const r=window.getComputedStyle(n);return function(e,t=window.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)})}(n,r)&&t.push(n),function(e,t=window.getComputedStyle(e)){return"fixed"===t.position}(n,r)?t:e(n.parentNode)}(e.parentNode):t}function R(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 E(e){return o.isWindow(e)?{x:e.scrollX,y:e.scrollY}:{x:e.scrollLeft,y:e.scrollTop}}var S;function M(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"}(S||(S={}));const L={x:.2,y:.2};function T(e,t,{top:n,left:r,right:a,bottom:s},i=10,l=L){const{clientHeight:c,clientWidth:d}=e,u=(f=e,o.canUseDOM&&f&&f===document.scrollingElement?{top:0,left:0,right:d,bottom:c,width:d,height:c}:t);var f;const{isTop:p,isBottom:h,isLeft:g,isRight:v}=M(e),y={x:0,y:0},b={x:0,y:0},m=u.height*l.y,x=u.width*l.x;return!p&&n<=u.top+m?(y.y=S.Backward,b.y=i*Math.abs((u.top+m-n)/m)):!h&&s>=u.bottom-m&&(y.y=S.Forward,b.y=i*Math.abs((u.bottom-m-s)/m)),!v&&a>=u.right-x?(y.x=S.Forward,b.x=i*Math.abs((u.right-x-a)/x)):!g&&r<=u.left+x&&(y.x=S.Backward,b.x=i*Math.abs((u.left+x-r)/x)),{direction:y,speed:b}}function A(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 N(e){return e.reduce((e,t)=>o.add(e,E(t)),y)}function O(e){const{offsetWidth:t,offsetHeight:n}=e,{x:r,y:a}=function e(t,n,r=y){if(!t||!o.isHTMLElement(t))return r;const a={x:r.x+t.offsetLeft,y:r.y+t.offsetTop};return t.offsetParent===n?a:e(t.offsetParent,n,a)}(e,null);return{width:t,height:n,offsetTop:a,offsetLeft:r}}function K(e){if(o.isWindow(e)){const e=window.innerWidth,t=window.innerHeight;return{top:0,left:0,right:e,bottom:t,width:e,height:t,offsetTop:0,offsetLeft:0}}const{offsetTop:t,offsetLeft:n}=O(e),{width:r,height:a,top:s,bottom:i,left:l,right:c}=e.getBoundingClientRect();return{width:r,height:a,top:s,bottom:i,right:c,left:l,offsetTop:t,offsetLeft:n}}function k(e){const{width:t,height:n,offsetTop:r,offsetLeft:o}=O(e),a=N(C(e)),s=r-a.y,i=o-a.x;return{width:t,height:n,top:s,bottom:s+n,right:i+t,left:i,offsetTop:r,offsetLeft:o}}function B(e){return"top"in e}function I(e,t=e.offsetLeft,n=e.offsetTop){return[{x:t,y:n},{x:t+e.width,y:n},{x:t,y:n+e.height},{x:t+e.width,y:n+e.height}]}function P(e,t){const n=Math.max(t.top,e.offsetTop),r=Math.max(t.left,e.offsetLeft),o=Math.min(t.left+t.width,e.offsetLeft+e.width),a=Math.min(t.top+t.height,e.offsetTop+e.height);if(r<o&&n<a){const s=(o-r)*(a-n);return Number((s/(t.width*t.height+e.width*e.height-s)).toFixed(4))}return 0}const U=({collisionRect:e,droppableContainers:t})=>{let n=0,r=null;for(const o of t){const{rect:{current:t}}=o;if(t){const a=P(t,e);a>n&&(n=a,r=o.id)}}return r};var q,W,z;function F(e){const n=t.useRef(e);return o.useIsomorphicLayoutEffect(()=>{n.current!==e&&(n.current=e)},[e]),n}(q=exports.AutoScrollActivator||(exports.AutoScrollActivator={}))[q.Pointer=0]="Pointer",q[q.DraggableRect=1]="DraggableRect",(W=exports.TraversalOrder||(exports.TraversalOrder={}))[W.TreeOrder=0]="TreeOrder",W[W.ReversedTreeOrder=1]="ReversedTreeOrder",(z=exports.MeasuringStrategy||(exports.MeasuringStrategy={}))[z.Always=0]="Always",z[z.BeforeDragging=1]="BeforeDragging",z[z.WhileDragging=2]="WhileDragging",(exports.MeasuringFrequency||(exports.MeasuringFrequency={})).Optimized="optimized";const j=new Map,H={measure:O,strategy:exports.MeasuringStrategy.WhileDragging,frequency:exports.MeasuringFrequency.Optimized},$=[],X=_(K),Y=G(K);function V(e,n,r){const a=t.useRef(e);return o.useLazyMemo(t=>e?r||!t&&e||e!==a.current?o.isHTMLElement(e)&&null==e.parentNode?null:n(e):null!=t?t:null:null,[e,r,n])}function _(e){return(t,n)=>V(t,e,n)}function G(e){const n=[];return function(r,a){const s=t.useRef(r);return o.useLazyMemo(t=>r.length?a||!t&&r.length||r!==s.current?r.map(t=>e(t)):null!=t?t:n:n,[r,a])}}function J(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return o.isHTMLElement(t)?t:e}function Q(e){const{width:t,height:n,offsetLeft:r,offsetTop:o}=O(e);return{top:o,bottom:o+n,left:r,right:r+t,width:t,height:n,offsetTop:o,offsetLeft:r}}const Z=_(Q);class ee{constructor(e){this.target=e,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})}}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function te(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 ne,re;function oe(e){e.preventDefault()}function ae(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"}(ne||(ne={})),(re=exports.KeyboardCode||(exports.KeyboardCode={})).Space="Space",re.Down="ArrowDown",re.Right="ArrowRight",re.Left="ArrowLeft",re.Up="ArrowUp",re.Esc="Escape",re.Enter="Enter";const se={start:[exports.KeyboardCode.Space,exports.KeyboardCode.Enter],cancel:[exports.KeyboardCode.Esc],end:[exports.KeyboardCode.Space,exports.KeyboardCode.Enter]},ie=(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 le{constructor(e){this.props=e,this.autoScrollEnabled=!1,this.coordinates=y;const{event:{target:t}}=e;this.props=e,this.listeners=new ee(o.getOwnerDocument(t)),this.windowListeners=new ee(o.getWindow(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ne.Resize,this.handleCancel),this.windowListeners.add(ne.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ne.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=K(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:a}=this.props,{keyboardCodes:s=se,coordinateGetter:i=ie,scrollBehavior:l="smooth"}=a,{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=i(e,{active:n,context:r.current,currentCoordinates:t});if(d){const n={x:0,y:0},{scrollableAncestors:a}=r.current;for(const r of a){const a=e.code,s=o.subtract(d,t),{isTop:i,isRight:c,isLeft:u,isBottom:f,maxScroll:p,minScroll:h}=M(r),g=A(r),v={x:Math.min(a===exports.KeyboardCode.Right?g.right-g.width/2:g.right,Math.max(a===exports.KeyboardCode.Right?g.left:g.left+g.width/2,d.x)),y:Math.min(a===exports.KeyboardCode.Down?g.bottom-g.height/2:g.bottom,Math.max(a===exports.KeyboardCode.Down?g.top:g.top+g.height/2,d.y))},y=a===exports.KeyboardCode.Right&&!c||a===exports.KeyboardCode.Left&&!u,b=a===exports.KeyboardCode.Down&&!f||a===exports.KeyboardCode.Up&&!i;if(y&&v.x!==d.x){if(a===exports.KeyboardCode.Right&&r.scrollLeft+s.x<=p.x||a===exports.KeyboardCode.Left&&r.scrollLeft+s.x>=h.x)return void r.scrollBy({left:s.x,behavior:l});n.x=a===exports.KeyboardCode.Right?r.scrollLeft-p.x:r.scrollLeft-h.x,r.scrollBy({left:-n.x,behavior:l});break}if(b&&v.y!==d.y){if(a===exports.KeyboardCode.Down&&r.scrollTop+s.y<=p.y||a===exports.KeyboardCode.Up&&r.scrollTop+s.y>=h.y)return void r.scrollBy({top:s.y,behavior:l});n.y=a===exports.KeyboardCode.Down?r.scrollTop-p.y:r.scrollTop-h.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 ce(e){return Boolean(e&&"distance"in e)}function de(e){return Boolean(e&&"delay"in e)}le.activators=[{eventName:"onKeyDown",handler:(e,{keyboardCodes:t=se,onActivation:n})=>{const{code:r}=e.nativeEvent;return!!t.start.includes(r)&&(e.preventDefault(),null==n||n({event:e.nativeEvent}),!0)}}];class ue{constructor(e,t,n=function(e){const{EventTarget:t}=o.getWindow(e);return e instanceof t?e:o.getOwnerDocument(e)}(e.event.target)){this.props=e,this.events=t,this.autoScrollEnabled=!0,this.activated=!1,this.timeoutId=null;const{event:r}=e,{target:a}=r;this.props=e,this.events=t,this.document=o.getOwnerDocument(a),this.documentListeners=new ee(this.document),this.listeners=new ee(n),this.windowListeners=new ee(o.getWindow(a)),this.initialCoordinates=o.getEventCoordinates(r),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(ne.Resize,this.handleCancel),this.windowListeners.add(ne.DragStart,oe),this.windowListeners.add(ne.VisibilityChange,this.handleCancel),this.windowListeners.add(ne.ContextMenu,oe),this.documentListeners.add(ne.Keydown,this.handleKeydown),t){if(ce(t))return;if(de(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(ne.Click,ae,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ne.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){const{activated:t,initialCoordinates:n,props:r}=this,{onMove:a,options:{activationConstraint:s}}=r;if(!n)return;const i=o.getEventCoordinates(e),l=o.subtract(n,i);if(!t&&s){if(de(s))return te(l,s.tolerance)?this.handleCancel():void 0;if(ce(s))return null!=s.tolerance&&te(l,s.tolerance)?this.handleCancel():te(l,s.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),a(i)}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 pe extends ue{constructor(e){const{event:t}=e,n=o.getOwnerDocument(t.target);super(e,fe,n)}}pe.activators=[{eventName:"onPointerDown",handler:({nativeEvent:e},{onActivation:t})=>!(!e.isPrimary||0!==e.button||(null==t||t({event:e}),0))}];const he={move:{name:"mousemove"},end:{name:"mouseup"}};var ge;!function(e){e[e.RightClick=2]="RightClick"}(ge||(ge={}));class ve extends ue{constructor(e){super(e,he,o.getOwnerDocument(e.event.target))}}ve.activators=[{eventName:"onMouseDown",handler:({nativeEvent:e},{onActivation:t})=>e.button!==ge.RightClick&&(null==t||t({event:e}),!0)}];const ye={move:{name:"touchmove"},end:{name:"touchend"}};class be extends ue{constructor(e){super(e,ye)}static setup(){return window.addEventListener(ye.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ye.move.name,e)};function e(){}}}function me(e,{transform:t,...n}){return(null==e?void 0:e.length)?e.reduce((e,t)=>t({transform:e,...n}),t):t}be.activators=[{eventName:"onTouchStart",handler:({nativeEvent:e},{onActivation:t})=>{const{touches:n}=e;return!(n.length>1||(null==t||t({event:e}),0))}}];const xe=[{sensor:pe,options:{}},{sensor:le,options:{}}],we={current:{}},De=t.createContext({...y,scaleX:1,scaleY:1}),Ce=t.memo((function({id:e,autoScroll:a=!0,announcements:i,children:c,sensors:d=xe,collisionDetection:g=U,measuring:b,modifiers:m,screenReaderInstructions:x=s,...w}){var S,M,L,A,O;const K=t.useReducer(p,void 0,f),[B,I]=K,[P,q]=t.useState(()=>({type:null,event:null})),[W,z]=t.useState(!1),{draggable:{active:F,nodes:_,translate:G},droppable:{containers:Q}}=B,ee=F?_[F]:null,te=t.useRef({initial:null,translated:null}),ne=t.useMemo(()=>{var e;return null!=F?{id:F,data:null!=(e=null==ee?void 0:ee.data)?e:we,rect:te}:null},[F,ee]),re=t.useRef(null),[oe,ae]=t.useState(null),[se,ie]=t.useState(null),le=t.useRef(w),ce=o.useUniqueId("DndDescribedBy",e),de=t.useMemo(()=>Q.getEnabled(),[Q]),{layoutRectMap:ue,recomputeLayouts:fe,willRecomputeLayouts:pe}=function(e,{dragging:n,dependencies:r,config:a}){const[s,i]=t.useState(!1),{frequency:l,measure:c,strategy:d}={...H,...a},u=t.useRef(e),f=t.useCallback(()=>i(!0),[]),p=t.useRef(null),h=function(){switch(d){case exports.MeasuringStrategy.Always:return!1;case exports.MeasuringStrategy.BeforeDragging:return n;default:return!n}}(),g=o.useLazyMemo(t=>{if(h&&!n)return j;if(!t||t===j||u.current!==e||s){for(let t of e)t&&(t.rect.current=t.node.current?c(t.node.current):null);return function(e){const t=new Map;if(e)for(const n of e){if(!n)continue;const{id:e,rect:r}=n;null!=r.current&&t.set(e,r.current)}return t}(e)}return t},[e,n,h,c,s]);return t.useEffect(()=>{u.current=e},[e]),t.useEffect(()=>{s&&i(!1)},[s]),t.useEffect((function(){h||requestAnimationFrame(f)}),[n,h]),t.useEffect((function(){h||"number"!=typeof l||null!==p.current||(p.current=setTimeout(()=>{f(),p.current=null},l))}),[l,h,f,...r]),{layoutRectMap:g,recomputeLayouts:f,willRecomputeLayouts:s}}(de,{dragging:W,dependencies:[G.x,G.y],config:null==b?void 0:b.droppable}),he=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])}(_,F),ge=se?o.getEventCoordinates(se):null,ve=V(he,null!=(S=null==b||null==(M=b.draggable)?void 0:M.measure)?S:k),ye=X(he),be=t.useRef(null),Ce=be.current,Re=t.useRef({active:null,activeNode:he,collisionRect:null,droppableRects:ue,draggableNodes:_,draggingNodeRect:null,droppableContainers:Q,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null,translatedRect:null}),Ee=Q.getNodeFor(null==(L=Re.current.over)?void 0:L.id),Se=X(he?he.ownerDocument.defaultView:null),Me=X(he?he.parentElement:null),Le=function(e){const n=t.useRef(e),r=o.useLazyMemo(t=>e?t&&e&&n.current&&e.parentNode===n.current.parentNode?t:C(e):$,[e]);return t.useEffect(()=>{n.current=e},[e]),r}(F?null!=Ee?Ee:he:null),Te=Y(Le),Ae=function({disabled:e,forceRecompute:n}){const[r,a]=o.useNodeRef(),s=Z(e?null:J(r.current),n);return t.useMemo(()=>({nodeRef:r,rect:s,setRef:a}),[s,r,a])}({disabled:null==F,forceRecompute:pe}),Ne=null!=(A=Ae.rect)?A:ve,Oe=Ne===ve?(ke=Ce,(Ke=ve)&&ke?{x:Ke.left-ke.left,y:Ke.top-ke.top}:y):y;var Ke,ke;const Be=me(m,{transform:{x:G.x-Oe.x,y:G.y-Oe.y,scaleX:1,scaleY:1},activatorEvent:se,active:ne,activeNodeRect:ye,containerNodeRect:Me,draggingNodeRect:Ne,over:Re.current.over,overlayNodeRect:Ae.rect,scrollableAncestors:Le,scrollableAncestorRects:Te,windowRect:Se}),Ie=ge?o.add(ge,G):null,Pe=function(e){const[n,r]=t.useState(null),a=t.useRef(e),s=t.useCallback(e=>{const t=R(e.target);t&&r(e=>e?(e.set(t,E(t)),new Map(e)):null)},[]);return t.useEffect(()=>{const t=a.current;if(e!==t){n(t);const o=e.map(e=>{const t=R(e);return t?(t.addEventListener("scroll",s,{passive:!0}),[t,E(t)]):null}).filter(e=>null!=e);r(o.length?new Map(o):null),a.current=e}return()=>{n(e),n(t)};function n(e){e.forEach(e=>{const t=R(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),y):N(e):y,[e,n])}(Le),Ue=o.add(Be,Pe),qe=Ne?D(Ne,Be):null,We=qe?D(qe,Pe):null,ze=ne&&We?g({active:ne,collisionRect:We,droppableContainers:de}):null,[Fe,je]=t.useState(null),He=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Be,null!=(O=null==Fe?void 0:Fe.rect)?O:null,ve),$e=t.useCallback((e,{sensor:t,options:n})=>{if(!re.current)return;const o=_[re.current];if(!o)return;const a=new t({active:re.current,activeNode:o,event:e.nativeEvent,options:n,context:Re,onStart(e){const t=re.current;if(!t)return;const n=_[t];if(!n)return;const{onDragStart:o}=le.current,a={active:{id:t,data:n.data,rect:te}};r.unstable_batchedUpdates(()=>{I({type:l.DragStart,initialCoordinates:e,active:t}),q({type:l.DragStart,event:a})}),null==o||o(a)},onMove(e){I({type:l.DragMove,coordinates:e})},onEnd:s(l.DragEnd),onCancel:s(l.DragCancel)});function s(e){return async function(){const{active:t,over:n,scrollAdjustedTranslate:o}=Re.current;let a=null;if(t&&o){const{cancelDrop:r}=le.current;a={active:t,delta:o,over:n},e===l.DragEnd&&"function"==typeof r&&await Promise.resolve(r(a))&&(e=l.DragCancel)}if(re.current=null,r.unstable_batchedUpdates(()=>{I({type:e}),je(null),z(!1),ae(null),ie(null),a&&q({type:e,event:a})}),a){const{onDragCancel:t,onDragEnd:n}=le.current,r=e===l.DragEnd?n:t;null==r||r(a)}}}r.unstable_batchedUpdates(()=>{ae(a),ie(e.nativeEvent)})},[I,_]),Xe=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!==re.current||o.dndKit||o.defaultPrevented||!0===e(n,t.options)&&(o.dndKit={capturedBy:t.sensor},re.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(()=>{le.current=w},Object.values(w)),t.useEffect(()=>{null!=F&&z(!0)},[F]),t.useEffect(()=>{ne||(be.current=null),ne&&ve&&!be.current&&(be.current=ve)},[ve,ne]),t.useEffect(()=>{const{onDragMove:e}=le.current,{active:t,over:n}=Re.current;if(!t)return;const r={active:t,delta:{x:Ue.x,y:Ue.y},over:n};q({type:l.DragMove,event:r}),null==e||e(r)},[Ue.x,Ue.y]),t.useEffect(()=>{const{active:e,droppableContainers:t,scrollAdjustedTranslate:n}=Re.current;if(!e||!re.current||!n)return;const{onDragOver:o}=le.current,a=t.get(ze),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,i={active:e,delta:{x:n.x,y:n.y},over:s};r.unstable_batchedUpdates(()=>{je(s),q({type:l.DragOver,event:i}),null==o||o(i)})},[ze]),o.useIsomorphicLayoutEffect(()=>{Re.current={active:ne,activeNode:he,collisionRect:We,droppableRects:ue,draggableNodes:_,draggingNodeRect:Ne,droppableContainers:Q,over:Fe,scrollableAncestors:Le,scrollAdjustedTranslate:Ue,translatedRect:qe},te.current={initial:Ne,translated:qe}},[ne,he,We,_,Ne,ue,Q,Fe,Le,Ue,qe]),function({acceleration:e,activator:n=exports.AutoScrollActivator.Pointer,canScroll:r,draggingRect:a,enabled:s,interval:i=5,order:l=exports.TraversalOrder.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,threshold:f}){const[p,h]=o.useInterval(),g=t.useRef({x:1,y:1}),v=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 a}return null},[n,a,c]),b=t.useRef(y),m=t.useRef(null),x=t.useCallback(()=>{const e=m.current;e&&e.scrollBy(g.current.x*b.current.x,g.current.y*b.current.y)},[]),w=t.useMemo(()=>l===exports.TraversalOrder.TreeOrder?[...d].reverse():d,[l,d]);t.useEffect(()=>{if(s&&d.length&&v){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:a,speed:s}=T(t,o,v,e,f);if(s.x>0||s.y>0)return h(),m.current=t,p(x,i),g.current=s,void(b.current=a)}g.current={x:0,y:0},b.current={x:0,y:0},h()}else h()},[e,x,r,h,s,i,JSON.stringify(v),p,d,w,u,JSON.stringify(f)])}({...function(){const e=!(!1===(null==oe?void 0:oe.autoScrollEnabled)||("object"==typeof a?!1===a.enabled:!1===a));return"object"==typeof a?{...a,enabled:e}:{enabled:e}}(),draggingRect:qe,pointerCoordinates:Ie,scrollableAncestors:Le,scrollableAncestorRects:Te});const Ye=t.useMemo(()=>({active:ne,activeNode:he,activeNodeRect:ve,activeNodeClientRect:ye,activatorEvent:se,activators:Xe,ariaDescribedById:{draggable:ce},containerNodeRect:Me,dispatch:I,dragOverlay:Ae,draggableNodes:_,droppableContainers:Q,droppableRects:ue,over:Fe,recomputeLayouts:fe,scrollableAncestors:Le,scrollableAncestorRects:Te,willRecomputeLayouts:pe,windowRect:Se}),[ne,he,ye,ve,se,Xe,Me,Ae,I,_,ce,Q,ue,Fe,fe,Le,Te,pe,Se]);return n.createElement(h.Provider,{value:P},n.createElement(u.Provider,{value:Ye},n.createElement(De.Provider,{value:He},c)),n.createElement(v,{announcements:i,hiddenTextDescribedById:ce,screenReaderInstructions:x}))})),Re=t.createContext(null),Ee="button";function Se(){return t.useContext(u)}const Me=e=>o.isKeyboardEvent(e)?"transform 250ms ease":void 0,Le={duration:250,easing:"ease",dragSourceOpacity:0},Te=n.memo(({adjustScale:e=!1,children:r,dropAnimation:a=Le,style:s,transition:i=Me,modifiers:l,wrapperElement:c="div",className:d,zIndex:u=999})=>{var f,p;const{active:h,activeNodeRect:g,activeNodeClientRect:v,containerNodeRect:y,draggableNodes:b,activatorEvent:x,over:w,dragOverlay:D,scrollableAncestors:C,scrollableAncestorRects:R,windowRect:E}=Se(),S=t.useContext(De),M=me(l,{activatorEvent:x,active:h,activeNodeRect:v,containerNodeRect:y,draggingNodeRect:D.rect,over:w,overlayNodeRect:D.rect,scrollableAncestors:C,scrollableAncestorRects:R,transform:S,windowRect:E}),L=null!==h,T=e?M:{...M,scaleX:1,scaleY:1},A=o.useLazyMemo(e=>L?null!=e?e:g:null,[L,g]),N=A?{position:"fixed",width:A.width,height:A.height,top:A.top,left:A.left,zIndex:u,transform:o.CSS.Transform.toString(T),touchAction:"none",transformOrigin:e&&x?m(x,A):void 0,transition:"function"==typeof i?i(x):i,...s}:void 0,O=L?{style:N,children:r,className:d,transform:T}:void 0,K=t.useRef(O),B=null!=O?O:K.current,{children:I,...P}=null!=B?B:{},U=t.useRef(null!=(f=null==h?void 0:h.id)?f:null),q=function({animate:e,adjustScale:n,activeId:r,draggableNodes:a,duration:s,easing:i,dragSourceOpacity:l,node:c,transform:d}){const[u,f]=t.useState(!1);return t.useEffect(()=>{e&&r&&i&&s?requestAnimationFrame(()=>{var e;const t=null==(e=a[r])?void 0:e.node.current;if(d&&c&&t&&null!==t.parentNode){const e=J(c);if(e){const r=e.getBoundingClientRect(),a=k(t),u={x:r.left-a.left,y:r.top-a.top};if(Math.abs(u.x)||Math.abs(u.y)){const e=o.CSS.Transform.toString({x:d.x-u.x,y:d.y-u.y,scaleX:n?a.width*d.scaleX/r.width:1,scaleY:n?a.height*d.scaleY/r.height:1}),p=t.style.opacity;return null!=l&&(t.style.opacity=""+l),void(c.animate([{transform:o.CSS.Transform.toString(d)},{transform:e}],{easing:i,duration:s}).onfinish=()=>{c.style.display="none",f(!0),t&&null!=l&&(t.style.opacity=p)})}}}f(!0)}):e&&f(!0)},[e,r,n,a,s,i,l,c,d]),o.useIsomorphicLayoutEffect(()=>{u&&f(!1)},[u]),u}({animate:Boolean(a&&U.current&&!h),adjustScale:e,activeId:U.current,draggableNodes:b,duration:null==a?void 0:a.duration,easing:null==a?void 0:a.easing,dragSourceOpacity:null==a?void 0:a.dragSourceOpacity,node:D.nodeRef.current,transform:null==(p=K.current)?void 0:p.transform}),W=Boolean(I&&(r||a&&!q));return t.useEffect(()=>{var e;(null==h?void 0:h.id)!==U.current&&(U.current=null!=(e=null==h?void 0:h.id)?e:null),h&&K.current!==O&&(K.current=O)},[h,O]),t.useEffect(()=>{q&&(K.current=void 0)},[q]),W?n.createElement(c,{...P,ref:D.setRef},I):null});exports.DndContext=Ce,exports.DragOverlay=Te,exports.KeyboardSensor=le,exports.MouseSensor=ve,exports.PointerSensor=pe,exports.TouchSensor=be,exports.applyModifiers=me,exports.closestCenter=({collisionRect:e,droppableContainers:t})=>{const n=x(e,e.left,e.top);let r=Infinity,o=null;for(const e of t){const{rect:{current:t}}=e;if(t){const a=b(x(t),n);a<r&&(r=a,o=e.id)}}return o},exports.closestCorners=({collisionRect:e,droppableContainers:t})=>{let n=Infinity,r=null;const o=I(e,e.left,e.top);for(const e of t){const{rect:{current:t}}=e;if(t){const a=I(t,B(t)?t.left:void 0,B(t)?t.top:void 0),s=o.reduce((e,t,n)=>e+b(a[n],t),0),i=Number((s/4).toFixed(4));i<n&&(n=i,r=e.id)}}return r},exports.defaultAnnouncements=i,exports.defaultCoordinates=y,exports.defaultDropAnimation=Le,exports.getBoundingClientRect=K,exports.getLayoutRect=O,exports.getScrollableAncestors=C,exports.getViewRect=k,exports.getViewportLayoutRect=function(e){const{width:t,height:n,top:r,left:o}=e.getBoundingClientRect(),a=N(C(e));return{width:t,height:n,offsetTop:r+a.y,offsetLeft:o+a.x}},exports.rectIntersection=U,exports.useDndContext=Se,exports.useDndMonitor=g,exports.useDraggable=function({id:e,data:n,disabled:r=!1,attributes:a}){const s=o.useUniqueId("Droppable"),{active:i,activeNodeRect:l,activatorEvent:c,ariaDescribedById:d,draggableNodes:f,droppableRects:p,activators:h,over:g}=t.useContext(u),{role:v=Ee,roleDescription:y="draggable",tabIndex:b=0}=null!=a?a:{},m=(null==i?void 0:i.id)===e,x=t.useContext(m?De:Re),[w,D]=o.useNodeRef(),C=function(e,n){return t.useMemo(()=>e.reduce((e,{eventName:t,handler:r})=>(e[t]=e=>{r(e,n)},e),{}),[e,n])}(h,e),R=F(n);return t.useEffect(()=>(f[e]={id:e,key:s,node:w,data:R},()=>{const t=f[e];t&&t.key===s&&delete f[e]}),[f,e]),{active:i,activeNodeRect:l,activatorEvent:c,attributes:t.useMemo(()=>({role:v,tabIndex:b,"aria-pressed":!(!m||v!==Ee)||void 0,"aria-roledescription":y,"aria-describedby":d.draggable}),[v,b,m,y,d.draggable]),droppableRects:p,isDragging:m,listeners:r?void 0:C,node:w,over:g,setNodeRef:D,transform:x}},exports.useDroppable=function({data:e,disabled:n=!1,id:r}){const a=o.useUniqueId("Droppable"),{active:s,dispatch:i,over:c}=t.useContext(u),d=t.useRef(null),[f,p]=o.useNodeRef(),h=F(e);return o.useIsomorphicLayoutEffect(()=>(i({type:l.RegisterDroppable,element:{id:r,key:a,disabled:n,node:f,rect:d,data:h}}),()=>i({type:l.UnregisterDroppable,key:a,id:r})),[r]),t.useEffect(()=>{i({type:l.SetDroppableDisabled,id:r,key:a,disabled:n})},[n]),{active:s,rect:d,isOver:(null==c?void 0:c.id)===r,node:f,over:c,setNodeRef:p}},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 a={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 "},s={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={activatorEvent:null,activators:[],active:null,activeNodeRect:null,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 a=new d(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}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 a=t.useContext(b),s=t.useRef(a);t.useEffect(()=>{if(a!==s.current){const{type:t,event:c}=a;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)}s.current=a}},[a,e,n,r,o,i])}function y({announcements:e=s,hiddenTextDescribedById:a,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:a,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 E({data:{value:e}},{data:{value:t}}){return t-e}function R({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 a=(o-r)*(i-n);return Number((a/(t.width*t.height+e.width*e.height-a)).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(E)};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,a,s;if(t.startsWith("matrix3d("))r=t.slice(9,-1).split(/, /),o=+r[0],i=+r[5],a=+r[12],s=+r[13];else{if(!t.startsWith("matrix("))return e;r=t.slice(7,-1).split(/, /),o=+r[0],i=+r[3],a=+r[4],s=+r[5]}const l=e.left-a-(1-o)*parseFloat(n),c=e.top-s-(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:a,height:s,bottom:l,right:c}=n;return{top:r,left:i,width:a,height:s,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),a=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,a)&&t.push(r),function(e,t=o.getWindow(e).getComputedStyle(e)){return"fixed"===t.position}(r,a)?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:a},s=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=s*Math.abs((u.top+y-n)/y)):!g&&a>=u.bottom-y&&(b.y=F.Forward,m.y=s*Math.abs((u.bottom-y-a)/y)),!f&&i>=u.right-x?(b.x=F.Forward,m.x=s*Math.abs((u.right-x-i)/x)):!v&&r<=u.left+x&&(b.x=F.Backward,m.x=s*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 a=t.useRef(r);return o.useLazyMemo(t=>r.length?i||!t&&r.length||r!==a.current?r.map(t=>new V(e(t),t)):null!=t?t:n:n,[r,i])}}function ae(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return o.isHTMLElement(t)?t:e}class se{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 se(o.getOwnerDocument(t)),this.windowListeners=new se(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:a=pe,coordinateGetter:s=ge,scrollBehavior:l="smooth"}=i,{code:c}=e;if(a.end.includes(c))return void this.handleEnd(e);if(a.cancel.includes(c))return void this.handleCancel(e);const d=s(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,a=o.subtract(d,t),{isTop:s,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&&!s;if(b&&f.x!==d.x){if(i===exports.KeyboardCode.Right&&r.scrollLeft+a.x<=p.x||i===exports.KeyboardCode.Left&&r.scrollLeft+a.x>=g.x)return void r.scrollBy({left:a.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+a.y<=p.y||i===exports.KeyboardCode.Up&&r.scrollTop+a.y>=g.y)return void r.scrollBy({top:a.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:a}=i;this.props=e,this.events=t,this.document=o.getOwnerDocument(a),this.documentListeners=new se(this.document),this.listeners=new se(n),this.windowListeners=new se(o.getWindow(a)),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:a,options:{activationConstraint:s}}=i;if(!r)return;const l=null!=(t=o.getEventCoordinates(e))?t:x,c=o.subtract(r,l);if(!n&&s){if(be(s))return le(c,s.tolerance)?this.handleCancel():void 0;if(fe(s))return null!=s.tolerance&&le(c,s.tolerance)?this.handleCancel():le(c,s.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),a(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 Ee={move:{name:"touchmove"},end:{name:"touchend"}};class Re extends me{constructor(e){super(e,Ee)}static setup(){return window.addEventListener(Ee.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ee.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}Re.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:s,children:c,sensors:d=Me,collisionDetection:u=L,measuring:h,modifiers:m,screenReaderInstructions:w=a,...C}){var D,E,R,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}),se=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[a,s]=t.useState(null),l=null!=a,{frequency:c,measure:d,strategy:u}={...Z,...i},h=t.useRef(e),p=t.useCallback((e=[])=>s(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=a;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,a,n,v,d]);return t.useEffect(()=>{h.current=e},[e]),t.useEffect(()=>{v||requestAnimationFrame(()=>p())},[n,v]),t.useEffect(()=>{l&&s(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==(E=h.draggable)?void 0:E.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}),Ee=J.getNodeFor(null==(R=De.current.over)?void 0:R.id),Re=function({measure:e=K}){const[n,r]=t.useState(null),i=t.useRef(e),a=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]),s=t.useMemo(()=>new ResizeObserver(a),[a]),l=t.useCallback(t=>{const n=ae(t);s.disconnect(),n&&s.observe(n),r(n?e(n):null)},[e,s]),[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=Re.nodeRef.current)?N:ye,Oe=null!=(A=Re.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!=Ee?Ee: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:se,activeNodeRect:we,containerNodeRect:Ce,draggingNodeRect:Oe,over:De.current.over,overlayNodeRect:Re.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),a=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",a,{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",a)})}},[a,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=se&&He?u({active:se,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:a(l.DragEnd),onCancel:a(l.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:i}=De.current;let a=null;if(t&&i){const{cancelDrop:r}=pe.current;a={active:t,collisions:n,delta:i,over:o},e===l.DragEnd&&"function"==typeof r&&await Promise.resolve(r(a))&&(e=l.DragCancel)}le.current=null,r.unstable_batchedUpdates(()=>{if(z({type:e}),Ve(null),$(!1),de(null),he(null),a&&q({type:e,event:a}),a){const{onDragCancel:t,onDragEnd:n}=pe.current,r=e===l.DragEnd?n:t;null==r||r(a)}})}}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(()=>{se||(Te.current=null),se&&we&&!Te.current&&(Te.current=we)},[we,se]),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,a=n.get(Xe),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,collisions:t,delta:{x:o.x,y:o.y},over:s};r.unstable_batchedUpdates(()=>{Ve(s),q({type:l.DragOver,event:c}),null==i||i(c)})},[Xe]),o.useIsomorphicLayoutEffect(()=>{De.current={active:se,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}},[se,ye,$e,He,_,Ae,Oe,fe,J,Ye,Pe,je]),function({acceleration:e,activator:n=exports.AutoScrollActivator.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:s=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(a&&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:a}=H(t,o,f,e,h);if(a.x>0||a.y>0)return g(),m.current=t,p(y,s),v.current=a,void(b.current=i)}v.current={x:0,y:0},b.current={x:0,y:0},g()}else g()},[e,y,r,g,a,s,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:se,activeNode:ye,activeNodeRect:we,activatorEvent:ue,collisions:$e,containerNodeRect:Ce,dragOverlay:Re,draggableNodes:_,droppableContainers:J,droppableRects:fe,over:Ye,measureDroppableContainers:be,scrollableAncestors:Pe,scrollableAncestorRects:ze,measuringScheduled:me,windowRect:Be}),[se,ye,we,ue,$e,Ce,Re,_,J,fe,Ye,be,Pe,ze,me,Be]),Ze=t.useMemo(()=>({activatorEvent:ue,activators:Je,active:se,activeNodeRect:we,ariaDescribedById:{draggable:ge},dispatch:z,draggableNodes:_,over:Ye,measureDroppableContainers:be}),[ue,Je,se,we,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:s,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:a,transition:s=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:E,scrollableAncestorRects:R,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:E,scrollableAncestorRects:R,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 s?s(x):s,...a}: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:a,dragSourceOpacity:s,easing:l,node:c,transform:d}){const[u,h]=t.useState(!1);return o.useIsomorphicLayoutEffect(()=>{var t;if(!(e&&r&&l&&a))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=ae(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!=s&&(u.style.opacity=""+s),void(c.animate([{transform:o.CSS.Transform.toString(d)},{transform:e}],{easing:l,duration:a}).onfinish=()=>{c.style.display="none",h(!0),u&&null!=s&&(u.style.opacity=p)})}}}h(!0)},[e,r,n,i,a,l,s,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=Re,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=R(e),r=[];for(const e of t){const{id:t,rect:{current:o}}=e;if(o){const i=R(o),a=n.reduce((e,t,n)=>e+w(i[n],t),0),s=Number((a/4).toFixed(4));r.push({id:t,data:{droppableContainer:e,value:s}})}}return r.sort(D)},exports.defaultAnnouncements=s,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=R(o).reduce((e,n)=>e+w(t,n),0),a=Number((i/4).toFixed(4));n.push({id:e,data:{droppableContainer:r,value:a}})}}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 a=o.useUniqueId("Droppable"),{activators:s,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:h,over:g}=t.useContext(p),{role:v=Te,roleDescription:f="draggable",tabIndex:b=0}=null!=i?i:{},m=(null==c?void 0:c.id)===e,y=t.useContext(m?Le:Oe),[x,w]=o.useNodeRef(),C=function(e,n){return t.useMemo(()=>e.reduce((e,{eventName:t,handler:r})=>(e[t]=e=>{r(e,n)},e),{}),[e,n])}(s,e),D=o.useLatestValue(n);return o.useIsomorphicLayoutEffect(()=>(h[e]={id:e,key:a,node:x,data:D},()=>{const t=h[e];t&&t.key===a&&delete h[e]}),[h,e]),{active:c,activatorEvent:l,activeNodeRect:d,attributes:t.useMemo(()=>({role:v,tabIndex:b,"aria-pressed":!(!m||v!==Te)||void 0,"aria-roledescription":f,"aria-describedby":u.draggable}),[v,b,m,f,u.draggable]),isDragging:m,listeners:r?void 0:C,node:x,over:g,setNodeRef:w,transform:y}},exports.useDroppable=function({data:e,disabled:n=!1,id:r,resizeObserverConfig:i}){const a=o.useUniqueId("Droppable"),{active:s,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(()=>!s||f?null:new ResizeObserver(x),[s,x,f]),C=t.useCallback((e,t)=>{w&&(t&&(w.unobserve(t),h.current=!1),e&&w.observe(e))},[w]),[D,E]=o.useNodeRef(C),R=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:a,disabled:n,node:D,rect:g,data:R}}),()=>c({type:l.UnregisterDroppable,key:a,id:r})),[r]),t.useEffect(()=>{c({type:l.SetDroppableDisabled,id:r,key:a,disabled:n})},[n]),{active:s,rect:g,isOver:(null==d?void 0:d.id)===r,node:D,over:d,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])}; | ||
//# 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>; |
@@ -18,4 +18,4 @@ /// <reference types="react" /> | ||
active: import("../store").Active | null; | ||
activeNodeRect: import("..").ViewRect | null; | ||
activatorEvent: Event | null; | ||
activeNodeRect: import("..").ClientRect | null; | ||
attributes: { | ||
@@ -28,5 +28,4 @@ role: string; | ||
}; | ||
droppableRects: import("../store").LayoutRectMap; | ||
isDragging: boolean; | ||
listeners: DraggableSyntheticListeners; | ||
listeners: SyntheticListenerMap | undefined; | ||
node: import("react").MutableRefObject<HTMLElement | null>; | ||
@@ -33,0 +32,0 @@ over: import("../store").Over | null; |
/// <reference types="react" /> | ||
import { Data } from '../store'; | ||
import type { LayoutRect } from '../types'; | ||
import type { ClientRect, UniqueIdentifier } from '../types'; | ||
interface ResizeObserverConfig { | ||
/** Whether the ResizeObserver should be disabled entirely */ | ||
disabled?: boolean; | ||
/** Resize events may affect the layout and position of other droppable containers. | ||
* Specify an array of `UniqueIdentifier` of droppable containers that should also be re-measured | ||
* when this droppable container resizes. Specifying an empty array re-measures all droppable containers. | ||
*/ | ||
updateMeasurementsFor?: UniqueIdentifier[]; | ||
/** Represents the debounce timeout between when resize events are observed and when elements are re-measured */ | ||
timeout?: number; | ||
} | ||
export interface UseDroppableArguments { | ||
id: string; | ||
id: UniqueIdentifier; | ||
disabled?: boolean; | ||
data?: Data; | ||
resizeObserverConfig?: ResizeObserverConfig; | ||
} | ||
export declare function useDroppable({ data, disabled, id, }: UseDroppableArguments): { | ||
export declare function useDroppable({ data, disabled, id, resizeObserverConfig, }: UseDroppableArguments): { | ||
active: import("../store").Active | null; | ||
rect: import("react").MutableRefObject<LayoutRect | null>; | ||
rect: import("react").MutableRefObject<ClientRect | null>; | ||
isOver: boolean; | ||
@@ -17,1 +29,2 @@ node: import("react").MutableRefObject<HTMLElement | null>; | ||
}; | ||
export {}; |
@@ -5,3 +5,2 @@ export { AutoScrollActivator, TraversalOrder, useAutoScroller, } from './useAutoScroller'; | ||
export { useCombineActivators } from './useCombineActivators'; | ||
export { useData } from './useData'; | ||
export { useDroppableMeasuring, MeasuringFrequency, MeasuringStrategy, } from './useDroppableMeasuring'; | ||
@@ -14,3 +13,3 @@ export type { DroppableMeasuring } from './useDroppableMeasuring'; | ||
export type { SyntheticListener, SyntheticListeners, SyntheticListenerMap, } from './useSyntheticListeners'; | ||
export { useRect, useClientRect, useClientRects, useViewRect } from './useRect'; | ||
export { useRect, useClientRect, useClientRects, useWindowRect } from './useRect'; | ||
export { useDragOverlayMeasuring } from './useDragOverlayMeasuring'; |
@@ -1,2 +0,2 @@ | ||
import type { Coordinates, ViewRect } from '../../types'; | ||
import type { Coordinates, ClientRect } from '../../types'; | ||
export declare type ScrollAncestorSortingFn = (ancestors: Element[]) => Element[]; | ||
@@ -20,7 +20,7 @@ export declare enum AutoScrollActivator { | ||
interface Arguments extends Options { | ||
draggingRect: ViewRect | null; | ||
draggingRect: ClientRect | null; | ||
enabled: boolean; | ||
pointerCoordinates: Coordinates | null; | ||
scrollableAncestors: Element[]; | ||
scrollableAncestorRects: ViewRect[]; | ||
scrollableAncestorRects: ClientRect[]; | ||
} | ||
@@ -27,0 +27,0 @@ export declare type CanScroll = (element: Element) => boolean; |
@@ -1,7 +0,7 @@ | ||
import type { DndContextDescriptor } from '../../store'; | ||
import type { PublicContextDescriptor } from '../../store'; | ||
import type { ClientRect } from '../../types'; | ||
interface Arguments { | ||
disabled: boolean; | ||
forceRecompute: boolean; | ||
measure?(element: HTMLElement): ClientRect; | ||
} | ||
export declare function useDragOverlayMeasuring({ disabled, forceRecompute, }: Arguments): DndContextDescriptor['dragOverlay']; | ||
export declare function useDragOverlayMeasuring({ measure, }: Arguments): PublicContextDescriptor['dragOverlay']; | ||
export {}; |
@@ -1,3 +0,3 @@ | ||
import type { DroppableContainer, LayoutRectMap } from '../../store/types'; | ||
import type { LayoutRect } from '../../types'; | ||
import type { DroppableContainer, RectMap } from '../../store/types'; | ||
import type { ClientRect, UniqueIdentifier } from '../../types'; | ||
interface Arguments { | ||
@@ -16,3 +16,3 @@ dragging: boolean; | ||
} | ||
declare type MeasuringFunction = (element: HTMLElement) => LayoutRect; | ||
declare type MeasuringFunction = (element: HTMLElement) => ClientRect; | ||
export interface DroppableMeasuring { | ||
@@ -24,6 +24,6 @@ measure: MeasuringFunction; | ||
export declare function useDroppableMeasuring(containers: DroppableContainer[], { dragging, dependencies, config }: Arguments): { | ||
layoutRectMap: LayoutRectMap; | ||
recomputeLayouts: () => void; | ||
willRecomputeLayouts: boolean; | ||
droppableRects: RectMap; | ||
measureDroppableContainers: (ids?: UniqueIdentifier[]) => void; | ||
measuringScheduled: boolean; | ||
}; | ||
export {}; |
@@ -1,8 +0,9 @@ | ||
import type { LayoutRect } from '../../types'; | ||
declare type RectFn<T, U> = (element: U) => T; | ||
export declare const useViewRect: (element: HTMLElement | null, forceRecompute?: boolean | undefined) => import("../../types").ViewRect | null; | ||
export declare const useClientRect: (element: HTMLElement | (Window & typeof globalThis) | null, forceRecompute?: boolean | undefined) => import("../../types").ClientRect | null; | ||
export declare const useClientRects: (elements: Element[], forceRecompute?: boolean | undefined) => import("../../types").ClientRect[]; | ||
export declare function useRect<T = LayoutRect, U extends Element | Window = HTMLElement>(element: U | null, getRect: (element: U) => T, forceRecompute?: boolean): T | null; | ||
export declare function createUseRectFn<T = LayoutRect, U extends Element | Window = HTMLElement>(getRect: RectFn<T, U>): (element: U | null, forceRecompute?: boolean | undefined) => T | null; | ||
import { Rect } from '../../utilities/rect'; | ||
import type { ClientRect } from '../../types'; | ||
declare type RectFn<T> = (element: T) => ClientRect; | ||
export declare const useClientRect: (element: HTMLElement | null, forceRecompute?: boolean | undefined) => Rect | null; | ||
export declare const useClientRects: (elements: HTMLElement[], forceRecompute?: boolean | undefined) => Rect[]; | ||
export declare function useRect<T extends HTMLElement>(element: T | null, getRect: (element: T) => ClientRect, forceRecompute?: boolean): Rect | null; | ||
export declare function createUseRectFn<T extends HTMLElement>(getRect: RectFn<T>): (element: T | null, forceRecompute?: boolean | undefined) => Rect | null; | ||
export declare function useWindowRect(element: typeof window | null): ClientRect | null; | ||
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 { DistanceMeasurement, DragEndEvent, DragMoveEvent, DragOverEvent, DragStartEvent, DragCancelEvent, LayoutRect, Translate, UniqueIdentifier, ViewRect, } from './types'; | ||
export { defaultCoordinates, getBoundingClientRect, getViewRect, getLayoutRect, getViewportLayoutRect, getScrollableAncestors, closestCenter, closestCorners, rectIntersection, } from './utilities'; | ||
export type { CollisionDetection } from './utilities'; | ||
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'; |
import type { Transform } from '@dnd-kit/utilities'; | ||
import type { Active, Over } from '../store'; | ||
import type { ClientRect, ViewRect } from '../types'; | ||
import type { ClientRect } from '../types'; | ||
export declare type Modifier = (args: { | ||
activatorEvent: Event | null; | ||
active: Active | null; | ||
activeNodeRect: ViewRect | null; | ||
draggingNodeRect: ViewRect | null; | ||
containerNodeRect: ViewRect | null; | ||
activeNodeRect: ClientRect | null; | ||
draggingNodeRect: ClientRect | null; | ||
containerNodeRect: ClientRect | null; | ||
over: Over | null; | ||
overlayNodeRect: ViewRect | null; | ||
overlayNodeRect: ClientRect | null; | ||
scrollableAncestors: Element[]; | ||
scrollableAncestorRects: ViewRect[]; | ||
scrollableAncestorRects: ClientRect[]; | ||
transform: Transform; | ||
@@ -15,0 +15,0 @@ windowRect: ClientRect | null; |
import type { MutableRefObject } from 'react'; | ||
import type { Active, Over, DraggableNode, DraggableNodes, DroppableContainers, LayoutRectMap } from '../store'; | ||
import type { Coordinates, LayoutRect, SyntheticEventName, Translate, UniqueIdentifier, ViewRect } from '../types'; | ||
import type { Active, Over, DraggableNode, DraggableNodes, DroppableContainers, RectMap } from '../store'; | ||
import type { Coordinates, SyntheticEventName, Translate, UniqueIdentifier, ClientRect } from '../types'; | ||
import type { Collision } from '../utilities/algorithms'; | ||
export declare enum Response { | ||
@@ -12,6 +13,8 @@ Start = "start", | ||
activeNode: HTMLElement | null; | ||
collisionRect: ViewRect | null; | ||
collisionRect: ClientRect | null; | ||
collisions: Collision[] | null; | ||
draggableNodes: DraggableNodes; | ||
draggingNodeRect: LayoutRect | null; | ||
droppableRects: LayoutRectMap; | ||
draggingNode: HTMLElement | null; | ||
draggingNodeRect: ClientRect | null; | ||
droppableRects: RectMap; | ||
droppableContainers: DroppableContainers; | ||
@@ -21,3 +24,2 @@ over: Over | null; | ||
scrollAdjustedTranslate: Translate | null; | ||
translatedRect: ViewRect | null; | ||
}; | ||
@@ -24,0 +26,0 @@ export declare type SensorOptions = {}; |
/// <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, LayoutRectMap, Over, State, } from './types'; | ||
export type { Active, Data, DataRef, DraggableElement, DraggableNode, DraggableNodes, DroppableContainer, DroppableContainers, PublicContextDescriptor, InternalContextDescriptor, RectMap, Over, State, } from './types'; |
import type { MutableRefObject } from 'react'; | ||
import type { Coordinates, ViewRect, ClientRect, LayoutRect, UniqueIdentifier } from '../types'; | ||
import type { Coordinates, ClientRect, UniqueIdentifier } from '../types'; | ||
import type { Collision } from '../utilities/algorithms'; | ||
import type { SyntheticListeners } from '../hooks/utilities'; | ||
@@ -21,3 +22,3 @@ import type { Actions } from './actions'; | ||
node: MutableRefObject<HTMLElement | null>; | ||
rect: MutableRefObject<LayoutRect | null>; | ||
rect: MutableRefObject<ClientRect | null>; | ||
} | ||
@@ -28,4 +29,4 @@ export interface Active { | ||
rect: MutableRefObject<{ | ||
initial: ViewRect | null; | ||
translated: ViewRect | null; | ||
initial: ClientRect | null; | ||
translated: ClientRect | null; | ||
}>; | ||
@@ -35,3 +36,3 @@ } | ||
id: UniqueIdentifier; | ||
rect: LayoutRect; | ||
rect: ClientRect; | ||
disabled: boolean; | ||
@@ -48,3 +49,3 @@ data: DataRef; | ||
export declare type DroppableContainers = DroppableContainersMap; | ||
export declare type LayoutRectMap = Map<UniqueIdentifier, LayoutRect>; | ||
export declare type RectMap = Map<UniqueIdentifier, ClientRect>; | ||
export interface State { | ||
@@ -61,28 +62,36 @@ droppable: { | ||
} | ||
export interface DndContextDescriptor { | ||
dispatch: React.Dispatch<Actions>; | ||
activators: SyntheticListeners; | ||
export interface PublicContextDescriptor { | ||
activatorEvent: Event | null; | ||
active: Active | null; | ||
activeNode: HTMLElement | null; | ||
activeNodeRect: ViewRect | null; | ||
activeNodeClientRect: ClientRect | null; | ||
ariaDescribedById: { | ||
draggable: UniqueIdentifier; | ||
}; | ||
containerNodeRect: ViewRect | null; | ||
activeNodeRect: ClientRect | null; | ||
collisions: Collision[] | null; | ||
containerNodeRect: ClientRect | null; | ||
draggableNodes: DraggableNodes; | ||
droppableContainers: DroppableContainers; | ||
droppableRects: LayoutRectMap; | ||
droppableRects: RectMap; | ||
over: Over | null; | ||
dragOverlay: { | ||
nodeRef: MutableRefObject<HTMLElement | null>; | ||
rect: ViewRect | null; | ||
rect: ClientRect | null; | ||
setRef: (element: HTMLElement | null) => void; | ||
}; | ||
scrollableAncestors: Element[]; | ||
scrollableAncestorRects: ViewRect[]; | ||
recomputeLayouts(): void; | ||
willRecomputeLayouts: boolean; | ||
scrollableAncestorRects: ClientRect[]; | ||
measureDroppableContainers(ids: UniqueIdentifier[]): void; | ||
measuringScheduled: boolean; | ||
windowRect: ClientRect | null; | ||
} | ||
export interface InternalContextDescriptor { | ||
activatorEvent: Event | null; | ||
activators: SyntheticListeners; | ||
active: Active | null; | ||
activeNodeRect: ClientRect | null; | ||
ariaDescribedById: { | ||
draggable: UniqueIdentifier; | ||
}; | ||
dispatch: React.Dispatch<Actions>; | ||
draggableNodes: DraggableNodes; | ||
over: Over | null; | ||
measureDroppableContainers(ids: UniqueIdentifier[]): void; | ||
} |
@@ -5,16 +5,2 @@ import type { Coordinates } from '@dnd-kit/utilities'; | ||
export declare type Translate = Coordinates; | ||
export interface LayoutRect { | ||
width: number; | ||
height: number; | ||
offsetLeft: number; | ||
offsetTop: number; | ||
} | ||
export interface ViewRect extends LayoutRect { | ||
top: number; | ||
left: number; | ||
right: number; | ||
bottom: number; | ||
} | ||
export interface ClientRect extends ViewRect { | ||
} | ||
export interface ScrollCoordinates { | ||
@@ -21,0 +7,0 @@ initial: Coordinates; |
import type { Active, Over } from '../store'; | ||
import type { Collision } from '../utilities/algorithms'; | ||
import type { Translate } from './coordinates'; | ||
interface DragEvent { | ||
active: Active; | ||
collisions: Collision[] | null; | ||
delta: Translate; | ||
@@ -6,0 +8,0 @@ over: Over | null; |
@@ -1,2 +0,2 @@ | ||
export type { Coordinates, ClientRect, DistanceMeasurement, LayoutRect, ViewRect, Translate, ScrollCoordinates, } from './coordinates'; | ||
export type { Coordinates, DistanceMeasurement, Translate, ScrollCoordinates, } from './coordinates'; | ||
export { Direction } from './direction'; | ||
@@ -6,1 +6,2 @@ export type { DragStartEvent, DragCancelEvent, DragEndEvent, DragMoveEvent, DragOverEvent, } from './events'; | ||
export type { SyntheticEventName } from './react'; | ||
export type { ClientRect } from './rect'; |
import type { CollisionDetection } from './types'; | ||
/** | ||
* Returns the closest rectangle from an array of rectangles to the center of a given | ||
* Returns the closest rectangles from an array of rectangles to the center of a given | ||
* rectangle. | ||
*/ | ||
export declare const closestCenter: CollisionDetection; |
import type { CollisionDetection } from './types'; | ||
/** | ||
* Returns the closest rectangle from an array of rectangles to the corners of | ||
* Returns the closest rectangles from an array of rectangles to the corners of | ||
* another rectangle. | ||
*/ | ||
export declare const closestCorners: CollisionDetection; |
export { closestCenter } from './closestCenter'; | ||
export { closestCorners } from './closestCorners'; | ||
export { rectIntersection } from './rectIntersection'; | ||
export type { CollisionDetection } from './types'; | ||
export { pointerWithin } from './pointerWithin'; | ||
export type { Collision, CollisionDescriptor, CollisionDetection } from './types'; | ||
export { getFirstCollision } from './helpers'; |
@@ -0,6 +1,11 @@ | ||
import type { ClientRect } from '../../types'; | ||
import type { CollisionDetection } from './types'; | ||
/** | ||
* Returns the rectangle that has the greatest intersection area with a given | ||
* Returns the intersecting rectangle area between two rectangles | ||
*/ | ||
export declare function getIntersectionRatio(entry: ClientRect, target: ClientRect): number; | ||
/** | ||
* Returns the rectangles that has the greatest intersection area with a given | ||
* rectangle in an array of rectangles. | ||
*/ | ||
export declare const rectIntersection: CollisionDetection; |
@@ -1,7 +0,19 @@ | ||
import type { Active, DroppableContainer } from '../../store'; | ||
import type { UniqueIdentifier, ViewRect } from '../../types'; | ||
import type { Active, Data, DroppableContainer } from '../../store'; | ||
import type { Coordinates, ClientRect, UniqueIdentifier } from '../../types'; | ||
export interface Collision { | ||
id: UniqueIdentifier; | ||
data?: Data; | ||
} | ||
export interface CollisionDescriptor extends Collision { | ||
data: { | ||
droppableContainer: DroppableContainer; | ||
value: number; | ||
[key: string]: any; | ||
}; | ||
} | ||
export declare type CollisionDetection = (args: { | ||
active: Active; | ||
collisionRect: ViewRect; | ||
collisionRect: ClientRect; | ||
droppableContainers: DroppableContainer[]; | ||
}) => UniqueIdentifier | null; | ||
pointerCoordinates: Coordinates | null; | ||
}) => Collision[]; |
@@ -0,1 +1,2 @@ | ||
import type { ClientRect } from '../../types'; | ||
export declare function getRelativeTransformOrigin(event: MouseEvent | TouchEvent | KeyboardEvent, rect: ClientRect): string; |
@@ -1,6 +0,6 @@ | ||
export { closestCenter, closestCorners, rectIntersection } from './algorithms'; | ||
export type { CollisionDetection } from './algorithms'; | ||
export { closestCenter, closestCorners, rectIntersection, getFirstCollision, pointerWithin, } from './algorithms'; | ||
export type { Collision, CollisionDescriptor, CollisionDetection, } from './algorithms'; | ||
export { defaultCoordinates, distanceBetween, getRelativeTransformOrigin, } from './coordinates'; | ||
export { adjustScale, getAdjustedRect, getRectDelta, getLayoutRect, getViewportLayoutRect, getBoundingClientRect, getViewRect, isViewRect, } from './rect'; | ||
export { Rect, adjustScale, getAdjustedRect, getClientRect, getTransformAgnosticClientRect, getWindowClientRect, getRectDelta, } from './rect'; | ||
export { noop } from './other'; | ||
export { getScrollableAncestors, getScrollableElement, getScrollCoordinates, getScrollDirectionAndSpeed, getScrollElementRect, getScrollOffsets, getScrollPosition, isDocumentScrollingElement, } from './scroll'; |
import type { Transform } from '@dnd-kit/utilities'; | ||
import type { LayoutRect } from '../../types'; | ||
export declare function adjustScale(transform: Transform, rect1: LayoutRect | null, rect2: LayoutRect | null): Transform; | ||
import type { ClientRect } from '../../types'; | ||
export declare function adjustScale(transform: Transform, rect1: ClientRect | null, rect2: ClientRect | null): Transform; |
@@ -1,5 +0,25 @@ | ||
import type { ClientRect, LayoutRect, ViewRect } from '../../types'; | ||
export declare function getLayoutRect(element: HTMLElement): LayoutRect; | ||
export declare function getViewportLayoutRect(element: HTMLElement): LayoutRect; | ||
export declare function getBoundingClientRect(element: HTMLElement | typeof window): ClientRect; | ||
export declare function getViewRect(element: HTMLElement): ViewRect; | ||
import type { ClientRect } from '../../types'; | ||
interface Options { | ||
ignoreTransform?: boolean; | ||
} | ||
/** | ||
* Returns the bounding client rect of an element relative to the viewport. | ||
*/ | ||
export declare function getClientRect(element: HTMLElement, options?: Options): { | ||
top: number; | ||
left: number; | ||
width: number; | ||
height: number; | ||
bottom: number; | ||
right: number; | ||
}; | ||
/** | ||
* Returns the bounding client rect of an element relative to the viewport. | ||
* | ||
* @remarks | ||
* The ClientRect returned by this method does not take into account transforms | ||
* applied to the element it measures. | ||
* | ||
*/ | ||
export declare function getTransformAgnosticClientRect(element: HTMLElement): ClientRect; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import type { Coordinates, ViewRect } from '../../types'; | ||
export declare function getRectDelta(rect1: ViewRect | null, rect2: ViewRect | null): Coordinates; | ||
import type { Coordinates, ClientRect } from '../../types'; | ||
export declare function getRectDelta(rect1: ClientRect | null, rect2: ClientRect | null): Coordinates; |
export { adjustScale } from './adjustScale'; | ||
export { getRectDelta } from './getRectDelta'; | ||
export { getAdjustedRect } from './rectAdjustment'; | ||
export { getBoundingClientRect, getLayoutRect, getViewportLayoutRect, getViewRect, } from './getRect'; | ||
export { isViewRect } from './isViewRect'; | ||
export { getClientRect, getTransformAgnosticClientRect } from './getRect'; | ||
export { getWindowClientRect } from './getWindowClientRect'; | ||
export { Rect } from './Rect'; |
@@ -1,3 +0,3 @@ | ||
import type { Coordinates, ViewRect } from '../../types'; | ||
export declare function createRectAdjustmentFn(modifier: number): (viewRect: ViewRect, ...adjustments: Coordinates[]) => ViewRect; | ||
export declare const getAdjustedRect: (viewRect: ViewRect, ...adjustments: Coordinates[]) => ViewRect; | ||
import type { Coordinates, ClientRect } from '../../types'; | ||
export declare function createRectAdjustmentFn(modifier: number): (rect: ClientRect, ...adjustments: Coordinates[]) => ClientRect; | ||
export declare const getAdjustedRect: (rect: ClientRect, ...adjustments: Coordinates[]) => ClientRect; |
import type { Coordinates } from '../../types'; | ||
export declare function getScrollXCoordinate(element: Element | typeof window): number; | ||
export declare function getScrollYCoordinate(element: Element | typeof window): number; | ||
export declare function getScrollCoordinates(element: Element | typeof window): Coordinates; |
@@ -1,5 +0,5 @@ | ||
import { ViewRect } from '../../types'; | ||
interface Rect extends Pick<ViewRect, 'top' | 'left' | 'right' | 'bottom'> { | ||
import { ClientRect } from '../../types'; | ||
interface PositionalCoordinates extends Pick<ClientRect, 'top' | 'left' | 'right' | 'bottom'> { | ||
} | ||
export declare function getScrollDirectionAndSpeed(scrollContainer: Element, scrollContainerRect: ViewRect, { top, left, right, bottom }: Rect, acceleration?: number, thresholdPercentage?: { | ||
export declare function getScrollDirectionAndSpeed(scrollContainer: Element, scrollContainerRect: ClientRect, { top, left, right, bottom }: PositionalCoordinates, acceleration?: number, thresholdPercentage?: { | ||
x: number; | ||
@@ -6,0 +6,0 @@ y: number; |
import type { Coordinates } from '../../types'; | ||
export declare function getScrollOffsets(scrollableAncestors: Element[]): Coordinates; | ||
export declare function getScrollXOffset(scrollableAncestors: Element[]): number; | ||
export declare function getScrollYOffset(scrollableAncestors: Element[]): number; |
@@ -6,5 +6,5 @@ export { getScrollableAncestors } from './getScrollableAncestors'; | ||
export { getScrollElementRect } from './getScrollElementRect'; | ||
export { getScrollOffsets } from './getScrollOffsets'; | ||
export { getScrollOffsets, getScrollXOffset, getScrollYOffset, } from './getScrollOffsets'; | ||
export { getScrollPosition } from './getScrollPosition'; | ||
export { isDocumentScrollingElement } from './documentScrollingElement'; | ||
export { isScrollable } from './isScrollable'; |
@@ -1,1 +0,1 @@ | ||
export declare function isScrollable(node: HTMLElement, computedStyle?: CSSStyleDeclaration): boolean; | ||
export declare function isScrollable(element: HTMLElement, computedStyle?: CSSStyleDeclaration): boolean; |
{ | ||
"name": "@dnd-kit/core", | ||
"version": "4.0.3", | ||
"version": "5.0.0-next-202201012117", | ||
"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.0.1" | ||
"@dnd-kit/utilities": "^3.1.0-next-202201012117" | ||
}, | ||
@@ -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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
868321
112
6709
3