Skip to content

Commit 6290fed

Browse files
committed
Invoke react-dnd-multi-backend differently to hopefully fix npm peer deps weirdness
1 parent 64e3d26 commit 6290fed

File tree

3 files changed

+32
-44
lines changed

3 files changed

+32
-44
lines changed

package.json

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@
66
"main": "lib/index.js",
77
"style": "lib/react-mosaic.css",
88
"typings": "lib/index.d.ts",
9-
"sideEffects": [
10-
"*.css"
11-
],
129
"repository": {
1310
"type": "git",
1411
"url": "https://github.com/nomcopter/react-mosaic.git"
1512
},
1613
"funding": "https://github.com/nomcopter/react-mosaic?sponsor=1",
14+
"keywords": [
15+
"ui",
16+
"react",
17+
"component",
18+
"typescript",
19+
"tiling-window-manager",
20+
"window-manager"
21+
],
22+
"sideEffects": [
23+
"*.css"
24+
],
1725
"scripts": {
1826
"build": "npm-run-all clean -lp build:**",
1927
"build:ts": "tsc -p tsconfig-build.json",
@@ -29,7 +37,18 @@
2937
"fix": "npm-run-all -lp fix:**",
3038
"fix:format": "yarn run prettier:run --write",
3139
"fix:lint": "yarn run test:lint --fix",
32-
"version": "yarn run bundle && git add -A docs/"
40+
"version": "npm-run-all test bundle && git add -A docs/"
41+
},
42+
"dependencies": {
43+
"classnames": "^2.3.1",
44+
"immutability-helper": "^3.1.1",
45+
"lodash": "^4.17.21",
46+
"prop-types": "^15.8.1",
47+
"react-dnd": "^14.0.5",
48+
"react-dnd-html5-backend": "^14.1.0",
49+
"react-dnd-multi-backend": "^6.0.2",
50+
"react-dnd-touch-backend": "^14.1.1",
51+
"uuid": "^3.4.0"
3352
},
3453
"devDependencies": {
3554
"@blueprintjs/core": "^4.7.0",
@@ -77,26 +96,10 @@
7796
"webpack-dev-server": "^2.11.5",
7897
"yarn-deduplicate": "^3.1.0"
7998
},
80-
"dependencies": {
81-
"classnames": "^2.3.1",
82-
"immutability-helper": "^3.1.1",
83-
"lodash": "^4.17.21",
84-
"prop-types": "^15.8.1",
85-
"react-dnd": "^14.0.5",
86-
"react-dnd-html5-backend": "^14.1.0",
87-
"react-dnd-multi-backend": "^6.0.2",
88-
"react-dnd-touch-backend": "^14.1.1",
89-
"uuid": "^3.4.0"
90-
},
9199
"peerDependencies": {
92100
"react": "16 - 18"
93101
},
94-
"keywords": [
95-
"ui",
96-
"react",
97-
"component",
98-
"typescript",
99-
"tiling-window-manager",
100-
"window-manager"
101-
]
102+
"resolutions": {
103+
"dnd-core": "14.0.1"
104+
}
102105
}

src/Mosaic.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import countBy from 'lodash/countBy';
33
import keys from 'lodash/keys';
44
import pickBy from 'lodash/pickBy';
55
import React from 'react';
6-
import { Backends, DndProvider } from 'react-dnd-multi-backend';
6+
import { DndProvider } from 'react-dnd';
7+
import MultiBackend from 'react-dnd-multi-backend';
78
import HTML5ToTouch from 'react-dnd-multi-backend/dist/cjs/HTML5toTouch';
89
import { v4 as uuid } from 'uuid';
910

@@ -213,19 +214,12 @@ export class MosaicWithoutDragDropContext<T extends MosaicKey = string> extends
213214
}
214215
}
215216

216-
const FixedDndProvider = DndProvider as React.FC<{
217-
context?: any;
218-
debugMode?: boolean | undefined;
219-
options: Backends;
220-
children?: React.ReactNode;
221-
}>;
222-
223217
export class Mosaic<T extends MosaicKey = string> extends React.PureComponent<MosaicProps<T>> {
224218
render() {
225219
return (
226-
<FixedDndProvider options={HTML5ToTouch}>
220+
<DndProvider backend={MultiBackend} options={HTML5ToTouch}>
227221
<MosaicWithoutDragDropContext<T> {...this.props} />
228-
</FixedDndProvider>
222+
</DndProvider>
229223
);
230224
}
231225
}

yarn.lock

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ diffie-hellman@^5.0.0:
17301730
miller-rabin "^4.0.0"
17311731
randombytes "^2.0.0"
17321732

1733-
dnd-core@14.0.1:
1733+
dnd-core@14.0.1, dnd-core@^10.0.2:
17341734
version "14.0.1"
17351735
resolved "https://registry.yarnpkg.com/dnd-core/-/dnd-core-14.0.1.tgz#76d000e41c494983210fb20a48b835f81a203c2e"
17361736
integrity sha512-+PVS2VPTgKFPYWo3vAFEA8WPbTf7/xo43TifH9G8S1KqnrQu0o77A3unrF5yOugy4mIz7K5wAVFHUcha7wsz6A==
@@ -1739,15 +1739,6 @@ dnd-core@14.0.1:
17391739
"@react-dnd/invariant" "^2.0.0"
17401740
redux "^4.1.1"
17411741

1742-
dnd-core@^10.0.2:
1743-
version "10.0.2"
1744-
resolved "https://registry.yarnpkg.com/dnd-core/-/dnd-core-10.0.2.tgz#051dc119682ea1185622f954667670d3d5f6a574"
1745-
integrity sha512-PrxEjxF0+6Y1n1n1Z9hSWZ1tvnDXv9syL+BccV1r1RC08uWNsyetf8AnWmUF3NgYPwy0HKQJwTqGkZK+1NlaFA==
1746-
dependencies:
1747-
"@react-dnd/asap" "^4.0.0"
1748-
"@react-dnd/invariant" "^2.0.0"
1749-
redux "^4.0.4"
1750-
17511742
dnd-multi-backend@^6.0.0:
17521743
version "6.0.0"
17531744
resolved "https://registry.yarnpkg.com/dnd-multi-backend/-/dnd-multi-backend-6.0.0.tgz#4ed68229a3f6f1fb9e9bc45b4034e8330005280d"
@@ -5287,7 +5278,7 @@ reduce-function-call@^1.0.1:
52875278
dependencies:
52885279
balanced-match "^0.4.2"
52895280

5290-
redux@^4.0.4, redux@^4.1.1:
5281+
redux@^4.1.1:
52915282
version "4.1.2"
52925283
resolved "https://registry.yarnpkg.com/redux/-/redux-4.1.2.tgz#140f35426d99bb4729af760afcf79eaaac407104"
52935284
integrity sha512-SH8PglcebESbd/shgf6mii6EIoRM0zrQyjcuQ+ojmfxjTtE0z9Y8pa62iA/OJ58qjP6j27uyW4kUF4jl/jd6sw==

0 commit comments

Comments
 (0)