Skip to content

Commit

Permalink
Allow .ts imports
Browse files Browse the repository at this point in the history
  • Loading branch information
clauderic committed Jun 6, 2024
1 parent 9351ad2 commit a05a769
Show file tree
Hide file tree
Showing 129 changed files with 346 additions and 351 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import {
Item,
Handle,
Remove,
} from '../../components/index.js';
import {createRange} from '../../../utilities/createRange.js';
import {cloneDeep} from '../../../utilities/cloneDeep.js';
} from '../../components/index.ts';
import {createRange} from '../../../utilities/createRange.ts';
import {cloneDeep} from '../../../utilities/cloneDeep.ts';

interface Props {
debug?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions apps/stories/stories/react/Sortable/SortableExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {directionBiased} from '@dnd-kit/collision';
import {move} from '@dnd-kit/helpers';
import {Debug} from '@dnd-kit/dom/plugins/debug';

import {Item, Handle} from '../components/index.js';
import {createRange} from '../../utilities/createRange.js';
import {Item, Handle} from '../components/index.ts';
import {createRange} from '../../utilities/createRange.ts';

interface Props {
debug?: boolean;
Expand Down
4 changes: 3 additions & 1 deletion config/typescript/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"noUnusedParameters": false,
"preserveWatchOutput": true,
"skipLibCheck": true,
"strict": true
"strict": true,
"allowImportingTsExtensions": true,
"emitDeclarationOnly": true
},
"exclude": ["node_modules"]
}
8 changes: 4 additions & 4 deletions packages/abstract/src/core/collision/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {CollisionObserver} from './observer.js';
export {CollisionNotifier} from './notifier.js';
export {sortCollisions} from './utilities.js';
export * from './types.js';
export {CollisionObserver} from './observer.ts';
export {CollisionNotifier} from './notifier.ts';
export {sortCollisions} from './utilities.ts';
export * from './types.ts';
6 changes: 3 additions & 3 deletions packages/abstract/src/core/collision/notifier.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {effect, untracked} from '@dnd-kit/state';

import {DragDropManager} from '../manager/index.js';
import {CorePlugin} from '../plugins/index.js';
import {defaultPreventable} from '../manager/events.js';
import {DragDropManager} from '../manager/index.ts';
import {CorePlugin} from '../plugins/index.ts';
import {defaultPreventable} from '../manager/events.ts';

export class CollisionNotifier extends CorePlugin {
constructor(manager: DragDropManager) {
Expand Down
10 changes: 5 additions & 5 deletions packages/abstract/src/core/collision/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
effect,
} from '@dnd-kit/state';

import type {DragDropManager} from '../manager/index.js';
import type {Draggable, Droppable} from '../entities/index.js';
import {Plugin} from '../plugins/index.js';
import type {Collision, CollisionDetector, Collisions} from './types.js';
import {sortCollisions} from './utilities.js';
import type {DragDropManager} from '../manager/index.ts';
import type {Draggable, Droppable} from '../entities/index.ts';
import {Plugin} from '../plugins/index.ts';
import type {Collision, CollisionDetector, Collisions} from './types.ts';
import {sortCollisions} from './utilities.ts';

const DEFAULT_VALUE: Collisions = [];

Expand Down
4 changes: 2 additions & 2 deletions packages/abstract/src/core/collision/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type {DragOperation} from '../manager/index.js';
import type {DragOperation} from '../manager/index.ts';
import type {
Draggable,
Droppable,
UniqueIdentifier,
} from '../entities/index.js';
} from '../entities/index.ts';

export enum CollisionPriority {
Lowest,
Expand Down
2 changes: 1 addition & 1 deletion packages/abstract/src/core/collision/utilities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Collision} from './types.js';
import {Collision} from './types.ts';

