Add files

This commit is contained in:
DoomRye 2022-07-26 10:06:20 -07:00
commit bb80829159
18195 changed files with 2122994 additions and 0 deletions

View file

@ -0,0 +1,107 @@
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _slice = Array.prototype.slice;
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
exports['default'] = DragDropContext;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _dndCore = require('dnd-core');
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments');
var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments);
function DragDropContext(backendOrModule) {
_utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragDropContext', 'backend'].concat(_slice.call(arguments)));
// Auto-detect ES6 default export for people still using ES5
var backend = undefined;
if (typeof backendOrModule === 'object' && typeof backendOrModule['default'] === 'function') {
backend = backendOrModule['default'];
} else {
backend = backendOrModule;
}
_invariant2['default'](typeof backend === 'function', 'Expected the backend to be a function or an ES6 module exporting a default function. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-drop-context.html');
var childContext = {
dragDropManager: new _dndCore.DragDropManager(backend)
};
return function decorateContext(DecoratedComponent) {
var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
return (function (_Component) {
_inherits(DragDropContextContainer, _Component);
function DragDropContextContainer() {
_classCallCheck(this, DragDropContextContainer);
_Component.apply(this, arguments);
}
DragDropContextContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() {
return this.refs.child;
};
DragDropContextContainer.prototype.getManager = function getManager() {
return childContext.dragDropManager;
};
DragDropContextContainer.prototype.getChildContext = function getChildContext() {
return childContext;
};
DragDropContextContainer.prototype.render = function render() {
return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, {
ref: 'child' }));
};
_createClass(DragDropContextContainer, null, [{
key: 'DecoratedComponent',
value: DecoratedComponent,
enumerable: true
}, {
key: 'displayName',
value: 'DragDropContext(' + displayName + ')',
enumerable: true
}, {
key: 'childContextTypes',
value: {
dragDropManager: _react.PropTypes.object.isRequired
},
enumerable: true
}]);
return DragDropContextContainer;
})(_react.Component);
};
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/DragDropContext.js
// module id = 2736
// module chunks = 4

View file

@ -0,0 +1,133 @@
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _slice = Array.prototype.slice;
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
exports['default'] = DragLayer;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _utilsShallowEqual = require('./utils/shallowEqual');
var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual);
var _utilsShallowEqualScalar = require('./utils/shallowEqualScalar');
var _utilsShallowEqualScalar2 = _interopRequireDefault(_utilsShallowEqualScalar);
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments');
var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments);
function DragLayer(collect) {
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
_utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragLayer', 'collect[, options]'].concat(_slice.call(arguments)));
_invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the first argument to DragLayer ' + 'to be a function that collects props to inject into the component. ', 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html', collect);
_invariant2['default'](_lodashLangIsPlainObject2['default'](options), 'Expected "options" provided as the second argument to DragLayer to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html', options);
return function decorateLayer(DecoratedComponent) {
var _options$arePropsEqual = options.arePropsEqual;
var arePropsEqual = _options$arePropsEqual === undefined ? _utilsShallowEqualScalar2['default'] : _options$arePropsEqual;
var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
return (function (_Component) {
_inherits(DragLayerContainer, _Component);
DragLayerContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() {
return this.refs.child;
};
DragLayerContainer.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
return !arePropsEqual(nextProps, this.props) || !_utilsShallowEqual2['default'](nextState, this.state);
};
_createClass(DragLayerContainer, null, [{
key: 'DecoratedComponent',
value: DecoratedComponent,
enumerable: true
}, {
key: 'displayName',
value: 'DragLayer(' + displayName + ')',
enumerable: true
}, {
key: 'contextTypes',
value: {
dragDropManager: _react.PropTypes.object.isRequired
},
enumerable: true
}]);
function DragLayerContainer(props, context) {
_classCallCheck(this, DragLayerContainer);
_Component.call(this, props);
this.handleChange = this.handleChange.bind(this);
this.manager = context.dragDropManager;
_invariant2['default'](typeof this.manager === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);
this.state = this.getCurrentState();
}
DragLayerContainer.prototype.componentDidMount = function componentDidMount() {
var monitor = this.manager.getMonitor();
this.unsubscribe = monitor.subscribeToOffsetChange(this.handleChange);
};
DragLayerContainer.prototype.componentWillUnmount = function componentWillUnmount() {
this.unsubscribe();
};
DragLayerContainer.prototype.handleChange = function handleChange() {
var nextState = this.getCurrentState();
if (!_utilsShallowEqual2['default'](nextState, this.state)) {
this.setState(nextState);
}
};
DragLayerContainer.prototype.getCurrentState = function getCurrentState() {
var monitor = this.manager.getMonitor();
return collect(monitor);
};
DragLayerContainer.prototype.render = function render() {
return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, this.state, {
ref: 'child' }));
};
return DragLayerContainer;
})(_react.Component);
};
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/DragLayer.js
// module id = 2737
// module chunks = 4

