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,10 @@
/// <reference types="react" />
import type { Announcements, ScreenReaderInstructions } from './types';
interface Props {
announcements?: Announcements;
container?: Element;
screenReaderInstructions?: ScreenReaderInstructions;
hiddenTextDescribedById: string;
}
export declare function Accessibility({ announcements, container, hiddenTextDescribedById, screenReaderInstructions, }: Props): JSX.Element | null;
export {};

View File

@@ -0,0 +1,5 @@
interface Props {
disabled: boolean;
}
export declare function RestoreFocus({ disabled }: Props): null;
export {};

View File

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

View File

@@ -0,0 +1,3 @@
import type { Announcements, ScreenReaderInstructions } from './types';
export declare const defaultScreenReaderInstructions: ScreenReaderInstructions;
export declare const defaultAnnouncements: Announcements;

View File

@@ -0,0 +1,4 @@
export { Accessibility } from './Accessibility';
export { RestoreFocus } from './components';
export { defaultAnnouncements, defaultScreenReaderInstructions, } from './defaults';
export type { Announcements, ScreenReaderInstructions } from './types';

View File

@@ -0,0 +1,15 @@
import type { Active, Over } from '../../store';
export interface Arguments {
active: Active;
over: Over | null;
}
export interface Announcements {
onDragStart({ active }: Pick<Arguments, 'active'>): string | undefined;
onDragMove?({ active, over }: Arguments): string | undefined;
onDragOver({ active, over }: Arguments): string | undefined;
onDragEnd({ active, over }: Arguments): string | undefined;
onDragCancel({ active, over }: Arguments): string | undefined;
}
export interface ScreenReaderInstructions {
draggable: string;
}

View File

@@ -0,0 +1,35 @@
import React from 'react';
import type { Transform } from '@dnd-kit/utilities';
import type { AutoScrollOptions } from '../../hooks/utilities';
import type { SensorDescriptor } from '../../sensors';
import { CollisionDetection } from '../../utilities';
import { Modifiers } from '../../modifiers';
import type { DragStartEvent, DragCancelEvent, DragEndEvent, DragMoveEvent, DragOverEvent } from '../../types';
import { Announcements, ScreenReaderInstructions } from '../Accessibility';
import type { MeasuringConfiguration } from './types';
export interface Props {
id?: string;
accessibility?: {
announcements?: Announcements;
container?: Element;
restoreFocus?: boolean;
screenReaderInstructions?: ScreenReaderInstructions;
};
autoScroll?: boolean | AutoScrollOptions;
cancelDrop?: CancelDrop;
children?: React.ReactNode;
collisionDetection?: CollisionDetection;
measuring?: MeasuringConfiguration;
modifiers?: Modifiers;
sensors?: SensorDescriptor<any>[];
onDragStart?(event: DragStartEvent): void;
onDragMove?(event: DragMoveEvent): void;
onDragOver?(event: DragOverEvent): void;
onDragEnd?(event: DragEndEvent): void;
onDragCancel?(event: DragCancelEvent): void;
}
export interface CancelDropArguments extends DragEndEvent {
}
export declare type CancelDrop = (args: CancelDropArguments) => boolean | Promise<boolean>;
export declare const ActiveDraggableContext: React.Context<Transform>;
export declare const DndContext: React.NamedExoticComponent<Props>;

View File

@@ -0,0 +1,13 @@
import type { DeepRequired } from '@dnd-kit/utilities';
import type { DataRef } from '../../store/types';
import { KeyboardSensor, PointerSensor } from '../../sensors';
import type { MeasuringConfiguration } from './types';
export declare const defaultSensors: ({
sensor: typeof PointerSensor;
options: {};
} | {
sensor: typeof KeyboardSensor;
options: {};
})[];
export declare const defaultData: DataRef;
export declare const defaultMeasuringConfiguration: DeepRequired<MeasuringConfiguration>;

View File

@@ -0,0 +1,2 @@
export { useMeasuringConfiguration } from './useMeasuringConfiguration';
export { useLayoutShiftScrollCompensation } from './useLayoutShiftScrollCompensation';

View File

@@ -0,0 +1,14 @@
import type { ClientRect } from '../../../types';
import type { DraggableNode } from '../../../store';
import type { MeasuringFunction } from '../types';
interface Options {
activeNode: DraggableNode | null | undefined;
config: boolean | {
x: boolean;
y: boolean;
} | undefined;
initialRect: ClientRect | null;
measure: MeasuringFunction;
}
export declare function useLayoutShiftScrollCompensation({ activeNode, measure, initialRect, config, }: Options): void;
export {};

View File

@@ -0,0 +1,3 @@
import type { DeepRequired } from '@dnd-kit/utilities';
import type { MeasuringConfiguration } from '../types';
export declare function useMeasuringConfiguration(config: MeasuringConfiguration | undefined): DeepRequired<MeasuringConfiguration>;

