Comparing version
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var setClientOffset_1 = require("./local/setClientOffset"); | ||
var discount_lodash_1 = require("../../utils/discount_lodash"); | ||
var invariant = require('invariant'); | ||
var isObject = require('lodash/isObject'); | ||
var types_1 = require("./types"); | ||
@@ -70,3 +70,3 @@ var ResetCoordinatesAction = { | ||
function verifyItemIsObject(item) { | ||
invariant(isObject(item), 'Item must be an object.'); | ||
invariant(discount_lodash_1.isObject(item), 'Item must be an object.'); | ||
} | ||
@@ -73,0 +73,0 @@ function getDraggableSource(sourceIds, monitor) { |
@@ -15,4 +15,4 @@ "use strict"; | ||
var types_1 = require("./types"); | ||
var discount_lodash_1 = require("../../utils/discount_lodash"); | ||
var invariant = require('invariant'); | ||
var isObject = require('lodash/isObject'); | ||
function createDrop(manager) { | ||
@@ -53,3 +53,3 @@ return function drop(options) { | ||
function verifyDropResultType(dropResult) { | ||
invariant(typeof dropResult === 'undefined' || isObject(dropResult), 'Drop result must either be an object or undefined.'); | ||
invariant(typeof dropResult === 'undefined' || discount_lodash_1.isObject(dropResult), 'Drop result must either be an object or undefined.'); | ||
} | ||
@@ -56,0 +56,0 @@ function getDroppableTargets(monitor) { |
@@ -22,5 +22,5 @@ "use strict"; | ||
function DragDropManagerImpl(createBackend, context, debugMode) { | ||
var _this = this; | ||
if (context === void 0) { context = {}; } | ||
if (debugMode === void 0) { debugMode = false; } | ||
var _this = this; | ||
this.context = context; | ||
@@ -27,0 +27,0 @@ this.isSetUp = false; |
import { Store } from 'redux'; | ||
import { State } from './reducers'; | ||
import { DragDropMonitor, Listener, Unsubscribe, XYCoord, HandlerRegistry } from './interfaces'; | ||
import { DragDropMonitor, Listener, Unsubscribe, XYCoord, HandlerRegistry, Identifier } from './interfaces'; | ||
export default class DragDropMonitorImpl implements DragDropMonitor { | ||
@@ -19,3 +19,3 @@ private store; | ||
}): boolean; | ||
getItemType(): string | symbol; | ||
getItemType(): Identifier; | ||
getItem(): any; | ||
@@ -22,0 +22,0 @@ getSourceId(): string | null; |
@@ -17,3 +17,3 @@ import { Store } from 'redux'; | ||
getTarget(targetId: string): DropTarget; | ||
getSourceType(sourceId: string): string | symbol; | ||
getSourceType(sourceId: string): Identifier; | ||
getTargetType(targetId: string): Identifier | Identifier[]; | ||
@@ -20,0 +20,0 @@ isSourceId(handlerId: string): boolean; |
@@ -7,2 +7,2 @@ import { Action } from '../interfaces'; | ||
} | ||
export default function dirtyHandlerIds(state: string[] | undefined, action: Action<DirtyHandlerIdPayload>): any; | ||
export default function dirtyHandlerIds(state: string[] | undefined, action: Action<DirtyHandlerIdPayload>): string[]; |
@@ -7,3 +7,3 @@ "use strict"; | ||
var dirtiness_1 = require("../utils/dirtiness"); | ||
var xor = require('lodash/xor'); | ||
var discount_lodash_1 = require("../utils/discount_lodash"); | ||
function dirtyHandlerIds(state, action) { | ||
@@ -27,3 +27,3 @@ if (state === void 0) { state = dirtiness_1.NONE; } | ||
var _a = action.payload, _b = _a.targetIds, targetIds = _b === void 0 ? [] : _b, _c = _a.prevTargetIds, prevTargetIds = _c === void 0 ? [] : _c; | ||
var result = xor(targetIds, prevTargetIds); | ||
var result = discount_lodash_1.xor(targetIds, prevTargetIds); | ||
var didChange = result.length > 0 || !equality_1.areArraysEqual(targetIds, prevTargetIds); | ||
@@ -30,0 +30,0 @@ if (!didChange) { |
@@ -19,10 +19,2 @@ import { Identifier, Action } from '../interfaces'; | ||
dropResult: any; | ||
}>): { | ||
targetIds: any; | ||
itemType: string | symbol | (string | symbol)[] | null; | ||
item: any; | ||
sourceId: string | null; | ||
dropResult: any; | ||
didDrop: boolean; | ||
isSourcePublic: boolean | null; | ||
}; | ||
}>): State; |
@@ -16,3 +16,3 @@ "use strict"; | ||
var registry_1 = require("../actions/registry"); | ||
var without = require('lodash/without'); | ||
var discount_lodash_1 = require("../utils/discount_lodash"); | ||
var initialState = { | ||
@@ -41,3 +41,3 @@ itemType: null, | ||
} | ||
return __assign({}, state, { targetIds: without(state.targetIds, payload.targetId) }); | ||
return __assign({}, state, { targetIds: discount_lodash_1.without(state.targetIds, payload.targetId) }); | ||
case dragDrop_1.DROP: | ||
@@ -44,0 +44,0 @@ return __assign({}, state, { dropResult: payload.dropResult, didDrop: true, targetIds: [] }); |
@@ -14,15 +14,7 @@ import { State as DragOffsetState } from './dragOffset'; | ||
export default function reduce(state: State | undefined, action: any): { | ||
dirtyHandlerIds: any; | ||
dirtyHandlerIds: string[]; | ||
dragOffset: DragOffsetState; | ||
refCount: number; | ||
dragOperation: { | ||
targetIds: any; | ||
itemType: string | symbol | (string | symbol)[] | null; | ||
item: any; | ||
sourceId: string | null; | ||
dropResult: any; | ||
didDrop: boolean; | ||
isSourcePublic: boolean | null; | ||
}; | ||
dragOperation: DragOperationState; | ||
stateId: number; | ||
}; |
@@ -19,3 +19,3 @@ "use strict"; | ||
var stateId_1 = require("./stateId"); | ||
var get = require('lodash/get'); | ||
var discount_lodash_1 = require("../utils/discount_lodash"); | ||
function reduce(state, action) { | ||
@@ -26,3 +26,3 @@ if (state === void 0) { state = {}; } | ||
type: action.type, | ||
payload: __assign({}, action.payload, { prevTargetIds: get(state, 'dragOperation.targetIds', []) }), | ||
payload: __assign({}, action.payload, { prevTargetIds: discount_lodash_1.get(state, 'dragOperation.targetIds', []) }), | ||
}), | ||
@@ -29,0 +29,0 @@ dragOffset: dragOffset_1.default(state.dragOffset, action), |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var intersection = require('lodash/intersection'); | ||
var discount_lodash_1 = require("./discount_lodash"); | ||
exports.NONE = []; | ||
@@ -21,5 +21,5 @@ exports.ALL = []; | ||
} | ||
var commonIds = intersection(handlerIds, dirtyIds); | ||
var commonIds = discount_lodash_1.intersection(handlerIds, dirtyIds); | ||
return commonIds.length > 0; | ||
} | ||
exports.areDirty = areDirty; |
import { setClientOffset } from './local/setClientOffset'; | ||
import { isObject } from '../../utils/discount_lodash'; | ||
const invariant = require('invariant'); | ||
const isObject = require('lodash/isObject'); | ||
import { BEGIN_DRAG, INIT_COORDS } from './types'; | ||
@@ -5,0 +5,0 @@ const ResetCoordinatesAction = { |
import { DROP } from './types'; | ||
import { isObject } from '../../utils/discount_lodash'; | ||
const invariant = require('invariant'); | ||
const isObject = require('lodash/isObject'); | ||
export default function createDrop(manager) { | ||
@@ -5,0 +5,0 @@ return function drop(options = {}) { |
import { Store } from 'redux'; | ||
import { State } from './reducers'; | ||
import { DragDropMonitor, Listener, Unsubscribe, XYCoord, HandlerRegistry } from './interfaces'; | ||
import { DragDropMonitor, Listener, Unsubscribe, XYCoord, HandlerRegistry, Identifier } from './interfaces'; | ||
export default class DragDropMonitorImpl implements DragDropMonitor { | ||
@@ -19,3 +19,3 @@ private store; | ||
}): boolean; | ||
getItemType(): string | symbol; | ||
getItemType(): Identifier; | ||
getItem(): any; | ||
@@ -22,0 +22,0 @@ getSourceId(): string | null; |
@@ -17,3 +17,3 @@ import { Store } from 'redux'; | ||
getTarget(targetId: string): DropTarget; | ||
getSourceType(sourceId: string): string | symbol; | ||
getSourceType(sourceId: string): Identifier; | ||
getTargetType(targetId: string): Identifier | Identifier[]; | ||
@@ -20,0 +20,0 @@ isSourceId(handlerId: string): boolean; |
@@ -7,2 +7,2 @@ import { Action } from '../interfaces'; | ||
} | ||
export default function dirtyHandlerIds(state: string[] | undefined, action: Action<DirtyHandlerIdPayload>): any; | ||
export default function dirtyHandlerIds(state: string[] | undefined, action: Action<DirtyHandlerIdPayload>): string[]; |
@@ -5,3 +5,3 @@ import { BEGIN_DRAG, PUBLISH_DRAG_SOURCE, HOVER, END_DRAG, DROP, } from '../actions/dragDrop'; | ||
import { NONE, ALL } from '../utils/dirtiness'; | ||
const xor = require('lodash/xor'); | ||
import { xor } from '../utils/discount_lodash'; | ||
export default function dirtyHandlerIds(state = NONE, action) { | ||
@@ -8,0 +8,0 @@ switch (action.type) { |
@@ -19,10 +19,2 @@ import { Identifier, Action } from '../interfaces'; | ||
dropResult: any; | ||
}>): { | ||
targetIds: any; | ||
itemType: string | symbol | (string | symbol)[] | null; | ||
item: any; | ||
sourceId: string | null; | ||
dropResult: any; | ||
didDrop: boolean; | ||
isSourcePublic: boolean | null; | ||
}; | ||
}>): State; |
import { BEGIN_DRAG, PUBLISH_DRAG_SOURCE, HOVER, END_DRAG, DROP, } from '../actions/dragDrop'; | ||
import { REMOVE_TARGET } from '../actions/registry'; | ||
const without = require('lodash/without'); | ||
import { without } from '../utils/discount_lodash'; | ||
const initialState = { | ||
@@ -5,0 +5,0 @@ itemType: null, |
@@ -14,15 +14,7 @@ import { State as DragOffsetState } from './dragOffset'; | ||
export default function reduce(state: State | undefined, action: any): { | ||
dirtyHandlerIds: any; | ||
dirtyHandlerIds: string[]; | ||
dragOffset: DragOffsetState; | ||
refCount: number; | ||
dragOperation: { | ||
targetIds: any; | ||
itemType: string | symbol | (string | symbol)[] | null; | ||
item: any; | ||
sourceId: string | null; | ||
dropResult: any; | ||
didDrop: boolean; | ||
isSourcePublic: boolean | null; | ||
}; | ||
dragOperation: DragOperationState; | ||
stateId: number; | ||
}; |
@@ -6,3 +6,3 @@ import dragOffset from './dragOffset'; | ||
import stateId from './stateId'; | ||
const get = require('lodash/get'); | ||
import { get } from '../utils/discount_lodash'; | ||
export default function reduce(state = {}, action) { | ||
@@ -9,0 +9,0 @@ return { |
@@ -1,2 +0,2 @@ | ||
const intersection = require('lodash/intersection'); | ||
import { intersection } from './discount_lodash'; | ||
export const NONE = []; | ||
@@ -3,0 +3,0 @@ export const ALL = []; |
{ | ||
"name": "dnd-core", | ||
"version": "7.4.0", | ||
"version": "7.4.4", | ||
"description": "Drag and drop sans the GUI", | ||
@@ -23,3 +23,2 @@ "license": "MIT", | ||
"invariant": "^2.2.4", | ||
"lodash": "^4.17.11", | ||
"redux": "^4.0.1" | ||
@@ -30,5 +29,5 @@ }, | ||
"rimraf": "^2.6.3", | ||
"typescript": "^3.3.3333" | ||
"typescript": "^3.4.1" | ||
}, | ||
"gitHead": "941dc2eb67e41ad924a31e4cbb793fa5dd3add71" | ||
"gitHead": "5b58d291c6bcdb87c18cf3ad2a1d76b599a43c1f" | ||
} |
117500
3.42%3
-25%117
3.54%3000
5.56%- Removed
- Removed