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

@atlaskit/drag-and-drop-hitbox

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/drag-and-drop-hitbox - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

6

CHANGELOG.md
# @atlaskit/drag-and-drop-hitbox
## 0.8.0
### Minor Changes
- [`a7dc73c0a57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a7dc73c0a57) - Internal refactor: implemented a cheaper mechanism to enable memoization of tree item data
## 0.7.0

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

40

dist/cjs/experimental/tree-item.js

@@ -11,4 +11,2 @@ "use strict";

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
var _excluded = ["block"];

@@ -140,14 +138,18 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

}
var memoizeInstruction = (0, _memoizeOne.default)(function (instruction) {
return instruction;
}, function (_ref3, _ref4) {
var _ref5 = (0, _slicedToArray2.default)(_ref3, 1),
incoming = _ref5[0];
var _ref6 = (0, _slicedToArray2.default)(_ref4, 1),
existing = _ref6[0];
return areInstructionsEqual(incoming, existing);
});
function applyInstructionBlock(_ref7) {
var desired = _ref7.desired,
block = _ref7.block;
// Note: not using `memoize-one` as all we need is a cached value.
// We do not need to avoid executing an expensive function.
var memoizeInstruction = function () {
var last = null;
return function (instruction) {
if (last && areInstructionsEqual(last, instruction)) {
return last;
}
last = instruction;
return instruction;
};
}();
function applyInstructionBlock(_ref3) {
var desired = _ref3.desired,
block = _ref3.block;
if (block !== null && block !== void 0 && block.includes(desired.type) && desired.type !== 'instruction-blocked') {

@@ -162,5 +164,5 @@ var blocked = {

}
function attachInstruction(userData, _ref8) {
var block = _ref8.block,
rest = (0, _objectWithoutProperties2.default)(_ref8, _excluded);
function attachInstruction(userData, _ref4) {
var block = _ref4.block,
rest = (0, _objectWithoutProperties2.default)(_ref4, _excluded);
var desired = getInstruction(rest);

@@ -175,4 +177,4 @@ var withBlock = applyInstructionBlock({

function extractInstruction(userData) {
var _ref9;
return (_ref9 = userData[uniqueKey]) !== null && _ref9 !== void 0 ? _ref9 : null;
var _ref5;
return (_ref5 = userData[uniqueKey]) !== null && _ref5 !== void 0 ? _ref5 : null;
}
{
"name": "@atlaskit/drag-and-drop-hitbox",
"version": "0.7.0",
"version": "0.8.0",
"sideEffects": false
}

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

import memoizeOne from 'memoize-one';
// using a symbol so we can guarantee a key with a unique value

@@ -125,3 +124,15 @@ const uniqueKey = Symbol('tree-item-instruction');

}
const memoizeInstruction = memoizeOne(instruction => instruction, ([incoming], [existing]) => areInstructionsEqual(incoming, existing));
// Note: not using `memoize-one` as all we need is a cached value.
// We do not need to avoid executing an expensive function.
const memoizeInstruction = (() => {
let last = null;
return instruction => {
if (last && areInstructionsEqual(last, instruction)) {
return last;
}
last = instruction;
return instruction;
};
})();
function applyInstructionBlock({

@@ -128,0 +139,0 @@ desired,

{
"name": "@atlaskit/drag-and-drop-hitbox",
"version": "0.7.0",
"version": "0.8.0",
"sideEffects": false
}
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
var _excluded = ["block"];
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
import memoizeOne from 'memoize-one';
// using a symbol so we can guarantee a key with a unique value

@@ -131,14 +129,18 @@ var uniqueKey = Symbol('tree-item-instruction');

}
var memoizeInstruction = memoizeOne(function (instruction) {
return instruction;
}, function (_ref3, _ref4) {
var _ref5 = _slicedToArray(_ref3, 1),
incoming = _ref5[0];
var _ref6 = _slicedToArray(_ref4, 1),
existing = _ref6[0];
return areInstructionsEqual(incoming, existing);
});
function applyInstructionBlock(_ref7) {
var desired = _ref7.desired,
block = _ref7.block;
// Note: not using `memoize-one` as all we need is a cached value.
// We do not need to avoid executing an expensive function.
var memoizeInstruction = function () {
var last = null;
return function (instruction) {
if (last && areInstructionsEqual(last, instruction)) {
return last;
}
last = instruction;
return instruction;
};
}();
function applyInstructionBlock(_ref3) {
var desired = _ref3.desired,
block = _ref3.block;
if (block !== null && block !== void 0 && block.includes(desired.type) && desired.type !== 'instruction-blocked') {

@@ -153,5 +155,5 @@ var blocked = {

}
export function attachInstruction(userData, _ref8) {
var block = _ref8.block,
rest = _objectWithoutProperties(_ref8, _excluded);
export function attachInstruction(userData, _ref4) {
var block = _ref4.block,
rest = _objectWithoutProperties(_ref4, _excluded);
var desired = getInstruction(rest);

@@ -166,4 +168,4 @@ var withBlock = applyInstructionBlock({

export function extractInstruction(userData) {
var _ref9;
return (_ref9 = userData[uniqueKey]) !== null && _ref9 !== void 0 ? _ref9 : null;
var _ref5;
return (_ref5 = userData[uniqueKey]) !== null && _ref5 !== void 0 ? _ref5 : null;
}
{
"name": "@atlaskit/drag-and-drop-hitbox",
"version": "0.7.0",
"version": "0.8.0",
"sideEffects": false
}
{
"name": "@atlaskit/drag-and-drop-hitbox",
"version": "0.7.0",
"version": "0.8.0",
"description": "An addon for `@atlaskit/drag-and-drop` with helpers for attaching interaction information to a drop target when it is being dragged over",

@@ -39,4 +39,3 @@ "author": "Atlassian Pty Ltd",

"@atlaskit/drag-and-drop": "^0.15.0",
"@babel/runtime": "^7.0.0",
"memoize-one": "^6.0.0"
"@babel/runtime": "^7.0.0"
},

@@ -43,0 +42,0 @@ "peerDependencies": {},

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