Files
externals/npm/web/ui/node_modules/react-dnd/dist/ReactDnD.js
T

7342 lines
202 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"));
else if(typeof define === 'function' && define.amd)
define(["react"], factory);
else if(typeof exports === 'object')
exports["ReactDnD"] = factory(require("react"));
else
root["ReactDnD"] = factory(root["React"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 43);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var invariant = function(condition, format, a, b, c, d, e, f) {
if (false) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
}
if (!condition) {
var error;
if (format === undefined) {
error = new Error(
'Minified exception occurred; use the non-minified dev environment ' +
'for the full error message and additional helpful warnings.'
);
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(
format.replace(/%s/g, function() { return args[argIndex++]; })
);
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
};
module.exports = invariant;
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(14),
getPrototype = __webpack_require__(54),
isObjectLike = __webpack_require__(6);
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;
/***/ }),
/* 2 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
/***/ }),
/* 3 */
/***/ (function(module, exports) {
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
module.exports = isArray;
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (false) {
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
Symbol.for &&
Symbol.for('react.element')) ||
0xeac7;
var isValidElement = function(object) {
return typeof object === 'object' &&
object !== null &&
object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
} else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = __webpack_require__(44)();
}
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(51);
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
/***/ }),
/* 6 */
/***/ (function(module, exports) {
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.END_DRAG = exports.DROP = exports.HOVER = exports.PUBLISH_DRAG_SOURCE = exports.BEGIN_DRAG = undefined;
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}return target;
};
exports.beginDrag = beginDrag;
exports.publishDragSource = publishDragSource;
exports.hover = hover;
exports.drop = drop;
exports.endDrag = endDrag;
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
var _isArray = __webpack_require__(3);
var _isArray2 = _interopRequireDefault(_isArray);
var _isObject = __webpack_require__(17);
var _isObject2 = _interopRequireDefault(_isObject);
var _matchesType = __webpack_require__(30);
var _matchesType2 = _interopRequireDefault(_matchesType);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var BEGIN_DRAG = exports.BEGIN_DRAG = 'dnd-core/BEGIN_DRAG';
var PUBLISH_DRAG_SOURCE = exports.PUBLISH_DRAG_SOURCE = 'dnd-core/PUBLISH_DRAG_SOURCE';
var HOVER = exports.HOVER = 'dnd-core/HOVER';
var DROP = exports.DROP = 'dnd-core/DROP';
var END_DRAG = exports.END_DRAG = 'dnd-core/END_DRAG';
function beginDrag(sourceIds) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { publishSource: true, clientOffset: null };
var publishSource = options.publishSource,
clientOffset = options.clientOffset,
getSourceClientOffset = options.getSourceClientOffset;
(0, _invariant2.default)((0, _isArray2.default)(sourceIds), 'Expected sourceIds to be an array.');
var monitor = this.getMonitor();
var registry = this.getRegistry();
(0, _invariant2.default)(!monitor.isDragging(), 'Cannot call beginDrag while dragging.');
for (var i = 0; i < sourceIds.length; i++) {
(0, _invariant2.default)(registry.getSource(sourceIds[i]), 'Expected sourceIds to be registered.');
}
var sourceId = null;
for (var _i = sourceIds.length - 1; _i >= 0; _i--) {
if (monitor.canDragSource(sourceIds[_i])) {
sourceId = sourceIds[_i];
break;
}
}
if (sourceId === null) {
return;
}
var sourceClientOffset = null;
if (clientOffset) {
(0, _invariant2.default)(typeof getSourceClientOffset === 'function', 'When clientOffset is provided, getSourceClientOffset must be a function.');
sourceClientOffset = getSourceClientOffset(sourceId);
}
var source = registry.getSource(sourceId);
var item = source.beginDrag(monitor, sourceId);
(0, _invariant2.default)((0, _isObject2.default)(item), 'Item must be an object.');
registry.pinSource(sourceId);
var itemType = registry.getSourceType(sourceId);
return {
type: BEGIN_DRAG,
itemType: itemType,
item: item,
sourceId: sourceId,
clientOffset: clientOffset,
sourceClientOffset: sourceClientOffset,
isSourcePublic: publishSource
};
}
function publishDragSource() {
var monitor = this.getMonitor();
if (!monitor.isDragging()) {
return;
}
return { type: PUBLISH_DRAG_SOURCE };
}
function hover(targetIdsArg) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$clientOffset = _ref.clientOffset,
clientOffset = _ref$clientOffset === undefined ? null : _ref$clientOffset;
(0, _invariant2.default)((0, _isArray2.default)(targetIdsArg), 'Expected targetIds to be an array.');
var targetIds = targetIdsArg.slice(0);
var monitor = this.getMonitor();
var registry = this.getRegistry();
(0, _invariant2.default)(monitor.isDragging(), 'Cannot call hover while not dragging.');
(0, _invariant2.default)(!monitor.didDrop(), 'Cannot call hover after drop.');
// First check invariants.
for (var i = 0; i < targetIds.length; i++) {
var targetId = targetIds[i];
(0, _invariant2.default)(targetIds.lastIndexOf(targetId) === i, 'Expected targetIds to be unique in the passed array.');
var target = registry.getTarget(targetId);
(0, _invariant2.default)(target, 'Expected targetIds to be registered.');
}
var draggedItemType = monitor.getItemType();
// Remove those targetIds that don't match the targetType. This
// fixes shallow isOver which would only be non-shallow because of
// non-matching targets.
for (var _i2 = targetIds.length - 1; _i2 >= 0; _i2--) {
var _targetId = targetIds[_i2];
var targetType = registry.getTargetType(_targetId);
if (!(0, _matchesType2.default)(targetType, draggedItemType)) {
targetIds.splice(_i2, 1);
}
}
// Finally call hover on all matching targets.
for (var _i3 = 0; _i3 < targetIds.length; _i3++) {
var _targetId2 = targetIds[_i3];
var _target = registry.getTarget(_targetId2);
_target.hover(monitor, _targetId2);
}
return {
type: HOVER,
targetIds: targetIds,
clientOffset: clientOffset
};
}
function drop() {
var _this = this;
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var monitor = this.getMonitor();
var registry = this.getRegistry();
(0, _invariant2.default)(monitor.isDragging(), 'Cannot call drop while not dragging.');
(0, _invariant2.default)(!monitor.didDrop(), 'Cannot call drop twice during one drag operation.');
var targetIds = monitor.getTargetIds().filter(monitor.canDropOnTarget, monitor);
targetIds.reverse();
targetIds.forEach(function (targetId, index) {
var target = registry.getTarget(targetId);
var dropResult = target.drop(monitor, targetId);
(0, _invariant2.default)(typeof dropResult === 'undefined' || (0, _isObject2.default)(dropResult), 'Drop result must either be an object or undefined.');
if (typeof dropResult === 'undefined') {
dropResult = index === 0 ? {} : monitor.getDropResult();
}
_this.store.dispatch({
type: DROP,
dropResult: _extends({}, options, dropResult)
});
});
}
function endDrag() {
var monitor = this.getMonitor();
var registry = this.getRegistry();
(0, _invariant2.default)(monitor.isDragging(), 'Cannot call endDrag while not dragging.');
var sourceId = monitor.getSourceId();
var source = registry.getSource(sourceId, true);
source.endDrag(monitor, sourceId);
registry.unpinSource();
return { type: END_DRAG };
}
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(9);
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(67),
getValue = __webpack_require__(71);
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
module.exports = getNative;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(79);
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
module.exports = assocIndexOf;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(85);
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
module.exports = getMapData;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addSource = addSource;
exports.addTarget = addTarget;
exports.removeSource = removeSource;
exports.removeTarget = removeTarget;
var ADD_SOURCE = exports.ADD_SOURCE = 'dnd-core/ADD_SOURCE';
var ADD_TARGET = exports.ADD_TARGET = 'dnd-core/ADD_TARGET';
var REMOVE_SOURCE = exports.REMOVE_SOURCE = 'dnd-core/REMOVE_SOURCE';
var REMOVE_TARGET = exports.REMOVE_TARGET = 'dnd-core/REMOVE_TARGET';
function addSource(sourceId) {
return {
type: ADD_SOURCE,
sourceId: sourceId
};
}
function addTarget(targetId) {
return {
type: ADD_TARGET,
targetId: targetId
};
}
function removeSource(sourceId) {
return {
type: REMOVE_SOURCE,
sourceId: sourceId
};
}
function removeTarget(targetId) {
return {
type: REMOVE_TARGET,
targetId: targetId
};
}
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = checkDecoratorArguments;
function checkDecoratorArguments(functionName, signature) {
if (false) {
for (var i = 0; i < (arguments.length <= 2 ? 0 : arguments.length - 2); i += 1) {
var arg = arguments.length <= i + 2 ? undefined : arguments[i + 2];
if (arg && arg.prototype && arg.prototype.render) {
// eslint-disable-next-line no-console
console.error('You seem to be applying the arguments in the wrong order. ' + ('It should be ' + functionName + '(' + signature + ')(Component), not the other way around. ') + 'Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order');
return;
}
}
}
}
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(15),
getRawTag = __webpack_require__(52),
objectToString = __webpack_require__(53);
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
module.exports = baseGetTag;
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(5);
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ }),
/* 16 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 17 */
/***/ (function(module, exports) {
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
module.exports = isObject;
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(63),
setCacheAdd = __webpack_require__(89),
setCacheHas = __webpack_require__(90);
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values == null ? 0 : values.length;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(91);
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array == null ? 0 : array.length;
return !!length && baseIndexOf(array, value, 0) > -1;
}
module.exports = arrayIncludes;
/***/ }),
/* 20 */
/***/ (function(module, exports) {
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
module.exports = arrayIncludesWith;
/***/ }),
/* 21 */
/***/ (function(module, exports) {
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;
/***/ }),
/* 22 */
/***/ (function(module, exports) {
/**
* Checks if a `cache` value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
module.exports = cacheHas;
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
var identity = __webpack_require__(34),
overRest = __webpack_require__(95),
setToString = __webpack_require__(97);
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
return setToString(overRest(func, start, identity), func + '');
}
module.exports = baseRest;
/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(102),
isObjectLike = __webpack_require__(6);
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
module.exports = isArrayLikeObject;
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
(function (global, factory) {
true ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.hoistNonReactStatics = factory());
}(this, (function () {
'use strict';
var REACT_STATICS = {
childContextTypes: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
if (objectPrototype) {
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
}
}
var keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try { // Avoid failures from read-only properties
defineProperty(targetComponent, key, descriptor);
} catch (e) {}
}
}
return targetComponent;
}
return targetComponent;
};
})));
/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = shallowEqual;
function shallowEqual(objA, objB) {
if (objA === objB) {
return true;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
var hasOwn = Object.prototype.hasOwnProperty;
for (var i = 0; i < keysA.length; i += 1) {
if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
return false;
}
var valA = objA[keysA[i]];
var valB = objB[keysA[i]];
if (valA !== valB) {
return false;
}
}
return true;
}
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports['default'] = isDisposable;
function isDisposable(obj) {
return Boolean(obj && typeof obj.dispose === 'function');
}
module.exports = exports['default'];
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unpackBackendForEs5Users = exports.createChildContext = exports.CHILD_CONTEXT_TYPES = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.default = DragDropContext;
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(4);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _dndCore = __webpack_require__(48);
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
var _hoistNonReactStatics = __webpack_require__(25);
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
var _checkDecoratorArguments = __webpack_require__(13);
var _checkDecoratorArguments2 = _interopRequireDefault(_checkDecoratorArguments);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var CHILD_CONTEXT_TYPES = exports.CHILD_CONTEXT_TYPES = {
dragDropManager: _propTypes2.default.object.isRequired
};
var createChildContext = exports.createChildContext = function createChildContext(backend, context) {
return {
dragDropManager: new _dndCore.DragDropManager(backend, context)
};
};
var unpackBackendForEs5Users = exports.unpackBackendForEs5Users = function unpackBackendForEs5Users(backendOrModule) {
// Auto-detect ES6 default export for people still using ES5
var backend = backendOrModule;
if ((typeof backend === 'undefined' ? 'undefined' : _typeof(backend)) === 'object' && typeof backend.default === 'function') {
backend = backend.default;
}
(0, _invariant2.default)(typeof backend === 'function', 'Expected the backend to be a function or an ES6 module exporting a default function. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-drop-context.html');
return backend;
};
function DragDropContext(backendOrModule) {
_checkDecoratorArguments2.default.apply(undefined, ['DragDropContext', 'backend'].concat(Array.prototype.slice.call(arguments))); // eslint-disable-line prefer-rest-params
var backend = unpackBackendForEs5Users(backendOrModule);
var childContext = createChildContext(backend);
return function decorateContext(DecoratedComponent) {
var _class, _temp;
var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
var DragDropContextContainer = (_temp = _class = function (_Component) {
_inherits(DragDropContextContainer, _Component);
function DragDropContextContainer() {
_classCallCheck(this, DragDropContextContainer);
return _possibleConstructorReturn(this, (DragDropContextContainer.__proto__ || Object.getPrototypeOf(DragDropContextContainer)).apply(this, arguments));
}
_createClass(DragDropContextContainer, [{
key: 'getDecoratedComponentInstance',
value: function getDecoratedComponentInstance() {
(0, _invariant2.default)(this.child, 'In order to access an instance of the decorated component it can not be a stateless component.');
return this.child;
}
}, {
key: 'getManager',
value: function getManager() {
return childContext.dragDropManager;
}
}, {
key: 'getChildContext',
value: function getChildContext() {
return childContext;
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
return _react2.default.createElement(DecoratedComponent, _extends({}, this.props, {
ref: function ref(child) {
_this2.child = child;
}
}));
}
}]);
return DragDropContextContainer;
}(_react.Component), _class.DecoratedComponent = DecoratedComponent, _class.displayName = 'DragDropContext(' + displayName + ')', _class.childContextTypes = CHILD_CONTEXT_TYPES, _temp);
return (0, _hoistNonReactStatics2.default)(DragDropContextContainer, DecoratedComponent);
};
}
/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}return target;
};
exports.default = dragOffset;
exports.getSourceClientOffset = getSourceClientOffset;
exports.getDifferenceFromInitialOffset = getDifferenceFromInitialOffset;
var _dragDrop = __webpack_require__(7);
var initialState = {
initialSourceClientOffset: null,
initialClientOffset: null,
clientOffset: null
};
function areOffsetsEqual(offsetA, offsetB) {
if (offsetA === offsetB) {
return true;
}
return offsetA && offsetB && offsetA.x === offsetB.x && offsetA.y === offsetB.y;
}
function dragOffset() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
var action = arguments[1];
switch (action.type) {
case _dragDrop.BEGIN_DRAG:
return {
initialSourceClientOffset: action.sourceClientOffset,
initialClientOffset: action.clientOffset,
clientOffset: action.clientOffset
};
case _dragDrop.HOVER:
if (areOffsetsEqual(state.clientOffset, action.clientOffset)) {
return state;
}
return _extends({}, state, {
clientOffset: action.clientOffset
});
case _dragDrop.END_DRAG:
case _dragDrop.DROP:
return initialState;
default:
return state;
}
}
function getSourceClientOffset(state) {
var clientOffset = state.clientOffset,
initialClientOffset = state.initialClientOffset,
initialSourceClientOffset = state.initialSourceClientOffset;
if (!clientOffset || !initialClientOffset || !initialSourceClientOffset) {
return null;
}
return {
x: clientOffset.x + initialSourceClientOffset.x - initialClientOffset.x,
y: clientOffset.y + initialSourceClientOffset.y - initialClientOffset.y
};
}
function getDifferenceFromInitialOffset(state) {
var clientOffset = state.clientOffset,
initialClientOffset = state.initialClientOffset;
if (!clientOffset || !initialClientOffset) {
return null;
}
return {
x: clientOffset.x - initialClientOffset.x,
y: clientOffset.y - initialClientOffset.y
};
}
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = matchesType;
var _isArray = __webpack_require__(3);
var _isArray2 = _interopRequireDefault(_isArray);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function matchesType(targetType, draggedItemType) {
if ((0, _isArray2.default)(targetType)) {
return targetType.some(function (t) {
return t === draggedItemType;
});
} else {
return targetType === draggedItemType;
}
}
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(18),
arrayIncludes = __webpack_require__(19),
arrayIncludesWith = __webpack_require__(20),
arrayMap = __webpack_require__(21),
baseUnary = __webpack_require__(33),
cacheHas = __webpack_require__(22);
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* The base implementation of methods like `_.difference` without support
* for excluding multiple arrays or iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Array} values The values to exclude.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
*/
function baseDifference(array, values, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
isCommon = true,
length = array.length,
result = [],
valuesLength = values.length;
if (!length) {
return result;
}
if (iteratee) {
values = arrayMap(values, baseUnary(iteratee));
}
if (comparator) {
includes = arrayIncludesWith;
isCommon = false;
}
else if (values.length >= LARGE_ARRAY_SIZE) {
includes = cacheHas;
isCommon = false;
values = new SetCache(values);
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee == null ? value : iteratee(value);
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values[valuesIndex] === computed) {
continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result;
}
module.exports = baseDifference;
/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(14),
isObject = __webpack_require__(17);
/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
proxyTag = '[object Proxy]';
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
module.exports = isFunction;
/***/ }),
/* 33 */
/***/ (function(module, exports) {
/**
* The base implementation of `_.unary` without support for storing metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function(value) {
return func(value);
};
}
module.exports = baseUnary;
/***/ }),
/* 34 */
/***/ (function(module, exports) {
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
module.exports = identity;
/***/ }),
/* 35 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = dirtyHandlerIds;
exports.areDirty = areDirty;
var _xor = __webpack_require__(105);
var _xor2 = _interopRequireDefault(_xor);
var _intersection = __webpack_require__(116);
var _intersection2 = _interopRequireDefault(_intersection);
var _dragDrop = __webpack_require__(7);
var _registry = __webpack_require__(12);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var NONE = [];
var ALL = [];
function dirtyHandlerIds() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : NONE;
var action = arguments[1];
var dragOperation = arguments[2];
switch (action.type) {
case _dragDrop.HOVER:
break;
case _registry.ADD_SOURCE:
case _registry.ADD_TARGET:
case _registry.REMOVE_TARGET:
case _registry.REMOVE_SOURCE:
return NONE;
case _dragDrop.BEGIN_DRAG:
case _dragDrop.PUBLISH_DRAG_SOURCE:
case _dragDrop.END_DRAG:
case _dragDrop.DROP:
default:
return ALL;
}
var targetIds = action.targetIds;
var prevTargetIds = dragOperation.targetIds;
var result = (0, _xor2.default)(targetIds, prevTargetIds);
var didChange = false;
if (result.length === 0) {
for (var i = 0; i < targetIds.length; i++) {
if (targetIds[i] !== prevTargetIds[i]) {
didChange = true;
break;
}
}
} else {
didChange = true;
}
if (!didChange) {
return NONE;
}
var prevInnermostTargetId = prevTargetIds[prevTargetIds.length - 1];
var innermostTargetId = targetIds[targetIds.length - 1];
if (prevInnermostTargetId !== innermostTargetId) {
if (prevInnermostTargetId) {
result.push(prevInnermostTargetId);
}
if (innermostTargetId) {
result.push(innermostTargetId);
}
}
return result;
}
function areDirty(state, handlerIds) {
if (state === NONE) {
return false;
}
if (state === ALL || typeof handlerIds === 'undefined') {
return true;
}
return (0, _intersection2.default)(handlerIds, state).length > 0;
}
/***/ }),
/* 36 */
/***/ (function(module, exports) {
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {
// No operation performed.
}
module.exports = noop;
/***/ }),
/* 37 */
/***/ (function(module, exports) {
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
module.exports = setToArray;
/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.default = shallowEqualScalar;
function shallowEqualScalar(objA, objB) {
if (objA === objB) {
return true;
}
if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
var hasOwn = Object.prototype.hasOwnProperty;
for (var i = 0; i < keysA.length; i += 1) {
if (!hasOwn.call(objB, keysA[i])) {
return false;
}
var valA = objA[keysA[i]];
var valB = objB[keysA[i]];
if (valA !== valB || (typeof valA === 'undefined' ? 'undefined' : _typeof(valA)) === 'object' || (typeof valB === 'undefined' ? 'undefined' : _typeof(valB)) === 'object') {
return false;
}
}
return true;
}
/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
exports.default = decorateHandler;
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(4);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _disposables = __webpack_require__(131);
var _isPlainObject = __webpack_require__(1);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
var _hoistNonReactStatics = __webpack_require__(25);
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
var _shallowEqual = __webpack_require__(26);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var _shallowEqualScalar = __webpack_require__(38);
var _shallowEqualScalar2 = _interopRequireDefault(_shallowEqualScalar);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var isClassComponent = function isClassComponent(Comp) {
return Boolean(Comp && Comp.prototype && typeof Comp.prototype.render === 'function');
};
function decorateHandler(_ref) {
var _class, _temp;
var DecoratedComponent = _ref.DecoratedComponent,
createHandler = _ref.createHandler,
createMonitor = _ref.createMonitor,
createConnector = _ref.createConnector,
registerHandler = _ref.registerHandler,
containerDisplayName = _ref.containerDisplayName,
getType = _ref.getType,
collect = _ref.collect,
options = _ref.options;
var _options$arePropsEqua = options.arePropsEqual,
arePropsEqual = _options$arePropsEqua === undefined ? _shallowEqualScalar2.default : _options$arePropsEqua;
var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
var DragDropContainer = (_temp = _class = function (_Component) {
_inherits(DragDropContainer, _Component);
_createClass(DragDropContainer, [{
key: 'getHandlerId',
value: function getHandlerId() {
return this.handlerId;
}
}, {
key: 'getDecoratedComponentInstance',
value: function getDecoratedComponentInstance() {
return this.decoratedComponentInstance;
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
return !arePropsEqual(nextProps, this.props) || !(0, _shallowEqual2.default)(nextState, this.state);
}
}]);
function DragDropContainer(props, context) {
_classCallCheck(this, DragDropContainer);
var _this = _possibleConstructorReturn(this, (DragDropContainer.__proto__ || Object.getPrototypeOf(DragDropContainer)).call(this, props, context));
_this.handleChange = _this.handleChange.bind(_this);
_this.handleChildRef = _this.handleChildRef.bind(_this);
(0, _invariant2.default)(_typeof(_this.context.dragDropManager) === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);
_this.manager = _this.context.dragDropManager;
_this.handlerMonitor = createMonitor(_this.manager);
_this.handlerConnector = createConnector(_this.manager.getBackend());
_this.handler = createHandler(_this.handlerMonitor);
_this.disposable = new _disposables.SerialDisposable();
_this.receiveProps(props);
_this.state = _this.getCurrentState();
_this.dispose();
return _this;
}
_createClass(DragDropContainer, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.isCurrentlyMounted = true;
this.disposable = new _disposables.SerialDisposable();
this.currentType = null;
this.receiveProps(this.props);
this.handleChange();
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (!arePropsEqual(nextProps, this.props)) {
this.receiveProps(nextProps);
this.handleChange();
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.dispose();
this.isCurrentlyMounted = false;
}
}, {
key: 'receiveProps',
value: function receiveProps(props) {
this.handler.receiveProps(props);
this.receiveType(getType(props));
}
}, {
key: 'receiveType',
value: function receiveType(type) {
if (type === this.currentType) {
return;
}
this.currentType = type;
var _registerHandler = registerHandler(type, this.handler, this.manager),
handlerId = _registerHandler.handlerId,
unregister = _registerHandler.unregister;
this.handlerId = handlerId;
this.handlerMonitor.receiveHandlerId(handlerId);
this.handlerConnector.receiveHandlerId(handlerId);
var globalMonitor = this.manager.getMonitor();
var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, { handlerIds: [handlerId] });
this.disposable.setDisposable(new _disposables.CompositeDisposable(new _disposables.Disposable(unsubscribe), new _disposables.Disposable(unregister)));
}
}, {
key: 'handleChange',
value: function handleChange() {
if (!this.isCurrentlyMounted) {
return;
}
var nextState = this.getCurrentState();
if (!(0, _shallowEqual2.default)(nextState, this.state)) {
this.setState(nextState);
}
}
}, {
key: 'dispose',
value: function dispose() {
this.disposable.dispose();
this.handlerConnector.receiveHandlerId(null);
}
}, {
key: 'handleChildRef',
value: function handleChildRef(component) {
this.decoratedComponentInstance = component;
this.handler.receiveComponent(component);
}
}, {
key: 'getCurrentState',
value: function getCurrentState() {
var nextState = collect(this.handlerConnector.hooks, this.handlerMonitor);
if (false) {
(0, _invariant2.default)((0, _isPlainObject2.default)(nextState), 'Expected `collect` specified as the second argument to ' + '%s for %s to return a plain object of props to inject. ' + 'Instead, received %s.', containerDisplayName, displayName, nextState);
}
return nextState;
}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(DecoratedComponent, _extends({}, this.props, this.state, {
ref: isClassComponent(DecoratedComponent) ? this.handleChildRef : null
}));
}
}]);
return DragDropContainer;
}(_react.Component), _class.DecoratedComponent = DecoratedComponent, _class.displayName = containerDisplayName + '(' + displayName + ')', _class.contextTypes = {
dragDropManager: _propTypes2.default.object.isRequired
}, _temp);
return (0, _hoistNonReactStatics2.default)(DragDropContainer, DecoratedComponent);
}
/***/ }),
/* 40 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = wrapConnectorHooks;
var _react = __webpack_require__(2);
var _cloneWithRef = __webpack_require__(139);
var _cloneWithRef2 = _interopRequireDefault(_cloneWithRef);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function throwIfCompositeComponentElement(element) {
// Custom components can no longer be wrapped directly in React DnD 2.0
// so that we don't need to depend on findDOMNode() from react-dom.
if (typeof element.type === 'string') {
return;
}
var displayName = element.type.displayName || element.type.name || 'the component';
throw new Error('Only native element nodes can now be passed to React DnD connectors.' + ('You can either wrap ' + displayName + ' into a <div>, or turn it into a ') + 'drag source or a drop target itself.');
}
function wrapHookToRecognizeElement(hook) {
return function () {
var elementOrNode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
// When passed a node, call the hook straight away.
if (!(0, _react.isValidElement)(elementOrNode)) {
var node = elementOrNode;
hook(node, options);
return undefined;
}
// If passed a ReactElement, clone it and attach this function as a ref.
// This helps us achieve a neat API where user doesn't even know that refs
// are being used under the hood.
var element = elementOrNode;
throwIfCompositeComponentElement(element);
// When no options are passed, use the hook directly
var ref = options ? function (node) {
return hook(node, options);
} : hook;
return (0, _cloneWithRef2.default)(element, ref);
};
}
function wrapConnectorHooks(hooks) {
var wrappedHooks = {};
Object.keys(hooks).forEach(function (key) {
var hook = hooks[key];
var wrappedHook = wrapHookToRecognizeElement(hook);
wrappedHooks[key] = function () {
return wrappedHook;
};
});
return wrappedHooks;
}
/***/ }),
/* 41 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = areOptionsEqual;
var _shallowEqual = __webpack_require__(26);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function areOptionsEqual(nextOptions, currentOptions) {
if (currentOptions === nextOptions) {
return true;
}
return currentOptions !== null && nextOptions !== null && (0, _shallowEqual2.default)(currentOptions, nextOptions);
}
/***/ }),
/* 42 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.default = isValidType;
var _isArray = __webpack_require__(3);
var _isArray2 = _interopRequireDefault(_isArray);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function isValidType(type, allowArray) {
return typeof type === 'string' || (typeof type === 'undefined' ? 'undefined' : _typeof(type)) === 'symbol' || allowArray && (0, _isArray2.default)(type) && type.every(function (t) {
return isValidType(t, false);
});
}
/***/ }),
/* 43 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _DragDropContext = __webpack_require__(28);
Object.defineProperty(exports, 'DragDropContext', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DragDropContext).default;
}
});
var _DragDropContextProvider = __webpack_require__(128);
Object.defineProperty(exports, 'DragDropContextProvider', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DragDropContextProvider).default;
}
});
var _DragLayer = __webpack_require__(129);
Object.defineProperty(exports, 'DragLayer', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DragLayer).default;
}
});
var _DragSource = __webpack_require__(130);
Object.defineProperty(exports, 'DragSource', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DragSource).default;
}
});
var _DropTarget = __webpack_require__(140);
Object.defineProperty(exports, 'DropTarget', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DropTarget).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 44 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var emptyFunction = __webpack_require__(45);
var invariant = __webpack_require__(46);
var ReactPropTypesSecret = __webpack_require__(47);
module.exports = function() {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret === ReactPropTypesSecret) {
// It is still safe when called from React.
return;
}
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use PropTypes.checkPropTypes() to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
};
shim.isRequired = shim;
function getShim() {
return shim;
};
// Important!
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
var ReactPropTypes = {
array: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim,
exact: getShim
};
ReactPropTypes.checkPropTypes = emptyFunction;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/***/ }),
/* 45 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = function emptyFunction() {};
emptyFunction.thatReturns = makeEmptyFunction;
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
emptyFunction.thatReturnsThis = function () {
return this;
};
emptyFunction.thatReturnsArgument = function (arg) {
return arg;
};
module.exports = emptyFunction;
/***/ }),
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var validateFormat = function validateFormat(format) {};
if (false) {
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(format.replace(/%s/g, function () {
return args[argIndex++];
}));
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
}
module.exports = invariant;
/***/ }),
/* 47 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _DragDropManager = __webpack_require__(49);
Object.defineProperty(exports, 'DragDropManager', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DragDropManager).default;
}
});
var _DragSource = __webpack_require__(125);
Object.defineProperty(exports, 'DragSource', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DragSource).default;
}
});
var _DropTarget = __webpack_require__(126);
Object.defineProperty(exports, 'DropTarget', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DropTarget).default;
}
});
var _createTestBackend = __webpack_require__(127);
Object.defineProperty(exports, 'createTestBackend', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_createTestBackend).default;
}
});
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
/***/ }),
/* 49 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
}
}return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
};
}();
var _createStore = __webpack_require__(50);
var _createStore2 = _interopRequireDefault(_createStore);
var _reducers = __webpack_require__(60);
var _reducers2 = _interopRequireDefault(_reducers);
var _dragDrop = __webpack_require__(7);
var dragDropActions = _interopRequireWildcard(_dragDrop);
var _DragDropMonitor = __webpack_require__(120);
var _DragDropMonitor2 = _interopRequireDefault(_DragDropMonitor);
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
}
}newObj.default = obj;return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var DragDropManager = function () {
function DragDropManager(createBackend) {
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
_classCallCheck(this, DragDropManager);
var store = (0, _createStore2.default)(_reducers2.default);
this.context = context;
this.store = store;
this.monitor = new _DragDropMonitor2.default(store);
this.registry = this.monitor.registry;
this.backend = createBackend(this);
store.subscribe(this.handleRefCountChange.bind(this));
}
_createClass(DragDropManager, [{
key: 'handleRefCountChange',
value: function handleRefCountChange() {
var shouldSetUp = this.store.getState().refCount > 0;
if (shouldSetUp && !this.isSetUp) {
this.backend.setup();
this.isSetUp = true;
} else if (!shouldSetUp && this.isSetUp) {
this.backend.teardown();
this.isSetUp = false;
}
}
}, {
key: 'getContext',
value: function getContext() {
return this.context;
}
}, {
key: 'getMonitor',
value: function getMonitor() {
return this.monitor;
}
}, {
key: 'getBackend',
value: function getBackend() {
return this.backend;
}
}, {
key: 'getRegistry',
value: function getRegistry() {
return this.registry;
}
}, {
key: 'getActions',
value: function getActions() {
var manager = this;
var dispatch = this.store.dispatch;
function bindActionCreator(actionCreator) {
return function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var action = actionCreator.apply(manager, args);
if (typeof action !== 'undefined') {
dispatch(action);
}
};
}
return Object.keys(dragDropActions).filter(function (key) {
return typeof dragDropActions[key] === 'function';
}).reduce(function (boundActions, key) {
var action = dragDropActions[key];
boundActions[key] = bindActionCreator(action); // eslint-disable-line no-param-reassign
return boundActions;
}, {});
}
}]);
return DragDropManager;
}();
exports.default = DragDropManager;
/***/ }),
/* 50 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.ActionTypes = undefined;
exports['default'] = createStore;
var _isPlainObject = __webpack_require__(1);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _symbolObservable = __webpack_require__(56);
var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* These are private action types reserved by Redux.
* For any unknown actions, you must return the current state.
* If the current state is undefined, you must return the initial state.
* Do not reference these action types directly in your code.
*/
var ActionTypes = exports.ActionTypes = {
INIT: '@@redux/INIT'
/**
* Creates a Redux store that holds the state tree.
* The only way to change the data in the store is to call `dispatch()` on it.
*
* There should only be a single store in your app. To specify how different
* parts of the state tree respond to actions, you may combine several reducers
* into a single reducer function by using `combineReducers`.
*
* @param {Function} reducer A function that returns the next state tree, given
* the current state tree and the action to handle.
*
* @param {any} [preloadedState] The initial state. You may optionally specify it
* to hydrate the state from the server in universal apps, or to restore a
* previously serialized user session.
* If you use `combineReducers` to produce the root reducer function, this must be
* an object with the same shape as `combineReducers` keys.
*
* @param {Function} [enhancer] The store enhancer. You may optionally specify it
* to enhance the store with third-party capabilities such as middleware,
* time travel, persistence, etc. The only store enhancer that ships with Redux
* is `applyMiddleware()`.
*
* @returns {Store} A Redux store that lets you read the state, dispatch actions
* and subscribe to changes.
*/
};function createStore(reducer, preloadedState, enhancer) {
var _ref2;
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
enhancer = preloadedState;
preloadedState = undefined;
}
if (typeof enhancer !== 'undefined') {
if (typeof enhancer !== 'function') {
throw new Error('Expected the enhancer to be a function.');
}
return enhancer(createStore)(reducer, preloadedState);
}
if (typeof reducer !== 'function') {
throw new Error('Expected the reducer to be a function.');
}
var currentReducer = reducer;
var currentState = preloadedState;
var currentListeners = [];
var nextListeners = currentListeners;
var isDispatching = false;
function ensureCanMutateNextListeners() {
if (nextListeners === currentListeners) {
nextListeners = currentListeners.slice();
}
}
/**
* Reads the state tree managed by the store.
*
* @returns {any} The current state tree of your application.
*/
function getState() {
return currentState;
}
/**
* Adds a change listener. It will be called any time an action is dispatched,
* and some part of the state tree may potentially have changed. You may then
* call `getState()` to read the current state tree inside the callback.
*
* You may call `dispatch()` from a change listener, with the following
* caveats:
*
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
* If you subscribe or unsubscribe while the listeners are being invoked, this
* will not have any effect on the `dispatch()` that is currently in progress.
* However, the next `dispatch()` call, whether nested or not, will use a more
* recent snapshot of the subscription list.
*
* 2. The listener should not expect to see all state changes, as the state
* might have been updated multiple times during a nested `dispatch()` before
* the listener is called. It is, however, guaranteed that all subscribers
* registered before the `dispatch()` started will be called with the latest
* state by the time it exits.
*
* @param {Function} listener A callback to be invoked on every dispatch.
* @returns {Function} A function to remove this change listener.
*/
function subscribe(listener) {
if (typeof listener !== 'function') {
throw new Error('Expected listener to be a function.');
}
var isSubscribed = true;
ensureCanMutateNextListeners();
nextListeners.push(listener);
return function unsubscribe() {
if (!isSubscribed) {
return;
}
isSubscribed = false;
ensureCanMutateNextListeners();
var index = nextListeners.indexOf(listener);
nextListeners.splice(index, 1);
};
}
/**
* Dispatches an action. It is the only way to trigger a state change.
*
* The `reducer` function, used to create the store, will be called with the
* current state tree and the given `action`. Its return value will
* be considered the **next** state of the tree, and the change listeners
* will be notified.
*
* The base implementation only supports plain object actions. If you want to
* dispatch a Promise, an Observable, a thunk, or something else, you need to
* wrap your store creating function into the corresponding middleware. For
* example, see the documentation for the `redux-thunk` package. Even the
* middleware will eventually dispatch plain object actions using this method.
*
* @param {Object} action A plain object representing “what changed”. It is
* a good idea to keep actions serializable so you can record and replay user
* sessions, or use the time travelling `redux-devtools`. An action must have
* a `type` property which may not be `undefined`. It is a good idea to use
* string constants for action types.
*
* @returns {Object} For convenience, the same action object you dispatched.
*
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
* return something else (for example, a Promise you can await).
*/
function dispatch(action) {
if (!(0, _isPlainObject2['default'])(action)) {
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
}
if (typeof action.type === 'undefined') {
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
}
if (isDispatching) {
throw new Error('Reducers may not dispatch actions.');
}
try {
isDispatching = true;
currentState = currentReducer(currentState, action);
} finally {
isDispatching = false;
}
var listeners = currentListeners = nextListeners;
for (var i = 0; i < listeners.length; i++) {
var listener = listeners[i];
listener();
}
return action;
}
/**
* Replaces the reducer currently used by the store to calculate the state.
*
* You might need this if your app implements code splitting and you want to
* load some of the reducers dynamically. You might also need this if you
* implement a hot reloading mechanism for Redux.
*
* @param {Function} nextReducer The reducer for the store to use instead.
* @returns {void}
*/
function replaceReducer(nextReducer) {
if (typeof nextReducer !== 'function') {
throw new Error('Expected the nextReducer to be a function.');
}
currentReducer = nextReducer;
dispatch({ type: ActionTypes.INIT });
}
/**
* Interoperability point for observable/reactive libraries.
* @returns {observable} A minimal observable of state changes.
* For more information, see the observable proposal:
* https://github.com/tc39/proposal-observable
*/
function observable() {
var _ref;
var outerSubscribe = subscribe;
return _ref = {
/**
* The minimal observable subscription method.
* @param {Object} observer Any object that can be used as an observer.
* The observer object should have a `next` method.
* @returns {subscription} An object with an `unsubscribe` method that can
* be used to unsubscribe the observable from the store, and prevent further
* emission of values from the observable.
*/
subscribe: function subscribe(observer) {
if (typeof observer !== 'object') {
throw new TypeError('Expected the observer to be an object.');
}
function observeState() {
if (observer.next) {
observer.next(getState());
}
}
observeState();
var unsubscribe = outerSubscribe(observeState);
return { unsubscribe: unsubscribe };
}
}, _ref[_symbolObservable2['default']] = function () {
return this;
}, _ref;
}
// When a store is created, an "INIT" action is dispatched so that every
// reducer returns their initial state. This effectively populates
// the initial state tree.
dispatch({ type: ActionTypes.INIT });
return _ref2 = {
dispatch: dispatch,
subscribe: subscribe,
getState: getState,
replaceReducer: replaceReducer
}, _ref2[_symbolObservable2['default']] = observable, _ref2;
}
/***/ }),
/* 51 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 52 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(15);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
module.exports = getRawTag;
/***/ }),
/* 53 */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
module.exports = objectToString;
/***/ }),
/* 54 */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(55);
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ }),
/* 55 */
/***/ (function(module, exports) {
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
module.exports = overArg;
/***/ }),
/* 56 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(57);
/***/ }),
/* 57 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global, module) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ponyfill = __webpack_require__(59);
var _ponyfill2 = _interopRequireDefault(_ponyfill);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var root; /* global window */
if (typeof self !== 'undefined') {
root = self;
} else if (typeof window !== 'undefined') {
root = window;
} else if (typeof global !== 'undefined') {
root = global;
} else if (true) {
root = module;
} else {
root = Function('return this')();
}
var result = (0, _ponyfill2['default'])(root);
exports['default'] = result;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16), __webpack_require__(58)(module)))
/***/ }),
/* 58 */
/***/ (function(module, exports) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
if(!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/* 59 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = symbolObservablePonyfill;
function symbolObservablePonyfill(root) {
var result;
var _Symbol = root.Symbol;
if (typeof _Symbol === 'function') {
if (_Symbol.observable) {
result = _Symbol.observable;
} else {
result = _Symbol('observable');
_Symbol.observable = result;
}
} else {
result = '@@observable';
}
return result;
};
/***/ }),
/* 60 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = reduce;
var _dragOffset = __webpack_require__(29);
var _dragOffset2 = _interopRequireDefault(_dragOffset);
var _dragOperation = __webpack_require__(61);
var _dragOperation2 = _interopRequireDefault(_dragOperation);
var _refCount = __webpack_require__(104);
var _refCount2 = _interopRequireDefault(_refCount);
var _dirtyHandlerIds = __webpack_require__(35);
var _dirtyHandlerIds2 = _interopRequireDefault(_dirtyHandlerIds);
var _stateId = __webpack_require__(119);
var _stateId2 = _interopRequireDefault(_stateId);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function reduce() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var action = arguments[1];
return {
dirtyHandlerIds: (0, _dirtyHandlerIds2.default)(state.dirtyHandlerIds, action, state.dragOperation),
dragOffset: (0, _dragOffset2.default)(state.dragOffset, action),
refCount: (0, _refCount2.default)(state.refCount, action),
dragOperation: (0, _dragOperation2.default)(state.dragOperation, action),
stateId: (0, _stateId2.default)(state.stateId)
};
}
/***/ }),
/* 61 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}return target;
};
exports.default = dragOperation;
var _without = __webpack_require__(62);
var _without2 = _interopRequireDefault(_without);
var _dragDrop = __webpack_require__(7);
var _registry = __webpack_require__(12);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var initialState = {
itemType: null,
item: null,
sourceId: null,
targetIds: [],
dropResult: null,
didDrop: false,
isSourcePublic: null
};
function dragOperation() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
var action = arguments[1];
switch (action.type) {
case _dragDrop.BEGIN_DRAG:
return _extends({}, state, {
itemType: action.itemType,
item: action.item,
sourceId: action.sourceId,
isSourcePublic: action.isSourcePublic,
dropResult: null,
didDrop: false
});
case _dragDrop.PUBLISH_DRAG_SOURCE:
return _extends({}, state, {
isSourcePublic: true
});
case _dragDrop.HOVER:
return _extends({}, state, {
targetIds: action.targetIds
});
case _registry.REMOVE_TARGET:
if (state.targetIds.indexOf(action.targetId) === -1) {
return state;
}
return _extends({}, state, {
targetIds: (0, _without2.default)(state.targetIds, action.targetId)
});
case _dragDrop.DROP:
return _extends({}, state, {
dropResult: action.dropResult,
didDrop: true,
targetIds: []
});
case _dragDrop.END_DRAG:
return _extends({}, state, {
itemType: null,
item: null,
sourceId: null,
dropResult: null,
didDrop: false,
isSourcePublic: null,
targetIds: []
});
default:
return state;
}
}
/***/ }),
/* 62 */
/***/ (function(module, exports, __webpack_require__) {
var baseDifference = __webpack_require__(31),
baseRest = __webpack_require__(23),
isArrayLikeObject = __webpack_require__(24);
/**
* Creates an array excluding all given values using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.pull`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...*} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.xor
* @example
*
* _.without([2, 1, 2, 3], 1, 2);
* // => [3]
*/
var without = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, values)
: [];
});
module.exports = without;
/***/ }),
/* 63 */
/***/ (function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(64),
mapCacheDelete = __webpack_require__(84),
mapCacheGet = __webpack_require__(86),
mapCacheHas = __webpack_require__(87),
mapCacheSet = __webpack_require__(88);
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;
/***/ }),
/* 64 */
/***/ (function(module, exports, __webpack_require__) {
var Hash = __webpack_require__(65),
ListCache = __webpack_require__(76),
Map = __webpack_require__(83);
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
module.exports = mapCacheClear;
/***/ }),
/* 65 */
/***/ (function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__(66),
hashDelete = __webpack_require__(72),
hashGet = __webpack_require__(73),
hashHas = __webpack_require__(74),
hashSet = __webpack_require__(75);
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;
/***/ }),
/* 66 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(8);
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
module.exports = hashClear;
/***/ }),
/* 67 */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(32),
isMasked = __webpack_require__(68),
isObject = __webpack_require__(17),
toSource = __webpack_require__(70);
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
module.exports = baseIsNative;
/***/ }),
/* 68 */
/***/ (function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__(69);
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
module.exports = isMasked;
/***/ }),
/* 69 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(5);
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ }),
/* 70 */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var funcProto = Function.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
module.exports = toSource;
/***/ }),
/* 71 */
/***/ (function(module, exports) {
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
module.exports = getValue;
/***/ }),
/* 72 */
/***/ (function(module, exports) {
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
module.exports = hashDelete;
/***/ }),
/* 73 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(8);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
module.exports = hashGet;
/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(8);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
module.exports = hashHas;
/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(8);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
module.exports = hashSet;
/***/ }),
/* 76 */
/***/ (function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(77),
listCacheDelete = __webpack_require__(78),
listCacheGet = __webpack_require__(80),
listCacheHas = __webpack_require__(81),
listCacheSet = __webpack_require__(82);
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;
/***/ }),
/* 77 */
/***/ (function(module, exports) {
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
module.exports = listCacheClear;
/***/ }),
/* 78 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(10);
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/** Built-in value references. */
var splice = arrayProto.splice;
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
module.exports = listCacheDelete;
/***/ }),
/* 79 */
/***/ (function(module, exports) {
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
module.exports = eq;
/***/ }),
/* 80 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(10);
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
module.exports = listCacheGet;
/***/ }),
/* 81 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(10);
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
module.exports = listCacheHas;
/***/ }),
/* 82 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(10);
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
module.exports = listCacheSet;
/***/ }),
/* 83 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(9),
root = __webpack_require__(5);
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ }),
/* 84 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(11);
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
var result = getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
module.exports = mapCacheDelete;
/***/ }),
/* 85 */
/***/ (function(module, exports) {
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
module.exports = isKeyable;
/***/ }),
/* 86 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(11);
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
module.exports = mapCacheGet;
/***/ }),
/* 87 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(11);
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
module.exports = mapCacheHas;
/***/ }),
/* 88 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(11);
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
module.exports = mapCacheSet;
/***/ }),
/* 89 */
/***/ (function(module, exports) {
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
module.exports = setCacheAdd;
/***/ }),
/* 90 */
/***/ (function(module, exports) {
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
module.exports = setCacheHas;
/***/ }),
/* 91 */
/***/ (function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(92),
baseIsNaN = __webpack_require__(93),
strictIndexOf = __webpack_require__(94);
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
return value === value
? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex);
}
module.exports = baseIndexOf;
/***/ }),
/* 92 */
/***/ (function(module, exports) {
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
module.exports = baseFindIndex;
/***/ }),
/* 93 */
/***/ (function(module, exports) {
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
module.exports = baseIsNaN;
/***/ }),
/* 94 */
/***/ (function(module, exports) {
/**
* A specialized version of `_.indexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictIndexOf(array, value, fromIndex) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
module.exports = strictIndexOf;
/***/ }),
/* 95 */
/***/ (function(module, exports, __webpack_require__) {
var apply = __webpack_require__(96);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* A specialized version of `baseRest` which transforms the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @param {Function} transform The rest array transform.
* @returns {Function} Returns the new function.
*/
function overRest(func, start, transform) {
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = transform(array);
return apply(func, this, otherArgs);
};
}
module.exports = overRest;
/***/ }),
/* 96 */
/***/ (function(module, exports) {
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
switch (args.length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);
case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
module.exports = apply;
/***/ }),
/* 97 */
/***/ (function(module, exports, __webpack_require__) {
var baseSetToString = __webpack_require__(98),
shortOut = __webpack_require__(101);
/**
* Sets the `toString` method of `func` to return `string`.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var setToString = shortOut(baseSetToString);
module.exports = setToString;
/***/ }),
/* 98 */
/***/ (function(module, exports, __webpack_require__) {
var constant = __webpack_require__(99),
defineProperty = __webpack_require__(100),
identity = __webpack_require__(34);
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !defineProperty ? identity : function(func, string) {
return defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
module.exports = baseSetToString;
/***/ }),
/* 99 */
/***/ (function(module, exports) {
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new constant function.
* @example
*
* var objects = _.times(2, _.constant({ 'a': 1 }));
*
* console.log(objects);
* // => [{ 'a': 1 }, { 'a': 1 }]
*
* console.log(objects[0] === objects[1]);
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
module.exports = constant;
/***/ }),
/* 100 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(9);
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;
/***/ }),
/* 101 */
/***/ (function(module, exports) {
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
function shortOut(func) {
var count = 0,
lastCalled = 0;
return function() {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
}
} else {
count = 0;
}
return func.apply(undefined, arguments);
};
}
module.exports = shortOut;
/***/ }),
/* 102 */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(32),
isLength = __webpack_require__(103);
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
module.exports = isArrayLike;
/***/ }),
/* 103 */
/***/ (function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
module.exports = isLength;
/***/ }),
/* 104 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = refCount;
var _registry = __webpack_require__(12);
function refCount() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var action = arguments[1];
switch (action.type) {
case _registry.ADD_SOURCE:
case _registry.ADD_TARGET:
return state + 1;
case _registry.REMOVE_SOURCE:
case _registry.REMOVE_TARGET:
return state - 1;
default:
return state;
}
}
/***/ }),
/* 105 */
/***/ (function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(106),
baseRest = __webpack_require__(23),
baseXor = __webpack_require__(107),
isArrayLikeObject = __webpack_require__(24);
/**
* Creates an array of unique values that is the
* [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
* of the given arrays. The order of result values is determined by the order
* they occur in the arrays.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.without
* @example
*
* _.xor([2, 1], [2, 3]);
* // => [1, 3]
*/
var xor = baseRest(function(arrays) {
return baseXor(arrayFilter(arrays, isArrayLikeObject));
});
module.exports = xor;
/***/ }),
/* 106 */
/***/ (function(module, exports) {
/**
* A specialized version of `_.filter` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[resIndex++] = value;
}
}
return result;
}
module.exports = arrayFilter;
/***/ }),
/* 107 */
/***/ (function(module, exports, __webpack_require__) {
var baseDifference = __webpack_require__(31),
baseFlatten = __webpack_require__(108),
baseUniq = __webpack_require__(113);
/**
* The base implementation of methods like `_.xor`, without support for
* iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of values.
*/
function baseXor(arrays, iteratee, comparator) {
var length = arrays.length;
if (length < 2) {
return length ? baseUniq(arrays[0]) : [];
}
var index = -1,
result = Array(length);
while (++index < length) {
var array = arrays[index],
othIndex = -1;
while (++othIndex < length) {
if (othIndex != index) {
result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
}
}
}
return baseUniq(baseFlatten(result, 1), iteratee, comparator);
}
module.exports = baseXor;
/***/ }),
/* 108 */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(109),
isFlattenable = __webpack_require__(110);
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
module.exports = baseFlatten;
/***/ }),
/* 109 */
/***/ (function(module, exports) {
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
module.exports = arrayPush;
/***/ }),
/* 110 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(15),
isArguments = __webpack_require__(111),
isArray = __webpack_require__(3);
/** Built-in value references. */
var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]);
}
module.exports = isFlattenable;
/***/ }),
/* 111 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__(112),
isObjectLike = __webpack_require__(6);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
module.exports = isArguments;
/***/ }),
/* 112 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(14),
isObjectLike = __webpack_require__(6);
/** `Object#toString` result references. */
var argsTag = '[object Arguments]';
/**
* The base implementation of `_.isArguments`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag;
}
module.exports = baseIsArguments;
/***/ }),
/* 113 */
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(18),
arrayIncludes = __webpack_require__(19),
arrayIncludesWith = __webpack_require__(20),
cacheHas = __webpack_require__(22),
createSet = __webpack_require__(114),
setToArray = __webpack_require__(37);
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
length = array.length,
isCommon = true,
result = [],
seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
}
else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache;
}
else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
module.exports = baseUniq;
/***/ }),
/* 114 */
/***/ (function(module, exports, __webpack_require__) {
var Set = __webpack_require__(115),
noop = __webpack_require__(36),
setToArray = __webpack_require__(37);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Creates a set object of `values`.
*
* @private
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
return new Set(values);
};
module.exports = createSet;
/***/ }),
/* 115 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(9),
root = __webpack_require__(5);
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ }),
/* 116 */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(21),
baseIntersection = __webpack_require__(117),
baseRest = __webpack_require__(23),
castArrayLikeObject = __webpack_require__(118);
/**
* Creates an array of unique values that are included in all given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* _.intersection([2, 1], [2, 3]);
* // => [2]
*/
var intersection = baseRest(function(arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject);
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped)
: [];
});
module.exports = intersection;
/***/ }),
/* 117 */
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(18),
arrayIncludes = __webpack_require__(19),
arrayIncludesWith = __webpack_require__(20),
arrayMap = __webpack_require__(21),
baseUnary = __webpack_require__(33),
cacheHas = __webpack_require__(22);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* The base implementation of methods like `_.intersection`, without support
* for iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of shared values.
*/
function baseIntersection(arrays, iteratee, comparator) {
var includes = comparator ? arrayIncludesWith : arrayIncludes,
length = arrays[0].length,
othLength = arrays.length,
othIndex = othLength,
caches = Array(othLength),
maxLength = Infinity,
result = [];
while (othIndex--) {
var array = arrays[othIndex];
if (othIndex && iteratee) {
array = arrayMap(array, baseUnary(iteratee));
}
maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array)
: undefined;
}
array = arrays[0];
var index = -1,
seen = caches[0];
outer:
while (++index < length && result.length < maxLength) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (!(seen
? cacheHas(seen, computed)
: includes(result, computed, comparator)
)) {
othIndex = othLength;
while (--othIndex) {
var cache = caches[othIndex];
if (!(cache
? cacheHas(cache, computed)
: includes(arrays[othIndex], computed, comparator))
) {
continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
module.exports = baseIntersection;
/***/ }),
/* 118 */
/***/ (function(module, exports, __webpack_require__) {
var isArrayLikeObject = __webpack_require__(24);
/**
* Casts `value` to an empty array if it's not an array like object.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array|Object} Returns the cast array-like object.
*/
function castArrayLikeObject(value) {
return isArrayLikeObject(value) ? value : [];
}
module.exports = castArrayLikeObject;
/***/ }),
/* 119 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = stateId;
function stateId() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
return state + 1;
}
/***/ }),
/* 120 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
}
}return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
};
}();
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
var _isArray = __webpack_require__(3);
var _isArray2 = _interopRequireDefault(_isArray);
var _matchesType = __webpack_require__(30);
var _matchesType2 = _interopRequireDefault(_matchesType);
var _HandlerRegistry = __webpack_require__(121);
var _HandlerRegistry2 = _interopRequireDefault(_HandlerRegistry);
var _dragOffset = __webpack_require__(29);
var _dirtyHandlerIds = __webpack_require__(35);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var DragDropMonitor = function () {
function DragDropMonitor(store) {
_classCallCheck(this, DragDropMonitor);
this.store = store;
this.registry = new _HandlerRegistry2.default(store);
}
_createClass(DragDropMonitor, [{
key: 'subscribeToStateChange',
value: function subscribeToStateChange(listener) {
var _this = this;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var handlerIds = options.handlerIds;
(0, _invariant2.default)(typeof listener === 'function', 'listener must be a function.');
(0, _invariant2.default)(typeof handlerIds === 'undefined' || (0, _isArray2.default)(handlerIds), 'handlerIds, when specified, must be an array of strings.');
var prevStateId = this.store.getState().stateId;
var handleChange = function handleChange() {
var state = _this.store.getState();
var currentStateId = state.stateId;
try {
var canSkipListener = currentStateId === prevStateId || currentStateId === prevStateId + 1 && !(0, _dirtyHandlerIds.areDirty)(state.dirtyHandlerIds, handlerIds);
if (!canSkipListener) {
listener();
}
} finally {
prevStateId = currentStateId;
}
};
return this.store.subscribe(handleChange);
}
}, {
key: 'subscribeToOffsetChange',
value: function subscribeToOffsetChange(listener) {
var _this2 = this;
(0, _invariant2.default)(typeof listener === 'function', 'listener must be a function.');
var previousState = this.store.getState().dragOffset;
var handleChange = function handleChange() {
var nextState = _this2.store.getState().dragOffset;
if (nextState === previousState) {
return;
}
previousState = nextState;
listener();
};
return this.store.subscribe(handleChange);
}
}, {
key: 'canDragSource',
value: function canDragSource(sourceId) {
var source = this.registry.getSource(sourceId);
(0, _invariant2.default)(source, 'Expected to find a valid source.');
if (this.isDragging()) {
return false;
}
return source.canDrag(this, sourceId);
}
}, {
key: 'canDropOnTarget',
value: function canDropOnTarget(targetId) {
var target = this.registry.getTarget(targetId);
(0, _invariant2.default)(target, 'Expected to find a valid target.');
if (!this.isDragging() || this.didDrop()) {
return false;
}
var targetType = this.registry.getTargetType(targetId);
var draggedItemType = this.getItemType();
return (0, _matchesType2.default)(targetType, draggedItemType) && target.canDrop(this, targetId);
}
}, {
key: 'isDragging',
value: function isDragging() {
return Boolean(this.getItemType());
}
}, {
key: 'isDraggingSource',
value: function isDraggingSource(sourceId) {
var source = this.registry.getSource(sourceId, true);
(0, _invariant2.default)(source, 'Expected to find a valid source.');
if (!this.isDragging() || !this.isSourcePublic()) {
return false;
}
var sourceType = this.registry.getSourceType(sourceId);
var draggedItemType = this.getItemType();
if (sourceType !== draggedItemType) {
return false;
}
return source.isDragging(this, sourceId);
}
}, {
key: 'isOverTarget',
value: function isOverTarget(targetId) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { shallow: false };
var shallow = options.shallow;
if (!this.isDragging()) {
return false;
}
var targetType = this.registry.getTargetType(targetId);
var draggedItemType = this.getItemType();
if (!(0, _matchesType2.default)(targetType, draggedItemType)) {
return false;
}
var targetIds = this.getTargetIds();
if (!targetIds.length) {
return false;
}
var index = targetIds.indexOf(targetId);
if (shallow) {
return index === targetIds.length - 1;
} else {
return index > -1;
}
}
}, {
key: 'getItemType',
value: function getItemType() {
return this.store.getState().dragOperation.itemType;
}
}, {
key: 'getItem',
value: function getItem() {
return this.store.getState().dragOperation.item;
}
}, {
key: 'getSourceId',
value: function getSourceId() {
return this.store.getState().dragOperation.sourceId;
}
}, {
key: 'getTargetIds',
value: function getTargetIds() {
return this.store.getState().dragOperation.targetIds;
}
}, {
key: 'getDropResult',
value: function getDropResult() {
return this.store.getState().dragOperation.dropResult;
}
}, {
key: 'didDrop',
value: function didDrop() {
return this.store.getState().dragOperation.didDrop;
}
}, {
key: 'isSourcePublic',
value: function isSourcePublic() {
return this.store.getState().dragOperation.isSourcePublic;
}
}, {
key: 'getInitialClientOffset',
value: function getInitialClientOffset() {
return this.store.getState().dragOffset.initialClientOffset;
}
}, {
key: 'getInitialSourceClientOffset',
value: function getInitialSourceClientOffset() {
return this.store.getState().dragOffset.initialSourceClientOffset;
}
}, {
key: 'getClientOffset',
value: function getClientOffset() {
return this.store.getState().dragOffset.clientOffset;
}
}, {
key: 'getSourceClientOffset',
value: function getSourceClientOffset() {
return (0, _dragOffset.getSourceClientOffset)(this.store.getState().dragOffset);
}
}, {
key: 'getDifferenceFromInitialOffset',
value: function getDifferenceFromInitialOffset() {
return (0, _dragOffset.getDifferenceFromInitialOffset)(this.store.getState().dragOffset);
}
}]);
return DragDropMonitor;
}();
exports.default = DragDropMonitor;
/***/ }),
/* 121 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
}
}return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
};
}();
var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) {
return typeof obj === "undefined" ? "undefined" : _typeof2(obj);
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj);
};
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
var _isArray = __webpack_require__(3);
var _isArray2 = _interopRequireDefault(_isArray);
var _asap = __webpack_require__(122);
var _asap2 = _interopRequireDefault(_asap);
var _registry = __webpack_require__(12);
var _getNextUniqueId = __webpack_require__(124);
var _getNextUniqueId2 = _interopRequireDefault(_getNextUniqueId);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var HandlerRoles = {
SOURCE: 'SOURCE',
TARGET: 'TARGET'
};
function validateSourceContract(source) {
(0, _invariant2.default)(typeof source.canDrag === 'function', 'Expected canDrag to be a function.');
(0, _invariant2.default)(typeof source.beginDrag === 'function', 'Expected beginDrag to be a function.');
(0, _invariant2.default)(typeof source.endDrag === 'function', 'Expected endDrag to be a function.');
}
function validateTargetContract(target) {
(0, _invariant2.default)(typeof target.canDrop === 'function', 'Expected canDrop to be a function.');
(0, _invariant2.default)(typeof target.hover === 'function', 'Expected hover to be a function.');
(0, _invariant2.default)(typeof target.drop === 'function', 'Expected beginDrag to be a function.');
}
function validateType(type, allowArray) {
if (allowArray && (0, _isArray2.default)(type)) {
type.forEach(function (t) {
return validateType(t, false);
});
return;
}
(0, _invariant2.default)(typeof type === 'string' || (typeof type === 'undefined' ? 'undefined' : _typeof(type)) === 'symbol', allowArray ? 'Type can only be a string, a symbol, or an array of either.' : 'Type can only be a string or a symbol.');
}
function getNextHandlerId(role) {
var id = (0, _getNextUniqueId2.default)().toString();
switch (role) {
case HandlerRoles.SOURCE:
return 'S' + id;
case HandlerRoles.TARGET:
return 'T' + id;
default:
(0, _invariant2.default)(false, 'Unknown role: ' + role);
}
}
function parseRoleFromHandlerId(handlerId) {
switch (handlerId[0]) {
case 'S':
return HandlerRoles.SOURCE;
case 'T':
return HandlerRoles.TARGET;
default:
(0, _invariant2.default)(false, 'Cannot parse handler ID: ' + handlerId);
}
}
var HandlerRegistry = function () {
function HandlerRegistry(store) {
_classCallCheck(this, HandlerRegistry);
this.store = store;
this.types = {};
this.handlers = {};
this.pinnedSourceId = null;
this.pinnedSource = null;
}
_createClass(HandlerRegistry, [{
key: 'addSource',
value: function addSource(type, source) {
validateType(type);
validateSourceContract(source);
var sourceId = this.addHandler(HandlerRoles.SOURCE, type, source);
this.store.dispatch((0, _registry.addSource)(sourceId));
return sourceId;
}
}, {
key: 'addTarget',
value: function addTarget(type, target) {
validateType(type, true);
validateTargetContract(target);
var targetId = this.addHandler(HandlerRoles.TARGET, type, target);
this.store.dispatch((0, _registry.addTarget)(targetId));
return targetId;
}
}, {
key: 'addHandler',
value: function addHandler(role, type, handler) {
var id = getNextHandlerId(role);
this.types[id] = type;
this.handlers[id] = handler;
return id;
}
}, {
key: 'containsHandler',
value: function containsHandler(handler) {
var _this = this;
return Object.keys(this.handlers).some(function (key) {
return _this.handlers[key] === handler;
});
}
}, {
key: 'getSource',
value: function getSource(sourceId, includePinned) {
(0, _invariant2.default)(this.isSourceId(sourceId), 'Expected a valid source ID.');
var isPinned = includePinned && sourceId === this.pinnedSourceId;
var source = isPinned ? this.pinnedSource : this.handlers[sourceId];
return source;
}
}, {
key: 'getTarget',
value: function getTarget(targetId) {
(0, _invariant2.default)(this.isTargetId(targetId), 'Expected a valid target ID.');
return this.handlers[targetId];
}
}, {
key: 'getSourceType',
value: function getSourceType(sourceId) {
(0, _invariant2.default)(this.isSourceId(sourceId), 'Expected a valid source ID.');
return this.types[sourceId];
}
}, {
key: 'getTargetType',
value: function getTargetType(targetId) {
(0, _invariant2.default)(this.isTargetId(targetId), 'Expected a valid target ID.');
return this.types[targetId];
}
}, {
key: 'isSourceId',
value: function isSourceId(handlerId) {
var role = parseRoleFromHandlerId(handlerId);
return role === HandlerRoles.SOURCE;
}
}, {
key: 'isTargetId',
value: function isTargetId(handlerId) {
var role = parseRoleFromHandlerId(handlerId);
return role === HandlerRoles.TARGET;
}
}, {
key: 'removeSource',
value: function removeSource(sourceId) {
var _this2 = this;
(0, _invariant2.default)(this.getSource(sourceId), 'Expected an existing source.');
this.store.dispatch((0, _registry.removeSource)(sourceId));
(0, _asap2.default)(function () {
delete _this2.handlers[sourceId];
delete _this2.types[sourceId];
});
}
}, {
key: 'removeTarget',
value: function removeTarget(targetId) {
var _this3 = this;
(0, _invariant2.default)(this.getTarget(targetId), 'Expected an existing target.');
this.store.dispatch((0, _registry.removeTarget)(targetId));
(0, _asap2.default)(function () {
delete _this3.handlers[targetId];
delete _this3.types[targetId];
});
}
}, {
key: 'pinSource',
value: function pinSource(sourceId) {
var source = this.getSource(sourceId);
(0, _invariant2.default)(source, 'Expected an existing source.');
this.pinnedSourceId = sourceId;
this.pinnedSource = source;
}
}, {
key: 'unpinSource',
value: function unpinSource() {
(0, _invariant2.default)(this.pinnedSource, 'No source is pinned at the time.');
this.pinnedSourceId = null;
this.pinnedSource = null;
}
}]);
return HandlerRegistry;
}();
exports.default = HandlerRegistry;
/***/ }),
/* 122 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// rawAsap provides everything we need except exception management.
var rawAsap = __webpack_require__(123);
// RawTasks are recycled to reduce GC churn.
var freeTasks = [];
// We queue errors to ensure they are thrown in right order (FIFO).
// Array-as-queue is good enough here, since we are just dealing with exceptions.
var pendingErrors = [];
var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);
function throwFirstError() {
if (pendingErrors.length) {
throw pendingErrors.shift();
}
}
/**
* Calls a task as soon as possible after returning, in its own event, with priority
* over other events like animation, reflow, and repaint. An error thrown from an
* event will not interrupt, nor even substantially slow down the processing of
* other events, but will be rather postponed to a lower priority event.
* @param {{call}} task A callable object, typically a function that takes no
* arguments.
*/
module.exports = asap;
function asap(task) {
var rawTask;
if (freeTasks.length) {
rawTask = freeTasks.pop();
} else {
rawTask = new RawTask();
}
rawTask.task = task;
rawAsap(rawTask);
}
// We wrap tasks with recyclable task objects. A task object implements
// `call`, just like a function.
function RawTask() {
this.task = null;
}
// The sole purpose of wrapping the task is to catch the exception and recycle
// the task object after its single use.
RawTask.prototype.call = function () {
try {
this.task.call();
} catch (error) {
if (asap.onerror) {
// This hook exists purely for testing purposes.
// Its name will be periodically randomized to break any code that
// depends on its existence.
asap.onerror(error);
} else {
// In a web browser, exceptions are not fatal. However, to avoid
// slowing down the queue of pending tasks, we rethrow the error in a
// lower priority turn.
pendingErrors.push(error);
requestErrorThrow();
}
} finally {
this.task = null;
freeTasks[freeTasks.length] = this;
}
};
/***/ }),
/* 123 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {
// Use the fastest means possible to execute a task in its own turn, with
// priority over other events including IO, animation, reflow, and redraw
// events in browsers.
//
// An exception thrown by a task will permanently interrupt the processing of
// subsequent tasks. The higher level `asap` function ensures that if an
// exception is thrown by a task, that the task queue will continue flushing as
// soon as possible, but if you use `rawAsap` directly, you are responsible to
// either ensure that no exceptions are thrown from your task, or to manually
// call `rawAsap.requestFlush` if an exception is thrown.
module.exports = rawAsap;
function rawAsap(task) {
if (!queue.length) {
requestFlush();
flushing = true;
}
// Equivalent to push, but avoids a function call.
queue[queue.length] = task;
}
var queue = [];
// Once a flush has been requested, no further calls to `requestFlush` are
// necessary until the next `flush` completes.
var flushing = false;
// `requestFlush` is an implementation-specific method that attempts to kick
// off a `flush` event as quickly as possible. `flush` will attempt to exhaust
// the event queue before yielding to the browser's own event loop.
var requestFlush;
// The position of the next task to execute in the task queue. This is
// preserved between calls to `flush` so that it can be resumed if
// a task throws an exception.
var index = 0;
// If a task schedules additional tasks recursively, the task queue can grow
// unbounded. To prevent memory exhaustion, the task queue will periodically
// truncate already-completed tasks.
var capacity = 1024;
// The flush function processes all tasks that have been scheduled with
// `rawAsap` unless and until one of those tasks throws an exception.
// If a task throws an exception, `flush` ensures that its state will remain
// consistent and will resume where it left off when called again.
// However, `flush` does not make any arrangements to be called again if an
// exception is thrown.
function flush() {
while (index < queue.length) {
var currentIndex = index;
// Advance the index before calling the task. This ensures that we will
// begin flushing on the next task the task throws an error.
index = index + 1;
queue[currentIndex].call();
// Prevent leaking memory for long chains of recursive calls to `asap`.
// If we call `asap` within tasks scheduled by `asap`, the queue will
// grow, but to avoid an O(n) walk for every task we execute, we don't
// shift tasks off the queue after they have been executed.
// Instead, we periodically shift 1024 tasks off the queue.
if (index > capacity) {
// Manually shift all values starting at the index back to the
// beginning of the queue.
for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
queue[scan] = queue[scan + index];
}
queue.length -= index;
index = 0;
}
}
queue.length = 0;
index = 0;
flushing = false;
}
// `requestFlush` is implemented using a strategy based on data collected from
// every available SauceLabs Selenium web driver worker at time of writing.
// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593
// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that
// have WebKitMutationObserver but not un-prefixed MutationObserver.
// Must use `global` or `self` instead of `window` to work in both frames and web
// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.
/* globals self */
var scope = typeof global !== "undefined" ? global : self;
var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;
// MutationObservers are desirable because they have high priority and work
// reliably everywhere they are implemented.
// They are implemented in all modern browsers.
//
// - Android 4-4.3
// - Chrome 26-34
// - Firefox 14-29
// - Internet Explorer 11
// - iPad Safari 6-7.1
// - iPhone Safari 7-7.1
// - Safari 6-7
if (typeof BrowserMutationObserver === "function") {
requestFlush = makeRequestCallFromMutationObserver(flush);
// MessageChannels are desirable because they give direct access to the HTML
// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
// 11-12, and in web workers in many engines.
// Although message channels yield to any queued rendering and IO tasks, they
// would be better than imposing the 4ms delay of timers.
// However, they do not work reliably in Internet Explorer or Safari.
// Internet Explorer 10 is the only browser that has setImmediate but does
// not have MutationObservers.
// Although setImmediate yields to the browser's renderer, it would be
// preferrable to falling back to setTimeout since it does not have
// the minimum 4ms penalty.
// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
// Desktop to a lesser extent) that renders both setImmediate and
// MessageChannel useless for the purposes of ASAP.
// https://github.com/kriskowal/q/issues/396
// Timers are implemented universally.
// We fall back to timers in workers in most engines, and in foreground
// contexts in the following browsers.
// However, note that even this simple case requires nuances to operate in a
// broad spectrum of browsers.
//
// - Firefox 3-13
// - Internet Explorer 6-9
// - iPad Safari 4.3
// - Lynx 2.8.7
} else {
requestFlush = makeRequestCallFromTimer(flush);
}
// `requestFlush` requests that the high priority event queue be flushed as
// soon as possible.
// This is useful to prevent an error thrown in a task from stalling the event
// queue if the exception handled by Node.js’s
// `process.on("uncaughtException")` or by a domain.
rawAsap.requestFlush = requestFlush;
// To request a high priority event, we induce a mutation observer by toggling
// the text of a text node between "1" and "-1".
function makeRequestCallFromMutationObserver(callback) {
var toggle = 1;
var observer = new BrowserMutationObserver(callback);
var node = document.createTextNode("");
observer.observe(node, {characterData: true});
return function requestCall() {
toggle = -toggle;
node.data = toggle;
};
}
// The message channel technique was discovered by Malte Ubl and was the
// original foundation for this library.
// http://www.nonblocking.io/2011/06/windownexttick.html
// Safari 6.0.5 (at least) intermittently fails to create message ports on a
// page's first load. Thankfully, this version of Safari supports
// MutationObservers, so we don't need to fall back in that case.
// function makeRequestCallFromMessageChannel(callback) {
// var channel = new MessageChannel();
// channel.port1.onmessage = callback;
// return function requestCall() {
// channel.port2.postMessage(0);
// };
// }
// For reasons explained above, we are also unable to use `setImmediate`
// under any circumstances.
// Even if we were, there is another bug in Internet Explorer 10.
// It is not sufficient to assign `setImmediate` to `requestFlush` because
// `setImmediate` must be called *by name* and therefore must be wrapped in a
// closure.
// Never forget.
// function makeRequestCallFromSetImmediate(callback) {
// return function requestCall() {
// setImmediate(callback);
// };
// }
// Safari 6.0 has a problem where timers will get lost while the user is
// scrolling. This problem does not impact ASAP because Safari 6.0 supports
// mutation observers, so that implementation is used instead.
// However, if we ever elect to use timers in Safari, the prevalent work-around
// is to add a scroll event listener that calls for a flush.
// `setTimeout` does not call the passed callback if the delay is less than
// approximately 7 in web workers in Firefox 8 through 18, and sometimes not
// even then.
function makeRequestCallFromTimer(callback) {
return function requestCall() {
// We dispatch a timeout with a specified delay of 0 for engines that
// can reliably accommodate that request. This will usually be snapped
// to a 4 milisecond delay, but once we're flushing, there's no delay
// between events.
var timeoutHandle = setTimeout(handleTimer, 0);
// However, since this timer gets frequently dropped in Firefox
// workers, we enlist an interval handle that will try to fire
// an event 20 times per second until it succeeds.
var intervalHandle = setInterval(handleTimer, 50);
function handleTimer() {
// Whichever timer succeeds will cancel both timers and
// execute the callback.
clearTimeout(timeoutHandle);
clearInterval(intervalHandle);
callback();
}
};
}
// This is for `asap.js` only.
// Its name will be periodically randomized to break any code that depends on
// its existence.
rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;
// ASAP was originally a nextTick shim included in Q. This was factored out
// into this ASAP package. It was later adapted to RSVP which made further
// amendments. These decisions, particularly to marginalize MessageChannel and
// to capture the MutationObserver implementation in a closure, were integrated
// back into ASAP proper.
// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 124 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getNextUniqueId;
var nextUniqueId = 0;
function getNextUniqueId() {
return nextUniqueId++;
}
/***/ }),
/* 125 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
}
}return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var DragSource = function () {
function DragSource() {
_classCallCheck(this, DragSource);
}
_createClass(DragSource, [{
key: "canDrag",
value: function canDrag() {
return true;
}
}, {
key: "isDragging",
value: function isDragging(monitor, handle) {
return handle === monitor.getSourceId();
}
}, {
key: "endDrag",
value: function endDrag() {}
}]);
return DragSource;
}();
exports.default = DragSource;
/***/ }),
/* 126 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
}
}return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
};
}();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var DropTarget = function () {
function DropTarget() {
_classCallCheck(this, DropTarget);
}
_createClass(DropTarget, [{
key: "canDrop",
value: function canDrop() {
return true;
}
}, {
key: "hover",
value: function hover() {}
}, {
key: "drop",
value: function drop() {}
}]);
return DropTarget;
}();
exports.default = DropTarget;
/***/ }),
/* 127 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
}
}return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
};
}();
exports.default = createBackend;
var _noop = __webpack_require__(36);
var _noop2 = _interopRequireDefault(_noop);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var TestBackend = function () {
function TestBackend(manager) {
_classCallCheck(this, TestBackend);
this.actions = manager.getActions();
}
_createClass(TestBackend, [{
key: 'setup',
value: function setup() {
this.didCallSetup = true;
}
}, {
key: 'teardown',
value: function teardown() {
this.didCallTeardown = true;
}
}, {
key: 'connectDragSource',
value: function connectDragSource() {
return _noop2.default;
}
}, {
key: 'connectDragPreview',
value: function connectDragPreview() {
return _noop2.default;
}
}, {
key: 'connectDropTarget',
value: function connectDropTarget() {
return _noop2.default;
}
}, {
key: 'simulateBeginDrag',
value: function simulateBeginDrag(sourceIds, options) {
this.actions.beginDrag(sourceIds, options);
}
}, {
key: 'simulatePublishDragSource',
value: function simulatePublishDragSource() {
this.actions.publishDragSource();
}
}, {
key: 'simulateHover',
value: function simulateHover(targetIds, options) {
this.actions.hover(targetIds, options);
}
}, {
key: 'simulateDrop',
value: function simulateDrop() {
this.actions.drop();
}
}, {
key: 'simulateEndDrag',
value: function simulateEndDrag() {
this.actions.endDrag();
}
}]);
return TestBackend;
}();
function createBackend(manager) {
return new TestBackend(manager);
}
/***/ }),
/* 128 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _class, _temp;
var _react = __webpack_require__(2);
var _propTypes = __webpack_require__(4);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _DragDropContext = __webpack_require__(28);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* This class is a React-Component based version of the DragDropContext.
* This is an alternative to decorating an application component with an ES7 decorator.
*/
var DragDropContextProvider = (_temp = _class = function (_Component) {
_inherits(DragDropContextProvider, _Component);
function DragDropContextProvider(props, context) {
_classCallCheck(this, DragDropContextProvider);
/**
* This property determines which window global to use for creating the DragDropManager.
* If a window has been injected explicitly via props, that is used first. If it is available
* as a context value, then use that, otherwise use the browser global.
*/
var _this = _possibleConstructorReturn(this, (DragDropContextProvider.__proto__ || Object.getPrototypeOf(DragDropContextProvider)).call(this, props, context));
var getWindow = function getWindow() {
if (props && props.window) {
return props.window;
} else if (context && context.window) {
return context.window;
} else if (typeof window !== 'undefined') {
return window;
}
return undefined;
};
_this.backend = (0, _DragDropContext.unpackBackendForEs5Users)(props.backend);
_this.childContext = (0, _DragDropContext.createChildContext)(_this.backend, {
window: getWindow()
});
return _this;
}
_createClass(DragDropContextProvider, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (nextProps.backend !== this.props.backend || nextProps.window !== this.props.window) {
throw new Error('DragDropContextProvider backend and window props must not change.');
}
}
}, {
key: 'getChildContext',
value: function getChildContext() {
return this.childContext;
}
}, {
key: 'render',
value: function render() {
return _react.Children.only(this.props.children);
}
}]);
return DragDropContextProvider;
}(_react.Component), _class.propTypes = {
backend: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.object]).isRequired,
children: _propTypes2.default.element.isRequired,
window: _propTypes2.default.object // eslint-disable-line react/forbid-prop-types
}, _class.defaultProps = {
window: undefined
}, _class.childContextTypes = _DragDropContext.CHILD_CONTEXT_TYPES, _class.displayName = 'DragDropContextProvider', _class.contextTypes = {
window: _propTypes2.default.object
}, _temp);
exports.default = DragDropContextProvider;
/***/ }),
/* 129 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
exports.default = DragLayer;
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(4);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _hoistNonReactStatics = __webpack_require__(25);
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
var _isPlainObject = __webpack_require__(1);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
var _shallowEqual = __webpack_require__(26);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var _shallowEqualScalar = __webpack_require__(38);
var _shallowEqualScalar2 = _interopRequireDefault(_shallowEqualScalar);
var _checkDecoratorArguments = __webpack_require__(13);
var _checkDecoratorArguments2 = _interopRequireDefault(_checkDecoratorArguments);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function DragLayer(collect) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
_checkDecoratorArguments2.default.apply(undefined, ['DragLayer', 'collect[, options]'].concat(Array.prototype.slice.call(arguments))); // eslint-disable-line prefer-rest-params
(0, _invariant2.default)(typeof collect === 'function', 'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ', 'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html', collect);
(0, _invariant2.default)((0, _isPlainObject2.default)(options), 'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. ' + 'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html', options);
return function decorateLayer(DecoratedComponent) {
var _class, _temp;
var _options$arePropsEqua = options.arePropsEqual,
arePropsEqual = _options$arePropsEqua === undefined ? _shallowEqualScalar2.default : _options$arePropsEqua;
var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
var DragLayerContainer = (_temp = _class = function (_Component) {
_inherits(DragLayerContainer, _Component);
_createClass(DragLayerContainer, [{
key: 'getDecoratedComponentInstance',
value: function getDecoratedComponentInstance() {
(0, _invariant2.default)(this.child, 'In order to access an instance of the decorated component it can not be a stateless component.');
return this.child;
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
return !arePropsEqual(nextProps, this.props) || !(0, _shallowEqual2.default)(nextState, this.state);
}
}]);
function DragLayerContainer(props, context) {
_classCallCheck(this, DragLayerContainer);
var _this = _possibleConstructorReturn(this, (DragLayerContainer.__proto__ || Object.getPrototypeOf(DragLayerContainer)).call(this, props));
_this.handleChange = _this.handleChange.bind(_this);
_this.manager = context.dragDropManager;
(0, _invariant2.default)(_typeof(_this.manager) === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);
_this.state = _this.getCurrentState();
return _this;
}
_createClass(DragLayerContainer, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.isCurrentlyMounted = true;
var monitor = this.manager.getMonitor();
this.unsubscribeFromOffsetChange = monitor.subscribeToOffsetChange(this.handleChange);
this.unsubscribeFromStateChange = monitor.subscribeToStateChange(this.handleChange);
this.handleChange();
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.isCurrentlyMounted = false;
this.unsubscribeFromOffsetChange();
this.unsubscribeFromStateChange();
}
}, {
key: 'handleChange',
value: function handleChange() {
if (!this.isCurrentlyMounted) {
return;
}
var nextState = this.getCurrentState();
if (!(0, _shallowEqual2.default)(nextState, this.state)) {
this.setState(nextState);
}
}
}, {
key: 'getCurrentState',
value: function getCurrentState() {
var monitor = this.manager.getMonitor();
return collect(monitor, this.props);
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
return _react2.default.createElement(DecoratedComponent, _extends({}, this.props, this.state, {
ref: function ref(child) {
_this2.child = child;
}
}));
}
}]);
return DragLayerContainer;
}(_react.Component), _class.DecoratedComponent = DecoratedComponent, _class.displayName = 'DragLayer(' + displayName + ')', _class.contextTypes = {
dragDropManager: _propTypes2.default.object.isRequired
}, _temp);
return (0, _hoistNonReactStatics2.default)(DragLayerContainer, DecoratedComponent);
};
}
/***/ }),
/* 130 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = DragSource;
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
var _isPlainObject = __webpack_require__(1);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _checkDecoratorArguments = __webpack_require__(13);
var _checkDecoratorArguments2 = _interopRequireDefault(_checkDecoratorArguments);
var _decorateHandler = __webpack_require__(39);
var _decorateHandler2 = _interopRequireDefault(_decorateHandler);
var _registerSource = __webpack_require__(135);
var _registerSource2 = _interopRequireDefault(_registerSource);
var _createSourceFactory = __webpack_require__(136);
var _createSourceFactory2 = _interopRequireDefault(_createSourceFactory);
var _createSourceMonitor = __webpack_require__(137);
var _createSourceMonitor2 = _interopRequireDefault(_createSourceMonitor);
var _createSourceConnector = __webpack_require__(138);
var _createSourceConnector2 = _interopRequireDefault(_createSourceConnector);
var _isValidType = __webpack_require__(42);
var _isValidType2 = _interopRequireDefault(_isValidType);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function DragSource(type, spec, collect) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
_checkDecoratorArguments2.default.apply(undefined, ['DragSource', 'type, spec, collect[, options]'].concat(Array.prototype.slice.call(arguments)));
var getType = type;
if (typeof type !== 'function') {
(0, _invariant2.default)((0, _isValidType2.default)(type), 'Expected "type" provided as the first argument to DragSource to be ' + 'a string, or a function that returns a string given the current props. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', type);
getType = function getType() {
return type;
};
}
(0, _invariant2.default)((0, _isPlainObject2.default)(spec), 'Expected "spec" provided as the second argument to DragSource to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', spec);
var createSource = (0, _createSourceFactory2.default)(spec);
(0, _invariant2.default)(typeof collect === 'function', 'Expected "collect" provided as the third argument to DragSource to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', collect);
(0, _invariant2.default)((0, _isPlainObject2.default)(options), 'Expected "options" provided as the fourth argument to DragSource to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', collect);
return function decorateSource(DecoratedComponent) {
return (0, _decorateHandler2.default)({
connectBackend: function connectBackend(backend, sourceId) {
return backend.connectDragSource(sourceId);
},
containerDisplayName: 'DragSource',
createHandler: createSource,
registerHandler: _registerSource2.default,
createMonitor: _createSourceMonitor2.default,
createConnector: _createSourceConnector2.default,
DecoratedComponent: DecoratedComponent,
getType: getType,
collect: collect,
options: options
});
};
}
/***/ }),
/* 131 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _isDisposable2 = __webpack_require__(27);
var _isDisposable3 = _interopRequireDefault(_isDisposable2);
exports.isDisposable = _isDisposable3['default'];
var _Disposable2 = __webpack_require__(132);
var _Disposable3 = _interopRequireDefault(_Disposable2);
exports.Disposable = _Disposable3['default'];
var _CompositeDisposable2 = __webpack_require__(133);
var _CompositeDisposable3 = _interopRequireDefault(_CompositeDisposable2);
exports.CompositeDisposable = _CompositeDisposable3['default'];
var _SerialDisposable2 = __webpack_require__(134);
var _SerialDisposable3 = _interopRequireDefault(_SerialDisposable2);
exports.SerialDisposable = _SerialDisposable3['default'];
/***/ }),
/* 132 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var noop = function noop() {};
/**
* The basic disposable.
*/
var Disposable = (function () {
_createClass(Disposable, null, [{
key: "empty",
value: { dispose: noop },
enumerable: true
}]);
function Disposable(action) {
_classCallCheck(this, Disposable);
this.isDisposed = false;
this.action = action || noop;
}
Disposable.prototype.dispose = function dispose() {
if (!this.isDisposed) {
this.action.call(null);
this.isDisposed = true;
}
};
return Disposable;
})();
exports["default"] = Disposable;
module.exports = exports["default"];
/***/ }),
/* 133 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _isDisposable = __webpack_require__(27);
var _isDisposable2 = _interopRequireDefault(_isDisposable);
/**
* Represents a group of disposable resources that are disposed together.
*/
var CompositeDisposable = (function () {
function CompositeDisposable() {
for (var _len = arguments.length, disposables = Array(_len), _key = 0; _key < _len; _key++) {
disposables[_key] = arguments[_key];
}
_classCallCheck(this, CompositeDisposable);
if (Array.isArray(disposables[0]) && disposables.length === 1) {
disposables = disposables[0];
}
for (var i = 0; i < disposables.length; i++) {
if (!_isDisposable2['default'](disposables[i])) {
throw new Error('Expected a disposable');
}
}
this.disposables = disposables;
this.isDisposed = false;
}
/**
* Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
* @param {Disposable} item Disposable to add.
*/
CompositeDisposable.prototype.add = function add(item) {
if (this.isDisposed) {
item.dispose();
} else {
this.disposables.push(item);
}
};
/**
* Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
* @param {Disposable} item Disposable to remove.
* @returns {Boolean} true if found; false otherwise.
*/
CompositeDisposable.prototype.remove = function remove(item) {
if (this.isDisposed) {
return false;
}
var index = this.disposables.indexOf(item);
if (index === -1) {
return false;
}
this.disposables.splice(index, 1);
item.dispose();
return true;
};
/**
* Disposes all disposables in the group and removes them from the group.
*/
CompositeDisposable.prototype.dispose = function dispose() {
if (this.isDisposed) {
return;
}
var len = this.disposables.length;
var currentDisposables = new Array(len);
for (var i = 0; i < len; i++) {
currentDisposables[i] = this.disposables[i];
}
this.isDisposed = true;
this.disposables = [];
this.length = 0;
for (var i = 0; i < len; i++) {
currentDisposables[i].dispose();
}
};
return CompositeDisposable;
})();
exports['default'] = CompositeDisposable;
module.exports = exports['default'];
/***/ }),
/* 134 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _isDisposable = __webpack_require__(27);
var _isDisposable2 = _interopRequireDefault(_isDisposable);
var SerialDisposable = (function () {
function SerialDisposable() {
_classCallCheck(this, SerialDisposable);
this.isDisposed = false;
this.current = null;
}
/**
* Gets the underlying disposable.
* @return The underlying disposable.
*/
SerialDisposable.prototype.getDisposable = function getDisposable() {
return this.current;
};
/**
* Sets the underlying disposable.
* @param {Disposable} value The new underlying disposable.
*/
SerialDisposable.prototype.setDisposable = function setDisposable() {
var value = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
if (value != null && !_isDisposable2['default'](value)) {
throw new Error('Expected either an empty value or a valid disposable');
}
var isDisposed = this.isDisposed;
var previous = undefined;
if (!isDisposed) {
previous = this.current;
this.current = value;
}
if (previous) {
previous.dispose();
}
if (isDisposed && value) {
value.dispose();
}
};
/**
* Disposes the underlying disposable as well as all future replacements.
*/
SerialDisposable.prototype.dispose = function dispose() {
if (this.isDisposed) {
return;
}
this.isDisposed = true;
var previous = this.current;
this.current = null;
if (previous) {
previous.dispose();
}
};
return SerialDisposable;
})();
exports['default'] = SerialDisposable;
module.exports = exports['default'];
/***/ }),
/* 135 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = registerSource;
function registerSource(type, source, manager) {
var registry = manager.getRegistry();
var sourceId = registry.addSource(type, source);
function unregisterSource() {
registry.removeSource(sourceId);
}
return {
handlerId: sourceId,
unregister: unregisterSource
};
}
/***/ }),
/* 136 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
exports.default = createSourceFactory;
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
var _isPlainObject = __webpack_require__(1);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'isDragging', 'endDrag'];
var REQUIRED_SPEC_METHODS = ['beginDrag'];
function createSourceFactory(spec) {
Object.keys(spec).forEach(function (key) {
(0, _invariant2.default)(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drag source specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', ALLOWED_SPEC_METHODS.join(', '), key);
(0, _invariant2.default)(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);
});
REQUIRED_SPEC_METHODS.forEach(function (key) {
(0, _invariant2.default)(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);
});
var Source = function () {
function Source(monitor) {
_classCallCheck(this, Source);
this.monitor = monitor;
this.props = null;
this.component = null;
}
_createClass(Source, [{
key: 'receiveProps',
value: function receiveProps(props) {
this.props = props;
}
}, {
key: 'receiveComponent',
value: function receiveComponent(component) {
this.component = component;
}
}, {
key: 'canDrag',
value: function canDrag() {
if (!spec.canDrag) {
return true;
}
return spec.canDrag(this.props, this.monitor);
}
}, {
key: 'isDragging',
value: function isDragging(globalMonitor, sourceId) {
if (!spec.isDragging) {
return sourceId === globalMonitor.getSourceId();
}
return spec.isDragging(this.props, this.monitor);
}
}, {
key: 'beginDrag',
value: function beginDrag() {
var item = spec.beginDrag(this.props, this.monitor, this.component);
if (false) {
(0, _invariant2.default)((0, _isPlainObject2.default)(item), 'beginDrag() must return a plain object that represents the dragged item. ' + 'Instead received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', item);
}
return item;
}
}, {
key: 'endDrag',
value: function endDrag() {
if (!spec.endDrag) {
return;
}
spec.endDrag(this.props, this.monitor, this.component);
}
}]);
return Source;
}();
return function createSource(monitor) {
return new Source(monitor);
};
}
/***/ }),
/* 137 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
exports.default = createSourceMonitor;
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var isCallingCanDrag = false;
var isCallingIsDragging = false;
var SourceMonitor = function () {
function SourceMonitor(manager) {
_classCallCheck(this, SourceMonitor);
this.internalMonitor = manager.getMonitor();
}
_createClass(SourceMonitor, [{
key: 'receiveHandlerId',
value: function receiveHandlerId(sourceId) {
this.sourceId = sourceId;
}
}, {
key: 'canDrag',
value: function canDrag() {
(0, _invariant2.default)(!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html');
try {
isCallingCanDrag = true;
return this.internalMonitor.canDragSource(this.sourceId);
} finally {
isCallingCanDrag = false;
}
}
}, {
key: 'isDragging',
value: function isDragging() {
(0, _invariant2.default)(!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html');
try {
isCallingIsDragging = true;
return this.internalMonitor.isDraggingSource(this.sourceId);
} finally {
isCallingIsDragging = false;
}
}
}, {
key: 'getItemType',
value: function getItemType() {
return this.internalMonitor.getItemType();
}
}, {
key: 'getItem',
value: function getItem() {
return this.internalMonitor.getItem();
}
}, {
key: 'getDropResult',
value: function getDropResult() {
return this.internalMonitor.getDropResult();
}
}, {
key: 'didDrop',
value: function didDrop() {
return this.internalMonitor.didDrop();
}
}, {
key: 'getInitialClientOffset',
value: function getInitialClientOffset() {
return this.internalMonitor.getInitialClientOffset();
}
}, {
key: 'getInitialSourceClientOffset',
value: function getInitialSourceClientOffset() {
return this.internalMonitor.getInitialSourceClientOffset();
}
}, {
key: 'getSourceClientOffset',
value: function getSourceClientOffset() {
return this.internalMonitor.getSourceClientOffset();
}
}, {
key: 'getClientOffset',
value: function getClientOffset() {
return this.internalMonitor.getClientOffset();
}
}, {
key: 'getDifferenceFromInitialOffset',
value: function getDifferenceFromInitialOffset() {
return this.internalMonitor.getDifferenceFromInitialOffset();
}
}]);
return SourceMonitor;
}();
function createSourceMonitor(manager) {
return new SourceMonitor(manager);
}
/***/ }),
/* 138 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = createSourceConnector;
var _wrapConnectorHooks = __webpack_require__(40);
var _wrapConnectorHooks2 = _interopRequireDefault(_wrapConnectorHooks);
var _areOptionsEqual = __webpack_require__(41);
var _areOptionsEqual2 = _interopRequireDefault(_areOptionsEqual);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function createSourceConnector(backend) {
var currentHandlerId = void 0;
var currentDragSourceNode = void 0;
var currentDragSourceOptions = void 0;
var disconnectCurrentDragSource = void 0;
var currentDragPreviewNode = void 0;
var currentDragPreviewOptions = void 0;
var disconnectCurrentDragPreview = void 0;
function reconnectDragSource() {
if (disconnectCurrentDragSource) {
disconnectCurrentDragSource();
disconnectCurrentDragSource = null;
}
if (currentHandlerId && currentDragSourceNode) {
disconnectCurrentDragSource = backend.connectDragSource(currentHandlerId, currentDragSourceNode, currentDragSourceOptions);
}
}
function reconnectDragPreview() {
if (disconnectCurrentDragPreview) {
disconnectCurrentDragPreview();
disconnectCurrentDragPreview = null;
}
if (currentHandlerId && currentDragPreviewNode) {
disconnectCurrentDragPreview = backend.connectDragPreview(currentHandlerId, currentDragPreviewNode, currentDragPreviewOptions);
}
}
function receiveHandlerId(handlerId) {
if (handlerId === currentHandlerId) {
return;
}
currentHandlerId = handlerId;
reconnectDragSource();
reconnectDragPreview();
}
var hooks = (0, _wrapConnectorHooks2.default)({
dragSource: function connectDragSource(node, options) {
if (node === currentDragSourceNode && (0, _areOptionsEqual2.default)(options, currentDragSourceOptions)) {
return;
}
currentDragSourceNode = node;
currentDragSourceOptions = options;
reconnectDragSource();
},
dragPreview: function connectDragPreview(node, options) {
if (node === currentDragPreviewNode && (0, _areOptionsEqual2.default)(options, currentDragPreviewOptions)) {
return;
}
currentDragPreviewNode = node;
currentDragPreviewOptions = options;
reconnectDragPreview();
}
});
return {
receiveHandlerId: receiveHandlerId,
hooks: hooks
};
}
/***/ }),
/* 139 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cloneWithRef;
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function cloneWithRef(element, newRef) {
var previousRef = element.ref;
(0, _invariant2.default)(typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' + 'Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. ' + 'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute');
if (!previousRef) {
// When there is no ref on the element, use the new ref directly
return (0, _react.cloneElement)(element, {
ref: newRef
});
}
return (0, _react.cloneElement)(element, {
ref: function ref(node) {
newRef(node);
if (previousRef) {
previousRef(node);
}
}
});
}
/***/ }),
/* 140 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = DropTarget;
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
var _isPlainObject = __webpack_require__(1);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _checkDecoratorArguments = __webpack_require__(13);
var _checkDecoratorArguments2 = _interopRequireDefault(_checkDecoratorArguments);
var _decorateHandler = __webpack_require__(39);
var _decorateHandler2 = _interopRequireDefault(_decorateHandler);
var _registerTarget = __webpack_require__(141);
var _registerTarget2 = _interopRequireDefault(_registerTarget);
var _createTargetFactory = __webpack_require__(142);
var _createTargetFactory2 = _interopRequireDefault(_createTargetFactory);
var _createTargetMonitor = __webpack_require__(143);
var _createTargetMonitor2 = _interopRequireDefault(_createTargetMonitor);
var _createTargetConnector = __webpack_require__(144);
var _createTargetConnector2 = _interopRequireDefault(_createTargetConnector);
var _isValidType = __webpack_require__(42);
var _isValidType2 = _interopRequireDefault(_isValidType);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function DropTarget(type, spec, collect) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
_checkDecoratorArguments2.default.apply(undefined, ['DropTarget', 'type, spec, collect[, options]'].concat(Array.prototype.slice.call(arguments)));
var getType = type;
if (typeof type !== 'function') {
(0, _invariant2.default)((0, _isValidType2.default)(type, true), 'Expected "type" provided as the first argument to DropTarget to be ' + 'a string, an array of strings, or a function that returns either given ' + 'the current props. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', type);
getType = function getType() {
return type;
};
}
(0, _invariant2.default)((0, _isPlainObject2.default)(spec), 'Expected "spec" provided as the second argument to DropTarget to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', spec);
var createTarget = (0, _createTargetFactory2.default)(spec);
(0, _invariant2.default)(typeof collect === 'function', 'Expected "collect" provided as the third argument to DropTarget to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', collect);
(0, _invariant2.default)((0, _isPlainObject2.default)(options), 'Expected "options" provided as the fourth argument to DropTarget to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', collect);
return function decorateTarget(DecoratedComponent) {
return (0, _decorateHandler2.default)({
connectBackend: function connectBackend(backend, targetId) {
return backend.connectDropTarget(targetId);
},
containerDisplayName: 'DropTarget',
createHandler: createTarget,
registerHandler: _registerTarget2.default,
createMonitor: _createTargetMonitor2.default,
createConnector: _createTargetConnector2.default,
DecoratedComponent: DecoratedComponent,
getType: getType,
collect: collect,
options: options
});
};
}
/***/ }),
/* 141 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = registerTarget;
function registerTarget(type, target, manager) {
var registry = manager.getRegistry();
var targetId = registry.addTarget(type, target);
function unregisterTarget() {
registry.removeTarget(targetId);
}
return {
handlerId: targetId,
unregister: unregisterTarget
};
}
/***/ }),
/* 142 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
exports.default = createTargetFactory;
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
var _isPlainObject = __webpack_require__(1);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];
function createTargetFactory(spec) {
Object.keys(spec).forEach(function (key) {
(0, _invariant2.default)(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', ALLOWED_SPEC_METHODS.join(', '), key);
(0, _invariant2.default)(typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', key, key, spec[key]);
});
var Target = function () {
function Target(monitor) {
_classCallCheck(this, Target);
this.monitor = monitor;
this.props = null;
this.component = null;
}
_createClass(Target, [{
key: 'receiveProps',
value: function receiveProps(props) {
this.props = props;
}
}, {
key: 'receiveMonitor',
value: function receiveMonitor(monitor) {
this.monitor = monitor;
}
}, {
key: 'receiveComponent',
value: function receiveComponent(component) {
this.component = component;
}
}, {
key: 'canDrop',
value: function canDrop() {
if (!spec.canDrop) {
return true;
}
return spec.canDrop(this.props, this.monitor);
}
}, {
key: 'hover',
value: function hover() {
if (!spec.hover) {
return;
}
spec.hover(this.props, this.monitor, this.component);
}
}, {
key: 'drop',
value: function drop() {
if (!spec.drop) {
return undefined;
}
var dropResult = spec.drop(this.props, this.monitor, this.component);
if (false) {
(0, _invariant2.default)(typeof dropResult === 'undefined' || (0, _isPlainObject2.default)(dropResult), 'drop() must either return undefined, or an object that represents the drop result. ' + 'Instead received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', dropResult);
}
return dropResult;
}
}]);
return Target;
}();
return function createTarget(monitor) {
return new Target(monitor);
};
}
/***/ }),
/* 143 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
exports.default = createTargetMonitor;
var _invariant = __webpack_require__(0);
var _invariant2 = _interopRequireDefault(_invariant);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var isCallingCanDrop = false;
var TargetMonitor = function () {
function TargetMonitor(manager) {
_classCallCheck(this, TargetMonitor);
this.internalMonitor = manager.getMonitor();
}
_createClass(TargetMonitor, [{
key: 'receiveHandlerId',
value: function receiveHandlerId(targetId) {
this.targetId = targetId;
}
}, {
key: 'canDrop',
value: function canDrop() {
(0, _invariant2.default)(!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target-monitor.html');
try {
isCallingCanDrop = true;
return this.internalMonitor.canDropOnTarget(this.targetId);
} finally {
isCallingCanDrop = false;
}
}
}, {
key: 'isOver',
value: function isOver(options) {
return this.internalMonitor.isOverTarget(this.targetId, options);
}
}, {
key: 'getItemType',
value: function getItemType() {
return this.internalMonitor.getItemType();
}
}, {
key: 'getItem',
value: function getItem() {
return this.internalMonitor.getItem();
}
}, {
key: 'getDropResult',
value: function getDropResult() {
return this.internalMonitor.getDropResult();
}
}, {
key: 'didDrop',
value: function didDrop() {
return this.internalMonitor.didDrop();
}
}, {
key: 'getInitialClientOffset',
value: function getInitialClientOffset() {
return this.internalMonitor.getInitialClientOffset();
}
}, {
key: 'getInitialSourceClientOffset',
value: function getInitialSourceClientOffset() {
return this.internalMonitor.getInitialSourceClientOffset();
}
}, {
key: 'getSourceClientOffset',
value: function getSourceClientOffset() {
return this.internalMonitor.getSourceClientOffset();
}
}, {
key: 'getClientOffset',
value: function getClientOffset() {
return this.internalMonitor.getClientOffset();
}
}, {
key: 'getDifferenceFromInitialOffset',
value: function getDifferenceFromInitialOffset() {
return this.internalMonitor.getDifferenceFromInitialOffset();
}
}]);
return TargetMonitor;
}();
function createTargetMonitor(manager) {
return new TargetMonitor(manager);
}
/***/ }),
/* 144 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = createTargetConnector;
var _wrapConnectorHooks = __webpack_require__(40);
var _wrapConnectorHooks2 = _interopRequireDefault(_wrapConnectorHooks);
var _areOptionsEqual = __webpack_require__(41);
var _areOptionsEqual2 = _interopRequireDefault(_areOptionsEqual);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function createTargetConnector(backend) {
var currentHandlerId = void 0;
var currentDropTargetNode = void 0;
var currentDropTargetOptions = void 0;
var disconnectCurrentDropTarget = void 0;
function reconnectDropTarget() {
if (disconnectCurrentDropTarget) {
disconnectCurrentDropTarget();
disconnectCurrentDropTarget = null;
}
if (currentHandlerId && currentDropTargetNode) {
disconnectCurrentDropTarget = backend.connectDropTarget(currentHandlerId, currentDropTargetNode, currentDropTargetOptions);
}
}
function receiveHandlerId(handlerId) {
if (handlerId === currentHandlerId) {
return;
}
currentHandlerId = handlerId;
reconnectDropTarget();
}
var hooks = (0, _wrapConnectorHooks2.default)({
dropTarget: function connectDropTarget(node, options) {
if (node === currentDropTargetNode && (0, _areOptionsEqual2.default)(options, currentDropTargetOptions)) {
return;
}
currentDropTargetNode = node;
currentDropTargetOptions = options;
reconnectDropTarget();
}
});
return {
receiveHandlerId: receiveHandlerId,
hooks: hooks
};
}
/***/ })
/******/ ]);
});