/**
* Sort collisions from greatest to smallest priority
Expand Down
12 changes: 6 additions & 6 deletions packages/abstract/src/core/entities/draggable/draggable.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {derived, reactive} from '@dnd-kit/state';

import {Entity} from '../entity/index.js';
import type {EntityInput, Data, Type} from '../entity/index.js';
import {Modifier} from '../../modifiers/index.js';
import type {Modifiers} from '../../modifiers/index.js';
import type {DragDropManager} from '../../manager/index.js';
import {descriptor} from '../../plugins/index.js';
import {Entity} from '../entity/index.ts';
import type {EntityInput, Data, Type} from '../entity/index.ts';
import {Modifier} from '../../modifiers/index.ts';
import type {Modifiers} from '../../modifiers/index.ts';
import type {DragDropManager} from '../../manager/index.ts';
import {descriptor} from '../../plugins/index.ts';

export interface Input<
T extends Data = Data,
Expand Down
4 changes: 2 additions & 2 deletions packages/abstract/src/core/entities/draggable/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export {Draggable} from './draggable.js';
export type {Input as DraggableInput} from './draggable.js';
export {Draggable} from './draggable.ts';
export type {Input as DraggableInput} from './draggable.ts';
10 changes: 5 additions & 5 deletions packages/abstract/src/core/entities/droppable/droppable.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {derived, effects, reactive, type Effect} from '@dnd-kit/state';
import type {Shape} from '@dnd-kit/geometry';

import {Entity} from '../entity/index.js';
import type {EntityInput, Data, Type} from '../entity/index.js';
import {Entity} from '../entity/index.ts';
import type {EntityInput, Data, Type} from '../entity/index.ts';
import {
CollisionPriority,
type CollisionDetector,
} from '../../collision/index.js';
import type {DragDropManager} from '../../manager/index.js';
import {Draggable} from '../draggable/draggable.js';
} from '../../collision/index.ts';
import type {DragDropManager} from '../../manager/index.ts';
import {Draggable} from '../draggable/draggable.ts';

export interface Input<
T extends Data = Data,
Expand Down
4 changes: 2 additions & 2 deletions packages/abstract/src/core/entities/droppable/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export {Droppable} from './droppable.js';
export type {Input as DroppableInput} from './droppable.js';
export {Droppable} from './droppable.ts';
export type {Input as DroppableInput} from './droppable.ts';
4 changes: 2 additions & 2 deletions packages/abstract/src/core/entities/entity/entity.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {effects, reactive, type Effect} from '@dnd-kit/state';

import type {DragDropManager} from '../../manager/index.js';
import type {Data, UniqueIdentifier} from './types.js';
import type {DragDropManager} from '../../manager/index.ts';
import type {Data, UniqueIdentifier} from './types.ts';

interface Options {
/**
Expand Down
8 changes: 4 additions & 4 deletions packages/abstract/src/core/entities/entity/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export {Entity} from './entity.js';
export type {Input as EntityInput} from './entity.js';
export {Entity} from './entity.ts';
export type {Input as EntityInput} from './entity.ts';

export type {Data, Type, UniqueIdentifier} from './types.js';
export type {Data, Type, UniqueIdentifier} from './types.ts';

export {EntityRegistry} from './registry.js';
export {EntityRegistry} from './registry.ts';
4 changes: 2 additions & 2 deletions packages/abstract/src/core/entities/entity/registry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {signal} from '@dnd-kit/state';

import type {Entity} from './entity.js';
import type {UniqueIdentifier} from './types.js';
import type {Entity} from './entity.ts';
import type {UniqueIdentifier} from './types.ts';

/**
* Reactive class representing a registry for entities.
Expand Down
6 changes: 3 additions & 3 deletions packages/abstract/src/core/entities/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './entity/index.js';
export * from './draggable/index.js';
export * from './droppable/index.js';
export * from './entity/index.ts';
export * from './draggable/index.ts';
export * from './droppable/index.ts';
24 changes: 12 additions & 12 deletions packages/abstract/src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
export {DragDropManager, DragOperationStatus} from './manager/index.js';
export {DragDropManager, DragOperationStatus} from './manager/index.ts';
export type {
DragDropManagerInput,
DragDropConfiguration,
DragOperationManager,
DragDropEvents,
DragOperation,
Renderer,
} from './manager/index.js';
} from './manager/index.ts';

export {CollisionPriority, sortCollisions} from './collision/index.js';
export type {Collision, CollisionDetector} from './collision/index.js';
export {CollisionPriority, sortCollisions} from './collision/index.ts';
export type {Collision, CollisionDetector} from './collision/index.ts';

export {Modifier} from './modifiers/index.js';
export type {Modifiers, ModifierConstructor} from './modifiers/index.js';
export {Modifier} from './modifiers/index.ts';
export type {Modifiers, ModifierConstructor} from './modifiers/index.ts';

export {Draggable, Droppable} from './entities/index.js';
export {Draggable, Droppable} from './entities/index.ts';
export type {
Data,
DraggableInput,
DroppableInput,
Entity,
Type,
UniqueIdentifier,
} from './entities/index.js';
} from './entities/index.ts';

export {
Plugin,
Expand All @@ -31,18 +31,18 @@ export {
configure,
configurator,
descriptor,
} from './plugins/index.js';
} from './plugins/index.ts';
export type {
Plugins,
PluginConstructor,
PluginDescriptor,
PluginOptions,
} from './plugins/index.js';
} from './plugins/index.ts';

export {Sensor} from './sensors/index.js';
export {Sensor} from './sensors/index.ts';
export type {
Sensors,
SensorConstructor,
SensorDescriptor,
SensorOptions,
} from './sensors/index.js';
} from './sensors/index.ts';
6 changes: 3 additions & 3 deletions packages/abstract/src/core/manager/dragOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import type {
Draggable,
Droppable,
UniqueIdentifier,
} from '../entities/index.js';
} from '../entities/index.ts';

import type {DragDropManager} from './manager.js';
import {defaultPreventable} from './events.js';
import type {DragDropManager} from './manager.ts';
import {defaultPreventable} from './events.ts';

export enum Status {
Idle = 'idle',
Expand Down
8 changes: 4 additions & 4 deletions packages/abstract/src/core/manager/events.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type {Coordinates} from '@dnd-kit/geometry';

import type {Draggable, Droppable} from '../entities/index.js';
import type {Collisions} from '../collision/index.js';
import type {DragDropManager} from './manager.js';
import type {DragOperation} from './dragOperation.js';
import type {Draggable, Droppable} from '../entities/index.ts';
import type {Collisions} from '../collision/index.ts';
import type {DragDropManager} from './manager.ts';
import type {DragOperation} from './dragOperation.ts';

export type Events = Record<string, (...args: any[]) => void>;

Expand Down
16 changes: 8 additions & 8 deletions packages/abstract/src/core/manager/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export {DragDropManager} from './manager.js';
export type {DragDropManagerInput, DragDropConfiguration} from './manager.js';
export type {DragDropEvents} from './events.js';
export {Status as DragOperationStatus} from './dragOperation.js';
export type {DragOperation, DragOperationManager} from './dragOperation.js';
export type {DragDropRegistry} from './registry.js';
export type {InferDraggable, InferDroppable} from './types.js';
export type {Renderer} from './renderer.js';
export {DragDropManager} from './manager.ts';
export type {DragDropManagerInput, DragDropConfiguration} from './manager.ts';
export type {DragDropEvents} from './events.ts';
export {Status as DragOperationStatus} from './dragOperation.ts';
export type {DragOperation, DragOperationManager} from './dragOperation.ts';
export type {DragDropRegistry} from './registry.ts';
export type {InferDraggable, InferDroppable} from './types.ts';
export type {Renderer} from './renderer.ts';
18 changes: 9 additions & 9 deletions packages/abstract/src/core/manager/manager.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import type {Draggable, Droppable} from '../entities/index.js';
import {CollisionObserver, CollisionNotifier} from '../collision/index.js';
import type {Plugins, Plugin} from '../plugins/index.js';
import type {Sensor, Sensors} from '../sensors/index.js';
import type {Modifier, Modifiers} from '../modifiers/index.js';
import type {Draggable, Droppable} from '../entities/index.ts';
import {CollisionObserver, CollisionNotifier} from '../collision/index.ts';
import type {Plugins, Plugin} from '../plugins/index.ts';
import type {Sensor, Sensors} from '../sensors/index.ts';
import type {Modifier, Modifiers} from '../modifiers/index.ts';

import {DragDropRegistry} from './registry.js';
import {DragDropRegistry} from './registry.ts';
import {
DragOperationManager,
type DragOperation,
type DragActions,
} from './dragOperation.js';
import {DragDropMonitor} from './events.js';
import {defaultRenderer, type Renderer} from './renderer.js';
} from './dragOperation.ts';
import {DragDropMonitor} from './events.ts';
import {defaultRenderer, type Renderer} from './renderer.ts';

export interface DragDropConfiguration<T extends DragDropManager> {
core?: {
Expand Down
10 changes: 5 additions & 5 deletions packages/abstract/src/core/manager/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ import {
Droppable,
Entity,
EntityRegistry,
} from '../entities/index.js';
} from '../entities/index.ts';
import {
PluginRegistry,
Plugin,
type PluginConstructor,
PluginOptions,
} from '../plugins/index.js';
} from '../plugins/index.ts';
import {
Sensor,
SensorOptions,
type SensorConstructor,
} from '../sensors/index.js';
import {Modifier, type ModifierConstructor} from '../modifiers/index.js';
import type {DragDropManager} from './manager.js';
} from '../sensors/index.ts';
import {Modifier, type ModifierConstructor} from '../modifiers/index.ts';
import type {DragDropManager} from './manager.ts';

export class DragDropRegistry<
T extends Draggable,
Expand Down
7 changes: 3 additions & 4 deletions packages/abstract/src/core/manager/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type {DragDropManager} from './manager.js';
import type {DragDropManager} from './manager.ts';

export type InferDraggable<P> = P extends DragDropManager<infer T> ? T : never;

export type InferDroppable<P> = P extends DragDropManager<any, infer T>
? T
: never;
export type InferDroppable<P> =
P extends DragDropManager<any, infer T> ? T : never;
4 changes: 2 additions & 2 deletions packages/abstract/src/core/modifiers/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export {Modifier} from './modifier.js';
export {Modifier} from './modifier.ts';

export type {
Modifiers,
ModifierConstructor,
ModifierDescriptor,
ModifierOptions,
} from './modifier.js';
} from './modifier.ts';
4 changes: 2 additions & 2 deletions packages/abstract/src/core/modifiers/modifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
type PluginOptions,
type PluginConstructor,
type PluginDescriptor,
} from '../plugins/index.js';
import type {DragDropManager} from '../manager/index.js';
} from '../plugins/index.ts';
import type {DragDropManager} from '../manager/index.ts';

export type ModifierOptions = PluginOptions;

Expand Down
8 changes: 4 additions & 4 deletions packages/abstract/src/core/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export {Plugin, CorePlugin} from './plugin.js';
export {PluginRegistry} from './registry.js';
export {Plugin, CorePlugin} from './plugin.ts';
export {PluginRegistry} from './registry.ts';
export type {
Plugins,
PluginConstructor,
PluginDescriptor,
PluginOptions,
} from './types.js';
export {configure, configurator, descriptor} from './utilities.js';
} from './types.ts';
export {configure, configurator, descriptor} from './utilities.ts';
6 changes: 3 additions & 3 deletions packages/abstract/src/core/plugins/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {reactive, untracked} from '@dnd-kit/state';

import type {DragDropManager} from '../manager/index.js';
import type {PluginOptions} from './types.js';
import {configure} from './utilities.js';
import type {DragDropManager} from '../manager/index.ts';
import type {PluginOptions} from './types.ts';
import {configure} from './utilities.ts';

/**
* An abstract plugin class that can be extended to implement custom
Expand Down
Loading

0 comments on commit a05a769

Please sign in to comment.