View file

@ -0,0 +1,86 @@
'use strict';
exports.__esModule = true;
var _slice = Array.prototype.slice;
exports['default'] = DragSource;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments');
var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments);
var _decorateHandler = require('./decorateHandler');
var _decorateHandler2 = _interopRequireDefault(_decorateHandler);
var _registerSource = require('./registerSource');
var _registerSource2 = _interopRequireDefault(_registerSource);
var _createSourceFactory = require('./createSourceFactory');
var _createSourceFactory2 = _interopRequireDefault(_createSourceFactory);
var _createSourceMonitor = require('./createSourceMonitor');
var _createSourceMonitor2 = _interopRequireDefault(_createSourceMonitor);
var _createSourceConnector = require('./createSourceConnector');
var _createSourceConnector2 = _interopRequireDefault(_createSourceConnector);
var _utilsIsValidType = require('./utils/isValidType');
var _utilsIsValidType2 = _interopRequireDefault(_utilsIsValidType);
function DragSource(type, spec, collect) {
var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
_utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragSource', 'type, spec, collect[, options]'].concat(_slice.call(arguments)));
var getType = type;
if (typeof type !== 'function') {
_invariant2['default'](_utilsIsValidType2['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://gaearon.github.io/react-dnd/docs-drag-source.html', type);
getType = function () {
return type;
};
}
_invariant2['default'](_lodashLangIsPlainObject2['default'](spec), 'Expected "spec" provided as the second argument to DragSource to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', spec);
var createSource = _createSourceFactory2['default'](spec);
_invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the third argument to DragSource to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', collect);
_invariant2['default'](_lodashLangIsPlainObject2['default'](options), 'Expected "options" provided as the fourth argument to DragSource to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', collect);
return function decorateSource(DecoratedComponent) {
return _decorateHandler2['default']({
connectBackend: function connectBackend(backend, sourceId) {
return backend.connectDragSource(sourceId);
},
containerDisplayName: 'DragSource',
createHandler: createSource,
registerHandler: _registerSource2['default'],
createMonitor: _createSourceMonitor2['default'],
createConnector: _createSourceConnector2['default'],
DecoratedComponent: DecoratedComponent,
getType: getType,
collect: collect,
options: options
});
};
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/DragSource.js
// module id = 2738
// module chunks = 4

View file

@ -0,0 +1,86 @@
'use strict';
exports.__esModule = true;
var _slice = Array.prototype.slice;
exports['default'] = DropTarget;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments');
var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments);
var _decorateHandler = require('./decorateHandler');
var _decorateHandler2 = _interopRequireDefault(_decorateHandler);
var _registerTarget = require('./registerTarget');
var _registerTarget2 = _interopRequireDefault(_registerTarget);
var _createTargetFactory = require('./createTargetFactory');
var _createTargetFactory2 = _interopRequireDefault(_createTargetFactory);
var _createTargetMonitor = require('./createTargetMonitor');
var _createTargetMonitor2 = _interopRequireDefault(_createTargetMonitor);
var _createTargetConnector = require('./createTargetConnector');
var _createTargetConnector2 = _interopRequireDefault(_createTargetConnector);
var _utilsIsValidType = require('./utils/isValidType');
var _utilsIsValidType2 = _interopRequireDefault(_utilsIsValidType);
function DropTarget(type, spec, collect) {
var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
_utilsCheckDecoratorArguments2['default'].apply(undefined, ['DropTarget', 'type, spec, collect[, options]'].concat(_slice.call(arguments)));
var getType = type;
if (typeof type !== 'function') {
_invariant2['default'](_utilsIsValidType2['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://gaearon.github.io/react-dnd/docs-drop-target.html', type);
getType = function () {
return type;
};
}
_invariant2['default'](_lodashLangIsPlainObject2['default'](spec), 'Expected "spec" provided as the second argument to DropTarget to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', spec);
var createTarget = _createTargetFactory2['default'](spec);
_invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the third argument to DropTarget to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', collect);
_invariant2['default'](_lodashLangIsPlainObject2['default'](options), 'Expected "options" provided as the fourth argument to DropTarget to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', collect);
return function decorateTarget(DecoratedComponent) {
return _decorateHandler2['default']({
connectBackend: function connectBackend(backend, targetId) {
return backend.connectDropTarget(targetId);
},
containerDisplayName: 'DropTarget',
createHandler: createTarget,
registerHandler: _registerTarget2['default'],
createMonitor: _createTargetMonitor2['default'],
createConnector: _createTargetConnector2['default'],
DecoratedComponent: DecoratedComponent,
getType: getType,
collect: collect,
options: options
});
};
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/DropTarget.js
// module id = 2739
// module chunks = 4

View file

@ -0,0 +1,43 @@
'use strict';
exports.__esModule = true;
exports['default'] = bindConnector;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _bindConnectorMethod2 = require('./bindConnectorMethod');
var _bindConnectorMethod3 = _interopRequireDefault(_bindConnectorMethod2);
var _disposables = require('disposables');
function bindConnector(connector, handlerId) {
var compositeDisposable = new _disposables.CompositeDisposable();
var handlerConnector = {};
Object.keys(connector).forEach(function (key) {
var _bindConnectorMethod = _bindConnectorMethod3['default'](handlerId, connector[key]);
var disposable = _bindConnectorMethod.disposable;
var ref = _bindConnectorMethod.ref;
compositeDisposable.add(disposable);
handlerConnector[key] = function () {
return ref;
};
});
return {
disposable: compositeDisposable,
handlerConnector: handlerConnector
};
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/bindConnector.js
// module id = 2740
// module chunks = 4

View file

@ -0,0 +1,89 @@
'use strict';
exports.__esModule = true;
exports['default'] = bindConnectorMethod;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _utilsShallowEqual = require('./utils/shallowEqual');
var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual);
var _utilsCloneWithRef = require('./utils/cloneWithRef');
var _utilsCloneWithRef2 = _interopRequireDefault(_utilsCloneWithRef);
var _disposables = require('disposables');
var _react = require('react');
function areOptionsEqual(currentOptions, nextOptions) {
if (currentOptions === nextOptions) {
return true;
}
return currentOptions !== null && nextOptions !== null && _utilsShallowEqual2['default'](currentOptions, nextOptions);
}
function bindConnectorMethod(handlerId, connect) {
var disposable = new _disposables.SerialDisposable();
var currentNode = null;
var currentOptions = null;
function ref() {
var nextWhatever = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
var nextOptions = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
// 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.
if (_react.isValidElement(nextWhatever)) {
// 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 nextWhatever.type !== 'string') {
var displayName = nextWhatever.type.displayName || nextWhatever.type.name || 'the component';
throw new Error('Only native element nodes can now be passed to ' + connect.name + '(). ' + ('You can either wrap ' + displayName + ' into a <div>, or turn it into a ') + 'drag source or a drop target itself.');
}
var nextElement = nextWhatever;
return _utilsCloneWithRef2['default'](nextElement, function (inst) {
return ref(inst, nextOptions);
});
}
// At this point we can only receive DOM nodes.
var nextNode = nextWhatever;
// If nothing changed, bail out of re-connecting the node to the backend.
if (nextNode === currentNode && areOptionsEqual(currentOptions, nextOptions)) {
return;
}
currentNode = nextNode;
currentOptions = nextOptions;
if (!nextNode) {
disposable.setDisposable(null);
return;
}
// Re-connect the node to the backend.
var currentDispose = connect(handlerId, nextNode, nextOptions);
disposable.setDisposable(new _disposables.Disposable(currentDispose));
}
return {
ref: ref,
disposable: disposable
};
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/bindConnectorMethod.js
// module id = 2741
// module chunks = 4

View file

@ -0,0 +1,24 @@
"use strict";
exports.__esModule = true;
exports["default"] = createSourceConnector;
function createSourceConnector(backend) {
return {
dragSource: function connectDragSource() {
return backend.connectDragSource.apply(backend, arguments);
},
dragPreview: function connectDragPreview() {
return backend.connectDragPreview.apply(backend, arguments);
}
};
}
module.exports = exports["default"];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/createSourceConnector.js
// module id = 2742
// module chunks = 4

View file

@ -0,0 +1,94 @@
'use strict';
exports.__esModule = true;
exports['default'] = createSourceFactory;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
var ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'canDrag', 'isDragging', 'endDrag'];
var REQUIRED_SPEC_METHODS = ['beginDrag'];
function createSourceFactory(spec) {
Object.keys(spec).forEach(function (key) {
_invariant2['default'](ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drag source specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', ALLOWED_SPEC_METHODS.join(', '), key);
_invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);
});
REQUIRED_SPEC_METHODS.forEach(function (key) {
_invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);
});
var Source = (function () {
function Source(monitor) {
_classCallCheck(this, Source);
this.monitor = monitor;
this.props = null;
this.component = null;
}
Source.prototype.receiveProps = function receiveProps(props) {
this.props = props;
};
Source.prototype.receiveComponent = function receiveComponent(component) {
this.component = component;
};
Source.prototype.canDrag = function canDrag() {
if (!spec.canDrag) {
return true;
}
return spec.canDrag(this.props, this.monitor);
};
Source.prototype.isDragging = function isDragging(globalMonitor, sourceId) {
if (!spec.isDragging) {
return sourceId === globalMonitor.getSourceId();
}
return spec.isDragging(this.props, this.monitor);
};
Source.prototype.beginDrag = function beginDrag() {
var item = spec.beginDrag(this.props, this.monitor, this.component);
if (process.env.NODE_ENV !== 'production') {
_invariant2['default'](_lodashLangIsPlainObject2['default'](item), 'beginDrag() must return a plain object that represents the dragged item. ' + 'Instead received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', item);
}
return item;
};
Source.prototype.endDrag = function endDrag() {
if (!spec.endDrag) {
return;
}
spec.endDrag(this.props, this.monitor, this.component);
};
return Source;
})();
return function createSource(monitor) {
return new Source(monitor);
};
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/createSourceFactory.js
// module id = 2743
// module chunks = 4

View file

@ -0,0 +1,100 @@
'use strict';
exports.__esModule = true;
exports['default'] = createSourceMonitor;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var isCallingCanDrag = false;
var isCallingIsDragging = false;
var SourceMonitor = (function () {
function SourceMonitor(manager) {
_classCallCheck(this, SourceMonitor);
this.internalMonitor = manager.getMonitor();
}
SourceMonitor.prototype.receiveHandlerId = function receiveHandlerId(sourceId) {
this.sourceId = sourceId;
};
SourceMonitor.prototype.canDrag = function canDrag() {
_invariant2['default'](!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html');
try {
isCallingCanDrag = true;
return this.internalMonitor.canDragSource(this.sourceId);
} finally {
isCallingCanDrag = false;
}
};
SourceMonitor.prototype.isDragging = function isDragging() {
_invariant2['default'](!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html');
try {
isCallingIsDragging = true;
return this.internalMonitor.isDraggingSource(this.sourceId);
} finally {
isCallingIsDragging = false;
}
};
SourceMonitor.prototype.getItemType = function getItemType() {
return this.internalMonitor.getItemType();
};
SourceMonitor.prototype.getItem = function getItem() {
return this.internalMonitor.getItem();
};
SourceMonitor.prototype.getDropResult = function getDropResult() {
return this.internalMonitor.getDropResult();
};
SourceMonitor.prototype.didDrop = function didDrop() {
return this.internalMonitor.didDrop();
};
SourceMonitor.prototype.getInitialClientOffset = function getInitialClientOffset() {
return this.internalMonitor.getInitialClientOffset();
};
SourceMonitor.prototype.getInitialSourceClientOffset = function getInitialSourceClientOffset() {
return this.internalMonitor.getInitialSourceClientOffset();
};
SourceMonitor.prototype.getSourceClientOffset = function getSourceClientOffset() {
return this.internalMonitor.getSourceClientOffset();
};
SourceMonitor.prototype.getClientOffset = function getClientOffset() {
return this.internalMonitor.getClientOffset();
};
SourceMonitor.prototype.getDifferenceFromInitialOffset = function getDifferenceFromInitialOffset() {
return this.internalMonitor.getDifferenceFromInitialOffset();
};
return SourceMonitor;
})();
function createSourceMonitor(manager) {
return new SourceMonitor(manager);
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/createSourceMonitor.js
// module id = 2744
// module chunks = 4

View file

@ -0,0 +1,21 @@
"use strict";
exports.__esModule = true;
exports["default"] = createTargetConnector;
function createTargetConnector(backend) {
return {
dropTarget: function connectDropTarget() {
return backend.connectDropTarget.apply(backend, arguments);
}
};
}
module.exports = exports["default"];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/createTargetConnector.js
// module id = 2745
// module chunks = 4

View file

@ -0,0 +1,90 @@
'use strict';
exports.__esModule = true;
exports['default'] = createTargetFactory;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
var ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];
function createTargetFactory(spec) {
Object.keys(spec).forEach(function (key) {
_invariant2['default'](ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', ALLOWED_SPEC_METHODS.join(', '), key);
_invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', key, key, spec[key]);
});
var Target = (function () {
function Target(monitor) {
_classCallCheck(this, Target);
this.monitor = monitor;
this.props = null;
this.component = null;
}
Target.prototype.receiveProps = function receiveProps(props) {
this.props = props;
};
Target.prototype.receiveMonitor = function receiveMonitor(monitor) {
this.monitor = monitor;
};
Target.prototype.receiveComponent = function receiveComponent(component) {
this.component = component;
};
Target.prototype.canDrop = function canDrop() {
if (!spec.canDrop) {
return true;
}
return spec.canDrop(this.props, this.monitor);
};
Target.prototype.hover = function hover() {
if (!spec.hover) {
return;
}
spec.hover(this.props, this.monitor, this.component);
};
Target.prototype.drop = function drop() {
if (!spec.drop) {
return;
}
var dropResult = spec.drop(this.props, this.monitor, this.component);
if (process.env.NODE_ENV !== 'production') {
_invariant2['default'](typeof dropResult === 'undefined' || _lodashLangIsPlainObject2['default'](dropResult), 'drop() must either return undefined, or an object that represents the drop result. ' + 'Instead received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', dropResult);
}
return dropResult;
};
return Target;
})();
return function createTarget(monitor) {
return new Target(monitor);
};
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/createTargetFactory.js
// module id = 2746
// module chunks = 4

View file

@ -0,0 +1,92 @@
'use strict';
exports.__esModule = true;
exports['default'] = createTargetMonitor;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var isCallingCanDrop = false;
var TargetMonitor = (function () {
function TargetMonitor(manager) {
_classCallCheck(this, TargetMonitor);
this.internalMonitor = manager.getMonitor();
}
TargetMonitor.prototype.receiveHandlerId = function receiveHandlerId(targetId) {
this.targetId = targetId;
};
TargetMonitor.prototype.canDrop = function canDrop() {
_invariant2['default'](!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target-monitor.html');
try {
isCallingCanDrop = true;
return this.internalMonitor.canDropOnTarget(this.targetId);
} finally {
isCallingCanDrop = false;
}
};
TargetMonitor.prototype.isOver = function isOver(options) {
return this.internalMonitor.isOverTarget(this.targetId, options);
};
TargetMonitor.prototype.getItemType = function getItemType() {
return this.internalMonitor.getItemType();
};
TargetMonitor.prototype.getItem = function getItem() {
return this.internalMonitor.getItem();
};
TargetMonitor.prototype.getDropResult = function getDropResult() {
return this.internalMonitor.getDropResult();
};
TargetMonitor.prototype.didDrop = function didDrop() {
return this.internalMonitor.didDrop();
};
TargetMonitor.prototype.getInitialClientOffset = function getInitialClientOffset() {
return this.internalMonitor.getInitialClientOffset();
};
TargetMonitor.prototype.getInitialSourceClientOffset = function getInitialSourceClientOffset() {
return this.internalMonitor.getInitialSourceClientOffset();
};
TargetMonitor.prototype.getSourceClientOffset = function getSourceClientOffset() {
return this.internalMonitor.getSourceClientOffset();
};
TargetMonitor.prototype.getClientOffset = function getClientOffset() {
return this.internalMonitor.getClientOffset();
};
TargetMonitor.prototype.getDifferenceFromInitialOffset = function getDifferenceFromInitialOffset() {
return this.internalMonitor.getDifferenceFromInitialOffset();
};
return TargetMonitor;
})();
function createTargetMonitor(manager) {
return new TargetMonitor(manager);
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/createTargetMonitor.js
// module id = 2747
// module chunks = 4

View file

@ -0,0 +1,188 @@
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
exports['default'] = decorateHandler;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _disposables = require('disposables');
var _utilsShallowEqual = require('./utils/shallowEqual');
var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual);
var _utilsShallowEqualScalar = require('./utils/shallowEqualScalar');
var _utilsShallowEqualScalar2 = _interopRequireDefault(_utilsShallowEqualScalar);
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _bindConnector2 = require('./bindConnector');
var _bindConnector3 = _interopRequireDefault(_bindConnector2);
function decorateHandler(_ref) {
var DecoratedComponent = _ref.DecoratedComponent;
var createHandler = _ref.createHandler;
var createMonitor = _ref.createMonitor;
var createConnector = _ref.createConnector;
var registerHandler = _ref.registerHandler;
var containerDisplayName = _ref.containerDisplayName;
var getType = _ref.getType;
var collect = _ref.collect;
var options = _ref.options;
var _options$arePropsEqual = options.arePropsEqual;
var arePropsEqual = _options$arePropsEqual === undefined ? _utilsShallowEqualScalar2['default'] : _options$arePropsEqual;
var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
return (function (_Component) {
_inherits(DragDropContainer, _Component);
DragDropContainer.prototype.getHandlerId = function getHandlerId() {
return this.handlerId;
};
DragDropContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() {
return this.decoratedComponentInstance;
};
DragDropContainer.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
return !arePropsEqual(nextProps, this.props) || !_utilsShallowEqual2['default'](nextState, this.state);
};
_createClass(DragDropContainer, null, [{
key: 'DecoratedComponent',
value: DecoratedComponent,
enumerable: true
}, {
key: 'displayName',
value: containerDisplayName + '(' + displayName + ')',
enumerable: true
}, {
key: 'contextTypes',
value: {
dragDropManager: _react.PropTypes.object.isRequired
},
enumerable: true
}]);
function DragDropContainer(props, context) {
_classCallCheck(this, DragDropContainer);
_Component.call(this, props, context);
this.handleChange = this.handleChange.bind(this);
this.handleChildRef = this.handleChildRef.bind(this);
_invariant2['default'](typeof this.context.dragDropManager === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);
this.manager = this.context.dragDropManager;
this.handlerMonitor = createMonitor(this.manager);
this.handler = createHandler(this.handlerMonitor);
this.disposable = new _disposables.SerialDisposable();
this.receiveProps(props);
this.state = this.getCurrentState();
}
DragDropContainer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (!arePropsEqual(nextProps, this.props)) {
this.receiveProps(nextProps);
this.handleChange();
}
};
DragDropContainer.prototype.componentWillUnmount = function componentWillUnmount() {
this.disposable.dispose();
};
DragDropContainer.prototype.receiveProps = function receiveProps(props) {
this.handler.receiveProps(props);
this.receiveType(getType(props));
};
DragDropContainer.prototype.receiveType = function receiveType(type) {
if (type === this.currentType) {
return;
}
this.currentType = type;
var _registerHandler = registerHandler(type, this.handler, this.manager);
var handlerId = _registerHandler.handlerId;
var unregister = _registerHandler.unregister;
var connector = createConnector(this.manager.getBackend());
var _bindConnector = _bindConnector3['default'](connector, handlerId);
var handlerConnector = _bindConnector.handlerConnector;
var connectorDisposable = _bindConnector.disposable;
this.handlerId = handlerId;
this.handlerConnector = handlerConnector;
this.handlerMonitor.receiveHandlerId(handlerId);
var globalMonitor = this.manager.getMonitor();
var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, { handlerIds: [handlerId] });
this.disposable.setDisposable(new _disposables.CompositeDisposable(new _disposables.Disposable(unsubscribe), new _disposables.Disposable(unregister), connectorDisposable));
};
DragDropContainer.prototype.handleChange = function handleChange() {
var nextState = this.getCurrentState();
if (!_utilsShallowEqual2['default'](nextState, this.state)) {
this.setState(nextState);
}
};
DragDropContainer.prototype.handleChildRef = function handleChildRef(component) {
this.decoratedComponentInstance = component;
this.handler.receiveComponent(component);
};
DragDropContainer.prototype.getCurrentState = function getCurrentState() {
var nextState = collect(this.handlerConnector, this.handlerMonitor);
if (process.env.NODE_ENV !== 'production') {
_invariant2['default'](_lodashLangIsPlainObject2['default'](nextState), 'Expected `collect` specified as the second argument to ' + '%s for %s to return a plain object of props to inject. ' + 'Instead, received %s.', containerDisplayName, displayName, nextState);
}
return nextState;
};
DragDropContainer.prototype.render = function render() {
return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, this.state, {
ref: this.handleChildRef }));
};
return DragDropContainer;
})(_react.Component);
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/decorateHandler.js
// module id = 1119
// module chunks = 4

37
509bba0_unpacked_with_node_modules/~/react-dnd/lib/index.js generated vendored Executable file
View file

@ -0,0 +1,37 @@
'use strict';
exports.__esModule = true;
function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; }
var _DragDropContext = require('./DragDropContext');
exports.DragDropContext = _interopRequire(_DragDropContext);
var _DragLayer = require('./DragLayer');
exports.DragLayer = _interopRequire(_DragLayer);
var _DragSource = require('./DragSource');
exports.DragSource = _interopRequire(_DragSource);
var _DropTarget = require('./DropTarget');
exports.DropTarget = _interopRequire(_DropTarget);
if (process.env.NODE_ENV !== 'production') {
Object.defineProperty(exports, 'default', {
get: function get() {
console.error( // eslint-disable-line no-console
'React DnD does not provide a default export. ' + 'You are probably missing the curly braces in the import statement. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#react-dnd-does-not-provide-a-default-export');
}
});
}
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/index.js
// module id = 254
// module chunks = 4

View file

@ -0,0 +1,27 @@
"use strict";
exports.__esModule = true;
exports["default"] = registerSource;
function registerSource(type, source, manager) {
var registry = manager.getRegistry();
var sourceId = registry.addSource(type, source);
function unregisterSource() {
registry.removeSource(sourceId);
}
return {
handlerId: sourceId,
unregister: unregisterSource
};
}
module.exports = exports["default"];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/registerSource.js
// module id = 2748
// module chunks = 4

View file

@ -0,0 +1,27 @@
"use strict";
exports.__esModule = true;
exports["default"] = registerTarget;
function registerTarget(type, target, manager) {
var registry = manager.getRegistry();
var targetId = registry.addTarget(type, target);
function unregisterTarget() {
registry.removeTarget(targetId);
}
return {
handlerId: targetId,
unregister: unregisterTarget
};
}
module.exports = exports["default"];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/registerTarget.js
// module id = 2749
// module chunks = 4

View file

@ -0,0 +1,30 @@
'use strict';
exports.__esModule = true;
exports['default'] = checkDecoratorArguments;
function checkDecoratorArguments(functionName, signature) {
if (process.env.NODE_ENV !== 'production') {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
for (var i = 0; i < args.length; i++) {
var arg = args[i];
if (arg && arg.prototype && arg.prototype.render) {
console.error( // eslint-disable-line no-console
'You seem to be applying the arguments in the wrong order. ' + ('It should be ' + functionName + '(' + signature + ')(Component), not the other way around. ') + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order');
return;
}
}
}
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/utils/checkDecoratorArguments.js
// module id = 439
// module chunks = 4

View file

@ -0,0 +1,36 @@
'use strict';
exports.__esModule = true;
exports['default'] = cloneWithRef;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _react = require('react');
function cloneWithRef(element, newRef) {
var previousRef = element.ref;
_invariant2['default'](typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' + 'Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. ' + 'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute');
return _react.cloneElement(element, {
ref: function ref(instance) {
newRef(instance);
if (previousRef) {
previousRef(instance);
}
}
});
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/utils/cloneWithRef.js
// module id = 2750
// module chunks = 4

View file

@ -0,0 +1,25 @@
'use strict';
exports.__esModule = true;
exports['default'] = isValidType;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _lodashLangIsArray = require('lodash/lang/isArray');
var _lodashLangIsArray2 = _interopRequireDefault(_lodashLangIsArray);
function isValidType(type, allowArray) {
return typeof type === 'string' || typeof type === 'symbol' || allowArray && _lodashLangIsArray2['default'](type) && type.every(function (t) {
return isValidType(t, false);
});
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/utils/isValidType.js
// module id = 1120
// module chunks = 4

View file

@ -0,0 +1,43 @@
"use strict";
exports.__esModule = true;
exports["default"] = shallowEqual;
function shallowEqual(objA, objB) {
if (objA === objB) {
return true;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
var hasOwn = Object.prototype.hasOwnProperty;
for (var i = 0; i < keysA.length; i++) {
if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
return false;
}
var valA = objA[keysA[i]];
var valB = objB[keysA[i]];
if (valA !== valB) {
return false;
}
}
return true;
}
module.exports = exports["default"];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/utils/shallowEqual.js
// module id = 649
// module chunks = 4

View file

@ -0,0 +1,47 @@
'use strict';
exports.__esModule = true;
exports['default'] = shallowEqualScalar;
function shallowEqualScalar(objA, objB) {
if (objA === objB) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
var hasOwn = Object.prototype.hasOwnProperty;
for (var i = 0; i < keysA.length; i++) {
if (!hasOwn.call(objB, keysA[i])) {
return false;
}
var valA = objA[keysA[i]];
var valB = objB[keysA[i]];
if (valA !== valB || typeof valA === 'object' || typeof valB === 'object') {
return false;
}
}
return true;
}
module.exports = exports['default'];
//////////////////
// WEBPACK FOOTER
// ./~/react-dnd/lib/utils/shallowEqualScalar.js
// module id = 1121
// module chunks = 4