react-dnd
Advanced tools
Comparing version 15.1.2 to 16.0.0
@@ -1,3 +0,3 @@ | ||
export * from './types/index.js'; | ||
export * from './core/index.js'; | ||
export * from './hooks/index.js'; | ||
export * from './connectors.js'; | ||
export * from './monitors.js'; | ||
export * from './options.js'; |
{ | ||
"name": "react-dnd", | ||
"version": "15.1.2", | ||
"version": "16.0.0", | ||
"description": "Drag and Drop for React", | ||
"main": "dist/cjs/index.js", | ||
"types": "dist/types/index.d.ts", | ||
"exports": { | ||
"import": "./dist/esm/index.mjs", | ||
"require": "./dist/cjs/index.js", | ||
"types": "./dist/types/index.d.ts" | ||
}, | ||
"type": "module", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"sideEffects": false, | ||
@@ -21,11 +17,9 @@ "repository": { | ||
"build_types": "tsc -b .", | ||
"build_esm": "swc -C module.type=es6 -d dist/esm src/", | ||
"build_cjs": "swc -C module.type=commonjs -d dist/cjs src/", | ||
"esm_hack": "node ../../scripts/esmify.mjs", | ||
"build": "run-s build_types build_esm build_cjs esm_hack" | ||
"build_esm": "swc -C module.type=es6 -d dist src/", | ||
"build": "run-s build_types build_esm" | ||
}, | ||
"dependencies": { | ||
"@react-dnd/invariant": "3.0.1", | ||
"@react-dnd/shallowequal": "3.0.1", | ||
"dnd-core": "15.1.2", | ||
"@react-dnd/invariant": "^4.0.0", | ||
"@react-dnd/shallowequal": "^4.0.0", | ||
"dnd-core": "^16.0.0", | ||
"fast-deep-equal": "^3.1.3", | ||
@@ -36,4 +30,4 @@ "hoist-non-react-statics": "^3.3.2" | ||
"@swc/cli": "^0.1.57", | ||
"@swc/core": "^1.2.161", | ||
"@testing-library/react": "^12.1.4", | ||
"@swc/core": "^1.2.163", | ||
"@testing-library/react": "^13.0.0", | ||
"@types/hoist-non-react-statics": "^3.3.1", | ||
@@ -44,7 +38,9 @@ "@types/jest": "^27.4.1", | ||
"@types/react-dom": "^17.0.14", | ||
"jest": "^27.5.1", | ||
"jest-mock": "^27.5.1", | ||
"npm-run-all": "^4.1.5", | ||
"react": "^17.0.2", | ||
"react": "^18.0.0", | ||
"react-dnd-test-backend": "portal:../backend-test", | ||
"react-dnd-test-utils": "portal:../test-utils", | ||
"react-dom": "^17.0.2", | ||
"react-dom": "^18.0.0", | ||
"shx": "^0.3.4", | ||
@@ -51,0 +47,0 @@ "typescript": "^4.6.3" |
@@ -0,3 +1,3 @@ | ||
import type { DragDropManager } from 'dnd-core' | ||
import { createContext } from 'react' | ||
import type { DragDropManager } from 'dnd-core' | ||
@@ -4,0 +4,0 @@ /** |
@@ -1,2 +0,4 @@ | ||
import { FC, useEffect, memo } from 'react' | ||
import type { FC } from 'react' | ||
import { memo, useEffect } from 'react' | ||
import type { ConnectDragPreview } from '../types/index.js' | ||
@@ -3,0 +5,0 @@ |
@@ -0,5 +1,5 @@ | ||
export * from './types.js' | ||
export * from './useDrag/index.js' | ||
export * from './useDragDropManager.js' | ||
export * from './useDragLayer.js' | ||
export * from './useDrop/index.js' | ||
export * from './useDragLayer.js' | ||
export * from './useDragDropManager.js' | ||
export * from './types.js' |
@@ -1,7 +0,8 @@ | ||
import type { TargetType, SourceType } from 'dnd-core' | ||
import type { SourceType, TargetType } from 'dnd-core' | ||
import type { | ||
DropTargetMonitor, | ||
DragPreviewOptions, | ||
DragSourceMonitor, | ||
DragSourceOptions, | ||
DragPreviewOptions, | ||
DropTargetMonitor, | ||
DropTargetOptions, | ||
@@ -8,0 +9,0 @@ } from '../types/index.js' |
import equal from 'fast-deep-equal' | ||
import { useState, useCallback } from 'react' | ||
import { useCallback, useState } from 'react' | ||
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js' | ||
@@ -4,0 +5,0 @@ |
import { useMemo } from 'react' | ||
import type { SourceConnector } from '../../internals/index.js' | ||
@@ -3,0 +4,0 @@ |
import type { DragDropMonitor, DragSource, Identifier } from 'dnd-core' | ||
import type { Connector } from '../../internals/index.js' | ||
@@ -3,0 +4,0 @@ import type { DragSourceMonitor } from '../../types/index.js' |
@@ -0,13 +1,14 @@ | ||
import { invariant } from '@react-dnd/invariant' | ||
import type { | ||
ConnectDragPreview, | ||
ConnectDragSource, | ||
ConnectDragPreview, | ||
} from '../../types/index.js' | ||
import type { DragSourceHookSpec, FactoryOrInstance } from '../types.js' | ||
import { useRegisteredDragSource } from './useRegisteredDragSource.js' | ||
import { useCollectedProps } from '../useCollectedProps.js' | ||
import { useOptionalFactory } from '../useOptionalFactory.js' | ||
import { useConnectDragPreview, useConnectDragSource } from './connectors.js' | ||
import { useDragSourceConnector } from './useDragSourceConnector.js' | ||
import { useDragSourceMonitor } from './useDragSourceMonitor.js' | ||
import { useDragSourceConnector } from './useDragSourceConnector.js' | ||
import { useCollectedProps } from '../useCollectedProps.js' | ||
import { useConnectDragPreview, useConnectDragSource } from './connectors.js' | ||
import { invariant } from '@react-dnd/invariant' | ||
import { useRegisteredDragSource } from './useRegisteredDragSource.js' | ||
@@ -14,0 +15,0 @@ /** |
import { useEffect, useMemo } from 'react' | ||
import type { Connector } from '../../internals/index.js' | ||
@@ -3,0 +4,0 @@ import type { DragSourceMonitor } from '../../types/index.js' |
import { useMemo } from 'react' | ||
import { SourceConnector } from '../../internals/index.js' | ||
@@ -3,0 +4,0 @@ import type { |
import { useMemo } from 'react' | ||
import { DragSourceMonitorImpl } from '../../internals/index.js' | ||
@@ -3,0 +4,0 @@ import type { DragSourceMonitor } from '../../types/index.js' |
import { invariant } from '@react-dnd/invariant' | ||
import type { Identifier } from 'dnd-core' | ||
import { useMemo } from 'react' | ||
import type { DragSourceHookSpec } from '../types.js' | ||
@@ -5,0 +6,0 @@ |
@@ -0,7 +1,8 @@ | ||
import type { SourceConnector } from '../../internals/index.js' | ||
import { registerSource } from '../../internals/index.js' | ||
import type { DragSourceMonitor } from '../../types/index.js' | ||
import { registerSource, SourceConnector } from '../../internals/index.js' | ||
import type { DragSourceHookSpec } from '../types.js' | ||
import { useDragDropManager } from '../useDragDropManager.js' | ||
import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js' | ||
import { useDragSource } from './useDragSource.js' | ||
import { useDragDropManager } from '../useDragDropManager.js' | ||
import { useDragType } from './useDragType.js' | ||
@@ -8,0 +9,0 @@ |
@@ -0,4 +1,5 @@ | ||
import { invariant } from '@react-dnd/invariant' | ||
import type { DragDropManager } from 'dnd-core' | ||
import { useContext } from 'react' | ||
import type { DragDropManager } from 'dnd-core' | ||
import { invariant } from '@react-dnd/invariant' | ||
import { DndContext } from '../core/index.js' | ||
@@ -5,0 +6,0 @@ |
import { useEffect } from 'react' | ||
import type { DragLayerMonitor } from '../types/index.js' | ||
import { useCollector } from './useCollector.js' | ||
import { useDragDropManager } from './useDragDropManager.js' | ||
import { useCollector } from './useCollector.js' | ||
@@ -6,0 +7,0 @@ /** |
import { useMemo } from 'react' | ||
import type { TargetConnector } from '../../internals/index.js' | ||
@@ -3,0 +4,0 @@ |
import type { DropTarget } from 'dnd-core' | ||
import type { DropTargetMonitor } from '../../types/index.js' | ||
@@ -3,0 +4,0 @@ import type { DropTargetHookSpec } from '../types.js' |
import { invariant } from '@react-dnd/invariant' | ||
import type { Identifier } from 'dnd-core' | ||
import { useMemo } from 'react' | ||
import type { DropTargetHookSpec } from '../types.js' | ||
@@ -5,0 +6,0 @@ |
import type { ConnectDropTarget } from '../../types/index.js' | ||
import type { DropTargetHookSpec, FactoryOrInstance } from '../types.js' | ||
import { useRegisteredDropTarget } from './useRegisteredDropTarget.js' | ||
import { useCollectedProps } from '../useCollectedProps.js' | ||
import { useOptionalFactory } from '../useOptionalFactory.js' | ||
import { useConnectDropTarget } from './connectors.js' | ||
import { useDropTargetConnector } from './useDropTargetConnector.js' | ||
import { useDropTargetMonitor } from './useDropTargetMonitor.js' | ||
import { useDropTargetConnector } from './useDropTargetConnector.js' | ||
import { useCollectedProps } from '../useCollectedProps.js' | ||
import { useConnectDropTarget } from './connectors.js' | ||
import { useRegisteredDropTarget } from './useRegisteredDropTarget.js' | ||
@@ -10,0 +10,0 @@ /** |
import { useEffect, useMemo } from 'react' | ||
import type { DropTargetMonitor } from '../../types/index.js' | ||
@@ -3,0 +4,0 @@ import type { DropTargetHookSpec } from '../types.js' |
import { useMemo } from 'react' | ||
import { TargetConnector } from '../../internals/index.js' | ||
@@ -3,0 +4,0 @@ import type { DropTargetOptions } from '../../types/index.js' |
import { useMemo } from 'react' | ||
import { DropTargetMonitorImpl } from '../../internals/index.js' | ||
@@ -3,0 +4,0 @@ import type { DropTargetMonitor } from '../../types/index.js' |
@@ -1,2 +0,3 @@ | ||
import { registerTarget, TargetConnector } from '../../internals/index.js' | ||
import type { TargetConnector } from '../../internals/index.js' | ||
import { registerTarget } from '../../internals/index.js' | ||
import type { DropTargetMonitor } from '../../types/index.js' | ||
@@ -3,0 +4,0 @@ import type { DropTargetHookSpec } from '../types.js' |
@@ -1,2 +0,2 @@ | ||
import { useLayoutEffect, useEffect } from 'react' | ||
import { useEffect, useLayoutEffect } from 'react' | ||
@@ -3,0 +3,0 @@ // suppress the useLayoutEffect warning on server side. |
import type { HandlerManager, MonitorEventEmitter } from '../types/index.js' | ||
import { useCollector } from './useCollector.js' | ||
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js' | ||
import { useCollector } from './useCollector.js' | ||
@@ -5,0 +5,0 @@ export function useMonitorOutput<Monitor extends HandlerManager, Collected>( |
import { useMemo } from 'react' | ||
import type { FactoryOrInstance } from './types.js' | ||
@@ -3,0 +4,0 @@ |
@@ -1,3 +0,3 @@ | ||
export * from './types/index.js' | ||
export * from './core/index.js' | ||
export * from './hooks/index.js' | ||
export * from './types/index.js' |
@@ -0,10 +1,11 @@ | ||
import { invariant } from '@react-dnd/invariant' | ||
import type { | ||
DragDropManager, | ||
DragDropMonitor, | ||
Identifier, | ||
Listener, | ||
Unsubscribe, | ||
Listener, | ||
Identifier, | ||
XYCoord, | ||
} from 'dnd-core' | ||
import { invariant } from '@react-dnd/invariant' | ||
import type { DragSourceMonitor } from '../types/index.js' | ||
@@ -11,0 +12,0 @@ |
@@ -0,10 +1,11 @@ | ||
import { invariant } from '@react-dnd/invariant' | ||
import type { | ||
DragDropManager, | ||
DragDropMonitor, | ||
Identifier, | ||
Listener, | ||
Unsubscribe, | ||
Listener, | ||
Identifier, | ||
XYCoord, | ||
} from 'dnd-core' | ||
import { invariant } from '@react-dnd/invariant' | ||
import type { DropTargetMonitor } from '../types/index.js' | ||
@@ -11,0 +12,0 @@ |
export * from './DragSourceMonitorImpl.js' | ||
export * from './DropTargetMonitorImpl.js' | ||
export * from './registration.js' | ||
export * from './SourceConnector.js' | ||
export * from './TargetConnector.js' | ||
export * from './registration.js' |
import type { | ||
DragDropManager, | ||
DragSource, | ||
DropTarget, | ||
Unsubscribe, | ||
Identifier, | ||
SourceType, | ||
TargetType, | ||
SourceType, | ||
DragSource, | ||
Unsubscribe, | ||
} from 'dnd-core' | ||
@@ -10,0 +10,0 @@ |
@@ -0,7 +1,8 @@ | ||
import { shallowEqual } from '@react-dnd/shallowequal' | ||
import type { Backend, Identifier, Unsubscribe } from 'dnd-core' | ||
import type { ReactElement, Ref, RefObject } from 'react' | ||
import type { DragPreviewOptions, DragSourceOptions } from '../types/index.js' | ||
import { isRef } from './isRef.js' | ||
import { wrapConnectorHooks } from './wrapConnectorHooks.js' | ||
import type { Backend, Unsubscribe, Identifier } from 'dnd-core' | ||
import { isRef } from './isRef.js' | ||
import type { DragSourceOptions, DragPreviewOptions } from '../types/index.js' | ||
import { shallowEqual } from '@react-dnd/shallowequal' | ||
@@ -8,0 +9,0 @@ export interface Connector { |
@@ -0,8 +1,9 @@ | ||
import { shallowEqual } from '@react-dnd/shallowequal' | ||
import type { Backend, Identifier, Unsubscribe } from 'dnd-core' | ||
import type { RefObject } from 'react' | ||
import { shallowEqual } from '@react-dnd/shallowequal' | ||
import { wrapConnectorHooks } from './wrapConnectorHooks.js' | ||
import type { Backend, Unsubscribe, Identifier } from 'dnd-core' | ||
import type { DropTargetOptions } from '../types/index.js' | ||
import { isRef } from './isRef.js' | ||
import type { Connector } from './SourceConnector.js' | ||
import type { DropTargetOptions } from '../types/index.js' | ||
import { wrapConnectorHooks } from './wrapConnectorHooks.js' | ||
@@ -9,0 +10,0 @@ export class TargetConnector implements Connector { |
import { invariant } from '@react-dnd/invariant' | ||
import { cloneElement, isValidElement, ReactElement } from 'react' | ||
import type { ReactElement } from 'react' | ||
import { cloneElement, isValidElement } from 'react' | ||
@@ -4,0 +5,0 @@ function throwIfCompositeComponentElement(element: ReactElement<any>) { |
@@ -1,4 +0,5 @@ | ||
import type { RefObject, ReactElement } from 'react' | ||
import type { DragSourceOptions, DragPreviewOptions } from './options' | ||
import type { ReactElement, RefObject } from 'react' | ||
import type { DragPreviewOptions, DragSourceOptions } from './options' | ||
export type ConnectableElement = RefObject<any> | ReactElement | Element | null | ||
@@ -5,0 +6,0 @@ |
@@ -0,3 +1,3 @@ | ||
export * from './connectors.js' | ||
export * from './monitors.js' | ||
export * from './options.js' | ||
export * from './connectors.js' |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
401306
311
4970
Yes
17
1
+ Added@react-dnd/asap@5.0.2(transitive)
+ Added@react-dnd/invariant@4.0.2(transitive)
+ Added@react-dnd/shallowequal@4.0.2(transitive)
+ Addeddnd-core@16.0.1(transitive)
- Removed@react-dnd/asap@4.0.1(transitive)
- Removed@react-dnd/invariant@3.0.1(transitive)
- Removed@react-dnd/shallowequal@3.0.1(transitive)
- Removeddnd-core@15.1.2(transitive)
Updated@react-dnd/invariant@^4.0.0
Updateddnd-core@^16.0.0