planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
import type { CollisionDetection } from './types';
/**
* Returns the closest rectangles from an array of rectangles to the center of a given
* rectangle.
*/
export declare const closestCenter: CollisionDetection;

View File

@@ -0,0 +1,6 @@
import type { CollisionDetection } from './types';
/**
* Returns the closest rectangles from an array of rectangles to the corners of
* another rectangle.
*/
export declare const closestCorners: CollisionDetection;

View File

@@ -0,0 +1,24 @@
import type { ClientRect } from '../../types';
import type { Collision, CollisionDescriptor } from './types';
/**
* Sort collisions from smallest to greatest value
*/
export declare function sortCollisionsAsc({ data: { value: a } }: CollisionDescriptor, { data: { value: b } }: CollisionDescriptor): number;
/**
* Sort collisions from greatest to smallest value
*/
export declare function sortCollisionsDesc({ data: { value: a } }: CollisionDescriptor, { data: { value: b } }: CollisionDescriptor): number;
/**
* Returns the coordinates of the corners of a given rectangle:
* [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}]
*/
export declare function cornersOfRectangle({ left, top, height, width }: ClientRect): {
x: number;
y: number;
}[];
/**
* Returns the first collision, or null if there isn't one.
* If a property is specified, returns the specified property of the first collision.
*/
export declare function getFirstCollision(collisions: Collision[] | null | undefined): Collision | null;
export declare function getFirstCollision<T extends keyof Collision>(collisions: Collision[] | null | undefined, property: T): Collision[T] | null;

View File

@@ -0,0 +1,6 @@
export { closestCenter } from './closestCenter';
export { closestCorners } from './closestCorners';
export { rectIntersection } from './rectIntersection';
export { pointerWithin } from './pointerWithin';
export type { Collision, CollisionDescriptor, CollisionDetection } from './types';
export { getFirstCollision } from './helpers';

View File

@@ -0,0 +1,5 @@
import type { CollisionDetection } from './types';
/**
* Returns the rectangles that the pointer is hovering over
*/
export declare const pointerWithin: CollisionDetection;

View File

@@ -0,0 +1,11 @@
import type { ClientRect } from '../../types';
import type { CollisionDetection } from './types';
/**
* 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;

View File

@@ -0,0 +1,20 @@
import type { Active, Data, DroppableContainer, RectMap } 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: ClientRect;
droppableRects: RectMap;
droppableContainers: DroppableContainer[];
pointerCoordinates: Coordinates | null;
}) => Collision[];

View File

@@ -0,0 +1,2 @@
import type { Coordinates } from '../../types';
export declare const defaultCoordinates: Coordinates;

View File

@@ -0,0 +1,5 @@
import type { Coordinates } from '../../types';
/**
* Returns the distance between two points
*/
export declare function distanceBetween(p1: Coordinates, p2: Coordinates): number;

View File

@@ -0,0 +1,2 @@
import type { ClientRect } from '../../types';
export declare function getRelativeTransformOrigin(event: MouseEvent | TouchEvent | KeyboardEvent, rect: ClientRect): string;

View File

@@ -0,0 +1,3 @@
export { defaultCoordinates } from './constants';
export { distanceBetween } from './distanceBetweenPoints';
export { getRelativeTransformOrigin } from './getRelativeTransformOrigin';

6
node_modules/@dnd-kit/core/dist/utilities/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export { closestCenter, closestCorners, rectIntersection, getFirstCollision, pointerWithin, } from './algorithms';
export type { Collision, CollisionDescriptor, CollisionDetection, } from './algorithms';
export { defaultCoordinates, distanceBetween, getRelativeTransformOrigin, } from './coordinates';
export { Rect, adjustScale, getAdjustedRect, getClientRect, getTransformAgnosticClientRect, getWindowClientRect, getRectDelta, } from './rect';
export { noop } from './other';
export { getFirstScrollableAncestor, getScrollableAncestors, getScrollableElement, getScrollCoordinates, getScrollDirectionAndSpeed, getScrollElementRect, getScrollOffsets, getScrollPosition, isDocumentScrollingElement, } from './scroll';

View File

@@ -0,0 +1 @@
export declare function getMeasurableNode(node: HTMLElement | undefined | null): HTMLElement | null;

View File

@@ -0,0 +1 @@
export { getMeasurableNode } from './getMeasurableNode';

View File

@@ -0,0 +1 @@
export { noop } from './noop';

View File

@@ -0,0 +1 @@
export declare function noop(..._args: any): void;

View File

@@ -0,0 +1,11 @@
import type { ClientRect } from '../../types/rect';
export declare class Rect {
constructor(rect: ClientRect, element: Element);
private rect;
width: number;
height: number;
top: number;
bottom: number;
right: number;
left: number;
}

