Skip to content

Commit 18e5567

Browse files
committed
Merge branch 'master' into gh-pages
2 parents 5f12edf + 356a2b1 commit 18e5567

41 files changed

Lines changed: 7370 additions & 3638 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.babelrc

Lines changed: 0 additions & 18 deletions
This file was deleted.

.babelrc.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
'use strict';
2+
3+
// If set, we put Babel in "esmMode", i.e. leave import/export intact.
4+
// Good for webpack and for an esm build.
5+
const esmMode = process.env.BABEL_MODULE_TYPE === "module";
6+
const es6Compat = process.env.BABEL_ES_COMPAT === "6";
7+
8+
module.exports = {
9+
"presets": [
10+
[
11+
"@babel/preset-env",
12+
{
13+
// Don't transpile import/export in esmMode.
14+
modules: esmMode ? false : "auto",
15+
targets: es6Compat ? "maintained node versions" : undefined
16+
},
17+
],
18+
"@babel/react",
19+
"@babel/preset-flow"
20+
],
21+
"plugins": [
22+
"@babel/plugin-transform-flow-comments",
23+
"@babel/plugin-proposal-class-properties",
24+
"transform-inline-environment-variables"
25+
],
26+
"env": {
27+
"test": {
28+
"plugins": [
29+
"espower"
30+
]
31+
}
32+
}
33+
}

.browserslistrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 0.25%
2+
ie 11
3+
not dead

.eslintrc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"parser": "babel-eslint",
3+
"extends": "eslint:recommended",
34
"plugins": [
45
"react"
56
],
@@ -12,7 +13,7 @@
1213
"no-console": 2,
1314
"no-use-before-define": [1, "nofunc"],
1415
"no-underscore-dangle": 0,
15-
"no-unused-vars": 1,
16+
"no-unused-vars": [1, {ignoreRestSiblings: true}],
1617
"new-cap": 0,
1718
"prefer-const": 1,
1819
"semi": 1
@@ -24,6 +25,10 @@
2425
globals: {
2526
// For Flow
2627
"ReactElement",
27-
"ReactClass"
28+
"ReactClass",
29+
"$Shape",
30+
"$Exact",
31+
"$Keys",
32+
"MouseTouchEvent",
2833
}
2934
}

.flowconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
[ignore]
2-
.*/node_modules/.*
32

43
[include]
54
lib/
65
index.js
76

8-
[libs]
9-
interfaces/
10-
117
[options]
128
suppress_comment=\\(.\\|\n\\)*\\s*\\$FlowFixMe.*
139
suppress_comment=\\(.\\|\n\\)*\\s*\\$FlowBug.*
@@ -16,7 +12,3 @@ suppress_comment=\\(.\\|\n\\)*\\s*\\$FlowNewLine.*
1612
suppress_comment=\\(.\\|\n\\)*\\s*\\$FlowIssue
1713
esproposal.class_instance_fields=enable
1814
esproposal.class_static_fields=enable
19-
module.file_ext=.js
20-
module.file_ext=.jsx
21-
module.file_ext=.es5
22-
module.file_ext=.es6

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
*.iml
33
node_modules/
4+
build/

.npmignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.travis.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
language: node_js
22
node_js:
3-
- "4"
4-
- "6"
5-
- "7"
3+
- "8"
4+
- "10"
5+
- "node" # latest
66
cache: yarn
7-
before_script:
8-
- export CHROME_BIN=chromium-browser
9-
- export DISPLAY=:99.0
10-
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1024x768x16"
11-
- sleep 3 # give xvfb some time to start
7+
env:
8+
- MOZ_HEADLESS=1
9+
addons:
10+
firefox: latest
1211
script:
13-
- npm run lint
14-
- npm run test
12+
- make lint
13+
- make test
14+
- make test-phantom
1515
email:
1616
on_failure: change
1717
on_success: never

CHANGELOG.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,167 @@
11
# Changelog
22

