Files

Return to Package Diff Home.
Brought to you by Intrinsic.

Package Diff: react-dnd @ 7.1.0 .. 7.2.0

dist/ReactDnD.js

@@ -104,7 +104,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst redux_1 = __webpack_require__(/*! redux */ \"./node_modules/redux/es/redux.js\");\n\nconst reducers_1 = __webpack_require__(/*! ./reducers */ \"../dnd-core/lib/cjs/reducers/index.js\");\n\nconst dragDrop_1 = __webpack_require__(/*! ./actions/dragDrop */ \"../dnd-core/lib/cjs/actions/dragDrop/index.js\");\n\nconst DragDropMonitorImpl_1 = __webpack_require__(/*! ./DragDropMonitorImpl */ \"../dnd-core/lib/cjs/DragDropMonitorImpl.js\");\n\nconst HandlerRegistryImpl_1 = __webpack_require__(/*! ./HandlerRegistryImpl */ \"../dnd-core/lib/cjs/HandlerRegistryImpl.js\");\n\nfunction makeStoreInstance(debugMode) {\n // TODO: if we ever make a react-native version of this,\n // we'll need to consider how to pull off dev-tooling\n const reduxDevTools = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__;\n return redux_1.createStore(reducers_1.default, debugMode && reduxDevTools && reduxDevTools({\n name: 'dnd-core',\n instanceId: 'dnd-core'\n }));\n}\n\nclass DragDropManagerImpl {\n constructor(createBackend, context = {}, debugMode = false) {\n this.context = context;\n this.isSetUp = false;\n\n this.handleRefCountChange = () => {\n const shouldSetUp = this.store.getState().refCount > 0;\n\n if (shouldSetUp && !this.isSetUp) {\n this.backend.setup();\n this.isSetUp = true;\n } else if (!shouldSetUp && this.isSetUp) {\n this.backend.teardown();\n this.isSetUp = false;\n }\n };\n\n const store = makeStoreInstance(debugMode);\n this.store = store;\n this.monitor = new DragDropMonitorImpl_1.default(store, new HandlerRegistryImpl_1.default(store));\n this.backend = createBackend(this);\n store.subscribe(this.handleRefCountChange);\n }\n\n getContext() {\n return this.context;\n }\n\n getMonitor() {\n return this.monitor;\n }\n\n getBackend() {\n return this.backend;\n }\n\n getRegistry() {\n return this.monitor.registry;\n }\n\n getActions() {\n const manager = this;\n const {\n dispatch\n } = this.store;\n\n function bindActionCreator(actionCreator) {\n return (...args) => {\n const action = actionCreator.apply(manager, args);\n\n if (typeof action !== 'undefined') {\n dispatch(action);\n }\n };\n }\n\n const actions = dragDrop_1.default(this);\n return Object.keys(actions).reduce((boundActions, key) => {\n const action = actions[key];\n boundActions[key] = bindActionCreator(action);\n return boundActions;\n }, {});\n }\n\n dispatch(action) {\n this.store.dispatch(action);\n }\n\n}\n\nexports.default = DragDropManagerImpl;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/DragDropManagerImpl.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar redux_1 = __webpack_require__(/*! redux */ \"./node_modules/redux/es/redux.js\");\n\nvar reducers_1 = __webpack_require__(/*! ./reducers */ \"../dnd-core/lib/cjs/reducers/index.js\");\n\nvar dragDrop_1 = __webpack_require__(/*! ./actions/dragDrop */ \"../dnd-core/lib/cjs/actions/dragDrop/index.js\");\n\nvar DragDropMonitorImpl_1 = __webpack_require__(/*! ./DragDropMonitorImpl */ \"../dnd-core/lib/cjs/DragDropMonitorImpl.js\");\n\nvar HandlerRegistryImpl_1 = __webpack_require__(/*! ./HandlerRegistryImpl */ \"../dnd-core/lib/cjs/HandlerRegistryImpl.js\");\n\nfunction makeStoreInstance(debugMode) {\n // TODO: if we ever make a react-native version of this,\n // we'll need to consider how to pull off dev-tooling\n var reduxDevTools = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__;\n return redux_1.createStore(reducers_1.default, debugMode && reduxDevTools && reduxDevTools({\n name: 'dnd-core',\n instanceId: 'dnd-core'\n }));\n}\n\nvar DragDropManagerImpl =\n/** @class */\nfunction () {\n function DragDropManagerImpl(createBackend, context, debugMode) {\n if (context === void 0) {\n context = {};\n }\n\n if (debugMode === void 0) {\n debugMode = false;\n }\n\n var _this = this;\n\n this.context = context;\n this.isSetUp = false;\n\n this.handleRefCountChange = function () {\n var shouldSetUp = _this.store.getState().refCount > 0;\n\n if (shouldSetUp && !_this.isSetUp) {\n _this.backend.setup();\n\n _this.isSetUp = true;\n } else if (!shouldSetUp && _this.isSetUp) {\n _this.backend.teardown();\n\n _this.isSetUp = false;\n }\n };\n\n var store = makeStoreInstance(debugMode);\n this.store = store;\n this.monitor = new DragDropMonitorImpl_1.default(store, new HandlerRegistryImpl_1.default(store));\n this.backend = createBackend(this);\n store.subscribe(this.handleRefCountChange);\n }\n\n DragDropManagerImpl.prototype.getContext = function () {\n return this.context;\n };\n\n DragDropManagerImpl.prototype.getMonitor = function () {\n return this.monitor;\n };\n\n DragDropManagerImpl.prototype.getBackend = function () {\n return this.backend;\n };\n\n DragDropManagerImpl.prototype.getRegistry = function () {\n return this.monitor.registry;\n };\n\n DragDropManagerImpl.prototype.getActions = function () {\n var manager = this;\n var dispatch = this.store.dispatch;\n\n function bindActionCreator(actionCreator) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var action = actionCreator.apply(manager, args);\n\n if (typeof action !== 'undefined') {\n dispatch(action);\n }\n };\n }\n\n var actions = dragDrop_1.default(this);\n return Object.keys(actions).reduce(function (boundActions, key) {\n var action = actions[key];\n boundActions[key] = bindActionCreator(action);\n return boundActions;\n }, {});\n };\n\n DragDropManagerImpl.prototype.dispatch = function (action) {\n this.store.dispatch(action);\n };\n\n return DragDropManagerImpl;\n}();\n\nexports.default = DragDropManagerImpl;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/DragDropManagerImpl.js?");
/***/ }),
@@ -116,7 +116,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst matchesType_1 = __webpack_require__(/*! ./utils/matchesType */ \"../dnd-core/lib/cjs/utils/matchesType.js\");\n\nconst coords_1 = __webpack_require__(/*! ./utils/coords */ \"../dnd-core/lib/cjs/utils/coords.js\");\n\nconst dirtiness_1 = __webpack_require__(/*! ./utils/dirtiness */ \"../dnd-core/lib/cjs/utils/dirtiness.js\");\n\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nclass DragDropMonitorImpl {\n constructor(store, registry) {\n this.store = store;\n this.registry = registry;\n }\n\n subscribeToStateChange(listener, options = {\n handlerIds: undefined\n }) {\n const {\n handlerIds\n } = options;\n invariant(typeof listener === 'function', 'listener must be a function.');\n invariant(typeof handlerIds === 'undefined' || Array.isArray(handlerIds), 'handlerIds, when specified, must be an array of strings.');\n let prevStateId = this.store.getState().stateId;\n\n const handleChange = () => {\n const state = this.store.getState();\n const currentStateId = state.stateId;\n\n try {\n const canSkipListener = currentStateId === prevStateId || currentStateId === prevStateId + 1 && !dirtiness_1.areDirty(state.dirtyHandlerIds, handlerIds);\n\n if (!canSkipListener) {\n listener();\n }\n } finally {\n prevStateId = currentStateId;\n }\n };\n\n return this.store.subscribe(handleChange);\n }\n\n subscribeToOffsetChange(listener) {\n invariant(typeof listener === 'function', 'listener must be a function.');\n let previousState = this.store.getState().dragOffset;\n\n const handleChange = () => {\n const nextState = this.store.getState().dragOffset;\n\n if (nextState === previousState) {\n return;\n }\n\n previousState = nextState;\n listener();\n };\n\n return this.store.subscribe(handleChange);\n }\n\n canDragSource(sourceId) {\n const source = this.registry.getSource(sourceId);\n invariant(source, 'Expected to find a valid source.');\n\n if (this.isDragging()) {\n return false;\n }\n\n return source.canDrag(this, sourceId);\n }\n\n canDropOnTarget(targetId) {\n // undefined on initial render\n if (!targetId) {\n return false;\n }\n\n const target = this.registry.getTarget(targetId);\n invariant(target, 'Expected to find a valid target.');\n\n if (!this.isDragging() || this.didDrop()) {\n return false;\n }\n\n const targetType = this.registry.getTargetType(targetId);\n const draggedItemType = this.getItemType();\n return matchesType_1.default(targetType, draggedItemType) && target.canDrop(this, targetId);\n }\n\n isDragging() {\n return Boolean(this.getItemType());\n }\n\n isDraggingSource(sourceId) {\n // undefined on initial render\n if (!sourceId) {\n return false;\n }\n\n const source = this.registry.getSource(sourceId, true);\n invariant(source, 'Expected to find a valid source.');\n\n if (!this.isDragging() || !this.isSourcePublic()) {\n return false;\n }\n\n const sourceType = this.registry.getSourceType(sourceId);\n const draggedItemType = this.getItemType();\n\n if (sourceType !== draggedItemType) {\n return false;\n }\n\n return source.isDragging(this, sourceId);\n }\n\n isOverTarget(targetId, options = {\n shallow: false\n }) {\n const {\n shallow\n } = options;\n\n if (!this.isDragging()) {\n return false;\n }\n\n const targetType = this.registry.getTargetType(targetId);\n const draggedItemType = this.getItemType();\n\n if (draggedItemType && !matchesType_1.default(targetType, draggedItemType)) {\n return false;\n }\n\n const targetIds = this.getTargetIds();\n\n if (!targetIds.length) {\n return false;\n }\n\n const index = targetIds.indexOf(targetId);\n\n if (shallow) {\n return index === targetIds.length - 1;\n } else {\n return index > -1;\n }\n }\n\n getItemType() {\n return this.store.getState().dragOperation.itemType;\n }\n\n getItem() {\n return this.store.getState().dragOperation.item;\n }\n\n getSourceId() {\n return this.store.getState().dragOperation.sourceId;\n }\n\n getTargetIds() {\n return this.store.getState().dragOperation.targetIds;\n }\n\n getDropResult() {\n return this.store.getState().dragOperation.dropResult;\n }\n\n didDrop() {\n return this.store.getState().dragOperation.didDrop;\n }\n\n isSourcePublic() {\n return this.store.getState().dragOperation.isSourcePublic;\n }\n\n getInitialClientOffset() {\n return this.store.getState().dragOffset.initialClientOffset;\n }\n\n getInitialSourceClientOffset() {\n return this.store.getState().dragOffset.initialSourceClientOffset;\n }\n\n getClientOffset() {\n return this.store.getState().dragOffset.clientOffset;\n }\n\n getSourceClientOffset() {\n return coords_1.getSourceClientOffset(this.store.getState().dragOffset);\n }\n\n getDifferenceFromInitialOffset() {\n return coords_1.getDifferenceFromInitialOffset(this.store.getState().dragOffset);\n }\n\n}\n\nexports.default = DragDropMonitorImpl;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/DragDropMonitorImpl.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar matchesType_1 = __webpack_require__(/*! ./utils/matchesType */ \"../dnd-core/lib/cjs/utils/matchesType.js\");\n\nvar coords_1 = __webpack_require__(/*! ./utils/coords */ \"../dnd-core/lib/cjs/utils/coords.js\");\n\nvar dirtiness_1 = __webpack_require__(/*! ./utils/dirtiness */ \"../dnd-core/lib/cjs/utils/dirtiness.js\");\n\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nvar DragDropMonitorImpl =\n/** @class */\nfunction () {\n function DragDropMonitorImpl(store, registry) {\n this.store = store;\n this.registry = registry;\n }\n\n DragDropMonitorImpl.prototype.subscribeToStateChange = function (listener, options) {\n var _this = this;\n\n if (options === void 0) {\n options = {\n handlerIds: undefined\n };\n }\n\n var handlerIds = options.handlerIds;\n invariant(typeof listener === 'function', 'listener must be a function.');\n invariant(typeof handlerIds === 'undefined' || Array.isArray(handlerIds), 'handlerIds, when specified, must be an array of strings.');\n var prevStateId = this.store.getState().stateId;\n\n var handleChange = function () {\n var state = _this.store.getState();\n\n var currentStateId = state.stateId;\n\n try {\n var canSkipListener = currentStateId === prevStateId || currentStateId === prevStateId + 1 && !dirtiness_1.areDirty(state.dirtyHandlerIds, handlerIds);\n\n if (!canSkipListener) {\n listener();\n }\n } finally {\n prevStateId = currentStateId;\n }\n };\n\n return this.store.subscribe(handleChange);\n };\n\n DragDropMonitorImpl.prototype.subscribeToOffsetChange = function (listener) {\n var _this = this;\n\n invariant(typeof listener === 'function', 'listener must be a function.');\n var previousState = this.store.getState().dragOffset;\n\n var handleChange = function () {\n var nextState = _this.store.getState().dragOffset;\n\n if (nextState === previousState) {\n return;\n }\n\n previousState = nextState;\n listener();\n };\n\n return this.store.subscribe(handleChange);\n };\n\n DragDropMonitorImpl.prototype.canDragSource = function (sourceId) {\n if (!sourceId) {\n return false;\n }\n\n var source = this.registry.getSource(sourceId);\n invariant(source, 'Expected to find a valid source.');\n\n if (this.isDragging()) {\n return false;\n }\n\n return source.canDrag(this, sourceId);\n };\n\n DragDropMonitorImpl.prototype.canDropOnTarget = function (targetId) {\n // undefined on initial render\n if (!targetId) {\n return false;\n }\n\n var target = this.registry.getTarget(targetId);\n invariant(target, 'Expected to find a valid target.');\n\n if (!this.isDragging() || this.didDrop()) {\n return false;\n }\n\n var targetType = this.registry.getTargetType(targetId);\n var draggedItemType = this.getItemType();\n return matchesType_1.default(targetType, draggedItemType) && target.canDrop(this, targetId);\n };\n\n DragDropMonitorImpl.prototype.isDragging = function () {\n return Boolean(this.getItemType());\n };\n\n DragDropMonitorImpl.prototype.isDraggingSource = function (sourceId) {\n // undefined on initial render\n if (!sourceId) {\n return false;\n }\n\n var source = this.registry.getSource(sourceId, true);\n invariant(source, 'Expected to find a valid source.');\n\n if (!this.isDragging() || !this.isSourcePublic()) {\n return false;\n }\n\n var sourceType = this.registry.getSourceType(sourceId);\n var draggedItemType = this.getItemType();\n\n if (sourceType !== draggedItemType) {\n return false;\n }\n\n return source.isDragging(this, sourceId);\n };\n\n DragDropMonitorImpl.prototype.isOverTarget = function (targetId, options) {\n if (options === void 0) {\n options = {\n shallow: false\n };\n } // undefined on initial render\n\n\n if (!targetId) {\n return false;\n }\n\n var shallow = options.shallow;\n\n if (!this.isDragging()) {\n return false;\n }\n\n var targetType = this.registry.getTargetType(targetId);\n var draggedItemType = this.getItemType();\n\n if (draggedItemType && !matchesType_1.default(targetType, draggedItemType)) {\n return false;\n }\n\n var targetIds = this.getTargetIds();\n\n if (!targetIds.length) {\n return false;\n }\n\n var index = targetIds.indexOf(targetId);\n\n if (shallow) {\n return index === targetIds.length - 1;\n } else {\n return index > -1;\n }\n };\n\n DragDropMonitorImpl.prototype.getItemType = function () {\n return this.store.getState().dragOperation.itemType;\n };\n\n DragDropMonitorImpl.prototype.getItem = function () {\n return this.store.getState().dragOperation.item;\n };\n\n DragDropMonitorImpl.prototype.getSourceId = function () {\n return this.store.getState().dragOperation.sourceId;\n };\n\n DragDropMonitorImpl.prototype.getTargetIds = function () {\n return this.store.getState().dragOperation.targetIds;\n };\n\n DragDropMonitorImpl.prototype.getDropResult = function () {\n return this.store.getState().dragOperation.dropResult;\n };\n\n DragDropMonitorImpl.prototype.didDrop = function () {\n return this.store.getState().dragOperation.didDrop;\n };\n\n DragDropMonitorImpl.prototype.isSourcePublic = function () {\n return this.store.getState().dragOperation.isSourcePublic;\n };\n\n DragDropMonitorImpl.prototype.getInitialClientOffset = function () {\n return this.store.getState().dragOffset.initialClientOffset;\n };\n\n DragDropMonitorImpl.prototype.getInitialSourceClientOffset = function () {\n return this.store.getState().dragOffset.initialSourceClientOffset;\n };\n\n DragDropMonitorImpl.prototype.getClientOffset = function () {\n return this.store.getState().dragOffset.clientOffset;\n };\n\n DragDropMonitorImpl.prototype.getSourceClientOffset = function () {\n return coords_1.getSourceClientOffset(this.store.getState().dragOffset);\n };\n\n DragDropMonitorImpl.prototype.getDifferenceFromInitialOffset = function () {\n return coords_1.getDifferenceFromInitialOffset(this.store.getState().dragOffset);\n };\n\n return DragDropMonitorImpl;\n}();\n\nexports.default = DragDropMonitorImpl;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/DragDropMonitorImpl.js?");
/***/ }),
@@ -128,7 +128,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst registry_1 = __webpack_require__(/*! ./actions/registry */ \"../dnd-core/lib/cjs/actions/registry.js\");\n\nconst getNextUniqueId_1 = __webpack_require__(/*! ./utils/getNextUniqueId */ \"../dnd-core/lib/cjs/utils/getNextUniqueId.js\");\n\nconst interfaces_1 = __webpack_require__(/*! ./interfaces */ \"../dnd-core/lib/cjs/interfaces.js\");\n\nconst contracts_1 = __webpack_require__(/*! ./contracts */ \"../dnd-core/lib/cjs/contracts.js\");\n\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nconst asap = __webpack_require__(/*! asap */ \"./node_modules/asap/browser-asap.js\");\n\nfunction getNextHandlerId(role) {\n const id = getNextUniqueId_1.default().toString();\n\n switch (role) {\n case interfaces_1.HandlerRole.SOURCE:\n return `S${id}`;\n\n case interfaces_1.HandlerRole.TARGET:\n return `T${id}`;\n\n default:\n throw new Error(`Unknown Handler Role: ${role}`);\n }\n}\n\nfunction parseRoleFromHandlerId(handlerId) {\n switch (handlerId[0]) {\n case 'S':\n return interfaces_1.HandlerRole.SOURCE;\n\n case 'T':\n return interfaces_1.HandlerRole.TARGET;\n\n default:\n invariant(false, `Cannot parse handler ID: ${handlerId}`);\n }\n}\n\nfunction mapContainsValue(map, searchValue) {\n const entries = map.entries();\n let isDone = false;\n\n do {\n const {\n done,\n value: [, value]\n } = entries.next();\n\n if (value === searchValue) {\n return true;\n }\n\n isDone = done;\n } while (!isDone);\n\n return false;\n}\n\nclass HandlerRegistryImpl {\n constructor(store) {\n this.store = store;\n this.types = new Map();\n this.dragSources = new Map();\n this.dropTargets = new Map();\n this.pinnedSourceId = null;\n this.pinnedSource = null;\n }\n\n addSource(type, source) {\n contracts_1.validateType(type);\n contracts_1.validateSourceContract(source);\n const sourceId = this.addHandler(interfaces_1.HandlerRole.SOURCE, type, source);\n this.store.dispatch(registry_1.addSource(sourceId));\n return sourceId;\n }\n\n addTarget(type, target) {\n contracts_1.validateType(type, true);\n contracts_1.validateTargetContract(target);\n const targetId = this.addHandler(interfaces_1.HandlerRole.TARGET, type, target);\n this.store.dispatch(registry_1.addTarget(targetId));\n return targetId;\n }\n\n containsHandler(handler) {\n return mapContainsValue(this.dragSources, handler) || mapContainsValue(this.dropTargets, handler);\n }\n\n getSource(sourceId, includePinned = false) {\n invariant(this.isSourceId(sourceId), 'Expected a valid source ID.');\n const isPinned = includePinned && sourceId === this.pinnedSourceId;\n const source = isPinned ? this.pinnedSource : this.dragSources.get(sourceId);\n return source;\n }\n\n getTarget(targetId) {\n invariant(this.isTargetId(targetId), 'Expected a valid target ID.');\n return this.dropTargets.get(targetId);\n }\n\n getSourceType(sourceId) {\n invariant(this.isSourceId(sourceId), 'Expected a valid source ID.');\n return this.types.get(sourceId);\n }\n\n getTargetType(targetId) {\n invariant(this.isTargetId(targetId), 'Expected a valid target ID.');\n return this.types.get(targetId);\n }\n\n isSourceId(handlerId) {\n const role = parseRoleFromHandlerId(handlerId);\n return role === interfaces_1.HandlerRole.SOURCE;\n }\n\n isTargetId(handlerId) {\n const role = parseRoleFromHandlerId(handlerId);\n return role === interfaces_1.HandlerRole.TARGET;\n }\n\n removeSource(sourceId) {\n invariant(this.getSource(sourceId), 'Expected an existing source.');\n this.store.dispatch(registry_1.removeSource(sourceId));\n asap(() => {\n this.dragSources.delete(sourceId);\n this.types.delete(sourceId);\n });\n }\n\n removeTarget(targetId) {\n invariant(this.getTarget(targetId), 'Expected an existing target.');\n this.store.dispatch(registry_1.removeTarget(targetId));\n this.dropTargets.delete(targetId);\n this.types.delete(targetId);\n }\n\n pinSource(sourceId) {\n const source = this.getSource(sourceId);\n invariant(source, 'Expected an existing source.');\n this.pinnedSourceId = sourceId;\n this.pinnedSource = source;\n }\n\n unpinSource() {\n invariant(this.pinnedSource, 'No source is pinned at the time.');\n this.pinnedSourceId = null;\n this.pinnedSource = null;\n }\n\n addHandler(role, type, handler) {\n const id = getNextHandlerId(role);\n this.types.set(id, type);\n\n if (role === interfaces_1.HandlerRole.SOURCE) {\n this.dragSources.set(id, handler);\n } else if (role === interfaces_1.HandlerRole.TARGET) {\n this.dropTargets.set(id, handler);\n }\n\n return id;\n }\n\n}\n\nexports.default = HandlerRegistryImpl;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/HandlerRegistryImpl.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar registry_1 = __webpack_require__(/*! ./actions/registry */ \"../dnd-core/lib/cjs/actions/registry.js\");\n\nvar getNextUniqueId_1 = __webpack_require__(/*! ./utils/getNextUniqueId */ \"../dnd-core/lib/cjs/utils/getNextUniqueId.js\");\n\nvar interfaces_1 = __webpack_require__(/*! ./interfaces */ \"../dnd-core/lib/cjs/interfaces.js\");\n\nvar contracts_1 = __webpack_require__(/*! ./contracts */ \"../dnd-core/lib/cjs/contracts.js\");\n\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nvar asap = __webpack_require__(/*! asap */ \"./node_modules/asap/browser-asap.js\");\n\nfunction getNextHandlerId(role) {\n var id = getNextUniqueId_1.default().toString();\n\n switch (role) {\n case interfaces_1.HandlerRole.SOURCE:\n return \"S\" + id;\n\n case interfaces_1.HandlerRole.TARGET:\n return \"T\" + id;\n\n default:\n throw new Error(\"Unknown Handler Role: \" + role);\n }\n}\n\nfunction parseRoleFromHandlerId(handlerId) {\n switch (handlerId[0]) {\n case 'S':\n return interfaces_1.HandlerRole.SOURCE;\n\n case 'T':\n return interfaces_1.HandlerRole.TARGET;\n\n default:\n invariant(false, \"Cannot parse handler ID: \" + handlerId);\n }\n}\n\nfunction mapContainsValue(map, searchValue) {\n var entries = map.entries();\n var isDone = false;\n\n do {\n var _a = entries.next(),\n done = _a.done,\n _b = _a.value,\n value = _b[1];\n\n if (value === searchValue) {\n return true;\n }\n\n isDone = done;\n } while (!isDone);\n\n return false;\n}\n\nvar HandlerRegistryImpl =\n/** @class */\nfunction () {\n function HandlerRegistryImpl(store) {\n this.store = store;\n this.types = new Map();\n this.dragSources = new Map();\n this.dropTargets = new Map();\n this.pinnedSourceId = null;\n this.pinnedSource = null;\n }\n\n HandlerRegistryImpl.prototype.addSource = function (type, source) {\n contracts_1.validateType(type);\n contracts_1.validateSourceContract(source);\n var sourceId = this.addHandler(interfaces_1.HandlerRole.SOURCE, type, source);\n this.store.dispatch(registry_1.addSource(sourceId));\n return sourceId;\n };\n\n HandlerRegistryImpl.prototype.addTarget = function (type, target) {\n contracts_1.validateType(type, true);\n contracts_1.validateTargetContract(target);\n var targetId = this.addHandler(interfaces_1.HandlerRole.TARGET, type, target);\n this.store.dispatch(registry_1.addTarget(targetId));\n return targetId;\n };\n\n HandlerRegistryImpl.prototype.containsHandler = function (handler) {\n return mapContainsValue(this.dragSources, handler) || mapContainsValue(this.dropTargets, handler);\n };\n\n HandlerRegistryImpl.prototype.getSource = function (sourceId, includePinned) {\n if (includePinned === void 0) {\n includePinned = false;\n }\n\n invariant(this.isSourceId(sourceId), 'Expected a valid source ID.');\n var isPinned = includePinned && sourceId === this.pinnedSourceId;\n var source = isPinned ? this.pinnedSource : this.dragSources.get(sourceId);\n return source;\n };\n\n HandlerRegistryImpl.prototype.getTarget = function (targetId) {\n invariant(this.isTargetId(targetId), 'Expected a valid target ID.');\n return this.dropTargets.get(targetId);\n };\n\n HandlerRegistryImpl.prototype.getSourceType = function (sourceId) {\n invariant(this.isSourceId(sourceId), 'Expected a valid source ID.');\n return this.types.get(sourceId);\n };\n\n HandlerRegistryImpl.prototype.getTargetType = function (targetId) {\n invariant(this.isTargetId(targetId), 'Expected a valid target ID.');\n return this.types.get(targetId);\n };\n\n HandlerRegistryImpl.prototype.isSourceId = function (handlerId) {\n var role = parseRoleFromHandlerId(handlerId);\n return role === interfaces_1.HandlerRole.SOURCE;\n };\n\n HandlerRegistryImpl.prototype.isTargetId = function (handlerId) {\n var role = parseRoleFromHandlerId(handlerId);\n return role === interfaces_1.HandlerRole.TARGET;\n };\n\n HandlerRegistryImpl.prototype.removeSource = function (sourceId) {\n var _this = this;\n\n invariant(this.getSource(sourceId), 'Expected an existing source.');\n this.store.dispatch(registry_1.removeSource(sourceId));\n asap(function () {\n _this.dragSources.delete(sourceId);\n\n _this.types.delete(sourceId);\n });\n };\n\n HandlerRegistryImpl.prototype.removeTarget = function (targetId) {\n invariant(this.getTarget(targetId), 'Expected an existing target.');\n this.store.dispatch(registry_1.removeTarget(targetId));\n this.dropTargets.delete(targetId);\n this.types.delete(targetId);\n };\n\n HandlerRegistryImpl.prototype.pinSource = function (sourceId) {\n var source = this.getSource(sourceId);\n invariant(source, 'Expected an existing source.');\n this.pinnedSourceId = sourceId;\n this.pinnedSource = source;\n };\n\n HandlerRegistryImpl.prototype.unpinSource = function () {\n invariant(this.pinnedSource, 'No source is pinned at the time.');\n this.pinnedSourceId = null;\n this.pinnedSource = null;\n };\n\n HandlerRegistryImpl.prototype.addHandler = function (role, type, handler) {\n var id = getNextHandlerId(role);\n this.types.set(id, type);\n\n if (role === interfaces_1.HandlerRole.SOURCE) {\n this.dragSources.set(id, handler);\n } else if (role === interfaces_1.HandlerRole.TARGET) {\n this.dropTargets.set(id, handler);\n }\n\n return id;\n };\n\n return HandlerRegistryImpl;\n}();\n\nexports.default = HandlerRegistryImpl;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/HandlerRegistryImpl.js?");
/***/ }),
@@ -140,7 +140,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst setClientOffset_1 = __webpack_require__(/*! ./local/setClientOffset */ \"../dnd-core/lib/cjs/actions/dragDrop/local/setClientOffset.js\");\n\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nconst isObject = __webpack_require__(/*! lodash/isObject */ \"./node_modules/lodash/isObject.js\");\n\nconst types_1 = __webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nconst ResetCoordinatesAction = {\n type: types_1.INIT_COORDS,\n payload: {\n clientOffset: null,\n sourceClientOffset: null\n }\n};\n\nfunction createBeginDrag(manager) {\n return function beginDrag(sourceIds = [], options = {\n publishSource: true\n }) {\n const {\n publishSource = true,\n clientOffset,\n getSourceClientOffset\n } = options;\n const monitor = manager.getMonitor();\n const registry = manager.getRegistry(); // Initialize the coordinates using the client offset\n\n manager.dispatch(setClientOffset_1.setClientOffset(clientOffset));\n verifyInvariants(sourceIds, monitor, registry); // Get the draggable source\n\n const sourceId = getDraggableSource(sourceIds, monitor);\n\n if (sourceId === null) {\n manager.dispatch(ResetCoordinatesAction);\n return;\n } // Get the source client offset\n\n\n let sourceClientOffset = null;\n\n if (clientOffset) {\n verifyGetSourceClientOffsetIsFunction(getSourceClientOffset);\n sourceClientOffset = getSourceClientOffset(sourceId);\n } // Initialize the full coordinates\n\n\n manager.dispatch(setClientOffset_1.setClientOffset(clientOffset, sourceClientOffset));\n const source = registry.getSource(sourceId);\n const item = source.beginDrag(monitor, sourceId);\n verifyItemIsObject(item);\n registry.pinSource(sourceId);\n const itemType = registry.getSourceType(sourceId);\n return {\n type: types_1.BEGIN_DRAG,\n payload: {\n itemType,\n item,\n sourceId,\n clientOffset: clientOffset || null,\n sourceClientOffset: sourceClientOffset || null,\n isSourcePublic: !!publishSource\n }\n };\n };\n}\n\nexports.default = createBeginDrag;\n\nfunction verifyInvariants(sourceIds, monitor, registry) {\n invariant(!monitor.isDragging(), 'Cannot call beginDrag while dragging.');\n\n for (const s of sourceIds) {\n invariant(registry.getSource(s), 'Expected sourceIds to be registered.');\n }\n}\n\nfunction verifyGetSourceClientOffsetIsFunction(getSourceClientOffset) {\n invariant(typeof getSourceClientOffset === 'function', 'When clientOffset is provided, getSourceClientOffset must be a function.');\n}\n\nfunction verifyItemIsObject(item) {\n invariant(isObject(item), 'Item must be an object.');\n}\n\nfunction getDraggableSource(sourceIds, monitor) {\n let sourceId = null;\n\n for (let i = sourceIds.length - 1; i >= 0; i--) {\n if (monitor.canDragSource(sourceIds[i])) {\n sourceId = sourceIds[i];\n break;\n }\n }\n\n return sourceId;\n}\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/beginDrag.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar setClientOffset_1 = __webpack_require__(/*! ./local/setClientOffset */ \"../dnd-core/lib/cjs/actions/dragDrop/local/setClientOffset.js\");\n\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nvar isObject = __webpack_require__(/*! lodash/isObject */ \"./node_modules/lodash/isObject.js\");\n\nvar types_1 = __webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nvar ResetCoordinatesAction = {\n type: types_1.INIT_COORDS,\n payload: {\n clientOffset: null,\n sourceClientOffset: null\n }\n};\n\nfunction createBeginDrag(manager) {\n return function beginDrag(sourceIds, options) {\n if (sourceIds === void 0) {\n sourceIds = [];\n }\n\n if (options === void 0) {\n options = {\n publishSource: true\n };\n }\n\n var _a = options.publishSource,\n publishSource = _a === void 0 ? true : _a,\n clientOffset = options.clientOffset,\n getSourceClientOffset = options.getSourceClientOffset;\n var monitor = manager.getMonitor();\n var registry = manager.getRegistry(); // Initialize the coordinates using the client offset\n\n manager.dispatch(setClientOffset_1.setClientOffset(clientOffset));\n verifyInvariants(sourceIds, monitor, registry); // Get the draggable source\n\n var sourceId = getDraggableSource(sourceIds, monitor);\n\n if (sourceId === null) {\n manager.dispatch(ResetCoordinatesAction);\n return;\n } // Get the source client offset\n\n\n var sourceClientOffset = null;\n\n if (clientOffset) {\n verifyGetSourceClientOffsetIsFunction(getSourceClientOffset);\n sourceClientOffset = getSourceClientOffset(sourceId);\n } // Initialize the full coordinates\n\n\n manager.dispatch(setClientOffset_1.setClientOffset(clientOffset, sourceClientOffset));\n var source = registry.getSource(sourceId);\n var item = source.beginDrag(monitor, sourceId);\n verifyItemIsObject(item);\n registry.pinSource(sourceId);\n var itemType = registry.getSourceType(sourceId);\n return {\n type: types_1.BEGIN_DRAG,\n payload: {\n itemType: itemType,\n item: item,\n sourceId: sourceId,\n clientOffset: clientOffset || null,\n sourceClientOffset: sourceClientOffset || null,\n isSourcePublic: !!publishSource\n }\n };\n };\n}\n\nexports.default = createBeginDrag;\n\nfunction verifyInvariants(sourceIds, monitor, registry) {\n invariant(!monitor.isDragging(), 'Cannot call beginDrag while dragging.');\n\n for (var _i = 0, sourceIds_1 = sourceIds; _i < sourceIds_1.length; _i++) {\n var s = sourceIds_1[_i];\n invariant(registry.getSource(s), 'Expected sourceIds to be registered.');\n }\n}\n\nfunction verifyGetSourceClientOffsetIsFunction(getSourceClientOffset) {\n invariant(typeof getSourceClientOffset === 'function', 'When clientOffset is provided, getSourceClientOffset must be a function.');\n}\n\nfunction verifyItemIsObject(item) {\n invariant(isObject(item), 'Item must be an object.');\n}\n\nfunction getDraggableSource(sourceIds, monitor) {\n var sourceId = null;\n\n for (var i = sourceIds.length - 1; i >= 0; i--) {\n if (monitor.canDragSource(sourceIds[i])) {\n sourceId = sourceIds[i];\n break;\n }\n }\n\n return sourceId;\n}\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/beginDrag.js?");
/***/ }),
@@ -152,7 +152,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst types_1 = __webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nconst isObject = __webpack_require__(/*! lodash/isObject */ \"./node_modules/lodash/isObject.js\");\n\nfunction createDrop(manager) {\n return function drop(options = {}) {\n const monitor = manager.getMonitor();\n const registry = manager.getRegistry();\n verifyInvariants(monitor);\n const targetIds = getDroppableTargets(monitor); // Multiple actions are dispatched here, which is why this doesn't return an action\n\n targetIds.forEach((targetId, index) => {\n const dropResult = determineDropResult(targetId, index, registry, monitor);\n const action = {\n type: types_1.DROP,\n payload: {\n dropResult: Object.assign({}, options, dropResult)\n }\n };\n manager.dispatch(action);\n });\n };\n}\n\nexports.default = createDrop;\n\nfunction verifyInvariants(monitor) {\n invariant(monitor.isDragging(), 'Cannot call drop while not dragging.');\n invariant(!monitor.didDrop(), 'Cannot call drop twice during one drag operation.');\n}\n\nfunction determineDropResult(targetId, index, registry, monitor) {\n const target = registry.getTarget(targetId);\n let dropResult = target.drop(monitor, targetId);\n verifyDropResultType(dropResult);\n\n if (typeof dropResult === 'undefined') {\n dropResult = index === 0 ? {} : monitor.getDropResult();\n }\n\n return dropResult;\n}\n\nfunction verifyDropResultType(dropResult) {\n invariant(typeof dropResult === 'undefined' || isObject(dropResult), 'Drop result must either be an object or undefined.');\n}\n\nfunction getDroppableTargets(monitor) {\n const targetIds = monitor.getTargetIds().filter(monitor.canDropOnTarget, monitor);\n targetIds.reverse();\n return targetIds;\n}\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/drop.js?");
+eval("\n\nvar __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar types_1 = __webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nvar isObject = __webpack_require__(/*! lodash/isObject */ \"./node_modules/lodash/isObject.js\");\n\nfunction createDrop(manager) {\n return function drop(options) {\n if (options === void 0) {\n options = {};\n }\n\n var monitor = manager.getMonitor();\n var registry = manager.getRegistry();\n verifyInvariants(monitor);\n var targetIds = getDroppableTargets(monitor); // Multiple actions are dispatched here, which is why this doesn't return an action\n\n targetIds.forEach(function (targetId, index) {\n var dropResult = determineDropResult(targetId, index, registry, monitor);\n var action = {\n type: types_1.DROP,\n payload: {\n dropResult: __assign({}, options, dropResult)\n }\n };\n manager.dispatch(action);\n });\n };\n}\n\nexports.default = createDrop;\n\nfunction verifyInvariants(monitor) {\n invariant(monitor.isDragging(), 'Cannot call drop while not dragging.');\n invariant(!monitor.didDrop(), 'Cannot call drop twice during one drag operation.');\n}\n\nfunction determineDropResult(targetId, index, registry, monitor) {\n var target = registry.getTarget(targetId);\n var dropResult = target.drop(monitor, targetId);\n verifyDropResultType(dropResult);\n\n if (typeof dropResult === 'undefined') {\n dropResult = index === 0 ? {} : monitor.getDropResult();\n }\n\n return dropResult;\n}\n\nfunction verifyDropResultType(dropResult) {\n invariant(typeof dropResult === 'undefined' || isObject(dropResult), 'Drop result must either be an object or undefined.');\n}\n\nfunction getDroppableTargets(monitor) {\n var targetIds = monitor.getTargetIds().filter(monitor.canDropOnTarget, monitor);\n targetIds.reverse();\n return targetIds;\n}\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/drop.js?");
/***/ }),
@@ -164,7 +164,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst types_1 = __webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nfunction createEndDrag(manager) {\n return function endDrag() {\n const monitor = manager.getMonitor();\n const registry = manager.getRegistry();\n verifyIsDragging(monitor);\n const sourceId = monitor.getSourceId();\n const source = registry.getSource(sourceId, true);\n source.endDrag(monitor, sourceId);\n registry.unpinSource();\n return {\n type: types_1.END_DRAG\n };\n };\n}\n\nexports.default = createEndDrag;\n\nfunction verifyIsDragging(monitor) {\n invariant(monitor.isDragging(), 'Cannot call endDrag while not dragging.');\n}\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/endDrag.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar types_1 = __webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nfunction createEndDrag(manager) {\n return function endDrag() {\n var monitor = manager.getMonitor();\n var registry = manager.getRegistry();\n verifyIsDragging(monitor);\n var sourceId = monitor.getSourceId();\n var source = registry.getSource(sourceId, true);\n source.endDrag(monitor, sourceId);\n registry.unpinSource();\n return {\n type: types_1.END_DRAG\n };\n };\n}\n\nexports.default = createEndDrag;\n\nfunction verifyIsDragging(monitor) {\n invariant(monitor.isDragging(), 'Cannot call endDrag while not dragging.');\n}\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/endDrag.js?");
/***/ }),
@@ -176,7 +176,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst matchesType_1 = __webpack_require__(/*! ../../utils/matchesType */ \"../dnd-core/lib/cjs/utils/matchesType.js\");\n\nconst types_1 = __webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nfunction createHover(manager) {\n return function hover(targetIdsArg, {\n clientOffset\n } = {}) {\n verifyTargetIdsIsArray(targetIdsArg);\n const targetIds = targetIdsArg.slice(0);\n const monitor = manager.getMonitor();\n const registry = manager.getRegistry();\n checkInvariants(targetIds, monitor, registry);\n const draggedItemType = monitor.getItemType();\n removeNonMatchingTargetIds(targetIds, registry, draggedItemType);\n hoverAllTargets(targetIds, monitor, registry);\n return {\n type: types_1.HOVER,\n payload: {\n targetIds,\n clientOffset: clientOffset || null\n }\n };\n };\n}\n\nexports.default = createHover;\n\nfunction verifyTargetIdsIsArray(targetIdsArg) {\n invariant(Array.isArray(targetIdsArg), 'Expected targetIds to be an array.');\n}\n\nfunction checkInvariants(targetIds, monitor, registry) {\n invariant(monitor.isDragging(), 'Cannot call hover while not dragging.');\n invariant(!monitor.didDrop(), 'Cannot call hover after drop.');\n\n for (let i = 0; i < targetIds.length; i++) {\n const targetId = targetIds[i];\n invariant(targetIds.lastIndexOf(targetId) === i, 'Expected targetIds to be unique in the passed array.');\n const target = registry.getTarget(targetId);\n invariant(target, 'Expected targetIds to be registered.');\n }\n}\n\nfunction removeNonMatchingTargetIds(targetIds, registry, draggedItemType) {\n // Remove those targetIds that don't match the targetType. This\n // fixes shallow isOver which would only be non-shallow because of\n // non-matching targets.\n for (let i = targetIds.length - 1; i >= 0; i--) {\n const targetId = targetIds[i];\n const targetType = registry.getTargetType(targetId);\n\n if (!matchesType_1.default(targetType, draggedItemType)) {\n targetIds.splice(i, 1);\n }\n }\n}\n\nfunction hoverAllTargets(targetIds, monitor, registry) {\n // Finally call hover on all matching targets.\n for (const targetId of targetIds) {\n const target = registry.getTarget(targetId);\n target.hover(monitor, targetId);\n }\n}\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/hover.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar matchesType_1 = __webpack_require__(/*! ../../utils/matchesType */ \"../dnd-core/lib/cjs/utils/matchesType.js\");\n\nvar types_1 = __webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nfunction createHover(manager) {\n return function hover(targetIdsArg, _a) {\n var clientOffset = (_a === void 0 ? {} : _a).clientOffset;\n verifyTargetIdsIsArray(targetIdsArg);\n var targetIds = targetIdsArg.slice(0);\n var monitor = manager.getMonitor();\n var registry = manager.getRegistry();\n checkInvariants(targetIds, monitor, registry);\n var draggedItemType = monitor.getItemType();\n removeNonMatchingTargetIds(targetIds, registry, draggedItemType);\n hoverAllTargets(targetIds, monitor, registry);\n return {\n type: types_1.HOVER,\n payload: {\n targetIds: targetIds,\n clientOffset: clientOffset || null\n }\n };\n };\n}\n\nexports.default = createHover;\n\nfunction verifyTargetIdsIsArray(targetIdsArg) {\n invariant(Array.isArray(targetIdsArg), 'Expected targetIds to be an array.');\n}\n\nfunction checkInvariants(targetIds, monitor, registry) {\n invariant(monitor.isDragging(), 'Cannot call hover while not dragging.');\n invariant(!monitor.didDrop(), 'Cannot call hover after drop.');\n\n for (var i = 0; i < targetIds.length; i++) {\n var targetId = targetIds[i];\n invariant(targetIds.lastIndexOf(targetId) === i, 'Expected targetIds to be unique in the passed array.');\n var target = registry.getTarget(targetId);\n invariant(target, 'Expected targetIds to be registered.');\n }\n}\n\nfunction removeNonMatchingTargetIds(targetIds, registry, draggedItemType) {\n // Remove those targetIds that don't match the targetType. This\n // fixes shallow isOver which would only be non-shallow because of\n // non-matching targets.\n for (var i = targetIds.length - 1; i >= 0; i--) {\n var targetId = targetIds[i];\n var targetType = registry.getTargetType(targetId);\n\n if (!matchesType_1.default(targetType, draggedItemType)) {\n targetIds.splice(i, 1);\n }\n }\n}\n\nfunction hoverAllTargets(targetIds, monitor, registry) {\n // Finally call hover on all matching targets.\n for (var _i = 0, targetIds_1 = targetIds; _i < targetIds_1.length; _i++) {\n var targetId = targetIds_1[_i];\n var target = registry.getTarget(targetId);\n target.hover(monitor, targetId);\n }\n}\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/hover.js?");
/***/ }),
@@ -188,7 +188,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst beginDrag_1 = __webpack_require__(/*! ./beginDrag */ \"../dnd-core/lib/cjs/actions/dragDrop/beginDrag.js\");\n\nconst publishDragSource_1 = __webpack_require__(/*! ./publishDragSource */ \"../dnd-core/lib/cjs/actions/dragDrop/publishDragSource.js\");\n\nconst hover_1 = __webpack_require__(/*! ./hover */ \"../dnd-core/lib/cjs/actions/dragDrop/hover.js\");\n\nconst drop_1 = __webpack_require__(/*! ./drop */ \"../dnd-core/lib/cjs/actions/dragDrop/drop.js\");\n\nconst endDrag_1 = __webpack_require__(/*! ./endDrag */ \"../dnd-core/lib/cjs/actions/dragDrop/endDrag.js\");\n\n__export(__webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\"));\n\nfunction createDragDropActions(manager) {\n return {\n beginDrag: beginDrag_1.default(manager),\n publishDragSource: publishDragSource_1.default(manager),\n hover: hover_1.default(manager),\n drop: drop_1.default(manager),\n endDrag: endDrag_1.default(manager)\n };\n}\n\nexports.default = createDragDropActions;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/index.js?");
+eval("\n\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar beginDrag_1 = __webpack_require__(/*! ./beginDrag */ \"../dnd-core/lib/cjs/actions/dragDrop/beginDrag.js\");\n\nvar publishDragSource_1 = __webpack_require__(/*! ./publishDragSource */ \"../dnd-core/lib/cjs/actions/dragDrop/publishDragSource.js\");\n\nvar hover_1 = __webpack_require__(/*! ./hover */ \"../dnd-core/lib/cjs/actions/dragDrop/hover.js\");\n\nvar drop_1 = __webpack_require__(/*! ./drop */ \"../dnd-core/lib/cjs/actions/dragDrop/drop.js\");\n\nvar endDrag_1 = __webpack_require__(/*! ./endDrag */ \"../dnd-core/lib/cjs/actions/dragDrop/endDrag.js\");\n\n__export(__webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\"));\n\nfunction createDragDropActions(manager) {\n return {\n beginDrag: beginDrag_1.default(manager),\n publishDragSource: publishDragSource_1.default(manager),\n hover: hover_1.default(manager),\n drop: drop_1.default(manager),\n endDrag: endDrag_1.default(manager)\n };\n}\n\nexports.default = createDragDropActions;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/index.js?");
/***/ }),
@@ -200,7 +200,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst types_1 = __webpack_require__(/*! ../types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nfunction setClientOffset(clientOffset, sourceClientOffset) {\n return {\n type: types_1.INIT_COORDS,\n payload: {\n sourceClientOffset: sourceClientOffset || null,\n clientOffset: clientOffset || null\n }\n };\n}\n\nexports.setClientOffset = setClientOffset;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/local/setClientOffset.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar types_1 = __webpack_require__(/*! ../types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nfunction setClientOffset(clientOffset, sourceClientOffset) {\n return {\n type: types_1.INIT_COORDS,\n payload: {\n sourceClientOffset: sourceClientOffset || null,\n clientOffset: clientOffset || null\n }\n };\n}\n\nexports.setClientOffset = setClientOffset;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/local/setClientOffset.js?");
/***/ }),
@@ -212,7 +212,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst types_1 = __webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nfunction createPublishDragSource(manager) {\n return function publishDragSource() {\n const monitor = manager.getMonitor();\n\n if (monitor.isDragging()) {\n return {\n type: types_1.PUBLISH_DRAG_SOURCE\n };\n }\n };\n}\n\nexports.default = createPublishDragSource;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/publishDragSource.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar types_1 = __webpack_require__(/*! ./types */ \"../dnd-core/lib/cjs/actions/dragDrop/types.js\");\n\nfunction createPublishDragSource(manager) {\n return function publishDragSource() {\n var monitor = manager.getMonitor();\n\n if (monitor.isDragging()) {\n return {\n type: types_1.PUBLISH_DRAG_SOURCE\n };\n }\n };\n}\n\nexports.default = createPublishDragSource;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/dragDrop/publishDragSource.js?");
/***/ }),
@@ -236,7 +236,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ADD_SOURCE = 'dnd-core/ADD_SOURCE';\nexports.ADD_TARGET = 'dnd-core/ADD_TARGET';\nexports.REMOVE_SOURCE = 'dnd-core/REMOVE_SOURCE';\nexports.REMOVE_TARGET = 'dnd-core/REMOVE_TARGET';\n\nfunction addSource(sourceId) {\n return {\n type: exports.ADD_SOURCE,\n payload: {\n sourceId\n }\n };\n}\n\nexports.addSource = addSource;\n\nfunction addTarget(targetId) {\n return {\n type: exports.ADD_TARGET,\n payload: {\n targetId\n }\n };\n}\n\nexports.addTarget = addTarget;\n\nfunction removeSource(sourceId) {\n return {\n type: exports.REMOVE_SOURCE,\n payload: {\n sourceId\n }\n };\n}\n\nexports.removeSource = removeSource;\n\nfunction removeTarget(targetId) {\n return {\n type: exports.REMOVE_TARGET,\n payload: {\n targetId\n }\n };\n}\n\nexports.removeTarget = removeTarget;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/registry.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ADD_SOURCE = 'dnd-core/ADD_SOURCE';\nexports.ADD_TARGET = 'dnd-core/ADD_TARGET';\nexports.REMOVE_SOURCE = 'dnd-core/REMOVE_SOURCE';\nexports.REMOVE_TARGET = 'dnd-core/REMOVE_TARGET';\n\nfunction addSource(sourceId) {\n return {\n type: exports.ADD_SOURCE,\n payload: {\n sourceId: sourceId\n }\n };\n}\n\nexports.addSource = addSource;\n\nfunction addTarget(targetId) {\n return {\n type: exports.ADD_TARGET,\n payload: {\n targetId: targetId\n }\n };\n}\n\nexports.addTarget = addTarget;\n\nfunction removeSource(sourceId) {\n return {\n type: exports.REMOVE_SOURCE,\n payload: {\n sourceId: sourceId\n }\n };\n}\n\nexports.removeSource = removeSource;\n\nfunction removeTarget(targetId) {\n return {\n type: exports.REMOVE_TARGET,\n payload: {\n targetId: targetId\n }\n };\n}\n\nexports.removeTarget = removeTarget;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/actions/registry.js?");
/***/ }),
@@ -248,7 +248,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nfunction validateSourceContract(source) {\n invariant(typeof source.canDrag === 'function', 'Expected canDrag to be a function.');\n invariant(typeof source.beginDrag === 'function', 'Expected beginDrag to be a function.');\n invariant(typeof source.endDrag === 'function', 'Expected endDrag to be a function.');\n}\n\nexports.validateSourceContract = validateSourceContract;\n\nfunction validateTargetContract(target) {\n invariant(typeof target.canDrop === 'function', 'Expected canDrop to be a function.');\n invariant(typeof target.hover === 'function', 'Expected hover to be a function.');\n invariant(typeof target.drop === 'function', 'Expected beginDrag to be a function.');\n}\n\nexports.validateTargetContract = validateTargetContract;\n\nfunction validateType(type, allowArray) {\n if (allowArray && Array.isArray(type)) {\n type.forEach(t => validateType(t, false));\n return;\n }\n\n invariant(typeof type === 'string' || 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.');\n}\n\nexports.validateType = validateType;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/contracts.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n\nfunction validateSourceContract(source) {\n invariant(typeof source.canDrag === 'function', 'Expected canDrag to be a function.');\n invariant(typeof source.beginDrag === 'function', 'Expected beginDrag to be a function.');\n invariant(typeof source.endDrag === 'function', 'Expected endDrag to be a function.');\n}\n\nexports.validateSourceContract = validateSourceContract;\n\nfunction validateTargetContract(target) {\n invariant(typeof target.canDrop === 'function', 'Expected canDrop to be a function.');\n invariant(typeof target.hover === 'function', 'Expected hover to be a function.');\n invariant(typeof target.drop === 'function', 'Expected beginDrag to be a function.');\n}\n\nexports.validateTargetContract = validateTargetContract;\n\nfunction validateType(type, allowArray) {\n if (allowArray && Array.isArray(type)) {\n type.forEach(function (t) {\n return validateType(t, false);\n });\n return;\n }\n\n invariant(typeof type === 'string' || 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.');\n}\n\nexports.validateType = validateType;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/contracts.js?");
/***/ }),
@@ -260,7 +260,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst DragDropManagerImpl_1 = __webpack_require__(/*! ./DragDropManagerImpl */ \"../dnd-core/lib/cjs/DragDropManagerImpl.js\");\n\nfunction createDragDropManager(backend, context, debugMode) {\n return new DragDropManagerImpl_1.default(backend, context, debugMode);\n}\n\nexports.createDragDropManager = createDragDropManager;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/factories.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar DragDropManagerImpl_1 = __webpack_require__(/*! ./DragDropManagerImpl */ \"../dnd-core/lib/cjs/DragDropManagerImpl.js\");\n\nfunction createDragDropManager(backend, context, debugMode) {\n return new DragDropManagerImpl_1.default(backend, context, debugMode);\n}\n\nexports.createDragDropManager = createDragDropManager;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/factories.js?");
/***/ }),
@@ -296,7 +296,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst dragDrop_1 = __webpack_require__(/*! ../actions/dragDrop */ \"../dnd-core/lib/cjs/actions/dragDrop/index.js\");\n\nconst registry_1 = __webpack_require__(/*! ../actions/registry */ \"../dnd-core/lib/cjs/actions/registry.js\");\n\nconst equality_1 = __webpack_require__(/*! ../utils/equality */ \"../dnd-core/lib/cjs/utils/equality.js\");\n\nconst dirtiness_1 = __webpack_require__(/*! ../utils/dirtiness */ \"../dnd-core/lib/cjs/utils/dirtiness.js\");\n\nconst xor = __webpack_require__(/*! lodash/xor */ \"./node_modules/lodash/xor.js\");\n\nfunction dirtyHandlerIds(state = dirtiness_1.NONE, action) {\n switch (action.type) {\n case dragDrop_1.HOVER:\n break;\n\n case registry_1.ADD_SOURCE:\n case registry_1.ADD_TARGET:\n case registry_1.REMOVE_TARGET:\n case registry_1.REMOVE_SOURCE:\n return dirtiness_1.NONE;\n\n case dragDrop_1.BEGIN_DRAG:\n case dragDrop_1.PUBLISH_DRAG_SOURCE:\n case dragDrop_1.END_DRAG:\n case dragDrop_1.DROP:\n default:\n return dirtiness_1.ALL;\n }\n\n const {\n targetIds = [],\n prevTargetIds = []\n } = action.payload;\n const result = xor(targetIds, prevTargetIds);\n const didChange = result.length > 0 || !equality_1.areArraysEqual(targetIds, prevTargetIds);\n\n if (!didChange) {\n return dirtiness_1.NONE;\n } // Check the target ids at the innermost position. If they are valid, add them\n // to the result\n\n\n const prevInnermostTargetId = prevTargetIds[prevTargetIds.length - 1];\n const innermostTargetId = targetIds[targetIds.length - 1];\n\n if (prevInnermostTargetId !== innermostTargetId) {\n if (prevInnermostTargetId) {\n result.push(prevInnermostTargetId);\n }\n\n if (innermostTargetId) {\n result.push(innermostTargetId);\n }\n }\n\n return result;\n}\n\nexports.default = dirtyHandlerIds;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/dirtyHandlerIds.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar dragDrop_1 = __webpack_require__(/*! ../actions/dragDrop */ \"../dnd-core/lib/cjs/actions/dragDrop/index.js\");\n\nvar registry_1 = __webpack_require__(/*! ../actions/registry */ \"../dnd-core/lib/cjs/actions/registry.js\");\n\nvar equality_1 = __webpack_require__(/*! ../utils/equality */ \"../dnd-core/lib/cjs/utils/equality.js\");\n\nvar dirtiness_1 = __webpack_require__(/*! ../utils/dirtiness */ \"../dnd-core/lib/cjs/utils/dirtiness.js\");\n\nvar xor = __webpack_require__(/*! lodash/xor */ \"./node_modules/lodash/xor.js\");\n\nfunction dirtyHandlerIds(state, action) {\n if (state === void 0) {\n state = dirtiness_1.NONE;\n }\n\n switch (action.type) {\n case dragDrop_1.HOVER:\n break;\n\n case registry_1.ADD_SOURCE:\n case registry_1.ADD_TARGET:\n case registry_1.REMOVE_TARGET:\n case registry_1.REMOVE_SOURCE:\n return dirtiness_1.NONE;\n\n case dragDrop_1.BEGIN_DRAG:\n case dragDrop_1.PUBLISH_DRAG_SOURCE:\n case dragDrop_1.END_DRAG:\n case dragDrop_1.DROP:\n default:\n return dirtiness_1.ALL;\n }\n\n var _a = action.payload,\n _b = _a.targetIds,\n targetIds = _b === void 0 ? [] : _b,\n _c = _a.prevTargetIds,\n prevTargetIds = _c === void 0 ? [] : _c;\n var result = xor(targetIds, prevTargetIds);\n var didChange = result.length > 0 || !equality_1.areArraysEqual(targetIds, prevTargetIds);\n\n if (!didChange) {\n return dirtiness_1.NONE;\n } // Check the target ids at the innermost position. If they are valid, add them\n // to the result\n\n\n var prevInnermostTargetId = prevTargetIds[prevTargetIds.length - 1];\n var innermostTargetId = targetIds[targetIds.length - 1];\n\n if (prevInnermostTargetId !== innermostTargetId) {\n if (prevInnermostTargetId) {\n result.push(prevInnermostTargetId);\n }\n\n if (innermostTargetId) {\n result.push(innermostTargetId);\n }\n }\n\n return result;\n}\n\nexports.default = dirtyHandlerIds;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/dirtyHandlerIds.js?");
/***/ }),
@@ -308,7 +308,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst dragDrop_1 = __webpack_require__(/*! ../actions/dragDrop */ \"../dnd-core/lib/cjs/actions/dragDrop/index.js\");\n\nconst equality_1 = __webpack_require__(/*! ../utils/equality */ \"../dnd-core/lib/cjs/utils/equality.js\");\n\nconst initialState = {\n initialSourceClientOffset: null,\n initialClientOffset: null,\n clientOffset: null\n};\n\nfunction dragOffset(state = initialState, action) {\n const {\n payload\n } = action;\n\n switch (action.type) {\n case dragDrop_1.INIT_COORDS:\n case dragDrop_1.BEGIN_DRAG:\n return {\n initialSourceClientOffset: payload.sourceClientOffset,\n initialClientOffset: payload.clientOffset,\n clientOffset: payload.clientOffset\n };\n\n case dragDrop_1.HOVER:\n if (equality_1.areCoordsEqual(state.clientOffset, payload.clientOffset)) {\n return state;\n }\n\n return Object.assign({}, state, {\n clientOffset: payload.clientOffset\n });\n\n case dragDrop_1.END_DRAG:\n case dragDrop_1.DROP:\n return initialState;\n\n default:\n return state;\n }\n}\n\nexports.default = dragOffset;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/dragOffset.js?");
+eval("\n\nvar __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar dragDrop_1 = __webpack_require__(/*! ../actions/dragDrop */ \"../dnd-core/lib/cjs/actions/dragDrop/index.js\");\n\nvar equality_1 = __webpack_require__(/*! ../utils/equality */ \"../dnd-core/lib/cjs/utils/equality.js\");\n\nvar initialState = {\n initialSourceClientOffset: null,\n initialClientOffset: null,\n clientOffset: null\n};\n\nfunction dragOffset(state, action) {\n if (state === void 0) {\n state = initialState;\n }\n\n var payload = action.payload;\n\n switch (action.type) {\n case dragDrop_1.INIT_COORDS:\n case dragDrop_1.BEGIN_DRAG:\n return {\n initialSourceClientOffset: payload.sourceClientOffset,\n initialClientOffset: payload.clientOffset,\n clientOffset: payload.clientOffset\n };\n\n case dragDrop_1.HOVER:\n if (equality_1.areCoordsEqual(state.clientOffset, payload.clientOffset)) {\n return state;\n }\n\n return __assign({}, state, {\n clientOffset: payload.clientOffset\n });\n\n case dragDrop_1.END_DRAG:\n case dragDrop_1.DROP:\n return initialState;\n\n default:\n return state;\n }\n}\n\nexports.default = dragOffset;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/dragOffset.js?");
/***/ }),
@@ -320,7 +320,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst dragDrop_1 = __webpack_require__(/*! ../actions/dragDrop */ \"../dnd-core/lib/cjs/actions/dragDrop/index.js\");\n\nconst registry_1 = __webpack_require__(/*! ../actions/registry */ \"../dnd-core/lib/cjs/actions/registry.js\");\n\nconst without = __webpack_require__(/*! lodash/without */ \"./node_modules/lodash/without.js\");\n\nconst initialState = {\n itemType: null,\n item: null,\n sourceId: null,\n targetIds: [],\n dropResult: null,\n didDrop: false,\n isSourcePublic: null\n};\n\nfunction dragOperation(state = initialState, action) {\n const {\n payload\n } = action;\n\n switch (action.type) {\n case dragDrop_1.BEGIN_DRAG:\n return Object.assign({}, state, {\n itemType: payload.itemType,\n item: payload.item,\n sourceId: payload.sourceId,\n isSourcePublic: payload.isSourcePublic,\n dropResult: null,\n didDrop: false\n });\n\n case dragDrop_1.PUBLISH_DRAG_SOURCE:\n return Object.assign({}, state, {\n isSourcePublic: true\n });\n\n case dragDrop_1.HOVER:\n return Object.assign({}, state, {\n targetIds: payload.targetIds\n });\n\n case registry_1.REMOVE_TARGET:\n if (state.targetIds.indexOf(payload.targetId) === -1) {\n return state;\n }\n\n return Object.assign({}, state, {\n targetIds: without(state.targetIds, payload.targetId)\n });\n\n case dragDrop_1.DROP:\n return Object.assign({}, state, {\n dropResult: payload.dropResult,\n didDrop: true,\n targetIds: []\n });\n\n case dragDrop_1.END_DRAG:\n return Object.assign({}, state, {\n itemType: null,\n item: null,\n sourceId: null,\n dropResult: null,\n didDrop: false,\n isSourcePublic: null,\n targetIds: []\n });\n\n default:\n return state;\n }\n}\n\nexports.default = dragOperation;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/dragOperation.js?");
+eval("\n\nvar __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar dragDrop_1 = __webpack_require__(/*! ../actions/dragDrop */ \"../dnd-core/lib/cjs/actions/dragDrop/index.js\");\n\nvar registry_1 = __webpack_require__(/*! ../actions/registry */ \"../dnd-core/lib/cjs/actions/registry.js\");\n\nvar without = __webpack_require__(/*! lodash/without */ \"./node_modules/lodash/without.js\");\n\nvar initialState = {\n itemType: null,\n item: null,\n sourceId: null,\n targetIds: [],\n dropResult: null,\n didDrop: false,\n isSourcePublic: null\n};\n\nfunction dragOperation(state, action) {\n if (state === void 0) {\n state = initialState;\n }\n\n var payload = action.payload;\n\n switch (action.type) {\n case dragDrop_1.BEGIN_DRAG:\n return __assign({}, state, {\n itemType: payload.itemType,\n item: payload.item,\n sourceId: payload.sourceId,\n isSourcePublic: payload.isSourcePublic,\n dropResult: null,\n didDrop: false\n });\n\n case dragDrop_1.PUBLISH_DRAG_SOURCE:\n return __assign({}, state, {\n isSourcePublic: true\n });\n\n case dragDrop_1.HOVER:\n return __assign({}, state, {\n targetIds: payload.targetIds\n });\n\n case registry_1.REMOVE_TARGET:\n if (state.targetIds.indexOf(payload.targetId) === -1) {\n return state;\n }\n\n return __assign({}, state, {\n targetIds: without(state.targetIds, payload.targetId)\n });\n\n case dragDrop_1.DROP:\n return __assign({}, state, {\n dropResult: payload.dropResult,\n didDrop: true,\n targetIds: []\n });\n\n case dragDrop_1.END_DRAG:\n return __assign({}, state, {\n itemType: null,\n item: null,\n sourceId: null,\n dropResult: null,\n didDrop: false,\n isSourcePublic: null,\n targetIds: []\n });\n\n default:\n return state;\n }\n}\n\nexports.default = dragOperation;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/dragOperation.js?");
/***/ }),
@@ -332,7 +332,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst dragOffset_1 = __webpack_require__(/*! ./dragOffset */ \"../dnd-core/lib/cjs/reducers/dragOffset.js\");\n\nconst dragOperation_1 = __webpack_require__(/*! ./dragOperation */ \"../dnd-core/lib/cjs/reducers/dragOperation.js\");\n\nconst refCount_1 = __webpack_require__(/*! ./refCount */ \"../dnd-core/lib/cjs/reducers/refCount.js\");\n\nconst dirtyHandlerIds_1 = __webpack_require__(/*! ./dirtyHandlerIds */ \"../dnd-core/lib/cjs/reducers/dirtyHandlerIds.js\");\n\nconst stateId_1 = __webpack_require__(/*! ./stateId */ \"../dnd-core/lib/cjs/reducers/stateId.js\");\n\nconst get = __webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\");\n\nfunction reduce(state = {}, action) {\n return {\n dirtyHandlerIds: dirtyHandlerIds_1.default(state.dirtyHandlerIds, {\n type: action.type,\n payload: Object.assign({}, action.payload, {\n prevTargetIds: get(state, 'dragOperation.targetIds', [])\n })\n }),\n dragOffset: dragOffset_1.default(state.dragOffset, action),\n refCount: refCount_1.default(state.refCount, action),\n dragOperation: dragOperation_1.default(state.dragOperation, action),\n stateId: stateId_1.default(state.stateId)\n };\n}\n\nexports.default = reduce;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/index.js?");
+eval("\n\nvar __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar dragOffset_1 = __webpack_require__(/*! ./dragOffset */ \"../dnd-core/lib/cjs/reducers/dragOffset.js\");\n\nvar dragOperation_1 = __webpack_require__(/*! ./dragOperation */ \"../dnd-core/lib/cjs/reducers/dragOperation.js\");\n\nvar refCount_1 = __webpack_require__(/*! ./refCount */ \"../dnd-core/lib/cjs/reducers/refCount.js\");\n\nvar dirtyHandlerIds_1 = __webpack_require__(/*! ./dirtyHandlerIds */ \"../dnd-core/lib/cjs/reducers/dirtyHandlerIds.js\");\n\nvar stateId_1 = __webpack_require__(/*! ./stateId */ \"../dnd-core/lib/cjs/reducers/stateId.js\");\n\nvar get = __webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\");\n\nfunction reduce(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n return {\n dirtyHandlerIds: dirtyHandlerIds_1.default(state.dirtyHandlerIds, {\n type: action.type,\n payload: __assign({}, action.payload, {\n prevTargetIds: get(state, 'dragOperation.targetIds', [])\n })\n }),\n dragOffset: dragOffset_1.default(state.dragOffset, action),\n refCount: refCount_1.default(state.refCount, action),\n dragOperation: dragOperation_1.default(state.dragOperation, action),\n stateId: stateId_1.default(state.stateId)\n };\n}\n\nexports.default = reduce;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/index.js?");
/***/ }),
@@ -344,7 +344,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst registry_1 = __webpack_require__(/*! ../actions/registry */ \"../dnd-core/lib/cjs/actions/registry.js\");\n\nfunction refCount(state = 0, action) {\n switch (action.type) {\n case registry_1.ADD_SOURCE:\n case registry_1.ADD_TARGET:\n return state + 1;\n\n case registry_1.REMOVE_SOURCE:\n case registry_1.REMOVE_TARGET:\n return state - 1;\n\n default:\n return state;\n }\n}\n\nexports.default = refCount;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/refCount.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar registry_1 = __webpack_require__(/*! ../actions/registry */ \"../dnd-core/lib/cjs/actions/registry.js\");\n\nfunction refCount(state, action) {\n if (state === void 0) {\n state = 0;\n }\n\n switch (action.type) {\n case registry_1.ADD_SOURCE:\n case registry_1.ADD_TARGET:\n return state + 1;\n\n case registry_1.REMOVE_SOURCE:\n case registry_1.REMOVE_TARGET:\n return state - 1;\n\n default:\n return state;\n }\n}\n\nexports.default = refCount;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/refCount.js?");
/***/ }),
@@ -356,7 +356,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction stateId(state = 0) {\n return state + 1;\n}\n\nexports.default = stateId;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/stateId.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction stateId(state) {\n if (state === void 0) {\n state = 0;\n }\n\n return state + 1;\n}\n\nexports.default = stateId;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/reducers/stateId.js?");
/***/ }),
@@ -368,7 +368,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Coordinate addition\n * @param a The first coordinate\n * @param b The second coordinate\n */\n\nfunction add(a, b) {\n return {\n x: a.x + b.x,\n y: a.y + b.y\n };\n}\n\nexports.add = add;\n/**\n * Coordinate subtraction\n * @param a The first coordinate\n * @param b The second coordinate\n */\n\nfunction subtract(a, b) {\n return {\n x: a.x - b.x,\n y: a.y - b.y\n };\n}\n\nexports.subtract = subtract;\n/**\n * Returns the cartesian distance of the drag source component's position, based on its position\n * at the time when the current drag operation has started, and the movement difference.\n *\n * Returns null if no item is being dragged.\n *\n * @param state The offset state to compute from\n */\n\nfunction getSourceClientOffset(state) {\n const {\n clientOffset,\n initialClientOffset,\n initialSourceClientOffset\n } = state;\n\n if (!clientOffset || !initialClientOffset || !initialSourceClientOffset) {\n return null;\n }\n\n return subtract(add(clientOffset, initialSourceClientOffset), initialClientOffset);\n}\n\nexports.getSourceClientOffset = getSourceClientOffset;\n/**\n * Determines the x,y offset between the client offset and the initial client offset\n *\n * @param state The offset state to compute from\n */\n\nfunction getDifferenceFromInitialOffset(state) {\n const {\n clientOffset,\n initialClientOffset\n } = state;\n\n if (!clientOffset || !initialClientOffset) {\n return null;\n }\n\n return subtract(clientOffset, initialClientOffset);\n}\n\nexports.getDifferenceFromInitialOffset = getDifferenceFromInitialOffset;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/utils/coords.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Coordinate addition\n * @param a The first coordinate\n * @param b The second coordinate\n */\n\nfunction add(a, b) {\n return {\n x: a.x + b.x,\n y: a.y + b.y\n };\n}\n\nexports.add = add;\n/**\n * Coordinate subtraction\n * @param a The first coordinate\n * @param b The second coordinate\n */\n\nfunction subtract(a, b) {\n return {\n x: a.x - b.x,\n y: a.y - b.y\n };\n}\n\nexports.subtract = subtract;\n/**\n * Returns the cartesian distance of the drag source component's position, based on its position\n * at the time when the current drag operation has started, and the movement difference.\n *\n * Returns null if no item is being dragged.\n *\n * @param state The offset state to compute from\n */\n\nfunction getSourceClientOffset(state) {\n var clientOffset = state.clientOffset,\n initialClientOffset = state.initialClientOffset,\n initialSourceClientOffset = state.initialSourceClientOffset;\n\n if (!clientOffset || !initialClientOffset || !initialSourceClientOffset) {\n return null;\n }\n\n return subtract(add(clientOffset, initialSourceClientOffset), initialClientOffset);\n}\n\nexports.getSourceClientOffset = getSourceClientOffset;\n/**\n * Determines the x,y offset between the client offset and the initial client offset\n *\n * @param state The offset state to compute from\n */\n\nfunction getDifferenceFromInitialOffset(state) {\n var clientOffset = state.clientOffset,\n initialClientOffset = state.initialClientOffset;\n\n if (!clientOffset || !initialClientOffset) {\n return null;\n }\n\n return subtract(clientOffset, initialClientOffset);\n}\n\nexports.getDifferenceFromInitialOffset = getDifferenceFromInitialOffset;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/utils/coords.js?");
/***/ }),
@@ -380,7 +380,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nconst intersection = __webpack_require__(/*! lodash/intersection */ \"./node_modules/lodash/intersection.js\");\n\nexports.NONE = [];\nexports.ALL = [];\n/**\n * Determines if the given handler IDs are dirty or not.\n *\n * @param dirtyIds The set of dirty handler ids\n * @param handlerIds The set of handler ids to check\n */\n\nfunction areDirty(dirtyIds, handlerIds) {\n if (dirtyIds === exports.NONE) {\n return false;\n }\n\n if (dirtyIds === exports.ALL || typeof handlerIds === 'undefined') {\n return true;\n }\n\n return intersection(handlerIds, dirtyIds).length > 0;\n}\n\nexports.areDirty = areDirty;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/utils/dirtiness.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar intersection = __webpack_require__(/*! lodash/intersection */ \"./node_modules/lodash/intersection.js\");\n\nexports.NONE = [];\nexports.ALL = [];\n/**\n * Determines if the given handler IDs are dirty or not.\n *\n * @param dirtyIds The set of dirty handler ids\n * @param handlerIds The set of handler ids to check\n */\n\nfunction areDirty(dirtyIds, handlerIds) {\n if (dirtyIds === exports.NONE) {\n return false;\n }\n\n if (dirtyIds === exports.ALL || typeof handlerIds === 'undefined') {\n return true;\n }\n\n return intersection(handlerIds, dirtyIds).length > 0;\n}\n\nexports.areDirty = areDirty;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/utils/dirtiness.js?");
/***/ }),
@@ -392,7 +392,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.strictEquality = (a, b) => a === b;\n/**\n * Determine if two cartesian coordinate offsets are equal\n * @param offsetA\n * @param offsetB\n */\n\n\nfunction areCoordsEqual(offsetA, offsetB) {\n if (!offsetA && !offsetB) {\n return true;\n } else if (!offsetA || !offsetB) {\n return false;\n } else {\n return offsetA.x === offsetB.x && offsetA.y === offsetB.y;\n }\n}\n\nexports.areCoordsEqual = areCoordsEqual;\n/**\n * Determines if two arrays of items are equal\n * @param a The first array of items\n * @param b The second array of items\n */\n\nfunction areArraysEqual(a, b, isEqual = exports.strictEquality) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (let i = 0; i < a.length; ++i) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n}\n\nexports.areArraysEqual = areArraysEqual;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/utils/equality.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.strictEquality = function (a, b) {\n return a === b;\n};\n/**\n * Determine if two cartesian coordinate offsets are equal\n * @param offsetA\n * @param offsetB\n */\n\n\nfunction areCoordsEqual(offsetA, offsetB) {\n if (!offsetA && !offsetB) {\n return true;\n } else if (!offsetA || !offsetB) {\n return false;\n } else {\n return offsetA.x === offsetB.x && offsetA.y === offsetB.y;\n }\n}\n\nexports.areCoordsEqual = areCoordsEqual;\n/**\n * Determines if two arrays of items are equal\n * @param a The first array of items\n * @param b The second array of items\n */\n\nfunction areArraysEqual(a, b, isEqual) {\n if (isEqual === void 0) {\n isEqual = exports.strictEquality;\n }\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; ++i) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n}\n\nexports.areArraysEqual = areArraysEqual;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/utils/equality.js?");
/***/ }),
@@ -404,7 +404,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nlet nextUniqueId = 0;\n\nfunction getNextUniqueId() {\n return nextUniqueId++;\n}\n\nexports.default = getNextUniqueId;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/utils/getNextUniqueId.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar nextUniqueId = 0;\n\nfunction getNextUniqueId() {\n return nextUniqueId++;\n}\n\nexports.default = getNextUniqueId;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/utils/getNextUniqueId.js?");
/***/ }),
@@ -416,7 +416,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction matchesType(targetType, draggedItemType) {\n if (draggedItemType === null) {\n return targetType === null;\n }\n\n return Array.isArray(targetType) ? targetType.some(t => t === draggedItemType) : targetType === draggedItemType;\n}\n\nexports.default = matchesType;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/utils/matchesType.js?");
+eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction matchesType(targetType, draggedItemType) {\n if (draggedItemType === null) {\n return targetType === null;\n }\n\n return Array.isArray(targetType) ? targetType.some(function (t) {\n return t === draggedItemType;\n }) : targetType === draggedItemType;\n}\n\nexports.default = matchesType;\n\n//# sourceURL=webpack://ReactDnD/../dnd-core/lib/cjs/utils/matchesType.js?");
/***/ }),
@@ -1637,7 +1637,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst React = __webpack_require__(/*! react */ \"react\");\nconst dnd_core_1 = __webpack_require__(/*! dnd-core */ \"../dnd-core/lib/cjs/index.js\");\nconst checkDecoratorArguments_1 = __webpack_require__(/*! ./utils/checkDecoratorArguments */ \"./src/utils/checkDecoratorArguments.ts\");\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nconst hoistStatics = __webpack_require__(/*! hoist-non-react-statics */ \"./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js\");\nconst isClassComponent = __webpack_require__(/*! recompose/isClassComponent */ \"./node_modules/recompose/isClassComponent.js\").default;\n/**\n * Create the React Context\n */\n_a = React.createContext({ dragDropManager: undefined }), exports.Consumer = _a.Consumer, exports.Provider = _a.Provider;\n/**\n * Creates the context object we're providing\n * @param backend\n * @param context\n */\nfunction createChildContext(backend, context, debugMode) {\n return {\n dragDropManager: dnd_core_1.createDragDropManager(backend, context, debugMode),\n };\n}\nexports.createChildContext = createChildContext;\n/**\n * A React component that provides the React-DnD context\n */\nexports.DragDropContextProvider = ({ backend, context, debugMode, children }) => {\n const contextValue = createChildContext(backend, context, debugMode);\n return React.createElement(exports.Provider, { value: contextValue }, children);\n};\n/**\n * Wrap the root component of your application with DragDropContext decorator to set up React DnD.\n * This lets you specify the backend, and sets up the shared DnD state behind the scenes.\n * @param backendFactory The DnD backend factory\n * @param backendContext The backend context\n */\nfunction DragDropContext(backendFactory, backendContext, debugMode) {\n checkDecoratorArguments_1.default('DragDropContext', 'backend', backendFactory);\n const childContext = createChildContext(backendFactory, backendContext, debugMode);\n return function decorateContext(DecoratedComponent) {\n const Decorated = DecoratedComponent;\n const displayName = Decorated.displayName || Decorated.name || 'Component';\n class DragDropContextContainer extends React.Component {\n constructor() {\n super(...arguments);\n this.ref = React.createRef();\n this.getManager = () => childContext.dragDropManager;\n }\n getDecoratedComponentInstance() {\n invariant(this.ref.current, 'In order to access an instance of the decorated component it can not be a stateless component.');\n return this.ref.current;\n }\n render() {\n return (React.createElement(exports.Provider, { value: childContext },\n React.createElement(Decorated, Object.assign({}, this.props, { ref: isClassComponent(Decorated) ? this.ref : undefined }))));\n }\n }\n DragDropContextContainer.DecoratedComponent = DecoratedComponent;\n DragDropContextContainer.displayName = `DragDropContext(${displayName})`;\n return hoistStatics(DragDropContextContainer, DecoratedComponent);\n };\n}\nexports.DragDropContext = DragDropContext;\n\n\n//# sourceURL=webpack://ReactDnD/./src/DragDropContext.tsx?");
+eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __webpack_require__(/*! react */ \"react\");\nvar dnd_core_1 = __webpack_require__(/*! dnd-core */ \"../dnd-core/lib/cjs/index.js\");\nvar checkDecoratorArguments_1 = __webpack_require__(/*! ./utils/checkDecoratorArguments */ \"./src/utils/checkDecoratorArguments.ts\");\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nvar hoistStatics = __webpack_require__(/*! hoist-non-react-statics */ \"./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js\");\nvar isClassComponent = __webpack_require__(/*! recompose/isClassComponent */ \"./node_modules/recompose/isClassComponent.js\").default;\n/**\n * Create the React Context\n */\nexports.context = React.createContext({\n dragDropManager: undefined,\n});\nexports.Consumer = exports.context.Consumer, exports.Provider = exports.context.Provider;\n/**\n * Creates the context object we're providing\n * @param backend\n * @param context\n */\nfunction createChildContext(backend, context, debugMode) {\n return {\n dragDropManager: dnd_core_1.createDragDropManager(backend, context, debugMode),\n };\n}\nexports.createChildContext = createChildContext;\n/**\n * A React component that provides the React-DnD context\n */\nexports.DragDropContextProvider = function (_a) {\n var backend = _a.backend, context = _a.context, debugMode = _a.debugMode, children = _a.children;\n var contextValue = createChildContext(backend, context, debugMode);\n React.useEffect(function () {\n return function () {\n return contextValue.dragDropManager.dispatch({\n type: 'DragDropContextProvider::Exiting',\n });\n };\n });\n return React.createElement(exports.Provider, { value: contextValue }, children);\n};\n/**\n * Wrap the root component of your application with DragDropContext decorator to set up React DnD.\n * This lets you specify the backend, and sets up the shared DnD state behind the scenes.\n * @param backendFactory The DnD backend factory\n * @param backendContext The backend context\n */\nfunction DragDropContext(backendFactory, backendContext, debugMode) {\n checkDecoratorArguments_1.default('DragDropContext', 'backend', backendFactory);\n var childContext = createChildContext(backendFactory, backendContext, debugMode);\n return function decorateContext(DecoratedComponent) {\n var Decorated = DecoratedComponent;\n var displayName = Decorated.displayName || Decorated.name || 'Component';\n var DragDropContextContainer = /** @class */ (function (_super) {\n __extends(DragDropContextContainer, _super);\n function DragDropContextContainer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.ref = React.createRef();\n _this.getManager = function () { return childContext.dragDropManager; };\n return _this;\n }\n DragDropContextContainer.prototype.getDecoratedComponentInstance = function () {\n invariant(this.ref.current, 'In order to access an instance of the decorated component it can not be a stateless component.');\n return this.ref.current;\n };\n DragDropContextContainer.prototype.render = function () {\n return (React.createElement(exports.Provider, { value: childContext },\n React.createElement(Decorated, __assign({}, this.props, { ref: isClassComponent(Decorated) ? this.ref : undefined }))));\n };\n DragDropContextContainer.DecoratedComponent = DecoratedComponent;\n DragDropContextContainer.displayName = \"DragDropContext(\" + displayName + \")\";\n return DragDropContextContainer;\n }(React.Component));\n return hoistStatics(DragDropContextContainer, DecoratedComponent);\n };\n}\nexports.DragDropContext = DragDropContext;\n\n\n//# sourceURL=webpack://ReactDnD/./src/DragDropContext.tsx?");
/***/ }),
@@ -1649,7 +1649,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst React = __webpack_require__(/*! react */ \"react\");\nconst checkDecoratorArguments_1 = __webpack_require__(/*! ./utils/checkDecoratorArguments */ \"./src/utils/checkDecoratorArguments.ts\");\nconst DragDropContext_1 = __webpack_require__(/*! ./DragDropContext */ \"./src/DragDropContext.tsx\");\nconst hoistStatics = __webpack_require__(/*! hoist-non-react-statics */ \"./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js\");\nconst isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nconst shallowEqual = __webpack_require__(/*! shallowequal */ \"./node_modules/shallowequal/index.js\");\nconst isClassComponent = __webpack_require__(/*! recompose/isClassComponent */ \"./node_modules/recompose/isClassComponent.js\").default;\nfunction DragLayer(collect, options = {}) {\n checkDecoratorArguments_1.default('DragLayer', 'collect[, options]', collect, options);\n invariant(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);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the second argument to DragLayer to be a plain object when specified. ' +\n 'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html', options);\n return function decorateLayer(DecoratedComponent) {\n const Decorated = DecoratedComponent;\n const { arePropsEqual = shallowEqual } = options;\n const displayName = Decorated.displayName || Decorated.name || 'Component';\n class DragLayerContainer extends React.Component {\n constructor() {\n super(...arguments);\n this.isCurrentlyMounted = false;\n this.ref = React.createRef();\n this.handleChange = () => {\n if (!this.isCurrentlyMounted) {\n return;\n }\n const nextState = this.getCurrentState();\n if (!shallowEqual(nextState, this.state)) {\n this.setState(nextState);\n }\n };\n }\n getDecoratedComponentInstance() {\n invariant(this.ref.current, 'In order to access an instance of the decorated component it can not be a stateless component.');\n return this.ref.current;\n }\n shouldComponentUpdate(nextProps, nextState) {\n return (!arePropsEqual(nextProps, this.props) ||\n !shallowEqual(nextState, this.state));\n }\n componentDidMount() {\n this.isCurrentlyMounted = true;\n this.handleChange();\n }\n componentWillUnmount() {\n this.isCurrentlyMounted = false;\n if (this.unsubscribeFromOffsetChange) {\n this.unsubscribeFromOffsetChange();\n this.unsubscribeFromOffsetChange = undefined;\n }\n if (this.unsubscribeFromStateChange) {\n this.unsubscribeFromStateChange();\n this.unsubscribeFromStateChange = undefined;\n }\n }\n render() {\n return (React.createElement(DragDropContext_1.Consumer, null, ({ dragDropManager }) => {\n if (dragDropManager === undefined) {\n return null;\n }\n this.receiveDragDropManager(dragDropManager);\n // Let componentDidMount fire to initialize the collected state\n if (!this.isCurrentlyMounted) {\n return null;\n }\n return (React.createElement(Decorated, Object.assign({}, this.props, this.state, { ref: isClassComponent(Decorated) ? this.ref : undefined })));\n }));\n }\n receiveDragDropManager(dragDropManager) {\n if (this.manager !== undefined) {\n return;\n }\n this.manager = dragDropManager;\n invariant(typeof dragDropManager === 'object', 'Could not find the drag and drop manager in the context of %s. ' +\n 'Make sure to wrap the top-level component of your app with DragDropContext. ' +\n '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);\n const monitor = this.manager.getMonitor();\n this.unsubscribeFromOffsetChange = monitor.subscribeToOffsetChange(this.handleChange);\n this.unsubscribeFromStateChange = monitor.subscribeToStateChange(this.handleChange);\n }\n getCurrentState() {\n if (!this.manager) {\n return {};\n }\n const monitor = this.manager.getMonitor();\n return collect(monitor, this.props);\n }\n }\n DragLayerContainer.displayName = `DragLayer(${displayName})`;\n DragLayerContainer.DecoratedComponent = DecoratedComponent;\n return hoistStatics(DragLayerContainer, DecoratedComponent);\n };\n}\nexports.default = DragLayer;\n\n\n//# sourceURL=webpack://ReactDnD/./src/DragLayer.tsx?");
+eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __webpack_require__(/*! react */ \"react\");\nvar checkDecoratorArguments_1 = __webpack_require__(/*! ./utils/checkDecoratorArguments */ \"./src/utils/checkDecoratorArguments.ts\");\nvar DragDropContext_1 = __webpack_require__(/*! ./DragDropContext */ \"./src/DragDropContext.tsx\");\nvar hoistStatics = __webpack_require__(/*! hoist-non-react-statics */ \"./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js\");\nvar isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nvar shallowEqual = __webpack_require__(/*! shallowequal */ \"./node_modules/shallowequal/index.js\");\nvar isClassComponent = __webpack_require__(/*! recompose/isClassComponent */ \"./node_modules/recompose/isClassComponent.js\").default;\nfunction DragLayer(collect, options) {\n if (options === void 0) { options = {}; }\n checkDecoratorArguments_1.default('DragLayer', 'collect[, options]', collect, options);\n invariant(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);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the second argument to DragLayer to be a plain object when specified. ' +\n 'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html', options);\n return function decorateLayer(DecoratedComponent) {\n var Decorated = DecoratedComponent;\n var _a = options.arePropsEqual, arePropsEqual = _a === void 0 ? shallowEqual : _a;\n var displayName = Decorated.displayName || Decorated.name || 'Component';\n var DragLayerContainer = /** @class */ (function (_super) {\n __extends(DragLayerContainer, _super);\n function DragLayerContainer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isCurrentlyMounted = false;\n _this.ref = React.createRef();\n _this.handleChange = function () {\n if (!_this.isCurrentlyMounted) {\n return;\n }\n var nextState = _this.getCurrentState();\n if (!shallowEqual(nextState, _this.state)) {\n _this.setState(nextState);\n }\n };\n return _this;\n }\n DragLayerContainer.prototype.getDecoratedComponentInstance = function () {\n invariant(this.ref.current, 'In order to access an instance of the decorated component it can not be a stateless component.');\n return this.ref.current;\n };\n DragLayerContainer.prototype.shouldComponentUpdate = function (nextProps, nextState) {\n return (!arePropsEqual(nextProps, this.props) ||\n !shallowEqual(nextState, this.state));\n };\n DragLayerContainer.prototype.componentDidMount = function () {\n this.isCurrentlyMounted = true;\n this.handleChange();\n };\n DragLayerContainer.prototype.componentWillUnmount = function () {\n this.isCurrentlyMounted = false;\n if (this.unsubscribeFromOffsetChange) {\n this.unsubscribeFromOffsetChange();\n this.unsubscribeFromOffsetChange = undefined;\n }\n if (this.unsubscribeFromStateChange) {\n this.unsubscribeFromStateChange();\n this.unsubscribeFromStateChange = undefined;\n }\n };\n DragLayerContainer.prototype.render = function () {\n var _this = this;\n return (React.createElement(DragDropContext_1.Consumer, null, function (_a) {\n var dragDropManager = _a.dragDropManager;\n if (dragDropManager === undefined) {\n return null;\n }\n _this.receiveDragDropManager(dragDropManager);\n // Let componentDidMount fire to initialize the collected state\n if (!_this.isCurrentlyMounted) {\n return null;\n }\n return (React.createElement(Decorated, __assign({}, _this.props, _this.state, { ref: isClassComponent(Decorated) ? _this.ref : undefined })));\n }));\n };\n DragLayerContainer.prototype.receiveDragDropManager = function (dragDropManager) {\n if (this.manager !== undefined) {\n return;\n }\n this.manager = dragDropManager;\n invariant(typeof dragDropManager === 'object', 'Could not find the drag and drop manager in the context of %s. ' +\n 'Make sure to wrap the top-level component of your app with DragDropContext. ' +\n '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);\n var monitor = this.manager.getMonitor();\n this.unsubscribeFromOffsetChange = monitor.subscribeToOffsetChange(this.handleChange);\n this.unsubscribeFromStateChange = monitor.subscribeToStateChange(this.handleChange);\n };\n DragLayerContainer.prototype.getCurrentState = function () {\n if (!this.manager) {\n return {};\n }\n var monitor = this.manager.getMonitor();\n return collect(monitor, this.props);\n };\n DragLayerContainer.displayName = \"DragLayer(\" + displayName + \")\";\n DragLayerContainer.DecoratedComponent = DecoratedComponent;\n return DragLayerContainer;\n }(React.Component));\n return hoistStatics(DragLayerContainer, DecoratedComponent);\n };\n}\nexports.default = DragLayer;\n\n\n//# sourceURL=webpack://ReactDnD/./src/DragLayer.tsx?");
/***/ }),
@@ -1661,7 +1661,19 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst checkDecoratorArguments_1 = __webpack_require__(/*! ./utils/checkDecoratorArguments */ \"./src/utils/checkDecoratorArguments.ts\");\nconst decorateHandler_1 = __webpack_require__(/*! ./decorateHandler */ \"./src/decorateHandler.tsx\");\nconst registerSource_1 = __webpack_require__(/*! ./registerSource */ \"./src/registerSource.ts\");\nconst createSourceFactory_1 = __webpack_require__(/*! ./createSourceFactory */ \"./src/createSourceFactory.ts\");\nconst createSourceMonitor_1 = __webpack_require__(/*! ./createSourceMonitor */ \"./src/createSourceMonitor.ts\");\nconst createSourceConnector_1 = __webpack_require__(/*! ./createSourceConnector */ \"./src/createSourceConnector.ts\");\nconst isValidType_1 = __webpack_require__(/*! ./utils/isValidType */ \"./src/utils/isValidType.ts\");\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nconst isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\n/**\n * Decorates a component as a dragsource\n * @param type The dragsource type\n * @param spec The drag source specification\n * @param collect The props collector function\n * @param options DnD options\n */\nfunction DragSource(type, spec, collect, options = {}) {\n checkDecoratorArguments_1.default('DragSource', 'type, spec, collect[, options]', type, spec, collect, options);\n let getType = type;\n if (typeof type !== 'function') {\n invariant(isValidType_1.default(type), 'Expected \"type\" provided as the first argument to DragSource to be ' +\n 'a string, or a function that returns a string given the current props. ' +\n 'Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', type);\n getType = () => type;\n }\n invariant(isPlainObject(spec), 'Expected \"spec\" provided as the second argument to DragSource to be ' +\n 'a plain object. Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', spec);\n const createSource = createSourceFactory_1.default(spec);\n invariant(typeof collect === 'function', 'Expected \"collect\" provided as the third argument to DragSource to be ' +\n 'a function that returns a plain object of props to inject. ' +\n 'Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', collect);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the fourth argument to DragSource to be ' +\n 'a plain object when specified. ' +\n 'Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', collect);\n return function decorateSource(DecoratedComponent) {\n return decorateHandler_1.default({\n containerDisplayName: 'DragSource',\n createHandler: createSource,\n registerHandler: registerSource_1.default,\n createMonitor: createSourceMonitor_1.default,\n createConnector: createSourceConnector_1.default,\n DecoratedComponent,\n getType,\n collect,\n options,\n });\n };\n}\nexports.default = DragSource;\n\n\n//# sourceURL=webpack://ReactDnD/./src/DragSource.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar checkDecoratorArguments_1 = __webpack_require__(/*! ./utils/checkDecoratorArguments */ \"./src/utils/checkDecoratorArguments.ts\");\nvar decorateHandler_1 = __webpack_require__(/*! ./decorateHandler */ \"./src/decorateHandler.tsx\");\nvar registerSource_1 = __webpack_require__(/*! ./registerSource */ \"./src/registerSource.ts\");\nvar createSourceFactory_1 = __webpack_require__(/*! ./createSourceFactory */ \"./src/createSourceFactory.ts\");\nvar DragSourceMonitorImpl_1 = __webpack_require__(/*! ./DragSourceMonitorImpl */ \"./src/DragSourceMonitorImpl.ts\");\nvar createSourceConnector_1 = __webpack_require__(/*! ./createSourceConnector */ \"./src/createSourceConnector.ts\");\nvar isValidType_1 = __webpack_require__(/*! ./utils/isValidType */ \"./src/utils/isValidType.ts\");\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nvar isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\n/**\n * Decorates a component as a dragsource\n * @param type The dragsource type\n * @param spec The drag source specification\n * @param collect The props collector function\n * @param options DnD options\n */\nfunction DragSource(type, spec, collect, options) {\n if (options === void 0) { options = {}; }\n checkDecoratorArguments_1.default('DragSource', 'type, spec, collect[, options]', type, spec, collect, options);\n var getType = type;\n if (typeof type !== 'function') {\n invariant(isValidType_1.default(type), 'Expected \"type\" provided as the first argument to DragSource to be ' +\n 'a string, or a function that returns a string given the current props. ' +\n 'Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', type);\n getType = function () { return type; };\n }\n invariant(isPlainObject(spec), 'Expected \"spec\" provided as the second argument to DragSource to be ' +\n 'a plain object. Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', spec);\n var createSource = createSourceFactory_1.default(spec);\n invariant(typeof collect === 'function', 'Expected \"collect\" provided as the third argument to DragSource to be ' +\n 'a function that returns a plain object of props to inject. ' +\n 'Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', collect);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the fourth argument to DragSource to be ' +\n 'a plain object when specified. ' +\n 'Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', collect);\n return function decorateSource(DecoratedComponent) {\n return decorateHandler_1.default({\n containerDisplayName: 'DragSource',\n createHandler: createSource,\n registerHandler: registerSource_1.default,\n createMonitor: function (manager) {\n return new DragSourceMonitorImpl_1.default(manager);\n },\n createConnector: createSourceConnector_1.default,\n DecoratedComponent: DecoratedComponent,\n getType: getType,\n collect: collect,\n options: options,\n });\n };\n}\nexports.default = DragSource;\n\n\n//# sourceURL=webpack://ReactDnD/./src/DragSource.ts?");
+
+/***/ }),
+
+/***/ "./src/DragSourceMonitorImpl.ts":
+/*!**************************************!*\
+ !*** ./src/DragSourceMonitorImpl.ts ***!
+ \**************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nvar isCallingCanDrag = false;\nvar isCallingIsDragging = false;\nvar DragSourceMonitorImpl = /** @class */ (function () {\n function DragSourceMonitorImpl(manager) {\n this.sourceId = null;\n this.internalMonitor = manager.getMonitor();\n }\n DragSourceMonitorImpl.prototype.receiveHandlerId = function (sourceId) {\n this.sourceId = sourceId;\n };\n DragSourceMonitorImpl.prototype.getHandlerId = function () {\n return this.sourceId;\n };\n DragSourceMonitorImpl.prototype.canDrag = function () {\n invariant(!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html');\n try {\n isCallingCanDrag = true;\n return this.internalMonitor.canDragSource(this.sourceId);\n }\n finally {\n isCallingCanDrag = false;\n }\n };\n DragSourceMonitorImpl.prototype.isDragging = function () {\n invariant(!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html');\n try {\n isCallingIsDragging = true;\n return this.internalMonitor.isDraggingSource(this.sourceId);\n }\n finally {\n isCallingIsDragging = false;\n }\n };\n DragSourceMonitorImpl.prototype.subscribeToStateChange = function (listener, options) {\n return this.internalMonitor.subscribeToStateChange(listener, options);\n };\n DragSourceMonitorImpl.prototype.isDraggingSource = function (sourceId) {\n return this.internalMonitor.isDraggingSource(sourceId);\n };\n DragSourceMonitorImpl.prototype.isOverTarget = function (targetId, options) {\n return this.internalMonitor.isOverTarget(targetId, options);\n };\n DragSourceMonitorImpl.prototype.getTargetIds = function () {\n return this.internalMonitor.getTargetIds();\n };\n DragSourceMonitorImpl.prototype.isSourcePublic = function () {\n return this.internalMonitor.isSourcePublic();\n };\n DragSourceMonitorImpl.prototype.getSourceId = function () {\n return this.internalMonitor.getSourceId();\n };\n DragSourceMonitorImpl.prototype.subscribeToOffsetChange = function (listener) {\n return this.internalMonitor.subscribeToOffsetChange(listener);\n };\n DragSourceMonitorImpl.prototype.canDragSource = function (sourceId) {\n return this.internalMonitor.canDragSource(sourceId);\n };\n DragSourceMonitorImpl.prototype.canDropOnTarget = function (targetId) {\n return this.internalMonitor.canDropOnTarget(targetId);\n };\n DragSourceMonitorImpl.prototype.getItemType = function () {\n return this.internalMonitor.getItemType();\n };\n DragSourceMonitorImpl.prototype.getItem = function () {\n return this.internalMonitor.getItem();\n };\n DragSourceMonitorImpl.prototype.getDropResult = function () {\n return this.internalMonitor.getDropResult();\n };\n DragSourceMonitorImpl.prototype.didDrop = function () {\n return this.internalMonitor.didDrop();\n };\n DragSourceMonitorImpl.prototype.getInitialClientOffset = function () {\n return this.internalMonitor.getInitialClientOffset();\n };\n DragSourceMonitorImpl.prototype.getInitialSourceClientOffset = function () {\n return this.internalMonitor.getInitialSourceClientOffset();\n };\n DragSourceMonitorImpl.prototype.getSourceClientOffset = function () {\n return this.internalMonitor.getSourceClientOffset();\n };\n DragSourceMonitorImpl.prototype.getClientOffset = function () {\n return this.internalMonitor.getClientOffset();\n };\n DragSourceMonitorImpl.prototype.getDifferenceFromInitialOffset = function () {\n return this.internalMonitor.getDifferenceFromInitialOffset();\n };\n return DragSourceMonitorImpl;\n}());\nexports.default = DragSourceMonitorImpl;\n\n\n//# sourceURL=webpack://ReactDnD/./src/DragSourceMonitorImpl.ts?");
/***/ }),
@@ -1673,43 +1685,43 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst checkDecoratorArguments_1 = __webpack_require__(/*! ./utils/checkDecoratorArguments */ \"./src/utils/checkDecoratorArguments.ts\");\nconst decorateHandler_1 = __webpack_require__(/*! ./decorateHandler */ \"./src/decorateHandler.tsx\");\nconst registerTarget_1 = __webpack_require__(/*! ./registerTarget */ \"./src/registerTarget.ts\");\nconst createTargetFactory_1 = __webpack_require__(/*! ./createTargetFactory */ \"./src/createTargetFactory.ts\");\nconst createTargetMonitor_1 = __webpack_require__(/*! ./createTargetMonitor */ \"./src/createTargetMonitor.ts\");\nconst createTargetConnector_1 = __webpack_require__(/*! ./createTargetConnector */ \"./src/createTargetConnector.ts\");\nconst isValidType_1 = __webpack_require__(/*! ./utils/isValidType */ \"./src/utils/isValidType.ts\");\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nconst isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\nfunction DropTarget(type, spec, collect, options = {}) {\n checkDecoratorArguments_1.default('DropTarget', 'type, spec, collect[, options]', type, spec, collect, options);\n let getType = type;\n if (typeof type !== 'function') {\n invariant(isValidType_1.default(type, true), 'Expected \"type\" provided as the first argument to DropTarget to be ' +\n 'a string, an array of strings, or a function that returns either given ' +\n 'the current props. Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', type);\n getType = () => type;\n }\n invariant(isPlainObject(spec), 'Expected \"spec\" provided as the second argument to DropTarget to be ' +\n 'a plain object. Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', spec);\n const createTarget = createTargetFactory_1.default(spec);\n invariant(typeof collect === 'function', 'Expected \"collect\" provided as the third argument to DropTarget to be ' +\n 'a function that returns a plain object of props to inject. ' +\n 'Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', collect);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the fourth argument to DropTarget to be ' +\n 'a plain object when specified. ' +\n 'Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', collect);\n return function decorateTarget(DecoratedComponent) {\n return decorateHandler_1.default({\n containerDisplayName: 'DropTarget',\n createHandler: createTarget,\n registerHandler: registerTarget_1.default,\n createMonitor: createTargetMonitor_1.default,\n createConnector: createTargetConnector_1.default,\n DecoratedComponent,\n getType,\n collect,\n options,\n });\n };\n}\nexports.default = DropTarget;\n\n\n//# sourceURL=webpack://ReactDnD/./src/DropTarget.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar checkDecoratorArguments_1 = __webpack_require__(/*! ./utils/checkDecoratorArguments */ \"./src/utils/checkDecoratorArguments.ts\");\nvar decorateHandler_1 = __webpack_require__(/*! ./decorateHandler */ \"./src/decorateHandler.tsx\");\nvar registerTarget_1 = __webpack_require__(/*! ./registerTarget */ \"./src/registerTarget.ts\");\nvar createTargetFactory_1 = __webpack_require__(/*! ./createTargetFactory */ \"./src/createTargetFactory.ts\");\nvar createTargetConnector_1 = __webpack_require__(/*! ./createTargetConnector */ \"./src/createTargetConnector.ts\");\nvar isValidType_1 = __webpack_require__(/*! ./utils/isValidType */ \"./src/utils/isValidType.ts\");\nvar DropTargetMonitorImpl_1 = __webpack_require__(/*! ./DropTargetMonitorImpl */ \"./src/DropTargetMonitorImpl.ts\");\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nvar isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\nfunction DropTarget(type, spec, collect, options) {\n if (options === void 0) { options = {}; }\n checkDecoratorArguments_1.default('DropTarget', 'type, spec, collect[, options]', type, spec, collect, options);\n var getType = type;\n if (typeof type !== 'function') {\n invariant(isValidType_1.default(type, true), 'Expected \"type\" provided as the first argument to DropTarget to be ' +\n 'a string, an array of strings, or a function that returns either given ' +\n 'the current props. Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', type);\n getType = function () { return type; };\n }\n invariant(isPlainObject(spec), 'Expected \"spec\" provided as the second argument to DropTarget to be ' +\n 'a plain object. Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', spec);\n var createTarget = createTargetFactory_1.default(spec);\n invariant(typeof collect === 'function', 'Expected \"collect\" provided as the third argument to DropTarget to be ' +\n 'a function that returns a plain object of props to inject. ' +\n 'Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', collect);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the fourth argument to DropTarget to be ' +\n 'a plain object when specified. ' +\n 'Instead, received %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', collect);\n return function decorateTarget(DecoratedComponent) {\n return decorateHandler_1.default({\n containerDisplayName: 'DropTarget',\n createHandler: createTarget,\n registerHandler: registerTarget_1.default,\n createMonitor: function (manager) {\n return new DropTargetMonitorImpl_1.default(manager);\n },\n createConnector: createTargetConnector_1.default,\n DecoratedComponent: DecoratedComponent,\n getType: getType,\n collect: collect,\n options: options,\n });\n };\n}\nexports.default = DropTarget;\n\n\n//# sourceURL=webpack://ReactDnD/./src/DropTarget.ts?");
/***/ }),
-/***/ "./src/createSourceConnector.ts":
+/***/ "./src/DropTargetMonitorImpl.ts":
/*!**************************************!*\
- !*** ./src/createSourceConnector.ts ***!
+ !*** ./src/DropTargetMonitorImpl.ts ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst wrapConnectorHooks_1 = __webpack_require__(/*! ./wrapConnectorHooks */ \"./src/wrapConnectorHooks.ts\");\nconst shallowEqual = __webpack_require__(/*! shallowequal */ \"./node_modules/shallowequal/index.js\");\nfunction createSourceConnector(backend) {\n let currentHandlerId;\n let currentDragSourceNode;\n let currentDragSourceOptions;\n let disconnectCurrentDragSource;\n let currentDragPreviewNode;\n let currentDragPreviewOptions;\n let disconnectCurrentDragPreview;\n function reconnectDragSource() {\n if (disconnectCurrentDragSource) {\n disconnectCurrentDragSource();\n disconnectCurrentDragSource = undefined;\n }\n if (currentHandlerId && currentDragSourceNode) {\n disconnectCurrentDragSource = backend.connectDragSource(currentHandlerId, currentDragSourceNode, currentDragSourceOptions);\n }\n }\n function reconnectDragPreview() {\n if (disconnectCurrentDragPreview) {\n disconnectCurrentDragPreview();\n disconnectCurrentDragPreview = undefined;\n }\n if (currentHandlerId && currentDragPreviewNode) {\n disconnectCurrentDragPreview = backend.connectDragPreview(currentHandlerId, currentDragPreviewNode, currentDragPreviewOptions);\n }\n }\n function receiveHandlerId(handlerId) {\n if (handlerId === currentHandlerId) {\n return;\n }\n currentHandlerId = handlerId;\n reconnectDragSource();\n reconnectDragPreview();\n }\n const hooks = wrapConnectorHooks_1.default({\n dragSource: function connectDragSource(node, options) {\n if (node === currentDragSourceNode &&\n shallowEqual(options, currentDragSourceOptions)) {\n return;\n }\n currentDragSourceNode = node;\n currentDragSourceOptions = options;\n reconnectDragSource();\n },\n dragPreview: function connectDragPreview(node, options) {\n if (node === currentDragPreviewNode &&\n shallowEqual(options, currentDragPreviewOptions)) {\n return;\n }\n currentDragPreviewNode = node;\n currentDragPreviewOptions = options;\n reconnectDragPreview();\n },\n });\n return {\n receiveHandlerId,\n hooks,\n };\n}\nexports.default = createSourceConnector;\n\n\n//# sourceURL=webpack://ReactDnD/./src/createSourceConnector.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nvar isCallingCanDrop = false;\nvar DropTargetMonitorImpl = /** @class */ (function () {\n function DropTargetMonitorImpl(manager) {\n this.targetId = null;\n this.internalMonitor = manager.getMonitor();\n }\n DropTargetMonitorImpl.prototype.receiveHandlerId = function (targetId) {\n this.targetId = targetId;\n };\n DropTargetMonitorImpl.prototype.getHandlerId = function () {\n return this.targetId;\n };\n DropTargetMonitorImpl.prototype.subscribeToStateChange = function (listener, options) {\n return this.internalMonitor.subscribeToStateChange(listener, options);\n };\n DropTargetMonitorImpl.prototype.canDrop = function () {\n invariant(!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target-monitor.html');\n try {\n isCallingCanDrop = true;\n return this.internalMonitor.canDropOnTarget(this.targetId);\n }\n finally {\n isCallingCanDrop = false;\n }\n };\n DropTargetMonitorImpl.prototype.isOver = function (options) {\n return this.internalMonitor.isOverTarget(this.targetId, options);\n };\n DropTargetMonitorImpl.prototype.getItemType = function () {\n return this.internalMonitor.getItemType();\n };\n DropTargetMonitorImpl.prototype.getItem = function () {\n return this.internalMonitor.getItem();\n };\n DropTargetMonitorImpl.prototype.getDropResult = function () {\n return this.internalMonitor.getDropResult();\n };\n DropTargetMonitorImpl.prototype.didDrop = function () {\n return this.internalMonitor.didDrop();\n };\n DropTargetMonitorImpl.prototype.getInitialClientOffset = function () {\n return this.internalMonitor.getInitialClientOffset();\n };\n DropTargetMonitorImpl.prototype.getInitialSourceClientOffset = function () {\n return this.internalMonitor.getInitialSourceClientOffset();\n };\n DropTargetMonitorImpl.prototype.getSourceClientOffset = function () {\n return this.internalMonitor.getSourceClientOffset();\n };\n DropTargetMonitorImpl.prototype.getClientOffset = function () {\n return this.internalMonitor.getClientOffset();\n };\n DropTargetMonitorImpl.prototype.getDifferenceFromInitialOffset = function () {\n return this.internalMonitor.getDifferenceFromInitialOffset();\n };\n return DropTargetMonitorImpl;\n}());\nexports.default = DropTargetMonitorImpl;\n\n\n//# sourceURL=webpack://ReactDnD/./src/DropTargetMonitorImpl.ts?");
/***/ }),
-/***/ "./src/createSourceFactory.ts":
-/*!************************************!*\
- !*** ./src/createSourceFactory.ts ***!
- \************************************/
+/***/ "./src/createSourceConnector.ts":
+/*!**************************************!*\
+ !*** ./src/createSourceConnector.ts ***!
+ \**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __webpack_require__(/*! react */ \"react\");\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nconst isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\nconst ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'isDragging', 'endDrag'];\nconst REQUIRED_SPEC_METHODS = ['beginDrag'];\nfunction createSourceFactory(spec) {\n Object.keys(spec).forEach(key => {\n invariant(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drag source specification to only have ' +\n 'some of the following keys: %s. ' +\n 'Instead received a specification with an unexpected \"%s\" key. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', ALLOWED_SPEC_METHODS.join(', '), key);\n invariant(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' +\n 'Instead received a specification with %s: %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);\n });\n REQUIRED_SPEC_METHODS.forEach(key => {\n invariant(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' +\n 'Instead received a specification with %s: %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);\n });\n class SourceImpl {\n constructor(monitor) {\n this.monitor = monitor;\n this.props = null;\n this.ref = react_1.createRef();\n this.beginDrag = () => {\n if (!this.props) {\n return;\n }\n const item = spec.beginDrag(this.props, this.monitor, this.ref.current);\n if (false) {}\n return item;\n };\n }\n receiveProps(props) {\n this.props = props;\n }\n canDrag() {\n if (!this.props) {\n return false;\n }\n if (!spec.canDrag) {\n return true;\n }\n return spec.canDrag(this.props, this.monitor);\n }\n isDragging(globalMonitor, sourceId) {\n if (!this.props) {\n return false;\n }\n if (!spec.isDragging) {\n return sourceId === globalMonitor.getSourceId();\n }\n return spec.isDragging(this.props, this.monitor);\n }\n endDrag() {\n if (!this.props) {\n return;\n }\n if (!spec.endDrag) {\n return;\n }\n spec.endDrag(this.props, this.monitor, this.ref.current);\n }\n }\n return function createSource(monitor) {\n return new SourceImpl(monitor);\n };\n}\nexports.default = createSourceFactory;\n\n\n//# sourceURL=webpack://ReactDnD/./src/createSourceFactory.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar wrapConnectorHooks_1 = __webpack_require__(/*! ./wrapConnectorHooks */ \"./src/wrapConnectorHooks.ts\");\nvar shallowEqual = __webpack_require__(/*! shallowequal */ \"./node_modules/shallowequal/index.js\");\nfunction createSourceConnector(backend) {\n var currentHandlerId;\n var currentDragSourceNode;\n var currentDragSourceOptions;\n var disconnectCurrentDragSource;\n var currentDragPreviewNode;\n var currentDragPreviewOptions;\n var disconnectCurrentDragPreview;\n function reconnectDragSource() {\n if (disconnectCurrentDragSource) {\n disconnectCurrentDragSource();\n disconnectCurrentDragSource = undefined;\n }\n if (currentHandlerId && currentDragSourceNode) {\n disconnectCurrentDragSource = backend.connectDragSource(currentHandlerId, currentDragSourceNode, currentDragSourceOptions);\n }\n }\n function reconnectDragPreview() {\n if (disconnectCurrentDragPreview) {\n disconnectCurrentDragPreview();\n disconnectCurrentDragPreview = undefined;\n }\n if (currentHandlerId && currentDragPreviewNode) {\n disconnectCurrentDragPreview = backend.connectDragPreview(currentHandlerId, currentDragPreviewNode, currentDragPreviewOptions);\n }\n }\n function receiveHandlerId(handlerId) {\n if (handlerId === currentHandlerId) {\n return;\n }\n currentHandlerId = handlerId;\n reconnectDragSource();\n reconnectDragPreview();\n }\n var hooks = wrapConnectorHooks_1.default({\n dragSource: function connectDragSource(node, options) {\n if (node === currentDragSourceNode &&\n shallowEqual(options, currentDragSourceOptions)) {\n return;\n }\n currentDragSourceNode = node;\n currentDragSourceOptions = options;\n reconnectDragSource();\n },\n dragPreview: function connectDragPreview(node, options) {\n if (node === currentDragPreviewNode &&\n shallowEqual(options, currentDragPreviewOptions)) {\n return;\n }\n currentDragPreviewNode = node;\n currentDragPreviewOptions = options;\n reconnectDragPreview();\n },\n });\n return {\n receiveHandlerId: receiveHandlerId,\n hooks: hooks,\n };\n}\nexports.default = createSourceConnector;\n\n\n//# sourceURL=webpack://ReactDnD/./src/createSourceConnector.ts?");
/***/ }),
-/***/ "./src/createSourceMonitor.ts":
+/***/ "./src/createSourceFactory.ts":
/*!************************************!*\
- !*** ./src/createSourceMonitor.ts ***!
+ !*** ./src/createSourceFactory.ts ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nlet isCallingCanDrag = false;\nlet isCallingIsDragging = false;\nclass SourceMonitor {\n constructor(manager) {\n this.internalMonitor = manager.getMonitor();\n }\n receiveHandlerId(sourceId) {\n this.sourceId = sourceId;\n }\n canDrag() {\n invariant(!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html');\n try {\n isCallingCanDrag = true;\n return this.internalMonitor.canDragSource(this.sourceId);\n }\n finally {\n isCallingCanDrag = false;\n }\n }\n isDragging() {\n invariant(!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html');\n try {\n isCallingIsDragging = true;\n return this.internalMonitor.isDraggingSource(this.sourceId);\n }\n finally {\n isCallingIsDragging = false;\n }\n }\n subscribeToStateChange(listener, options) {\n return this.internalMonitor.subscribeToStateChange(listener, options);\n }\n isDraggingSource(sourceId) {\n return this.internalMonitor.isDraggingSource(sourceId);\n }\n isOverTarget(targetId, options) {\n return this.internalMonitor.isOverTarget(targetId, options);\n }\n getTargetIds() {\n return this.internalMonitor.getTargetIds();\n }\n isSourcePublic() {\n return this.internalMonitor.isSourcePublic();\n }\n getSourceId() {\n return this.internalMonitor.getSourceId();\n }\n subscribeToOffsetChange(listener) {\n return this.internalMonitor.subscribeToOffsetChange(listener);\n }\n canDragSource(sourceId) {\n return this.internalMonitor.canDragSource(sourceId);\n }\n canDropOnTarget(targetId) {\n return this.internalMonitor.canDropOnTarget(targetId);\n }\n getItemType() {\n return this.internalMonitor.getItemType();\n }\n getItem() {\n return this.internalMonitor.getItem();\n }\n getDropResult() {\n return this.internalMonitor.getDropResult();\n }\n didDrop() {\n return this.internalMonitor.didDrop();\n }\n getInitialClientOffset() {\n return this.internalMonitor.getInitialClientOffset();\n }\n getInitialSourceClientOffset() {\n return this.internalMonitor.getInitialSourceClientOffset();\n }\n getSourceClientOffset() {\n return this.internalMonitor.getSourceClientOffset();\n }\n getClientOffset() {\n return this.internalMonitor.getClientOffset();\n }\n getDifferenceFromInitialOffset() {\n return this.internalMonitor.getDifferenceFromInitialOffset();\n }\n}\nfunction createSourceMonitor(manager) {\n return new SourceMonitor(manager);\n}\nexports.default = createSourceMonitor;\n\n\n//# sourceURL=webpack://ReactDnD/./src/createSourceMonitor.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nvar isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\nvar ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'isDragging', 'endDrag'];\nvar REQUIRED_SPEC_METHODS = ['beginDrag'];\nfunction createSourceFactory(spec) {\n Object.keys(spec).forEach(function (key) {\n invariant(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drag source specification to only have ' +\n 'some of the following keys: %s. ' +\n 'Instead received a specification with an unexpected \"%s\" key. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', ALLOWED_SPEC_METHODS.join(', '), key);\n invariant(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' +\n 'Instead received a specification with %s: %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);\n });\n REQUIRED_SPEC_METHODS.forEach(function (key) {\n invariant(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' +\n 'Instead received a specification with %s: %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);\n });\n var SourceImpl = /** @class */ (function () {\n function SourceImpl(monitor) {\n var _this = this;\n this.monitor = monitor;\n this.props = null;\n this.ref = react_1.createRef();\n this.beginDrag = function () {\n if (!_this.props) {\n return;\n }\n var item = spec.beginDrag(_this.props, _this.monitor, _this.ref.current);\n if (false) {}\n return item;\n };\n }\n SourceImpl.prototype.receiveProps = function (props) {\n this.props = props;\n };\n SourceImpl.prototype.canDrag = function () {\n if (!this.props) {\n return false;\n }\n if (!spec.canDrag) {\n return true;\n }\n return spec.canDrag(this.props, this.monitor);\n };\n SourceImpl.prototype.isDragging = function (globalMonitor, sourceId) {\n if (!this.props) {\n return false;\n }\n if (!spec.isDragging) {\n return sourceId === globalMonitor.getSourceId();\n }\n return spec.isDragging(this.props, this.monitor);\n };\n SourceImpl.prototype.endDrag = function () {\n if (!this.props) {\n return;\n }\n if (!spec.endDrag) {\n return;\n }\n spec.endDrag(this.props, this.monitor, this.ref.current);\n };\n return SourceImpl;\n }());\n return function createSource(monitor) {\n return new SourceImpl(monitor);\n };\n}\nexports.default = createSourceFactory;\n\n\n//# sourceURL=webpack://ReactDnD/./src/createSourceFactory.ts?");
/***/ }),
@@ -1721,7 +1733,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst wrapConnectorHooks_1 = __webpack_require__(/*! ./wrapConnectorHooks */ \"./src/wrapConnectorHooks.ts\");\nconst shallowEqual = __webpack_require__(/*! shallowequal */ \"./node_modules/shallowequal/index.js\");\nfunction createTargetConnector(backend) {\n let currentHandlerId;\n let currentDropTargetNode;\n let currentDropTargetOptions;\n let disconnectCurrentDropTarget;\n function reconnectDropTarget() {\n if (disconnectCurrentDropTarget) {\n disconnectCurrentDropTarget();\n disconnectCurrentDropTarget = undefined;\n }\n if (currentHandlerId && currentDropTargetNode) {\n disconnectCurrentDropTarget = backend.connectDropTarget(currentHandlerId, currentDropTargetNode, currentDropTargetOptions);\n }\n }\n function receiveHandlerId(handlerId) {\n if (handlerId === currentHandlerId) {\n return;\n }\n currentHandlerId = handlerId;\n reconnectDropTarget();\n }\n const hooks = wrapConnectorHooks_1.default({\n dropTarget: function connectDropTarget(node, options) {\n if (node === currentDropTargetNode &&\n shallowEqual(options, currentDropTargetOptions)) {\n return;\n }\n currentDropTargetNode = node;\n currentDropTargetOptions = options;\n reconnectDropTarget();\n },\n });\n return {\n receiveHandlerId,\n hooks,\n };\n}\nexports.default = createTargetConnector;\n\n\n//# sourceURL=webpack://ReactDnD/./src/createTargetConnector.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar wrapConnectorHooks_1 = __webpack_require__(/*! ./wrapConnectorHooks */ \"./src/wrapConnectorHooks.ts\");\nvar shallowEqual = __webpack_require__(/*! shallowequal */ \"./node_modules/shallowequal/index.js\");\nfunction createTargetConnector(backend) {\n var currentHandlerId;\n var currentDropTargetNode;\n var currentDropTargetOptions;\n var disconnectCurrentDropTarget;\n function reconnectDropTarget() {\n if (disconnectCurrentDropTarget) {\n disconnectCurrentDropTarget();\n disconnectCurrentDropTarget = undefined;\n }\n if (currentHandlerId && currentDropTargetNode) {\n disconnectCurrentDropTarget = backend.connectDropTarget(currentHandlerId, currentDropTargetNode, currentDropTargetOptions);\n }\n }\n function receiveHandlerId(handlerId) {\n if (handlerId === currentHandlerId) {\n return;\n }\n currentHandlerId = handlerId;\n reconnectDropTarget();\n }\n var hooks = wrapConnectorHooks_1.default({\n dropTarget: function connectDropTarget(node, options) {\n if (node === currentDropTargetNode &&\n shallowEqual(options, currentDropTargetOptions)) {\n return;\n }\n currentDropTargetNode = node;\n currentDropTargetOptions = options;\n reconnectDropTarget();\n },\n });\n return {\n receiveHandlerId: receiveHandlerId,\n hooks: hooks,\n };\n}\nexports.default = createTargetConnector;\n\n\n//# sourceURL=webpack://ReactDnD/./src/createTargetConnector.ts?");
/***/ }),
@@ -1733,31 +1745,163 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __webpack_require__(/*! react */ \"react\");\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nconst isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\nconst ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];\nfunction createTargetFactory(spec) {\n Object.keys(spec).forEach(key => {\n invariant(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' +\n 'some of the following keys: %s. ' +\n 'Instead received a specification with an unexpected \"%s\" key. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', ALLOWED_SPEC_METHODS.join(', '), key);\n invariant(typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' +\n 'Instead received a specification with %s: %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', key, key, spec[key]);\n });\n class TargetImpl {\n constructor(monitor) {\n this.monitor = monitor;\n this.props = null;\n this.ref = react_1.createRef();\n }\n receiveProps(props) {\n this.props = props;\n }\n receiveMonitor(monitor) {\n this.monitor = monitor;\n }\n canDrop() {\n if (!spec.canDrop) {\n return true;\n }\n return spec.canDrop(this.props, this.monitor);\n }\n hover() {\n if (!spec.hover) {\n return;\n }\n spec.hover(this.props, this.monitor, this.ref.current);\n }\n drop() {\n if (!spec.drop) {\n return undefined;\n }\n const dropResult = spec.drop(this.props, this.monitor, this.ref.current);\n if (false) {}\n return dropResult;\n }\n }\n return function createTarget(monitor) {\n return new TargetImpl(monitor);\n };\n}\nexports.default = createTargetFactory;\n\n\n//# sourceURL=webpack://ReactDnD/./src/createTargetFactory.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nvar isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\nvar ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];\nfunction createTargetFactory(spec) {\n Object.keys(spec).forEach(function (key) {\n invariant(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' +\n 'some of the following keys: %s. ' +\n 'Instead received a specification with an unexpected \"%s\" key. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', ALLOWED_SPEC_METHODS.join(', '), key);\n invariant(typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' +\n 'Instead received a specification with %s: %s. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', key, key, spec[key]);\n });\n var TargetImpl = /** @class */ (function () {\n function TargetImpl(monitor) {\n this.monitor = monitor;\n this.props = null;\n this.ref = react_1.createRef();\n }\n TargetImpl.prototype.receiveProps = function (props) {\n this.props = props;\n };\n TargetImpl.prototype.receiveMonitor = function (monitor) {\n this.monitor = monitor;\n };\n TargetImpl.prototype.canDrop = function () {\n if (!spec.canDrop) {\n return true;\n }\n return spec.canDrop(this.props, this.monitor);\n };\n TargetImpl.prototype.hover = function () {\n if (!spec.hover) {\n return;\n }\n spec.hover(this.props, this.monitor, this.ref.current);\n };\n TargetImpl.prototype.drop = function () {\n if (!spec.drop) {\n return undefined;\n }\n var dropResult = spec.drop(this.props, this.monitor, this.ref.current);\n if (false) {}\n return dropResult;\n };\n return TargetImpl;\n }());\n return function createTarget(monitor) {\n return new TargetImpl(monitor);\n };\n}\nexports.default = createTargetFactory;\n\n\n//# sourceURL=webpack://ReactDnD/./src/createTargetFactory.ts?");
+
+/***/ }),
+
+/***/ "./src/decorateHandler.tsx":
+/*!*********************************!*\
+ !*** ./src/decorateHandler.tsx ***!
+ \*********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __webpack_require__(/*! react */ \"react\");\nvar DragDropContext_1 = __webpack_require__(/*! ./DragDropContext */ \"./src/DragDropContext.tsx\");\nvar disposables_1 = __webpack_require__(/*! ./utils/disposables */ \"./src/utils/disposables/index.ts\");\nvar isClassComponent = __webpack_require__(/*! recompose/isClassComponent */ \"./node_modules/recompose/isClassComponent.js\").default;\nvar isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nvar hoistStatics = __webpack_require__(/*! hoist-non-react-statics */ \"./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js\");\nvar shallowEqual = __webpack_require__(/*! shallowequal */ \"./node_modules/shallowequal/index.js\");\nfunction decorateHandler(_a) {\n var DecoratedComponent = _a.DecoratedComponent, createHandler = _a.createHandler, createMonitor = _a.createMonitor, createConnector = _a.createConnector, registerHandler = _a.registerHandler, containerDisplayName = _a.containerDisplayName, getType = _a.getType, collect = _a.collect, options = _a.options;\n var _b = options.arePropsEqual, arePropsEqual = _b === void 0 ? shallowEqual : _b;\n var Decorated = DecoratedComponent;\n var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';\n var DragDropContainer = /** @class */ (function (_super) {\n __extends(DragDropContainer, _super);\n function DragDropContainer(props) {\n var _this = _super.call(this, props) || this;\n _this.handleChange = function () {\n var nextState = _this.getCurrentState();\n if (!shallowEqual(nextState, _this.state)) {\n _this.setState(nextState);\n }\n };\n _this.disposable = new disposables_1.SerialDisposable();\n _this.receiveProps(props);\n _this.dispose();\n return _this;\n }\n DragDropContainer.prototype.getHandlerId = function () {\n return this.handlerId;\n };\n DragDropContainer.prototype.getDecoratedComponentInstance = function () {\n if (!this.handler) {\n return null;\n }\n return this.handler.ref.current;\n };\n DragDropContainer.prototype.shouldComponentUpdate = function (nextProps, nextState) {\n return (!arePropsEqual(nextProps, this.props) ||\n !shallowEqual(nextState, this.state));\n };\n DragDropContainer.prototype.componentDidMount = function () {\n this.disposable = new disposables_1.SerialDisposable();\n this.currentType = undefined;\n this.receiveProps(this.props);\n this.handleChange();\n };\n DragDropContainer.prototype.componentDidUpdate = function (prevProps) {\n if (!arePropsEqual(this.props, prevProps)) {\n this.receiveProps(this.props);\n this.handleChange();\n }\n };\n DragDropContainer.prototype.componentWillUnmount = function () {\n this.dispose();\n };\n DragDropContainer.prototype.receiveProps = function (props) {\n if (!this.handler) {\n return;\n }\n this.handler.receiveProps(props);\n this.receiveType(getType(props));\n };\n DragDropContainer.prototype.receiveType = function (type) {\n if (!this.handlerMonitor || !this.manager || !this.handlerConnector) {\n return;\n }\n if (type === this.currentType) {\n return;\n }\n this.currentType = type;\n var _a = registerHandler(type, this.handler, this.manager), handlerId = _a.handlerId, unregister = _a.unregister;\n this.handlerId = handlerId;\n this.handlerMonitor.receiveHandlerId(handlerId);\n this.handlerConnector.receiveHandlerId(handlerId);\n var globalMonitor = this.manager.getMonitor();\n var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, { handlerIds: [handlerId] });\n this.disposable.setDisposable(new disposables_1.CompositeDisposable(new disposables_1.Disposable(unsubscribe), new disposables_1.Disposable(unregister)));\n };\n DragDropContainer.prototype.dispose = function () {\n this.disposable.dispose();\n if (this.handlerConnector) {\n this.handlerConnector.receiveHandlerId(null);\n }\n };\n DragDropContainer.prototype.getCurrentState = function () {\n if (!this.handlerConnector) {\n return {};\n }\n var nextState = collect(this.handlerConnector.hooks, this.handlerMonitor);\n if (false) {}\n return nextState;\n };\n DragDropContainer.prototype.render = function () {\n var _this = this;\n return (React.createElement(DragDropContext_1.Consumer, null, function (_a) {\n var dragDropManager = _a.dragDropManager;\n if (dragDropManager === undefined) {\n return null;\n }\n _this.receiveDragDropManager(dragDropManager);\n return (React.createElement(Decorated, __assign({}, _this.props, _this.getCurrentState(), { ref: _this.handler && isClassComponent(Decorated)\n ? _this.handler.ref\n : undefined })));\n }));\n };\n DragDropContainer.prototype.receiveDragDropManager = function (dragDropManager) {\n if (this.manager !== undefined) {\n return;\n }\n this.manager = dragDropManager;\n invariant(typeof dragDropManager === 'object', 'Could not find the drag and drop manager in the context of %s. ' +\n 'Make sure to wrap the top-level component of your app with DragDropContext. ' +\n '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);\n this.handlerMonitor = createMonitor(dragDropManager);\n this.handlerConnector = createConnector(dragDropManager.getBackend());\n this.handler = createHandler(this.handlerMonitor);\n };\n DragDropContainer.DecoratedComponent = DecoratedComponent;\n DragDropContainer.displayName = containerDisplayName + \"(\" + displayName + \")\";\n return DragDropContainer;\n }(React.Component));\n return hoistStatics(DragDropContainer, DecoratedComponent);\n}\nexports.default = decorateHandler;\n\n\n//# sourceURL=webpack://ReactDnD/./src/decorateHandler.tsx?");
+
+/***/ }),
+
+/***/ "./src/hooks/index.ts":
+/*!****************************!*\
+ !*** ./src/hooks/index.ts ***!
+ \****************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(__webpack_require__(/*! ./useDragSource */ \"./src/hooks/useDragSource.ts\"));\n__export(__webpack_require__(/*! ./useDropTarget */ \"./src/hooks/useDropTarget.ts\"));\n__export(__webpack_require__(/*! ./useDragLayer */ \"./src/hooks/useDragLayer.ts\"));\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/index.ts?");
+
+/***/ }),
+
+/***/ "./src/hooks/useCollector.ts":
+/*!***********************************!*\
+ !*** ./src/hooks/useCollector.ts ***!
+ \***********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar shallowEqual = __webpack_require__(/*! shallowequal */ \"./node_modules/shallowequal/index.js\");\nfunction useCollector(monitor, collect) {\n var _a = react_1.useState(function () { return collect(monitor); }), collected = _a[0], setCollected = _a[1];\n var updateCollected = function () {\n var nextValue = collect(monitor);\n // Not async-safe, but we need a way to opt-out of state updates\n if (!shallowEqual(collected, nextValue)) {\n setCollected(nextValue);\n }\n };\n return [collected, updateCollected];\n}\nexports.useCollector = useCollector;\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/useCollector.ts?");
+
+/***/ }),
+
+/***/ "./src/hooks/useDragDropManager.ts":
+/*!*****************************************!*\
+ !*** ./src/hooks/useDragDropManager.ts ***!
+ \*****************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar DragDropContext_1 = __webpack_require__(/*! ../DragDropContext */ \"./src/DragDropContext.tsx\");\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n/**\n * A hook to retrieve the DragDropManager from Context\n */\nfunction useDragDropManager() {\n var dragDropManager = react_1.useContext(DragDropContext_1.context).dragDropManager;\n invariant(dragDropManager != null, 'Expected drag drop context');\n return dragDropManager;\n}\nexports.useDragDropManager = useDragDropManager;\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/useDragDropManager.ts?");
+
+/***/ }),
+
+/***/ "./src/hooks/useDragLayer.ts":
+/*!***********************************!*\
+ !*** ./src/hooks/useDragLayer.ts ***!
+ \***********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar useDragDropManager_1 = __webpack_require__(/*! ./useDragDropManager */ \"./src/hooks/useDragDropManager.ts\");\nvar useCollector_1 = __webpack_require__(/*! ./useCollector */ \"./src/hooks/useCollector.ts\");\n/**\n * useDragLayer Hook (This API is experimental and subject to breaking changes in non-breaking versions)\n * @param collector The property collector\n */\nfunction useDragLayer(collect) {\n var dragDropManager = useDragDropManager_1.useDragDropManager();\n var monitor = dragDropManager.getMonitor();\n var _a = useCollector_1.useCollector(monitor, collect), collected = _a[0], updateCollected = _a[1];\n react_1.useEffect(function () { return monitor.subscribeToOffsetChange(updateCollected); });\n react_1.useEffect(function () { return monitor.subscribeToStateChange(updateCollected); });\n return collected;\n}\nexports.useDragLayer = useDragLayer;\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/useDragLayer.ts?");
+
+/***/ }),
+
+/***/ "./src/hooks/useDragSource.ts":
+/*!************************************!*\
+ !*** ./src/hooks/useDragSource.ts ***!
+ \************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar useDragSourceHandler_1 = __webpack_require__(/*! ./useDragSourceHandler */ \"./src/hooks/useDragSourceHandler.ts\");\nvar useDragDropManager_1 = __webpack_require__(/*! ./useDragDropManager */ \"./src/hooks/useDragDropManager.ts\");\nvar util_1 = __webpack_require__(/*! ./util */ \"./src/hooks/util.ts\");\nvar useMonitorOutput_1 = __webpack_require__(/*! ./useMonitorOutput */ \"./src/hooks/useMonitorOutput.ts\");\nvar useDragSourceMonitor_1 = __webpack_require__(/*! ./useDragSourceMonitor */ \"./src/hooks/useDragSourceMonitor.ts\");\n/**\n * useDragSource hook (This API is experimental and subject to breaking changes in non-major versions)\n * @param ref The drag source element\n * @param type The drag source type\n * @param sourceSpec The drag source specification *\n */\nfunction useDragSource(ref, type, sourceSpec) {\n var manager = useDragDropManager_1.useDragDropManager();\n var backend = manager.getBackend();\n var handler = useDragSourceHandler_1.useDragSourceHandler(sourceSpec);\n var sourceMonitor = useDragSourceMonitor_1.useDragSourceMonitor(type, handler, manager);\n /*\n * Connect the Drag Source Element to the Backend\n */\n react_1.useEffect(function connectDragSource() {\n var dragSourceNode = ref.current;\n var dragSourceOptions = sourceSpec.dragSourceOptions;\n return backend.connectDragSource(sourceMonitor.getHandlerId(), dragSourceNode, dragSourceOptions);\n }, []);\n /*\n * Connect the Drag Previem Element to the Backend\n */\n react_1.useEffect(function connectDragPreview() {\n if (sourceSpec.dragPreview == null) {\n return undefined;\n }\n var dragPreviewNode = util_1.isRef(sourceSpec.dragPreview)\n ? sourceSpec.dragPreview.current\n : sourceSpec.dragPreview;\n var dragPreviewOptions = sourceSpec.dragPreviewOptions;\n return backend.connectDragPreview(sourceMonitor.getHandlerId(), dragPreviewNode, dragPreviewOptions);\n }, []);\n var collector = sourceSpec.collect || (function () { return ({}); });\n return useMonitorOutput_1.useMonitorOutput(sourceMonitor, collector);\n}\nexports.useDragSource = useDragSource;\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/useDragSource.ts?");
+
+/***/ }),
+
+/***/ "./src/hooks/useDragSourceHandler.ts":
+/*!*******************************************!*\
+ !*** ./src/hooks/useDragSourceHandler.ts ***!
+ \*******************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nfunction useDragSourceHandler(sourceSpec) {\n var sourceSpecRef = react_1.useRef(sourceSpec);\n react_1.useEffect(function () {\n sourceSpecRef.current = sourceSpec;\n });\n // Can't use createSourceFactory, as semantics are different\n var handler = react_1.useMemo(function () {\n return ({\n beginDrag: function (monitor, target) {\n var beginDrag = sourceSpecRef.current.beginDrag;\n return beginDrag(monitor);\n },\n canDrag: function (monitor, target) {\n var canDrag = sourceSpecRef.current.canDrag;\n return canDrag ? canDrag(monitor) : true;\n },\n isDragging: function (monitor, target) {\n var isDragging = sourceSpecRef.current.isDragging;\n return isDragging\n ? isDragging(monitor)\n : target === monitor.getSourceId();\n },\n endDrag: function (monitor, target) {\n var endDrag = sourceSpecRef.current.endDrag;\n if (endDrag) {\n endDrag(monitor);\n }\n },\n });\n }, []);\n return handler;\n}\nexports.useDragSourceHandler = useDragSourceHandler;\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/useDragSourceHandler.ts?");
+
+/***/ }),
+
+/***/ "./src/hooks/useDragSourceMonitor.ts":
+/*!*******************************************!*\
+ !*** ./src/hooks/useDragSourceMonitor.ts ***!
+ \*******************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar registerSource_1 = __webpack_require__(/*! ../registerSource */ \"./src/registerSource.ts\");\nvar DragSourceMonitorImpl_1 = __webpack_require__(/*! ../DragSourceMonitorImpl */ \"./src/DragSourceMonitorImpl.ts\");\nfunction useDragSourceMonitor(type, source, manager) {\n var monitor = react_1.useMemo(function () { return new DragSourceMonitorImpl_1.default(manager); }, [manager]);\n react_1.useEffect(function registerSourceWithMonitor() {\n var _a = registerSource_1.default(type, source, manager), handlerId = _a.handlerId, unregister = _a.unregister;\n monitor.receiveHandlerId(handlerId);\n return unregister;\n }, [monitor]);\n return monitor;\n}\nexports.useDragSourceMonitor = useDragSourceMonitor;\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/useDragSourceMonitor.ts?");
/***/ }),
-/***/ "./src/createTargetMonitor.ts":
+/***/ "./src/hooks/useDropTarget.ts":
/*!************************************!*\
- !*** ./src/createTargetMonitor.ts ***!
+ !*** ./src/hooks/useDropTarget.ts ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nlet isCallingCanDrop = false;\nclass TargetMonitor {\n constructor(manager) {\n this.internalMonitor = manager.getMonitor();\n }\n receiveHandlerId(targetId) {\n this.targetId = targetId;\n }\n canDrop() {\n invariant(!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' +\n 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target-monitor.html');\n try {\n isCallingCanDrop = true;\n return this.internalMonitor.canDropOnTarget(this.targetId);\n }\n finally {\n isCallingCanDrop = false;\n }\n }\n isOver(options) {\n return this.internalMonitor.isOverTarget(this.targetId, options);\n }\n getItemType() {\n return this.internalMonitor.getItemType();\n }\n getItem() {\n return this.internalMonitor.getItem();\n }\n getDropResult() {\n return this.internalMonitor.getDropResult();\n }\n didDrop() {\n return this.internalMonitor.didDrop();\n }\n getInitialClientOffset() {\n return this.internalMonitor.getInitialClientOffset();\n }\n getInitialSourceClientOffset() {\n return this.internalMonitor.getInitialSourceClientOffset();\n }\n getSourceClientOffset() {\n return this.internalMonitor.getSourceClientOffset();\n }\n getClientOffset() {\n return this.internalMonitor.getClientOffset();\n }\n getDifferenceFromInitialOffset() {\n return this.internalMonitor.getDifferenceFromInitialOffset();\n }\n}\nexports.TargetMonitor = TargetMonitor;\nfunction createTargetMonitor(manager) {\n return new TargetMonitor(manager);\n}\nexports.default = createTargetMonitor;\n\n\n//# sourceURL=webpack://ReactDnD/./src/createTargetMonitor.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar useDragDropManager_1 = __webpack_require__(/*! ./useDragDropManager */ \"./src/hooks/useDragDropManager.ts\");\nvar useDropTargetHandler_1 = __webpack_require__(/*! ./useDropTargetHandler */ \"./src/hooks/useDropTargetHandler.ts\");\nvar useMonitorOutput_1 = __webpack_require__(/*! ./useMonitorOutput */ \"./src/hooks/useMonitorOutput.ts\");\nvar useDropTargetMonitor_1 = __webpack_require__(/*! ./useDropTargetMonitor */ \"./src/hooks/useDropTargetMonitor.ts\");\n/**\n * useDropTarget Hook (This API is experimental and subject to breaking changes in non-breaking versions)\n * @param ref The drop target's ref\n * @param type The drop target type\n * @param targetSpec The drop target specification\n */\nfunction useDropTarget(ref, type, targetSpec) {\n var manager = useDragDropManager_1.useDragDropManager();\n var backend = manager.getBackend();\n var handler = useDropTargetHandler_1.useDropTargetHandler(targetSpec);\n var targetMonitor = useDropTargetMonitor_1.useDropTargetMonitor(type, handler, manager);\n /*\n * Connect the Drop Target Element to the Backend\n */\n react_1.useEffect(function connectDropTarget() {\n var dropTargetNode = ref.current;\n if (dropTargetNode) {\n var dropTargetOptions = targetSpec.dropTargetOptions;\n return backend.connectDropTarget(targetMonitor.getHandlerId(), dropTargetNode, dropTargetOptions);\n }\n }, []);\n var collector = targetSpec.collect || (function () { return ({}); });\n return useMonitorOutput_1.useMonitorOutput(targetMonitor, collector);\n}\nexports.useDropTarget = useDropTarget;\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/useDropTarget.ts?");
/***/ }),
-/***/ "./src/decorateHandler.tsx":
-/*!*********************************!*\
- !*** ./src/decorateHandler.tsx ***!
- \*********************************/
+/***/ "./src/hooks/useDropTargetHandler.ts":
+/*!*******************************************!*\
+ !*** ./src/hooks/useDropTargetHandler.ts ***!
+ \*******************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __webpack_require__(/*! react */ \"react\");\nfunction useDropTargetHandler(targetSpec) {\n var targetSpecRef = React.useRef(targetSpec);\n React.useEffect(function updateDropTargetSpec() {\n targetSpecRef.current = targetSpec;\n });\n // Can't use createSourceFactory, as semantics are different\n var handler = React.useMemo(function () {\n return ({\n canDrop: function (monitor, targetId) {\n var canDrop = targetSpecRef.current.canDrop;\n return canDrop ? canDrop(monitor) : true;\n },\n hover: function (monitor, targetId) {\n var hover = targetSpecRef.current.hover;\n if (hover) {\n hover(monitor);\n }\n },\n drop: function (monitor, targetId) {\n var drop = targetSpecRef.current.drop;\n if (drop) {\n drop(monitor);\n }\n },\n });\n }, []);\n return handler;\n}\nexports.useDropTargetHandler = useDropTargetHandler;\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/useDropTargetHandler.ts?");
+
+/***/ }),
+
+/***/ "./src/hooks/useDropTargetMonitor.ts":
+/*!*******************************************!*\
+ !*** ./src/hooks/useDropTargetMonitor.ts ***!
+ \*******************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar registerTarget_1 = __webpack_require__(/*! ../registerTarget */ \"./src/registerTarget.ts\");\nvar DropTargetMonitorImpl_1 = __webpack_require__(/*! ../DropTargetMonitorImpl */ \"./src/DropTargetMonitorImpl.ts\");\nfunction useDropTargetMonitor(type, target, manager) {\n var monitor = react_1.useMemo(function () { return new DropTargetMonitorImpl_1.default(manager); }, [manager]);\n react_1.useEffect(function registerTargetWithMonitor() {\n var _a = registerTarget_1.default(type, target, manager), handlerId = _a.handlerId, unregister = _a.unregister;\n monitor.receiveHandlerId(handlerId);\n return unregister;\n }, [monitor]);\n return monitor;\n}\nexports.useDropTargetMonitor = useDropTargetMonitor;\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/useDropTargetMonitor.ts?");
+
+/***/ }),
+
+/***/ "./src/hooks/useMonitorOutput.ts":
+/*!***************************************!*\
+ !*** ./src/hooks/useMonitorOutput.ts ***!
+ \***************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar useCollector_1 = __webpack_require__(/*! ./useCollector */ \"./src/hooks/useCollector.ts\");\nfunction useMonitorOutput(monitor, collect) {\n var _a = useCollector_1.useCollector(monitor, collect), collected = _a[0], updateCollected = _a[1];\n // This runs on every render. There will be ways to optimise this, but for\n // now, this is the most correct thing to do.\n react_1.useEffect(function subscribeToMonitorStateChange() {\n var handlerId = monitor.getHandlerId();\n if (handlerId == null) {\n return undefined;\n }\n return monitor.subscribeToStateChange(updateCollected, {\n handlerIds: [handlerId],\n });\n });\n return collected;\n}\nexports.useMonitorOutput = useMonitorOutput;\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/useMonitorOutput.ts?");
+
+/***/ }),
+
+/***/ "./src/hooks/util.ts":
+/*!***************************!*\
+ !*** ./src/hooks/util.ts ***!
+ \***************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst React = __webpack_require__(/*! react */ \"react\");\nconst DragDropContext_1 = __webpack_require__(/*! ./DragDropContext */ \"./src/DragDropContext.tsx\");\nconst disposables_1 = __webpack_require__(/*! ./utils/disposables */ \"./src/utils/disposables/index.ts\");\nconst isClassComponent = __webpack_require__(/*! recompose/isClassComponent */ \"./node_modules/recompose/isClassComponent.js\").default;\nconst isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nconst hoistStatics = __webpack_require__(/*! hoist-non-react-statics */ \"./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js\");\nconst shallowEqual = __webpack_require__(/*! shallowequal */ \"./node_modules/shallowequal/index.js\");\nfunction decorateHandler({ DecoratedComponent, createHandler, createMonitor, createConnector, registerHandler, containerDisplayName, getType, collect, options, }) {\n const { arePropsEqual = shallowEqual } = options;\n const Decorated = DecoratedComponent;\n const displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';\n class DragDropContainer extends React.Component {\n constructor(props) {\n super(props);\n this.handleChange = () => {\n const nextState = this.getCurrentState();\n if (!shallowEqual(nextState, this.state)) {\n this.setState(nextState);\n }\n };\n this.disposable = new disposables_1.SerialDisposable();\n this.receiveProps(props);\n this.dispose();\n }\n getHandlerId() {\n return this.handlerId;\n }\n getDecoratedComponentInstance() {\n if (!this.handler) {\n return null;\n }\n return this.handler.ref.current;\n }\n shouldComponentUpdate(nextProps, nextState) {\n return (!arePropsEqual(nextProps, this.props) ||\n !shallowEqual(nextState, this.state));\n }\n componentDidMount() {\n this.disposable = new disposables_1.SerialDisposable();\n this.currentType = undefined;\n this.receiveProps(this.props);\n this.handleChange();\n }\n componentDidUpdate(prevProps) {\n if (!arePropsEqual(this.props, prevProps)) {\n this.receiveProps(this.props);\n this.handleChange();\n }\n }\n componentWillUnmount() {\n this.dispose();\n }\n receiveProps(props) {\n if (!this.handler) {\n return;\n }\n this.handler.receiveProps(props);\n this.receiveType(getType(props));\n }\n receiveType(type) {\n if (!this.handlerMonitor || !this.manager || !this.handlerConnector) {\n return;\n }\n if (type === this.currentType) {\n return;\n }\n this.currentType = type;\n const { handlerId, unregister } = registerHandler(type, this.handler, this.manager);\n this.handlerId = handlerId;\n this.handlerMonitor.receiveHandlerId(handlerId);\n this.handlerConnector.receiveHandlerId(handlerId);\n const globalMonitor = this.manager.getMonitor();\n const unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, { handlerIds: [handlerId] });\n this.disposable.setDisposable(new disposables_1.CompositeDisposable(new disposables_1.Disposable(unsubscribe), new disposables_1.Disposable(unregister)));\n }\n dispose() {\n this.disposable.dispose();\n if (this.handlerConnector) {\n this.handlerConnector.receiveHandlerId(null);\n }\n }\n getCurrentState() {\n if (!this.handlerConnector) {\n return {};\n }\n const nextState = collect(this.handlerConnector.hooks, this.handlerMonitor);\n if (false) {}\n return nextState;\n }\n render() {\n return (React.createElement(DragDropContext_1.Consumer, null, ({ dragDropManager }) => {\n if (dragDropManager === undefined) {\n return null;\n }\n this.receiveDragDropManager(dragDropManager);\n return (React.createElement(Decorated, Object.assign({}, this.props, this.getCurrentState(), { ref: this.handler && isClassComponent(Decorated)\n ? this.handler.ref\n : undefined })));\n }));\n }\n receiveDragDropManager(dragDropManager) {\n if (this.manager !== undefined) {\n return;\n }\n this.manager = dragDropManager;\n invariant(typeof dragDropManager === 'object', 'Could not find the drag and drop manager in the context of %s. ' +\n 'Make sure to wrap the top-level component of your app with DragDropContext. ' +\n '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);\n this.handlerMonitor = createMonitor(dragDropManager);\n this.handlerConnector = createConnector(dragDropManager.getBackend());\n this.handler = createHandler(this.handlerMonitor);\n }\n }\n DragDropContainer.DecoratedComponent = DecoratedComponent;\n DragDropContainer.displayName = `${containerDisplayName}(${displayName})`;\n return hoistStatics(DragDropContainer, DecoratedComponent);\n}\nexports.default = decorateHandler;\n\n\n//# sourceURL=webpack://ReactDnD/./src/decorateHandler.tsx?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isRef(obj) {\n if (obj !== null && typeof obj === 'object') {\n var keys = Object.keys(obj);\n return keys.length === 1 && keys[0] === 'current';\n }\n return false;\n}\nexports.isRef = isRef;\n\n\n//# sourceURL=webpack://ReactDnD/./src/hooks/util.ts?");
/***/ }),
@@ -1769,7 +1913,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DragDropContext_1 = __webpack_require__(/*! ./DragDropContext */ \"./src/DragDropContext.tsx\");\nexports.DragDropContext = DragDropContext_1.DragDropContext;\nexports.DragDropContextProvider = DragDropContext_1.DragDropContextProvider;\nexports.DragDropContextProviderProps = DragDropContext_1.DragDropContextProviderProps;\nvar DragLayer_1 = __webpack_require__(/*! ./DragLayer */ \"./src/DragLayer.tsx\");\nexports.DragLayer = DragLayer_1.default;\nvar DragSource_1 = __webpack_require__(/*! ./DragSource */ \"./src/DragSource.ts\");\nexports.DragSource = DragSource_1.default;\nvar DropTarget_1 = __webpack_require__(/*! ./DropTarget */ \"./src/DropTarget.ts\");\nexports.DropTarget = DropTarget_1.default;\n__export(__webpack_require__(/*! ./interfaces */ \"./src/interfaces.ts\"));\n\n\n//# sourceURL=webpack://ReactDnD/./src/index.ts?");
+eval("\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DragDropContext_1 = __webpack_require__(/*! ./DragDropContext */ \"./src/DragDropContext.tsx\");\nexports.DragDropContext = DragDropContext_1.DragDropContext;\nexports.DragDropContextProvider = DragDropContext_1.DragDropContextProvider;\nexports.DragDropContextProviderProps = DragDropContext_1.DragDropContextProviderProps;\nvar DragLayer_1 = __webpack_require__(/*! ./DragLayer */ \"./src/DragLayer.tsx\");\nexports.DragLayer = DragLayer_1.default;\nvar DragSource_1 = __webpack_require__(/*! ./DragSource */ \"./src/DragSource.ts\");\nexports.DragSource = DragSource_1.default;\nvar DropTarget_1 = __webpack_require__(/*! ./DropTarget */ \"./src/DropTarget.ts\");\nexports.DropTarget = DropTarget_1.default;\n__export(__webpack_require__(/*! ./hooks */ \"./src/hooks/index.ts\"));\n__export(__webpack_require__(/*! ./interfaces */ \"./src/interfaces.ts\"));\n\n\n//# sourceURL=webpack://ReactDnD/./src/index.ts?");
/***/ }),
@@ -1781,7 +1925,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst dnd_core_1 = __webpack_require__(/*! dnd-core */ \"../dnd-core/lib/cjs/index.js\");\nexports.XYCoord = dnd_core_1.XYCoord;\n\n\n//# sourceURL=webpack://ReactDnD/./src/interfaces.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar dnd_core_1 = __webpack_require__(/*! dnd-core */ \"../dnd-core/lib/cjs/index.js\");\nexports.XYCoord = dnd_core_1.XYCoord;\n\n\n//# sourceURL=webpack://ReactDnD/./src/interfaces.ts?");
/***/ }),
@@ -1793,7 +1937,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction registerSource(type, source, manager) {\n const registry = manager.getRegistry();\n const sourceId = registry.addSource(type, source);\n function unregisterSource() {\n registry.removeSource(sourceId);\n }\n return {\n handlerId: sourceId,\n unregister: unregisterSource,\n };\n}\nexports.default = registerSource;\n\n\n//# sourceURL=webpack://ReactDnD/./src/registerSource.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction registerSource(type, source, manager) {\n var registry = manager.getRegistry();\n var sourceId = registry.addSource(type, source);\n return {\n handlerId: sourceId,\n unregister: function () { return registry.removeSource(sourceId); },\n };\n}\nexports.default = registerSource;\n\n\n//# sourceURL=webpack://ReactDnD/./src/registerSource.ts?");
/***/ }),
@@ -1805,7 +1949,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction registerTarget(type, target, manager) {\n const registry = manager.getRegistry();\n const targetId = registry.addTarget(type, target);\n function unregisterTarget() {\n registry.removeTarget(targetId);\n }\n return {\n handlerId: targetId,\n unregister: unregisterTarget,\n };\n}\nexports.default = registerTarget;\n\n\n//# sourceURL=webpack://ReactDnD/./src/registerTarget.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction registerTarget(type, target, manager) {\n var registry = manager.getRegistry();\n var targetId = registry.addTarget(type, target);\n return {\n handlerId: targetId,\n unregister: function () { return registry.removeTarget(targetId); },\n };\n}\nexports.default = registerTarget;\n\n\n//# sourceURL=webpack://ReactDnD/./src/registerTarget.ts?");
/***/ }),
@@ -1817,7 +1961,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction checkDecoratorArguments(functionName, signature, ...args) {\n if (false) {}\n}\nexports.default = checkDecoratorArguments;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/checkDecoratorArguments.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction checkDecoratorArguments(functionName, signature) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (false) { var arg, _a, args_1; }\n}\nexports.default = checkDecoratorArguments;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/checkDecoratorArguments.ts?");
/***/ }),
@@ -1829,7 +1973,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __webpack_require__(/*! react */ \"react\");\nconst invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nfunction setRef(ref, node) {\n if (typeof ref === 'function') {\n ref(node);\n }\n else {\n ref.current = node;\n }\n}\nfunction cloneWithRef(element, newRef) {\n const previousRef = element.ref;\n invariant(typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' +\n 'Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. ' +\n 'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute');\n if (!previousRef) {\n // When there is no ref on the element, use the new ref directly\n return react_1.cloneElement(element, {\n ref: newRef,\n });\n }\n return react_1.cloneElement(element, {\n ref: (node) => {\n setRef(newRef, node);\n if (previousRef) {\n setRef(previousRef, node);\n }\n },\n });\n}\nexports.default = cloneWithRef;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/cloneWithRef.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar invariant = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\nfunction setRef(ref, node) {\n if (typeof ref === 'function') {\n ref(node);\n }\n else {\n ref.current = node;\n }\n}\nfunction cloneWithRef(element, newRef) {\n var previousRef = element.ref;\n invariant(typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' +\n 'Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. ' +\n 'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute');\n if (!previousRef) {\n // When there is no ref on the element, use the new ref directly\n return react_1.cloneElement(element, {\n ref: newRef,\n });\n }\n return react_1.cloneElement(element, {\n ref: function (node) {\n setRef(newRef, node);\n if (previousRef) {\n setRef(previousRef, node);\n }\n },\n });\n}\nexports.default = cloneWithRef;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/cloneWithRef.ts?");
/***/ }),
@@ -1841,7 +1985,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Represents a group of disposable resources that are disposed together.\n * @constructor\n */\nclass CompositeDisposable {\n constructor(...disposables) {\n this.isDisposed = false;\n this.disposables = disposables;\n }\n /**\n * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.\n * @param {Any} item Disposable to add.\n */\n add(item) {\n if (this.isDisposed) {\n item.dispose();\n }\n else {\n this.disposables.push(item);\n }\n }\n /**\n * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.\n * @param {Any} item Disposable to remove.\n * @returns {Boolean} true if found; false otherwise.\n */\n remove(item) {\n let shouldDispose = false;\n if (!this.isDisposed) {\n const idx = this.disposables.indexOf(item);\n if (idx !== -1) {\n shouldDispose = true;\n this.disposables.splice(idx, 1);\n item.dispose();\n }\n }\n return shouldDispose;\n }\n /**\n * Disposes all disposables in the group and removes them from the group but\n * does not dispose the CompositeDisposable.\n */\n clear() {\n if (!this.isDisposed) {\n const len = this.disposables.length;\n const currentDisposables = new Array(len);\n for (let i = 0; i < len; i++) {\n currentDisposables[i] = this.disposables[i];\n }\n this.disposables = [];\n for (let i = 0; i < len; i++) {\n currentDisposables[i].dispose();\n }\n }\n }\n /**\n * Disposes all disposables in the group and removes them from the group.\n */\n dispose() {\n if (!this.isDisposed) {\n this.isDisposed = true;\n const len = this.disposables.length;\n const currentDisposables = new Array(len);\n for (let i = 0; i < len; i++) {\n currentDisposables[i] = this.disposables[i];\n }\n this.disposables = [];\n for (let i = 0; i < len; i++) {\n currentDisposables[i].dispose();\n }\n }\n }\n}\nexports.CompositeDisposable = CompositeDisposable;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/disposables/CompositeDisposable.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Represents a group of disposable resources that are disposed together.\n * @constructor\n */\nvar CompositeDisposable = /** @class */ (function () {\n function CompositeDisposable() {\n var disposables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n disposables[_i] = arguments[_i];\n }\n this.isDisposed = false;\n this.disposables = disposables;\n }\n /**\n * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.\n * @param {Any} item Disposable to add.\n */\n CompositeDisposable.prototype.add = function (item) {\n if (this.isDisposed) {\n item.dispose();\n }\n else {\n this.disposables.push(item);\n }\n };\n /**\n * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.\n * @param {Any} item Disposable to remove.\n * @returns {Boolean} true if found; false otherwise.\n */\n CompositeDisposable.prototype.remove = function (item) {\n var shouldDispose = false;\n if (!this.isDisposed) {\n var idx = this.disposables.indexOf(item);\n if (idx !== -1) {\n shouldDispose = true;\n this.disposables.splice(idx, 1);\n item.dispose();\n }\n }\n return shouldDispose;\n };\n /**\n * Disposes all disposables in the group and removes them from the group but\n * does not dispose the CompositeDisposable.\n */\n CompositeDisposable.prototype.clear = function () {\n if (!this.isDisposed) {\n var len = this.disposables.length;\n var currentDisposables = new Array(len);\n for (var i = 0; i < len; i++) {\n currentDisposables[i] = this.disposables[i];\n }\n this.disposables = [];\n for (var i = 0; i < len; i++) {\n currentDisposables[i].dispose();\n }\n }\n };\n /**\n * Disposes all disposables in the group and removes them from the group.\n */\n CompositeDisposable.prototype.dispose = function () {\n if (!this.isDisposed) {\n this.isDisposed = true;\n var len = this.disposables.length;\n var currentDisposables = new Array(len);\n for (var i = 0; i < len; i++) {\n currentDisposables[i] = this.disposables[i];\n }\n this.disposables = [];\n for (var i = 0; i < len; i++) {\n currentDisposables[i].dispose();\n }\n }\n };\n return CompositeDisposable;\n}());\nexports.CompositeDisposable = CompositeDisposable;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/disposables/CompositeDisposable.ts?");
/***/ }),
@@ -1853,7 +1997,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst isFunction = __webpack_require__(/*! lodash/isFunction */ \"./node_modules/lodash/isFunction.js\");\nconst noop = __webpack_require__(/*! lodash/noop */ \"./node_modules/lodash/noop.js\");\n/**\n * Provides a set of static methods for creating Disposables.\n * @param {Function} action Action to run during the first call to dispose.\n * The action is guaranteed to be run at most once.\n */\nclass Disposable {\n constructor(action) {\n this.isDisposed = false;\n this.action = isFunction(action) ? action : noop;\n }\n /**\n * Validates whether the given object is a disposable\n * @param {Object} Object to test whether it has a dispose method\n * @returns {Boolean} true if a disposable object, else false.\n */\n static isDisposable(d) {\n return d && isFunction(d.dispose);\n }\n static _fixup(result) {\n return Disposable.isDisposable(result) ? result : Disposable.empty;\n }\n /**\n * Creates a disposable object that invokes the specified action when disposed.\n * @param {Function} dispose Action to run during the first call to dispose.\n * The action is guaranteed to be run at most once.\n * @return {Disposable} The disposable object that runs the given action upon disposal.\n */\n static create(action) {\n return new Disposable(action);\n }\n /** Performs the task of cleaning up resources. */\n dispose() {\n if (!this.isDisposed) {\n this.action();\n this.isDisposed = true;\n }\n }\n}\n/**\n * Gets the disposable that does nothing when disposed.\n */\nDisposable.empty = { dispose: noop };\nexports.Disposable = Disposable;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/disposables/Disposable.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar isFunction = __webpack_require__(/*! lodash/isFunction */ \"./node_modules/lodash/isFunction.js\");\nvar noop = __webpack_require__(/*! lodash/noop */ \"./node_modules/lodash/noop.js\");\n/**\n * Provides a set of static methods for creating Disposables.\n * @param {Function} action Action to run during the first call to dispose.\n * The action is guaranteed to be run at most once.\n */\nvar Disposable = /** @class */ (function () {\n function Disposable(action) {\n this.isDisposed = false;\n this.action = isFunction(action) ? action : noop;\n }\n /**\n * Validates whether the given object is a disposable\n * @param {Object} Object to test whether it has a dispose method\n * @returns {Boolean} true if a disposable object, else false.\n */\n Disposable.isDisposable = function (d) {\n return d && isFunction(d.dispose);\n };\n Disposable._fixup = function (result) {\n return Disposable.isDisposable(result) ? result : Disposable.empty;\n };\n /**\n * Creates a disposable object that invokes the specified action when disposed.\n * @param {Function} dispose Action to run during the first call to dispose.\n * The action is guaranteed to be run at most once.\n * @return {Disposable} The disposable object that runs the given action upon disposal.\n */\n Disposable.create = function (action) {\n return new Disposable(action);\n };\n /** Performs the task of cleaning up resources. */\n Disposable.prototype.dispose = function () {\n if (!this.isDisposed) {\n this.action();\n this.isDisposed = true;\n }\n };\n /**\n * Gets the disposable that does nothing when disposed.\n */\n Disposable.empty = { dispose: noop };\n return Disposable;\n}());\nexports.Disposable = Disposable;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/disposables/Disposable.ts?");
/***/ }),
@@ -1865,7 +2009,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Represents a disposable resource whose underlying disposable resource can\n * be replaced by another disposable resource, causing automatic disposal of\n * the previous underlying disposable resource.\n */\nclass SerialDisposable {\n constructor() {\n this.isDisposed = false;\n }\n /**\n * Gets the underlying disposable.\n * @returns {Any} the underlying disposable.\n */\n getDisposable() {\n return this.current;\n }\n setDisposable(value) {\n const shouldDispose = this.isDisposed;\n if (!shouldDispose) {\n const old = this.current;\n this.current = value;\n if (old) {\n old.dispose();\n }\n }\n if (shouldDispose && value) {\n value.dispose();\n }\n }\n /** Performs the task of cleaning up resources. */\n dispose() {\n if (!this.isDisposed) {\n this.isDisposed = true;\n const old = this.current;\n this.current = undefined;\n if (old) {\n old.dispose();\n }\n }\n }\n}\nexports.SerialDisposable = SerialDisposable;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/disposables/SerialDisposable.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Represents a disposable resource whose underlying disposable resource can\n * be replaced by another disposable resource, causing automatic disposal of\n * the previous underlying disposable resource.\n */\nvar SerialDisposable = /** @class */ (function () {\n function SerialDisposable() {\n this.isDisposed = false;\n }\n /**\n * Gets the underlying disposable.\n * @returns {Any} the underlying disposable.\n */\n SerialDisposable.prototype.getDisposable = function () {\n return this.current;\n };\n SerialDisposable.prototype.setDisposable = function (value) {\n var shouldDispose = this.isDisposed;\n if (!shouldDispose) {\n var old = this.current;\n this.current = value;\n if (old) {\n old.dispose();\n }\n }\n if (shouldDispose && value) {\n value.dispose();\n }\n };\n /** Performs the task of cleaning up resources. */\n SerialDisposable.prototype.dispose = function () {\n if (!this.isDisposed) {\n this.isDisposed = true;\n var old = this.current;\n this.current = undefined;\n if (old) {\n old.dispose();\n }\n }\n };\n return SerialDisposable;\n}());\nexports.SerialDisposable = SerialDisposable;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/disposables/SerialDisposable.ts?");
/***/ }),
@@ -1889,7 +2033,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isValidType(type, allowArray) {\n return (typeof type === 'string' ||\n typeof type === 'symbol' ||\n (!!allowArray &&\n Array.isArray(type) &&\n type.every(t => isValidType(t, false))));\n}\nexports.default = isValidType;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/isValidType.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isValidType(type, allowArray) {\n return (typeof type === 'string' ||\n typeof type === 'symbol' ||\n (!!allowArray &&\n Array.isArray(type) &&\n type.every(function (t) { return isValidType(t, false); })));\n}\nexports.default = isValidType;\n\n\n//# sourceURL=webpack://ReactDnD/./src/utils/isValidType.ts?");
/***/ }),
@@ -1901,7 +2045,7 @@
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = __webpack_require__(/*! react */ \"react\");\nconst cloneWithRef_1 = __webpack_require__(/*! ./utils/cloneWithRef */ \"./src/utils/cloneWithRef.ts\");\nfunction throwIfCompositeComponentElement(element) {\n // Custom components can no longer be wrapped directly in React DnD 2.0\n // so that we don't need to depend on findDOMNode() from react-dom.\n if (typeof element.type === 'string') {\n return;\n }\n const displayName = element.type.displayName || element.type.name || 'the component';\n throw new Error('Only native element nodes can now be passed to React DnD connectors.' +\n `You can either wrap ${displayName} into a <div>, or turn it into a ` +\n 'drag source or a drop target itself.');\n}\nfunction wrapHookToRecognizeElement(hook) {\n return (elementOrNode = null, options = null) => {\n // When passed a node, call the hook straight away.\n if (!react_1.isValidElement(elementOrNode)) {\n const node = elementOrNode;\n hook(node, options);\n return undefined;\n }\n // If passed a ReactElement, clone it and attach this function as a ref.\n // This helps us achieve a neat API where user doesn't even know that refs\n // are being used under the hood.\n const element = elementOrNode;\n throwIfCompositeComponentElement(element);\n // When no options are passed, use the hook directly\n const ref = options ? (node) => hook(node, options) : hook;\n return cloneWithRef_1.default(element, ref);\n };\n}\nfunction wrapConnectorHooks(hooks) {\n const wrappedHooks = {};\n Object.keys(hooks).forEach(key => {\n const hook = hooks[key];\n const wrappedHook = wrapHookToRecognizeElement(hook);\n wrappedHooks[key] = () => wrappedHook;\n });\n return wrappedHooks;\n}\nexports.default = wrapConnectorHooks;\n\n\n//# sourceURL=webpack://ReactDnD/./src/wrapConnectorHooks.ts?");
+eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar react_1 = __webpack_require__(/*! react */ \"react\");\nvar cloneWithRef_1 = __webpack_require__(/*! ./utils/cloneWithRef */ \"./src/utils/cloneWithRef.ts\");\nfunction throwIfCompositeComponentElement(element) {\n // Custom components can no longer be wrapped directly in React DnD 2.0\n // so that we don't need to depend on findDOMNode() from react-dom.\n if (typeof element.type === 'string') {\n return;\n }\n var displayName = element.type.displayName || element.type.name || 'the component';\n throw new Error('Only native element nodes can now be passed to React DnD connectors.' +\n (\"You can either wrap \" + displayName + \" into a <div>, or turn it into a \") +\n 'drag source or a drop target itself.');\n}\nfunction wrapHookToRecognizeElement(hook) {\n return function (elementOrNode, options) {\n if (elementOrNode === void 0) { elementOrNode = null; }\n if (options === void 0) { options = null; }\n // When passed a node, call the hook straight away.\n if (!react_1.isValidElement(elementOrNode)) {\n var node = elementOrNode;\n hook(node, options);\n return undefined;\n }\n // If passed a ReactElement, clone it and attach this function as a ref.\n // This helps us achieve a neat API where user doesn't even know that refs\n // are being used under the hood.\n var element = elementOrNode;\n throwIfCompositeComponentElement(element);\n // When no options are passed, use the hook directly\n var ref = options ? function (node) { return hook(node, options); } : hook;\n return cloneWithRef_1.default(element, ref);\n };\n}\nfunction wrapConnectorHooks(hooks) {\n var wrappedHooks = {};\n Object.keys(hooks).forEach(function (key) {\n var hook = hooks[key];\n var wrappedHook = wrapHookToRecognizeElement(hook);\n wrappedHooks[key] = function () { return wrappedHook; };\n });\n return wrappedHooks;\n}\nexports.default = wrapConnectorHooks;\n\n\n//# sourceURL=webpack://ReactDnD/./src/wrapConnectorHooks.ts?");
/***/ }),

dist/ReactDnD.min.js

@@ -1,4 +1,4 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactDnD=e(require("react")):t.ReactDnD=e(t.React)}(window,function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=47)}([function(t,e,r){"use strict";t.exports=function(t,e,r,n,o,i,s,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,o,i,s,a],f=0;(c=new Error(e.replace(/%s/g,function(){return u[f++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,r){e.exports=t},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.INIT_COORDS="dnd-core/INIT_COORDS",e.BEGIN_DRAG="dnd-core/BEGIN_DRAG",e.PUBLISH_DRAG_SOURCE="dnd-core/PUBLISH_DRAG_SOURCE",e.HOVER="dnd-core/HOVER",e.DROP="dnd-core/DROP",e.END_DRAG="dnd-core/END_DRAG"},function(t,e,r){var n=r(10),o=r(142),i=r(4),s="[object Object]",a=Function.prototype,c=Object.prototype,u=a.toString,f=c.hasOwnProperty,d=u.call(Object);t.exports=function(t){if(!i(t)||n(t)!=s)return!1;var e=o(t);if(null===e)return!0;var r=f.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==d}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(54),o=r(56),i=r(57),s=r(58),a=r(59);!function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(2)),e.default=function(t){return{beginDrag:n.default(t),publishDragSource:o.default(t),hover:i.default(t),drop:s.default(t),endDrag:a.default(t)}}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ADD_SOURCE="dnd-core/ADD_SOURCE",e.ADD_TARGET="dnd-core/ADD_TARGET",e.REMOVE_SOURCE="dnd-core/REMOVE_SOURCE",e.REMOVE_TARGET="dnd-core/REMOVE_TARGET",e.addSource=function(t){return{type:e.ADD_SOURCE,payload:{sourceId:t}}},e.addTarget=function(t){return{type:e.ADD_TARGET,payload:{targetId:t}}},e.removeSource=function(t){return{type:e.REMOVE_SOURCE,payload:{sourceId:t}}},e.removeTarget=function(t){return{type:e.REMOVE_TARGET,payload:{targetId:t}}}},function(t,e,r){var n=r(9)(Object,"create");t.exports=n},function(t,e,r){var n=r(65),o=r(72);t.exports=function(t,e){var r=o(t,e);return n(r)?r:void 0}},function(t,e,r){var n=r(11),o=r(67),i=r(68),s="[object Null]",a="[object Undefined]",c=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?a:s:c&&c in Object(t)?o(t):i(t)}},function(t,e,r){var n=r(12).Symbol;t.exports=n},function(t,e,r){var n=r(66),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,e,r){var n=r(80);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},function(t,e,r){var n=r(86);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,...r){}},function(t,e){t.exports=function(t,e,r,n){var o=r?r.call(n,t,e):void 0;if(void 0!==o)return!!o;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var i=Object.keys(t),s=Object.keys(e);if(i.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(e),c=0;c<i.length;c++){var u=i[c];if(!a(u))return!1;var f=t[u],d=e[u];if(!1===(o=r?r.call(n,f,d,u):void 0)||void 0===o&&f!==d)return!1}return!0}},function(t,e,r){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0});const o=r(1),i=r(32),s=r(17),a=r(0),c=r(29),u=r(30).default;function f(t,e,r){return{dragDropManager:i.createDragDropManager(t,e,r)}}n=o.createContext({dragDropManager:void 0}),e.Consumer=n.Consumer,e.Provider=n.Provider,e.createChildContext=f,e.DragDropContextProvider=(({backend:t,context:r,debugMode:n,children:i})=>{const s=f(t,r,n);return o.createElement(e.Provider,{value:s},i)}),e.DragDropContext=function(t,r,n){s.default("DragDropContext","backend",t);const i=f(t,r,n);return function(t){const r=t,n=r.displayName||r.name||"Component";class s extends o.Component{constructor(){super(...arguments),this.ref=o.createRef(),this.getManager=(()=>i.dragDropManager)}getDecoratedComponentInstance(){return a(this.ref.current,"In order to access an instance of the decorated component it can not be a stateless component."),this.ref.current}render(){return o.createElement(e.Provider,{value:i},o.createElement(r,Object.assign({},this.props,{ref:u(r)?this.ref:void 0})))}}return s.DecoratedComponent=t,s.displayName=`DragDropContext(${n})`,c(s,t)}}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(37),o=r(90),i=r(91);function s(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n;++e<r;)this.add(t[e])}s.prototype.add=s.prototype.push=o,s.prototype.has=i,t.exports=s},function(t,e,r){var n=r(10),o=r(6),i="[object AsyncFunction]",s="[object Function]",a="[object GeneratorFunction]",c="[object Proxy]";t.exports=function(t){if(!o(t))return!1;var e=n(t);return e==s||e==a||e==i||e==c}},function(t,e,r){var n=r(92);t.exports=function(t,e){return!(null==t||!t.length)&&n(t,e,0)>-1}},function(t,e){t.exports=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,r){var n=r(39),o=r(96),i=r(98);t.exports=function(t,e){return i(o(t,e,n),t+"")}},function(t,e,r){var n=r(103),o=r(4);t.exports=function(t){return o(t)&&n(t)}},function(t,e,r){var n=r(10),o=r(4),i="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||o(t)&&n(t)==i}},function(t,e,r){"use strict";var n=r(139),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(t){return n.isMemo(t)?s:a[t.$$typeof]||o}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var u=Object.defineProperty,f=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,l=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;t.exports=function t(e,r,n){if("string"!=typeof r){if(h){var o=p(r);o&&o!==h&&t(e,o,n)}var s=f(r);d&&(s=s.concat(d(r)));for(var a=c(e),g=c(r),y=0;y<s.length;++y){var v=s[y];if(!(i[v]||n&&n[v]||g&&g[v]||a&&a[v])){var b=l(r,v);try{u(e,v,b)}catch(t){}}}return e}return e}},function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var n=function(t){return Boolean(t&&t.prototype&&"function"==typeof t.prototype.render)};e.default=n},function(t,e,r){"use strict";(function(t,n){var o,i=r(46);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:n;var s=Object(i.a)(o);e.a=s}).call(this,r(20),r(51)(t))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(33)),n(r(48))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"}(e.HandlerRole||(e.HandlerRole={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return null===e?null===t:Array.isArray(t)?t.some(t=>t===e):t===e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.strictEquality=((t,e)=>t===e),e.areCoordsEqual=function(t,e){return!t&&!e||!(!t||!e)&&t.x===e.x&&t.y===e.y},e.areArraysEqual=function(t,r,n=e.strictEquality){if(t.length!==r.length)return!1;for(let e=0;e<t.length;++e)if(!n(t[e],r[e]))return!1;return!0}},function(t,e,r){var n=r(21),o=r(23),i=r(24),s=r(15),a=r(38),c=r(25),u=200;t.exports=function(t,e,r,f){var d=-1,l=o,p=!0,h=t.length,g=[],y=e.length;if(!h)return g;r&&(e=s(e,a(r))),f?(l=i,p=!1):e.length>=u&&(l=c,p=!1,e=new n(e));t:for(;++d<h;){var v=t[d],b=null==r?v:r(v);if(v=f||0!==v?v:0,p&&b==b){for(var m=y;m--;)if(e[m]===b)continue t;g.push(v)}else l(e,b,f)||g.push(v)}return g}},function(t,e,r){var n=r(62),o=r(85),i=r(87),s=r(88),a=r(89);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,t.exports=c},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e){t.exports=function(t){return t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(107);e.NONE=[],e.ALL=[],e.areDirty=function(t,r){return t!==e.NONE&&(t===e.ALL||void 0===r||n(r,t).length>0)}},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),o=r(19),i=r(145),s=r(30).default,a=(r(3),r(0)),c=r(29),u=r(18);e.default=function({DecoratedComponent:t,createHandler:e,createMonitor:r,createConnector:f,registerHandler:d,containerDisplayName:l,getType:p,collect:h,options:g}){const{arePropsEqual:y=u}=g,v=t,b=t.displayName||t.name||"Component";class m extends n.Component{constructor(t){super(t),this.handleChange=(()=>{const t=this.getCurrentState();u(t,this.state)||this.setState(t)}),this.disposable=new i.SerialDisposable,this.receiveProps(t),this.dispose()}getHandlerId(){return this.handlerId}getDecoratedComponentInstance(){return this.handler?this.handler.ref.current:null}shouldComponentUpdate(t,e){return!y(t,this.props)||!u(e,this.state)}componentDidMount(){this.disposable=new i.SerialDisposable,this.currentType=void 0,this.receiveProps(this.props),this.handleChange()}componentDidUpdate(t){y(this.props,t)||(this.receiveProps(this.props),this.handleChange())}componentWillUnmount(){this.dispose()}receiveProps(t){this.handler&&(this.handler.receiveProps(t),this.receiveType(p(t)))}receiveType(t){if(!this.handlerMonitor||!this.manager||!this.handlerConnector)return;if(t===this.currentType)return;this.currentType=t;const{handlerId:e,unregister:r}=d(t,this.handler,this.manager);this.handlerId=e,this.handlerMonitor.receiveHandlerId(e),this.handlerConnector.receiveHandlerId(e);const n=this.manager.getMonitor().subscribeToStateChange(this.handleChange,{handlerIds:[e]});this.disposable.setDisposable(new i.CompositeDisposable(new i.Disposable(n),new i.Disposable(r)))}dispose(){this.disposable.dispose(),this.handlerConnector&&this.handlerConnector.receiveHandlerId(null)}getCurrentState(){return this.handlerConnector?h(this.handlerConnector.hooks,this.handlerMonitor):{}}render(){return n.createElement(o.Consumer,null,({dragDropManager:t})=>void 0===t?null:(this.receiveDragDropManager(t),n.createElement(v,Object.assign({},this.props,this.getCurrentState(),{ref:this.handler&&s(v)?this.handler.ref:void 0}))))}receiveDragDropManager(t){void 0===this.manager&&(this.manager=t,a("object"==typeof t,"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",b,b),this.handlerMonitor=r(t),this.handlerConnector=f(t.getBackend()),this.handler=e(this.handlerMonitor))}}return m.DecoratedComponent=t,m.displayName=`${l}(${b})`,c(m,t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),o=r(153);function i(t){return(e=null,r=null)=>{if(!n.isValidElement(e)){return void t(e,r)}const i=e;!function(t){if("string"==typeof t.type)return;const e=t.type.displayName||t.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+`You can either wrap ${e} into a <div>, or turn it into a `+"drag source or a drop target itself.")}(i);const s=r?e=>t(e,r):t;return o.default(i,s)}}e.default=function(t){const e={};return Object.keys(t).forEach(r=>{const n=i(t[r]);e[r]=(()=>n)}),e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,r){return"string"==typeof e||"symbol"==typeof e||!!r&&Array.isArray(e)&&e.every(e=>t(e,!1))}},function(t,e,r){"use strict";function n(t){var e,r=t.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}r.d(e,"a",function(){return n})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(19);e.DragDropContext=n.DragDropContext,e.DragDropContextProvider=n.DragDropContextProvider,e.DragDropContextProviderProps=n.DragDropContextProviderProps;var o=r(141);e.DragLayer=o.default;var i=r(144);e.DragSource=i.default;var s=r(154);e.DropTarget=s.default,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(159))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(49);e.createDragDropManager=function(t,e,r){return new n.default(t,e,r)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(50),o=r(52),i=r(5),s=r(132),a=r(134);e.default=class{constructor(t,e={},r=!1){this.context=e,this.isSetUp=!1,this.handleRefCountChange=(()=>{const t=this.store.getState().refCount>0;t&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!t&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1)});const i=function(t){const e="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return n.createStore(o.default,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}(r);this.store=i,this.monitor=new s.default(i,new a.default(i)),this.backend=t(this),i.subscribe(this.handleRefCountChange)}getContext(){return this.context}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:e}=this.store,r=i.default(this);return Object.keys(r).reduce((n,o)=>{const i=r[o];return n[o]=function(r){return(...n)=>{const o=r.apply(t,n);void 0!==o&&e(o)}}(i),n},{})}dispatch(t){this.store.dispatch(t)}}},function(t,e,r){"use strict";r.r(e),r.d(e,"createStore",function(){return a}),r.d(e,"combineReducers",function(){return u}),r.d(e,"bindActionCreators",function(){return d}),r.d(e,"applyMiddleware",function(){return h}),r.d(e,"compose",function(){return p}),r.d(e,"__DO_NOT_USE__ActionTypes",function(){return i});var n=r(31),o=function(){return Math.random().toString(36).substring(7).split("").join(".")},i={INIT:"@@redux/INIT"+o(),REPLACE:"@@redux/REPLACE"+o(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+o()}};function s(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function a(t,e,r){var o;if("function"==typeof e&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function");if("function"==typeof e&&void 0===r&&(r=e,e=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(a)(t,e)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var c=t,u=e,f=[],d=f,l=!1;function p(){d===f&&(d=f.slice())}function h(){if(l)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return u}function g(t){if("function"!=typeof t)throw new Error("Expected the listener to be a function.");if(l)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var e=!0;return p(),d.push(t),function(){if(e){if(l)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");e=!1,p();var r=d.indexOf(t);d.splice(r,1)}}}function y(t){if(!s(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(l)throw new Error("Reducers may not dispatch actions.");try{l=!0,u=c(u,t)}finally{l=!1}for(var e=f=d,r=0;r<e.length;r++){(0,e[r])()}return t}return y({type:i.INIT}),(o={dispatch:y,subscribe:g,getState:h,replaceReducer:function(t){if("function"!=typeof t)throw new Error("Expected the nextReducer to be a function.");c=t,y({type:i.REPLACE})}})[n.a]=function(){var t,e=g;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new TypeError("Expected the observer to be an object.");function r(){t.next&&t.next(h())}return r(),{unsubscribe:e(r)}}})[n.a]=function(){return this},t},o}function c(t,e){var r=e&&e.type;return"Given "+(r&&'action "'+String(r)+'"'||"an action")+', reducer "'+t+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function u(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var o=e[n];0,"function"==typeof t[o]&&(r[o]=t[o])}var s,a=Object.keys(r);try{!function(t){Object.keys(t).forEach(function(e){var r=t[e];if(void 0===r(void 0,{type:i.INIT}))throw new Error('Reducer "'+e+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+e+"\" returned undefined when probed with a random type. Don't try to handle "+i.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(r)}catch(t){s=t}return function(t,e){if(void 0===t&&(t={}),s)throw s;for(var n=!1,o={},i=0;i<a.length;i++){var u=a[i],f=r[u],d=t[u],l=f(d,e);if(void 0===l){var p=c(u,e);throw new Error(p)}o[u]=l,n=n||l!==d}return n?o:t}}function f(t,e){return function(){return e(t.apply(this,arguments))}}function d(t,e){if("function"==typeof t)return f(t,e);if("object"!=typeof t||null===t)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===t?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var r=Object.keys(t),n={},o=0;o<r.length;o++){var i=r[o],s=t[i];"function"==typeof s&&(n[i]=f(s,e))}return n}function l(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce(function(t,e){return function(){return t(e.apply(void 0,arguments))}})}function h(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=e.map(function(t){return t(o)});return function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){l(t,e,r[e])})}return t}({},r,{dispatch:n=p.apply(void 0,i)(r.dispatch)})}}}},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(53),o=r(60),i=r(105),s=r(106),a=r(121),c=r(122);e.default=function(t={},e){return{dirtyHandlerIds:s.default(t.dirtyHandlerIds,{type:e.type,payload:Object.assign({},e.payload,{prevTargetIds:c(t,"dragOperation.targetIds",[])})}),dragOffset:n.default(t.dragOffset,e),refCount:i.default(t.refCount,e),dragOperation:o.default(t.dragOperation,e),stateId:a.default(t.stateId)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5),o=r(35),i={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};e.default=function(t=i,e){const{payload:r}=e;switch(e.type){case n.INIT_COORDS:case n.BEGIN_DRAG:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case n.HOVER:return o.areCoordsEqual(t.clientOffset,r.clientOffset)?t:Object.assign({},t,{clientOffset:r.clientOffset});case n.END_DRAG:case n.DROP:return i;default:return t}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(55),o=r(0),i=r(6),s=r(2),a={type:s.INIT_COORDS,payload:{clientOffset:null,sourceClientOffset:null}};e.default=function(t){return function(e=[],r={publishSource:!0}){const{publishSource:c=!0,clientOffset:u,getSourceClientOffset:f}=r,d=t.getMonitor(),l=t.getRegistry();t.dispatch(n.setClientOffset(u)),function(t,e,r){o(!e.isDragging(),"Cannot call beginDrag while dragging.");for(const e of t)o(r.getSource(e),"Expected sourceIds to be registered.")}(e,d,l);const p=function(t,e){let r=null;for(let n=t.length-1;n>=0;n--)if(e.canDragSource(t[n])){r=t[n];break}return r}(e,d);if(null===p)return void t.dispatch(a);let h=null;u&&(function(t){o("function"==typeof t,"When clientOffset is provided, getSourceClientOffset must be a function.")}(f),h=f(p)),t.dispatch(n.setClientOffset(u,h));const g=l.getSource(p).beginDrag(d,p);!function(t){o(i(t),"Item must be an object.")}(g),l.pinSource(p);const y=l.getSourceType(p);return{type:s.BEGIN_DRAG,payload:{itemType:y,item:g,sourceId:p,clientOffset:u||null,sourceClientOffset:h||null,isSourcePublic:!!c}}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.setClientOffset=function(t,e){return{type:n.INIT_COORDS,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.default=function(t){return function(){if(t.getMonitor().isDragging())return{type:n.PUBLISH_DRAG_SOURCE}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(34),o=r(2),i=r(0);e.default=function(t){return function(e,{clientOffset:r}={}){!function(t){i(Array.isArray(t),"Expected targetIds to be an array.")}(e);const s=e.slice(0),a=t.getMonitor(),c=t.getRegistry();return function(t,e,r){i(e.isDragging(),"Cannot call hover while not dragging."),i(!e.didDrop(),"Cannot call hover after drop.");for(let e=0;e<t.length;e++){const n=t[e];i(t.lastIndexOf(n)===e,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(n);i(o,"Expected targetIds to be registered.")}}(s,a,c),function(t,e,r){for(let o=t.length-1;o>=0;o--){const i=t[o],s=e.getTargetType(i);n.default(s,r)||t.splice(o,1)}}(s,c,a.getItemType()),function(t,e,r){for(const n of t){const t=r.getTarget(n);t.hover(e,n)}}(s,a,c),{type:o.HOVER,payload:{targetIds:s,clientOffset:r||null}}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2),o=r(0),i=r(6);e.default=function(t){return function(e={}){const r=t.getMonitor(),s=t.getRegistry();!function(t){o(t.isDragging(),"Cannot call drop while not dragging."),o(!t.didDrop(),"Cannot call drop twice during one drag operation.")}(r),function(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}(r).forEach((a,c)=>{const u=function(t,e,r,n){let s=r.getTarget(t).drop(n,t);return function(t){o(void 0===t||i(t),"Drop result must either be an object or undefined.")}(s),void 0===s&&(s=0===e?{}:n.getDropResult()),s}(a,c,s,r),f={type:n.DROP,payload:{dropResult:Object.assign({},e,u)}};t.dispatch(f)})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2),o=r(0);e.default=function(t){return function(){const e=t.getMonitor(),r=t.getRegistry();!function(t){o(t.isDragging(),"Cannot call endDrag while not dragging.")}(e);const i=e.getSourceId();return r.getSource(i,!0).endDrag(e,i),r.unpinSource(),{type:n.END_DRAG}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5),o=r(7),i=r(61),s={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};e.default=function(t=s,e){const{payload:r}=e;switch(e.type){case n.BEGIN_DRAG:return Object.assign({},t,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case n.PUBLISH_DRAG_SOURCE:return Object.assign({},t,{isSourcePublic:!0});case n.HOVER:return Object.assign({},t,{targetIds:r.targetIds});case o.REMOVE_TARGET:return-1===t.targetIds.indexOf(r.targetId)?t:Object.assign({},t,{targetIds:i(t.targetIds,r.targetId)});case n.DROP:return Object.assign({},t,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case n.END_DRAG:return Object.assign({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}},function(t,e,r){var n=r(36),o=r(26),i=r(27),s=o(function(t,e){return i(t)?n(t,e):[]});t.exports=s},function(t,e,r){var n=r(63),o=r(77),i=r(84);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},function(t,e,r){var n=r(64),o=r(73),i=r(74),s=r(75),a=r(76);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,t.exports=c},function(t,e,r){var n=r(8);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(t,e,r){var n=r(22),o=r(69),i=r(6),s=r(71),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,f=c.toString,d=u.hasOwnProperty,l=RegExp("^"+f.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(n(t)?l:a).test(s(t))}},function(t,e,r){(function(e){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(this,r(20))},function(t,e,r){var n=r(11),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),r=t[a];try{t[a]=void 0;var n=!0}catch(t){}var o=s.call(t);return n&&(e?t[a]=r:delete t[a]),o}},function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},function(t,e,r){var n,o=r(70),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!i&&i in t}},function(t,e,r){var n=r(12)["__core-js_shared__"];t.exports=n},function(t,e){var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,r){var n=r(8),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return r===o?void 0:r}return i.call(e,t)?e[t]:void 0}},function(t,e,r){var n=r(8),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:o.call(e,t)}},function(t,e,r){var n=r(8),o="__lodash_hash_undefined__";t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?o:e,this}},function(t,e,r){var n=r(78),o=r(79),i=r(81),s=r(82),a=r(83);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,t.exports=c},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,r){var n=r(13),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0||(r==e.length-1?e.pop():o.call(e,r,1),--this.size,0))}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,r){var n=r(13);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},function(t,e,r){var n=r(13);t.exports=function(t){return n(this.__data__,t)>-1}},function(t,e,r){var n=r(13);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},function(t,e,r){var n=r(9)(r(12),"Map");t.exports=n},function(t,e,r){var n=r(14);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,r){var n=r(14);t.exports=function(t){return n(this,t).get(t)}},function(t,e,r){var n=r(14);t.exports=function(t){return n(this,t).has(t)}},function(t,e,r){var n=r(14);t.exports=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}},function(t,e){var r="__lodash_hash_undefined__";t.exports=function(t){return this.__data__.set(t,r),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,r){var n=r(93),o=r(94),i=r(95);t.exports=function(t,e,r){return e==e?i(t,e,r):n(t,o,r)}},function(t,e){t.exports=function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}},function(t,e,r){var n=r(97),o=Math.max;t.exports=function(t,e,r){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,s=-1,a=o(i.length-e,0),c=Array(a);++s<a;)c[s]=i[e+s];s=-1;for(var u=Array(e+1);++s<e;)u[s]=i[s];return u[e]=r(c),n(t,this,u)}}},function(t,e){t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},function(t,e,r){var n=r(99),o=r(102)(n);t.exports=o},function(t,e,r){var n=r(100),o=r(101),i=r(39),s=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:i;t.exports=s},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e,r){var n=r(9),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e){var r=800,n=16,o=Date.now;t.exports=function(t){var e=0,i=0;return function(){var s=o(),a=n-(s-i);if(i=s,a>0){if(++e>=r)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,r){var n=r(22),o=r(104);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},function(t,e){var r=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7);e.default=function(t=0,e){switch(e.type){case n.ADD_SOURCE:case n.ADD_TARGET:return t+1;case n.REMOVE_SOURCE:case n.REMOVE_TARGET:return t-1;default:return t}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5),o=r(7),i=r(35),s=r(40),a=r(110);e.default=function(t=s.NONE,e){switch(e.type){case n.HOVER:break;case o.ADD_SOURCE:case o.ADD_TARGET:case o.REMOVE_TARGET:case o.REMOVE_SOURCE:return s.NONE;case n.BEGIN_DRAG:case n.PUBLISH_DRAG_SOURCE:case n.END_DRAG:case n.DROP:default:return s.ALL}const{targetIds:r=[],prevTargetIds:c=[]}=e.payload,u=a(r,c);if(!(u.length>0)&&i.areArraysEqual(r,c))return s.NONE;const f=c[c.length-1],d=r[r.length-1];return f!==d&&(f&&u.push(f),d&&u.push(d)),u}},function(t,e,r){var n=r(15),o=r(108),i=r(26),s=r(109),a=i(function(t){var e=n(t,s);return e.length&&e[0]===t[0]?o(e):[]});t.exports=a},function(t,e,r){var n=r(21),o=r(23),i=r(24),s=r(15),a=r(38),c=r(25),u=Math.min;t.exports=function(t,e,r){for(var f=r?i:o,d=t[0].length,l=t.length,p=l,h=Array(l),g=1/0,y=[];p--;){var v=t[p];p&&e&&(v=s(v,a(e))),g=u(v.length,g),h[p]=!r&&(e||d>=120&&v.length>=120)?new n(p&&v):void 0}v=t[0];var b=-1,m=h[0];t:for(;++b<d&&y.length<g;){var O=v[b],D=e?e(O):O;if(O=r||0!==O?O:0,!(m?c(m,D):f(y,D,r))){for(p=l;--p;){var _=h[p];if(!(_?c(_,D):f(t[p],D,r)))continue t}m&&m.push(D),y.push(O)}}return y}},function(t,e,r){var n=r(27);t.exports=function(t){return n(t)?t:[]}},function(t,e,r){var n=r(111),o=r(26),i=r(112),s=r(27),a=o(function(t){return i(n(t,s))});t.exports=a},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var s=t[r];e(s,r,t)&&(i[o++]=s)}return i}},function(t,e,r){var n=r(36),o=r(113),i=r(118);t.exports=function(t,e,r){var s=t.length;if(s<2)return s?i(t[0]):[];for(var a=-1,c=Array(s);++a<s;)for(var u=t[a],f=-1;++f<s;)f!=a&&(c[a]=n(c[a]||u,t[f],e,r));return i(o(c,1),e,r)}},function(t,e,r){var n=r(114),o=r(115);t.exports=function t(e,r,i,s,a){var c=-1,u=e.length;for(i||(i=o),a||(a=[]);++c<u;){var f=e[c];r>0&&i(f)?r>1?t(f,r-1,i,s,a):n(a,f):s||(a[a.length]=f)}return a}},function(t,e){t.exports=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}},function(t,e,r){var n=r(11),o=r(116),i=r(16),s=n?n.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(s&&t&&t[s])}},function(t,e,r){var n=r(117),o=r(4),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(t){return o(t)&&s.call(t,"callee")&&!a.call(t,"callee")};t.exports=c},function(t,e,r){var n=r(10),o=r(4),i="[object Arguments]";t.exports=function(t){return o(t)&&n(t)==i}},function(t,e,r){var n=r(21),o=r(23),i=r(24),s=r(25),a=r(119),c=r(42),u=200;t.exports=function(t,e,r){var f=-1,d=o,l=t.length,p=!0,h=[],g=h;if(r)p=!1,d=i;else if(l>=u){var y=e?null:a(t);if(y)return c(y);p=!1,d=s,g=new n}else g=e?[]:h;t:for(;++f<l;){var v=t[f],b=e?e(v):v;if(v=r||0!==v?v:0,p&&b==b){for(var m=g.length;m--;)if(g[m]===b)continue t;e&&g.push(b),h.push(v)}else d(g,b,r)||(g!==h&&g.push(b),h.push(v))}return h}},function(t,e,r){var n=r(120),o=r(41),i=r(42),s=n&&1/i(new n([,-0]))[1]==1/0?function(t){return new n(t)}:o;t.exports=s},function(t,e,r){var n=r(9)(r(12),"Set");t.exports=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t=0){return t+1}},function(t,e,r){var n=r(123);t.exports=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}},function(t,e,r){var n=r(124),o=r(131);t.exports=function(t,e){for(var r=0,i=(e=n(e,t)).length;null!=t&&r<i;)t=t[o(e[r++])];return r&&r==i?t:void 0}},function(t,e,r){var n=r(16),o=r(125),i=r(126),s=r(129);t.exports=function(t,e){return n(t)?t:o(t,e)?[t]:i(s(t))}},function(t,e,r){var n=r(16),o=r(28),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!o(t))||s.test(t)||!i.test(t)||null!=e&&t in Object(e)}},function(t,e,r){var n=r(127),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,s=n(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,function(t,r,n,o){e.push(n?o.replace(i,"$1"):r||t)}),e});t.exports=s},function(t,e,r){var n=r(128),o=500;t.exports=function(t){var e=n(t,function(t){return r.size===o&&r.clear(),t}),r=e.cache;return e}},function(t,e,r){var n=r(37),o="Expected a function";function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(o);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,n);return r.cache=i.set(o,s)||i,s};return r.cache=new(i.Cache||n),r}i.Cache=n,t.exports=i},function(t,e,r){var n=r(130);t.exports=function(t){return null==t?"":n(t)}},function(t,e,r){var n=r(11),o=r(15),i=r(16),s=r(28),a=1/0,c=n?n.prototype:void 0,u=c?c.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(s(e))return u?u.call(e):"";var r=e+"";return"0"==r&&1/e==-a?"-0":r}},function(t,e,r){var n=r(28),o=1/0;t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(34),o=r(133),i=r(40),s=r(0);e.default=class{constructor(t,e){this.store=t,this.registry=e}subscribeToStateChange(t,e={handlerIds:void 0}){const{handlerIds:r}=e;s("function"==typeof t,"listener must be a function."),s(void 0===r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let n=this.store.getState().stateId;return this.store.subscribe(()=>{const e=this.store.getState(),o=e.stateId;try{o===n||o===n+1&&!i.areDirty(e.dirtyHandlerIds,r)||t()}finally{n=o}})}subscribeToOffsetChange(t){s("function"==typeof t,"listener must be a function.");let e=this.store.getState().dragOffset;return this.store.subscribe(()=>{const r=this.store.getState().dragOffset;r!==e&&(e=r,t())})}canDragSource(t){const e=this.registry.getSource(t);return s(e,"Expected to find a valid source."),!this.isDragging()&&e.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const e=this.registry.getTarget(t);if(s(e,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(t),o=this.getItemType();return n.default(r,o)&&e.canDrop(this,t)}isDragging(){return Boolean(this.getItemType())}isDraggingSource(t){if(!t)return!1;const e=this.registry.getSource(t,!0);return s(e,"Expected to find a valid source."),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(t)===this.getItemType()&&e.isDragging(this,t)}isOverTarget(t,e={shallow:!1}){const{shallow:r}=e;if(!this.isDragging())return!1;const o=this.registry.getTargetType(t),i=this.getItemType();if(i&&!n.default(o,i))return!1;const s=this.getTargetIds();if(!s.length)return!1;const a=s.indexOf(t);return r?a===s.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return o.getSourceClientOffset(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return o.getDifferenceFromInitialOffset(this.store.getState().dragOffset)}}},function(t,e,r){"use strict";function n(t,e){return{x:t.x+e.x,y:t.y+e.y}}function o(t,e){return{x:t.x-e.x,y:t.y-e.y}}Object.defineProperty(e,"__esModule",{value:!0}),e.add=n,e.subtract=o,e.getSourceClientOffset=function(t){const{clientOffset:e,initialClientOffset:r,initialSourceClientOffset:i}=t;return e&&r&&i?o(n(e,i),r):null},e.getDifferenceFromInitialOffset=function(t){const{clientOffset:e,initialClientOffset:r}=t;return e&&r?o(e,r):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7),o=r(135),i=r(33),s=r(136),a=r(0),c=r(137);function u(t){switch(t[0]){case"S":return i.HandlerRole.SOURCE;case"T":return i.HandlerRole.TARGET;default:a(!1,`Cannot parse handler ID: ${t}`)}}function f(t,e){const r=t.entries();let n=!1;do{const{done:t,value:[,o]}=r.next();if(o===e)return!0;n=t}while(!n);return!1}e.default=class{constructor(t){this.store=t,this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null}addSource(t,e){s.validateType(t),s.validateSourceContract(e);const r=this.addHandler(i.HandlerRole.SOURCE,t,e);return this.store.dispatch(n.addSource(r)),r}addTarget(t,e){s.validateType(t,!0),s.validateTargetContract(e);const r=this.addHandler(i.HandlerRole.TARGET,t,e);return this.store.dispatch(n.addTarget(r)),r}containsHandler(t){return f(this.dragSources,t)||f(this.dropTargets,t)}getSource(t,e=!1){return a(this.isSourceId(t),"Expected a valid source ID."),e&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return a(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return a(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return a(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return u(t)===i.HandlerRole.SOURCE}isTargetId(t){return u(t)===i.HandlerRole.TARGET}removeSource(t){a(this.getSource(t),"Expected an existing source."),this.store.dispatch(n.removeSource(t)),c(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){a(this.getTarget(t),"Expected an existing target."),this.store.dispatch(n.removeTarget(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const e=this.getSource(t);a(e,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=e}unpinSource(){a(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,e,r){const n=function(t){const e=o.default().toString();switch(t){case i.HandlerRole.SOURCE:return`S${e}`;case i.HandlerRole.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}(t);return this.types.set(n,e),t===i.HandlerRole.SOURCE?this.dragSources.set(n,r):t===i.HandlerRole.TARGET&&this.dropTargets.set(n,r),n}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});let n=0;e.default=function(){return n++}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0);e.validateSourceContract=function(t){n("function"==typeof t.canDrag,"Expected canDrag to be a function."),n("function"==typeof t.beginDrag,"Expected beginDrag to be a function."),n("function"==typeof t.endDrag,"Expected endDrag to be a function.")},e.validateTargetContract=function(t){n("function"==typeof t.canDrop,"Expected canDrop to be a function."),n("function"==typeof t.hover,"Expected hover to be a function."),n("function"==typeof t.drop,"Expected beginDrag to be a function.")},e.validateType=function t(e,r){r&&Array.isArray(e)?e.forEach(e=>t(e,!1)):n("string"==typeof e||"symbol"==typeof e,r?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}},function(t,e,r){"use strict";var n=r(138),o=[],i=[],s=n.makeRequestCallFromTimer(function(){if(i.length)throw i.shift()});function a(t){var e;(e=o.length?o.pop():new c).task=t,n(e)}function c(){this.task=null}t.exports=a,c.prototype.call=function(){try{this.task.call()}catch(t){a.onerror?a.onerror(t):(i.push(t),s())}finally{this.task=null,o[o.length]=this}}},function(t,e,r){"use strict";(function(e){function r(t){o.length||(n(),!0),o[o.length]=t}t.exports=r;var n,o=[],i=0,s=1024;function a(){for(;i<o.length;){var t=i;if(i+=1,o[t].call(),i>s){for(var e=0,r=o.length-i;e<r;e++)o[e]=o[e+i];o.length-=i,i=0}}o.length=0,i=0,!1}var c,u,f,d=void 0!==e?e:self,l=d.MutationObserver||d.WebKitMutationObserver;function p(t){return function(){var e=setTimeout(n,0),r=setInterval(n,50);function n(){clearTimeout(e),clearInterval(r),t()}}}"function"==typeof l?(c=1,u=new l(a),f=document.createTextNode(""),u.observe(f,{characterData:!0}),n=function(){c=-c,f.data=c}):n=p(a),r.requestFlush=n,r.makeRequestCallFromTimer=p}).call(this,r(20))},function(t,e,r){"use strict";t.exports=r(140)},function(t,e,r){"use strict";
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactDnD=e(require("react")):t.ReactDnD=e(t.React)}(window,function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=54)}([function(t,e,r){"use strict";t.exports=function(t,e,r,n,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,i,a,u],f=0;(c=new Error(e.replace(/%s/g,function(){return s[f++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,r){e.exports=t},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.INIT_COORDS="dnd-core/INIT_COORDS",e.BEGIN_DRAG="dnd-core/BEGIN_DRAG",e.PUBLISH_DRAG_SOURCE="dnd-core/PUBLISH_DRAG_SOURCE",e.HOVER="dnd-core/HOVER",e.DROP="dnd-core/DROP",e.END_DRAG="dnd-core/END_DRAG"},function(t,e,r){var n=r(12),o=r(149),i=r(4),a="[object Object]",u=Function.prototype,c=Object.prototype,s=u.toString,f=c.hasOwnProperty,p=s.call(Object);t.exports=function(t){if(!i(t)||n(t)!=a)return!1;var e=o(t);if(null===e)return!0;var r=f.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&s.call(r)==p}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t,e,r,n){var o=r?r.call(n,t,e):void 0;if(void 0!==o)return!!o;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(var u=Object.prototype.hasOwnProperty.bind(e),c=0;c<i.length;c++){var s=i[c];if(!u(s))return!1;var f=t[s],p=e[s];if(!1===(o=r?r.call(n,f,p,s):void 0)||void 0===o&&f!==p)return!1}return!0}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var a=r(1),u=r(33),c=r(19),s=r(0),f=r(29),p=r(30).default;function d(t,e,r){return{dragDropManager:u.createDragDropManager(t,e,r)}}e.context=a.createContext({dragDropManager:void 0}),e.Consumer=e.context.Consumer,e.Provider=e.context.Provider,e.createChildContext=d,e.DragDropContextProvider=function(t){var r=t.backend,n=t.context,o=t.debugMode,i=t.children,u=d(r,n,o);return a.useEffect(function(){return function(){return u.dragDropManager.dispatch({type:"DragDropContextProvider::Exiting"})}}),a.createElement(e.Provider,{value:u},i)},e.DragDropContext=function(t,r,n){c.default("DragDropContext","backend",t);var u=d(t,r,n);return function(t){var r=t,n=r.displayName||r.name||"Component",c=function(c){function f(){var t=null!==c&&c.apply(this,arguments)||this;return t.ref=a.createRef(),t.getManager=function(){return u.dragDropManager},t}return o(f,c),f.prototype.getDecoratedComponentInstance=function(){return s(this.ref.current,"In order to access an instance of the decorated component it can not be a stateless component."),this.ref.current},f.prototype.render=function(){return a.createElement(e.Provider,{value:u},a.createElement(r,i({},this.props,{ref:p(r)?this.ref:void 0})))},f.DecoratedComponent=t,f.displayName="DragDropContext("+n+")",f}(a.Component);return f(c,t)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(61),o=r(63),i=r(64),a=r(65),u=r(66);!function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(2)),e.default=function(t){return{beginDrag:n.default(t),publishDragSource:o.default(t),hover:i.default(t),drop:a.default(t),endDrag:u.default(t)}}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ADD_SOURCE="dnd-core/ADD_SOURCE",e.ADD_TARGET="dnd-core/ADD_TARGET",e.REMOVE_SOURCE="dnd-core/REMOVE_SOURCE",e.REMOVE_TARGET="dnd-core/REMOVE_TARGET",e.addSource=function(t){return{type:e.ADD_SOURCE,payload:{sourceId:t}}},e.addTarget=function(t){return{type:e.ADD_TARGET,payload:{targetId:t}}},e.removeSource=function(t){return{type:e.REMOVE_SOURCE,payload:{sourceId:t}}},e.removeTarget=function(t){return{type:e.REMOVE_TARGET,payload:{targetId:t}}}},function(t,e,r){var n=r(11)(Object,"create");t.exports=n},function(t,e,r){var n=r(72),o=r(79);t.exports=function(t,e){var r=o(t,e);return n(r)?r:void 0}},function(t,e,r){var n=r(13),o=r(74),i=r(75),a="[object Null]",u="[object Undefined]",c=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?u:a:c&&c in Object(t)?o(t):i(t)}},function(t,e,r){var n=r(14).Symbol;t.exports=n},function(t,e,r){var n=r(73),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,e,r){var n=r(87);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},function(t,e,r){var n=r(93);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n]}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(38),o=r(97),i=r(98);function a(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n;++e<r;)this.add(t[e])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,t.exports=a},function(t,e,r){var n=r(12),o=r(8),i="[object AsyncFunction]",a="[object Function]",u="[object GeneratorFunction]",c="[object Proxy]";t.exports=function(t){if(!o(t))return!1;var e=n(t);return e==a||e==u||e==i||e==c}},function(t,e,r){var n=r(99);t.exports=function(t,e){return!(null==t||!t.length)&&n(t,e,0)>-1}},function(t,e){t.exports=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,r){var n=r(40),o=r(103),i=r(105);t.exports=function(t,e){return i(o(t,e,n),t+"")}},function(t,e,r){var n=r(110),o=r(4);t.exports=function(t){return o(t)&&n(t)}},function(t,e,r){var n=r(12),o=r(4),i="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||o(t)&&n(t)==i}},function(t,e,r){"use strict";var n=r(146),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};function c(t){return n.isMemo(t)?a:u[t.$$typeof]||o}u[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var s=Object.defineProperty,f=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,h=Object.prototype;t.exports=function t(e,r,n){if("string"!=typeof r){if(h){var o=l(r);o&&o!==h&&t(e,o,n)}var a=f(r);p&&(a=a.concat(p(r)));for(var u=c(e),g=c(r),v=0;v<a.length;++v){var y=a[v];if(!(i[y]||n&&n[y]||g&&g[y]||u&&u[y])){var b=d(r,y);try{s(e,y,b)}catch(t){}}}return e}return e}},function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var n=function(t){return Boolean(t&&t.prototype&&"function"==typeof t.prototype.render)};e.default=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(6),i=r(0);e.useDragDropManager=function(){var t=n.useContext(o.context).dragDropManager;return i(null!=t,"Expected drag drop context"),t}},function(t,e,r){"use strict";(function(t,n){var o,i=r(53);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:n;var a=Object(i.a)(o);e.a=a}).call(this,r(20),r(58)(t))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(34)),n(r(55))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"}(e.HandlerRole||(e.HandlerRole={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return null===e?null===t:Array.isArray(t)?t.some(function(t){return t===e}):t===e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.strictEquality=function(t,e){return t===e},e.areCoordsEqual=function(t,e){return!t&&!e||!(!t||!e)&&t.x===e.x&&t.y===e.y},e.areArraysEqual=function(t,r,n){if(void 0===n&&(n=e.strictEquality),t.length!==r.length)return!1;for(var o=0;o<t.length;++o)if(!n(t[o],r[o]))return!1;return!0}},function(t,e,r){var n=r(21),o=r(23),i=r(24),a=r(17),u=r(39),c=r(25),s=200;t.exports=function(t,e,r,f){var p=-1,d=o,l=!0,h=t.length,g=[],v=e.length;if(!h)return g;r&&(e=a(e,u(r))),f?(d=i,l=!1):e.length>=s&&(d=c,l=!1,e=new n(e));t:for(;++p<h;){var y=t[p],b=null==r?y:r(y);if(y=f||0!==y?y:0,l&&b==b){for(var O=v;O--;)if(e[O]===b)continue t;g.push(y)}else d(e,b,f)||g.push(y)}return g}},function(t,e,r){var n=r(69),o=r(92),i=r(94),a=r(95),u=r(96);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,t.exports=c},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e){t.exports=function(t){return t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(114);e.NONE=[],e.ALL=[],e.areDirty=function(t,r){return t!==e.NONE&&(t===e.ALL||void 0===r||n(r,t).length>0)}},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var a=r(1),u=r(6),c=r(152),s=r(30).default,f=(r(3),r(0)),p=r(29),d=r(5);e.default=function(t){var e=t.DecoratedComponent,r=t.createHandler,n=t.createMonitor,l=t.createConnector,h=t.registerHandler,g=t.containerDisplayName,v=t.getType,y=t.collect,b=t.options.arePropsEqual,O=void 0===b?d:b,m=e,_=e.displayName||e.name||"Component",D=function(t){function p(e){var r=t.call(this,e)||this;return r.handleChange=function(){var t=r.getCurrentState();d(t,r.state)||r.setState(t)},r.disposable=new c.SerialDisposable,r.receiveProps(e),r.dispose(),r}return o(p,t),p.prototype.getHandlerId=function(){return this.handlerId},p.prototype.getDecoratedComponentInstance=function(){return this.handler?this.handler.ref.current:null},p.prototype.shouldComponentUpdate=function(t,e){return!O(t,this.props)||!d(e,this.state)},p.prototype.componentDidMount=function(){this.disposable=new c.SerialDisposable,this.currentType=void 0,this.receiveProps(this.props),this.handleChange()},p.prototype.componentDidUpdate=function(t){O(this.props,t)||(this.receiveProps(this.props),this.handleChange())},p.prototype.componentWillUnmount=function(){this.dispose()},p.prototype.receiveProps=function(t){this.handler&&(this.handler.receiveProps(t),this.receiveType(v(t)))},p.prototype.receiveType=function(t){if(this.handlerMonitor&&this.manager&&this.handlerConnector&&t!==this.currentType){this.currentType=t;var e=h(t,this.handler,this.manager),r=e.handlerId,n=e.unregister;this.handlerId=r,this.handlerMonitor.receiveHandlerId(r),this.handlerConnector.receiveHandlerId(r);var o=this.manager.getMonitor().subscribeToStateChange(this.handleChange,{handlerIds:[r]});this.disposable.setDisposable(new c.CompositeDisposable(new c.Disposable(o),new c.Disposable(n)))}},p.prototype.dispose=function(){this.disposable.dispose(),this.handlerConnector&&this.handlerConnector.receiveHandlerId(null)},p.prototype.getCurrentState=function(){return this.handlerConnector?y(this.handlerConnector.hooks,this.handlerMonitor):{}},p.prototype.render=function(){var t=this;return a.createElement(u.Consumer,null,function(e){var r=e.dragDropManager;return void 0===r?null:(t.receiveDragDropManager(r),a.createElement(m,i({},t.props,t.getCurrentState(),{ref:t.handler&&s(m)?t.handler.ref:void 0})))})},p.prototype.receiveDragDropManager=function(t){void 0===this.manager&&(this.manager=t,f("object"==typeof t,"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",_,_),this.handlerMonitor=n(t),this.handlerConnector=l(t.getBackend()),this.handler=r(this.handlerMonitor))},p.DecoratedComponent=e,p.displayName=g+"("+_+")",p}(a.Component);return p(D,e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){var n=r.getRegistry(),o=n.addSource(t,e);return{handlerId:o,unregister:function(){return n.removeSource(o)}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),o=!1,i=!1,a=function(){function t(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}return t.prototype.receiveHandlerId=function(t){this.sourceId=t},t.prototype.getHandlerId=function(){return this.sourceId},t.prototype.canDrag=function(){n(!o,"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{return o=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{o=!1}},t.prototype.isDragging=function(){n(!i,"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{return i=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{i=!1}},t.prototype.subscribeToStateChange=function(t,e){return this.internalMonitor.subscribeToStateChange(t,e)},t.prototype.isDraggingSource=function(t){return this.internalMonitor.isDraggingSource(t)},t.prototype.isOverTarget=function(t,e){return this.internalMonitor.isOverTarget(t,e)},t.prototype.getTargetIds=function(){return this.internalMonitor.getTargetIds()},t.prototype.isSourcePublic=function(){return this.internalMonitor.isSourcePublic()},t.prototype.getSourceId=function(){return this.internalMonitor.getSourceId()},t.prototype.subscribeToOffsetChange=function(t){return this.internalMonitor.subscribeToOffsetChange(t)},t.prototype.canDragSource=function(t){return this.internalMonitor.canDragSource(t)},t.prototype.canDropOnTarget=function(t){return this.internalMonitor.canDropOnTarget(t)},t.prototype.getItemType=function(){return this.internalMonitor.getItemType()},t.prototype.getItem=function(){return this.internalMonitor.getItem()},t.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},t.prototype.didDrop=function(){return this.internalMonitor.didDrop()},t.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},t.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},t.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},t.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},t.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},t}();e.default=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(158);function i(t){return function(e,r){if(void 0===e&&(e=null),void 0===r&&(r=null),n.isValidElement(e)){var i=e;!function(t){if("string"!=typeof t.type){var e=t.type.displayName||t.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors.You can either wrap "+e+" into a <div>, or turn it into a drag source or a drop target itself.")}}(i);var a=r?function(e){return t(e,r)}:t;return o.default(i,a)}t(e,r)}}e.default=function(t){var e={};return Object.keys(t).forEach(function(r){var n=i(t[r]);e[r]=function(){return n}}),e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,r){return"string"==typeof e||"symbol"==typeof e||!!r&&Array.isArray(e)&&e.every(function(e){return t(e,!1)})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){var n=r.getRegistry(),o=n.addTarget(t,e);return{handlerId:o,unregister:function(){return n.removeTarget(o)}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),o=!1,i=function(){function t(t){this.targetId=null,this.internalMonitor=t.getMonitor()}return t.prototype.receiveHandlerId=function(t){this.targetId=t},t.prototype.getHandlerId=function(){return this.targetId},t.prototype.subscribeToStateChange=function(t,e){return this.internalMonitor.subscribeToStateChange(t,e)},t.prototype.canDrop=function(){n(!o,"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{return o=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{o=!1}},t.prototype.isOver=function(t){return this.internalMonitor.isOverTarget(this.targetId,t)},t.prototype.getItemType=function(){return this.internalMonitor.getItemType()},t.prototype.getItem=function(){return this.internalMonitor.getItem()},t.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},t.prototype.didDrop=function(){return this.internalMonitor.didDrop()},t.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},t.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},t.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},t.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},t.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},t}();e.default=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(52);e.useMonitorOutput=function(t,e){var r=o.useCollector(t,e),i=r[0],a=r[1];return n.useEffect(function(){var e=t.getHandlerId();if(null!=e)return t.subscribeToStateChange(a,{handlerIds:[e]})}),i}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(5);e.useCollector=function(t,e){var r=n.useState(function(){return e(t)}),i=r[0],a=r[1];return[i,function(){var r=e(t);o(i,r)||a(r)}]}},function(t,e,r){"use strict";function n(t){var e,r=t.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}r.d(e,"a",function(){return n})},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0});var o=r(6);e.DragDropContext=o.DragDropContext,e.DragDropContextProvider=o.DragDropContextProvider,e.DragDropContextProviderProps=o.DragDropContextProviderProps;var i=r(148);e.DragLayer=i.default;var a=r(151);e.DragSource=a.default;var u=r(159);e.DropTarget=u.default,n(r(162)),n(r(171))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(56);e.createDragDropManager=function(t,e,r){return new n.default(t,e,r)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(57),o=r(59),i=r(7),a=r(139),u=r(141);var c=function(){function t(t,e,r){void 0===e&&(e={}),void 0===r&&(r=!1);var i=this;this.context=e,this.isSetUp=!1,this.handleRefCountChange=function(){var t=i.store.getState().refCount>0;t&&!i.isSetUp?(i.backend.setup(),i.isSetUp=!0):!t&&i.isSetUp&&(i.backend.teardown(),i.isSetUp=!1)};var c=function(t){var e="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return n.createStore(o.default,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}(r);this.store=c,this.monitor=new a.default(c,new u.default(c)),this.backend=t(this),c.subscribe(this.handleRefCountChange)}return t.prototype.getContext=function(){return this.context},t.prototype.getMonitor=function(){return this.monitor},t.prototype.getBackend=function(){return this.backend},t.prototype.getRegistry=function(){return this.monitor.registry},t.prototype.getActions=function(){var t=this,e=this.store.dispatch;var r=i.default(this);return Object.keys(r).reduce(function(n,o){var i,a=r[o];return n[o]=(i=a,function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=i.apply(t,r);void 0!==o&&e(o)}),n},{})},t.prototype.dispatch=function(t){this.store.dispatch(t)},t}();e.default=c},function(t,e,r){"use strict";r.r(e),r.d(e,"createStore",function(){return u}),r.d(e,"combineReducers",function(){return s}),r.d(e,"bindActionCreators",function(){return p}),r.d(e,"applyMiddleware",function(){return h}),r.d(e,"compose",function(){return l}),r.d(e,"__DO_NOT_USE__ActionTypes",function(){return i});var n=r(32),o=function(){return Math.random().toString(36).substring(7).split("").join(".")},i={INIT:"@@redux/INIT"+o(),REPLACE:"@@redux/REPLACE"+o(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+o()}};function a(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function u(t,e,r){var o;if("function"==typeof e&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function");if("function"==typeof e&&void 0===r&&(r=e,e=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(u)(t,e)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var c=t,s=e,f=[],p=f,d=!1;function l(){p===f&&(p=f.slice())}function h(){if(d)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function g(t){if("function"!=typeof t)throw new Error("Expected the listener to be a function.");if(d)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var e=!0;return l(),p.push(t),function(){if(e){if(d)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");e=!1,l();var r=p.indexOf(t);p.splice(r,1)}}}function v(t){if(!a(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,s=c(s,t)}finally{d=!1}for(var e=f=p,r=0;r<e.length;r++){(0,e[r])()}return t}return v({type:i.INIT}),(o={dispatch:v,subscribe:g,getState:h,replaceReducer:function(t){if("function"!=typeof t)throw new Error("Expected the nextReducer to be a function.");c=t,v({type:i.REPLACE})}})[n.a]=function(){var t,e=g;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new TypeError("Expected the observer to be an object.");function r(){t.next&&t.next(h())}return r(),{unsubscribe:e(r)}}})[n.a]=function(){return this},t},o}function c(t,e){var r=e&&e.type;return"Given "+(r&&'action "'+String(r)+'"'||"an action")+', reducer "'+t+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function s(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var o=e[n];0,"function"==typeof t[o]&&(r[o]=t[o])}var a,u=Object.keys(r);try{!function(t){Object.keys(t).forEach(function(e){var r=t[e];if(void 0===r(void 0,{type:i.INIT}))throw new Error('Reducer "'+e+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+e+"\" returned undefined when probed with a random type. Don't try to handle "+i.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(r)}catch(t){a=t}return function(t,e){if(void 0===t&&(t={}),a)throw a;for(var n=!1,o={},i=0;i<u.length;i++){var s=u[i],f=r[s],p=t[s],d=f(p,e);if(void 0===d){var l=c(s,e);throw new Error(l)}o[s]=d,n=n||d!==p}return n?o:t}}function f(t,e){return function(){return e(t.apply(this,arguments))}}function p(t,e){if("function"==typeof t)return f(t,e);if("object"!=typeof t||null===t)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===t?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var r=Object.keys(t),n={},o=0;o<r.length;o++){var i=r[o],a=t[i];"function"==typeof a&&(n[i]=f(a,e))}return n}function d(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce(function(t,e){return function(){return t(e.apply(void 0,arguments))}})}function h(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=e.map(function(t){return t(o)});return function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){d(t,e,r[e])})}return t}({},r,{dispatch:n=l.apply(void 0,i)(r.dispatch)})}}}},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=r(60),i=r(67),a=r(112),u=r(113),c=r(128),s=r(129);e.default=function(t,e){return void 0===t&&(t={}),{dirtyHandlerIds:u.default(t.dirtyHandlerIds,{type:e.type,payload:n({},e.payload,{prevTargetIds:s(t,"dragOperation.targetIds",[])})}),dragOffset:o.default(t.dragOffset,e),refCount:a.default(t.refCount,e),dragOperation:i.default(t.dragOperation,e),stateId:c.default(t.stateId)}}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=r(7),i=r(36),a={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};e.default=function(t,e){void 0===t&&(t=a);var r=e.payload;switch(e.type){case o.INIT_COORDS:case o.BEGIN_DRAG:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case o.HOVER:return i.areCoordsEqual(t.clientOffset,r.clientOffset)?t:n({},t,{clientOffset:r.clientOffset});case o.END_DRAG:case o.DROP:return a;default:return t}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(62),o=r(0),i=r(8),a=r(2),u={type:a.INIT_COORDS,payload:{clientOffset:null,sourceClientOffset:null}};e.default=function(t){return function(e,r){void 0===e&&(e=[]),void 0===r&&(r={publishSource:!0});var c=r.publishSource,s=void 0===c||c,f=r.clientOffset,p=r.getSourceClientOffset,d=t.getMonitor(),l=t.getRegistry();t.dispatch(n.setClientOffset(f)),function(t,e,r){o(!e.isDragging(),"Cannot call beginDrag while dragging.");for(var n=0,i=t;n<i.length;n++){var a=i[n];o(r.getSource(a),"Expected sourceIds to be registered.")}}(e,d,l);var h=function(t,e){for(var r=null,n=t.length-1;n>=0;n--)if(e.canDragSource(t[n])){r=t[n];break}return r}(e,d);if(null!==h){var g=null;f&&(function(t){o("function"==typeof t,"When clientOffset is provided, getSourceClientOffset must be a function.")}(p),g=p(h)),t.dispatch(n.setClientOffset(f,g));var v=l.getSource(h).beginDrag(d,h);!function(t){o(i(t),"Item must be an object.")}(v),l.pinSource(h);var y=l.getSourceType(h);return{type:a.BEGIN_DRAG,payload:{itemType:y,item:v,sourceId:h,clientOffset:f||null,sourceClientOffset:g||null,isSourcePublic:!!s}}}t.dispatch(u)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2);e.setClientOffset=function(t,e){return{type:n.INIT_COORDS,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2);e.default=function(t){return function(){if(t.getMonitor().isDragging())return{type:n.PUBLISH_DRAG_SOURCE}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),o=r(2),i=r(0);e.default=function(t){return function(e,r){var a=(void 0===r?{}:r).clientOffset;!function(t){i(Array.isArray(t),"Expected targetIds to be an array.")}(e);var u=e.slice(0),c=t.getMonitor(),s=t.getRegistry();return function(t,e,r){i(e.isDragging(),"Cannot call hover while not dragging."),i(!e.didDrop(),"Cannot call hover after drop.");for(var n=0;n<t.length;n++){var o=t[n];i(t.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array.");var a=r.getTarget(o);i(a,"Expected targetIds to be registered.")}}(u,c,s),function(t,e,r){for(var o=t.length-1;o>=0;o--){var i=t[o],a=e.getTargetType(i);n.default(a,r)||t.splice(o,1)}}(u,s,c.getItemType()),function(t,e,r){for(var n=0,o=t;n<o.length;n++){var i=o[n],a=r.getTarget(i);a.hover(e,i)}}(u,c,s),{type:o.HOVER,payload:{targetIds:u,clientOffset:a||null}}}}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=r(2),i=r(0),a=r(8);e.default=function(t){return function(e){void 0===e&&(e={});var r=t.getMonitor(),u=t.getRegistry();!function(t){i(t.isDragging(),"Cannot call drop while not dragging."),i(!t.didDrop(),"Cannot call drop twice during one drag operation.")}(r),function(t){var e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}(r).forEach(function(c,s){var f=function(t,e,r,n){var o=r.getTarget(t).drop(n,t);return function(t){i(void 0===t||a(t),"Drop result must either be an object or undefined.")}(o),void 0===o&&(o=0===e?{}:n.getDropResult()),o}(c,s,u,r),p={type:o.DROP,payload:{dropResult:n({},e,f)}};t.dispatch(p)})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2),o=r(0);e.default=function(t){return function(){var e=t.getMonitor(),r=t.getRegistry();!function(t){o(t.isDragging(),"Cannot call endDrag while not dragging.")}(e);var i=e.getSourceId();return r.getSource(i,!0).endDrag(e,i),r.unpinSource(),{type:n.END_DRAG}}}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=r(7),i=r(9),a=r(68),u={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};e.default=function(t,e){void 0===t&&(t=u);var r=e.payload;switch(e.type){case o.BEGIN_DRAG:return n({},t,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case o.PUBLISH_DRAG_SOURCE:return n({},t,{isSourcePublic:!0});case o.HOVER:return n({},t,{targetIds:r.targetIds});case i.REMOVE_TARGET:return-1===t.targetIds.indexOf(r.targetId)?t:n({},t,{targetIds:a(t.targetIds,r.targetId)});case o.DROP:return n({},t,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case o.END_DRAG:return n({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}},function(t,e,r){var n=r(37),o=r(26),i=r(27),a=o(function(t,e){return i(t)?n(t,e):[]});t.exports=a},function(t,e,r){var n=r(70),o=r(84),i=r(91);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},function(t,e,r){var n=r(71),o=r(80),i=r(81),a=r(82),u=r(83);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,t.exports=c},function(t,e,r){var n=r(10);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(t,e,r){var n=r(22),o=r(76),i=r(8),a=r(78),u=/^\[object .+?Constructor\]$/,c=Function.prototype,s=Object.prototype,f=c.toString,p=s.hasOwnProperty,d=RegExp("^"+f.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(n(t)?d:u).test(a(t))}},function(t,e,r){(function(e){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(this,r(20))},function(t,e,r){var n=r(13),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,u),r=t[u];try{t[u]=void 0;var n=!0}catch(t){}var o=a.call(t);return n&&(e?t[u]=r:delete t[u]),o}},function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},function(t,e,r){var n,o=r(77),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!i&&i in t}},function(t,e,r){var n=r(14)["__core-js_shared__"];t.exports=n},function(t,e){var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,r){var n=r(10),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return r===o?void 0:r}return i.call(e,t)?e[t]:void 0}},function(t,e,r){var n=r(10),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:o.call(e,t)}},function(t,e,r){var n=r(10),o="__lodash_hash_undefined__";t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?o:e,this}},function(t,e,r){var n=r(85),o=r(86),i=r(88),a=r(89),u=r(90);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,t.exports=c},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,r){var n=r(15),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0||(r==e.length-1?e.pop():o.call(e,r,1),--this.size,0))}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,r){var n=r(15);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},function(t,e,r){var n=r(15);t.exports=function(t){return n(this.__data__,t)>-1}},function(t,e,r){var n=r(15);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},function(t,e,r){var n=r(11)(r(14),"Map");t.exports=n},function(t,e,r){var n=r(16);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,r){var n=r(16);t.exports=function(t){return n(this,t).get(t)}},function(t,e,r){var n=r(16);t.exports=function(t){return n(this,t).has(t)}},function(t,e,r){var n=r(16);t.exports=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}},function(t,e){var r="__lodash_hash_undefined__";t.exports=function(t){return this.__data__.set(t,r),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,r){var n=r(100),o=r(101),i=r(102);t.exports=function(t,e,r){return e==e?i(t,e,r):n(t,o,r)}},function(t,e){t.exports=function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}},function(t,e,r){var n=r(104),o=Math.max;t.exports=function(t,e,r){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a<u;)c[a]=i[e+a];a=-1;for(var s=Array(e+1);++a<e;)s[a]=i[a];return s[e]=r(c),n(t,this,s)}}},function(t,e){t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},function(t,e,r){var n=r(106),o=r(109)(n);t.exports=o},function(t,e,r){var n=r(107),o=r(108),i=r(40),a=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:i;t.exports=a},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e,r){var n=r(11),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e){var r=800,n=16,o=Date.now;t.exports=function(t){var e=0,i=0;return function(){var a=o(),u=n-(a-i);if(i=a,u>0){if(++e>=r)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,r){var n=r(22),o=r(111);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},function(t,e){var r=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9);e.default=function(t,e){switch(void 0===t&&(t=0),e.type){case n.ADD_SOURCE:case n.ADD_TARGET:return t+1;case n.REMOVE_SOURCE:case n.REMOVE_TARGET:return t-1;default:return t}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(7),o=r(9),i=r(36),a=r(41),u=r(117);e.default=function(t,e){switch(void 0===t&&(t=a.NONE),e.type){case n.HOVER:break;case o.ADD_SOURCE:case o.ADD_TARGET:case o.REMOVE_TARGET:case o.REMOVE_SOURCE:return a.NONE;case n.BEGIN_DRAG:case n.PUBLISH_DRAG_SOURCE:case n.END_DRAG:case n.DROP:default:return a.ALL}var r=e.payload,c=r.targetIds,s=void 0===c?[]:c,f=r.prevTargetIds,p=void 0===f?[]:f,d=u(s,p);if(!(d.length>0)&&i.areArraysEqual(s,p))return a.NONE;var l=p[p.length-1],h=s[s.length-1];return l!==h&&(l&&d.push(l),h&&d.push(h)),d}},function(t,e,r){var n=r(17),o=r(115),i=r(26),a=r(116),u=i(function(t){var e=n(t,a);return e.length&&e[0]===t[0]?o(e):[]});t.exports=u},function(t,e,r){var n=r(21),o=r(23),i=r(24),a=r(17),u=r(39),c=r(25),s=Math.min;t.exports=function(t,e,r){for(var f=r?i:o,p=t[0].length,d=t.length,l=d,h=Array(d),g=1/0,v=[];l--;){var y=t[l];l&&e&&(y=a(y,u(e))),g=s(y.length,g),h[l]=!r&&(e||p>=120&&y.length>=120)?new n(l&&y):void 0}y=t[0];var b=-1,O=h[0];t:for(;++b<p&&v.length<g;){var m=y[b],_=e?e(m):m;if(m=r||0!==m?m:0,!(O?c(O,_):f(v,_,r))){for(l=d;--l;){var D=h[l];if(!(D?c(D,_):f(t[l],_,r)))continue t}O&&O.push(_),v.push(m)}}return v}},function(t,e,r){var n=r(27);t.exports=function(t){return n(t)?t:[]}},function(t,e,r){var n=r(118),o=r(26),i=r(119),a=r(27),u=o(function(t){return i(n(t,a))});t.exports=u},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i}},function(t,e,r){var n=r(37),o=r(120),i=r(125);t.exports=function(t,e,r){var a=t.length;if(a<2)return a?i(t[0]):[];for(var u=-1,c=Array(a);++u<a;)for(var s=t[u],f=-1;++f<a;)f!=u&&(c[u]=n(c[u]||s,t[f],e,r));return i(o(c,1),e,r)}},function(t,e,r){var n=r(121),o=r(122);t.exports=function t(e,r,i,a,u){var c=-1,s=e.length;for(i||(i=o),u||(u=[]);++c<s;){var f=e[c];r>0&&i(f)?r>1?t(f,r-1,i,a,u):n(u,f):a||(u[u.length]=f)}return u}},function(t,e){t.exports=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}},function(t,e,r){var n=r(13),o=r(123),i=r(18),a=n?n.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},function(t,e,r){var n=r(124),o=r(4),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(t){return o(t)&&a.call(t,"callee")&&!u.call(t,"callee")};t.exports=c},function(t,e,r){var n=r(12),o=r(4),i="[object Arguments]";t.exports=function(t){return o(t)&&n(t)==i}},function(t,e,r){var n=r(21),o=r(23),i=r(24),a=r(25),u=r(126),c=r(43),s=200;t.exports=function(t,e,r){var f=-1,p=o,d=t.length,l=!0,h=[],g=h;if(r)l=!1,p=i;else if(d>=s){var v=e?null:u(t);if(v)return c(v);l=!1,p=a,g=new n}else g=e?[]:h;t:for(;++f<d;){var y=t[f],b=e?e(y):y;if(y=r||0!==y?y:0,l&&b==b){for(var O=g.length;O--;)if(g[O]===b)continue t;e&&g.push(b),h.push(y)}else p(g,b,r)||(g!==h&&g.push(b),h.push(y))}return h}},function(t,e,r){var n=r(127),o=r(42),i=r(43),a=n&&1/i(new n([,-0]))[1]==1/0?function(t){return new n(t)}:o;t.exports=a},function(t,e,r){var n=r(11)(r(14),"Set");t.exports=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return void 0===t&&(t=0),t+1}},function(t,e,r){var n=r(130);t.exports=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}},function(t,e,r){var n=r(131),o=r(138);t.exports=function(t,e){for(var r=0,i=(e=n(e,t)).length;null!=t&&r<i;)t=t[o(e[r++])];return r&&r==i?t:void 0}},function(t,e,r){var n=r(18),o=r(132),i=r(133),a=r(136);t.exports=function(t,e){return n(t)?t:o(t,e)?[t]:i(a(t))}},function(t,e,r){var n=r(18),o=r(28),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!o(t))||a.test(t)||!i.test(t)||null!=e&&t in Object(e)}},function(t,e,r){var n=r(134),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=n(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,function(t,r,n,o){e.push(n?o.replace(i,"$1"):r||t)}),e});t.exports=a},function(t,e,r){var n=r(135),o=500;t.exports=function(t){var e=n(t,function(t){return r.size===o&&r.clear(),t}),r=e.cache;return e}},function(t,e,r){var n=r(38),o="Expected a function";function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(o);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(i.Cache||n),r}i.Cache=n,t.exports=i},function(t,e,r){var n=r(137);t.exports=function(t){return null==t?"":n(t)}},function(t,e,r){var n=r(13),o=r(17),i=r(18),a=r(28),u=1/0,c=n?n.prototype:void 0,s=c?c.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return s?s.call(e):"";var r=e+"";return"0"==r&&1/e==-u?"-0":r}},function(t,e,r){var n=r(28),o=1/0;t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),o=r(140),i=r(41),a=r(0),u=function(){function t(t,e){this.store=t,this.registry=e}return t.prototype.subscribeToStateChange=function(t,e){var r=this;void 0===e&&(e={handlerIds:void 0});var n=e.handlerIds;a("function"==typeof t,"listener must be a function."),a(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");var o=this.store.getState().stateId;return this.store.subscribe(function(){var e=r.store.getState(),a=e.stateId;try{a===o||a===o+1&&!i.areDirty(e.dirtyHandlerIds,n)||t()}finally{o=a}})},t.prototype.subscribeToOffsetChange=function(t){var e=this;a("function"==typeof t,"listener must be a function.");var r=this.store.getState().dragOffset;return this.store.subscribe(function(){var n=e.store.getState().dragOffset;n!==r&&(r=n,t())})},t.prototype.canDragSource=function(t){if(!t)return!1;var e=this.registry.getSource(t);return a(e,"Expected to find a valid source."),!this.isDragging()&&e.canDrag(this,t)},t.prototype.canDropOnTarget=function(t){if(!t)return!1;var e=this.registry.getTarget(t);if(a(e,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;var r=this.registry.getTargetType(t),o=this.getItemType();return n.default(r,o)&&e.canDrop(this,t)},t.prototype.isDragging=function(){return Boolean(this.getItemType())},t.prototype.isDraggingSource=function(t){if(!t)return!1;var e=this.registry.getSource(t,!0);return a(e,"Expected to find a valid source."),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(t)===this.getItemType()&&e.isDragging(this,t))},t.prototype.isOverTarget=function(t,e){if(void 0===e&&(e={shallow:!1}),!t)return!1;var r=e.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(t),i=this.getItemType();if(i&&!n.default(o,i))return!1;var a=this.getTargetIds();if(!a.length)return!1;var u=a.indexOf(t);return r?u===a.length-1:u>-1},t.prototype.getItemType=function(){return this.store.getState().dragOperation.itemType},t.prototype.getItem=function(){return this.store.getState().dragOperation.item},t.prototype.getSourceId=function(){return this.store.getState().dragOperation.sourceId},t.prototype.getTargetIds=function(){return this.store.getState().dragOperation.targetIds},t.prototype.getDropResult=function(){return this.store.getState().dragOperation.dropResult},t.prototype.didDrop=function(){return this.store.getState().dragOperation.didDrop},t.prototype.isSourcePublic=function(){return this.store.getState().dragOperation.isSourcePublic},t.prototype.getInitialClientOffset=function(){return this.store.getState().dragOffset.initialClientOffset},t.prototype.getInitialSourceClientOffset=function(){return this.store.getState().dragOffset.initialSourceClientOffset},t.prototype.getClientOffset=function(){return this.store.getState().dragOffset.clientOffset},t.prototype.getSourceClientOffset=function(){return o.getSourceClientOffset(this.store.getState().dragOffset)},t.prototype.getDifferenceFromInitialOffset=function(){return o.getDifferenceFromInitialOffset(this.store.getState().dragOffset)},t}();e.default=u},function(t,e,r){"use strict";function n(t,e){return{x:t.x+e.x,y:t.y+e.y}}function o(t,e){return{x:t.x-e.x,y:t.y-e.y}}Object.defineProperty(e,"__esModule",{value:!0}),e.add=n,e.subtract=o,e.getSourceClientOffset=function(t){var e=t.clientOffset,r=t.initialClientOffset,i=t.initialSourceClientOffset;return e&&r&&i?o(n(e,i),r):null},e.getDifferenceFromInitialOffset=function(t){var e=t.clientOffset,r=t.initialClientOffset;return e&&r?o(e,r):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9),o=r(142),i=r(34),a=r(143),u=r(0),c=r(144);function s(t){switch(t[0]){case"S":return i.HandlerRole.SOURCE;case"T":return i.HandlerRole.TARGET;default:u(!1,"Cannot parse handler ID: "+t)}}function f(t,e){var r=t.entries(),n=!1;do{var o=r.next(),i=o.done;if(o.value[1]===e)return!0;n=i}while(!n);return!1}var p=function(){function t(t){this.store=t,this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null}return t.prototype.addSource=function(t,e){a.validateType(t),a.validateSourceContract(e);var r=this.addHandler(i.HandlerRole.SOURCE,t,e);return this.store.dispatch(n.addSource(r)),r},t.prototype.addTarget=function(t,e){a.validateType(t,!0),a.validateTargetContract(e);var r=this.addHandler(i.HandlerRole.TARGET,t,e);return this.store.dispatch(n.addTarget(r)),r},t.prototype.containsHandler=function(t){return f(this.dragSources,t)||f(this.dropTargets,t)},t.prototype.getSource=function(t,e){return void 0===e&&(e=!1),u(this.isSourceId(t),"Expected a valid source ID."),e&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)},t.prototype.getTarget=function(t){return u(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)},t.prototype.getSourceType=function(t){return u(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)},t.prototype.getTargetType=function(t){return u(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)},t.prototype.isSourceId=function(t){return s(t)===i.HandlerRole.SOURCE},t.prototype.isTargetId=function(t){return s(t)===i.HandlerRole.TARGET},t.prototype.removeSource=function(t){var e=this;u(this.getSource(t),"Expected an existing source."),this.store.dispatch(n.removeSource(t)),c(function(){e.dragSources.delete(t),e.types.delete(t)})},t.prototype.removeTarget=function(t){u(this.getTarget(t),"Expected an existing target."),this.store.dispatch(n.removeTarget(t)),this.dropTargets.delete(t),this.types.delete(t)},t.prototype.pinSource=function(t){var e=this.getSource(t);u(e,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=e},t.prototype.unpinSource=function(){u(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null},t.prototype.addHandler=function(t,e,r){var n=function(t){var e=o.default().toString();switch(t){case i.HandlerRole.SOURCE:return"S"+e;case i.HandlerRole.TARGET:return"T"+e;default:throw new Error("Unknown Handler Role: "+t)}}(t);return this.types.set(n,e),t===i.HandlerRole.SOURCE?this.dragSources.set(n,r):t===i.HandlerRole.TARGET&&this.dropTargets.set(n,r),n},t}();e.default=p},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=0;e.default=function(){return n++}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0);e.validateSourceContract=function(t){n("function"==typeof t.canDrag,"Expected canDrag to be a function."),n("function"==typeof t.beginDrag,"Expected beginDrag to be a function."),n("function"==typeof t.endDrag,"Expected endDrag to be a function.")},e.validateTargetContract=function(t){n("function"==typeof t.canDrop,"Expected canDrop to be a function."),n("function"==typeof t.hover,"Expected hover to be a function."),n("function"==typeof t.drop,"Expected beginDrag to be a function.")},e.validateType=function t(e,r){r&&Array.isArray(e)?e.forEach(function(e){return t(e,!1)}):n("string"==typeof e||"symbol"==typeof e,r?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}},function(t,e,r){"use strict";var n=r(145),o=[],i=[],a=n.makeRequestCallFromTimer(function(){if(i.length)throw i.shift()});function u(t){var e;(e=o.length?o.pop():new c).task=t,n(e)}function c(){this.task=null}t.exports=u,c.prototype.call=function(){try{this.task.call()}catch(t){u.onerror?u.onerror(t):(i.push(t),a())}finally{this.task=null,o[o.length]=this}}},function(t,e,r){"use strict";(function(e){function r(t){o.length||(n(),!0),o[o.length]=t}t.exports=r;var n,o=[],i=0,a=1024;function u(){for(;i<o.length;){var t=i;if(i+=1,o[t].call(),i>a){for(var e=0,r=o.length-i;e<r;e++)o[e]=o[e+i];o.length-=i,i=0}}o.length=0,i=0,!1}var c,s,f,p=void 0!==e?e:self,d=p.MutationObserver||p.WebKitMutationObserver;function l(t){return function(){var e=setTimeout(n,0),r=setInterval(n,50);function n(){clearTimeout(e),clearInterval(r),t()}}}"function"==typeof d?(c=1,s=new d(u),f=document.createTextNode(""),s.observe(f,{characterData:!0}),n=function(){c=-c,f.data=c}):n=l(u),r.requestFlush=n,r.makeRequestCallFromTimer=l}).call(this,r(20))},function(t,e,r){"use strict";t.exports=r(147)},function(t,e,r){"use strict";
/** @license React v16.8.4
* react-is.production.min.js
*
@@ -6,4 +6,4 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,f=n?Symbol.for("react.context"):60110,d=n?Symbol.for("react.async_mode"):60111,l=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,g=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116;function v(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case o:switch(t=t.type){case d:case l:case s:case c:case a:case h:return t;default:switch(t=t&&t.$$typeof){case f:case p:case u:return t;default:return e}}case y:case g:case i:return e}}}function b(t){return v(t)===l}e.typeOf=v,e.AsyncMode=d,e.ConcurrentMode=l,e.ContextConsumer=f,e.ContextProvider=u,e.Element=o,e.ForwardRef=p,e.Fragment=s,e.Lazy=y,e.Memo=g,e.Portal=i,e.Profiler=c,e.StrictMode=a,e.Suspense=h,e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===s||t===l||t===c||t===a||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===y||t.$$typeof===g||t.$$typeof===u||t.$$typeof===f||t.$$typeof===p)},e.isAsyncMode=function(t){return b(t)||v(t)===d},e.isConcurrentMode=b,e.isContextConsumer=function(t){return v(t)===f},e.isContextProvider=function(t){return v(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===o},e.isForwardRef=function(t){return v(t)===p},e.isFragment=function(t){return v(t)===s},e.isLazy=function(t){return v(t)===y},e.isMemo=function(t){return v(t)===g},e.isPortal=function(t){return v(t)===i},e.isProfiler=function(t){return v(t)===c},e.isStrictMode=function(t){return v(t)===a},e.isSuspense=function(t){return v(t)===h}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),o=r(17),i=r(19),s=r(29),a=r(3),c=r(0),u=r(18),f=r(30).default;e.default=function(t,e={}){return o.default("DragLayer","collect[, options]",t,e),c("function"==typeof t,'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",t),c(a(e),'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',e),function(r){const o=r,{arePropsEqual:a=u}=e,d=o.displayName||o.name||"Component";class l extends n.Component{constructor(){super(...arguments),this.isCurrentlyMounted=!1,this.ref=n.createRef(),this.handleChange=(()=>{if(!this.isCurrentlyMounted)return;const t=this.getCurrentState();u(t,this.state)||this.setState(t)})}getDecoratedComponentInstance(){return c(this.ref.current,"In order to access an instance of the decorated component it can not be a stateless component."),this.ref.current}shouldComponentUpdate(t,e){return!a(t,this.props)||!u(e,this.state)}componentDidMount(){this.isCurrentlyMounted=!0,this.handleChange()}componentWillUnmount(){this.isCurrentlyMounted=!1,this.unsubscribeFromOffsetChange&&(this.unsubscribeFromOffsetChange(),this.unsubscribeFromOffsetChange=void 0),this.unsubscribeFromStateChange&&(this.unsubscribeFromStateChange(),this.unsubscribeFromStateChange=void 0)}render(){return n.createElement(i.Consumer,null,({dragDropManager:t})=>void 0===t?null:(this.receiveDragDropManager(t),this.isCurrentlyMounted?n.createElement(o,Object.assign({},this.props,this.state,{ref:f(o)?this.ref:void 0})):null))}receiveDragDropManager(t){if(void 0!==this.manager)return;this.manager=t,c("object"==typeof t,"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",d,d);const e=this.manager.getMonitor();this.unsubscribeFromOffsetChange=e.subscribeToOffsetChange(this.handleChange),this.unsubscribeFromStateChange=e.subscribeToStateChange(this.handleChange)}getCurrentState(){if(!this.manager)return{};const e=this.manager.getMonitor();return t(e,this.props)}}return l.displayName=`DragLayer(${d})`,l.DecoratedComponent=r,s(l,r)}}},function(t,e,r){var n=r(143)(Object.getPrototypeOf,Object);t.exports=n},function(t,e){t.exports=function(t,e){return function(r){return t(e(r))}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(17),o=r(43),i=r(149),s=r(150),a=r(151),c=r(152),u=r(45),f=r(0),d=r(3);e.default=function(t,e,r,l={}){n.default("DragSource","type, spec, collect[, options]",t,e,r,l);let p=t;"function"!=typeof t&&(f(u.default(t),'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',t),p=(()=>t)),f(d(e),'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',e);const h=s.default(e);return f("function"==typeof r,'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',r),f(d(l),'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',r),function(t){return o.default({containerDisplayName:"DragSource",createHandler:h,registerHandler:i.default,createMonitor:a.default,createConnector:c.default,DecoratedComponent:t,getType:p,collect:r,options:l})}}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(146)),n(r(147)),n(r(148))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(22),o=r(41);class i{constructor(t){this.isDisposed=!1,this.action=n(t)?t:o}static isDisposable(t){return t&&n(t.dispose)}static _fixup(t){return i.isDisposable(t)?t:i.empty}static create(t){return new i(t)}dispose(){this.isDisposed||(this.action(),this.isDisposed=!0)}}i.empty={dispose:o},e.Disposable=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SerialDisposable=class{constructor(){this.isDisposed=!1}getDisposable(){return this.current}setDisposable(t){const e=this.isDisposed;if(!e){const e=this.current;this.current=t,e&&e.dispose()}e&&t&&t.dispose()}dispose(){if(!this.isDisposed){this.isDisposed=!0;const t=this.current;this.current=void 0,t&&t.dispose()}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.CompositeDisposable=class{constructor(...t){this.isDisposed=!1,this.disposables=t}add(t){this.isDisposed?t.dispose():this.disposables.push(t)}remove(t){let e=!1;if(!this.isDisposed){const r=this.disposables.indexOf(t);-1!==r&&(e=!0,this.disposables.splice(r,1),t.dispose())}return e}clear(){if(!this.isDisposed){const t=this.disposables.length,e=new Array(t);for(let r=0;r<t;r++)e[r]=this.disposables[r];this.disposables=[];for(let r=0;r<t;r++)e[r].dispose()}}dispose(){if(!this.isDisposed){this.isDisposed=!0;const t=this.disposables.length,e=new Array(t);for(let r=0;r<t;r++)e[r]=this.disposables[r];this.disposables=[];for(let r=0;r<t;r++)e[r].dispose()}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){const n=r.getRegistry(),o=n.addSource(t,e);return{handlerId:o,unregister:function(){n.removeSource(o)}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),o=r(0),i=(r(3),["canDrag","beginDrag","isDragging","endDrag"]),s=["beginDrag"];e.default=function(t){Object.keys(t).forEach(e=>{o(i.indexOf(e)>-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',i.join(", "),e),o("function"==typeof t[e],"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",e,e,t[e])}),s.forEach(e=>{o("function"==typeof t[e],"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",e,e,t[e])});class e{constructor(e){this.monitor=e,this.props=null,this.ref=n.createRef(),this.beginDrag=(()=>{if(this.props)return t.beginDrag(this.props,this.monitor,this.ref.current)})}receiveProps(t){this.props=t}canDrag(){return!!this.props&&(!t.canDrag||t.canDrag(this.props,this.monitor))}isDragging(e,r){return!!this.props&&(t.isDragging?t.isDragging(this.props,this.monitor):r===e.getSourceId())}endDrag(){this.props&&t.endDrag&&t.endDrag(this.props,this.monitor,this.ref.current)}}return function(t){return new e(t)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0);let o=!1,i=!1;class s{constructor(t){this.internalMonitor=t.getMonitor()}receiveHandlerId(t){this.sourceId=t}canDrag(){n(!o,"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{return o=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{o=!1}}isDragging(){n(!i,"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{return i=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{i=!1}}subscribeToStateChange(t,e){return this.internalMonitor.subscribeToStateChange(t,e)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,e){return this.internalMonitor.isOverTarget(t,e)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}}e.default=function(t){return new s(t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(44),o=r(18);e.default=function(t){let e,r,i,s,a,c,u;function f(){s&&(s(),s=void 0),e&&r&&(s=t.connectDragSource(e,r,i))}function d(){u&&(u(),u=void 0),e&&a&&(u=t.connectDragPreview(e,a,c))}return{receiveHandlerId:function(t){t!==e&&(e=t,f(),d())},hooks:n.default({dragSource:function(t,e){t===r&&o(e,i)||(r=t,i=e,f())},dragPreview:function(t,e){t===a&&o(e,c)||(a=t,c=e,d())}})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),o=r(0);function i(t,e){"function"==typeof t?t(e):t.current=e}e.default=function(t,e){const r=t.ref;return o("string"!=typeof r,"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"),r?n.cloneElement(t,{ref:t=>{i(e,t),r&&i(r,t)}}):n.cloneElement(t,{ref:e})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(17),o=r(43),i=r(155),s=r(156),a=r(157),c=r(158),u=r(45),f=r(0),d=r(3);e.default=function(t,e,r,l={}){n.default("DropTarget","type, spec, collect[, options]",t,e,r,l);let p=t;"function"!=typeof t&&(f(u.default(t,!0),'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',t),p=(()=>t)),f(d(e),'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',e);const h=s.default(e);return f("function"==typeof r,'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',r),f(d(l),'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',r),function(t){return o.default({containerDisplayName:"DropTarget",createHandler:h,registerHandler:i.default,createMonitor:a.default,createConnector:c.default,DecoratedComponent:t,getType:p,collect:r,options:l})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){const n=r.getRegistry(),o=n.addTarget(t,e);return{handlerId:o,unregister:function(){n.removeTarget(o)}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),o=r(0),i=(r(3),["canDrop","hover","drop"]);e.default=function(t){Object.keys(t).forEach(e=>{o(i.indexOf(e)>-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',i.join(", "),e),o("function"==typeof t[e],"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",e,e,t[e])});class e{constructor(t){this.monitor=t,this.props=null,this.ref=n.createRef()}receiveProps(t){this.props=t}receiveMonitor(t){this.monitor=t}canDrop(){return!t.canDrop||t.canDrop(this.props,this.monitor)}hover(){t.hover&&t.hover(this.props,this.monitor,this.ref.current)}drop(){if(t.drop)return t.drop(this.props,this.monitor,this.ref.current)}}return function(t){return new e(t)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0);let o=!1;class i{constructor(t){this.internalMonitor=t.getMonitor()}receiveHandlerId(t){this.targetId=t}canDrop(){n(!o,"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{return o=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{o=!1}}isOver(t){return this.internalMonitor.isOverTarget(this.targetId,t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}}e.TargetMonitor=i,e.default=function(t){return new i(t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(44),o=r(18);e.default=function(t){let e,r,i,s;function a(){s&&(s(),s=void 0),e&&r&&(s=t.connectDropTarget(e,r,i))}return{receiveHandlerId:function(t){t!==e&&(e=t,a())},hooks:n.default({dropTarget:function(t,e){t===r&&o(e,i)||(r=t,i=e,a())}})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(32);e.XYCoord=n.XYCoord}])});
\ No newline at end of file
+ */Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,u=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,f=n?Symbol.for("react.context"):60110,p=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,l=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,g=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116;function y(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case o:switch(t=t.type){case p:case d:case a:case c:case u:case h:return t;default:switch(t=t&&t.$$typeof){case f:case l:case s:return t;default:return e}}case v:case g:case i:return e}}}function b(t){return y(t)===d}e.typeOf=y,e.AsyncMode=p,e.ConcurrentMode=d,e.ContextConsumer=f,e.ContextProvider=s,e.Element=o,e.ForwardRef=l,e.Fragment=a,e.Lazy=v,e.Memo=g,e.Portal=i,e.Profiler=c,e.StrictMode=u,e.Suspense=h,e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===a||t===d||t===c||t===u||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===v||t.$$typeof===g||t.$$typeof===s||t.$$typeof===f||t.$$typeof===l)},e.isAsyncMode=function(t){return b(t)||y(t)===p},e.isConcurrentMode=b,e.isContextConsumer=function(t){return y(t)===f},e.isContextProvider=function(t){return y(t)===s},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===o},e.isForwardRef=function(t){return y(t)===l},e.isFragment=function(t){return y(t)===a},e.isLazy=function(t){return y(t)===v},e.isMemo=function(t){return y(t)===g},e.isPortal=function(t){return y(t)===i},e.isProfiler=function(t){return y(t)===c},e.isStrictMode=function(t){return y(t)===u},e.isSuspense=function(t){return y(t)===h}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var a=r(1),u=r(19),c=r(6),s=r(29),f=r(3),p=r(0),d=r(5),l=r(30).default;e.default=function(t,e){return void 0===e&&(e={}),u.default("DragLayer","collect[, options]",t,e),p("function"==typeof t,'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",t),p(f(e),'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',e),function(r){var n=r,u=e.arePropsEqual,f=void 0===u?d:u,h=n.displayName||n.name||"Component",g=function(e){function u(){var t=null!==e&&e.apply(this,arguments)||this;return t.isCurrentlyMounted=!1,t.ref=a.createRef(),t.handleChange=function(){if(t.isCurrentlyMounted){var e=t.getCurrentState();d(e,t.state)||t.setState(e)}},t}return o(u,e),u.prototype.getDecoratedComponentInstance=function(){return p(this.ref.current,"In order to access an instance of the decorated component it can not be a stateless component."),this.ref.current},u.prototype.shouldComponentUpdate=function(t,e){return!f(t,this.props)||!d(e,this.state)},u.prototype.componentDidMount=function(){this.isCurrentlyMounted=!0,this.handleChange()},u.prototype.componentWillUnmount=function(){this.isCurrentlyMounted=!1,this.unsubscribeFromOffsetChange&&(this.unsubscribeFromOffsetChange(),this.unsubscribeFromOffsetChange=void 0),this.unsubscribeFromStateChange&&(this.unsubscribeFromStateChange(),this.unsubscribeFromStateChange=void 0)},u.prototype.render=function(){var t=this;return a.createElement(c.Consumer,null,function(e){var r=e.dragDropManager;return void 0===r?null:(t.receiveDragDropManager(r),t.isCurrentlyMounted?a.createElement(n,i({},t.props,t.state,{ref:l(n)?t.ref:void 0})):null)})},u.prototype.receiveDragDropManager=function(t){if(void 0===this.manager){this.manager=t,p("object"==typeof t,"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",h,h);var e=this.manager.getMonitor();this.unsubscribeFromOffsetChange=e.subscribeToOffsetChange(this.handleChange),this.unsubscribeFromStateChange=e.subscribeToStateChange(this.handleChange)}},u.prototype.getCurrentState=function(){if(!this.manager)return{};var e=this.manager.getMonitor();return t(e,this.props)},u.displayName="DragLayer("+h+")",u.DecoratedComponent=r,u}(a.Component);return s(g,r)}}},function(t,e,r){var n=r(150)(Object.getPrototypeOf,Object);t.exports=n},function(t,e){t.exports=function(t,e){return function(r){return t(e(r))}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(19),o=r(44),i=r(45),a=r(156),u=r(46),c=r(157),s=r(48),f=r(0),p=r(3);e.default=function(t,e,r,d){void 0===d&&(d={}),n.default("DragSource","type, spec, collect[, options]",t,e,r,d);var l=t;"function"!=typeof t&&(f(s.default(t),'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',t),l=function(){return t}),f(p(e),'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',e);var h=a.default(e);return f("function"==typeof r,'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',r),f(p(d),'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',r),function(t){return o.default({containerDisplayName:"DragSource",createHandler:h,registerHandler:i.default,createMonitor:function(t){return new u.default(t)},createConnector:c.default,DecoratedComponent:t,getType:l,collect:r,options:d})}}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(153)),n(r(154)),n(r(155))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(22),o=r(42),i=function(){function t(t){this.isDisposed=!1,this.action=n(t)?t:o}return t.isDisposable=function(t){return t&&n(t.dispose)},t._fixup=function(e){return t.isDisposable(e)?e:t.empty},t.create=function(e){return new t(e)},t.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)},t.empty={dispose:o},t}();e.Disposable=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this.isDisposed=!1}return t.prototype.getDisposable=function(){return this.current},t.prototype.setDisposable=function(t){var e=this.isDisposed;if(!e){var r=this.current;this.current=t,r&&r.dispose()}e&&t&&t.dispose()},t.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var t=this.current;this.current=void 0,t&&t.dispose()}},t}();e.SerialDisposable=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.isDisposed=!1,this.disposables=t}return t.prototype.add=function(t){this.isDisposed?t.dispose():this.disposables.push(t)},t.prototype.remove=function(t){var e=!1;if(!this.isDisposed){var r=this.disposables.indexOf(t);-1!==r&&(e=!0,this.disposables.splice(r,1),t.dispose())}return e},t.prototype.clear=function(){if(!this.isDisposed){for(var t=this.disposables.length,e=new Array(t),r=0;r<t;r++)e[r]=this.disposables[r];this.disposables=[];for(r=0;r<t;r++)e[r].dispose()}},t.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var t=this.disposables.length,e=new Array(t),r=0;r<t;r++)e[r]=this.disposables[r];this.disposables=[];for(r=0;r<t;r++)e[r].dispose()}},t}();e.CompositeDisposable=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(0),i=(r(3),["canDrag","beginDrag","isDragging","endDrag"]),a=["beginDrag"];e.default=function(t){Object.keys(t).forEach(function(e){o(i.indexOf(e)>-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',i.join(", "),e),o("function"==typeof t[e],"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",e,e,t[e])}),a.forEach(function(e){o("function"==typeof t[e],"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",e,e,t[e])});var e=function(){function e(e){var r=this;this.monitor=e,this.props=null,this.ref=n.createRef(),this.beginDrag=function(){if(r.props)return t.beginDrag(r.props,r.monitor,r.ref.current)}}return e.prototype.receiveProps=function(t){this.props=t},e.prototype.canDrag=function(){return!!this.props&&(!t.canDrag||t.canDrag(this.props,this.monitor))},e.prototype.isDragging=function(e,r){return!!this.props&&(t.isDragging?t.isDragging(this.props,this.monitor):r===e.getSourceId())},e.prototype.endDrag=function(){this.props&&t.endDrag&&t.endDrag(this.props,this.monitor,this.ref.current)},e}();return function(t){return new e(t)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(47),o=r(5);e.default=function(t){var e,r,i,a,u,c,s;function f(){a&&(a(),a=void 0),e&&r&&(a=t.connectDragSource(e,r,i))}function p(){s&&(s(),s=void 0),e&&u&&(s=t.connectDragPreview(e,u,c))}return{receiveHandlerId:function(t){t!==e&&(e=t,f(),p())},hooks:n.default({dragSource:function(t,e){t===r&&o(e,i)||(r=t,i=e,f())},dragPreview:function(t,e){t===u&&o(e,c)||(u=t,c=e,p())}})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(0);function i(t,e){"function"==typeof t?t(e):t.current=e}e.default=function(t,e){var r=t.ref;return o("string"!=typeof r,"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"),r?n.cloneElement(t,{ref:function(t){i(e,t),r&&i(r,t)}}):n.cloneElement(t,{ref:e})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(19),o=r(44),i=r(49),a=r(160),u=r(161),c=r(48),s=r(50),f=r(0),p=r(3);e.default=function(t,e,r,d){void 0===d&&(d={}),n.default("DropTarget","type, spec, collect[, options]",t,e,r,d);var l=t;"function"!=typeof t&&(f(c.default(t,!0),'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',t),l=function(){return t}),f(p(e),'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',e);var h=a.default(e);return f("function"==typeof r,'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',r),f(p(d),'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',r),function(t){return o.default({containerDisplayName:"DropTarget",createHandler:h,registerHandler:i.default,createMonitor:function(t){return new s.default(t)},createConnector:u.default,DecoratedComponent:t,getType:l,collect:r,options:d})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(0),i=(r(3),["canDrop","hover","drop"]);e.default=function(t){Object.keys(t).forEach(function(e){o(i.indexOf(e)>-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',i.join(", "),e),o("function"==typeof t[e],"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",e,e,t[e])});var e=function(){function e(t){this.monitor=t,this.props=null,this.ref=n.createRef()}return e.prototype.receiveProps=function(t){this.props=t},e.prototype.receiveMonitor=function(t){this.monitor=t},e.prototype.canDrop=function(){return!t.canDrop||t.canDrop(this.props,this.monitor)},e.prototype.hover=function(){t.hover&&t.hover(this.props,this.monitor,this.ref.current)},e.prototype.drop=function(){if(t.drop)return t.drop(this.props,this.monitor,this.ref.current)},e}();return function(t){return new e(t)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(47),o=r(5);e.default=function(t){var e,r,i,a;function u(){a&&(a(),a=void 0),e&&r&&(a=t.connectDropTarget(e,r,i))}return{receiveHandlerId:function(t){t!==e&&(e=t,u())},hooks:n.default({dropTarget:function(t,e){t===r&&o(e,i)||(r=t,i=e,u())}})}}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(163)),n(r(167)),n(r(170))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(164),i=r(31),a=r(165),u=r(51),c=r(166);e.useDragSource=function(t,e,r){var s=i.useDragDropManager(),f=s.getBackend(),p=o.useDragSourceHandler(r),d=c.useDragSourceMonitor(e,p,s);n.useEffect(function(){var e=t.current,n=r.dragSourceOptions;return f.connectDragSource(d.getHandlerId(),e,n)},[]),n.useEffect(function(){if(null!=r.dragPreview){var t=a.isRef(r.dragPreview)?r.dragPreview.current:r.dragPreview,e=r.dragPreviewOptions;return f.connectDragPreview(d.getHandlerId(),t,e)}},[]);var l=r.collect||function(){return{}};return u.useMonitorOutput(d,l)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1);e.useDragSourceHandler=function(t){var e=n.useRef(t);return n.useEffect(function(){e.current=t}),n.useMemo(function(){return{beginDrag:function(t,r){return(0,e.current.beginDrag)(t)},canDrag:function(t,r){var n=e.current.canDrag;return!n||n(t)},isDragging:function(t,r){var n=e.current.isDragging;return n?n(t):r===t.getSourceId()},endDrag:function(t,r){var n=e.current.endDrag;n&&n(t)}}},[])}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isRef=function(t){if(null!==t&&"object"==typeof t){var e=Object.keys(t);return 1===e.length&&"current"===e[0]}return!1}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(45),i=r(46);e.useDragSourceMonitor=function(t,e,r){var a=n.useMemo(function(){return new i.default(r)},[r]);return n.useEffect(function(){var n=o.default(t,e,r),i=n.handlerId,u=n.unregister;return a.receiveHandlerId(i),u},[a]),a}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(31),i=r(168),a=r(51),u=r(169);e.useDropTarget=function(t,e,r){var c=o.useDragDropManager(),s=c.getBackend(),f=i.useDropTargetHandler(r),p=u.useDropTargetMonitor(e,f,c);n.useEffect(function(){var e=t.current;if(e){var n=r.dropTargetOptions;return s.connectDropTarget(p.getHandlerId(),e,n)}},[]);var d=r.collect||function(){return{}};return a.useMonitorOutput(p,d)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1);e.useDropTargetHandler=function(t){var e=n.useRef(t);return n.useEffect(function(){e.current=t}),n.useMemo(function(){return{canDrop:function(t,r){var n=e.current.canDrop;return!n||n(t)},hover:function(t,r){var n=e.current.hover;n&&n(t)},drop:function(t,r){var n=e.current.drop;n&&n(t)}}},[])}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(49),i=r(50);e.useDropTargetMonitor=function(t,e,r){var a=n.useMemo(function(){return new i.default(r)},[r]);return n.useEffect(function(){var n=o.default(t,e,r),i=n.handlerId,u=n.unregister;return a.receiveHandlerId(i),u},[a]),a}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(31),i=r(52);e.useDragLayer=function(t){var e=o.useDragDropManager().getMonitor(),r=i.useCollector(e,t),a=r[0],u=r[1];return n.useEffect(function(){return e.subscribeToOffsetChange(u)}),n.useEffect(function(){return e.subscribeToStateChange(u)}),a}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(33);e.XYCoord=n.XYCoord}])});
\ No newline at end of file

lib/cjs/createSourceConnector.d.ts

@@ -1,5 +1,5 @@
import { Backend } from 'dnd-core';
export default function createSourceConnector(backend: Backend): {
- receiveHandlerId: (handlerId: string) => void;
+ receiveHandlerId: (handlerId: string | symbol) => void;
hooks: any;
};

lib/cjs/createSourceConnector.js

@@ -1,15 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const wrapConnectorHooks_1 = require("./wrapConnectorHooks");
-const shallowEqual = require('shallowequal');
+var wrapConnectorHooks_1 = require("./wrapConnectorHooks");
+var shallowEqual = require('shallowequal');
function createSourceConnector(backend) {
- let currentHandlerId;
- let currentDragSourceNode;
- let currentDragSourceOptions;
- let disconnectCurrentDragSource;
- let currentDragPreviewNode;
- let currentDragPreviewOptions;
- let disconnectCurrentDragPreview;
+ var currentHandlerId;
+ var currentDragSourceNode;
+ var currentDragSourceOptions;
+ var disconnectCurrentDragSource;
+ var currentDragPreviewNode;
+ var currentDragPreviewOptions;
+ var disconnectCurrentDragPreview;
function reconnectDragSource() {
if (disconnectCurrentDragSource) {
disconnectCurrentDragSource();
@@ -36,7 +36,7 @@
reconnectDragSource();
reconnectDragPreview();
}
- const hooks = wrapConnectorHooks_1.default({
+ var hooks = wrapConnectorHooks_1.default({
dragSource: function connectDragSource(node, options) {
if (node === currentDragSourceNode &&
shallowEqual(options, currentDragSourceOptions)) {
@@ -57,8 +57,8 @@
},
});
return {
- receiveHandlerId,
- hooks,
+ receiveHandlerId: receiveHandlerId,
+ hooks: hooks,
};
}
exports.default = createSourceConnector;

lib/cjs/createSourceFactory.js

@@ -1,12 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const react_1 = require("react");
-const invariant = require('invariant');
-const isPlainObject = require('lodash/isPlainObject');
-const ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'isDragging', 'endDrag'];
-const REQUIRED_SPEC_METHODS = ['beginDrag'];
+var react_1 = require("react");
+var invariant = require('invariant');
+var isPlainObject = require('lodash/isPlainObject');
+var ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'isDragging', 'endDrag'];
+var REQUIRED_SPEC_METHODS = ['beginDrag'];
function createSourceFactory(spec) {
- Object.keys(spec).forEach(key => {
+ Object.keys(spec).forEach(function (key) {
invariant(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. ' +
@@ -15,21 +15,22 @@
'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(key => {
+ REQUIRED_SPEC_METHODS.forEach(function (key) {
invariant(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]);
});
- class SourceImpl {
- constructor(monitor) {
+ var SourceImpl = /** @class */ (function () {
+ function SourceImpl(monitor) {
+ var _this = this;
this.monitor = monitor;
this.props = null;
this.ref = react_1.createRef();
- this.beginDrag = () => {
- if (!this.props) {
+ this.beginDrag = function () {
+ if (!_this.props) {
return;
}
- const item = spec.beginDrag(this.props, this.monitor, this.ref.current);
+ var item = spec.beginDrag(_this.props, _this.monitor, _this.ref.current);
if (process.env.NODE_ENV !== 'production') {
invariant(isPlainObject(item), 'beginDrag() must return a plain object that represents the dragged item. ' +
'Instead received %s. ' +
@@ -38,10 +39,10 @@
return item;
};
}
- receiveProps(props) {
+ SourceImpl.prototype.receiveProps = function (props) {
this.props = props;
- }
- canDrag() {
+ };
+ SourceImpl.prototype.canDrag = function () {
if (!this.props) {
return false;
}
@@ -49,8 +50,8 @@
return true;
}
return spec.canDrag(this.props, this.monitor);
- }
- isDragging(globalMonitor, sourceId) {
+ };
+ SourceImpl.prototype.isDragging = function (globalMonitor, sourceId) {
if (!this.props) {
return false;
}
@@ -58,8 +59,8 @@
return sourceId === globalMonitor.getSourceId();
}
return spec.isDragging(this.props, this.monitor);
- }
- endDrag() {
+ };
+ SourceImpl.prototype.endDrag = function () {
if (!this.props) {
return;
}
@@ -67,8 +68,9 @@
return;
}
spec.endDrag(this.props, this.monitor, this.ref.current);
- }
- }
+ };
+ return SourceImpl;
+ }());
return function createSource(monitor) {
return new SourceImpl(monitor);
};

lib/cjs/createSourceMonitor.d.ts

@@ -1,3 +0,0 @@
-import { DragDropManager } from 'dnd-core';
-import { DragSourceMonitor } from './interfaces';
-export default function createSourceMonitor<Context>(manager: DragDropManager<Context>): DragSourceMonitor;

lib/cjs/createSourceMonitor.js

@@ -1,93 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const invariant = require('invariant');
-let isCallingCanDrag = false;
-let isCallingIsDragging = false;
-class SourceMonitor {
- constructor(manager) {
- this.internalMonitor = manager.getMonitor();
- }
- receiveHandlerId(sourceId) {
- this.sourceId = sourceId;
- }
- canDrag() {
- invariant(!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;
- }
- }
- isDragging() {
- invariant(!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;
- }
- }
- subscribeToStateChange(listener, options) {
- return this.internalMonitor.subscribeToStateChange(listener, options);
- }
- isDraggingSource(sourceId) {
- return this.internalMonitor.isDraggingSource(sourceId);
- }
- isOverTarget(targetId, options) {
- return this.internalMonitor.isOverTarget(targetId, options);
- }
- getTargetIds() {
- return this.internalMonitor.getTargetIds();
- }
- isSourcePublic() {
- return this.internalMonitor.isSourcePublic();
- }
- getSourceId() {
- return this.internalMonitor.getSourceId();
- }
- subscribeToOffsetChange(listener) {
- return this.internalMonitor.subscribeToOffsetChange(listener);
- }
- canDragSource(sourceId) {
- return this.internalMonitor.canDragSource(sourceId);
- }
- canDropOnTarget(targetId) {
- return this.internalMonitor.canDropOnTarget(targetId);
- }
- getItemType() {
- return this.internalMonitor.getItemType();
- }
- getItem() {
- return this.internalMonitor.getItem();
- }
- getDropResult() {
- return this.internalMonitor.getDropResult();
- }
- didDrop() {
- return this.internalMonitor.didDrop();
- }
- getInitialClientOffset() {
- return this.internalMonitor.getInitialClientOffset();
- }
- getInitialSourceClientOffset() {
- return this.internalMonitor.getInitialSourceClientOffset();
- }
- getSourceClientOffset() {
- return this.internalMonitor.getSourceClientOffset();
- }
- getClientOffset() {
- return this.internalMonitor.getClientOffset();
- }
- getDifferenceFromInitialOffset() {
- return this.internalMonitor.getDifferenceFromInitialOffset();
- }
-}
-function createSourceMonitor(manager) {
- return new SourceMonitor(manager);
-}
-exports.default = createSourceMonitor;

lib/cjs/createTargetConnector.d.ts

@@ -1,5 +1,5 @@
import { Backend } from 'dnd-core';
export default function createTargetConnector(backend: Backend): {
- receiveHandlerId: (handlerId: string) => void;
+ receiveHandlerId: (handlerId: string | symbol) => void;
hooks: any;
};

lib/cjs/createTargetConnector.js

@@ -1,12 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const wrapConnectorHooks_1 = require("./wrapConnectorHooks");
-const shallowEqual = require('shallowequal');
+var wrapConnectorHooks_1 = require("./wrapConnectorHooks");
+var shallowEqual = require('shallowequal');
function createTargetConnector(backend) {
- let currentHandlerId;
- let currentDropTargetNode;
- let currentDropTargetOptions;
- let disconnectCurrentDropTarget;
+ var currentHandlerId;
+ var currentDropTargetNode;
+ var currentDropTargetOptions;
+ var disconnectCurrentDropTarget;
function reconnectDropTarget() {
if (disconnectCurrentDropTarget) {
disconnectCurrentDropTarget();
@@ -23,7 +23,7 @@
currentHandlerId = handlerId;
reconnectDropTarget();
}
- const hooks = wrapConnectorHooks_1.default({
+ var hooks = wrapConnectorHooks_1.default({
dropTarget: function connectDropTarget(node, options) {
if (node === currentDropTargetNode &&
shallowEqual(options, currentDropTargetOptions)) {
@@ -35,8 +35,8 @@
},
});
return {
- receiveHandlerId,
- hooks,
+ receiveHandlerId: receiveHandlerId,
+ hooks: hooks,
};
}
exports.default = createTargetConnector;

lib/cjs/createTargetFactory.js

@@ -1,11 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const react_1 = require("react");
-const invariant = require('invariant');
-const isPlainObject = require('lodash/isPlainObject');
-const ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];
+var react_1 = require("react");
+var invariant = require('invariant');
+var isPlainObject = require('lodash/isPlainObject');
+var ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];
function createTargetFactory(spec) {
- Object.keys(spec).forEach(key => {
+ Object.keys(spec).forEach(function (key) {
invariant(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. ' +
@@ -14,43 +14,44 @@
'Instead received a specification with %s: %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', key, key, spec[key]);
});
- class TargetImpl {
- constructor(monitor) {
+ var TargetImpl = /** @class */ (function () {
+ function TargetImpl(monitor) {
this.monitor = monitor;
this.props = null;
this.ref = react_1.createRef();
}
- receiveProps(props) {
+ TargetImpl.prototype.receiveProps = function (props) {
this.props = props;
- }
- receiveMonitor(monitor) {
+ };
+ TargetImpl.prototype.receiveMonitor = function (monitor) {
this.monitor = monitor;
- }
- canDrop() {
+ };
+ TargetImpl.prototype.canDrop = function () {
if (!spec.canDrop) {
return true;
}
return spec.canDrop(this.props, this.monitor);
- }
- hover() {
+ };
+ TargetImpl.prototype.hover = function () {
if (!spec.hover) {
return;
}
spec.hover(this.props, this.monitor, this.ref.current);
- }
- drop() {
+ };
+ TargetImpl.prototype.drop = function () {
if (!spec.drop) {
return undefined;
}
- const dropResult = spec.drop(this.props, this.monitor, this.ref.current);
+ var dropResult = spec.drop(this.props, this.monitor, this.ref.current);
if (process.env.NODE_ENV !== 'production') {
invariant(typeof dropResult === 'undefined' || isPlainObject(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 TargetImpl;
+ }());
return function createTarget(monitor) {
return new TargetImpl(monitor);
};

lib/cjs/createTargetMonitor.d.ts

@@ -1,22 +0,0 @@
-import { DragDropManager } from 'dnd-core';
-import { DropTargetMonitor } from './interfaces';
-export declare class TargetMonitor implements DropTargetMonitor {
- private internalMonitor;
- private targetId;
- constructor(manager: DragDropManager<any>);
- receiveHandlerId(targetId: string): void;
- canDrop(): boolean;
- isOver(options: {
- shallow?: boolean;
- }): boolean;
- getItemType(): string | symbol | null;
- getItem(): any;
- getDropResult(): any;
- didDrop(): boolean;
- getInitialClientOffset(): import("dnd-core").XYCoord | null;
- getInitialSourceClientOffset(): import("dnd-core").XYCoord | null;
- getSourceClientOffset(): import("dnd-core").XYCoord | null;
- getClientOffset(): import("dnd-core").XYCoord | null;
- getDifferenceFromInitialOffset(): import("dnd-core").XYCoord | null;
-}
-export default function createTargetMonitor<Context>(manager: DragDropManager<Context>): DropTargetMonitor;

lib/cjs/createTargetMonitor.js

@@ -1,58 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const invariant = require('invariant');
-let isCallingCanDrop = false;
-class TargetMonitor {
- constructor(manager) {
- this.internalMonitor = manager.getMonitor();
- }
- receiveHandlerId(targetId) {
- this.targetId = targetId;
- }
- canDrop() {
- invariant(!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;
- }
- }
- isOver(options) {
- return this.internalMonitor.isOverTarget(this.targetId, options);
- }
- getItemType() {
- return this.internalMonitor.getItemType();
- }
- getItem() {
- return this.internalMonitor.getItem();
- }
- getDropResult() {
- return this.internalMonitor.getDropResult();
- }
- didDrop() {
- return this.internalMonitor.didDrop();
- }
- getInitialClientOffset() {
- return this.internalMonitor.getInitialClientOffset();
- }
- getInitialSourceClientOffset() {
- return this.internalMonitor.getInitialSourceClientOffset();
- }
- getSourceClientOffset() {
- return this.internalMonitor.getSourceClientOffset();
- }
- getClientOffset() {
- return this.internalMonitor.getClientOffset();
- }
- getDifferenceFromInitialOffset() {
- return this.internalMonitor.getDifferenceFromInitialOffset();
- }
-}
-exports.TargetMonitor = TargetMonitor;
-function createTargetMonitor(manager) {
- return new TargetMonitor(manager);
-}
-exports.default = createTargetMonitor;

lib/cjs/decorateHandler.js

@@ -1,66 +1,93 @@
"use strict";
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+ };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+var __assign = (this && this.__assign) || function () {
+ __assign = Object.assign || function(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
+ t[p] = s[p];
+ }
+ return t;
+ };
+ return __assign.apply(this, arguments);
+};
Object.defineProperty(exports, "__esModule", { value: true });
-const React = require("react");
-const DragDropContext_1 = require("./DragDropContext");
-const disposables_1 = require("./utils/disposables");
-const isClassComponent = require('recompose/isClassComponent').default;
-const isPlainObject = require('lodash/isPlainObject');
-const invariant = require('invariant');
-const hoistStatics = require('hoist-non-react-statics');
-const shallowEqual = require('shallowequal');
-function decorateHandler({ DecoratedComponent, createHandler, createMonitor, createConnector, registerHandler, containerDisplayName, getType, collect, options, }) {
- const { arePropsEqual = shallowEqual } = options;
- const Decorated = DecoratedComponent;
- const displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
- class DragDropContainer extends React.Component {
- constructor(props) {
- super(props);
- this.handleChange = () => {
- const nextState = this.getCurrentState();
- if (!shallowEqual(nextState, this.state)) {
- this.setState(nextState);
+var React = require("react");
+var DragDropContext_1 = require("./DragDropContext");
+var disposables_1 = require("./utils/disposables");
+var isClassComponent = require('recompose/isClassComponent').default;
+var isPlainObject = require('lodash/isPlainObject');
+var invariant = require('invariant');
+var hoistStatics = require('hoist-non-react-statics');
+var shallowEqual = require('shallowequal');
+function decorateHandler(_a) {
+ var DecoratedComponent = _a.DecoratedComponent, createHandler = _a.createHandler, createMonitor = _a.createMonitor, createConnector = _a.createConnector, registerHandler = _a.registerHandler, containerDisplayName = _a.containerDisplayName, getType = _a.getType, collect = _a.collect, options = _a.options;
+ var _b = options.arePropsEqual, arePropsEqual = _b === void 0 ? shallowEqual : _b;
+ var Decorated = DecoratedComponent;
+ var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
+ var DragDropContainer = /** @class */ (function (_super) {
+ __extends(DragDropContainer, _super);
+ function DragDropContainer(props) {
+ var _this = _super.call(this, props) || this;
+ _this.handleChange = function () {
+ var nextState = _this.getCurrentState();
+ if (!shallowEqual(nextState, _this.state)) {
+ _this.setState(nextState);
}
};
- this.disposable = new disposables_1.SerialDisposable();
- this.receiveProps(props);
- this.dispose();
+ _this.disposable = new disposables_1.SerialDisposable();
+ _this.receiveProps(props);
+ _this.dispose();
+ return _this;
}
- getHandlerId() {
+ DragDropContainer.prototype.getHandlerId = function () {
return this.handlerId;
- }
- getDecoratedComponentInstance() {
+ };
+ DragDropContainer.prototype.getDecoratedComponentInstance = function () {
if (!this.handler) {
return null;
}
return this.handler.ref.current;
- }
- shouldComponentUpdate(nextProps, nextState) {
+ };
+ DragDropContainer.prototype.shouldComponentUpdate = function (nextProps, nextState) {
return (!arePropsEqual(nextProps, this.props) ||
!shallowEqual(nextState, this.state));
- }
- componentDidMount() {
+ };
+ DragDropContainer.prototype.componentDidMount = function () {
this.disposable = new disposables_1.SerialDisposable();
this.currentType = undefined;
this.receiveProps(this.props);
this.handleChange();
- }
- componentDidUpdate(prevProps) {
+ };
+ DragDropContainer.prototype.componentDidUpdate = function (prevProps) {
if (!arePropsEqual(this.props, prevProps)) {
this.receiveProps(this.props);
this.handleChange();
}
- }
- componentWillUnmount() {
+ };
+ DragDropContainer.prototype.componentWillUnmount = function () {
this.dispose();
- }
- receiveProps(props) {
+ };
+ DragDropContainer.prototype.receiveProps = function (props) {
if (!this.handler) {
return;
}
this.handler.receiveProps(props);
this.receiveType(getType(props));
- }
- receiveType(type) {
+ };
+ DragDropContainer.prototype.receiveType = function (type) {
if (!this.handlerMonitor || !this.manager || !this.handlerConnector) {
return;
}
@@ -68,44 +95,46 @@
return;
}
this.currentType = type;
- const { handlerId, unregister } = registerHandler(type, this.handler, this.manager);
+ var _a = registerHandler(type, this.handler, this.manager), handlerId = _a.handlerId, unregister = _a.unregister;
this.handlerId = handlerId;
this.handlerMonitor.receiveHandlerId(handlerId);
this.handlerConnector.receiveHandlerId(handlerId);
- const globalMonitor = this.manager.getMonitor();
- const unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, { handlerIds: [handlerId] });
+ var globalMonitor = this.manager.getMonitor();
+ var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, { handlerIds: [handlerId] });
this.disposable.setDisposable(new disposables_1.CompositeDisposable(new disposables_1.Disposable(unsubscribe), new disposables_1.Disposable(unregister)));
- }
- dispose() {
+ };
+ DragDropContainer.prototype.dispose = function () {
this.disposable.dispose();
if (this.handlerConnector) {
this.handlerConnector.receiveHandlerId(null);
}
- }
- getCurrentState() {
+ };
+ DragDropContainer.prototype.getCurrentState = function () {
if (!this.handlerConnector) {
return {};
}
- const nextState = collect(this.handlerConnector.hooks, this.handlerMonitor);
+ var nextState = collect(this.handlerConnector.hooks, this.handlerMonitor);
if (process.env.NODE_ENV !== 'production') {
invariant(isPlainObject(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;
- }
- render() {
- return (React.createElement(DragDropContext_1.Consumer, null, ({ dragDropManager }) => {
+ };
+ DragDropContainer.prototype.render = function () {
+ var _this = this;
+ return (React.createElement(DragDropContext_1.Consumer, null, function (_a) {
+ var dragDropManager = _a.dragDropManager;
if (dragDropManager === undefined) {
return null;
}
- this.receiveDragDropManager(dragDropManager);
- return (React.createElement(Decorated, Object.assign({}, this.props, this.getCurrentState(), { ref: this.handler && isClassComponent(Decorated)
- ? this.handler.ref
+ _this.receiveDragDropManager(dragDropManager);
+ return (React.createElement(Decorated, __assign({}, _this.props, _this.getCurrentState(), { ref: _this.handler && isClassComponent(Decorated)
+ ? _this.handler.ref
: undefined })));
}));
- }
- receiveDragDropManager(dragDropManager) {
+ };
+ DragDropContainer.prototype.receiveDragDropManager = function (dragDropManager) {
if (this.manager !== undefined) {
return;
}
@@ -116,10 +145,11 @@
this.handlerMonitor = createMonitor(dragDropManager);
this.handlerConnector = createConnector(dragDropManager.getBackend());
this.handler = createHandler(this.handlerMonitor);
- }
- }
+ };
DragDropContainer.DecoratedComponent = DecoratedComponent;
- DragDropContainer.displayName = `${containerDisplayName}(${displayName})`;
+ DragDropContainer.displayName = containerDisplayName + "(" + displayName + ")";
+ return DragDropContainer;
+ }(React.Component));
return hoistStatics(DragDropContainer, DecoratedComponent);
}
exports.default = decorateHandler;

lib/cjs/DragDropContext.d.ts

@@ -10,6 +10,7 @@
/**
* Create the React Context
*/
+export declare const context: React.Context<DragDropContext<any>>;
export declare const Consumer: React.ExoticComponent<React.ConsumerProps<DragDropContext<any>>>, Provider: React.ProviderExoticComponent<React.ProviderProps<DragDropContext<any>>>;
/**
* Creates the context object we're providing
@@ -27,7 +28,7 @@
/**
* A React component that provides the React-DnD context
*/
-export declare const DragDropContextProvider: React.SFC<DragDropContextProviderProps<any>>;
+export declare const DragDropContextProvider: React.FC<DragDropContextProviderProps<any>>;
/**
* Wrap the root component of your application with DragDropContext decorator to set up React DnD.
* This lets you specify the backend, and sets up the shared DnD state behind the scenes.

lib/cjs/DragDropContext.js

@@ -1,16 +1,42 @@
"use strict";
-var _a;
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+ };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+var __assign = (this && this.__assign) || function () {
+ __assign = Object.assign || function(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
+ t[p] = s[p];
+ }
+ return t;
+ };
+ return __assign.apply(this, arguments);
+};
Object.defineProperty(exports, "__esModule", { value: true });
-const React = require("react");
-const dnd_core_1 = require("dnd-core");
-const checkDecoratorArguments_1 = require("./utils/checkDecoratorArguments");
-const invariant = require('invariant');
-const hoistStatics = require('hoist-non-react-statics');
-const isClassComponent = require('recompose/isClassComponent').default;
+var React = require("react");
+var dnd_core_1 = require("dnd-core");
+var checkDecoratorArguments_1 = require("./utils/checkDecoratorArguments");
+var invariant = require('invariant');
+var hoistStatics = require('hoist-non-react-statics');
+var isClassComponent = require('recompose/isClassComponent').default;
/**
* Create the React Context
*/
-_a = React.createContext({ dragDropManager: undefined }), exports.Consumer = _a.Consumer, exports.Provider = _a.Provider;
+exports.context = React.createContext({
+ dragDropManager: undefined,
+});
+exports.Consumer = exports.context.Consumer, exports.Provider = exports.context.Provider;
/**
* Creates the context object we're providing
* @param backend
@@ -25,8 +51,16 @@
/**
* A React component that provides the React-DnD context
*/
-exports.DragDropContextProvider = ({ backend, context, debugMode, children }) => {
- const contextValue = createChildContext(backend, context, debugMode);
+exports.DragDropContextProvider = function (_a) {
+ var backend = _a.backend, context = _a.context, debugMode = _a.debugMode, children = _a.children;
+ var contextValue = createChildContext(backend, context, debugMode);
+ React.useEffect(function () {
+ return function () {
+ return contextValue.dragDropManager.dispatch({
+ type: 'DragDropContextProvider::Exiting',
+ });
+ };
+ });
return React.createElement(exports.Provider, { value: contextValue }, children);
};
/**
@@ -37,27 +71,30 @@
*/
function DragDropContext(backendFactory, backendContext, debugMode) {
checkDecoratorArguments_1.default('DragDropContext', 'backend', backendFactory);
- const childContext = createChildContext(backendFactory, backendContext, debugMode);
+ var childContext = createChildContext(backendFactory, backendContext, debugMode);
return function decorateContext(DecoratedComponent) {
- const Decorated = DecoratedComponent;
- const displayName = Decorated.displayName || Decorated.name || 'Component';
- class DragDropContextContainer extends React.Component {
- constructor() {
- super(...arguments);
- this.ref = React.createRef();
- this.getManager = () => childContext.dragDropManager;
+ var Decorated = DecoratedComponent;
+ var displayName = Decorated.displayName || Decorated.name || 'Component';
+ var DragDropContextContainer = /** @class */ (function (_super) {
+ __extends(DragDropContextContainer, _super);
+ function DragDropContextContainer() {
+ var _this = _super !== null && _super.apply(this, arguments) || this;
+ _this.ref = React.createRef();
+ _this.getManager = function () { return childContext.dragDropManager; };
+ return _this;
}
- getDecoratedComponentInstance() {
+ DragDropContextContainer.prototype.getDecoratedComponentInstance = function () {
invariant(this.ref.current, 'In order to access an instance of the decorated component it can not be a stateless component.');
return this.ref.current;
- }
- render() {
+ };
+ DragDropContextContainer.prototype.render = function () {
return (React.createElement(exports.Provider, { value: childContext },
- React.createElement(Decorated, Object.assign({}, this.props, { ref: isClassComponent(Decorated) ? this.ref : undefined }))));
- }
- }
+ React.createElement(Decorated, __assign({}, this.props, { ref: isClassComponent(Decorated) ? this.ref : undefined }))));
+ };
DragDropContextContainer.DecoratedComponent = DecoratedComponent;
- DragDropContextContainer.displayName = `DragDropContext(${displayName})`;
+ DragDropContextContainer.displayName = "DragDropContext(" + displayName + ")";
+ return DragDropContextContainer;
+ }(React.Component));
return hoistStatics(DragDropContextContainer, DecoratedComponent);
};
}

lib/cjs/DragLayer.js

@@ -1,50 +1,77 @@
"use strict";
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+ };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+var __assign = (this && this.__assign) || function () {
+ __assign = Object.assign || function(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
+ t[p] = s[p];
+ }
+ return t;
+ };
+ return __assign.apply(this, arguments);
+};
Object.defineProperty(exports, "__esModule", { value: true });
-const React = require("react");
-const checkDecoratorArguments_1 = require("./utils/checkDecoratorArguments");
-const DragDropContext_1 = require("./DragDropContext");
-const hoistStatics = require('hoist-non-react-statics');
-const isPlainObject = require('lodash/isPlainObject');
-const invariant = require('invariant');
-const shallowEqual = require('shallowequal');
-const isClassComponent = require('recompose/isClassComponent').default;
-function DragLayer(collect, options = {}) {
+var React = require("react");
+var checkDecoratorArguments_1 = require("./utils/checkDecoratorArguments");
+var DragDropContext_1 = require("./DragDropContext");
+var hoistStatics = require('hoist-non-react-statics');
+var isPlainObject = require('lodash/isPlainObject');
+var invariant = require('invariant');
+var shallowEqual = require('shallowequal');
+var isClassComponent = require('recompose/isClassComponent').default;
+function DragLayer(collect, options) {
+ if (options === void 0) { options = {}; }
checkDecoratorArguments_1.default('DragLayer', 'collect[, options]', collect, options);
invariant(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);
invariant(isPlainObject(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) {
- const Decorated = DecoratedComponent;
- const { arePropsEqual = shallowEqual } = options;
- const displayName = Decorated.displayName || Decorated.name || 'Component';
- class DragLayerContainer extends React.Component {
- constructor() {
- super(...arguments);
- this.isCurrentlyMounted = false;
- this.ref = React.createRef();
- this.handleChange = () => {
- if (!this.isCurrentlyMounted) {
+ var Decorated = DecoratedComponent;
+ var _a = options.arePropsEqual, arePropsEqual = _a === void 0 ? shallowEqual : _a;
+ var displayName = Decorated.displayName || Decorated.name || 'Component';
+ var DragLayerContainer = /** @class */ (function (_super) {
+ __extends(DragLayerContainer, _super);
+ function DragLayerContainer() {
+ var _this = _super !== null && _super.apply(this, arguments) || this;
+ _this.isCurrentlyMounted = false;
+ _this.ref = React.createRef();
+ _this.handleChange = function () {
+ if (!_this.isCurrentlyMounted) {
return;
}
- const nextState = this.getCurrentState();
- if (!shallowEqual(nextState, this.state)) {
- this.setState(nextState);
+ var nextState = _this.getCurrentState();
+ if (!shallowEqual(nextState, _this.state)) {
+ _this.setState(nextState);
}
};
+ return _this;
}
- getDecoratedComponentInstance() {
+ DragLayerContainer.prototype.getDecoratedComponentInstance = function () {
invariant(this.ref.current, 'In order to access an instance of the decorated component it can not be a stateless component.');
return this.ref.current;
- }
- shouldComponentUpdate(nextProps, nextState) {
+ };
+ DragLayerContainer.prototype.shouldComponentUpdate = function (nextProps, nextState) {
return (!arePropsEqual(nextProps, this.props) ||
!shallowEqual(nextState, this.state));
- }
- componentDidMount() {
+ };
+ DragLayerContainer.prototype.componentDidMount = function () {
this.isCurrentlyMounted = true;
this.handleChange();
- }
- componentWillUnmount() {
+ };
+ DragLayerContainer.prototype.componentWillUnmount = function () {
this.isCurrentlyMounted = false;
if (this.unsubscribeFromOffsetChange) {
this.unsubscribeFromOffsetChange();
@@ -54,21 +81,23 @@
this.unsubscribeFromStateChange();
this.unsubscribeFromStateChange = undefined;
}
- }
- render() {
- return (React.createElement(DragDropContext_1.Consumer, null, ({ dragDropManager }) => {
+ };
+ DragLayerContainer.prototype.render = function () {
+ var _this = this;
+ return (React.createElement(DragDropContext_1.Consumer, null, function (_a) {
+ var dragDropManager = _a.dragDropManager;
if (dragDropManager === undefined) {
return null;
}
- this.receiveDragDropManager(dragDropManager);
+ _this.receiveDragDropManager(dragDropManager);
// Let componentDidMount fire to initialize the collected state
- if (!this.isCurrentlyMounted) {
+ if (!_this.isCurrentlyMounted) {
return null;
}
- return (React.createElement(Decorated, Object.assign({}, this.props, this.state, { ref: isClassComponent(Decorated) ? this.ref : undefined })));
+ return (React.createElement(Decorated, __assign({}, _this.props, _this.state, { ref: isClassComponent(Decorated) ? _this.ref : undefined })));
}));
- }
- receiveDragDropManager(dragDropManager) {
+ };
+ DragLayerContainer.prototype.receiveDragDropManager = function (dragDropManager) {
if (this.manager !== undefined) {
return;
}
@@ -76,20 +105,21 @@
invariant(typeof 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);
- const monitor = this.manager.getMonitor();
+ var monitor = this.manager.getMonitor();
this.unsubscribeFromOffsetChange = monitor.subscribeToOffsetChange(this.handleChange);
this.unsubscribeFromStateChange = monitor.subscribeToStateChange(this.handleChange);
- }
- getCurrentState() {
+ };
+ DragLayerContainer.prototype.getCurrentState = function () {
if (!this.manager) {
return {};
}
- const monitor = this.manager.getMonitor();
+ var monitor = this.manager.getMonitor();
return collect(monitor, this.props);
- }
- }
- DragLayerContainer.displayName = `DragLayer(${displayName})`;
+ };
+ DragLayerContainer.displayName = "DragLayer(" + displayName + ")";
DragLayerContainer.DecoratedComponent = DecoratedComponent;
+ return DragLayerContainer;
+ }(React.Component));
return hoistStatics(DragLayerContainer, DecoratedComponent);
};
}

lib/cjs/DragSource.js

@@ -1,14 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const checkDecoratorArguments_1 = require("./utils/checkDecoratorArguments");
-const decorateHandler_1 = require("./decorateHandler");
-const registerSource_1 = require("./registerSource");
-const createSourceFactory_1 = require("./createSourceFactory");
-const createSourceMonitor_1 = require("./createSourceMonitor");
-const createSourceConnector_1 = require("./createSourceConnector");
-const isValidType_1 = require("./utils/isValidType");
-const invariant = require('invariant');
-const isPlainObject = require('lodash/isPlainObject');
+var checkDecoratorArguments_1 = require("./utils/checkDecoratorArguments");
+var decorateHandler_1 = require("./decorateHandler");
+var registerSource_1 = require("./registerSource");
+var createSourceFactory_1 = require("./createSourceFactory");
+var DragSourceMonitorImpl_1 = require("./DragSourceMonitorImpl");
+var createSourceConnector_1 = require("./createSourceConnector");
+var isValidType_1 = require("./utils/isValidType");
+var invariant = require('invariant');
+var isPlainObject = require('lodash/isPlainObject');
/**
* Decorates a component as a dragsource
* @param type The dragsource type
@@ -16,20 +16,21 @@
* @param collect The props collector function
* @param options DnD options
*/
-function DragSource(type, spec, collect, options = {}) {
+function DragSource(type, spec, collect, options) {
+ if (options === void 0) { options = {}; }
checkDecoratorArguments_1.default('DragSource', 'type, spec, collect[, options]', type, spec, collect, options);
- let getType = type;
+ var getType = type;
if (typeof type !== 'function') {
invariant(isValidType_1.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 = () => type;
+ getType = function () { return type; };
}
invariant(isPlainObject(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);
- const createSource = createSourceFactory_1.default(spec);
+ var createSource = createSourceFactory_1.default(spec);
invariant(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. ' +
@@ -43,12 +44,14 @@
containerDisplayName: 'DragSource',
createHandler: createSource,
registerHandler: registerSource_1.default,
- createMonitor: createSourceMonitor_1.default,
+ createMonitor: function (manager) {
+ return new DragSourceMonitorImpl_1.default(manager);
+ },
createConnector: createSourceConnector_1.default,
- DecoratedComponent,
- getType,
- collect,
- options,
+ DecoratedComponent: DecoratedComponent,
+ getType: getType,
+ collect: collect,
+ options: options,
});
};
}

lib/cjs/DragSourceMonitorImpl.d.ts

@@ -0,0 +1,33 @@
+import { DragDropManager, Unsubscribe, Listener, Identifier } from 'dnd-core';
+import { DragSourceMonitor } from './interfaces';
+export default class DragSourceMonitorImpl implements DragSourceMonitor {
+ private internalMonitor;
+ private sourceId;
+ constructor(manager: DragDropManager<any>);
+ receiveHandlerId(sourceId: Identifier | null): void;
+ getHandlerId(): Identifier | null;
+ canDrag(): boolean;
+ isDragging(): boolean;
+ subscribeToStateChange(listener: Listener, options?: {
+ handlerIds: Identifier[] | undefined;
+ }): Unsubscribe;
+ isDraggingSource(sourceId: Identifier): boolean;
+ isOverTarget(targetId: Identifier, options?: {
+ shallow: boolean;
+ }): boolean;
+ getTargetIds(): Identifier[];
+ isSourcePublic(): boolean | null;
+ getSourceId(): Identifier | null;
+ subscribeToOffsetChange(listener: Listener): Unsubscribe;
+ canDragSource(sourceId: Identifier): boolean;
+ canDropOnTarget(targetId: Identifier): boolean;
+ getItemType(): string | symbol | null;
+ getItem(): any;
+ getDropResult(): any;
+ didDrop(): boolean;
+ getInitialClientOffset(): import("dnd-core").XYCoord | null;
+ getInitialSourceClientOffset(): import("dnd-core").XYCoord | null;
+ getSourceClientOffset(): import("dnd-core").XYCoord | null;
+ getClientOffset(): import("dnd-core").XYCoord | null;
+ getDifferenceFromInitialOffset(): import("dnd-core").XYCoord | null;
+}

lib/cjs/DragSourceMonitorImpl.js

@@ -0,0 +1,95 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var invariant = require('invariant');
+var isCallingCanDrag = false;
+var isCallingIsDragging = false;
+var DragSourceMonitorImpl = /** @class */ (function () {
+ function DragSourceMonitorImpl(manager) {
+ this.sourceId = null;
+ this.internalMonitor = manager.getMonitor();
+ }
+ DragSourceMonitorImpl.prototype.receiveHandlerId = function (sourceId) {
+ this.sourceId = sourceId;
+ };
+ DragSourceMonitorImpl.prototype.getHandlerId = function () {
+ return this.sourceId;
+ };
+ DragSourceMonitorImpl.prototype.canDrag = function () {
+ invariant(!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;
+ }
+ };
+ DragSourceMonitorImpl.prototype.isDragging = function () {
+ invariant(!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;
+ }
+ };
+ DragSourceMonitorImpl.prototype.subscribeToStateChange = function (listener, options) {
+ return this.internalMonitor.subscribeToStateChange(listener, options);
+ };
+ DragSourceMonitorImpl.prototype.isDraggingSource = function (sourceId) {
+ return this.internalMonitor.isDraggingSource(sourceId);
+ };
+ DragSourceMonitorImpl.prototype.isOverTarget = function (targetId, options) {
+ return this.internalMonitor.isOverTarget(targetId, options);
+ };
+ DragSourceMonitorImpl.prototype.getTargetIds = function () {
+ return this.internalMonitor.getTargetIds();
+ };
+ DragSourceMonitorImpl.prototype.isSourcePublic = function () {
+ return this.internalMonitor.isSourcePublic();
+ };
+ DragSourceMonitorImpl.prototype.getSourceId = function () {
+ return this.internalMonitor.getSourceId();
+ };
+ DragSourceMonitorImpl.prototype.subscribeToOffsetChange = function (listener) {
+ return this.internalMonitor.subscribeToOffsetChange(listener);
+ };
+ DragSourceMonitorImpl.prototype.canDragSource = function (sourceId) {
+ return this.internalMonitor.canDragSource(sourceId);
+ };
+ DragSourceMonitorImpl.prototype.canDropOnTarget = function (targetId) {
+ return this.internalMonitor.canDropOnTarget(targetId);
+ };
+ DragSourceMonitorImpl.prototype.getItemType = function () {
+ return this.internalMonitor.getItemType();
+ };
+ DragSourceMonitorImpl.prototype.getItem = function () {
+ return this.internalMonitor.getItem();
+ };
+ DragSourceMonitorImpl.prototype.getDropResult = function () {
+ return this.internalMonitor.getDropResult();
+ };
+ DragSourceMonitorImpl.prototype.didDrop = function () {
+ return this.internalMonitor.didDrop();
+ };
+ DragSourceMonitorImpl.prototype.getInitialClientOffset = function () {
+ return this.internalMonitor.getInitialClientOffset();
+ };
+ DragSourceMonitorImpl.prototype.getInitialSourceClientOffset = function () {
+ return this.internalMonitor.getInitialSourceClientOffset();
+ };
+ DragSourceMonitorImpl.prototype.getSourceClientOffset = function () {
+ return this.internalMonitor.getSourceClientOffset();
+ };
+ DragSourceMonitorImpl.prototype.getClientOffset = function () {
+ return this.internalMonitor.getClientOffset();
+ };
+ DragSourceMonitorImpl.prototype.getDifferenceFromInitialOffset = function () {
+ return this.internalMonitor.getDifferenceFromInitialOffset();
+ };
+ return DragSourceMonitorImpl;
+}());
+exports.default = DragSourceMonitorImpl;

lib/cjs/DropTarget.js

@@ -1,28 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const checkDecoratorArguments_1 = require("./utils/checkDecoratorArguments");
-const decorateHandler_1 = require("./decorateHandler");
-const registerTarget_1 = require("./registerTarget");
-const createTargetFactory_1 = require("./createTargetFactory");
-const createTargetMonitor_1 = require("./createTargetMonitor");
-const createTargetConnector_1 = require("./createTargetConnector");
-const isValidType_1 = require("./utils/isValidType");
-const invariant = require('invariant');
-const isPlainObject = require('lodash/isPlainObject');
-function DropTarget(type, spec, collect, options = {}) {
+var checkDecoratorArguments_1 = require("./utils/checkDecoratorArguments");
+var decorateHandler_1 = require("./decorateHandler");
+var registerTarget_1 = require("./registerTarget");
+var createTargetFactory_1 = require("./createTargetFactory");
+var createTargetConnector_1 = require("./createTargetConnector");
+var isValidType_1 = require("./utils/isValidType");
+var DropTargetMonitorImpl_1 = require("./DropTargetMonitorImpl");
+var invariant = require('invariant');
+var isPlainObject = require('lodash/isPlainObject');
+function DropTarget(type, spec, collect, options) {
+ if (options === void 0) { options = {}; }
checkDecoratorArguments_1.default('DropTarget', 'type, spec, collect[, options]', type, spec, collect, options);
- let getType = type;
+ var getType = type;
if (typeof type !== 'function') {
invariant(isValidType_1.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 = () => type;
+ getType = function () { return type; };
}
invariant(isPlainObject(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);
- const createTarget = createTargetFactory_1.default(spec);
+ var createTarget = createTargetFactory_1.default(spec);
invariant(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. ' +
@@ -36,12 +37,14 @@
containerDisplayName: 'DropTarget',
createHandler: createTarget,
registerHandler: registerTarget_1.default,
- createMonitor: createTargetMonitor_1.default,
+ createMonitor: function (manager) {
+ return new DropTargetMonitorImpl_1.default(manager);
+ },
createConnector: createTargetConnector_1.default,
- DecoratedComponent,
- getType,
- collect,
- options,
+ DecoratedComponent: DecoratedComponent,
+ getType: getType,
+ collect: collect,
+ options: options,
});
};
}

lib/cjs/DropTargetMonitorImpl.d.ts

@@ -0,0 +1,25 @@
+import { DragDropManager, Unsubscribe, Listener, Identifier } from 'dnd-core';
+import { DropTargetMonitor } from './interfaces';
+export default class DropTargetMonitorImpl implements DropTargetMonitor {
+ private internalMonitor;
+ private targetId;
+ constructor(manager: DragDropManager<any>);
+ receiveHandlerId(targetId: Identifier | null): void;
+ getHandlerId(): Identifier | null;
+ subscribeToStateChange(listener: Listener, options?: {
+ handlerIds: Identifier[] | undefined;
+ }): Unsubscribe;
+ canDrop(): boolean;
+ isOver(options: {
+ shallow?: boolean;
+ }): boolean;
+ getItemType(): string | symbol | null;
+ getItem(): any;
+ getDropResult(): any;
+ didDrop(): boolean;
+ getInitialClientOffset(): import("dnd-core").XYCoord | null;
+ getInitialSourceClientOffset(): import("dnd-core").XYCoord | null;
+ getSourceClientOffset(): import("dnd-core").XYCoord | null;
+ getClientOffset(): import("dnd-core").XYCoord | null;
+ getDifferenceFromInitialOffset(): import("dnd-core").XYCoord | null;
+}

lib/cjs/DropTargetMonitorImpl.js

@@ -0,0 +1,62 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var invariant = require('invariant');
+var isCallingCanDrop = false;
+var DropTargetMonitorImpl = /** @class */ (function () {
+ function DropTargetMonitorImpl(manager) {
+ this.targetId = null;
+ this.internalMonitor = manager.getMonitor();
+ }
+ DropTargetMonitorImpl.prototype.receiveHandlerId = function (targetId) {
+ this.targetId = targetId;
+ };
+ DropTargetMonitorImpl.prototype.getHandlerId = function () {
+ return this.targetId;
+ };
+ DropTargetMonitorImpl.prototype.subscribeToStateChange = function (listener, options) {
+ return this.internalMonitor.subscribeToStateChange(listener, options);
+ };
+ DropTargetMonitorImpl.prototype.canDrop = function () {
+ invariant(!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;
+ }
+ };
+ DropTargetMonitorImpl.prototype.isOver = function (options) {
+ return this.internalMonitor.isOverTarget(this.targetId, options);
+ };
+ DropTargetMonitorImpl.prototype.getItemType = function () {
+ return this.internalMonitor.getItemType();
+ };
+ DropTargetMonitorImpl.prototype.getItem = function () {
+ return this.internalMonitor.getItem();
+ };
+ DropTargetMonitorImpl.prototype.getDropResult = function () {
+ return this.internalMonitor.getDropResult();
+ };
+ DropTargetMonitorImpl.prototype.didDrop = function () {
+ return this.internalMonitor.didDrop();
+ };
+ DropTargetMonitorImpl.prototype.getInitialClientOffset = function () {
+ return this.internalMonitor.getInitialClientOffset();
+ };
+ DropTargetMonitorImpl.prototype.getInitialSourceClientOffset = function () {
+ return this.internalMonitor.getInitialSourceClientOffset();
+ };
+ DropTargetMonitorImpl.prototype.getSourceClientOffset = function () {
+ return this.internalMonitor.getSourceClientOffset();
+ };
+ DropTargetMonitorImpl.prototype.getClientOffset = function () {
+ return this.internalMonitor.getClientOffset();
+ };
+ DropTargetMonitorImpl.prototype.getDifferenceFromInitialOffset = function () {
+ return this.internalMonitor.getDifferenceFromInitialOffset();
+ };
+ return DropTargetMonitorImpl;
+}());
+exports.default = DropTargetMonitorImpl;

lib/cjs/hooks/index.d.ts

@@ -0,0 +1,3 @@
+export * from './useDragSource';
+export * from './useDropTarget';
+export * from './useDragLayer';

lib/cjs/hooks/index.js

@@ -0,0 +1,8 @@
+"use strict";
+function __export(m) {
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+Object.defineProperty(exports, "__esModule", { value: true });
+__export(require("./useDragSource"));
+__export(require("./useDropTarget"));
+__export(require("./useDragLayer"));

lib/cjs/hooks/useCollector.d.ts

@@ -0,0 +1 @@
+export declare function useCollector<T, S>(monitor: T, collect: (monitor: T) => S): [S, () => void];

lib/cjs/hooks/useCollector.js

@@ -0,0 +1,16 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var react_1 = require("react");
+var shallowEqual = require('shallowequal');
+function useCollector(monitor, collect) {
+ var _a = react_1.useState(function () { return collect(monitor); }), collected = _a[0], setCollected = _a[1];
+ var updateCollected = function () {
+ var nextValue = collect(monitor);
+ // Not async-safe, but we need a way to opt-out of state updates
+ if (!shallowEqual(collected, nextValue)) {
+ setCollected(nextValue);
+ }
+ };
+ return [collected, updateCollected];
+}
+exports.useCollector = useCollector;

lib/cjs/hooks/useDragDropManager.d.ts

@@ -0,0 +1,5 @@
+import { DragDropManager } from 'dnd-core';
+/**
+ * A hook to retrieve the DragDropManager from Context
+ */
+export declare function useDragDropManager<Context>(): DragDropManager<Context>;

lib/cjs/hooks/useDragDropManager.js

@@ -0,0 +1,14 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var react_1 = require("react");
+var DragDropContext_1 = require("../DragDropContext");
+var invariant = require('invariant');
+/**
+ * A hook to retrieve the DragDropManager from Context
+ */
+function useDragDropManager() {
+ var dragDropManager = react_1.useContext(DragDropContext_1.context).dragDropManager;
+ invariant(dragDropManager != null, 'Expected drag drop context');
+ return dragDropManager;
+}
+exports.useDragDropManager = useDragDropManager;

lib/cjs/hooks/useDragLayer.d.ts

@@ -0,0 +1,6 @@
+import { DragLayerMonitor } from '../interfaces';
+/**
+ * useDragLayer Hook (This API is experimental and subject to breaking changes in non-breaking versions)
+ * @param collector The property collector
+ */
+export declare function useDragLayer<CollectedProps>(collect: (monitor: DragLayerMonitor) => CollectedProps): CollectedProps;

lib/cjs/hooks/useDragLayer.js

@@ -0,0 +1,18 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var react_1 = require("react");
+var useDragDropManager_1 = require("./useDragDropManager");
+var useCollector_1 = require("./useCollector");
+/**
+ * useDragLayer Hook (This API is experimental and subject to breaking changes in non-breaking versions)
+ * @param collector The property collector
+ */
+function useDragLayer(collect) {
+ var dragDropManager = useDragDropManager_1.useDragDropManager();
+ var monitor = dragDropManager.getMonitor();
+ var _a = useCollector_1.useCollector(monitor, collect), collected = _a[0], updateCollected = _a[1];
+ react_1.useEffect(function () { return monitor.subscribeToOffsetChange(updateCollected); });
+ react_1.useEffect(function () { return monitor.subscribeToStateChange(updateCollected); });
+ return collected;
+}
+exports.useDragLayer = useDragLayer;

lib/cjs/hooks/useDragSource.d.ts

@@ -0,0 +1,14 @@
+import { SourceType } from 'dnd-core';
+import { DragPreviewOptions, DragSourceHookSpec } from '../interfaces';
+import { Ref } from './util';
+/**
+ * useDragSource hook (This API is experimental and subject to breaking changes in non-major versions)
+ * @param ref The drag source element
+ * @param type The drag source type
+ * @param sourceSpec The drag source specification *
+ */
+export declare function useDragSource<DragObject, CustomProps>(ref: Ref<any>, type: SourceType, sourceSpec: DragSourceHookSpec<DragObject, CustomProps> & {
+ dragSourceOptions?: {};
+ dragPreview?: Ref<any> | Element;
+ dragPreviewOptions?: DragPreviewOptions;
+}): CustomProps;

lib/cjs/hooks/useDragSourceHandler.d.ts

@@ -0,0 +1,3 @@
+import { DragSource } from 'dnd-core';
+import { DragSourceHookSpec } from '../interfaces';
+export declare function useDragSourceHandler<DragObject, CustomProps>(sourceSpec: DragSourceHookSpec<DragObject, CustomProps>): DragSource;

lib/cjs/hooks/useDragSourceHandler.js

@@ -0,0 +1,36 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var react_1 = require("react");
+function useDragSourceHandler(sourceSpec) {
+ var sourceSpecRef = react_1.useRef(sourceSpec);
+ react_1.useEffect(function () {
+ sourceSpecRef.current = sourceSpec;
+ });
+ // Can't use createSourceFactory, as semantics are different
+ var handler = react_1.useMemo(function () {
+ return ({
+ beginDrag: function (monitor, target) {
+ var beginDrag = sourceSpecRef.current.beginDrag;
+ return beginDrag(monitor);
+ },
+ canDrag: function (monitor, target) {
+ var canDrag = sourceSpecRef.current.canDrag;
+ return canDrag ? canDrag(monitor) : true;
+ },
+ isDragging: function (monitor, target) {
+ var isDragging = sourceSpecRef.current.isDragging;
+ return isDragging
+ ? isDragging(monitor)
+ : target === monitor.getSourceId();
+ },
+ endDrag: function (monitor, target) {
+ var endDrag = sourceSpecRef.current.endDrag;
+ if (endDrag) {
+ endDrag(monitor);
+ }
+ },
+ });
+ }, []);
+ return handler;
+}
+exports.useDragSourceHandler = useDragSourceHandler;

lib/cjs/hooks/useDragSource.js

@@ -0,0 +1,44 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var react_1 = require("react");
+var useDragSourceHandler_1 = require("./useDragSourceHandler");
+var useDragDropManager_1 = require("./useDragDropManager");
+var util_1 = require("./util");
+var useMonitorOutput_1 = require("./useMonitorOutput");
+var useDragSourceMonitor_1 = require("./useDragSourceMonitor");
+/**
+ * useDragSource hook (This API is experimental and subject to breaking changes in non-major versions)
+ * @param ref The drag source element
+ * @param type The drag source type
+ * @param sourceSpec The drag source specification *
+ */
+function useDragSource(ref, type, sourceSpec) {
+ var manager = useDragDropManager_1.useDragDropManager();
+ var backend = manager.getBackend();
+ var handler = useDragSourceHandler_1.useDragSourceHandler(sourceSpec);
+ var sourceMonitor = useDragSourceMonitor_1.useDragSourceMonitor(type, handler, manager);
+ /*
+ * Connect the Drag Source Element to the Backend
+ */
+ react_1.useEffect(function connectDragSource() {
+ var dragSourceNode = ref.current;
+ var dragSourceOptions = sourceSpec.dragSourceOptions;
+ return backend.connectDragSource(sourceMonitor.getHandlerId(), dragSourceNode, dragSourceOptions);
+ }, []);
+ /*
+ * Connect the Drag Previem Element to the Backend
+ */
+ react_1.useEffect(function connectDragPreview() {
+ if (sourceSpec.dragPreview == null) {
+ return undefined;
+ }
+ var dragPreviewNode = util_1.isRef(sourceSpec.dragPreview)
+ ? sourceSpec.dragPreview.current
+ : sourceSpec.dragPreview;
+ var dragPreviewOptions = sourceSpec.dragPreviewOptions;
+ return backend.connectDragPreview(sourceMonitor.getHandlerId(), dragPreviewNode, dragPreviewOptions);
+ }, []);
+ var collector = sourceSpec.collect || (function () { return ({}); });
+ return useMonitorOutput_1.useMonitorOutput(sourceMonitor, collector);
+}
+exports.useDragSource = useDragSource;

lib/cjs/hooks/useDragSourceMonitor.d.ts

@@ -0,0 +1,3 @@
+import { DragDropManager, SourceType, DragSource } from 'dnd-core';
+import DragSourceMonitorImpl from '../DragSourceMonitorImpl';
+export declare function useDragSourceMonitor<Context>(type: SourceType, source: DragSource, manager: DragDropManager<Context>): DragSourceMonitorImpl;

lib/cjs/hooks/useDragSourceMonitor.js

@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var react_1 = require("react");
+var registerSource_1 = require("../registerSource");
+var DragSourceMonitorImpl_1 = require("../DragSourceMonitorImpl");
+function useDragSourceMonitor(type, source, manager) {
+ var monitor = react_1.useMemo(function () { return new DragSourceMonitorImpl_1.default(manager); }, [manager]);
+ react_1.useEffect(function registerSourceWithMonitor() {
+ var _a = registerSource_1.default(type, source, manager), handlerId = _a.handlerId, unregister = _a.unregister;
+ monitor.receiveHandlerId(handlerId);
+ return unregister;
+ }, [monitor]);
+ return monitor;
+}
+exports.useDragSourceMonitor = useDragSourceMonitor;

lib/cjs/hooks/useDropTarget.d.ts

@@ -0,0 +1,12 @@
+import { TargetType } from 'dnd-core';
+import { DropTargetHookSpec } from '../interfaces';
+import { Ref } from './util';
+/**
+ * useDropTarget Hook (This API is experimental and subject to breaking changes in non-breaking versions)
+ * @param ref The drop target's ref
+ * @param type The drop target type
+ * @param targetSpec The drop target specification
+ */
+export declare function useDropTarget<CustomProps>(ref: Ref<any>, type: TargetType, targetSpec: DropTargetHookSpec<CustomProps> & {
+ dropTargetOptions?: {};
+}): CustomProps;

lib/cjs/hooks/useDropTargetHandler.d.ts

@@ -0,0 +1,3 @@
+import { DropTargetHookSpec } from '../interfaces';
+import { DropTarget } from 'dnd-core';
+export declare function useDropTargetHandler<CustomProps>(targetSpec: DropTargetHookSpec<CustomProps>): DropTarget;

lib/cjs/hooks/useDropTargetHandler.js

@@ -0,0 +1,32 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var React = require("react");
+function useDropTargetHandler(targetSpec) {
+ var targetSpecRef = React.useRef(targetSpec);
+ React.useEffect(function updateDropTargetSpec() {
+ targetSpecRef.current = targetSpec;
+ });
+ // Can't use createSourceFactory, as semantics are different
+ var handler = React.useMemo(function () {
+ return ({
+ canDrop: function (monitor, targetId) {
+ var canDrop = targetSpecRef.current.canDrop;
+ return canDrop ? canDrop(monitor) : true;
+ },
+ hover: function (monitor, targetId) {
+ var hover = targetSpecRef.current.hover;
+ if (hover) {
+ hover(monitor);
+ }
+ },
+ drop: function (monitor, targetId) {
+ var drop = targetSpecRef.current.drop;
+ if (drop) {
+ drop(monitor);
+ }
+ },
+ });
+ }, []);
+ return handler;
+}
+exports.useDropTargetHandler = useDropTargetHandler;

lib/cjs/hooks/useDropTarget.js

@@ -0,0 +1,32 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var react_1 = require("react");
+var useDragDropManager_1 = require("./useDragDropManager");
+var useDropTargetHandler_1 = require("./useDropTargetHandler");
+var useMonitorOutput_1 = require("./useMonitorOutput");
+var useDropTargetMonitor_1 = require("./useDropTargetMonitor");
+/**
+ * useDropTarget Hook (This API is experimental and subject to breaking changes in non-breaking versions)
+ * @param ref The drop target's ref
+ * @param type The drop target type
+ * @param targetSpec The drop target specification
+ */
+function useDropTarget(ref, type, targetSpec) {
+ var manager = useDragDropManager_1.useDragDropManager();
+ var backend = manager.getBackend();
+ var handler = useDropTargetHandler_1.useDropTargetHandler(targetSpec);
+ var targetMonitor = useDropTargetMonitor_1.useDropTargetMonitor(type, handler, manager);
+ /*
+ * Connect the Drop Target Element to the Backend
+ */
+ react_1.useEffect(function connectDropTarget() {
+ var dropTargetNode = ref.current;
+ if (dropTargetNode) {
+ var dropTargetOptions = targetSpec.dropTargetOptions;
+ return backend.connectDropTarget(targetMonitor.getHandlerId(), dropTargetNode, dropTargetOptions);
+ }
+ }, []);
+ var collector = targetSpec.collect || (function () { return ({}); });
+ return useMonitorOutput_1.useMonitorOutput(targetMonitor, collector);
+}
+exports.useDropTarget = useDropTarget;

lib/cjs/hooks/useDropTargetMonitor.d.ts

@@ -0,0 +1,3 @@
+import { DragDropManager, TargetType, DropTarget } from 'dnd-core';
+import { DropTargetMonitor } from '../interfaces';
+export declare function useDropTargetMonitor<Context>(type: TargetType, target: DropTarget, manager: DragDropManager<Context>): DropTargetMonitor;

lib/cjs/hooks/useDropTargetMonitor.js

@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var react_1 = require("react");
+var registerTarget_1 = require("../registerTarget");
+var DropTargetMonitorImpl_1 = require("../DropTargetMonitorImpl");
+function useDropTargetMonitor(type, target, manager) {
+ var monitor = react_1.useMemo(function () { return new DropTargetMonitorImpl_1.default(manager); }, [manager]);
+ react_1.useEffect(function registerTargetWithMonitor() {
+ var _a = registerTarget_1.default(type, target, manager), handlerId = _a.handlerId, unregister = _a.unregister;
+ monitor.receiveHandlerId(handlerId);
+ return unregister;
+ }, [monitor]);
+ return monitor;
+}
+exports.useDropTargetMonitor = useDropTargetMonitor;

lib/cjs/hooks/useMonitorOutput.d.ts

@@ -0,0 +1,3 @@
+import { HandlerManager } from '../interfaces';
+import { DragDropMonitor } from 'dnd-core';
+export declare function useMonitorOutput<Monitor extends DragDropMonitor & HandlerManager, Collected>(monitor: Monitor, collect: (monitor: Monitor) => Collected): Collected;

lib/cjs/hooks/useMonitorOutput.js

@@ -0,0 +1,20 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var react_1 = require("react");
+var useCollector_1 = require("./useCollector");
+function useMonitorOutput(monitor, collect) {
+ var _a = useCollector_1.useCollector(monitor, collect), collected = _a[0], updateCollected = _a[1];
+ // This runs on every render. There will be ways to optimise this, but for
+ // now, this is the most correct thing to do.
+ react_1.useEffect(function subscribeToMonitorStateChange() {
+ var handlerId = monitor.getHandlerId();
+ if (handlerId == null) {
+ return undefined;
+ }
+ return monitor.subscribeToStateChange(updateCollected, {
+ handlerIds: [handlerId],
+ });
+ });
+ return collected;
+}
+exports.useMonitorOutput = useMonitorOutput;

lib/cjs/hooks/util.d.ts

@@ -0,0 +1,4 @@
+export interface Ref<T> {
+ current: T;
+}
+export declare function isRef(obj: any): boolean;

lib/cjs/hooks/util.js

@@ -0,0 +1,10 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+function isRef(obj) {
+ if (obj !== null && typeof obj === 'object') {
+ var keys = Object.keys(obj);
+ return keys.length === 1 && keys[0] === 'current';
+ }
+ return false;
+}
+exports.isRef = isRef;

lib/cjs/index.d.ts

@@ -2,4 +2,5 @@
export { default as DragLayer } from './DragLayer';
export { default as DragSource } from './DragSource';
export { default as DropTarget } from './DropTarget';
+export * from './hooks';
export * from './interfaces';

lib/cjs/index.js

@@ -1,4 +1,7 @@
"use strict";
+function __export(m) {
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
Object.defineProperty(exports, "__esModule", { value: true });
var DragDropContext_1 = require("./DragDropContext");
exports.DragDropContext = DragDropContext_1.DragDropContext;
@@ -9,3 +12,4 @@
exports.DragSource = DragSource_1.default;
var DropTarget_1 = require("./DropTarget");
exports.DropTarget = DropTarget_1.default;
+__export(require("./hooks"));

lib/cjs/interfaces.d.ts

@@ -1,6 +1,10 @@
import * as React from 'react';
-import { XYCoord, DragDropMonitor, Identifier, DragDropManager } from 'dnd-core';
+import { XYCoord, Identifier, DragDropManager } from 'dnd-core';
export { XYCoord };
+export interface HandlerManager {
+ receiveHandlerId: (handlerId: Identifier | null) => void;
+ getHandlerId: () => Identifier | null;
+}
/**
* The React Component that manages the DragDropContext for its children.
*/
@@ -29,7 +33,7 @@
DecoratedComponent: React.ComponentType<Props>;
new (props?: Props, context?: any): DndComponent<Props>;
}
-export interface DragSourceMonitor extends DragDropMonitor {
+export interface DragSourceMonitor extends HandlerManager {
/**
* Returns true if no drag operation is in progress, and the owner's canDrag() returns true or is not defined.
*/
@@ -82,7 +86,7 @@
*/
getSourceClientOffset(): XYCoord | null;
}
-export interface DropTargetMonitor {
+export interface DropTargetMonitor extends HandlerManager {
/**
* Returns true if there is a drag operation in progress, and the owner's canDrop() returns true or is not defined.
*/
@@ -213,6 +217,39 @@
*/
canDrop?: (props: Props, monitor: DropTargetMonitor) => boolean;
}
+/**
+ * Interface for the DropTarget specification object
+ */
+export interface DropTargetHookSpec<CollectedProps> {
+ /**
+ * Optional.
+ * Called when a compatible item is dropped on the target. You may either return undefined, or a plain object.
+ * If you return an object, it is going to become the drop result and will be available to the drag source in its
+ * endDrag method as monitor.getDropResult(). This is useful in case you want to perform different actions
+ * depending on which target received the drop. If you have nested drop targets, you can test whether a nested
+ * target has already handled drop by checking monitor.didDrop() and monitor.getDropResult(). Both this method and
+ * the source's endDrag method are good places to fire Flux actions. This method will not be called if canDrop()
+ * is defined and returns false.
+ */
+ drop?: (monitor: DropTargetMonitor) => any;
+ /**
+ * Optional.
+ * Called when an item is hovered over the component. You can check monitor.isOver({ shallow: true }) to test whether
+ * the hover happens over just the current target, or over a nested one. Unlike drop(), this method will be called even
+ * if canDrop() is defined and returns false. You can check monitor.canDrop() to test whether this is the case.
+ */
+ hover?: (monitor: DropTargetMonitor) => void;
+ /**
+ * Optional. Use it to specify whether the drop target is able to accept the item. If you want to always allow it, just
+ * omit this method. Specifying it is handy if you'd like to disable dropping based on some predicate over props or
+ * monitor.getItem(). Note: You may not call monitor.canDrop() inside this method.
+ */
+ canDrop?: (monitor: DropTargetMonitor) => boolean;
+ /**
+ * A function to collect rendering properties
+ */
+ collect?: (monitor: DropTargetMonitor) => CollectedProps;
+}
export interface DragSourceSpec<Props, DragObject> {
/**
* Required.
@@ -251,6 +288,48 @@
*/
isDragging?: (props: Props, monitor: DragSourceMonitor) => boolean;
}
+export interface DragSourceHookSpec<DragObject, CollectedProps> {
+ /**
+ * Required.
+ * When the dragging starts, beginDrag is called. You must return a plain JavaScript object describing the
+ * data being dragged. What you return is the only information available to the drop targets about the drag
+ * source so it's important to pick the minimal data they need to know. You may be tempted to put a reference
+ * to the component into it, but you should try very hard to avoid doing this because it couples the drag
+ * sources and drop targets. It's a good idea to return something like { id: props.id } from this method.
+ */
+ beginDrag: (monitor: DragSourceMonitor) => DragObject;
+ /**
+ * Optional.
+ * When the dragging stops, endDrag is called. For every beginDrag call, a corresponding endDrag call is guaranteed.
+ * You may call monitor.didDrop() to check whether or not the drop was handled by a compatible drop target. If it was handled,
+ * and the drop target specified a drop result by returning a plain object from its drop() method, it will be available as
+ * monitor.getDropResult(). This method is a good place to fire a Flux action. Note: If the component is unmounted while dragging,
+ * component parameter is set to be null.
+ */
+ endDrag?: (monitor: DragSourceMonitor) => void;
+ /**
+ * Optional.
+ * Use it to specify whether the dragging is currently allowed. If you want to always allow it, just omit this method.
+ * Specifying it is handy if you'd like to disable dragging based on some predicate over props. Note: You may not call
+ * monitor.canDrag() inside this method.
+ */
+ canDrag?: (monitor: DragSourceMonitor) => boolean;
+ /**
+ * Optional.
+ * By default, only the drag source that initiated the drag operation is considered to be dragging. You can
+ * override this behavior by defining a custom isDragging method. It might return something like props.id === monitor.getItem().id.
+ * Do this if the original component may be unmounted during the dragging and later “resurrected” with a different parent.
+ * For example, when moving a card across the lists in a Kanban board, you want it to retain the dragged appearance—even though
+ * technically, the component gets unmounted and a different one gets mounted every time you move it to another list.
+ *
+ * Note: You may not call monitor.isDragging() inside this method.
+ */
+ isDragging?: (monitor: DragSourceMonitor) => boolean;
+ /**
+ * A function to collect rendering properties
+ */
+ collect?: (monitor: DragSourceMonitor) => CollectedProps;
+}
/**
* Options for the Drag Sources, Drop Tragets, and Drag Layers annotation
*/

lib/cjs/registerSource.d.ts

@@ -1,5 +1,5 @@
-import { DragDropManager, DragSource, Unsubscribe } from 'dnd-core';
-export default function registerSource<Context>(type: string, source: DragSource, manager: DragDropManager<Context>): {
- handlerId: string;
+import { DragDropManager, DragSource, Unsubscribe, Identifier, SourceType } from 'dnd-core';
+export default function registerSource<Context>(type: SourceType, source: DragSource, manager: DragDropManager<Context>): {
+ handlerId: Identifier;
unregister: Unsubscribe;
};

lib/cjs/registerSource.js

@@ -1,14 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function registerSource(type, source, manager) {
- const registry = manager.getRegistry();
- const sourceId = registry.addSource(type, source);
- function unregisterSource() {
- registry.removeSource(sourceId);
- }
+ var registry = manager.getRegistry();
+ var sourceId = registry.addSource(type, source);
return {
handlerId: sourceId,
- unregister: unregisterSource,
+ unregister: function () { return registry.removeSource(sourceId); },
};
}
exports.default = registerSource;

lib/cjs/registerTarget.d.ts

@@ -1,5 +1,5 @@
-import { DragDropManager, DropTarget, Unsubscribe } from 'dnd-core';
-export default function registerTarget<Context>(type: string, target: DropTarget, manager: DragDropManager<Context>): {
- handlerId: string;
+import { DragDropManager, DropTarget, Unsubscribe, Identifier, TargetType } from 'dnd-core';
+export default function registerTarget<Context>(type: TargetType, target: DropTarget, manager: DragDropManager<Context>): {
+ handlerId: Identifier;
unregister: Unsubscribe;
};

lib/cjs/registerTarget.js

@@ -1,14 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function registerTarget(type, target, manager) {
- const registry = manager.getRegistry();
- const targetId = registry.addTarget(type, target);
- function unregisterTarget() {
- registry.removeTarget(targetId);
- }
+ var registry = manager.getRegistry();
+ var targetId = registry.addTarget(type, target);
return {
handlerId: targetId,
- unregister: unregisterTarget,
+ unregister: function () { return registry.removeTarget(targetId); },
};
}
exports.default = registerTarget;

lib/cjs/utils/checkDecoratorArguments.js

@@ -1,12 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-function checkDecoratorArguments(functionName, signature, ...args) {
+function checkDecoratorArguments(functionName, signature) {
+ var args = [];
+ for (var _i = 2; _i < arguments.length; _i++) {
+ args[_i - 2] = arguments[_i];
+ }
if (process.env.NODE_ENV !== 'production') {
- for (const arg of args) {
+ for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {
+ var arg = args_1[_a];
if (arg && arg.prototype && arg.prototype.render) {
// tslint: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. ` +
+ ("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;
}

lib/cjs/utils/cloneWithRef.js

@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const react_1 = require("react");
-const invariant = require('invariant');
+var react_1 = require("react");
+var invariant = require('invariant');
function setRef(ref, node) {
if (typeof ref === 'function') {
ref(node);
@@ -11,7 +11,7 @@
}
}
function cloneWithRef(element, newRef) {
- const previousRef = element.ref;
+ var previousRef = element.ref;
invariant(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');
@@ -22,7 +22,7 @@
});
}
return react_1.cloneElement(element, {
- ref: (node) => {
+ ref: function (node) {
setRef(newRef, node);
if (previousRef) {
setRef(previousRef, node);

lib/cjs/utils/disposables/CompositeDisposable.js

@@ -4,8 +4,12 @@
* Represents a group of disposable resources that are disposed together.
* @constructor
*/
-class CompositeDisposable {
- constructor(...disposables) {
+var CompositeDisposable = /** @class */ (function () {
+ function CompositeDisposable() {
+ var disposables = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ disposables[_i] = arguments[_i];
+ }
this.isDisposed = false;
this.disposables = disposables;
}
@@ -13,23 +17,23 @@
* Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
* @param {Any} item Disposable to add.
*/
- add(item) {
+ CompositeDisposable.prototype.add = function (item) {
if (this.isDisposed) {
item.dispose();
}
else {
this.disposables.push(item);
}
- }
+ };
/**
* Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
* @param {Any} item Disposable to remove.
* @returns {Boolean} true if found; false otherwise.
*/
- remove(item) {
- let shouldDispose = false;
+ CompositeDisposable.prototype.remove = function (item) {
+ var shouldDispose = false;
if (!this.isDisposed) {
- const idx = this.disposables.indexOf(item);
+ var idx = this.disposables.indexOf(item);
if (idx !== -1) {
shouldDispose = true;
this.disposables.splice(idx, 1);
@@ -37,40 +41,41 @@
}
}
return shouldDispose;
- }
+ };
/**
* Disposes all disposables in the group and removes them from the group but
* does not dispose the CompositeDisposable.
*/
- clear() {
+ CompositeDisposable.prototype.clear = function () {
if (!this.isDisposed) {
- const len = this.disposables.length;
- const currentDisposables = new Array(len);
- for (let i = 0; i < len; i++) {
+ var len = this.disposables.length;
+ var currentDisposables = new Array(len);
+ for (var i = 0; i < len; i++) {
currentDisposables[i] = this.disposables[i];
}
this.disposables = [];
- for (let i = 0; i < len; i++) {
+ for (var i = 0; i < len; i++) {
currentDisposables[i].dispose();
}
}
- }
+ };
/**
* Disposes all disposables in the group and removes them from the group.
*/
- dispose() {
+ CompositeDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
- const len = this.disposables.length;
- const currentDisposables = new Array(len);
- for (let i = 0; i < len; i++) {
+ var len = this.disposables.length;
+ var currentDisposables = new Array(len);
+ for (var i = 0; i < len; i++) {
currentDisposables[i] = this.disposables[i];
}
this.disposables = [];
- for (let i = 0; i < len; i++) {
+ for (var i = 0; i < len; i++) {
currentDisposables[i].dispose();
}
}
- }
-}
+ };
+ return CompositeDisposable;
+}());
exports.CompositeDisposable = CompositeDisposable;

lib/cjs/utils/disposables/Disposable.js

@@ -1,14 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const isFunction = require('lodash/isFunction');
-const noop = require('lodash/noop');
+var isFunction = require('lodash/isFunction');
+var noop = require('lodash/noop');
/**
* Provides a set of static methods for creating Disposables.
* @param {Function} action Action to run during the first call to dispose.
* The action is guaranteed to be run at most once.
*/
-class Disposable {
- constructor(action) {
+var Disposable = /** @class */ (function () {
+ function Disposable(action) {
this.isDisposed = false;
this.action = isFunction(action) ? action : noop;
}
@@ -17,31 +17,32 @@
* @param {Object} Object to test whether it has a dispose method
* @returns {Boolean} true if a disposable object, else false.
*/
- static isDisposable(d) {
+ Disposable.isDisposable = function (d) {
return d && isFunction(d.dispose);
- }
- static _fixup(result) {
+ };
+ Disposable._fixup = function (result) {
return Disposable.isDisposable(result) ? result : Disposable.empty;
- }
+ };
/**
* Creates a disposable object that invokes the specified action when disposed.
* @param {Function} dispose Action to run during the first call to dispose.
* The action is guaranteed to be run at most once.
* @return {Disposable} The disposable object that runs the given action upon disposal.
*/
- static create(action) {
+ Disposable.create = function (action) {
return new Disposable(action);
- }
+ };
/** Performs the task of cleaning up resources. */
- dispose() {
+ Disposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.action();
this.isDisposed = true;
}
- }
-}
-/**
+ };
+ /**
* Gets the disposable that does nothing when disposed.
*/
-Disposable.empty = { dispose: noop };
+ Disposable.empty = { dispose: noop };
+ return Disposable;
+}());
exports.Disposable = Disposable;

lib/cjs/utils/disposables/SerialDisposable.js

@@ -5,21 +5,21 @@
* be replaced by another disposable resource, causing automatic disposal of
* the previous underlying disposable resource.
*/
-class SerialDisposable {
- constructor() {
+var SerialDisposable = /** @class */ (function () {
+ function SerialDisposable() {
this.isDisposed = false;
}
/**
* Gets the underlying disposable.
* @returns {Any} the underlying disposable.
*/
- getDisposable() {
+ SerialDisposable.prototype.getDisposable = function () {
return this.current;
- }
- setDisposable(value) {
- const shouldDispose = this.isDisposed;
+ };
+ SerialDisposable.prototype.setDisposable = function (value) {
+ var shouldDispose = this.isDisposed;
if (!shouldDispose) {
- const old = this.current;
+ var old = this.current;
this.current = value;
if (old) {
old.dispose();
@@ -28,17 +28,18 @@
if (shouldDispose && value) {
value.dispose();
}
- }
+ };
/** Performs the task of cleaning up resources. */
- dispose() {
+ SerialDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
- const old = this.current;
+ var old = this.current;
this.current = undefined;
if (old) {
old.dispose();
}
}
- }
-}
+ };
+ return SerialDisposable;
+}());
exports.SerialDisposable = SerialDisposable;

lib/cjs/utils/isValidType.js

@@ -5,6 +5,6 @@
typeof type === 'symbol' ||
(!!allowArray &&
Array.isArray(type) &&
- type.every(t => isValidType(t, false))));
+ type.every(function (t) { return isValidType(t, false); })));
}
exports.default = isValidType;

lib/cjs/wrapConnectorHooks.js

@@ -1,42 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const react_1 = require("react");
-const cloneWithRef_1 = require("./utils/cloneWithRef");
+var react_1 = require("react");
+var cloneWithRef_1 = require("./utils/cloneWithRef");
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;
}
- const displayName = element.type.displayName || element.type.name || 'the component';
+ 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 ` +
+ ("You can either wrap " + displayName + " into a <div>, or turn it into a ") +
'drag source or a drop target itself.');
}
function wrapHookToRecognizeElement(hook) {
- return (elementOrNode = null, options = null) => {
+ return function (elementOrNode, options) {
+ if (elementOrNode === void 0) { elementOrNode = null; }
+ if (options === void 0) { options = null; }
// When passed a node, call the hook straight away.
if (!react_1.isValidElement(elementOrNode)) {
- const node = 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.
- const element = elementOrNode;
+ var element = elementOrNode;
throwIfCompositeComponentElement(element);
// When no options are passed, use the hook directly
- const ref = options ? (node) => hook(node, options) : hook;
+ var ref = options ? function (node) { return hook(node, options); } : hook;
return cloneWithRef_1.default(element, ref);
};
}
function wrapConnectorHooks(hooks) {
- const wrappedHooks = {};
- Object.keys(hooks).forEach(key => {
- const hook = hooks[key];
- const wrappedHook = wrapHookToRecognizeElement(hook);
- wrappedHooks[key] = () => wrappedHook;
+ var wrappedHooks = {};
+ Object.keys(hooks).forEach(function (key) {
+ var hook = hooks[key];
+ var wrappedHook = wrapHookToRecognizeElement(hook);
+ wrappedHooks[key] = function () { return wrappedHook; };
});
return wrappedHooks;
}

lib/esm/createSourceConnector.d.ts

@@ -1,5 +1,5 @@
import { Backend } from 'dnd-core';
export default function createSourceConnector(backend: Backend): {
- receiveHandlerId: (handlerId: string) => void;
+ receiveHandlerId: (handlerId: string | symbol) => void;
hooks: any;
};

lib/esm/createSourceMonitor.d.ts

@@ -1,3 +0,0 @@
-import { DragDropManager } from 'dnd-core';
-import { DragSourceMonitor } from './interfaces';
-export default function createSourceMonitor<Context>(manager: DragDropManager<Context>): DragSourceMonitor;

lib/esm/createSourceMonitor.js

@@ -1,90 +0,0 @@
-const invariant = require('invariant');
-let isCallingCanDrag = false;
-let isCallingIsDragging = false;
-class SourceMonitor {
- constructor(manager) {
- this.internalMonitor = manager.getMonitor();
- }
- receiveHandlerId(sourceId) {
- this.sourceId = sourceId;
- }
- canDrag() {
- invariant(!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;
- }
- }
- isDragging() {
- invariant(!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;
- }
- }
- subscribeToStateChange(listener, options) {
- return this.internalMonitor.subscribeToStateChange(listener, options);
- }
- isDraggingSource(sourceId) {
- return this.internalMonitor.isDraggingSource(sourceId);
- }
- isOverTarget(targetId, options) {
- return this.internalMonitor.isOverTarget(targetId, options);
- }
- getTargetIds() {
- return this.internalMonitor.getTargetIds();
- }
- isSourcePublic() {
- return this.internalMonitor.isSourcePublic();
- }
- getSourceId() {
- return this.internalMonitor.getSourceId();
- }
- subscribeToOffsetChange(listener) {
- return this.internalMonitor.subscribeToOffsetChange(listener);
- }
- canDragSource(sourceId) {
- return this.internalMonitor.canDragSource(sourceId);
- }
- canDropOnTarget(targetId) {
- return this.internalMonitor.canDropOnTarget(targetId);
- }
- getItemType() {
- return this.internalMonitor.getItemType();
- }
- getItem() {
- return this.internalMonitor.getItem();
- }
- getDropResult() {
- return this.internalMonitor.getDropResult();
- }
- didDrop() {
- return this.internalMonitor.didDrop();
- }
- getInitialClientOffset() {
- return this.internalMonitor.getInitialClientOffset();
- }
- getInitialSourceClientOffset() {
- return this.internalMonitor.getInitialSourceClientOffset();
- }
- getSourceClientOffset() {
- return this.internalMonitor.getSourceClientOffset();
- }
- getClientOffset() {
- return this.internalMonitor.getClientOffset();
- }
- getDifferenceFromInitialOffset() {
- return this.internalMonitor.getDifferenceFromInitialOffset();
- }
-}
-export default function createSourceMonitor(manager) {
- return new SourceMonitor(manager);
-}

lib/esm/createTargetConnector.d.ts

@@ -1,5 +1,5 @@
import { Backend } from 'dnd-core';
export default function createTargetConnector(backend: Backend): {
- receiveHandlerId: (handlerId: string) => void;
+ receiveHandlerId: (handlerId: string | symbol) => void;
hooks: any;
};

lib/esm/createTargetMonitor.d.ts

@@ -1,22 +0,0 @@
-import { DragDropManager } from 'dnd-core';
-import { DropTargetMonitor } from './interfaces';
-export declare class TargetMonitor implements DropTargetMonitor {
- private internalMonitor;
- private targetId;
- constructor(manager: DragDropManager<any>);
- receiveHandlerId(targetId: string): void;
- canDrop(): boolean;
- isOver(options: {
- shallow?: boolean;
- }): boolean;
- getItemType(): string | symbol | null;
- getItem(): any;
- getDropResult(): any;
- didDrop(): boolean;
- getInitialClientOffset(): import("dnd-core").XYCoord | null;
- getInitialSourceClientOffset(): import("dnd-core").XYCoord | null;
- getSourceClientOffset(): import("dnd-core").XYCoord | null;
- getClientOffset(): import("dnd-core").XYCoord | null;
- getDifferenceFromInitialOffset(): import("dnd-core").XYCoord | null;
-}
-export default function createTargetMonitor<Context>(manager: DragDropManager<Context>): DropTargetMonitor;

lib/esm/createTargetMonitor.js

@@ -1,54 +0,0 @@
-const invariant = require('invariant');
-let isCallingCanDrop = false;
-export class TargetMonitor {
- constructor(manager) {
- this.internalMonitor = manager.getMonitor();
- }
- receiveHandlerId(targetId) {
- this.targetId = targetId;
- }
- canDrop() {
- invariant(!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;
- }
- }
- isOver(options) {
- return this.internalMonitor.isOverTarget(this.targetId, options);
- }
- getItemType() {
- return this.internalMonitor.getItemType();
- }
- getItem() {
- return this.internalMonitor.getItem();
- }
- getDropResult() {
- return this.internalMonitor.getDropResult();
- }
- didDrop() {
- return this.internalMonitor.didDrop();
- }
- getInitialClientOffset() {
- return this.internalMonitor.getInitialClientOffset();
- }
- getInitialSourceClientOffset() {
- return this.internalMonitor.getInitialSourceClientOffset();
- }
- getSourceClientOffset() {
- return this.internalMonitor.getSourceClientOffset();
- }
- getClientOffset() {
- return this.internalMonitor.getClientOffset();
- }
- getDifferenceFromInitialOffset() {
- return this.internalMonitor.getDifferenceFromInitialOffset();
- }
-}
-export default function createTargetMonitor(manager) {
- return new TargetMonitor(manager);
-}

lib/esm/DragDropContext.d.ts

@@ -10,6 +10,7 @@
/**
* Create the React Context
*/
+export declare const context: React.Context<DragDropContext<any>>;
export declare const Consumer: React.ExoticComponent<React.ConsumerProps<DragDropContext<any>>>, Provider: React.ProviderExoticComponent<React.ProviderProps<DragDropContext<any>>>;
/**
* Creates the context object we're providing
@@ -27,7 +28,7 @@
/**
* A React component that provides the React-DnD context
*/
-export declare const DragDropContextProvider: React.SFC<DragDropContextProviderProps<any>>;
+export declare const DragDropContextProvider: React.FC<DragDropContextProviderProps<any>>;
/**
* Wrap the root component of your application with DragDropContext decorator to set up React DnD.
* This lets you specify the backend, and sets up the shared DnD state behind the scenes.

lib/esm/DragDropContext.js

@@ -7,7 +7,10 @@
/**
* Create the React Context
*/
-export const { Consumer, Provider } = React.createContext({ dragDropManager: undefined });
+export const context = React.createContext({
+ dragDropManager: undefined,
+});
+export const { Consumer, Provider } = context;
/**
* Creates the context object we're providing
* @param backend
@@ -23,6 +26,11 @@
*/
export const DragDropContextProvider = ({ backend, context, debugMode, children }) => {
const contextValue = createChildContext(backend, context, debugMode);
+ React.useEffect(() => {
+ return () => contextValue.dragDropManager.dispatch({
+ type: 'DragDropContextProvider::Exiting',
+ });
+ });
return React.createElement(Provider, { value: contextValue }, children);
};
/**

lib/esm/DragSource.js

@@ -2,7 +2,7 @@
import decorateHandler from './decorateHandler';
import registerSource from './registerSource';
import createSourceFactory from './createSourceFactory';
-import createSourceMonitor from './createSourceMonitor';
+import DragSourceMonitorImpl from './DragSourceMonitorImpl';
import createSourceConnector from './createSourceConnector';
import isValidType from './utils/isValidType';
const invariant = require('invariant');
@@ -41,7 +41,7 @@
containerDisplayName: 'DragSource',
createHandler: createSource,
registerHandler: registerSource,
- createMonitor: createSourceMonitor,
+ createMonitor: (manager) => new DragSourceMonitorImpl(manager),
createConnector: createSourceConnector,
DecoratedComponent,
getType,

lib/esm/DragSourceMonitorImpl.d.ts

@@ -0,0 +1,33 @@
+import { DragDropManager, Unsubscribe, Listener, Identifier } from 'dnd-core';
+import { DragSourceMonitor } from './interfaces';
+export default class DragSourceMonitorImpl implements DragSourceMonitor {
+ private internalMonitor;
+ private sourceId;
+ constructor(manager: DragDropManager<any>);
+ receiveHandlerId(sourceId: Identifier | null): void;
+ getHandlerId(): Identifier | null;
+ canDrag(): boolean;
+ isDragging(): boolean;
+ subscribeToStateChange(listener: Listener, options?: {
+ handlerIds: Identifier[] | undefined;
+ }): Unsubscribe;
+ isDraggingSource(sourceId: Identifier): boolean;
+ isOverTarget(targetId: Identifier, options?: {
+ shallow: boolean;
+ }): boolean;
+ getTargetIds(): Identifier[];
+ isSourcePublic(): boolean | null;
+ getSourceId(): Identifier | null;
+ subscribeToOffsetChange(listener: Listener): Unsubscribe;
+ canDragSource(sourceId: Identifier): boolean;
+ canDropOnTarget(targetId: Identifier): boolean;
+ getItemType(): string | symbol | null;
+ getItem(): any;
+ getDropResult(): any;
+ didDrop(): boolean;
+ getInitialClientOffset(): import("dnd-core").XYCoord | null;
+ getInitialSourceClientOffset(): import("dnd-core").XYCoord | null;
+ getSourceClientOffset(): import("dnd-core").XYCoord | null;
+ getClientOffset(): import("dnd-core").XYCoord | null;
+ getDifferenceFromInitialOffset(): import("dnd-core").XYCoord | null;
+}

lib/esm/DragSourceMonitorImpl.js

@@ -0,0 +1,91 @@
+const invariant = require('invariant');
+let isCallingCanDrag = false;
+let isCallingIsDragging = false;
+export default class DragSourceMonitorImpl {
+ constructor(manager) {
+ this.sourceId = null;
+ this.internalMonitor = manager.getMonitor();
+ }
+ receiveHandlerId(sourceId) {
+ this.sourceId = sourceId;
+ }
+ getHandlerId() {
+ return this.sourceId;
+ }
+ canDrag() {
+ invariant(!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;
+ }
+ }
+ isDragging() {
+ invariant(!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;
+ }
+ }
+ subscribeToStateChange(listener, options) {
+ return this.internalMonitor.subscribeToStateChange(listener, options);
+ }
+ isDraggingSource(sourceId) {
+ return this.internalMonitor.isDraggingSource(sourceId);
+ }
+ isOverTarget(targetId, options) {
+ return this.internalMonitor.isOverTarget(targetId, options);
+ }
+ getTargetIds() {
+ return this.internalMonitor.getTargetIds();
+ }
+ isSourcePublic() {
+ return this.internalMonitor.isSourcePublic();
+ }
+ getSourceId() {
+ return this.internalMonitor.getSourceId();
+ }
+ subscribeToOffsetChange(listener) {
+ return this.internalMonitor.subscribeToOffsetChange(listener);
+ }
+ canDragSource(sourceId) {
+ return this.internalMonitor.canDragSource(sourceId);
+ }
+ canDropOnTarget(targetId) {
+ return this.internalMonitor.canDropOnTarget(targetId);
+ }
+ getItemType() {
+ return this.internalMonitor.getItemType();
+ }
+ getItem() {
+ return this.internalMonitor.getItem();
+ }
+ getDropResult() {
+ return this.internalMonitor.getDropResult();
+ }
+ didDrop() {
+ return this.internalMonitor.didDrop();
+ }
+ getInitialClientOffset() {
+ return this.internalMonitor.getInitialClientOffset();
+ }
+ getInitialSourceClientOffset() {
+ return this.internalMonitor.getInitialSourceClientOffset();
+ }
+ getSourceClientOffset() {
+ return this.internalMonitor.getSourceClientOffset();
+ }
+ getClientOffset() {
+ return this.internalMonitor.getClientOffset();
+ }
+ getDifferenceFromInitialOffset() {
+ return this.internalMonitor.getDifferenceFromInitialOffset();
+ }
+}

lib/esm/DropTarget.js

@@ -2,9 +2,9 @@
import decorateHandler from './decorateHandler';
import registerTarget from './registerTarget';
import createTargetFactory from './createTargetFactory';
-import createTargetMonitor from './createTargetMonitor';
import createTargetConnector from './createTargetConnector';
import isValidType from './utils/isValidType';
+import DropTargetMonitorImpl from './DropTargetMonitorImpl';
const invariant = require('invariant');
const isPlainObject = require('lodash/isPlainObject');
export default function DropTarget(type, spec, collect, options = {}) {
@@ -34,7 +34,7 @@
containerDisplayName: 'DropTarget',
createHandler: createTarget,
registerHandler: registerTarget,
- createMonitor: createTargetMonitor,
+ createMonitor: (manager) => new DropTargetMonitorImpl(manager),
createConnector: createTargetConnector,
DecoratedComponent,
getType,

lib/esm/DropTargetMonitorImpl.d.ts

@@ -0,0 +1,25 @@
+import { DragDropManager, Unsubscribe, Listener, Identifier } from 'dnd-core';
+import { DropTargetMonitor } from './interfaces';
+export default class DropTargetMonitorImpl implements DropTargetMonitor {
+ private internalMonitor;
+ private targetId;
+ constructor(manager: DragDropManager<any>);
+ receiveHandlerId(targetId: Identifier | null): void;
+ getHandlerId(): Identifier | null;
+ subscribeToStateChange(listener: Listener, options?: {
+ handlerIds: Identifier[] | undefined;
+ }): Unsubscribe;
+ canDrop(): boolean;
+ isOver(options: {
+ shallow?: boolean;
+ }): boolean;
+ getItemType(): string | symbol | null;
+ getItem(): any;
+ getDropResult(): any;
+ didDrop(): boolean;
+ getInitialClientOffset(): import("dnd-core").XYCoord | null;
+ getInitialSourceClientOffset(): import("dnd-core").XYCoord | null;
+ getSourceClientOffset(): import("dnd-core").XYCoord | null;
+ getClientOffset(): import("dnd-core").XYCoord | null;
+ getDifferenceFromInitialOffset(): import("dnd-core").XYCoord | null;
+}

lib/esm/DropTargetMonitorImpl.js

@@ -0,0 +1,58 @@
+const invariant = require('invariant');
+let isCallingCanDrop = false;
+export default class DropTargetMonitorImpl {
+ constructor(manager) {
+ this.targetId = null;
+ this.internalMonitor = manager.getMonitor();
+ }
+ receiveHandlerId(targetId) {
+ this.targetId = targetId;
+ }
+ getHandlerId() {
+ return this.targetId;
+ }
+ subscribeToStateChange(listener, options) {
+ return this.internalMonitor.subscribeToStateChange(listener, options);
+ }
+ canDrop() {
+ invariant(!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;
+ }
+ }
+ isOver(options) {
+ return this.internalMonitor.isOverTarget(this.targetId, options);
+ }
+ getItemType() {
+ return this.internalMonitor.getItemType();
+ }
+ getItem() {
+ return this.internalMonitor.getItem();
+ }
+ getDropResult() {
+ return this.internalMonitor.getDropResult();
+ }
+ didDrop() {
+ return this.internalMonitor.didDrop();
+ }
+ getInitialClientOffset() {
+ return this.internalMonitor.getInitialClientOffset();
+ }
+ getInitialSourceClientOffset() {
+ return this.internalMonitor.getInitialSourceClientOffset();
+ }
+ getSourceClientOffset() {
+ return this.internalMonitor.getSourceClientOffset();
+ }
+ getClientOffset() {
+ return this.internalMonitor.getClientOffset();
+ }
+ getDifferenceFromInitialOffset() {
+ return this.internalMonitor.getDifferenceFromInitialOffset();
+ }
+}

lib/esm/hooks/index.d.ts

@@ -0,0 +1,3 @@
+export * from './useDragSource';
+export * from './useDropTarget';
+export * from './useDragLayer';

lib/esm/hooks/index.js

@@ -0,0 +1,3 @@
+export * from './useDragSource';
+export * from './useDropTarget';
+export * from './useDragLayer';

lib/esm/hooks/useCollector.d.ts

@@ -0,0 +1 @@
+export declare function useCollector<T, S>(monitor: T, collect: (monitor: T) => S): [S, () => void];

lib/esm/hooks/useCollector.js

@@ -0,0 +1,13 @@
+import { useState } from 'react';
+const shallowEqual = require('shallowequal');
+export function useCollector(monitor, collect) {
+ const [collected, setCollected] = useState(() => collect(monitor));
+ const updateCollected = () => {
+ const nextValue = collect(monitor);
+ // Not async-safe, but we need a way to opt-out of state updates
+ if (!shallowEqual(collected, nextValue)) {
+ setCollected(nextValue);
+ }
+ };
+ return [collected, updateCollected];
+}

lib/esm/hooks/useDragDropManager.d.ts

@@ -0,0 +1,5 @@
+import { DragDropManager } from 'dnd-core';
+/**
+ * A hook to retrieve the DragDropManager from Context
+ */
+export declare function useDragDropManager<Context>(): DragDropManager<Context>;

lib/esm/hooks/useDragDropManager.js

@@ -0,0 +1,11 @@
+import { useContext } from 'react';
+import { context } from '../DragDropContext';
+const invariant = require('invariant');
+/**
+ * A hook to retrieve the DragDropManager from Context
+ */
+export function useDragDropManager() {
+ const { dragDropManager } = useContext(context);
+ invariant(dragDropManager != null, 'Expected drag drop context');
+ return dragDropManager;
+}

lib/esm/hooks/useDragLayer.d.ts

@@ -0,0 +1,6 @@
+import { DragLayerMonitor } from '../interfaces';
+/**
+ * useDragLayer Hook (This API is experimental and subject to breaking changes in non-breaking versions)
+ * @param collector The property collector
+ */
+export declare function useDragLayer<CollectedProps>(collect: (monitor: DragLayerMonitor) => CollectedProps): CollectedProps;

lib/esm/hooks/useDragLayer.js

@@ -0,0 +1,15 @@
+import { useEffect } from 'react';
+import { useDragDropManager } from './useDragDropManager';
+import { useCollector } from './useCollector';
+/**
+ * useDragLayer Hook (This API is experimental and subject to breaking changes in non-breaking versions)
+ * @param collector The property collector
+ */
+export function useDragLayer(collect) {
+ const dragDropManager = useDragDropManager();
+ const monitor = dragDropManager.getMonitor();
+ const [collected, updateCollected] = useCollector(monitor, collect);
+ useEffect(() => monitor.subscribeToOffsetChange(updateCollected));
+ useEffect(() => monitor.subscribeToStateChange(updateCollected));
+ return collected;
+}

lib/esm/hooks/useDragSource.d.ts

@@ -0,0 +1,14 @@
+import { SourceType } from 'dnd-core';
+import { DragPreviewOptions, DragSourceHookSpec } from '../interfaces';
+import { Ref } from './util';
+/**
+ * useDragSource hook (This API is experimental and subject to breaking changes in non-major versions)
+ * @param ref The drag source element
+ * @param type The drag source type
+ * @param sourceSpec The drag source specification *
+ */
+export declare function useDragSource<DragObject, CustomProps>(ref: Ref<any>, type: SourceType, sourceSpec: DragSourceHookSpec<DragObject, CustomProps> & {
+ dragSourceOptions?: {};
+ dragPreview?: Ref<any> | Element;
+ dragPreviewOptions?: DragPreviewOptions;
+}): CustomProps;

lib/esm/hooks/useDragSourceHandler.d.ts

@@ -0,0 +1,3 @@
+import { DragSource } from 'dnd-core';
+import { DragSourceHookSpec } from '../interfaces';
+export declare function useDragSourceHandler<DragObject, CustomProps>(sourceSpec: DragSourceHookSpec<DragObject, CustomProps>): DragSource;

lib/esm/hooks/useDragSourceHandler.js

@@ -0,0 +1,31 @@
+import { useMemo, useEffect, useRef } from 'react';
+export function useDragSourceHandler(sourceSpec) {
+ const sourceSpecRef = useRef(sourceSpec);
+ useEffect(() => {
+ sourceSpecRef.current = sourceSpec;
+ });
+ // Can't use createSourceFactory, as semantics are different
+ const handler = useMemo(() => ({
+ beginDrag(monitor, target) {
+ const { beginDrag } = sourceSpecRef.current;
+ return beginDrag(monitor);
+ },
+ canDrag(monitor, target) {
+ const { canDrag } = sourceSpecRef.current;
+ return canDrag ? canDrag(monitor) : true;
+ },
+ isDragging(monitor, target) {
+ const { isDragging } = sourceSpecRef.current;
+ return isDragging
+ ? isDragging(monitor)
+ : target === monitor.getSourceId();
+ },
+ endDrag(monitor, target) {
+ const { endDrag } = sourceSpecRef.current;
+ if (endDrag) {
+ endDrag(monitor);
+ }
+ },
+ }), []);
+ return handler;
+}

lib/esm/hooks/useDragSource.js

@@ -0,0 +1,41 @@
+import { useEffect } from 'react';
+import { useDragSourceHandler } from './useDragSourceHandler';
+import { useDragDropManager } from './useDragDropManager';
+import { isRef } from './util';
+import { useMonitorOutput } from './useMonitorOutput';
+import { useDragSourceMonitor } from './useDragSourceMonitor';
+/**
+ * useDragSource hook (This API is experimental and subject to breaking changes in non-major versions)
+ * @param ref The drag source element
+ * @param type The drag source type
+ * @param sourceSpec The drag source specification *
+ */
+export function useDragSource(ref, type, sourceSpec) {
+ const manager = useDragDropManager();
+ const backend = manager.getBackend();
+ const handler = useDragSourceHandler(sourceSpec);
+ const sourceMonitor = useDragSourceMonitor(type, handler, manager);
+ /*
+ * Connect the Drag Source Element to the Backend
+ */
+ useEffect(function connectDragSource() {
+ const dragSourceNode = ref.current;
+ const dragSourceOptions = sourceSpec.dragSourceOptions;
+ return backend.connectDragSource(sourceMonitor.getHandlerId(), dragSourceNode, dragSourceOptions);
+ }, []);
+ /*
+ * Connect the Drag Previem Element to the Backend
+ */
+ useEffect(function connectDragPreview() {
+ if (sourceSpec.dragPreview == null) {
+ return undefined;
+ }
+ const dragPreviewNode = isRef(sourceSpec.dragPreview)
+ ? sourceSpec.dragPreview.current
+ : sourceSpec.dragPreview;
+ const { dragPreviewOptions } = sourceSpec;
+ return backend.connectDragPreview(sourceMonitor.getHandlerId(), dragPreviewNode, dragPreviewOptions);
+ }, []);
+ const collector = sourceSpec.collect || (() => ({}));
+ return useMonitorOutput(sourceMonitor, collector);
+}

lib/esm/hooks/useDragSourceMonitor.d.ts

@@ -0,0 +1,3 @@
+import { DragDropManager, SourceType, DragSource } from 'dnd-core';
+import DragSourceMonitorImpl from '../DragSourceMonitorImpl';
+export declare function useDragSourceMonitor<Context>(type: SourceType, source: DragSource, manager: DragDropManager<Context>): DragSourceMonitorImpl;

lib/esm/hooks/useDragSourceMonitor.js

@@ -0,0 +1,12 @@
+import { useMemo, useEffect } from 'react';
+import registerSource from '../registerSource';
+import DragSourceMonitorImpl from '../DragSourceMonitorImpl';
+export function useDragSourceMonitor(type, source, manager) {
+ const monitor = useMemo(() => new DragSourceMonitorImpl(manager), [manager]);
+ useEffect(function registerSourceWithMonitor() {
+ const { handlerId, unregister } = registerSource(type, source, manager);
+ monitor.receiveHandlerId(handlerId);
+ return unregister;
+ }, [monitor]);
+ return monitor;
+}

lib/esm/hooks/useDropTarget.d.ts

@@ -0,0 +1,12 @@
+import { TargetType } from 'dnd-core';
+import { DropTargetHookSpec } from '../interfaces';
+import { Ref } from './util';
+/**
+ * useDropTarget Hook (This API is experimental and subject to breaking changes in non-breaking versions)
+ * @param ref The drop target's ref
+ * @param type The drop target type
+ * @param targetSpec The drop target specification
+ */
+export declare function useDropTarget<CustomProps>(ref: Ref<any>, type: TargetType, targetSpec: DropTargetHookSpec<CustomProps> & {
+ dropTargetOptions?: {};
+}): CustomProps;

lib/esm/hooks/useDropTargetHandler.d.ts

@@ -0,0 +1,3 @@
+import { DropTargetHookSpec } from '../interfaces';
+import { DropTarget } from 'dnd-core';
+export declare function useDropTargetHandler<CustomProps>(targetSpec: DropTargetHookSpec<CustomProps>): DropTarget;

lib/esm/hooks/useDropTargetHandler.js

@@ -0,0 +1,27 @@
+import * as React from 'react';
+export function useDropTargetHandler(targetSpec) {
+ const targetSpecRef = React.useRef(targetSpec);
+ React.useEffect(function updateDropTargetSpec() {
+ targetSpecRef.current = targetSpec;
+ });
+ // Can't use createSourceFactory, as semantics are different
+ const handler = React.useMemo(() => ({
+ canDrop(monitor, targetId) {
+ const { canDrop } = targetSpecRef.current;
+ return canDrop ? canDrop(monitor) : true;
+ },
+ hover(monitor, targetId) {
+ const { hover } = targetSpecRef.current;
+ if (hover) {
+ hover(monitor);
+ }
+ },
+ drop(monitor, targetId) {
+ const { drop } = targetSpecRef.current;
+ if (drop) {
+ drop(monitor);
+ }
+ },
+ }), []);
+ return handler;
+}

lib/esm/hooks/useDropTarget.js

@@ -0,0 +1,29 @@
+import { useEffect } from 'react';
+import { useDragDropManager } from './useDragDropManager';
+import { useDropTargetHandler } from './useDropTargetHandler';
+import { useMonitorOutput } from './useMonitorOutput';
+import { useDropTargetMonitor } from './useDropTargetMonitor';
+/**
+ * useDropTarget Hook (This API is experimental and subject to breaking changes in non-breaking versions)
+ * @param ref The drop target's ref
+ * @param type The drop target type
+ * @param targetSpec The drop target specification
+ */
+export function useDropTarget(ref, type, targetSpec) {
+ const manager = useDragDropManager();
+ const backend = manager.getBackend();
+ const handler = useDropTargetHandler(targetSpec);
+ const targetMonitor = useDropTargetMonitor(type, handler, manager);
+ /*
+ * Connect the Drop Target Element to the Backend
+ */
+ useEffect(function connectDropTarget() {
+ const dropTargetNode = ref.current;
+ if (dropTargetNode) {
+ const dropTargetOptions = targetSpec.dropTargetOptions;
+ return backend.connectDropTarget(targetMonitor.getHandlerId(), dropTargetNode, dropTargetOptions);
+ }
+ }, []);
+ const collector = targetSpec.collect || (() => ({}));
+ return useMonitorOutput(targetMonitor, collector);
+}

lib/esm/hooks/useDropTargetMonitor.d.ts

@@ -0,0 +1,3 @@
+import { DragDropManager, TargetType, DropTarget } from 'dnd-core';
+import { DropTargetMonitor } from '../interfaces';
+export declare function useDropTargetMonitor<Context>(type: TargetType, target: DropTarget, manager: DragDropManager<Context>): DropTargetMonitor;

lib/esm/hooks/useDropTargetMonitor.js

@@ -0,0 +1,12 @@
+import { useMemo, useEffect } from 'react';
+import registerTarget from '../registerTarget';
+import DropTargetMonitorImpl from '../DropTargetMonitorImpl';
+export function useDropTargetMonitor(type, target, manager) {
+ const monitor = useMemo(() => new DropTargetMonitorImpl(manager), [manager]);
+ useEffect(function registerTargetWithMonitor() {
+ const { handlerId, unregister } = registerTarget(type, target, manager);
+ monitor.receiveHandlerId(handlerId);
+ return unregister;
+ }, [monitor]);
+ return monitor;
+}

lib/esm/hooks/useMonitorOutput.d.ts

@@ -0,0 +1,3 @@
+import { HandlerManager } from '../interfaces';
+import { DragDropMonitor } from 'dnd-core';
+export declare function useMonitorOutput<Monitor extends DragDropMonitor & HandlerManager, Collected>(monitor: Monitor, collect: (monitor: Monitor) => Collected): Collected;

lib/esm/hooks/useMonitorOutput.js

@@ -0,0 +1,17 @@
+import { useEffect } from 'react';
+import { useCollector } from './useCollector';
+export function useMonitorOutput(monitor, collect) {
+ const [collected, updateCollected] = useCollector(monitor, collect);
+ // This runs on every render. There will be ways to optimise this, but for
+ // now, this is the most correct thing to do.
+ useEffect(function subscribeToMonitorStateChange() {
+ const handlerId = monitor.getHandlerId();
+ if (handlerId == null) {
+ return undefined;
+ }
+ return monitor.subscribeToStateChange(updateCollected, {
+ handlerIds: [handlerId],
+ });
+ });
+ return collected;
+}

lib/esm/hooks/util.d.ts

@@ -0,0 +1,4 @@
+export interface Ref<T> {
+ current: T;
+}
+export declare function isRef(obj: any): boolean;

lib/esm/hooks/util.js

@@ -0,0 +1,7 @@
+export function isRef(obj) {
+ if (obj !== null && typeof obj === 'object') {
+ const keys = Object.keys(obj);
+ return keys.length === 1 && keys[0] === 'current';
+ }
+ return false;
+}

lib/esm/index.d.ts

@@ -2,4 +2,5 @@
export { default as DragLayer } from './DragLayer';
export { default as DragSource } from './DragSource';
export { default as DropTarget } from './DropTarget';
+export * from './hooks';
export * from './interfaces';

lib/esm/index.js

@@ -2,3 +2,4 @@
export { default as DragLayer } from './DragLayer';
export { default as DragSource } from './DragSource';
export { default as DropTarget } from './DropTarget';
+export * from './hooks';

lib/esm/interfaces.d.ts

@@ -1,6 +1,10 @@
import * as React from 'react';
-import { XYCoord, DragDropMonitor, Identifier, DragDropManager } from 'dnd-core';
+import { XYCoord, Identifier, DragDropManager } from 'dnd-core';
export { XYCoord };
+export interface HandlerManager {
+ receiveHandlerId: (handlerId: Identifier | null) => void;
+ getHandlerId: () => Identifier | null;
+}
/**
* The React Component that manages the DragDropContext for its children.
*/
@@ -29,7 +33,7 @@
DecoratedComponent: React.ComponentType<Props>;
new (props?: Props, context?: any): DndComponent<Props>;
}
-export interface DragSourceMonitor extends DragDropMonitor {
+export interface DragSourceMonitor extends HandlerManager {
/**
* Returns true if no drag operation is in progress, and the owner's canDrag() returns true or is not defined.
*/
@@ -82,7 +86,7 @@
*/
getSourceClientOffset(): XYCoord | null;
}
-export interface DropTargetMonitor {
+export interface DropTargetMonitor extends HandlerManager {
/**
* Returns true if there is a drag operation in progress, and the owner's canDrop() returns true or is not defined.
*/
@@ -213,6 +217,39 @@
*/
canDrop?: (props: Props, monitor: DropTargetMonitor) => boolean;
}
+/**
+ * Interface for the DropTarget specification object
+ */
+export interface DropTargetHookSpec<CollectedProps> {
+ /**
+ * Optional.
+ * Called when a compatible item is dropped on the target. You may either return undefined, or a plain object.
+ * If you return an object, it is going to become the drop result and will be available to the drag source in its
+ * endDrag method as monitor.getDropResult(). This is useful in case you want to perform different actions
+ * depending on which target received the drop. If you have nested drop targets, you can test whether a nested
+ * target has already handled drop by checking monitor.didDrop() and monitor.getDropResult(). Both this method and
+ * the source's endDrag method are good places to fire Flux actions. This method will not be called if canDrop()
+ * is defined and returns false.
+ */
+ drop?: (monitor: DropTargetMonitor) => any;
+ /**
+ * Optional.
+ * Called when an item is hovered over the component. You can check monitor.isOver({ shallow: true }) to test whether
+ * the hover happens over just the current target, or over a nested one. Unlike drop(), this method will be called even
+ * if canDrop() is defined and returns false. You can check monitor.canDrop() to test whether this is the case.
+ */
+ hover?: (monitor: DropTargetMonitor) => void;
+ /**
+ * Optional. Use it to specify whether the drop target is able to accept the item. If you want to always allow it, just
+ * omit this method. Specifying it is handy if you'd like to disable dropping based on some predicate over props or
+ * monitor.getItem(). Note: You may not call monitor.canDrop() inside this method.
+ */
+ canDrop?: (monitor: DropTargetMonitor) => boolean;
+ /**
+ * A function to collect rendering properties
+ */
+ collect?: (monitor: DropTargetMonitor) => CollectedProps;
+}
export interface DragSourceSpec<Props, DragObject> {
/**
* Required.
@@ -251,6 +288,48 @@
*/
isDragging?: (props: Props, monitor: DragSourceMonitor) => boolean;
}
+export interface DragSourceHookSpec<DragObject, CollectedProps> {
+ /**
+ * Required.
+ * When the dragging starts, beginDrag is called. You must return a plain JavaScript object describing the
+ * data being dragged. What you return is the only information available to the drop targets about the drag
+ * source so it's important to pick the minimal data they need to know. You may be tempted to put a reference
+ * to the component into it, but you should try very hard to avoid doing this because it couples the drag
+ * sources and drop targets. It's a good idea to return something like { id: props.id } from this method.
+ */
+ beginDrag: (monitor: DragSourceMonitor) => DragObject;
+ /**
+ * Optional.
+ * When the dragging stops, endDrag is called. For every beginDrag call, a corresponding endDrag call is guaranteed.
+ * You may call monitor.didDrop() to check whether or not the drop was handled by a compatible drop target. If it was handled,
+ * and the drop target specified a drop result by returning a plain object from its drop() method, it will be available as
+ * monitor.getDropResult(). This method is a good place to fire a Flux action. Note: If the component is unmounted while dragging,
+ * component parameter is set to be null.
+ */
+ endDrag?: (monitor: DragSourceMonitor) => void;
+ /**
+ * Optional.
+ * Use it to specify whether the dragging is currently allowed. If you want to always allow it, just omit this method.
+ * Specifying it is handy if you'd like to disable dragging based on some predicate over props. Note: You may not call
+ * monitor.canDrag() inside this method.
+ */
+ canDrag?: (monitor: DragSourceMonitor) => boolean;
+ /**
+ * Optional.
+ * By default, only the drag source that initiated the drag operation is considered to be dragging. You can
+ * override this behavior by defining a custom isDragging method. It might return something like props.id === monitor.getItem().id.
+ * Do this if the original component may be unmounted during the dragging and later “resurrected” with a different parent.
+ * For example, when moving a card across the lists in a Kanban board, you want it to retain the dragged appearance—even though
+ * technically, the component gets unmounted and a different one gets mounted every time you move it to another list.
+ *
+ * Note: You may not call monitor.isDragging() inside this method.
+ */
+ isDragging?: (monitor: DragSourceMonitor) => boolean;
+ /**
+ * A function to collect rendering properties
+ */
+ collect?: (monitor: DragSourceMonitor) => CollectedProps;
+}
/**
* Options for the Drag Sources, Drop Tragets, and Drag Layers annotation
*/

lib/esm/registerSource.d.ts

@@ -1,5 +1,5 @@
-import { DragDropManager, DragSource, Unsubscribe } from 'dnd-core';
-export default function registerSource<Context>(type: string, source: DragSource, manager: DragDropManager<Context>): {
- handlerId: string;
+import { DragDropManager, DragSource, Unsubscribe, Identifier, SourceType } from 'dnd-core';
+export default function registerSource<Context>(type: SourceType, source: DragSource, manager: DragDropManager<Context>): {
+ handlerId: Identifier;
unregister: Unsubscribe;
};

lib/esm/registerSource.js

@@ -1,11 +1,8 @@
export default function registerSource(type, source, manager) {
const registry = manager.getRegistry();
const sourceId = registry.addSource(type, source);
- function unregisterSource() {
- registry.removeSource(sourceId);
- }
return {
handlerId: sourceId,
- unregister: unregisterSource,
+ unregister: () => registry.removeSource(sourceId),
};
}

lib/esm/registerTarget.d.ts

@@ -1,5 +1,5 @@
-import { DragDropManager, DropTarget, Unsubscribe } from 'dnd-core';
-export default function registerTarget<Context>(type: string, target: DropTarget, manager: DragDropManager<Context>): {
- handlerId: string;
+import { DragDropManager, DropTarget, Unsubscribe, Identifier, TargetType } from 'dnd-core';
+export default function registerTarget<Context>(type: TargetType, target: DropTarget, manager: DragDropManager<Context>): {
+ handlerId: Identifier;
unregister: Unsubscribe;
};

lib/esm/registerTarget.js

@@ -1,11 +1,8 @@
export default function registerTarget(type, target, manager) {
const registry = manager.getRegistry();
const targetId = registry.addTarget(type, target);
- function unregisterTarget() {
- registry.removeTarget(targetId);
- }
return {
handlerId: targetId,
- unregister: unregisterTarget,
+ unregister: () => registry.removeTarget(targetId),
};
}

package.json

@@ -1,6 +1,6 @@
{
"name": "react-dnd",
- "version": "7.1.0",
+ "version": "7.2.0",
"description": "Drag and Drop for React",
"main": "lib/cjs/index.js",
"types": "lib/cjs/index.d.ts",
@@ -22,7 +22,7 @@
"start": "npm run watch"
},
"dependencies": {
- "dnd-core": "^7.1.0",
+ "dnd-core": "^7.2.0",
"hoist-non-react-statics": "^3.3.0",
"invariant": "^2.1.0",
"lodash": "^4.17.11",
@@ -37,6 +37,7 @@
"babel-loader": "^8.0.5",
"npm-run-all": "^4.1.5",
"react": "^16.8.4",
+ "react-dom": "^16.8.4",
"rimraf": "^2.6.3",
"ts-loader": "^5.3.3",
"typescript": "^3.3.3333",
@@ -44,7 +45,8 @@
"webpack-cli": "^3.2.3"
},
"peerDependencies": {
- "react": ">= 16.3"
+ "react": ">= 16.8",
+ "react-dom": ">= 16.8"
},
- "gitHead": "3c1a0125eba8738c87a19946dd49b13d433da4df"
+ "gitHead": "e4f7ebcdeb135ff3aa44c6b28001d3339dc5d55b"
}