From 1ba7170db681c3964b19c4ad1b61972e8ce3dc37 Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Thu, 29 Oct 2015 13:49:20 -0500 Subject: [PATCH 01/13] converted to AMD + CommonJS compatibility --- react-swipe.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/react-swipe.js b/react-swipe.js index 44d1458..71e8660 100644 --- a/react-swipe.js +++ b/react-swipe.js @@ -1,5 +1,8 @@ (function (root, factory) { - if (typeof module !== 'undefined' && module.exports) { + if (typeof define === 'function' && define.amd) { + // AMD + define(['react', 'swipe-js-iso', 'object-assign'], factory); + }else if (typeof exports === 'object') { module.exports = factory( require('react'), require('swipe-js-iso'), From def17e902331a32e08ac83671f1ba95a38a12903 Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Thu, 29 Oct 2015 15:06:34 -0500 Subject: [PATCH 02/13] added bower.json --- bower.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 bower.json diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..e7d507f --- /dev/null +++ b/bower.json @@ -0,0 +1,26 @@ +{ + "name": "react-swipe", + "description": "Brad Birdsall's Swipe.js, as a React component", + "main": "react-swipe.js", + "authors": [ + "Jed Schmidt " + ], + "license": "MIT", + "keywords": [ + "react", + "component", + "carousel", + "swipe", + "react-component" + ], + "homepage": "https://github.com/C4Tech/react-swipe", + "moduleType": [], + "private": true, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} From 5baee144ef9a111d6901edd93ceeeab08965ce09 Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Thu, 29 Oct 2015 15:30:37 -0500 Subject: [PATCH 03/13] tagging for semver From 64646a97e3e19e2c104d38b10c3d8bccebb5c917 Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Thu, 29 Oct 2015 16:04:24 -0500 Subject: [PATCH 04/13] Added deps for react, swipe, object-assign --- bower.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bower.json b/bower.json index e7d507f..5e05c32 100644 --- a/bower.json +++ b/bower.json @@ -22,5 +22,10 @@ "bower_components", "test", "tests" - ] + ], + "dependencies": { + "object-assign": "~4.0.1", + "react": "~0.14.1", + "Swipe": "swipe#~2.0.0" + } } From 54845a7d7e7e48542114fb6e99809d8313adc6ab Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Fri, 30 Oct 2015 09:32:26 -0500 Subject: [PATCH 05/13] Replaced deps for object-assign with object.assign shim --- bower.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 5e05c32..fcadac9 100644 --- a/bower.json +++ b/bower.json @@ -24,8 +24,8 @@ "tests" ], "dependencies": { - "object-assign": "~4.0.1", "react": "~0.14.1", - "Swipe": "swipe#~2.0.0" + "Swipe": "swipe#~2.0.0", + "object.assign": "~4.0.3" } } From c5cc7155bb6b975d3f9c0e34b727b98d06b73693 Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Fri, 30 Oct 2015 09:32:46 -0500 Subject: [PATCH 06/13] object.assign shim in place --- react-swipe.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/react-swipe.js b/react-swipe.js index 71e8660..37b82fe 100644 --- a/react-swipe.js +++ b/react-swipe.js @@ -1,21 +1,21 @@ (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD - define(['react', 'swipe-js-iso', 'object-assign'], factory); + define(['react', 'swipe-js-iso', 'object.assign'], factory); }else if (typeof exports === 'object') { module.exports = factory( require('react'), require('swipe-js-iso'), - require('object-assign') + require('object.assign') ); } else { root.ReactSwipe = factory( root.React, root.Swipe, - root.objectAssign + root.object.assign() ); } -})(this, function (React, Swipe, objectAssign) { +})(this, function (React, Swipe ) { var styles = { container: { overflow: 'hidden', @@ -53,7 +53,7 @@ componentDidMount: function () { if (this.isMounted()) { - this.swipe = Swipe(React.findDOMNode(this), objectAssign({}, this.props)); + this.swipe = Swipe(React.findDOMNode(this), object.assign({}, this.props)); } }, @@ -82,7 +82,7 @@ return React.cloneElement(child, { ref: child.props.ref, key: child.props.key, - style: child.props.style ? objectAssign(child.props.style, styles.child) : styles.child + style: child.props.style ? object.assign(child.props.style, styles.child) : styles.child }); }) ) From 3f350dc058692f540ce634b3bc3974c71143f874 Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Fri, 30 Oct 2015 10:06:32 -0500 Subject: [PATCH 07/13] object.assign replaced with es6-shim --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index fcadac9..db45bd2 100644 --- a/bower.json +++ b/bower.json @@ -26,6 +26,6 @@ "dependencies": { "react": "~0.14.1", "Swipe": "swipe#~2.0.0", - "object.assign": "~4.0.3" + "es6-shim": "~0.33.9" } } From 7c2cc17248f88373d14132ba722d5c0c73f9e41b Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Fri, 30 Oct 2015 10:07:10 -0500 Subject: [PATCH 08/13] removed extra params --- react-swipe.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/react-swipe.js b/react-swipe.js index 37b82fe..655bb58 100644 --- a/react-swipe.js +++ b/react-swipe.js @@ -1,18 +1,16 @@ (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD - define(['react', 'swipe-js-iso', 'object.assign'], factory); + define(['react', 'swipe-js-iso'], factory); }else if (typeof exports === 'object') { module.exports = factory( require('react'), - require('swipe-js-iso'), - require('object.assign') + require('swipe-js-iso') ); } else { root.ReactSwipe = factory( root.React, - root.Swipe, - root.object.assign() + root.Swipe ); } })(this, function (React, Swipe ) { @@ -53,7 +51,7 @@ componentDidMount: function () { if (this.isMounted()) { - this.swipe = Swipe(React.findDOMNode(this), object.assign({}, this.props)); + this.swipe = Swipe(React.findDOMNode(this), Object.assign({}, this.props)); } }, @@ -82,7 +80,7 @@ return React.cloneElement(child, { ref: child.props.ref, key: child.props.key, - style: child.props.style ? object.assign(child.props.style, styles.child) : styles.child + style: child.props.style ? Object.assign(child.props.style, styles.child) : styles.child }); }) ) From b6ab5904714eb9a3e9bf91985e724528a1836fa1 Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Fri, 30 Oct 2015 10:52:58 -0500 Subject: [PATCH 09/13] React -> ReactDOM.findDOMNode --- bower.json | 3 ++- react-swipe.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bower.json b/bower.json index db45bd2..222d507 100644 --- a/bower.json +++ b/bower.json @@ -26,6 +26,7 @@ "dependencies": { "react": "~0.14.1", "Swipe": "swipe#~2.0.0", - "es6-shim": "~0.33.9" + "es6-shim": "~0.33.9", + "react-dom": "~0.1.0" } } diff --git a/react-swipe.js b/react-swipe.js index 655bb58..f64f521 100644 --- a/react-swipe.js +++ b/react-swipe.js @@ -1,19 +1,21 @@ (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD - define(['react', 'swipe-js-iso'], factory); + define(['react', 'react-dom', 'swipe-js-iso'], factory); }else if (typeof exports === 'object') { module.exports = factory( - require('react'), - require('swipe-js-iso') + require('react'), + require('react-dom'), + require('swipe-js-iso') ); } else { root.ReactSwipe = factory( - root.React, + root.React, + root.ReactDOM, root.Swipe ); } -})(this, function (React, Swipe ) { +})(this, function (React, ReactDOM, Swipe ) { var styles = { container: { overflow: 'hidden', @@ -51,7 +53,7 @@ componentDidMount: function () { if (this.isMounted()) { - this.swipe = Swipe(React.findDOMNode(this), Object.assign({}, this.props)); + this.swipe = Swipe(ReactDOM.findDOMNode(this), Object.assign({}, this.props)); } }, From 55a258337f7e80fa90a55bb99dd032427d4b01bf Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Fri, 30 Oct 2015 10:59:31 -0500 Subject: [PATCH 10/13] formatting --- react-swipe.js | 166 ++++++++++++++++++++++++------------------------- 1 file changed, 83 insertions(+), 83 deletions(-) diff --git a/react-swipe.js b/react-swipe.js index f64f521..952d794 100644 --- a/react-swipe.js +++ b/react-swipe.js @@ -1,94 +1,94 @@ (function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD - define(['react', 'react-dom', 'swipe-js-iso'], factory); - }else if (typeof exports === 'object') { - module.exports = factory( - require('react'), - require('react-dom'), - require('swipe-js-iso') - ); - } else { - root.ReactSwipe = factory( - root.React, - root.ReactDOM, - root.Swipe - ); - } -})(this, function (React, ReactDOM, Swipe ) { - var styles = { - container: { - overflow: 'hidden', - visibility: 'hidden', - position: 'relative' - }, + if (typeof define === 'function' && define.amd) { + // AMD + define(['react', 'react-dom', 'swipe-js-iso'], factory); + } else if (typeof exports === 'object') { + module.exports = factory( + require('react'), + require('react-dom'), + require('swipe-js-iso') + ); + } else { + root.ReactSwipe = factory( + root.React, + root.ReactDOM, + root.Swipe + ); + } +})(this, function (React, ReactDOM, Swipe) { + var styles = { + container: { + overflow: 'hidden', + visibility: 'hidden', + position: 'relative' + }, - wrapper: { - overflow: 'hidden', - position: 'relative' - }, + wrapper: { + overflow: 'hidden', + position: 'relative' + }, - child: { - float: 'left', - width: '100%', - position: 'relative', - transitionProperty: 'transform' - } - }; + child: { + float: 'left', + width: '100%', + position: 'relative', + transitionProperty: 'transform' + } + }; - var ReactSwipe = React.createClass({ - // https://github.com/thebird/Swipe#config-options - propTypes: { - startSlide : React.PropTypes.number, - slideToIndex : React.PropTypes.number, - shouldUpdate : React.PropTypes.func, - speed : React.PropTypes.number, - auto : React.PropTypes.number, - continuous : React.PropTypes.bool, - disableScroll : React.PropTypes.bool, - stopPropagation : React.PropTypes.bool, - callback : React.PropTypes.func, - transitionEnd : React.PropTypes.func - }, + var ReactSwipe = React.createClass({ + // https://github.com/thebird/Swipe#config-options + propTypes: { + startSlide: React.PropTypes.number, + slideToIndex: React.PropTypes.number, + shouldUpdate: React.PropTypes.func, + speed: React.PropTypes.number, + auto: React.PropTypes.number, + continuous: React.PropTypes.bool, + disableScroll: React.PropTypes.bool, + stopPropagation: React.PropTypes.bool, + callback: React.PropTypes.func, + transitionEnd: React.PropTypes.func + }, - componentDidMount: function () { - if (this.isMounted()) { - this.swipe = Swipe(ReactDOM.findDOMNode(this), Object.assign({}, this.props)); - } - }, + componentDidMount: function () { + if (this.isMounted()) { + this.swipe = Swipe(ReactDOM.findDOMNode(this), Object.assign({}, this.props)); + } + }, - componentDidUpdate: function () { - if (this.props.slideToIndex || this.props.slideToIndex === 0) { - this.swipe.slide(this.props.slideToIndex); - } - }, + componentDidUpdate: function () { + if (this.props.slideToIndex || this.props.slideToIndex === 0) { + this.swipe.slide(this.props.slideToIndex); + } + }, - componentWillUnmount: function () { - this.swipe.kill(); - delete this.swipe; - }, + componentWillUnmount: function () { + this.swipe.kill(); + delete this.swipe; + }, - shouldComponentUpdate: function (nextProps) { - return ( - (this.props.slideToIndex !== nextProps.slideToIndex) || - (typeof this.props.shouldUpdate !== 'undefined') && this.props.shouldUpdate(nextProps) - ); - }, + shouldComponentUpdate: function (nextProps) { + return ( + (this.props.slideToIndex !== nextProps.slideToIndex) || + (typeof this.props.shouldUpdate !== 'undefined') && this.props.shouldUpdate(nextProps) + ); + }, - render: function() { - return React.createElement('div', React.__spread({}, {style: styles.container}, this.props), - React.createElement('div', {style: styles.wrapper}, - React.Children.map(this.props.children, function (child) { - return React.cloneElement(child, { - ref: child.props.ref, - key: child.props.key, - style: child.props.style ? Object.assign(child.props.style, styles.child) : styles.child - }); - }) - ) - ); - } - }); + render: function () { + return React.createElement('div', React.__spread({}, {style: styles.container}, this.props), + React.createElement('div', {style: styles.wrapper}, + React.Children.map(this.props.children, function (child) { + return React.cloneElement(child, { + ref: child.props.ref, + key: child.props.key, + style: child.props.style ? Object.assign(child.props.style, styles.child) : styles.child + }); + }) + ) + ); + } + }); - return ReactSwipe; + return ReactSwipe; }); From 976008ca4c0294aa44a2afd993dea06e6c381317 Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Fri, 30 Oct 2015 11:04:17 -0500 Subject: [PATCH 11/13] formatting --- react-swipe.js | 164 ++++++++++++++++++++++++------------------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/react-swipe.js b/react-swipe.js index 952d794..692dff3 100644 --- a/react-swipe.js +++ b/react-swipe.js @@ -1,94 +1,94 @@ (function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD - define(['react', 'react-dom', 'swipe-js-iso'], factory); - } else if (typeof exports === 'object') { - module.exports = factory( - require('react'), - require('react-dom'), - require('swipe-js-iso') - ); - } else { - root.ReactSwipe = factory( - root.React, - root.ReactDOM, - root.Swipe - ); - } + if (typeof define === 'function' && define.amd) { + // AMD + define(['react', 'react-dom', 'swipe-js-iso'], factory); + } else if (typeof exports === 'object') { + module.exports = factory( + require('react'), + require('react-dom'), + require('swipe-js-iso') + ); + } else { + root.ReactSwipe = factory( + root.React, + root.ReactDOM, + root.Swipe + ); + } })(this, function (React, ReactDOM, Swipe) { - var styles = { - container: { - overflow: 'hidden', - visibility: 'hidden', - position: 'relative' - }, + var styles = { + container: { + overflow: 'hidden', + visibility: 'hidden', + position: 'relative' + }, - wrapper: { - overflow: 'hidden', - position: 'relative' - }, + wrapper: { + overflow: 'hidden', + position: 'relative' + }, - child: { - float: 'left', - width: '100%', - position: 'relative', - transitionProperty: 'transform' - } - }; + child: { + float: 'left', + width: '100%', + position: 'relative', + transitionProperty: 'transform' + } + }; - var ReactSwipe = React.createClass({ - // https://github.com/thebird/Swipe#config-options - propTypes: { - startSlide: React.PropTypes.number, - slideToIndex: React.PropTypes.number, - shouldUpdate: React.PropTypes.func, - speed: React.PropTypes.number, - auto: React.PropTypes.number, - continuous: React.PropTypes.bool, - disableScroll: React.PropTypes.bool, - stopPropagation: React.PropTypes.bool, - callback: React.PropTypes.func, - transitionEnd: React.PropTypes.func - }, + var ReactSwipe = React.createClass({ + // https://github.com/thebird/Swipe#config-options + propTypes: { + startSlide: React.PropTypes.number, + slideToIndex: React.PropTypes.number, + shouldUpdate: React.PropTypes.func, + speed: React.PropTypes.number, + auto: React.PropTypes.number, + continuous: React.PropTypes.bool, + disableScroll: React.PropTypes.bool, + stopPropagation: React.PropTypes.bool, + callback: React.PropTypes.func, + transitionEnd: React.PropTypes.func + }, - componentDidMount: function () { - if (this.isMounted()) { - this.swipe = Swipe(ReactDOM.findDOMNode(this), Object.assign({}, this.props)); - } - }, + componentDidMount: function () { + if (this.isMounted()) { + this.swipe = Swipe(ReactDOM.findDOMNode(this), Object.assign({}, this.props)); + } + }, - componentDidUpdate: function () { - if (this.props.slideToIndex || this.props.slideToIndex === 0) { - this.swipe.slide(this.props.slideToIndex); - } - }, + componentDidUpdate: function () { + if (this.props.slideToIndex || this.props.slideToIndex === 0) { + this.swipe.slide(this.props.slideToIndex); + } + }, - componentWillUnmount: function () { - this.swipe.kill(); - delete this.swipe; - }, + componentWillUnmount: function () { + this.swipe.kill(); + delete this.swipe; + }, - shouldComponentUpdate: function (nextProps) { - return ( - (this.props.slideToIndex !== nextProps.slideToIndex) || - (typeof this.props.shouldUpdate !== 'undefined') && this.props.shouldUpdate(nextProps) - ); - }, + shouldComponentUpdate: function (nextProps) { + return ( + (this.props.slideToIndex !== nextProps.slideToIndex) || + (typeof this.props.shouldUpdate !== 'undefined') && this.props.shouldUpdate(nextProps) + ); + }, - render: function () { - return React.createElement('div', React.__spread({}, {style: styles.container}, this.props), - React.createElement('div', {style: styles.wrapper}, - React.Children.map(this.props.children, function (child) { - return React.cloneElement(child, { - ref: child.props.ref, - key: child.props.key, - style: child.props.style ? Object.assign(child.props.style, styles.child) : styles.child - }); - }) - ) - ); - } - }); + render: function () { + return React.createElement('div', React.__spread({}, {style: styles.container}, this.props), + React.createElement('div', {style: styles.wrapper}, + React.Children.map(this.props.children, function (child) { + return React.cloneElement(child, { + ref: child.props.ref, + key: child.props.key, + style: child.props.style ? Object.assign(child.props.style, styles.child) : styles.child + }); + }) + ) + ); + } + }); - return ReactSwipe; + return ReactSwipe; }); From 6fe42914ffdd27cc0c7c51eec17c2e783d1e26a9 Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Fri, 30 Oct 2015 12:25:34 -0500 Subject: [PATCH 12/13] Switched to swipe-js package --- bower.json | 4 ++-- react-swipe.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index 222d507..99e26a9 100644 --- a/bower.json +++ b/bower.json @@ -25,8 +25,8 @@ ], "dependencies": { "react": "~0.14.1", - "Swipe": "swipe#~2.0.0", "es6-shim": "~0.33.9", - "react-dom": "~0.1.0" + "react-dom": "~0.1.0", + "swipe-js": "~2.0.7" } } diff --git a/react-swipe.js b/react-swipe.js index 692dff3..4b3e07f 100644 --- a/react-swipe.js +++ b/react-swipe.js @@ -1,12 +1,12 @@ (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD - define(['react', 'react-dom', 'swipe-js-iso'], factory); + define(['react', 'react-dom', 'swipe-js'], factory); } else if (typeof exports === 'object') { module.exports = factory( require('react'), require('react-dom'), - require('swipe-js-iso') + require('swipe-js') ); } else { root.ReactSwipe = factory( From 66d1722fd3dd4699749a0e8937b13f64df4001f8 Mon Sep 17 00:00:00 2001 From: Alton Torregano Date: Wed, 30 Dec 2015 14:54:27 -0600 Subject: [PATCH 13/13] Updated React to 0.14.4, removed react-dom --- bower.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 99e26a9..7074bd0 100644 --- a/bower.json +++ b/bower.json @@ -24,9 +24,8 @@ "tests" ], "dependencies": { - "react": "~0.14.1", + "react": "~0.14.4", "es6-shim": "~0.33.9", - "react-dom": "~0.1.0", "swipe-js": "~2.0.7" } }