{"name":"rc-gesture","version":"0.0.21","description":"Support gesture for react component","keywords":["react","react-component","react-gesture","gesture","touch"],"homepage":"http://github.com/react-component/gesture/","repository":{"type":"git","url":"git+ssh://git@github.com/react-component/gesture.git"},"bugs":{"url":"http://github.com/react-component/gesture/issues"},"files":["lib","es","dist"],"license":"MIT","main":"./lib/index","module":"./es/index","config":{"port":8005,"entry":{"rc-gesture":["./index.js"]}},"scripts":{"build":"rc-tools run build","dist":"rc-tools run dist --babel-runtime","gh-pages":"rc-tools run gh-pages","start":"rc-tools run server","compile":"rc-tools run compile --babel-runtime","watch":"rc-tools run watch","prepublish":"rc-tools run guard","prepare":"rc-tools run guard","prepublishOnly":"rc-tools run guard","pub":"rc-tools run pub --babel-runtime","lint":"rc-tools run lint","test":"jest","coverage":"jest --coverage"},"jest":{"collectCoverageFrom":["src/*"],"transform":{"\\.tsx?$":"./node_modules/rc-tools/scripts/jestPreprocessor.js","\\.jsx?$":"./node_modules/rc-tools/scripts/jestPreprocessor.js"}},"devDependencies":{"@types/react":"^16.0.5","@types/react-dom":"^15.5.1","coveralls":"^2.11.15","enzyme":"^2.8.0","enzyme-to-json":"^1.5.1","jest":"^20.0.4","pre-commit":"1.x","rc-tools":"^6.3.6","react":"^15.2.1","react-dom":"^15.2.1","react-test-renderer":"^15.5.4"},"pre-commit":["lint"],"typings":"./lib/index.d.ts","dependencies":{"babel-runtime":"6.x"},"gitHead":"89e761b7d2def09e37a91bca4f14547cf2e441ba","_id":"rc-gesture@0.0.21","_npmVersion":"5.8.0","_nodeVersion":"9.3.0","_npmUser":{"name":"paranoidjk","email":"hust2012jiangkai@gmail.com"},"dist":{"integrity":"sha512-d5IMPe9rgf/RBWTLnt5EYyZUNe+/wneIl5hbhMjH062yXxkVa2YCUyeHKWwUDNBKHIpzv6efwAYeiniU2e1GKQ==","shasum":"bced92df820406d921c3c1f926cd389e3f2ae8b6","tarball":"http://registry-npm.ywwl.com/rc-gesture/download/rc-gesture-0.0.21.tgz","fileCount":19,"unpackedSize":280007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHz3SCRA9TVsSAnZWagAAPBIP/jYVkTw0YbllKZjPQEu3\nHOwI+qdxwzx4f5FXK9V7QYdnPJc0E5Y5XAWNlx89BNlqd0Jlb62aAUNzPyNY\nMd2tneqjzZXIYFUsZzoKygJr93J6aGnfNIOlpvgKRW83PqTkO97LH7Z8oWRh\nul2u6k0amgZJUxy+zVCeJDNovYhWLaCMZgXFLXmI/uIybTNszQOCL8lmQCrl\nc47kxqGrwvbO+yjEZiCLXOsoyVo2Qy/BtFhsZCGVImCbuuoEuZm16XCY8O6/\ngKJqhU3+V+eyfo0q8BToURo5Fv1Td6rUcDAdVPuOp2sf7aBRzJ8BLV3EZcab\n81q6UndbzdB6MsxmoMF5PtpqPXfINsjV/WqR8V92S9jQ9ep98xDOZQ8X2QPu\nEGvZU7ks3XlATWSt1HtHuyR3o+xG1lSoHve8eNLD8RVL5IDU8fZRdX6NJASp\nxwZY9Xr7PRSMIPfigOiDJA+3H14qWDJ3H3jxkwBr1q1YRxFJE+/c7usJjM4I\nCv3eL69lL9+THqTR6vcQhmmpB2RJ7dpXl4BjZitfYl551FLP732W8JBXvWEt\nrcl2C8ANpNJm+uJjHKhEU/5wh6Xm9KtXlz0AkBnvhSLSyxQxXwCEtnRoeDDE\nzjux7olHIsbD7M1OEagXgQ5vRSRmddfkLo9weURYioXtFR0y4cCPB32idTgO\nq5/R\r\n=SgMQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAdtG4OX3nxG+ak1JLmrn71lJuM4dQ1uu9A4ENltT0bAIhANdNlZ2XmPQMQma3JEgaxU5aVaOgwMOQVyHdHMDbIsvX"}],"size":62984,"noattachment":false,"key":"/rc-gesture/-/rc-gesture-0.0.21.tgz"},"maintainers":[{"email":"hust2012jiangkai@gmail.com","name":"paranoidjk"},{"email":"quentinyang1985@gmail.com","name":"quentinyang1985"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rc-gesture_0.0.21_1528774097766_0.21793288857708126"},"_hasShrinkwrap":false,"readme":"# rc-gesture\n---\n\nSupport gesture for react component, inspired by [hammer.js](https://github.com/hammerjs/hammer.js) and [AlloyFinger](https://github.com/AlloyTeam/AlloyFinger).\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![gemnasium deps][gemnasium-image]][gemnasium-url]\n[![node version][node-image]][node-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: http://img.shields.io/npm/v/rc-gesture.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rc-gesture\n[travis-image]: https://img.shields.io/travis/react-component/gesture.svg?style=flat-square\n[travis-url]: https://travis-ci.org/react-component/gesture\n[coveralls-image]: https://img.shields.io/coveralls/react-component/gesture.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/react-component/gesture?branch=master\n[gemnasium-image]: http://img.shields.io/gemnasium/react-component/gesture.svg?style=flat-square\n[gemnasium-url]: https://gemnasium.com/react-component/gesture\n[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square\n[node-url]: http://nodejs.org/download/\n[download-image]: https://img.shields.io/npm/dm/rc-gesture.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rc-gesture\n\n## Screenshots\n\n\n## Features\n\n\n\n## Install\n\n```bash\nnpm install --save rc-gesture\n```\n\n[![rc-gesture](https://nodei.co/npm/rc-gesture.png)](https://npmjs.org/package/rc-gesture)\n\n## Usage\n\n```tsx\nimport Gesture from 'rc-gesture';\n\nReactDOM.render(\n  <Gesture\n    onTap={(gestureStatus) => { console.log(gestureStatus); }}\n  >\n    <div>container</div>\n  </Gesture>,\ncontainer);\n```\n\n\n## API\n\nall callback funtion will have one parammeter: `type GestureHandler = (s: IGestureStatus) => void;`\n\n- gesture: the rc-gesture state object, which contain all information you may need, see [gesture](#gesture)\n\n### props:\n\n#### common props\n<table class=\"table table-bordered table-striped\">\n    <thead>\n    <tr>\n        <th style=\"width: 100px;\">name</th>\n        <th style=\"width: 50px;\">type</th>\n        <th>default</th>\n        <th>description</th>\n    </tr>\n    </thead>\n    <tbody>\n      <tr>\n          <td>direction</td>\n          <td>string</td>\n          <th>`all`</th>\n          <td>control the allowed gesture direction, could be `['all', 'vertical', 'horizontal']`</td>\n      </tr>\n</table>\n\n#### Tap & Press\n<table class=\"table table-bordered table-striped\">\n    <thead>\n    <tr>\n        <th style=\"width: 100px;\">name</th>\n        <th style=\"width: 50px;\">type</th>\n        <th>default</th>\n        <th>description</th>\n    </tr>\n    </thead>\n    <tbody>\n      <tr>\n          <td>onTap</td>\n          <td>function</td>\n          <th></th>\n          <td>single tap callback</td>\n      </tr>\n      <tr>\n          <td>onPress</td>\n          <td>function</td>\n          <th></th>\n          <td>long tap callback</td>\n      </tr>\n      <tr>\n          <td>onPressOut</td>\n          <td>function</td>\n          <th></th>\n          <td>long tap end callback</td>\n      </tr>\n</table>\n\n#### Swipe\n<table class=\"table table-bordered table-striped\">\n    <thead>\n    <tr>\n        <th style=\"width: 100px;\">name</th>\n        <th style=\"width: 50px;\">type</th>\n        <th>default</th>\n        <th>description</th>\n    </tr>\n    </thead>\n    <tbody>\n      <tr>\n          <td>onSwipe</td>\n          <td>function</td>\n          <th></th>\n          <td>swipe callback, will triggered at the same time of all of below callback</td>\n      </tr>\n      <tr>\n          <td>onSwipeLeft</td>\n          <td>function</td>\n          <th></th>\n          <td>swipe left callback</td>\n      </tr>\n      <tr>\n          <td>onSwipeRight</td>\n          <td>function</td>\n          <th></th>\n          <td>swipe right callback</td>\n      </tr>\n      <tr>\n          <td>onSwipeTop</td>\n          <td>function</td>\n          <th></th>\n          <td>swipe top callback</td>\n      </tr>\n      <tr>\n          <td>onSwipeBottom</td>\n          <td>function</td>\n          <th></th>\n          <td>swipe bottom callback</td>\n      </tr>\n    </tbody>\n</table>\n\n#### Pan\n<table class=\"table table-bordered table-striped\">\n    <thead>\n    <tr>\n        <th style=\"width: 100px;\">name</th>\n        <th style=\"width: 50px;\">type</th>\n        <th>default</th>\n        <th>description</th>\n    </tr>\n    </thead>\n    <tbody>\n      <tr>\n          <td>onPan</td>\n          <td>function</td>\n          <th></th>\n          <td>pan callback, will triggered at the same time of all of below callback</td>\n      </tr>\n      <tr>\n          <td>onPanStart</td>\n          <td>function</td>\n          <th></th>\n          <td>drag start callback</td>\n      </tr>\n      <tr>\n          <td>onPanMove</td>\n          <td>function</td>\n          <th></th>\n          <td>drag move callback</td>\n      </tr>\n      <tr>\n          <td>onPanEnd</td>\n          <td>function</td>\n          <th></th>\n          <td>drag end callback</td>\n      </tr>\n      <tr>\n          <td>onPanCancel</td>\n          <td>function</td>\n          <th></th>\n          <td>drag cancel callback</td>\n      </tr>\n      <tr>\n          <td>onPanLeft</td>\n          <td>function</td>\n          <th></th>\n          <td>pan left callback</td>\n      </tr>\n      <tr>\n          <td>onPanRight</td>\n          <td>function</td>\n          <th></th>\n          <td>pan right callback</td>\n      </tr>\n      <tr>\n          <td>onPanTop</td>\n          <td>function</td>\n          <th></th>\n          <td>pan top callback</td>\n      </tr>\n      <tr>\n          <td>onPanBottom</td>\n          <td>function</td>\n          <th></th>\n          <td>pan bottom callback</td>\n      </tr>\n    </tbody>\n</table>\n\n#### Pinch\n\npinch gesture is not enabled by default, you must set `props.enablePinch = true` at first;\n\n<table class=\"table table-bordered table-striped\">\n    <thead>\n    <tr>\n        <th style=\"width: 100px;\">name</th>\n        <th style=\"width: 50px;\">type</th>\n        <th>default</th>\n        <th>description</th>\n    </tr>\n    </thead>\n    <tbody>\n      <tr>\n          <td>onPinch</td>\n          <td>function</td>\n          <th></th>\n          <td>pinch callback, will triggered at the same time of all of below callback</td>\n      </tr>\n      <tr>\n          <td>onPinchStart</td>\n          <td>function</td>\n          <th></th>\n          <td>pinch start callback</td>\n      </tr>\n      <tr>\n          <td>onPinchMove</td>\n          <td>function</td>\n          <th></th>\n          <td>pinch move callback</td>\n      </tr>\n      <tr>\n          <td>onPinchEnd</td>\n          <td>function</td>\n          <th></th>\n          <td>pinch end callback</td>\n      </tr>\n      <tr>\n          <td>onPanCancel</td>\n          <td>function</td>\n          <th></th>\n          <td>pinch cancel callback</td>\n      </tr>\n      <tr>\n          <td>onPinchIn</td>\n          <td>function</td>\n          <th></th>\n          <td>pinch in callback</td>\n      </tr>\n      <tr>\n          <td>onPinchOut</td>\n          <td>function</td>\n          <th></th>\n          <td>pinch out callback</td>\n      </tr>\n    </tbody>\n</table>\n\n\n#### Rotate\n\npinch gesture is not enabled by default, you must set `props.enableRotate = true` at first;\n\n<table class=\"table table-bordered table-striped\">\n    <thead>\n    <tr>\n        <th style=\"width: 100px;\">name</th>\n        <th style=\"width: 50px;\">type</th>\n        <th>default</th>\n        <th>description</th>\n    </tr>\n    </thead>\n    <tbody>\n      <tr>\n          <td>onRotate</td>\n          <td>function</td>\n          <th></th>\n          <td>rotate callback, will triggered at the same time of all of below callback</td>\n      </tr>\n      <tr>\n          <td>onRotateStart</td>\n          <td>function</td>\n          <th></th>\n          <td>rotate start callback</td>\n      </tr>\n      <tr>\n          <td>onRotateMove</td>\n          <td>function</td>\n          <th></th>\n          <td>rotate move callback</td>\n      </tr>\n      <tr>\n          <td>onRotateEnd</td>\n          <td>function</td>\n          <th></th>\n          <td>rotate end callback</td>\n      </tr>\n      <tr>\n          <td>onRotateCancel</td>\n          <td>function</td>\n          <th></th>\n          <td>rotate cancel callback</td>\n      </tr>\n    </tbody>\n</table>\n\n## gesture\n\n```tsx\n// http://hammerjs.github.io/api/#event-object\nexport interface IGestureStauts {\n    /* start status snapshot */\n    startTime: number;\n    startTouches: Finger[];\n\n    startMutliFingerStatus?: MultiFingerStatus[];\n\n    /* now status snapshot */\n    time: number;\n    touches: Finger[];\n\n    mutliFingerStatus?: MultiFingerStatus[];\n\n    /* delta status from touchstart to now, just for singe finger */\n    moveStatus?: SingeFingerMoveStatus;\n\n    /* whether is a long tap */\n    press?: boolean;\n\n    /* whether is a swipe*/\n    swipe?: boolean;\n    direction?: number;\n\n    /* whether is in pinch process */\n    pinch?: boolean;\n    scale?: number;\n\n    /* whether is in rotate process */\n    rotate?: boolean;\n    rotation?: number; // Rotation (in deg) that has been done when multi-touch. 0 on a single touch.\n};\n```\n\n## Development\n\n```\nnpm install\nnpm start\n```\n\n## Example\n\n`npm start` and then go to `http://localhost:8005/examples/`\n\nOnline examples: [http://react-component.github.io/gesture/](http://react-component.github.io/gesture/)\n\n## Test Case\n\n`http://localhost:8005/tests/runner.html?coverage`\n\n## Coverage\n\n`http://localhost:8005/node_modules/rc-server/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8088/tests/runner.html?coverage`\n\n## License\n\n`rc-gesture` is released under the MIT license.\n","publish_time":1528774097852,"_cnpm_publish_time":1528774097852,"dist-tags":{"latest":"0.0.22"}}