Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-dnd-touch-backend

Package Overview
Dependencies
Maintainers
3
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dnd-touch-backend - npm Package Compare versions

Comparing version 15.0.0 to 15.0.1

dist/cjs/index.js

16

package.json
{
"name": "react-dnd-touch-backend",
"version": "15.0.0",
"version": "15.0.1",
"description": "Touch backend for react-dnd",
"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,

@@ -16,12 +16,10 @@ "license": "MIT",

"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"
},
"dependencies": {
"@react-dnd/invariant": "^2.0.0",
"dnd-core": "15.0.0"
"dnd-core": "15.0.1"
},
"devDependencies": {
"@swc/cli": "^0.1.55",
"@swc/core": "^1.2.135",
"shx": "^0.3.4",

@@ -28,0 +26,0 @@ "typescript": "^4.5.5"

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

import { DragDropManager, BackendFactory } from 'dnd-core'
import { TouchBackendOptions, TouchBackendContext } from './interfaces'
import type { DragDropManager, BackendFactory } from 'dnd-core'
import type { TouchBackendOptions, TouchBackendContext } from './interfaces'
import { TouchBackendImpl } from './TouchBackendImpl'

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

@@ -19,10 +19,8 @@ export interface EventName {

touchSlop: number
scrollAngleRanges?: AngleRange[]
scrollAngleRanges?: AngleRange[] | undefined
rootElement: Node | undefined
getDropTargetElementsAtPoint?: (
x: number,
y: number,
dropTargets: HTMLElement[],
) => HTMLElement[]
getDropTargetElementsAtPoint?:
| undefined
| ((x: number, y: number, dropTargets: HTMLElement[]) => HTMLElement[])
}

@@ -29,0 +27,0 @@

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

import {
import type {
TouchBackendOptions,

@@ -3,0 +3,0 @@ AngleRange,

import { invariant } from '@react-dnd/invariant'
import {
import type {
DragDropActions,

@@ -213,3 +213,3 @@ DragDropMonitor,

handler: (e: any) => void,
capture?: boolean,
capture = false,
) {

@@ -231,3 +231,3 @@ const options = supportsPassive ? { capture, passive: false } : capture

handler: (e: any) => void,
capture?: boolean,
capture = false,
) {

@@ -299,4 +299,4 @@ const options = supportsPassive ? { capture, passive: false } : capture

coords = {
x: (e as TouchEvent).touches[0].clientX,
y: (e as TouchEvent).touches[0].clientY,
x: (e as TouchEvent).touches[0]?.clientX || 0,
y: (e as TouchEvent).touches[0]?.clientY || 0,
}

@@ -499,4 +499,6 @@ break

}
let currentNode: Element | null = elementsAtPoint[nodeId]
elementsAtPointExtended.push(currentNode)
let currentNode: Element | undefined | null = elementsAtPoint[nodeId]
if (currentNode != null) {
elementsAtPointExtended.push(currentNode)
}
while (currentNode) {

@@ -503,0 +505,0 @@ currentNode = currentNode.parentElement

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

import { AngleRange } from '../interfaces'
import type { AngleRange } from '../interfaces'

@@ -19,3 +19,3 @@ export function distance(

y2: number,
angleRanges?: AngleRange[],
angleRanges: AngleRange[] | undefined,
): boolean {

@@ -29,5 +29,7 @@ if (!angleRanges) {

for (let i = 0; i < angleRanges.length; ++i) {
const ar = angleRanges[i]
if (
(angleRanges[i].start == null || angle >= angleRanges[i].start) &&
(angleRanges[i].end == null || angle <= angleRanges[i].end)
ar &&
(ar.start == null || angle >= ar.start) &&
(ar.end == null || angle <= ar.end)
) {

@@ -34,0 +36,0 @@ return true

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

import { XYCoord } from 'dnd-core'
import type { XYCoord } from 'dnd-core'
import { isTouchEvent } from './predicates'

@@ -20,8 +20,9 @@

if (e.targetTouches.length === 1) {
return getEventClientOffset(e.targetTouches[0])
return getEventClientOffset(e.targetTouches[0] as Touch)
} else if (lastTargetTouchFallback && e.touches.length === 1) {
if (e.touches[0].target === lastTargetTouchFallback.target) {
return getEventClientOffset(e.touches[0])
if ((e.touches[0] as Touch).target === lastTargetTouchFallback.target) {
return getEventClientOffset(e.touches[0] as Touch)
}
}
return
}

@@ -28,0 +29,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc