diff --git a/README.md b/README.md index 5ab93dc..fb6a323 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,10 @@ export interface MosaicBaseProps { * default: 'bp3' */ blueprintNamespace?: string; + /** + * Override the react-dnd provider to allow applications to inject an existing drag and drop context + */ + dragAndDropManager?: DragDropManager | undefined; } export interface MosaicControlledProps extends MosaicBaseProps { diff --git a/package.json b/package.json index f846d73..59953e3 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "@types/webpack": "^3.8.21", "chai": "^4.3.6", "css-loader": "^0.28.11", + "dnd-core": "14.0.1", "file-loader": "^1.1.11", "html-loader": "^0.5.5", "html-webpack-plugin": "^2.30.1", diff --git a/src/Mosaic.tsx b/src/Mosaic.tsx index a90bc80..cd392a8 100644 --- a/src/Mosaic.tsx +++ b/src/Mosaic.tsx @@ -1,4 +1,5 @@ import classNames from 'classnames'; +import { DragDropManager } from 'dnd-core'; import countBy from 'lodash/countBy'; import keys from 'lodash/keys'; import pickBy from 'lodash/pickBy'; @@ -58,6 +59,10 @@ export interface MosaicBaseProps { * default: 'bp3' */ blueprintNamespace?: string; + /** + * Override the react-dnd provider to allow applications to inject an existing drag and drop context + */ + dragAndDropManager?: DragDropManager | undefined; } export interface MosaicControlledProps extends MosaicBaseProps { @@ -217,7 +222,11 @@ export class MosaicWithoutDragDropContext extends export class Mosaic extends React.PureComponent> { render() { return ( - + {...this.props} /> );