3+
### 4.3.1 (Apr 11, 2020)
4+
5+
> This is a bugfix release.
6+
7+
- Happy Easter!
8+
- Fixed a serious bug that caused `<DraggableCore>` not to pass styles.
9+
- `React.cloneElement` has an odd quirk. When you do:
10+
```js
11+
return React.cloneElement(this.props.children, {style: this.props.children.props.style});
12+
```
13+
, `style` ends up undefined.
14+
- Fixed a bug that caused debug output to show up in the build.
15+
- `babel-loader` cache does not invalidate when it should. I had modified webpack.config.js in the last version but it reused stale cache.
16+
17+
### 4.3.0 (Apr 10, 2020)
18+
19+
- Fix setState warning after dismount if drag still active. Harmless, but prints a warning. [#424](https://github.com/mzabriskie/react-draggable/pull/424)
20+
- Fix a long-standing issue where text inputs would unfocus upon dismounting a `<Draggable>`.
21+
- Thanks @schnerd, [#450](https://github.com/mzabriskie/react-draggable/pull/450)
22+
- Fix an issue where the insides of a `<Draggable>` were not scrollable on touch devices due to the outer container having `touch-action: none`.
23+
- This was a long-standing hack for mobile devices. Without it, the page will scroll while you drag the element.
24+
- The new solution will simply cancel the touch event `e.preventDefault()`. However, due to changes in Chrome >= 56, this is only possible on
25+
non-passive event handlers. To fix this, we now add/remove the touchEvent on lifecycle events rather than using React's event system.
26+
- [#465](https://github.com/mzabriskie/react-draggable/pull/465)
27+
- Upgrade devDeps and fix security warnings. None of them actually applied to this module.
28+
29+
### 4.2.0 (Dec 2, 2019)
30+
31+
- Fix: Apply `scale` parameter also while dragging an element. [#438](https://github.com/mzabriskie/react-draggable/pull/438)
32+
- Fix: Don't ship `process.env.DRAGGABLE_DEBUG` checks in cjs/esm. [#445](https://github.com/mzabriskie/react-draggable/pull/445)
33+
34+
### 4.1.0 (Oct 25, 2019)
35+
36+
- Add `"module"` to `package.json`. There are now three builds:
37+
* **`"main"`**: ES5-compatible CJS build, suitable for most use cases with maximum compatibility.
38+
- For legacy reasons, this has exports of the following shape, which ensures no surprises in CJS or ESM polyfilled environments:
39+
```js
40+
module.exports = Draggable;
41+
module.exports.default = Draggable;
42+
module.exports.DraggableCore = DraggableCore;
43+
```
44+
* **`"web"`**: Minified UMD bundle exporting to `window.ReactDraggable` with the same ES compatibility as the "main" build.
45+
* **`"module"`**: ES6-compatible build using import/export.
46+
47+
This should fix issues like https://github.com/STRML/react-resizable/issues/113 while allowing modern bundlers to consume esm modules in the future.
48+
49+
No compatibility changes are expected.
50+
51+
### 4.0.3 (Sep 10, 2019)
52+
53+
- Add typings and sourcemap to published npm package.
54+
- This compresses well so it does not bloat the package by much. Would be nice if npm had another delivery mechanism for optional modes, like web/TS.
55+
56+
### 4.0.2 (Sep 9, 2019)
57+
58+
- Republish to fix packaging errors. Fixes #426
59+
60+
### 4.0.1 (Sep 7, 2019)
61+
62+
- Republish of 4.0.0 to fix a mistake where webpack working files were erroneously included in the package. Use this release instead as it is much smaller.
63+
64+
### 4.0.0 (Aug 26, 2019)
65+
66+
> This is a major release due to a React compatibility change. If you are already on React >= 16.3, this upgrade is non-breaking.
67+
68+
- *Requires React 16.3+ due to use of `getDerivedStateFromProps`.
69+
- See https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html for why this was done.
70+
- Upgraded build environment to Babel 7.
71+
- Switched build from rollup to webpack@4 to simplify.
72+
- Added CJS build that does not bundle `classNames` & `prop-types` into the build. This should result in marginally smaller bundle sizes for applications that use bundlers.
73+
- Removed Bower build.
74+
75+
### 3.3.2 (Aug 16, 2019)
76+
77+
- Use `all: inherit` instead of `background: transparent;` to fix selection styles.
78+
- Fixes https://github.com/mzabriskie/react-draggable/issues/315
79+
80+
### 3.3.1 (Aug 12, 2019)
81+
82+
- Fix React 16.9 `componentWillMount` deprecation.
83+
84+
### 3.3.0 (Apr 18, 2019)
85+
86+
- Addition of `positionOffset` prop, which can be Numbers (px) or string percentages (like `"10%"`). See the README for more.
87+
88+
### 3.2.1 (Mar 1, 2019)
89+
90+
- Reverted https://github.com/mzabriskie/react-draggable/pull/361.
91+
92+
### ~3.2.0 (Feb 27, 2019)~
93+
94+
> Note: this release has been pulled due to an inadvertent breaking change. See https://github.com/mzabriskie/react-draggable/issues/391
95+
96+
- Feature: `defaultPosition` now allows string offsets (like {x: '10%', y: '10%'}) then calculates deltas from there. See the examples and the PR [#361](https://github.com/mzabriskie/react-draggable/pull/361/). Thanks to @tnrich and @eric-burel.
97+
- Bugfix: Export `DraggableEvent` type for Flow consumers. Thanks @elie222.
98+
99+
### 3.1.1 (Dec 21, 2018)
100+
101+
- Bugfix: Minor type change on DraggableEventHandler TypeScript export ([#374](https://github.com/mzabriskie/react-draggable/pull/374))
102+
103+
### 3.1.0 (Dec 21, 2018)
104+
105+
- Feature: Added `scale` prop ([#352](https://github.com/mzabriskie/react-draggable/pull/352))
106+
- Thanks, @wootencl
107+
- Bugfix: Remove process.browser which is missing in browser ([#329]((https://github.com/mzabriskie/react-draggable/pull/329))
108+
- Bugfix: Fix selection api on IE ([#292](https://github.com/mzabriskie/react-draggable/pull/292))
109+
- Bugfix: Fixes some issues in the type definitions for TypeScript ([#331]((https://github.com/mzabriskie/react-draggable/pull/331))
110+
- Bugfix: Fix compare where portal elements are different instance to main window ([#359]((https://github.com/mzabriskie/react-draggable/pull/359))
111+
112+
### 3.0.5 (Jan 11, 2018)
113+
114+
- Bugfix: Fix crash in test environments during removeUserSelectStyles().
115+
116+
### 3.0.4 (Nov 27, 2017)
117+
118+
- Bugfix: Fix "Cannot call property 'call' of undefined" (matchesSelector)
119+
- Fixes [#300](https://github.com/mzabriskie/react-draggable/issues/300)
120+
121+
### 3.0.3 (Aug 31, 2017)
122+
123+
- Bugfix: Fix deprecation warnings caused by `import * as React` (Flow best practice).
124+
- See https://github.com/facebook/react/issues/10583
125+
126+
### 3.0.2 (Aug 22, 2017)
127+
128+
> 3.0.0 and 3.0.1 have been unpublished due to a large logfile making it into the package.
129+
130+
- Bugfix: Tweaked `.npmignore`.
131+
132+
### 3.0.1 (Aug 21, 2017)
133+
134+
- Bugfix: Flow-type should no longer throw errors for consumers.
135+
- It appears Flow can't resolve a sub-package's interfaces.
136+
137+
### 3.0.0 (Aug 21, 2017)
138+
139+
> Due to an export change, this is semver-major.
140+
141+
- Breaking: For TypeScript users, `<Draggable>` is now exported as `module.exports` and `module.exports.default`.
142+
- Potentially Breaking: We no longer set `user-select: none` on all elements while dragging. Instead,
143+
the [`::selection` psuedo element](https://developer.mozilla.org/en-US/docs/Web/CSS/::selection) is used.
144+
- Depending on your application, this could cause issues, so be sure to test.
145+
- Bugfix: Pass bounded `x`/`y` to callbacks. See [#226](https://github.com/mzabriskie/react-draggable/pull/226).
146+
- Internal: Upgraded dependencies.
147+
148+
### 2.2.6 (Apr 30, 2017)
149+
150+
- Bugfix: Missing export default on TS definition (thanks @lostfictions)
151+
- Internal: TS test suite (thanks @lostfictions)
152+
153+
### 2.2.5 (Apr 28, 2017)
154+
155+
- Bugfix: Typescript definition was incorrect. [#244](https://github.com/mzabriskie/react-draggable/issues/244)
156+
157+
### 2.2.4 (Apr 27, 2017)
158+
159+
- Internal: Moved `PropTypes` access to `prop-types` package for React 15.5 (prep for 16)
160+
- Feature: Added TypeScript definitions (thanks @erfangc)
161+
- Bugfix: No longer can erroneously add user-select style multiple times
162+
- Bugfix: OffsetParent with padding problem, fixes [#218](https://github.com/mzabriskie/react-draggable/issues/218)
163+
- Refactor: Misc example updates.
164+
3165
### 2.2.3 (Nov 21, 2016)
4166

5167
- Bugfix: Fix an issue with the entire window scrolling on a drag on iDevices. Thanks @JaneCoder. See #183

0 commit comments

Comments
 (0)