{"name":"rc-gesture","version":"0.0.9","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":["./src/index"]}},"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","pub":"rc-tools run pub --babel-runtime","lint":"rc-tools run lint","test":"jest","coverage":"jest --coverage && cat ./coverage/lcov.info | coveralls"},"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":"e05e3cee29db808e79566ab9e51b7962cf2a0f2b","_id":"rc-gesture@0.0.9","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"paranoidjk","email":"hust2012jiangkai@gmail.com"},"dist":{"integrity":"sha512-picR18RfxDPCGddVIXEoFTKTptd1Nij3vJnKGi0l1fremqU5/dVV5fur8sZ+n181x72HNnbTrDLpg2ELflQzqQ==","shasum":"1318a9ad2b3f10392c53728927a906fdceb7b42e","tarball":"http://registry-npm.ywwl.com/rc-gesture/download/rc-gesture-0.0.9.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBX1GcG5nAE2jMWLzesYNe+F1T+w6JhfoRItgvrxBVVvAiEApHi6D6tcOozSVQUp+DouYlBFcmEnNMfoJe9GCsPn3fQ="}],"size":56034,"noattachment":false,"key":"/rc-gesture/-/rc-gesture-0.0.9.tgz"},"maintainers":[{"name":"paranoidjk","email":"hust2012jiangkai@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rc-gesture-0.0.9.tgz_1504066387701_0.08690439094789326"},"directories":{},"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":1504066388325,"_cnpm_publish_time":1504066388325,"dist-tags":{"latest":"0.0.22"}}