View File

@@ -0,0 +1,3 @@
export { ActiveDraggableContext, DndContext } from './DndContext';
export type { CancelDrop, Props as DndContextProps } from './DndContext';
export type { DraggableMeasuring, MeasuringConfiguration } from './types';

View File

@@ -0,0 +1,16 @@
import type { ClientRect } from '../../types';
import type { DroppableMeasuring } from '../../hooks/utilities';
export declare type MeasuringFunction = (node: HTMLElement) => ClientRect;
interface Measuring {
measure: MeasuringFunction;
}
export interface DraggableMeasuring extends Measuring {
}
export interface DragOverlayMeasuring extends Measuring {
}
export interface MeasuringConfiguration {
draggable?: Partial<DraggableMeasuring>;
droppable?: Partial<DroppableMeasuring>;
dragOverlay?: Partial<DragOverlayMeasuring>;
}
export {};

View File

@@ -0,0 +1,3 @@
/// <reference types="react" />
import type { RegisterListener } from './types';
export declare const DndMonitorContext: import("react").Context<RegisterListener | null>;

View File

@@ -0,0 +1,4 @@
export { DndMonitorContext } from './context';
export type { DndMonitorListener, DndMonitorEvent } from './types';
export { useDndMonitor } from './useDndMonitor';
export { useDndMonitorProvider } from './useDndMonitorProvider';

View File

@@ -0,0 +1,14 @@
import type { DragStartEvent, DragCancelEvent, DragEndEvent, DragMoveEvent, DragOverEvent } from '../../types';
export interface DndMonitorListener {
onDragStart?(event: DragStartEvent): void;
onDragMove?(event: DragMoveEvent): void;
onDragOver?(event: DragOverEvent): void;
onDragEnd?(event: DragEndEvent): void;
onDragCancel?(event: DragCancelEvent): void;
}
export interface DndMonitorEvent {
type: keyof DndMonitorListener;
event: DragStartEvent | DragMoveEvent | DragOverEvent | DragEndEvent | DragCancelEvent;
}
export declare type UnregisterListener = () => void;
export declare type RegisterListener = (listener: DndMonitorListener) => UnregisterListener;

View File

@@ -0,0 +1,2 @@
import type { DndMonitorListener } from './types';
export declare function useDndMonitor(listener: DndMonitorListener): void;

View File

@@ -0,0 +1,2 @@
import type { DndMonitorEvent } from './types';
export declare function useDndMonitorProvider(): readonly [({ type, event }: DndMonitorEvent) => void, (listener: any) => () => boolean];

View File

@@ -0,0 +1,11 @@
import React from 'react';
import { Modifiers } from '../../modifiers';
import type { PositionedOverlayProps } from './components';
import type { DropAnimation } from './hooks';
export interface Props extends Pick<PositionedOverlayProps, 'adjustScale' | 'children' | 'className' | 'style' | 'transition'> {
dropAnimation?: DropAnimation | null | undefined;
modifiers?: Modifiers;
wrapperElement?: keyof JSX.IntrinsicElements;
zIndex?: number;
}
export declare const DragOverlay: React.MemoExoticComponent<({ adjustScale, children, dropAnimation: dropAnimationConfig, style, transition, modifiers, wrapperElement, className, zIndex, }: Props) => JSX.Element>;

View File

@@ -0,0 +1,8 @@
import React from 'react';
import type { UniqueIdentifier } from '../../../../types';
export declare type Animation = (key: UniqueIdentifier, node: HTMLElement) => Promise<void> | void;
export interface Props {
animation: Animation;
children: React.ReactElement | null;
}
export declare function AnimationManager({ animation, children }: Props): JSX.Element;

View File

@@ -0,0 +1,2 @@
export { AnimationManager } from './AnimationManager';
export type { Animation } from './AnimationManager';

View File

@@ -0,0 +1,6 @@
import React from 'react';
interface Props {
children: React.ReactNode;
}
export declare function NullifiedContextProvider({ children }: Props): JSX.Element;
export {};

View File

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

View File

@@ -0,0 +1,18 @@
import React from 'react';
import type { Transform } from '@dnd-kit/utilities';
import type { ClientRect, UniqueIdentifier } from '../../../../types';
declare type TransitionGetter = (activatorEvent: Event | null) => React.CSSProperties['transition'] | undefined;
export interface Props {
as: keyof JSX.IntrinsicElements;
activatorEvent: Event | null;
adjustScale?: boolean;
children?: React.ReactNode;
className?: string;
id: UniqueIdentifier;
rect: ClientRect | null;
style?: React.CSSProperties;
transition?: string | TransitionGetter;
transform: Transform;
}
export declare const PositionedOverlay: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
export {};

View File