View File

@@ -0,0 +1,3 @@
import type { Transform } from '@dnd-kit/utilities';
import type { ClientRect } from '../../types';
export declare function adjustScale(transform: Transform, rect1: ClientRect | null, rect2: ClientRect | null): Transform;

View File

@@ -0,0 +1,25 @@
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: Element, 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: Element): ClientRect;
export {};

View File

@@ -0,0 +1,2 @@
import type { Coordinates, ClientRect } from '../../types';
export declare function getRectDelta(rect1: ClientRect | null, rect2: ClientRect | null): Coordinates;

View File

@@ -0,0 +1,2 @@
import type { ClientRect } from '../../types';
export declare function getWindowClientRect(element: typeof window): ClientRect;

View File

@@ -0,0 +1,6 @@
export { adjustScale } from './adjustScale';
export { getRectDelta } from './getRectDelta';
export { getAdjustedRect } from './rectAdjustment';
export { getClientRect, getTransformAgnosticClientRect } from './getRect';
export { getWindowClientRect } from './getWindowClientRect';
export { Rect } from './Rect';

View File

@@ -0,0 +1,3 @@
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;

View File

@@ -0,0 +1 @@
export declare function isDocumentScrollingElement(element: Element | null): boolean;

View File

@@ -0,0 +1,4 @@
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;

View File

@@ -0,0 +1,17 @@
import { ClientRect } from '../../types';
interface PositionalCoordinates extends Pick<ClientRect, 'top' | 'left' | 'right' | 'bottom'> {
}
export declare function getScrollDirectionAndSpeed(scrollContainer: Element, scrollContainerRect: ClientRect, { top, left, right, bottom }: PositionalCoordinates, acceleration?: number, thresholdPercentage?: {
x: number;
y: number;
}): {
direction: {
x: number;
y: number;
};
speed: {
x: number;
y: number;
};
};
export {};

View File

@@ -0,0 +1,8 @@
export declare function getScrollElementRect(element: Element): {
top: number;
left: number;
right: number;
bottom: number;
width: number;
height: number;
};

View File

@@ -0,0 +1,4 @@
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;

View File

@@ -0,0 +1,14 @@
export declare function getScrollPosition(scrollingContainer: Element): {
isTop: boolean;
isLeft: boolean;
isBottom: boolean;
isRight: boolean;
maxScroll: {
x: number;
y: number;
};
minScroll: {
x: number;
y: number;
};
};

View File

@@ -0,0 +1,2 @@
export declare function getScrollableAncestors(element: Node | null, limit?: number): Element[];
export declare function getFirstScrollableAncestor(node: Node | null): Element | null;

View File

@@ -0,0 +1 @@
export declare function getScrollableElement(element: EventTarget | null): (Window & typeof globalThis) | HTMLElement | null;

View File

@@ -0,0 +1,10 @@
export { getFirstScrollableAncestor, getScrollableAncestors, } from './getScrollableAncestors';
export { getScrollableElement } from './getScrollableElement';
export { getScrollCoordinates } from './getScrollCoordinates';
export { getScrollDirectionAndSpeed } from './getScrollDirectionAndSpeed';
export { getScrollElementRect } from './getScrollElementRect';
export { getScrollOffsets, getScrollXOffset, getScrollYOffset, } from './getScrollOffsets';
export { getScrollPosition } from './getScrollPosition';
export { isDocumentScrollingElement } from './documentScrollingElement';
export { isScrollable } from './isScrollable';
export { scrollIntoViewIfNeeded } from './scrollIntoViewIfNeeded';

View File

@@ -0,0 +1 @@
export declare function isFixed(node: HTMLElement, computedStyle?: CSSStyleDeclaration): boolean;

View File

@@ -0,0 +1 @@
export declare function isScrollable(element: HTMLElement, computedStyle?: CSSStyleDeclaration): boolean;

View File

@@ -0,0 +1,2 @@
import type { ClientRect } from '../../types';
export declare function scrollIntoViewIfNeeded(element: HTMLElement | null | undefined, measure?: (node: HTMLElement) => ClientRect): void;

View File

@@ -0,0 +1,2 @@
export { inverseTransform } from './inverseTransform';
export { parseTransform } from './parseTransform';

View File

@@ -0,0 +1,2 @@
import type { ClientRect } from '../../types';
export declare function inverseTransform(rect: ClientRect, transform: string, transformOrigin: string): ClientRect;

View File

@@ -0,0 +1,2 @@
import type { Transform } from '@dnd-kit/utilities';
export declare function parseTransform(transform: string): Transform | null;