Skip to content

Commit 758ed71

Browse files
committed
Merge branch 'coreRefactor'
2 parents 99660e1 + 23e68a3 commit 758ed71

29 files changed

+2525
-1754
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"stage": 0
3+
}

.eslintrc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
{
2+
"parser": "babel-eslint",
3+
"plugins": [
4+
"react"
5+
],
26
"rules": {
37
"strict": 0,
4-
"quotes": ["single"],
5-
"curly": "multi-line",
8+
"quotes": [1, "single"],
9+
"curly": [1, "multi-line"],
610
"camelcase": 0,
7-
"no-use-before-define": "nofunc",
11+
"comma-dangle": 1,
12+
"no-use-before-define": [1, "nofunc"],
813
"no-underscore-dangle": 0,
9-
"no-unused-vars": 0,
10-
"new-cap": 0
14+
"no-unused-vars": 1,
15+
"new-cap": 0,
16+
"semi": 1
1117
},
1218
env: {
1319
"browser": true,

.gitignore

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

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
22
node_js:
33
- "0.10"
4+
- "0.12"
45
before_script:
56
- export DISPLAY=:99.0
67
- sh -e /etc/init.d/xvfb start

CHANGELOG.md

Lines changed: 79 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,128 @@
11
# Changelog
22

3-
### 0.1.0 (Jul 25, 2014)
3+
### 1.0.0 (Oct 27, 2015)
44

5-
- Initial release
5+
- Breaking: Removed `resetState()` instance method
6+
- Breaking: Removed `moveOnStartChange` prop
7+
- Breaking: React `0.14` support only.
8+
- Refactored project.
9+
- Module now exports a `<DraggableCore>` element upon which `<Draggable>` is based.
10+
This module is useful for building libraries and is completely stateless.
611

7-
### 0.1.1 (Jul 26, 2014)
12+
### 0.8.5 (Oct 20, 2015)
813

9-
- Fixing dragging not stopping on mouseup in some cases
14+
- Bugfix: isElementSVG no longer can be overwritten by getInitialState (#83)
15+
- Bugfix: Fix for element prefixes in JSDOM
1016

11-
### 0.2.0 (Sep 10, 2014)
17+
### 0.8.4 (Oct 15, 2015)
1218

13-
- Adding support for snapping to a grid
14-
- Adding support for specifying start position
15-
- Ensure event handlers are destroyed on unmount
16-
- Adding browserify support
17-
- Adding bower support
19+
- Bugfix: SVG elements now properly use `transform` attribute instead of `style`. Thanks @martinRoss
1820

19-
### 0.2.1 (Sep 10, 2014)
21+
### 0.8.3 (Oct 12, 2015)
2022

21-
- Exporting as ReactDraggable
23+
- Bugfix: Short-circuiting drag throws due to `e.changedTouches` check.
2224

23-
### 0.3.0 (Oct 21, 2014)
25+
### 0.8.2 (Sep 21, 2015)
2426

25-
- Adding support for touch devices
27+
- Handle scrolling while dragging. (#60)
28+
- Add multi-touch support. (#68)
29+
- IE fixes.
30+
- Documentation updates. (#77)
2631

27-
### 0.4.0 (Jan 03, 2015)
32+
### 0.8.1 (June 3, 2015)
2833

29-
- Improving accuracy of snap to grid
30-
- Updating to React 0.12
31-
- Adding dragging className
32-
- Adding reactify support for browserify
33-
- Fixing issue with server side rendering
34+
- Add `resetState()` instance method for use by parents. See README ("State Problems?").
3435

35-
### 0.4.1 (Apr 30, 2015)
36+
### 0.8.0 (May 19, 2015)
3637

37-
- Remove react/addons dependency (now depending on `react` directly).
38-
- Add MIT License file.
39-
- Fix an issue where browser may be detected as touch-enabled but touch event isn't thrown.
38+
- Touch/mouse events rework. Fixes #51, #37, and #43, as well as IE11 support.
39+
- Moved mousemove/mouseup and touch event handlers to document from window. Fixes IE9/10 support.
40+
IE8 is still not supported, as it is not supported by React.
4041

41-
### 0.4.2 (Apr 30, 2015)
42+
### 0.7.4 (May 18, 2015)
4243

43-
- Add `"browser"` config to package.json for browserify imports (fix #45).
44-
- Remove unnecessary `emptyFunction` and `React.addons.classSet` imports.
44+
- Fix a bug where a quick drag out of bounds to `0,0` would cause the element to remain in an inaccurate position,
45+
because the translation was removed from the CSS. See #55.
4546

46-
### 0.4.3 (Apr 30, 2015)
47+
### 0.7.3 (May 13, 2015)
4748

48-
- Fix React.addons error caused by faulty test.
49+
- Removed a `moveOnStartChange` optimization that was causing problems when attempting to move a `<Draggable>` back
50+
to its initial position. See https://github.com/STRML/react-grid-layout/issues/56
4951

50-
### 0.5.0 (May 2, 2015)
52+
### 0.7.2 (May 8, 2015)
5153

52-
- Remove browserify browser config, reactify, and jsx pragma. Fixes #38
53-
- Use React.cloneElement instead of addons cloneWithProps (requires React 0.13)
54-
- Move to CSS transforms. Simplifies implementation and fixes #48, #34, #31.
55-
- Fixup linting and space/tab errors. Fixes #46.
54+
- Added `moveOnStartChange` property. See README.
5655

57-
### 0.6.0 (May 2, 2015)
56+
### 0.7.1 (May 7, 2015)
5857

59-
- Breaking change: Cancel dragging when onDrag or onStart handlers return an explicit `false`.
60-
- Fix sluggish movement when `grid` option was active.
61-
- Example updates.
62-
- Move `user-select:none` hack to document.body for better highlight prevention.
63-
- Add `bounds` option to restrict dragging within parent or within coordinates.
58+
- The `start` param is back. Pass `{x: Number, y: Number}` to kickoff the CSS transform. Useful in certain
59+
cases for simpler callback math (so you don't have to know its existing relative position and add it to
60+
the dragged position). Fixes #52.
6461

6562
### 0.7.0 (May 7, 2015)
6663

6764
- Breaking change: `bounds` with coordinates was confusing because it was using the item's width/height,
6865
which was not intuitive. When providing coordinates, `bounds` now simply restricts movement in each
6966
direction by that many pixels.
7067

71-
### 0.7.1 (May 7, 2015)
68+
### 0.6.0 (May 2, 2015)
7269

73-
- The `start` param is back. Pass `{x: Number, y: Number}` to kickoff the CSS transform. Useful in certain
74-
cases for simpler callback math (so you don't have to know its existing relative position and add it to
75-
the dragged position). Fixes #52.
70+
- Breaking change: Cancel dragging when onDrag or onStart handlers return an explicit `false`.
71+
- Fix sluggish movement when `grid` option was active.
72+
- Example updates.
73+
- Move `user-select:none` hack to document.body for better highlight prevention.
74+
- Add `bounds` option to restrict dragging within parent or within coordinates.
7675

77-
### 0.7.2 (May 8, 2015)
76+
### 0.5.0 (May 2, 2015)
7877

79-
- Added `moveOnStartChange` property. See README.
78+
- Remove browserify browser config, reactify, and jsx pragma. Fixes #38
79+
- Use React.cloneElement instead of addons cloneWithProps (requires React 0.13)
80+
- Move to CSS transforms. Simplifies implementation and fixes #48, #34, #31.
81+
- Fixup linting and space/tab errors. Fixes #46.
8082

81-
### 0.7.3 (May 13, 2015)
83+
### 0.4.3 (Apr 30, 2015)
8284

83-
- Removed a `moveOnStartChange` optimization that was causing problems when attempting to move a `<Draggable>` back
84-
to its initial position. See https://github.com/STRML/react-grid-layout/issues/56
85+
- Fix React.addons error caused by faulty test.
8586

86-
### 0.7.4 (May 18, 2015)
87+
### 0.4.2 (Apr 30, 2015)
8788

88-
- Fix a bug where a quick drag out of bounds to `0,0` would cause the element to remain in an inaccurate position,
89-
because the translation was removed from the CSS. See #55.
89+
- Add `"browser"` config to package.json for browserify imports (fix #45).
90+
- Remove unnecessary `emptyFunction` and `React.addons.classSet` imports.
9091

91-
### 0.8.0 (May 19, 2015)
92+
### 0.4.1 (Apr 30, 2015)
9293

93-
- Touch/mouse events rework. Fixes #51, #37, and #43, as well as IE11 support.
94-
- Moved mousemove/mouseup and touch event handlers to document from window. Fixes IE9/10 support.
95-
IE8 is still not supported, as it is not supported by React.
94+
- Remove react/addons dependency (now depending on `react` directly).
95+
- Add MIT License file.
96+
- Fix an issue where browser may be detected as touch-enabled but touch event isn't thrown.
9697

97-
### 0.8.1 (June 3, 2015)
98+
### 0.4.0 (Jan 03, 2015)
9899

99-
- Add `resetState()` instance method for use by parents. See README ("State Problems?").
100+
- Improving accuracy of snap to grid
101+
- Updating to React 0.12
102+
- Adding dragging className
103+
- Adding reactify support for browserify
104+
- Fixing issue with server side rendering
100105

101-
### 0.8.2 (Sep 21, 2015)
106+
### 0.3.0 (Oct 21, 2014)
102107

103-
- Handle scrolling while dragging. (#60)
104-
- Add multi-touch support. (#68)
105-
- IE fixes.
106-
- Documentation updates. (#77)
108+
- Adding support for touch devices
107109

108-
### 0.8.3 (Oct 12, 2015)
110+
### 0.2.1 (Sep 10, 2014)
109111

110-
- Bugfix: Short-circuiting drag throws due to `e.changedTouches` check.
112+
- Exporting as ReactDraggable
111113

112-
### 0.8.4 (Oct 15, 2015)
114+
### 0.2.0 (Sep 10, 2014)
113115

114-
- Bugfix: SVG elements now properly use `transform` attribute instead of `style`. Thanks @martinRoss
116+
- Adding support for snapping to a grid
117+
- Adding support for specifying start position
118+
- Ensure event handlers are destroyed on unmount
119+
- Adding browserify support
120+
- Adding bower support
115121

116-
### 0.8.5 (Oct 20, 2015)
122+
### 0.1.1 (Jul 26, 2014)
117123

118-
- Bugfix: isElementSVG no longer can be overwritten by getInitialState (#83)
119-
- Bugfix: Fix for element prefixes in JSDOM
124+
- Fixing dragging not stopping on mouseup in some cases
125+
126+
### 0.1.0 (Jul 25, 2014)
127+
128+
- Initial release

Makefile

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
# Mostly lifted from https://andreypopp.com/posts/2013-05-16-makefile-recipes-for-node-js.html
22
# Thanks @andreypopp
33

4-
BIN = ./node_modules/.bin
5-
SRC = $(wildcard lib/*.js)
6-
LIB = $(SRC:lib/%.js=dist/%.js)
7-
MIN = $(SRC:lib/%.js=dist/%.min.js)
4+
BIN := $(shell npm bin)
5+
DIST = dist
6+
LIB = $(DIST)/react-draggable.js
7+
MIN = $(DIST)/react-draggable.min.js
88

9-
.PHONY: test dev
9+
.PHONY: test dev build clean
10+
11+
clean:
12+
rm -rf dist
1013

1114
build: $(LIB) $(MIN)
1215

1316
# Allows usage of `make install`, `make link`
1417
install link:
1518
@npm $@
1619

17-
# FIXME
18-
dist/%.min.js: $(BIN)
19-
@$(BIN)/uglifyjs dist/react-draggable.js \
20-
--output dist/react-draggable.min.js \
21-
--source-map dist/react-draggable.min.map \
22-
--source-map-url react-draggable.min.map \
23-
--in-source-map dist/react-draggable.map \
20+
dist/%.min.js: $(LIB) $(BIN)
21+
@$(BIN)/uglifyjs $< \
22+
--output $@ \
23+
--source-map $@.map \
24+
--source-map-url $(basename $@.map) \
25+
--in-source-map $<.map \
2426
--compress warnings=false
2527

2628
dist/%.js: $(BIN)
2729
@$(BIN)/webpack --devtool source-map
2830

2931
test: $(BIN)
30-
@$(BIN)/karma start --browsers Firefox --single-run
32+
@$(BIN)/karma start --single-run
3133

3234
dev: $(BIN)
3335
script/build-watch
@@ -50,15 +52,15 @@ define release
5052
git tag "v$$NEXT_VERSION" -m "release v$$NEXT_VERSION"
5153
endef
5254

53-
release-patch: test build
55+
release-patch: test clean build
5456
@$(call release,patch)
5557

56-
release-minor: test build
58+
release-minor: test clean build
5759
@$(call release,minor)
5860

59-
release-major: test build
61+
release-major: test clean build
6062
@$(call release,major)
6163

62-
publish:
64+
publish: clean build
6365
git push --tags origin HEAD:master
6466
npm publish

0 commit comments

Comments
 (0)