File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,10 @@ export interface MosaicBaseProps<T extends MosaicKey> {
206206 * default: 'bp3'
207207 */
208208 blueprintNamespace? : string ;
209+ /**
210+ * Override the react-dnd provider to allow applications to inject an existing drag and drop context
211+ */
212+ dragAndDropManager? : DragDropManager | undefined ;
209213}
210214
211215export interface MosaicControlledProps <T extends MosaicKey > extends MosaicBaseProps <T > {
Original file line number Diff line number Diff line change 6868 "@types/webpack" : " ^3.8.21" ,
6969 "chai" : " ^4.3.6" ,
7070 "css-loader" : " ^0.28.11" ,
71+ "dnd-core" : " 14.0.1" ,
7172 "file-loader" : " ^1.1.11" ,
7273 "html-loader" : " ^0.5.5" ,
7374 "html-webpack-plugin" : " ^2.30.1" ,
Original file line number Diff line number Diff line change 11import classNames from 'classnames' ;
2+ import { DragDropManager } from 'dnd-core' ;
23import countBy from 'lodash/countBy' ;
34import keys from 'lodash/keys' ;
45import pickBy from 'lodash/pickBy' ;
@@ -58,6 +59,10 @@ export interface MosaicBaseProps<T extends MosaicKey> {
5859 * default: 'bp3'
5960 */
6061 blueprintNamespace ?: string ;
62+ /**
63+ * Override the react-dnd provider to allow applications to inject an existing drag and drop context
64+ */
65+ dragAndDropManager ?: DragDropManager | undefined ;
6166}
6267
6368export interface MosaicControlledProps < T extends MosaicKey > extends MosaicBaseProps < T > {
@@ -217,7 +222,11 @@ export class MosaicWithoutDragDropContext<T extends MosaicKey = string> extends
217222export class Mosaic < T extends MosaicKey = string > extends React . PureComponent < MosaicProps < T > > {
218223 render ( ) {
219224 return (
220- < DndProvider backend = { MultiBackend } options = { HTML5ToTouch } >
225+ < DndProvider
226+ backend = { MultiBackend }
227+ options = { HTML5ToTouch }
228+ { ...( this . props . dragAndDropManager && { manager : this . props . dragAndDropManager } ) }
229+ >
221230 < MosaicWithoutDragDropContext < T > { ...this . props } />
222231 </ DndProvider >
223232 ) ;
You can’t perform that action at this time.
0 commit comments