@@ -0,0 +1,2 @@
export { PositionedOverlay } from './PositionedOverlay';
export type { Props as PositionedOverlayProps } from './PositionedOverlay';

View File

@@ -0,0 +1,5 @@
export { AnimationManager } from './AnimationManager';
export type { Animation } from './AnimationManager';
export { NullifiedContextProvider } from './NullifiedContextProvider';
export { PositionedOverlay } from './PositionedOverlay';
export type { PositionedOverlayProps } from './PositionedOverlay';

View File

@@ -0,0 +1,3 @@
export { useDropAnimation, defaultDropAnimationConfiguration as defaultDropAnimation, defaultDropAnimationSideEffects, } from './useDropAnimation';
export type { DropAnimation, DropAnimationFunction, DropAnimationFunctionArguments, KeyframeResolver as DropAnimationKeyframeResolver, DropAnimationSideEffects, } from './useDropAnimation';
export { useKey } from './useKey';

View File

@@ -0,0 +1,65 @@
import type { DeepRequired, Transform } from '@dnd-kit/utilities';
import type { Active, DraggableNodes, DroppableContainers } from '../../../store';
import type { ClientRect, UniqueIdentifier } from '../../../types';
import type { MeasuringConfiguration } from '../../DndContext';
interface SharedParameters {
active: {
id: UniqueIdentifier;
data: Active['data'];
node: HTMLElement;
rect: ClientRect;
};
dragOverlay: {
node: HTMLElement;
rect: ClientRect;
};
draggableNodes: DraggableNodes;
droppableContainers: DroppableContainers;
measuringConfiguration: DeepRequired<MeasuringConfiguration>;
}
export interface KeyframeResolverParameters extends SharedParameters {
transform: {
initial: Transform;
final: Transform;
};
}
export declare type KeyframeResolver = (parameters: KeyframeResolverParameters) => Keyframe[];
export interface DropAnimationOptions {
keyframes?: KeyframeResolver;
duration?: number;
easing?: string;
sideEffects?: DropAnimationSideEffects | null;
}
export declare type DropAnimation = DropAnimationFunction | DropAnimationOptions;
interface Arguments {
draggableNodes: DraggableNodes;
droppableContainers: DroppableContainers;
measuringConfiguration: DeepRequired<MeasuringConfiguration>;
config?: DropAnimation | null;
}
export interface DropAnimationFunctionArguments extends SharedParameters {
transform: Transform;
}
export declare type DropAnimationFunction = (args: DropAnimationFunctionArguments) => Promise<void> | void;
declare type CleanupFunction = () => void;
export interface DropAnimationSideEffectsParameters extends SharedParameters {
}
export declare type DropAnimationSideEffects = (parameters: DropAnimationSideEffectsParameters) => CleanupFunction | void;
declare type ExtractStringProperties<T> = {
[K in keyof T]?: T[K] extends string ? string : never;
};
declare type Styles = ExtractStringProperties<CSSStyleDeclaration>;
interface DefaultDropAnimationSideEffectsOptions {
className?: {
active?: string;
dragOverlay?: string;
};
styles?: {
active?: Styles;
dragOverlay?: Styles;
};
}
export declare const defaultDropAnimationSideEffects: (options: DefaultDropAnimationSideEffectsOptions) => DropAnimationSideEffects;
export declare const defaultDropAnimationConfiguration: Required<DropAnimationOptions>;
export declare function useDropAnimation({ config, draggableNodes, droppableContainers, measuringConfiguration, }: Arguments): (...args: any) => any;
export {};

View File

@@ -0,0 +1,2 @@
import type { UniqueIdentifier } from '../../../types';
export declare function useKey(id: UniqueIdentifier | undefined): number | undefined;

View File

@@ -0,0 +1,4 @@
export { DragOverlay } from './DragOverlay';
export type { Props } from './DragOverlay';
export { defaultDropAnimation, defaultDropAnimationSideEffects } from './hooks';
export type { DropAnimation, DropAnimationFunction, DropAnimationFunctionArguments, DropAnimationKeyframeResolver, DropAnimationSideEffects, } from './hooks';

View File

@@ -0,0 +1,8 @@
export { defaultAnnouncements, defaultScreenReaderInstructions, } from './Accessibility';
export type { Announcements, ScreenReaderInstructions } from './Accessibility';
export { DndContext } from './DndContext';
export type { CancelDrop, DndContextProps, DraggableMeasuring, MeasuringConfiguration, } from './DndContext';
export { useDndMonitor } from './DndMonitor';
export type { DndMonitorListener } from './DndMonitor';
export { DragOverlay, defaultDropAnimation, defaultDropAnimationSideEffects, } from './DragOverlay';
export type { DropAnimation, DropAnimationFunction, DropAnimationFunctionArguments, DropAnimationKeyframeResolver, DropAnimationSideEffects, Props as DragOverlayProps, } from './DragOverlay';