Socket
Socket
Sign inDemoInstall

dnd-core

Package Overview
Dependencies
5
Maintainers
5
Versions
93
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 15.1.2 to 16.0.0

dist/actions/dragDrop/beginDrag.d.ts

25

package.json
{
"name": "dnd-core",
"version": "15.1.2",
"version": "16.0.0",
"description": "Drag and drop sans the GUI",
"license": "MIT",
"exports": {
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
},
"main": "dist/cjs/index.js",
"types": "dist/types/index.d.ts",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,

@@ -17,6 +13,4 @@ "scripts": {

"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"
},

@@ -28,4 +22,4 @@ "repository": {

"dependencies": {
"@react-dnd/asap": "4.0.1",
"@react-dnd/invariant": "3.0.1",
"@react-dnd/asap": "^5.0.0",
"@react-dnd/invariant": "^4.0.0",
"redux": "^4.1.2"

@@ -35,5 +29,6 @@ },

"@swc/cli": "^0.1.57",
"@swc/core": "^1.2.161",
"@swc/core": "^1.2.163",
"@types/jest": "^27.4.1",
"@types/setimmediate": "^1.0.2",
"jest-mock": "^27.5.1",
"npm-run-all": "^4.1.5",

@@ -40,0 +35,0 @@ "react-dnd-test-backend": "portal:../backend-test",

9

src/actions/dragDrop/beginDrag.ts
import { invariant } from '@react-dnd/invariant'
import type {
Action,
BeginDragOptions,
BeginDragPayload,
DragDropManager,
XYCoord,
BeginDragPayload,
BeginDragOptions,
DragDropMonitor,
HandlerRegistry,
Identifier,
XYCoord,
} from '../../interfaces.js'
import { isObject } from '../../utils/js_utils.js'
import { setClientOffset } from './local/setClientOffset.js'
import { isObject } from '../../utils/js_utils.js'
import { BEGIN_DRAG, INIT_COORDS } from './types.js'

@@ -15,0 +16,0 @@

import { invariant } from '@react-dnd/invariant'
import type {
Action,
DragDropManager,
DragDropMonitor,
DropPayload,
DragDropMonitor,
HandlerRegistry,
Identifier,
} from '../../interfaces.js'
import { isObject } from '../../utils/js_utils.js'
import { DROP } from './types.js'
import { isObject } from '../../utils/js_utils.js'

@@ -13,0 +14,0 @@ export function createDrop(manager: DragDropManager) {

import { invariant } from '@react-dnd/invariant'
import type {
DragDropManager,
DragDropMonitor,
SentinelAction,
DragDropMonitor,
} from '../../interfaces.js'

@@ -7,0 +8,0 @@ import { END_DRAG } from './types.js'

import { invariant } from '@react-dnd/invariant'
import type {
Action,
DragDropManager,
HoverPayload,
HoverOptions,
DragDropMonitor,
HandlerRegistry,
HoverOptions,
HoverPayload,
Identifier,

@@ -10,0 +11,0 @@ } from '../../interfaces.js'

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

import type { DragDropManager, DragDropActions } from '../../interfaces.js'
import type { DragDropActions, DragDropManager } from '../../interfaces.js'
import { createBeginDrag } from './beginDrag.js'
import { createPublishDragSource } from './publishDragSource.js'
import { createHover } from './hover.js'
import { createDrop } from './drop.js'
import { createEndDrag } from './endDrag.js'
import { createHover } from './hover.js'
import { createPublishDragSource } from './publishDragSource.js'

@@ -8,0 +8,0 @@ export * from './types.js'

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

import type { AnyAction } from 'redux'
import type { XYCoord } from '../../../interfaces.js'
import type { AnyAction } from 'redux'
import { INIT_COORDS } from '../types.js'

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

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

import type { Store, Action } from 'redux'
import type { DragDropMonitorImpl } from './DragDropMonitorImpl.js'
import type { State } from '../reducers/index.js'
import type { Action, Store } from 'redux'
import { createDragDropActions } from '../actions/dragDrop/index.js'
import type {

@@ -8,7 +8,8 @@ ActionCreator,

DragDropActions,
DragDropManager,
DragDropMonitor,
DragDropManager,
HandlerRegistry,
} from '../interfaces.js'
import { createDragDropActions } from '../actions/dragDrop/index.js'
import type { State } from '../reducers/index.js'
import type { DragDropMonitorImpl } from './DragDropMonitorImpl.js'

@@ -15,0 +16,0 @@ export class DragDropManagerImpl implements DragDropManager {

@@ -0,18 +1,19 @@

import { invariant } from '@react-dnd/invariant'
import type { Store } from 'redux'
import { invariant } from '@react-dnd/invariant'
import { matchesType } from '../utils/matchesType.js'
import {
getSourceClientOffset,
getDifferenceFromInitialOffset,
} from '../utils/coords.js'
import { areDirty } from '../utils/dirtiness.js'
import type { State } from '../reducers/index.js'
import type {
DragDropMonitor,
HandlerRegistry,
Identifier,
Listener,
Unsubscribe,
XYCoord,
HandlerRegistry,
Identifier,
} from '../interfaces.js'
import type { State } from '../reducers/index.js'
import {
getDifferenceFromInitialOffset,
getSourceClientOffset,
} from '../utils/coords.js'
import { areDirty } from '../utils/dirtiness.js'
import { matchesType } from '../utils/matchesType.js'

@@ -19,0 +20,0 @@ export class DragDropMonitorImpl implements DragDropMonitor {

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

import { asap } from '@react-dnd/asap'
import { invariant } from '@react-dnd/invariant'
import type { Store } from 'redux'
import { invariant } from '@react-dnd/invariant'
import {

@@ -9,19 +11,18 @@ addSource,

} from '../actions/registry.js'
import { getNextUniqueId } from '../utils/getNextUniqueId.js'
import type { State } from '../reducers/index.js'
import {
validateSourceContract,
validateTargetContract,
validateType,
} from '../contracts.js'
import type {
DragSource,
DropTarget,
HandlerRegistry,
Identifier,
SourceType,
TargetType,
Identifier,
HandlerRole,
HandlerRegistry,
} from '../interfaces.js'
import {
validateSourceContract,
validateTargetContract,
validateType,
} from '../contracts.js'
import { asap } from '@react-dnd/asap'
import { HandlerRole } from '../interfaces.js'
import type { State } from '../reducers/index.js'
import { getNextUniqueId } from '../utils/getNextUniqueId.js'

@@ -28,0 +29,0 @@ function getNextHandlerId(role: HandlerRole): string {

import { invariant } from '@react-dnd/invariant'
import type { DragSource, DropTarget, Identifier } from './interfaces.js'

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

@@ -0,7 +1,10 @@

import type { Store } from 'redux'
import { createStore } from 'redux'
import { DragDropManagerImpl } from './classes/DragDropManagerImpl.js'
import type { DragDropManager, BackendFactory } from './interfaces.js'
import { createStore, Store } from 'redux'
import { reduce, State } from './reducers/index.js'
import { DragDropMonitorImpl } from './classes/DragDropMonitorImpl.js'
import { HandlerRegistryImpl } from './classes/HandlerRegistryImpl.js'
import type { BackendFactory, DragDropManager } from './interfaces.js'
import type { State } from './reducers/index.js'
import { reduce } from './reducers/index.js'

@@ -8,0 +11,0 @@ export function createDragDropManager(

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

export * from './createDragDropManager.js'
export * from './interfaces.js'
export * from './createDragDropManager.js'
import {
BEGIN_DRAG,
DROP,
END_DRAG,
HOVER,
PUBLISH_DRAG_SOURCE,
HOVER,
END_DRAG,
DROP,
} from '../actions/dragDrop/index.js'

@@ -15,4 +15,4 @@ import {

import type { Action } from '../interfaces.js'
import { ALL, NONE } from '../utils/dirtiness.js'
import { areArraysEqual } from '../utils/equality.js'
import { NONE, ALL } from '../utils/dirtiness.js'
import { xor } from '../utils/js_utils.js'

@@ -19,0 +19,0 @@

import {
INIT_COORDS,
BEGIN_DRAG,
DROP,
END_DRAG,
HOVER,
END_DRAG,
DROP,
INIT_COORDS,
} from '../actions/dragDrop/index.js'
import type { XYCoord, Action } from '../interfaces.js'
import type { Action, XYCoord } from '../interfaces.js'
import { areCoordsEqual } from '../utils/equality.js'

@@ -10,0 +10,0 @@

import {
BEGIN_DRAG,
DROP,
END_DRAG,
HOVER,
PUBLISH_DRAG_SOURCE,
HOVER,
END_DRAG,
DROP,
} from '../actions/dragDrop/index.js'
import { REMOVE_TARGET } from '../actions/registry.js'
import type { Identifier, Action } from '../interfaces.js'
import type { Action, Identifier } from '../interfaces.js'
import { without } from '../utils/js_utils.js'

@@ -11,0 +11,0 @@

@@ -1,14 +0,13 @@

import { reduce as dragOffset, State as DragOffsetState } from './dragOffset.js'
import {
reduce as dragOperation,
State as DragOperationState,
} from './dragOperation.js'
import { reduce as refCount, State as RefCountState } from './refCount.js'
import {
reduce as dirtyHandlerIds,
State as DirtyHandlerIdsState,
} from './dirtyHandlerIds.js'
import { reduce as stateId, State as StateIdState } from './stateId.js'
import type { Action } from '../interfaces.js'
import { get } from '../utils/js_utils.js'
import type { Action } from '../interfaces.js'
import type { State as DirtyHandlerIdsState } from './dirtyHandlerIds.js'
import { reduce as dirtyHandlerIds } from './dirtyHandlerIds.js'
import type { State as DragOffsetState } from './dragOffset.js'
import { reduce as dragOffset } from './dragOffset.js'
import type { State as DragOperationState } from './dragOperation.js'
import { reduce as dragOperation } from './dragOperation.js'
import type { State as RefCountState } from './refCount.js'
import { reduce as refCount } from './refCount.js'
import type { State as StateIdState } from './stateId.js'
import { reduce as stateId } from './stateId.js'

@@ -15,0 +14,0 @@ export interface State {

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

import type { XYCoord } from '../interfaces.js'
import type { State } from '../reducers/dragOffset.js'
import type { XYCoord } from '../interfaces.js'

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc