react-dnd
Advanced tools
Comparing version 15.0.2 to 15.1.0
@@ -9,3 +9,3 @@ "use strict"; | ||
var _dndCore = require("dnd-core"); | ||
var _dndContext = require("./DndContext"); | ||
var _dndContextJs = require("./DndContext.js"); | ||
function _objectWithoutProperties(source, excluded) { | ||
@@ -62,3 +62,3 @@ if (source == null) return {}; | ||
}, []); | ||
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_dndContext.DndContext.Provider, { | ||
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_dndContextJs.DndContext.Provider, { | ||
value: manager, | ||
@@ -65,0 +65,0 @@ children: children |
@@ -7,3 +7,3 @@ "use strict"; | ||
var _react = require("react"); | ||
const DragPreviewImage = /*#__PURE__*/ (0, _react).memo(function DragPreviewImage({ connect , src }) { | ||
const DragPreviewImage = (0, _react).memo(function DragPreviewImage({ connect , src }) { | ||
(0, _react).useEffect(()=>{ | ||
@@ -10,0 +10,0 @@ if (typeof Image === 'undefined') return; |
@@ -6,35 +6,35 @@ "use strict"; | ||
var _exportNames = {}; | ||
var _dndContext = _interopRequireWildcard(require("./DndContext")); | ||
Object.keys(_dndContext).forEach(function(key) { | ||
var _dndContextJs = _interopRequireWildcard(require("./DndContext.js")); | ||
Object.keys(_dndContextJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _dndContext[key]) return; | ||
if (key in exports && exports[key] === _dndContextJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _dndContext[key]; | ||
return _dndContextJs[key]; | ||
} | ||
}); | ||
}); | ||
var _dndProvider = _interopRequireWildcard(require("./DndProvider")); | ||
Object.keys(_dndProvider).forEach(function(key) { | ||
var _dndProviderJs = _interopRequireWildcard(require("./DndProvider.js")); | ||
Object.keys(_dndProviderJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _dndProvider[key]) return; | ||
if (key in exports && exports[key] === _dndProviderJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _dndProvider[key]; | ||
return _dndProviderJs[key]; | ||
} | ||
}); | ||
}); | ||
var _dragPreviewImage = _interopRequireWildcard(require("./DragPreviewImage")); | ||
Object.keys(_dragPreviewImage).forEach(function(key) { | ||
var _dragPreviewImageJs = _interopRequireWildcard(require("./DragPreviewImage.js")); | ||
Object.keys(_dragPreviewImageJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _dragPreviewImage[key]) return; | ||
if (key in exports && exports[key] === _dragPreviewImageJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _dragPreviewImage[key]; | ||
return _dragPreviewImageJs[key]; | ||
} | ||
@@ -41,0 +41,0 @@ }); |
@@ -6,59 +6,59 @@ "use strict"; | ||
var _exportNames = {}; | ||
var _useDrag = _interopRequireWildcard(require("./useDrag")); | ||
Object.keys(_useDrag).forEach(function(key) { | ||
var _indexJs = _interopRequireWildcard(require("./useDrag/index.js")); | ||
Object.keys(_indexJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _useDrag[key]) return; | ||
if (key in exports && exports[key] === _indexJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _useDrag[key]; | ||
return _indexJs[key]; | ||
} | ||
}); | ||
}); | ||
var _useDrop = _interopRequireWildcard(require("./useDrop")); | ||
Object.keys(_useDrop).forEach(function(key) { | ||
var _indexJs1 = _interopRequireWildcard(require("./useDrop/index.js")); | ||
Object.keys(_indexJs1).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _useDrop[key]) return; | ||
if (key in exports && exports[key] === _indexJs1[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _useDrop[key]; | ||
return _indexJs1[key]; | ||
} | ||
}); | ||
}); | ||
var _useDragLayer = _interopRequireWildcard(require("./useDragLayer")); | ||
Object.keys(_useDragLayer).forEach(function(key) { | ||
var _useDragLayerJs = _interopRequireWildcard(require("./useDragLayer.js")); | ||
Object.keys(_useDragLayerJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _useDragLayer[key]) return; | ||
if (key in exports && exports[key] === _useDragLayerJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _useDragLayer[key]; | ||
return _useDragLayerJs[key]; | ||
} | ||
}); | ||
}); | ||
var _useDragDropManager = _interopRequireWildcard(require("./useDragDropManager")); | ||
Object.keys(_useDragDropManager).forEach(function(key) { | ||
var _useDragDropManagerJs = _interopRequireWildcard(require("./useDragDropManager.js")); | ||
Object.keys(_useDragDropManagerJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _useDragDropManager[key]) return; | ||
if (key in exports && exports[key] === _useDragDropManagerJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _useDragDropManager[key]; | ||
return _useDragDropManagerJs[key]; | ||
} | ||
}); | ||
}); | ||
var _types = _interopRequireWildcard(require("./types")); | ||
Object.keys(_types).forEach(function(key) { | ||
var _typesJs = _interopRequireWildcard(require("./types.js")); | ||
Object.keys(_typesJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _types[key]) return; | ||
if (key in exports && exports[key] === _typesJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _types[key]; | ||
return _typesJs[key]; | ||
} | ||
@@ -65,0 +65,0 @@ }); |
@@ -6,5 +6,5 @@ "use strict"; | ||
exports.useCollectedProps = useCollectedProps; | ||
var _useMonitorOutput = require("./useMonitorOutput"); | ||
var _useMonitorOutputJs = require("./useMonitorOutput.js"); | ||
function useCollectedProps(collector, monitor, connector) { | ||
return (0, _useMonitorOutput).useMonitorOutput(monitor, collector || (()=>({}) | ||
return (0, _useMonitorOutputJs).useMonitorOutput(monitor, collector || (()=>({}) | ||
), ()=>connector.reconnect() | ||
@@ -11,0 +11,0 @@ ); |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _react = require("react"); | ||
var _useIsomorphicLayoutEffect = require("./useIsomorphicLayoutEffect"); | ||
var _useIsomorphicLayoutEffectJs = require("./useIsomorphicLayoutEffect.js"); | ||
function _interopRequireDefault(obj) { | ||
@@ -36,3 +36,3 @@ return obj && obj.__esModule ? obj : { | ||
// done when the component updates | ||
(0, _useIsomorphicLayoutEffect).useIsomorphicLayoutEffect(updateCollected); | ||
(0, _useIsomorphicLayoutEffectJs).useIsomorphicLayoutEffect(updateCollected); | ||
return [ | ||
@@ -39,0 +39,0 @@ collected, |
@@ -5,10 +5,10 @@ "use strict"; | ||
}); | ||
var _useDrag = _interopRequireWildcard(require("./useDrag")); | ||
Object.keys(_useDrag).forEach(function(key) { | ||
var _useDragJs = _interopRequireWildcard(require("./useDrag.js")); | ||
Object.keys(_useDragJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _useDrag[key]) return; | ||
if (key in exports && exports[key] === _useDragJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _useDrag[key]; | ||
return _useDragJs[key]; | ||
} | ||
@@ -15,0 +15,0 @@ }); |
@@ -6,19 +6,19 @@ "use strict"; | ||
exports.useDrag = useDrag; | ||
var _useRegisteredDragSource = require("./useRegisteredDragSource"); | ||
var _useOptionalFactory = require("../useOptionalFactory"); | ||
var _useDragSourceMonitor = require("./useDragSourceMonitor"); | ||
var _useDragSourceConnector = require("./useDragSourceConnector"); | ||
var _useCollectedProps = require("../useCollectedProps"); | ||
var _connectors = require("./connectors"); | ||
var _useRegisteredDragSourceJs = require("./useRegisteredDragSource.js"); | ||
var _useOptionalFactoryJs = require("../useOptionalFactory.js"); | ||
var _useDragSourceMonitorJs = require("./useDragSourceMonitor.js"); | ||
var _useDragSourceConnectorJs = require("./useDragSourceConnector.js"); | ||
var _useCollectedPropsJs = require("../useCollectedProps.js"); | ||
var _connectorsJs = require("./connectors.js"); | ||
var _invariant = require("@react-dnd/invariant"); | ||
function useDrag(specArg, deps) { | ||
const spec = (0, _useOptionalFactory).useOptionalFactory(specArg, deps); | ||
const spec = (0, _useOptionalFactoryJs).useOptionalFactory(specArg, deps); | ||
(0, _invariant).invariant(!spec.begin, `useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)`); | ||
const monitor = (0, _useDragSourceMonitor).useDragSourceMonitor(); | ||
const connector = (0, _useDragSourceConnector).useDragSourceConnector(spec.options, spec.previewOptions); | ||
(0, _useRegisteredDragSource).useRegisteredDragSource(spec, monitor, connector); | ||
const monitor = (0, _useDragSourceMonitorJs).useDragSourceMonitor(); | ||
const connector = (0, _useDragSourceConnectorJs).useDragSourceConnector(spec.options, spec.previewOptions); | ||
(0, _useRegisteredDragSourceJs).useRegisteredDragSource(spec, monitor, connector); | ||
return [ | ||
(0, _useCollectedProps).useCollectedProps(spec.collect, monitor, connector), | ||
(0, _connectors).useConnectDragSource(connector), | ||
(0, _connectors).useConnectDragPreview(connector), | ||
(0, _useCollectedPropsJs).useCollectedProps(spec.collect, monitor, connector), | ||
(0, _connectorsJs).useConnectDragSource(connector), | ||
(0, _connectorsJs).useConnectDragPreview(connector), | ||
]; | ||
@@ -25,0 +25,0 @@ } |
@@ -7,5 +7,5 @@ "use strict"; | ||
var _react = require("react"); | ||
var _dragSourceImpl = require("./DragSourceImpl"); | ||
var _dragSourceImplJs = require("./DragSourceImpl.js"); | ||
function useDragSource(spec, monitor, connector) { | ||
const handler = (0, _react).useMemo(()=>new _dragSourceImpl.DragSourceImpl(spec, monitor, connector) | ||
const handler = (0, _react).useMemo(()=>new _dragSourceImplJs.DragSourceImpl(spec, monitor, connector) | ||
, [ | ||
@@ -12,0 +12,0 @@ monitor, |
@@ -7,12 +7,12 @@ "use strict"; | ||
var _react = require("react"); | ||
var _internals = require("../../internals"); | ||
var _useDragDropManager = require("../useDragDropManager"); | ||
var _useIsomorphicLayoutEffect = require("../useIsomorphicLayoutEffect"); | ||
var _indexJs = require("../../internals/index.js"); | ||
var _useDragDropManagerJs = require("../useDragDropManager.js"); | ||
var _useIsomorphicLayoutEffectJs = require("../useIsomorphicLayoutEffect.js"); | ||
function useDragSourceConnector(dragSourceOptions, dragPreviewOptions) { | ||
const manager = (0, _useDragDropManager).useDragDropManager(); | ||
const connector = (0, _react).useMemo(()=>new _internals.SourceConnector(manager.getBackend()) | ||
const manager = (0, _useDragDropManagerJs).useDragDropManager(); | ||
const connector = (0, _react).useMemo(()=>new _indexJs.SourceConnector(manager.getBackend()) | ||
, [ | ||
manager | ||
]); | ||
(0, _useIsomorphicLayoutEffect).useIsomorphicLayoutEffect(()=>{ | ||
(0, _useIsomorphicLayoutEffectJs).useIsomorphicLayoutEffect(()=>{ | ||
connector.dragSourceOptions = dragSourceOptions || null; | ||
@@ -26,3 +26,3 @@ connector.reconnect(); | ||
]); | ||
(0, _useIsomorphicLayoutEffect).useIsomorphicLayoutEffect(()=>{ | ||
(0, _useIsomorphicLayoutEffectJs).useIsomorphicLayoutEffect(()=>{ | ||
connector.dragPreviewOptions = dragPreviewOptions || null; | ||
@@ -29,0 +29,0 @@ connector.reconnect(); |
@@ -7,7 +7,7 @@ "use strict"; | ||
var _react = require("react"); | ||
var _internals = require("../../internals"); | ||
var _useDragDropManager = require("../useDragDropManager"); | ||
var _indexJs = require("../../internals/index.js"); | ||
var _useDragDropManagerJs = require("../useDragDropManager.js"); | ||
function useDragSourceMonitor() { | ||
const manager = (0, _useDragDropManager).useDragDropManager(); | ||
return (0, _react).useMemo(()=>new _internals.DragSourceMonitorImpl(manager) | ||
const manager = (0, _useDragDropManagerJs).useDragDropManager(); | ||
return (0, _react).useMemo(()=>new _indexJs.DragSourceMonitorImpl(manager) | ||
, [ | ||
@@ -14,0 +14,0 @@ manager |
@@ -6,14 +6,14 @@ "use strict"; | ||
exports.useRegisteredDragSource = useRegisteredDragSource; | ||
var _internals = require("../../internals"); | ||
var _useIsomorphicLayoutEffect = require("../useIsomorphicLayoutEffect"); | ||
var _useDragSource = require("./useDragSource"); | ||
var _useDragDropManager = require("../useDragDropManager"); | ||
var _useDragType = require("./useDragType"); | ||
var _indexJs = require("../../internals/index.js"); | ||
var _useIsomorphicLayoutEffectJs = require("../useIsomorphicLayoutEffect.js"); | ||
var _useDragSourceJs = require("./useDragSource.js"); | ||
var _useDragDropManagerJs = require("../useDragDropManager.js"); | ||
var _useDragTypeJs = require("./useDragType.js"); | ||
function useRegisteredDragSource(spec, monitor, connector) { | ||
const manager = (0, _useDragDropManager).useDragDropManager(); | ||
const handler = (0, _useDragSource).useDragSource(spec, monitor, connector); | ||
const itemType = (0, _useDragType).useDragType(spec); | ||
(0, _useIsomorphicLayoutEffect).useIsomorphicLayoutEffect(function registerDragSource() { | ||
const manager = (0, _useDragDropManagerJs).useDragDropManager(); | ||
const handler = (0, _useDragSourceJs).useDragSource(spec, monitor, connector); | ||
const itemType = (0, _useDragTypeJs).useDragType(spec); | ||
(0, _useIsomorphicLayoutEffectJs).useIsomorphicLayoutEffect(function registerDragSource() { | ||
if (itemType != null) { | ||
const [handlerId, unregister] = (0, _internals).registerSource(itemType, handler, manager); | ||
const [handlerId, unregister] = (0, _indexJs).registerSource(itemType, handler, manager); | ||
monitor.receiveHandlerId(handlerId); | ||
@@ -20,0 +20,0 @@ connector.receiveHandlerId(handlerId); |
@@ -8,5 +8,5 @@ "use strict"; | ||
var _invariant = require("@react-dnd/invariant"); | ||
var _core = require("../core"); | ||
var _indexJs = require("../core/index.js"); | ||
function useDragDropManager() { | ||
const { dragDropManager } = (0, _react).useContext(_core.DndContext); | ||
const { dragDropManager } = (0, _react).useContext(_indexJs.DndContext); | ||
(0, _invariant).invariant(dragDropManager != null, 'Expected drag drop context'); | ||
@@ -13,0 +13,0 @@ return dragDropManager; |
@@ -7,8 +7,8 @@ "use strict"; | ||
var _react = require("react"); | ||
var _useDragDropManager = require("./useDragDropManager"); | ||
var _useCollector = require("./useCollector"); | ||
var _useDragDropManagerJs = require("./useDragDropManager.js"); | ||
var _useCollectorJs = require("./useCollector.js"); | ||
function useDragLayer(collect) { | ||
const dragDropManager = (0, _useDragDropManager).useDragDropManager(); | ||
const dragDropManager = (0, _useDragDropManagerJs).useDragDropManager(); | ||
const monitor = dragDropManager.getMonitor(); | ||
const [collected, updateCollected] = (0, _useCollector).useCollector(monitor, collect); | ||
const [collected, updateCollected] = (0, _useCollectorJs).useCollector(monitor, collect); | ||
(0, _react).useEffect(()=>monitor.subscribeToOffsetChange(updateCollected) | ||
@@ -15,0 +15,0 @@ ); |
@@ -5,10 +5,10 @@ "use strict"; | ||
}); | ||
var _useDrop = _interopRequireWildcard(require("./useDrop")); | ||
Object.keys(_useDrop).forEach(function(key) { | ||
var _useDropJs = _interopRequireWildcard(require("./useDrop.js")); | ||
Object.keys(_useDropJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _useDrop[key]) return; | ||
if (key in exports && exports[key] === _useDropJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _useDrop[key]; | ||
return _useDropJs[key]; | ||
} | ||
@@ -15,0 +15,0 @@ }); |
@@ -6,16 +6,16 @@ "use strict"; | ||
exports.useDrop = useDrop; | ||
var _useRegisteredDropTarget = require("./useRegisteredDropTarget"); | ||
var _useOptionalFactory = require("../useOptionalFactory"); | ||
var _useDropTargetMonitor = require("./useDropTargetMonitor"); | ||
var _useDropTargetConnector = require("./useDropTargetConnector"); | ||
var _useCollectedProps = require("../useCollectedProps"); | ||
var _connectors = require("./connectors"); | ||
var _useRegisteredDropTargetJs = require("./useRegisteredDropTarget.js"); | ||
var _useOptionalFactoryJs = require("../useOptionalFactory.js"); | ||
var _useDropTargetMonitorJs = require("./useDropTargetMonitor.js"); | ||
var _useDropTargetConnectorJs = require("./useDropTargetConnector.js"); | ||
var _useCollectedPropsJs = require("../useCollectedProps.js"); | ||
var _connectorsJs = require("./connectors.js"); | ||
function useDrop(specArg, deps) { | ||
const spec = (0, _useOptionalFactory).useOptionalFactory(specArg, deps); | ||
const monitor = (0, _useDropTargetMonitor).useDropTargetMonitor(); | ||
const connector = (0, _useDropTargetConnector).useDropTargetConnector(spec.options); | ||
(0, _useRegisteredDropTarget).useRegisteredDropTarget(spec, monitor, connector); | ||
const spec = (0, _useOptionalFactoryJs).useOptionalFactory(specArg, deps); | ||
const monitor = (0, _useDropTargetMonitorJs).useDropTargetMonitor(); | ||
const connector = (0, _useDropTargetConnectorJs).useDropTargetConnector(spec.options); | ||
(0, _useRegisteredDropTargetJs).useRegisteredDropTarget(spec, monitor, connector); | ||
return [ | ||
(0, _useCollectedProps).useCollectedProps(spec.collect, monitor, connector), | ||
(0, _connectors).useConnectDropTarget(connector), | ||
(0, _useCollectedPropsJs).useCollectedProps(spec.collect, monitor, connector), | ||
(0, _connectorsJs).useConnectDropTarget(connector), | ||
]; | ||
@@ -22,0 +22,0 @@ } |
@@ -7,5 +7,5 @@ "use strict"; | ||
var _react = require("react"); | ||
var _dropTargetImpl = require("./DropTargetImpl"); | ||
var _dropTargetImplJs = require("./DropTargetImpl.js"); | ||
function useDropTarget(spec, monitor) { | ||
const dropTarget = (0, _react).useMemo(()=>new _dropTargetImpl.DropTargetImpl(spec, monitor) | ||
const dropTarget = (0, _react).useMemo(()=>new _dropTargetImplJs.DropTargetImpl(spec, monitor) | ||
, [ | ||
@@ -12,0 +12,0 @@ monitor |
@@ -7,12 +7,12 @@ "use strict"; | ||
var _react = require("react"); | ||
var _internals = require("../../internals"); | ||
var _useDragDropManager = require("../useDragDropManager"); | ||
var _useIsomorphicLayoutEffect = require("../useIsomorphicLayoutEffect"); | ||
var _indexJs = require("../../internals/index.js"); | ||
var _useDragDropManagerJs = require("../useDragDropManager.js"); | ||
var _useIsomorphicLayoutEffectJs = require("../useIsomorphicLayoutEffect.js"); | ||
function useDropTargetConnector(options) { | ||
const manager = (0, _useDragDropManager).useDragDropManager(); | ||
const connector = (0, _react).useMemo(()=>new _internals.TargetConnector(manager.getBackend()) | ||
const manager = (0, _useDragDropManagerJs).useDragDropManager(); | ||
const connector = (0, _react).useMemo(()=>new _indexJs.TargetConnector(manager.getBackend()) | ||
, [ | ||
manager | ||
]); | ||
(0, _useIsomorphicLayoutEffect).useIsomorphicLayoutEffect(()=>{ | ||
(0, _useIsomorphicLayoutEffectJs).useIsomorphicLayoutEffect(()=>{ | ||
connector.dropTargetOptions = options || null; | ||
@@ -19,0 +19,0 @@ connector.reconnect(); |
@@ -7,7 +7,7 @@ "use strict"; | ||
var _react = require("react"); | ||
var _internals = require("../../internals"); | ||
var _useDragDropManager = require("../useDragDropManager"); | ||
var _indexJs = require("../../internals/index.js"); | ||
var _useDragDropManagerJs = require("../useDragDropManager.js"); | ||
function useDropTargetMonitor() { | ||
const manager = (0, _useDragDropManager).useDragDropManager(); | ||
return (0, _react).useMemo(()=>new _internals.DropTargetMonitorImpl(manager) | ||
const manager = (0, _useDragDropManagerJs).useDragDropManager(); | ||
return (0, _react).useMemo(()=>new _indexJs.DropTargetMonitorImpl(manager) | ||
, [ | ||
@@ -14,0 +14,0 @@ manager |
@@ -6,13 +6,13 @@ "use strict"; | ||
exports.useRegisteredDropTarget = useRegisteredDropTarget; | ||
var _internals = require("../../internals"); | ||
var _useDragDropManager = require("../useDragDropManager"); | ||
var _useIsomorphicLayoutEffect = require("../useIsomorphicLayoutEffect"); | ||
var _useAccept = require("./useAccept"); | ||
var _useDropTarget = require("./useDropTarget"); | ||
var _indexJs = require("../../internals/index.js"); | ||
var _useDragDropManagerJs = require("../useDragDropManager.js"); | ||
var _useIsomorphicLayoutEffectJs = require("../useIsomorphicLayoutEffect.js"); | ||
var _useAcceptJs = require("./useAccept.js"); | ||
var _useDropTargetJs = require("./useDropTarget.js"); | ||
function useRegisteredDropTarget(spec, monitor, connector) { | ||
const manager = (0, _useDragDropManager).useDragDropManager(); | ||
const dropTarget = (0, _useDropTarget).useDropTarget(spec, monitor); | ||
const accept = (0, _useAccept).useAccept(spec); | ||
(0, _useIsomorphicLayoutEffect).useIsomorphicLayoutEffect(function registerDropTarget() { | ||
const [handlerId, unregister] = (0, _internals).registerTarget(accept, dropTarget, manager); | ||
const manager = (0, _useDragDropManagerJs).useDragDropManager(); | ||
const dropTarget = (0, _useDropTargetJs).useDropTarget(spec, monitor); | ||
const accept = (0, _useAcceptJs).useAccept(spec); | ||
(0, _useIsomorphicLayoutEffectJs).useIsomorphicLayoutEffect(function registerDropTarget() { | ||
const [handlerId, unregister] = (0, _indexJs).registerTarget(accept, dropTarget, manager); | ||
monitor.receiveHandlerId(handlerId); | ||
@@ -19,0 +19,0 @@ connector.receiveHandlerId(handlerId); |
@@ -6,7 +6,7 @@ "use strict"; | ||
exports.useMonitorOutput = useMonitorOutput; | ||
var _useIsomorphicLayoutEffect = require("./useIsomorphicLayoutEffect"); | ||
var _useCollector = require("./useCollector"); | ||
var _useIsomorphicLayoutEffectJs = require("./useIsomorphicLayoutEffect.js"); | ||
var _useCollectorJs = require("./useCollector.js"); | ||
function useMonitorOutput(monitor, collect, onCollect) { | ||
const [collected, updateCollected] = (0, _useCollector).useCollector(monitor, collect, onCollect); | ||
(0, _useIsomorphicLayoutEffect).useIsomorphicLayoutEffect(function subscribeToMonitorStateChange() { | ||
const [collected, updateCollected] = (0, _useCollectorJs).useCollector(monitor, collect, onCollect); | ||
(0, _useIsomorphicLayoutEffectJs).useIsomorphicLayoutEffect(function subscribeToMonitorStateChange() { | ||
const handlerId = monitor.getHandlerId(); | ||
@@ -13,0 +13,0 @@ if (handlerId == null) { |
@@ -6,35 +6,35 @@ "use strict"; | ||
var _exportNames = {}; | ||
var _types = _interopRequireWildcard(require("./types")); | ||
Object.keys(_types).forEach(function(key) { | ||
var _indexJs = _interopRequireWildcard(require("./types/index.js")); | ||
Object.keys(_indexJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _types[key]) return; | ||
if (key in exports && exports[key] === _indexJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _types[key]; | ||
return _indexJs[key]; | ||
} | ||
}); | ||
}); | ||
var _core = _interopRequireWildcard(require("./core")); | ||
Object.keys(_core).forEach(function(key) { | ||
var _indexJs1 = _interopRequireWildcard(require("./core/index.js")); | ||
Object.keys(_indexJs1).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _core[key]) return; | ||
if (key in exports && exports[key] === _indexJs1[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _core[key]; | ||
return _indexJs1[key]; | ||
} | ||
}); | ||
}); | ||
var _hooks = _interopRequireWildcard(require("./hooks")); | ||
Object.keys(_hooks).forEach(function(key) { | ||
var _indexJs2 = _interopRequireWildcard(require("./hooks/index.js")); | ||
Object.keys(_indexJs2).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _hooks[key]) return; | ||
if (key in exports && exports[key] === _indexJs2[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _hooks[key]; | ||
return _indexJs2[key]; | ||
} | ||
@@ -41,0 +41,0 @@ }); |
@@ -6,59 +6,59 @@ "use strict"; | ||
var _exportNames = {}; | ||
var _dragSourceMonitorImpl = _interopRequireWildcard(require("./DragSourceMonitorImpl")); | ||
Object.keys(_dragSourceMonitorImpl).forEach(function(key) { | ||
var _dragSourceMonitorImplJs = _interopRequireWildcard(require("./DragSourceMonitorImpl.js")); | ||
Object.keys(_dragSourceMonitorImplJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _dragSourceMonitorImpl[key]) return; | ||
if (key in exports && exports[key] === _dragSourceMonitorImplJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _dragSourceMonitorImpl[key]; | ||
return _dragSourceMonitorImplJs[key]; | ||
} | ||
}); | ||
}); | ||
var _dropTargetMonitorImpl = _interopRequireWildcard(require("./DropTargetMonitorImpl")); | ||
Object.keys(_dropTargetMonitorImpl).forEach(function(key) { | ||
var _dropTargetMonitorImplJs = _interopRequireWildcard(require("./DropTargetMonitorImpl.js")); | ||
Object.keys(_dropTargetMonitorImplJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _dropTargetMonitorImpl[key]) return; | ||
if (key in exports && exports[key] === _dropTargetMonitorImplJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _dropTargetMonitorImpl[key]; | ||
return _dropTargetMonitorImplJs[key]; | ||
} | ||
}); | ||
}); | ||
var _sourceConnector = _interopRequireWildcard(require("./SourceConnector")); | ||
Object.keys(_sourceConnector).forEach(function(key) { | ||
var _sourceConnectorJs = _interopRequireWildcard(require("./SourceConnector.js")); | ||
Object.keys(_sourceConnectorJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _sourceConnector[key]) return; | ||
if (key in exports && exports[key] === _sourceConnectorJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _sourceConnector[key]; | ||
return _sourceConnectorJs[key]; | ||
} | ||
}); | ||
}); | ||
var _targetConnector = _interopRequireWildcard(require("./TargetConnector")); | ||
Object.keys(_targetConnector).forEach(function(key) { | ||
var _targetConnectorJs = _interopRequireWildcard(require("./TargetConnector.js")); | ||
Object.keys(_targetConnectorJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _targetConnector[key]) return; | ||
if (key in exports && exports[key] === _targetConnectorJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _targetConnector[key]; | ||
return _targetConnectorJs[key]; | ||
} | ||
}); | ||
}); | ||
var _registration = _interopRequireWildcard(require("./registration")); | ||
Object.keys(_registration).forEach(function(key) { | ||
var _registrationJs = _interopRequireWildcard(require("./registration.js")); | ||
Object.keys(_registrationJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _registration[key]) return; | ||
if (key in exports && exports[key] === _registrationJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _registration[key]; | ||
return _registrationJs[key]; | ||
} | ||
@@ -65,0 +65,0 @@ }); |
@@ -5,4 +5,4 @@ "use strict"; | ||
}); | ||
var _wrapConnectorHooks = require("./wrapConnectorHooks"); | ||
var _isRef = require("./isRef"); | ||
var _wrapConnectorHooksJs = require("./wrapConnectorHooks.js"); | ||
var _isRefJs = require("./isRef.js"); | ||
var _shallowequal = require("@react-dnd/shallowequal"); | ||
@@ -123,7 +123,7 @@ class SourceConnector { | ||
constructor(backend){ | ||
this.hooks = (0, _wrapConnectorHooks).wrapConnectorHooks({ | ||
this.hooks = (0, _wrapConnectorHooksJs).wrapConnectorHooks({ | ||
dragSource: (node, options)=>{ | ||
this.clearDragSource(); | ||
this.dragSourceOptions = options || null; | ||
if ((0, _isRef).isRef(node)) { | ||
if ((0, _isRefJs).isRef(node)) { | ||
this.dragSourceRef = node; | ||
@@ -138,3 +138,3 @@ } else { | ||
this.dragPreviewOptions = options || null; | ||
if ((0, _isRef).isRef(node)) { | ||
if ((0, _isRefJs).isRef(node)) { | ||
this.dragPreviewRef = node; | ||
@@ -141,0 +141,0 @@ } else { |
@@ -6,4 +6,4 @@ "use strict"; | ||
var _shallowequal = require("@react-dnd/shallowequal"); | ||
var _wrapConnectorHooks = require("./wrapConnectorHooks"); | ||
var _isRef = require("./isRef"); | ||
var _wrapConnectorHooksJs = require("./wrapConnectorHooks.js"); | ||
var _isRefJs = require("./isRef.js"); | ||
class TargetConnector { | ||
@@ -70,7 +70,7 @@ get connectTarget() { | ||
constructor(backend){ | ||
this.hooks = (0, _wrapConnectorHooks).wrapConnectorHooks({ | ||
this.hooks = (0, _wrapConnectorHooksJs).wrapConnectorHooks({ | ||
dropTarget: (node, options)=>{ | ||
this.clearDropTarget(); | ||
this.dropTargetOptions = options; | ||
if ((0, _isRef).isRef(node)) { | ||
if ((0, _isRefJs).isRef(node)) { | ||
this.dropTargetRef = node; | ||
@@ -77,0 +77,0 @@ } else { |
@@ -6,35 +6,35 @@ "use strict"; | ||
var _exportNames = {}; | ||
var _monitors = _interopRequireWildcard(require("./monitors")); | ||
Object.keys(_monitors).forEach(function(key) { | ||
var _monitorsJs = _interopRequireWildcard(require("./monitors.js")); | ||
Object.keys(_monitorsJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _monitors[key]) return; | ||
if (key in exports && exports[key] === _monitorsJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _monitors[key]; | ||
return _monitorsJs[key]; | ||
} | ||
}); | ||
}); | ||
var _options = _interopRequireWildcard(require("./options")); | ||
Object.keys(_options).forEach(function(key) { | ||
var _optionsJs = _interopRequireWildcard(require("./options.js")); | ||
Object.keys(_optionsJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _options[key]) return; | ||
if (key in exports && exports[key] === _optionsJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _options[key]; | ||
return _optionsJs[key]; | ||
} | ||
}); | ||
}); | ||
var _connectors = _interopRequireWildcard(require("./connectors")); | ||
Object.keys(_connectors).forEach(function(key) { | ||
var _connectorsJs = _interopRequireWildcard(require("./connectors.js")); | ||
Object.keys(_connectorsJs).forEach(function(key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _connectors[key]) return; | ||
if (key in exports && exports[key] === _connectorsJs[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function() { | ||
return _connectors[key]; | ||
return _connectorsJs[key]; | ||
} | ||
@@ -41,0 +41,0 @@ }); |
import { FC } from 'react'; | ||
import type { ConnectDragPreview } from '../types'; | ||
import type { ConnectDragPreview } from '../types/index.js'; | ||
export interface DragPreviewImageProps { | ||
@@ -4,0 +4,0 @@ connect: ConnectDragPreview; |
@@ -1,3 +0,3 @@ | ||
export * from './DndContext'; | ||
export * from './DndProvider'; | ||
export * from './DragPreviewImage'; | ||
export * from './DndContext.js'; | ||
export * from './DndProvider.js'; | ||
export * from './DragPreviewImage.js'; |
@@ -1,5 +0,5 @@ | ||
export * from './useDrag'; | ||
export * from './useDrop'; | ||
export * from './useDragLayer'; | ||
export * from './useDragDropManager'; | ||
export * from './types'; | ||
export * from './useDrag/index.js'; | ||
export * from './useDrop/index.js'; | ||
export * from './useDragLayer.js'; | ||
export * from './useDragDropManager.js'; | ||
export * from './types.js'; |
import type { TargetType, SourceType } from 'dnd-core'; | ||
import type { DropTargetMonitor, DragSourceMonitor, DragSourceOptions, DragPreviewOptions, DropTargetOptions } from '../types'; | ||
import type { DropTargetMonitor, DragSourceMonitor, DragSourceOptions, DragPreviewOptions, DropTargetOptions } from '../types/index.js'; | ||
export declare type FactoryOrInstance<T> = T | (() => T); | ||
@@ -4,0 +4,0 @@ export declare type DragObjectFactory<T> = (monitor: DragSourceMonitor<T>) => T | null; |
@@ -1,3 +0,3 @@ | ||
import type { Connector } from '../internals'; | ||
import type { HandlerManager, MonitorEventEmitter } from '../types'; | ||
import type { Connector } from '../internals/index.js'; | ||
import type { HandlerManager, MonitorEventEmitter } from '../types/index.js'; | ||
export declare function useCollectedProps<Collected, Monitor extends HandlerManager>(collector: ((monitor: Monitor) => Collected) | undefined, monitor: Monitor & MonitorEventEmitter, connector: Connector): Collected; |
@@ -1,3 +0,3 @@ | ||
import type { SourceConnector } from '../../internals'; | ||
import type { SourceConnector } from '../../internals/index.js'; | ||
export declare function useConnectDragSource(connector: SourceConnector): any; | ||
export declare function useConnectDragPreview(connector: SourceConnector): any; |
import type { DragDropMonitor, DragSource, Identifier } from 'dnd-core'; | ||
import type { Connector } from '../../internals'; | ||
import type { DragSourceMonitor } from '../../types'; | ||
import type { DragSourceHookSpec } from '../types'; | ||
import type { Connector } from '../../internals/index.js'; | ||
import type { DragSourceMonitor } from '../../types/index.js'; | ||
import type { DragSourceHookSpec } from '../types.js'; | ||
export declare class DragSourceImpl<O, R, P> implements DragSource { | ||
@@ -6,0 +6,0 @@ spec: DragSourceHookSpec<O, R, P>; |
@@ -1,1 +0,1 @@ | ||
export * from './useDrag'; | ||
export * from './useDrag.js'; |
@@ -1,3 +0,3 @@ | ||
import type { ConnectDragSource, ConnectDragPreview } from '../../types'; | ||
import type { DragSourceHookSpec, FactoryOrInstance } from '../types'; | ||
import type { ConnectDragSource, ConnectDragPreview } from '../../types/index.js'; | ||
import type { DragSourceHookSpec, FactoryOrInstance } from '../types.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * useDragSource hook |
@@ -1,5 +0,5 @@ | ||
import type { Connector } from '../../internals'; | ||
import type { DragSourceMonitor } from '../../types'; | ||
import type { DragSourceHookSpec } from '../types'; | ||
import { DragSourceImpl } from './DragSourceImpl'; | ||
import type { Connector } from '../../internals/index.js'; | ||
import type { DragSourceMonitor } from '../../types/index.js'; | ||
import type { DragSourceHookSpec } from '../types.js'; | ||
import { DragSourceImpl } from './DragSourceImpl.js'; | ||
export declare function useDragSource<O, R, P>(spec: DragSourceHookSpec<O, R, P>, monitor: DragSourceMonitor<O, R>, connector: Connector): DragSourceImpl<O, R, P>; |
@@ -1,3 +0,3 @@ | ||
import { SourceConnector } from '../../internals'; | ||
import type { DragPreviewOptions, DragSourceOptions } from '../../types'; | ||
import { SourceConnector } from '../../internals/index.js'; | ||
import type { DragPreviewOptions, DragSourceOptions } from '../../types/index.js'; | ||
export declare function useDragSourceConnector(dragSourceOptions: DragSourceOptions | undefined, dragPreviewOptions: DragPreviewOptions | undefined): SourceConnector; |
@@ -1,2 +0,2 @@ | ||
import type { DragSourceMonitor } from '../../types'; | ||
import type { DragSourceMonitor } from '../../types/index.js'; | ||
export declare function useDragSourceMonitor<O, R>(): DragSourceMonitor<O, R>; |
import type { Identifier } from 'dnd-core'; | ||
import type { DragSourceHookSpec } from '../types'; | ||
import type { DragSourceHookSpec } from '../types.js'; | ||
export declare function useDragType(spec: DragSourceHookSpec<any, any, any>): Identifier; |
@@ -1,4 +0,4 @@ | ||
import type { DragSourceMonitor } from '../../types'; | ||
import { SourceConnector } from '../../internals'; | ||
import type { DragSourceHookSpec } from '../types'; | ||
import type { DragSourceMonitor } from '../../types/index.js'; | ||
import { SourceConnector } from '../../internals/index.js'; | ||
import type { DragSourceHookSpec } from '../types.js'; | ||
export declare function useRegisteredDragSource<O, R, P>(spec: DragSourceHookSpec<O, R, P>, monitor: DragSourceMonitor<O, R>, connector: SourceConnector): void; |
@@ -1,2 +0,2 @@ | ||
import type { DragLayerMonitor } from '../types'; | ||
import type { DragLayerMonitor } from '../types/index.js'; | ||
/** | ||
@@ -3,0 +3,0 @@ * useDragLayer Hook |
@@ -1,2 +0,2 @@ | ||
import type { TargetConnector } from '../../internals'; | ||
import type { TargetConnector } from '../../internals/index.js'; | ||
export declare function useConnectDropTarget(connector: TargetConnector): any; |
import type { DropTarget } from 'dnd-core'; | ||
import type { DropTargetMonitor } from '../../types'; | ||
import type { DropTargetHookSpec } from '../types'; | ||
import type { DropTargetMonitor } from '../../types/index.js'; | ||
import type { DropTargetHookSpec } from '../types.js'; | ||
export declare class DropTargetImpl<O, R, P> implements DropTarget { | ||
@@ -5,0 +5,0 @@ spec: DropTargetHookSpec<O, R, P>; |
@@ -1,1 +0,1 @@ | ||
export * from './useDrop'; | ||
export * from './useDrop.js'; |
import type { Identifier } from 'dnd-core'; | ||
import type { DropTargetHookSpec } from '../types'; | ||
import type { DropTargetHookSpec } from '../types.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Internal utility hook to get an array-version of spec.accept. |
@@ -1,3 +0,3 @@ | ||
import type { ConnectDropTarget } from '../../types'; | ||
import type { DropTargetHookSpec, FactoryOrInstance } from '../types'; | ||
import type { ConnectDropTarget } from '../../types/index.js'; | ||
import type { DropTargetHookSpec, FactoryOrInstance } from '../types.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * useDropTarget Hook |
@@ -1,4 +0,4 @@ | ||
import type { DropTargetMonitor } from '../../types'; | ||
import type { DropTargetHookSpec } from '../types'; | ||
import { DropTargetImpl } from './DropTargetImpl'; | ||
import type { DropTargetMonitor } from '../../types/index.js'; | ||
import type { DropTargetHookSpec } from '../types.js'; | ||
import { DropTargetImpl } from './DropTargetImpl.js'; | ||
export declare function useDropTarget<O, R, P>(spec: DropTargetHookSpec<O, R, P>, monitor: DropTargetMonitor<O, R>): DropTargetImpl<O, R, P>; |
@@ -1,3 +0,3 @@ | ||
import { TargetConnector } from '../../internals'; | ||
import type { DropTargetOptions } from '../../types'; | ||
import { TargetConnector } from '../../internals/index.js'; | ||
import type { DropTargetOptions } from '../../types/index.js'; | ||
export declare function useDropTargetConnector(options: DropTargetOptions): TargetConnector; |
@@ -1,2 +0,2 @@ | ||
import type { DropTargetMonitor } from '../../types'; | ||
import type { DropTargetMonitor } from '../../types/index.js'; | ||
export declare function useDropTargetMonitor<O, R>(): DropTargetMonitor<O, R>; |
@@ -1,4 +0,4 @@ | ||
import { TargetConnector } from '../../internals'; | ||
import type { DropTargetMonitor } from '../../types'; | ||
import type { DropTargetHookSpec } from '../types'; | ||
import { TargetConnector } from '../../internals/index.js'; | ||
import type { DropTargetMonitor } from '../../types/index.js'; | ||
import type { DropTargetHookSpec } from '../types.js'; | ||
export declare function useRegisteredDropTarget<O, R, P>(spec: DropTargetHookSpec<O, R, P>, monitor: DropTargetMonitor<O, R>, connector: TargetConnector): void; |
@@ -1,2 +0,2 @@ | ||
import type { HandlerManager, MonitorEventEmitter } from '../types'; | ||
import type { HandlerManager, MonitorEventEmitter } from '../types/index.js'; | ||
export declare function useMonitorOutput<Monitor extends HandlerManager, Collected>(monitor: Monitor & MonitorEventEmitter, collect: (monitor: Monitor) => Collected, onCollect?: () => void): Collected; |
@@ -1,2 +0,2 @@ | ||
import type { FactoryOrInstance } from './types'; | ||
import type { FactoryOrInstance } from './types.js'; | ||
export declare function useOptionalFactory<T>(arg: FactoryOrInstance<T>, deps?: unknown[]): T; |
@@ -1,3 +0,3 @@ | ||
export * from './types'; | ||
export * from './core'; | ||
export * from './hooks'; | ||
export * from './types/index.js'; | ||
export * from './core/index.js'; | ||
export * from './hooks/index.js'; |
import type { DragDropManager, Unsubscribe, Listener, Identifier, XYCoord } from 'dnd-core'; | ||
import type { DragSourceMonitor } from '../types'; | ||
import type { DragSourceMonitor } from '../types/index.js'; | ||
export declare class DragSourceMonitorImpl implements DragSourceMonitor { | ||
@@ -4,0 +4,0 @@ private internalMonitor; |
import type { DragDropManager, Unsubscribe, Listener, Identifier, XYCoord } from 'dnd-core'; | ||
import type { DropTargetMonitor } from '../types'; | ||
import type { DropTargetMonitor } from '../types/index.js'; | ||
export declare class DropTargetMonitorImpl implements DropTargetMonitor { | ||
@@ -4,0 +4,0 @@ private internalMonitor; |
@@ -1,5 +0,5 @@ | ||
export * from './DragSourceMonitorImpl'; | ||
export * from './DropTargetMonitorImpl'; | ||
export * from './SourceConnector'; | ||
export * from './TargetConnector'; | ||
export * from './registration'; | ||
export * from './DragSourceMonitorImpl.js'; | ||
export * from './DropTargetMonitorImpl.js'; | ||
export * from './SourceConnector.js'; | ||
export * from './TargetConnector.js'; | ||
export * from './registration.js'; |
import type { Backend, Identifier } from 'dnd-core'; | ||
import type { DragSourceOptions, DragPreviewOptions } from '../types'; | ||
import type { DragSourceOptions, DragPreviewOptions } from '../types/index.js'; | ||
export interface Connector { | ||
@@ -4,0 +4,0 @@ hooks: any; |
import type { Backend, Identifier } from 'dnd-core'; | ||
import type { Connector } from './SourceConnector'; | ||
import type { DropTargetOptions } from '../types'; | ||
import type { Connector } from './SourceConnector.js'; | ||
import type { DropTargetOptions } from '../types/index.js'; | ||
export declare class TargetConnector implements Connector { | ||
@@ -5,0 +5,0 @@ hooks: any; |
@@ -1,3 +0,3 @@ | ||
export * from './monitors'; | ||
export * from './options'; | ||
export * from './connectors'; | ||
export * from './monitors.js'; | ||
export * from './options.js'; | ||
export * from './connectors.js'; |
{ | ||
"name": "react-dnd", | ||
"version": "15.0.2", | ||
"version": "15.1.0", | ||
"description": "Drag and Drop for React", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/types/index.d.ts", | ||
"exports": { | ||
"import": "./dist/esm/index.mjs", | ||
"require": "./dist/cjs/index.js", | ||
"types": "./dist/types/index.d.ts" | ||
}, | ||
"sideEffects": false, | ||
@@ -19,3 +23,4 @@ "repository": { | ||
"build_cjs": "swc -C module.type=commonjs -d dist/cjs src/", | ||
"build": "run-s build_types build_esm build_cjs" | ||
"esm_hack": "node ../../scripts/esmify.mjs", | ||
"build": "run-s build_types build_esm build_cjs esm_hack" | ||
}, | ||
@@ -25,3 +30,3 @@ "dependencies": { | ||
"@react-dnd/shallowequal": "^2.0.0", | ||
"dnd-core": "15.0.2", | ||
"dnd-core": "15.1.0", | ||
"fast-deep-equal": "^3.1.3", | ||
@@ -35,2 +40,3 @@ "hoist-non-react-statics": "^3.3.2" | ||
"@types/hoist-non-react-statics": "^3.3.1", | ||
"@types/jest": "^27.4.0", | ||
"@types/node": "^14.17.19", | ||
@@ -37,0 +43,0 @@ "@types/react": "^17.0.38", |
@@ -1,3 +0,3 @@ | ||
export * from './DndContext' | ||
export * from './DndProvider' | ||
export * from './DragPreviewImage' | ||
export * from './DndContext.js' | ||
export * from './DndProvider.js' | ||
export * from './DragPreviewImage.js' |
@@ -1,5 +0,5 @@ | ||
export * from './useDrag' | ||
export * from './useDrop' | ||
export * from './useDragLayer' | ||
export * from './useDragDropManager' | ||
export * from './types' | ||
export * from './useDrag/index.js' | ||
export * from './useDrop/index.js' | ||
export * from './useDragLayer.js' | ||
export * from './useDragDropManager.js' | ||
export * from './types.js' |
@@ -8,3 +8,3 @@ import type { TargetType, SourceType } from 'dnd-core' | ||
DropTargetOptions, | ||
} from '../types' | ||
} from '../types/index.js' | ||
@@ -11,0 +11,0 @@ export type FactoryOrInstance<T> = T | (() => T) |
@@ -1,4 +0,4 @@ | ||
import type { Connector } from '../internals' | ||
import type { HandlerManager, MonitorEventEmitter } from '../types' | ||
import { useMonitorOutput } from './useMonitorOutput' | ||
import type { Connector } from '../internals/index.js' | ||
import type { HandlerManager, MonitorEventEmitter } from '../types/index.js' | ||
import { useMonitorOutput } from './useMonitorOutput.js' | ||
@@ -5,0 +5,0 @@ export function useCollectedProps<Collected, Monitor extends HandlerManager>( |
import equal from 'fast-deep-equal' | ||
import { useState, useCallback } from 'react' | ||
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect' | ||
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js' | ||
@@ -5,0 +5,0 @@ /** |
import { useMemo } from 'react' | ||
import type { SourceConnector } from '../../internals' | ||
import type { SourceConnector } from '../../internals/index.js' | ||
@@ -4,0 +4,0 @@ export function useConnectDragSource(connector: SourceConnector) { |
import type { DragDropMonitor, DragSource, Identifier } from 'dnd-core' | ||
import type { Connector } from '../../internals' | ||
import type { DragSourceMonitor } from '../../types' | ||
import type { DragObjectFactory, DragSourceHookSpec } from '../types' | ||
import type { Connector } from '../../internals/index.js' | ||
import type { DragSourceMonitor } from '../../types/index.js' | ||
import type { DragObjectFactory, DragSourceHookSpec } from '../types.js' | ||
@@ -6,0 +6,0 @@ export class DragSourceImpl<O, R, P> implements DragSource { |
@@ -1,1 +0,1 @@ | ||
export * from './useDrag' | ||
export * from './useDrag.js' |
@@ -1,9 +0,12 @@ | ||
import type { ConnectDragSource, ConnectDragPreview } from '../../types' | ||
import type { DragSourceHookSpec, FactoryOrInstance } from '../types' | ||
import { useRegisteredDragSource } from './useRegisteredDragSource' | ||
import { useOptionalFactory } from '../useOptionalFactory' | ||
import { useDragSourceMonitor } from './useDragSourceMonitor' | ||
import { useDragSourceConnector } from './useDragSourceConnector' | ||
import { useCollectedProps } from '../useCollectedProps' | ||
import { useConnectDragPreview, useConnectDragSource } from './connectors' | ||
import type { | ||
ConnectDragSource, | ||
ConnectDragPreview, | ||
} from '../../types/index.js' | ||
import type { DragSourceHookSpec, FactoryOrInstance } from '../types.js' | ||
import { useRegisteredDragSource } from './useRegisteredDragSource.js' | ||
import { useOptionalFactory } from '../useOptionalFactory.js' | ||
import { useDragSourceMonitor } from './useDragSourceMonitor.js' | ||
import { useDragSourceConnector } from './useDragSourceConnector.js' | ||
import { useCollectedProps } from '../useCollectedProps.js' | ||
import { useConnectDragPreview, useConnectDragSource } from './connectors.js' | ||
import { invariant } from '@react-dnd/invariant' | ||
@@ -10,0 +13,0 @@ |
import { useEffect, useMemo } from 'react' | ||
import type { Connector } from '../../internals' | ||
import type { DragSourceMonitor } from '../../types' | ||
import type { DragSourceHookSpec } from '../types' | ||
import { DragSourceImpl } from './DragSourceImpl' | ||
import type { Connector } from '../../internals/index.js' | ||
import type { DragSourceMonitor } from '../../types/index.js' | ||
import type { DragSourceHookSpec } from '../types.js' | ||
import { DragSourceImpl } from './DragSourceImpl.js' | ||
@@ -7,0 +7,0 @@ export function useDragSource<O, R, P>( |
import { useMemo } from 'react' | ||
import { SourceConnector } from '../../internals' | ||
import type { DragPreviewOptions, DragSourceOptions } from '../../types' | ||
import { useDragDropManager } from '../useDragDropManager' | ||
import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect' | ||
import { SourceConnector } from '../../internals/index.js' | ||
import type { | ||
DragPreviewOptions, | ||
DragSourceOptions, | ||
} from '../../types/index.js' | ||
import { useDragDropManager } from '../useDragDropManager.js' | ||
import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js' | ||
@@ -7,0 +10,0 @@ export function useDragSourceConnector( |
import { useMemo } from 'react' | ||
import { DragSourceMonitorImpl } from '../../internals' | ||
import type { DragSourceMonitor } from '../../types' | ||
import { useDragDropManager } from '../useDragDropManager' | ||
import { DragSourceMonitorImpl } from '../../internals/index.js' | ||
import type { DragSourceMonitor } from '../../types/index.js' | ||
import { useDragDropManager } from '../useDragDropManager.js' | ||
@@ -6,0 +6,0 @@ export function useDragSourceMonitor<O, R>(): DragSourceMonitor<O, R> { |
import { invariant } from '@react-dnd/invariant' | ||
import type { Identifier } from 'dnd-core' | ||
import { useMemo } from 'react' | ||
import type { DragSourceHookSpec } from '../types' | ||
import type { DragSourceHookSpec } from '../types.js' | ||
@@ -6,0 +6,0 @@ export function useDragType( |
@@ -1,8 +0,8 @@ | ||
import type { DragSourceMonitor } from '../../types' | ||
import { registerSource, SourceConnector } from '../../internals' | ||
import type { DragSourceHookSpec } from '../types' | ||
import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect' | ||
import { useDragSource } from './useDragSource' | ||
import { useDragDropManager } from '../useDragDropManager' | ||
import { useDragType } from './useDragType' | ||
import type { DragSourceMonitor } from '../../types/index.js' | ||
import { registerSource, SourceConnector } from '../../internals/index.js' | ||
import type { DragSourceHookSpec } from '../types.js' | ||
import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js' | ||
import { useDragSource } from './useDragSource.js' | ||
import { useDragDropManager } from '../useDragDropManager.js' | ||
import { useDragType } from './useDragType.js' | ||
@@ -9,0 +9,0 @@ export function useRegisteredDragSource<O, R, P>( |
import { useContext } from 'react' | ||
import type { DragDropManager } from 'dnd-core' | ||
import { invariant } from '@react-dnd/invariant' | ||
import { DndContext } from '../core' | ||
import { DndContext } from '../core/index.js' | ||
@@ -6,0 +6,0 @@ /** |
import { useEffect } from 'react' | ||
import type { DragLayerMonitor } from '../types' | ||
import { useDragDropManager } from './useDragDropManager' | ||
import { useCollector } from './useCollector' | ||
import type { DragLayerMonitor } from '../types/index.js' | ||
import { useDragDropManager } from './useDragDropManager.js' | ||
import { useCollector } from './useCollector.js' | ||
@@ -6,0 +6,0 @@ /** |
import { useMemo } from 'react' | ||
import type { TargetConnector } from '../../internals' | ||
import type { TargetConnector } from '../../internals/index.js' | ||
@@ -4,0 +4,0 @@ export function useConnectDropTarget(connector: TargetConnector) { |
import type { DropTarget } from 'dnd-core' | ||
import type { DropTargetMonitor } from '../../types' | ||
import type { DropTargetHookSpec } from '../types' | ||
import type { DropTargetMonitor } from '../../types/index.js' | ||
import type { DropTargetHookSpec } from '../types.js' | ||
@@ -5,0 +5,0 @@ export class DropTargetImpl<O, R, P> implements DropTarget { |
@@ -1,1 +0,1 @@ | ||
export * from './useDrop' | ||
export * from './useDrop.js' |
import { invariant } from '@react-dnd/invariant' | ||
import type { Identifier } from 'dnd-core' | ||
import { useMemo } from 'react' | ||
import type { DropTargetHookSpec } from '../types' | ||
import type { DropTargetHookSpec } from '../types.js' | ||
@@ -6,0 +6,0 @@ /** |
@@ -1,9 +0,9 @@ | ||
import type { ConnectDropTarget } from '../../types' | ||
import type { DropTargetHookSpec, FactoryOrInstance } from '../types' | ||
import { useRegisteredDropTarget } from './useRegisteredDropTarget' | ||
import { useOptionalFactory } from '../useOptionalFactory' | ||
import { useDropTargetMonitor } from './useDropTargetMonitor' | ||
import { useDropTargetConnector } from './useDropTargetConnector' | ||
import { useCollectedProps } from '../useCollectedProps' | ||
import { useConnectDropTarget } from './connectors' | ||
import type { ConnectDropTarget } from '../../types/index.js' | ||
import type { DropTargetHookSpec, FactoryOrInstance } from '../types.js' | ||
import { useRegisteredDropTarget } from './useRegisteredDropTarget.js' | ||
import { useOptionalFactory } from '../useOptionalFactory.js' | ||
import { useDropTargetMonitor } from './useDropTargetMonitor.js' | ||
import { useDropTargetConnector } from './useDropTargetConnector.js' | ||
import { useCollectedProps } from '../useCollectedProps.js' | ||
import { useConnectDropTarget } from './connectors.js' | ||
@@ -10,0 +10,0 @@ /** |
import { useEffect, useMemo } from 'react' | ||
import type { DropTargetMonitor } from '../../types' | ||
import type { DropTargetHookSpec } from '../types' | ||
import { DropTargetImpl } from './DropTargetImpl' | ||
import type { DropTargetMonitor } from '../../types/index.js' | ||
import type { DropTargetHookSpec } from '../types.js' | ||
import { DropTargetImpl } from './DropTargetImpl.js' | ||
@@ -6,0 +6,0 @@ export function useDropTarget<O, R, P>( |
import { useMemo } from 'react' | ||
import { TargetConnector } from '../../internals' | ||
import type { DropTargetOptions } from '../../types' | ||
import { useDragDropManager } from '../useDragDropManager' | ||
import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect' | ||
import { TargetConnector } from '../../internals/index.js' | ||
import type { DropTargetOptions } from '../../types/index.js' | ||
import { useDragDropManager } from '../useDragDropManager.js' | ||
import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js' | ||
@@ -7,0 +7,0 @@ export function useDropTargetConnector( |
import { useMemo } from 'react' | ||
import { DropTargetMonitorImpl } from '../../internals' | ||
import type { DropTargetMonitor } from '../../types' | ||
import { useDragDropManager } from '../useDragDropManager' | ||
import { DropTargetMonitorImpl } from '../../internals/index.js' | ||
import type { DropTargetMonitor } from '../../types/index.js' | ||
import { useDragDropManager } from '../useDragDropManager.js' | ||
@@ -6,0 +6,0 @@ export function useDropTargetMonitor<O, R>(): DropTargetMonitor<O, R> { |
@@ -1,8 +0,8 @@ | ||
import { registerTarget, TargetConnector } from '../../internals' | ||
import type { DropTargetMonitor } from '../../types' | ||
import type { DropTargetHookSpec } from '../types' | ||
import { useDragDropManager } from '../useDragDropManager' | ||
import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect' | ||
import { useAccept } from './useAccept' | ||
import { useDropTarget } from './useDropTarget' | ||
import { registerTarget, TargetConnector } from '../../internals/index.js' | ||
import type { DropTargetMonitor } from '../../types/index.js' | ||
import type { DropTargetHookSpec } from '../types.js' | ||
import { useDragDropManager } from '../useDragDropManager.js' | ||
import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js' | ||
import { useAccept } from './useAccept.js' | ||
import { useDropTarget } from './useDropTarget.js' | ||
@@ -9,0 +9,0 @@ export function useRegisteredDropTarget<O, R, P>( |
@@ -1,4 +0,4 @@ | ||
import type { HandlerManager, MonitorEventEmitter } from '../types' | ||
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect' | ||
import { useCollector } from './useCollector' | ||
import type { HandlerManager, MonitorEventEmitter } from '../types/index.js' | ||
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js' | ||
import { useCollector } from './useCollector.js' | ||
@@ -5,0 +5,0 @@ export function useMonitorOutput<Monitor extends HandlerManager, Collected>( |
import { useMemo } from 'react' | ||
import type { FactoryOrInstance } from './types' | ||
import type { FactoryOrInstance } from './types.js' | ||
@@ -4,0 +4,0 @@ export function useOptionalFactory<T>( |
@@ -1,3 +0,3 @@ | ||
export * from './types' | ||
export * from './core' | ||
export * from './hooks' | ||
export * from './types/index.js' | ||
export * from './core/index.js' | ||
export * from './hooks/index.js' |
@@ -10,3 +10,3 @@ import type { | ||
import { invariant } from '@react-dnd/invariant' | ||
import type { DragSourceMonitor } from '../types' | ||
import type { DragSourceMonitor } from '../types/index.js' | ||
@@ -13,0 +13,0 @@ let isCallingCanDrag = false |
@@ -10,3 +10,3 @@ import type { | ||
import { invariant } from '@react-dnd/invariant' | ||
import type { DropTargetMonitor } from '../types' | ||
import type { DropTargetMonitor } from '../types/index.js' | ||
@@ -13,0 +13,0 @@ let isCallingCanDrop = false |
@@ -1,5 +0,5 @@ | ||
export * from './DragSourceMonitorImpl' | ||
export * from './DropTargetMonitorImpl' | ||
export * from './SourceConnector' | ||
export * from './TargetConnector' | ||
export * from './registration' | ||
export * from './DragSourceMonitorImpl.js' | ||
export * from './DropTargetMonitorImpl.js' | ||
export * from './SourceConnector.js' | ||
export * from './TargetConnector.js' | ||
export * from './registration.js' |
import type { ReactElement, Ref, RefObject } from 'react' | ||
import { wrapConnectorHooks } from './wrapConnectorHooks' | ||
import { wrapConnectorHooks } from './wrapConnectorHooks.js' | ||
import type { Backend, Unsubscribe, Identifier } from 'dnd-core' | ||
import { isRef } from './isRef' | ||
import type { DragSourceOptions, DragPreviewOptions } from '../types' | ||
import { isRef } from './isRef.js' | ||
import type { DragSourceOptions, DragPreviewOptions } from '../types/index.js' | ||
import { shallowEqual } from '@react-dnd/shallowequal' | ||
@@ -7,0 +7,0 @@ |
import type { RefObject } from 'react' | ||
import { shallowEqual } from '@react-dnd/shallowequal' | ||
import { wrapConnectorHooks } from './wrapConnectorHooks' | ||
import { wrapConnectorHooks } from './wrapConnectorHooks.js' | ||
import type { Backend, Unsubscribe, Identifier } from 'dnd-core' | ||
import { isRef } from './isRef' | ||
import type { Connector } from './SourceConnector' | ||
import type { DropTargetOptions } from '../types' | ||
import { isRef } from './isRef.js' | ||
import type { Connector } from './SourceConnector.js' | ||
import type { DropTargetOptions } from '../types/index.js' | ||
@@ -9,0 +9,0 @@ export class TargetConnector implements Connector { |
@@ -1,3 +0,3 @@ | ||
export * from './monitors' | ||
export * from './options' | ||
export * from './connectors' | ||
export * from './monitors.js' | ||
export * from './options.js' | ||
export * from './connectors.js' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
373598
4898
15
+ Addeddnd-core@15.1.0(transitive)
- Removeddnd-core@15.0.2(transitive)
Updateddnd-core@15.1.0