🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-dnd

Package Overview
Dependencies
Maintainers
5
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dnd - npm Package Compare versions

Comparing version

to
15.0.1

dist/cjs/core/DndContext.js

16

package.json
{
"name": "react-dnd",
"version": "15.0.0",
"version": "15.0.1",
"description": "Drag and Drop for React",
"type": "module",
"exports": "./lib/index.js",
"types": "./lib/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"sideEffects": false,

@@ -15,4 +15,4 @@ "repository": {

"scripts": {
"clean": "shx rm -rf lib/",
"build": "tsc -b . && swc src -d lib"
"clean": "shx rm -rf dist/",
"build": "tsc -b tsconfig.cjs.json && tsc -b tsconfig.esm.json && tsc -b tsconfig.types.json"
},

@@ -22,3 +22,3 @@ "dependencies": {

"@react-dnd/shallowequal": "^2.0.0",
"dnd-core": "15.0.0",
"dnd-core": "15.0.1",
"fast-deep-equal": "^3.1.3",

@@ -28,4 +28,2 @@ "hoist-non-react-statics": "^3.3.2"

"devDependencies": {
"@swc/cli": "^0.1.55",
"@swc/core": "^1.2.135",
"@testing-library/react": "^12.1.2",

@@ -32,0 +30,0 @@ "@types/hoist-non-react-statics": "^3.3.1",

import { createContext } from 'react'
import { DragDropManager } from 'dnd-core'
import type { DragDropManager } from 'dnd-core'

@@ -4,0 +4,0 @@ /**

@@ -1,3 +0,3 @@

import { TargetType, SourceType } from 'dnd-core'
import {
import type { TargetType, SourceType } from 'dnd-core'
import type {
DropTargetMonitor,

@@ -4,0 +4,0 @@ DragSourceMonitor,

@@ -1,3 +0,3 @@

import { Connector } from '../internals'
import { HandlerManager, MonitorEventEmitter } from '../types'
import type { Connector } from '../internals'
import type { HandlerManager, MonitorEventEmitter } from '../types'
import { useMonitorOutput } from './useMonitorOutput'

@@ -4,0 +4,0 @@

import { useMemo } from 'react'
import { SourceConnector } from '../../internals'
import type { SourceConnector } from '../../internals'

@@ -4,0 +4,0 @@ export function useConnectDragSource(connector: SourceConnector) {

@@ -1,5 +0,5 @@

import { DragDropMonitor, DragSource, Identifier } from 'dnd-core'
import { Connector } from '../../internals'
import { DragSourceMonitor } from '../../types'
import { DragObjectFactory, DragSourceHookSpec } from '../types'
import type { DragDropMonitor, DragSource, Identifier } from 'dnd-core'
import type { Connector } from '../../internals'
import type { DragSourceMonitor } from '../../types'
import type { DragObjectFactory, DragSourceHookSpec } from '../types'

@@ -6,0 +6,0 @@ export class DragSourceImpl<O, R, P> implements DragSource {

@@ -1,3 +0,3 @@

import { ConnectDragSource, ConnectDragPreview } from '../../types'
import { DragSourceHookSpec, FactoryOrInstance } from '../types'
import type { ConnectDragSource, ConnectDragPreview } from '../../types'
import type { DragSourceHookSpec, FactoryOrInstance } from '../types'
import { useRegisteredDragSource } from './useRegisteredDragSource'

@@ -4,0 +4,0 @@ import { useOptionalFactory } from '../useOptionalFactory'

import { useEffect, useMemo } from 'react'
import { Connector } from '../../internals'
import { DragSourceMonitor } from '../../types'
import { DragSourceHookSpec } from '../types'
import type { Connector } from '../../internals'
import type { DragSourceMonitor } from '../../types'
import type { DragSourceHookSpec } from '../types'
import { DragSourceImpl } from './DragSourceImpl'

@@ -6,0 +6,0 @@

import { useMemo } from 'react'
import { SourceConnector } from '../../internals'
import { DragPreviewOptions, DragSourceOptions } from '../../types'
import type { DragPreviewOptions, DragSourceOptions } from '../../types'
import { useDragDropManager } from '../useDragDropManager'

@@ -5,0 +5,0 @@ import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect'

import { useMemo } from 'react'
import { DragSourceMonitorImpl } from '../../internals'
import { DragSourceMonitor } from '../../types'
import type { DragSourceMonitor } from '../../types'
import { useDragDropManager } from '../useDragDropManager'

@@ -8,3 +8,6 @@

const manager = useDragDropManager()
return useMemo(() => new DragSourceMonitorImpl(manager), [manager])
return useMemo<DragSourceMonitor<O, R>>(
() => new DragSourceMonitorImpl(manager),
[manager],
)
}
import { invariant } from '@react-dnd/invariant'
import { Identifier } from 'dnd-core'
import type { Identifier } from 'dnd-core'
import { useMemo } from 'react'
import { DragSourceHookSpec } from '../types'
import type { DragSourceHookSpec } from '../types'

@@ -6,0 +6,0 @@ export function useDragType(

@@ -1,4 +0,4 @@

import { DragSourceMonitor } from '../../types'
import type { DragSourceMonitor } from '../../types'
import { registerSource, SourceConnector } from '../../internals'
import { DragSourceHookSpec } from '../types'
import type { DragSourceHookSpec } from '../types'
import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect'

@@ -30,2 +30,3 @@ import { useDragSource } from './useDragSource'

}
return
},

@@ -32,0 +33,0 @@ [manager, monitor, connector, handler, itemType],

import { useContext } from 'react'
import { DragDropManager } from 'dnd-core'
import type { DragDropManager } from 'dnd-core'
import { invariant } from '@react-dnd/invariant'

@@ -4,0 +4,0 @@ import { DndContext } from '../core'

import { useEffect } from 'react'
import { DragLayerMonitor } from '../types'
import type { DragLayerMonitor } from '../types'
import { useDragDropManager } from './useDragDropManager'

@@ -4,0 +4,0 @@ import { useCollector } from './useCollector'

import { useMemo } from 'react'
import { TargetConnector } from '../../internals'
import type { TargetConnector } from '../../internals'

@@ -4,0 +4,0 @@ export function useConnectDropTarget(connector: TargetConnector) {

@@ -1,4 +0,4 @@

import { DropTarget } from 'dnd-core'
import { DropTargetMonitor } from '../../types'
import { DropTargetHookSpec } from '../types'
import type { DropTarget } from 'dnd-core'
import type { DropTargetMonitor } from '../../types'
import type { DropTargetHookSpec } from '../types'

@@ -31,3 +31,4 @@ export class DropTargetImpl<O, R, P> implements DropTarget {

}
return
}
}
import { invariant } from '@react-dnd/invariant'
import { Identifier } from 'dnd-core'
import type { Identifier } from 'dnd-core'
import { useMemo } from 'react'
import { DropTargetHookSpec } from '../types'
import type { DropTargetHookSpec } from '../types'

@@ -6,0 +6,0 @@ /**

@@ -1,3 +0,3 @@

import { ConnectDropTarget } from '../../types'
import { DropTargetHookSpec, FactoryOrInstance } from '../types'
import type { ConnectDropTarget } from '../../types'
import type { DropTargetHookSpec, FactoryOrInstance } from '../types'
import { useRegisteredDropTarget } from './useRegisteredDropTarget'

@@ -4,0 +4,0 @@ import { useOptionalFactory } from '../useOptionalFactory'

import { useEffect, useMemo } from 'react'
import { DropTargetMonitor } from '../../types'
import { DropTargetHookSpec } from '../types'
import type { DropTargetMonitor } from '../../types'
import type { DropTargetHookSpec } from '../types'
import { DropTargetImpl } from './DropTargetImpl'

@@ -5,0 +5,0 @@

import { useMemo } from 'react'
import { TargetConnector } from '../../internals'
import { DropTargetOptions } from '../../types'
import type { DropTargetOptions } from '../../types'
import { useDragDropManager } from '../useDragDropManager'

@@ -5,0 +5,0 @@ import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect'

import { useMemo } from 'react'
import { DropTargetMonitorImpl } from '../../internals'
import { DropTargetMonitor } from '../../types'
import type { DropTargetMonitor } from '../../types'
import { useDragDropManager } from '../useDragDropManager'

@@ -5,0 +5,0 @@

import { registerTarget, TargetConnector } from '../../internals'
import { DropTargetMonitor } from '../../types'
import { DropTargetHookSpec } from '../types'
import type { DropTargetMonitor } from '../../types'
import type { DropTargetHookSpec } from '../types'
import { useDragDropManager } from '../useDragDropManager'

@@ -5,0 +5,0 @@ import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect'

@@ -1,2 +0,2 @@

import { HandlerManager, MonitorEventEmitter } from '../types'
import type { HandlerManager, MonitorEventEmitter } from '../types'
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect'

@@ -3,0 +3,0 @@ import { useCollector } from './useCollector'

import { useMemo } from 'react'
import { FactoryOrInstance } from './types'
import type { FactoryOrInstance } from './types'

@@ -4,0 +4,0 @@ export function useOptionalFactory<T>(

@@ -1,2 +0,2 @@

import {
import type {
DragDropManager,

@@ -10,3 +10,3 @@ DragDropMonitor,

import { invariant } from '@react-dnd/invariant'
import { DragSourceMonitor } from '../types'
import type { DragSourceMonitor } from '../types'

@@ -67,3 +67,3 @@ let isCallingCanDrag = false

listener: Listener,
options?: { handlerIds: Identifier[] | undefined },
options?: { handlerIds?: Identifier[] },
): Unsubscribe {

@@ -70,0 +70,0 @@ return this.internalMonitor.subscribeToStateChange(listener, options)

@@ -1,2 +0,2 @@

import {
import type {
DragDropManager,

@@ -10,3 +10,3 @@ DragDropMonitor,

import { invariant } from '@react-dnd/invariant'
import { DropTargetMonitor } from '../types'
import type { DropTargetMonitor } from '../types'

@@ -33,3 +33,3 @@ let isCallingCanDrop = false

listener: Listener,
options?: { handlerIds: Identifier[] | undefined },
options?: { handlerIds?: Identifier[] },
): Unsubscribe {

@@ -36,0 +36,0 @@ return this.internalMonitor.subscribeToStateChange(listener, options)

@@ -1,2 +0,2 @@

import {
import type {
DragDropManager,

@@ -3,0 +3,0 @@ DropTarget,

@@ -1,6 +0,6 @@

import { ReactElement, Ref, RefObject } from 'react'
import type { ReactElement, Ref, RefObject } from 'react'
import { wrapConnectorHooks } from './wrapConnectorHooks'
import { Backend, Unsubscribe, Identifier } from 'dnd-core'
import type { Backend, Unsubscribe, Identifier } from 'dnd-core'
import { isRef } from './isRef'
import { DragSourceOptions, DragPreviewOptions } from '../types'
import type { DragSourceOptions, DragPreviewOptions } from '../types'
import { shallowEqual } from '@react-dnd/shallowequal'

@@ -7,0 +7,0 @@

@@ -1,8 +0,8 @@

import { RefObject } from 'react'
import type { RefObject } from 'react'
import { shallowEqual } from '@react-dnd/shallowequal'
import { wrapConnectorHooks } from './wrapConnectorHooks'
import { Backend, Unsubscribe, Identifier } from 'dnd-core'
import type { Backend, Unsubscribe, Identifier } from 'dnd-core'
import { isRef } from './isRef'
import { Connector } from './SourceConnector'
import { DropTargetOptions } from '../types'
import type { Connector } from './SourceConnector'
import type { DropTargetOptions } from '../types'

@@ -9,0 +9,0 @@ export class TargetConnector implements Connector {

@@ -1,3 +0,3 @@

import { RefObject, ReactElement } from 'react'
import { DragSourceOptions, DragPreviewOptions } from './options'
import type { RefObject, ReactElement } from 'react'
import type { DragSourceOptions, DragPreviewOptions } from './options'

@@ -4,0 +4,0 @@ export type ConnectableElement = RefObject<any> | ReactElement | Element | null

@@ -1,2 +0,2 @@

import { Identifier, Unsubscribe } from 'dnd-core'
import type { Identifier, Unsubscribe } from 'dnd-core'

@@ -3,0 +3,0 @@ export interface XYCoord {

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 not supported yet