{"_id":"@emanuele-em/nuxt-swipe","_rev":"2-2fbabb6ae48b2ef6f3a4a25b3904e9de","name":"@emanuele-em/nuxt-swipe","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@emanuele-em/nuxt-swipe","version":"1.0.0","license":"MIT","type":"module","exports":{".":{"import":"./dist/module.mjs","require":"./dist/module.cjs"}},"main":"./dist/module.cjs","types":"./dist/types.d.ts","scripts":{"prepack":"nuxt-module-build","dev":"nuxi dev playground","dev:build":"nuxi build playground","dev:prepare":"nuxt-module-build --stub && nuxi prepare playground"},"dependencies":{"@nuxt/kit":"^3.0.0","mitt":"^3.0.0"},"devDependencies":{"@nuxt/module-builder":"^0.2.1","@nuxt/schema":"^3.0.0","@nuxtjs/eslint-config-typescript":"^12.0.0","eslint":"^8.29.0","nuxt":"^3.0.0"},"description":"## Development","repository":{"type":"git","url":"git+https://github.com/emanuele-em/nuxt-swipe.git"},"keywords":["gesture","swipe","nuxt3","vue3","vue","nuxt"],"author":{"name":"emanuele-em"},"bugs":{"url":"https://github.com/emanuele-em/nuxt-swipe/issues"},"homepage":"https://github.com/emanuele-em/nuxt-swipe#readme","gitHead":"a2bdee25190c41cd968a1e998163f37b7e18e48e","_id":"@emanuele-em/nuxt-swipe@1.0.0","_nodeVersion":"19.1.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-mby0nA3q8enD6CCcLawA7yYrMD9/YHkKERHYGvckaF6BSoFC3NfmhuZSOIjjJgHnUAoSY83LKdctoxUAOVLeAA==","shasum":"616a725dfc574ca0f2f81b9e815b71decb3686e0","tarball":"https://registry.npmjs.org/@emanuele-em/nuxt-swipe/-/nuxt-swipe-1.0.0.tgz","fileCount":10,"unpackedSize":7541,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGN5rzqGlA5PNgNq3YuDzqTWfb8jIl9B5pduWhQEiFz5AiEA70nQqqZGLXov6Bx8gXcHQ3kCAgJaNa80W/eUDZYuc/0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl1+tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBvA//Y6HuVhFlnmFuwImhDid9AZw6/REm4oaj+hwnqRgsMpNCnv1V\r\nYkg09gLkHvcXwhjPIPaT1wJFH2KbDQL6kn3ZhuCrprJM4VH6DhrkFRNEjMn1\r\nmOS74Us+Qc36qyexPW9Zg7JZk7p38TK2d9frNYhugRY3k1BPOTqWGZdRxcQK\r\nk1sMmnZx6U0WCB+HL99I7PKfHMZy6bdfGEmOiPkELoYZ64akV3Nf3pNIQTAb\r\nZ1FevBZItEM8LKNJPqXdBVH90/vX1jR+nGG8wZTCw7tk/o8Eib77QcFv409j\r\n1vWvvdIdTaJz6TFZoIry5JogisX6YhOo0L+AlTUmCpm05YHfqX8Q0xBJIeCS\r\nCoq6Lu03ldOKLPn/ka5Mm1mowHhf0guBIM4yZiADTpIuGXb/YqPvJYxJnQD1\r\ncRJnQJsiTmcn22oG1mNhiLfFFQqu7sTJFN5ZXBzgdalAKYSDdRjWudNEhqn3\r\n3dP0CByErZ7njvkkLUIJmXadCVgJbt1KxPTQClwwg9aZO92hGLq9QtFr+RgC\r\nCoeLnLWc8Sje6ty6ArliDFP+DH8E5i8MoS1xNmtiauPzcy9qA5HbhybJkhHJ\r\nUffKbmOoN01o9lgVToiKrFfAxRr5wgU0UZyayVGmq1OzDQAG1gxtLmbvpQ53\r\n3uE41uzhWAAaLOkkzaPUWfaORjnFO5WYotw=\r\n=szCl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"emanuele-em","email":"mike97.e@gmail.com"},"directories":{},"maintainers":[{"name":"emanuele-em","email":"mike97.e@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nuxt-swipe_1.0.0_1670864813484_0.3758960837356098"},"_hasShrinkwrap":false},"1.0.1":{"name":"@emanuele-em/nuxt-swipe","version":"1.0.1","license":"MIT","type":"module","exports":{".":{"import":"./dist/module.mjs","require":"./dist/module.cjs"}},"main":"./dist/module.cjs","types":"./dist/types.d.ts","scripts":{"prepack":"nuxt-module-build","dev":"nuxi dev playground","dev:build":"nuxi build playground","dev:prepare":"nuxt-module-build --stub && nuxi prepare playground"},"dependencies":{"@nuxt/kit":"^3.0.0","mitt":"^3.0.0"},"devDependencies":{"@nuxt/module-builder":"^0.2.1","@nuxt/schema":"^3.0.0","@nuxtjs/eslint-config-typescript":"^12.0.0","eslint":"^8.29.0","nuxt":"^3.0.0"},"description":"## Development","repository":{"type":"git","url":"git+https://github.com/emanuele-em/nuxt-swipe.git"},"keywords":["gesture","swipe","nuxt3","vue3","vue","nuxt"],"author":{"name":"emanuele-em"},"bugs":{"url":"https://github.com/emanuele-em/nuxt-swipe/issues"},"homepage":"https://github.com/emanuele-em/nuxt-swipe#readme","gitHead":"b3c41896dce8314a5b59029d2c6594b93a267271","_id":"@emanuele-em/nuxt-swipe@1.0.1","_nodeVersion":"19.1.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-tOlSCj2TAPCGpZ+uV2gdyx/nhAesPDQi8v3XrCxlypBPbyMJByhvHVaonoX4X/QJWNhD3cRvXuZ4YRAOJqP6AA==","shasum":"80f2b561bcf77a0f93013f6ce924f0e029ccaf14","tarball":"https://registry.npmjs.org/@emanuele-em/nuxt-swipe/-/nuxt-swipe-1.0.1.tgz","fileCount":10,"unpackedSize":7556,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5f88dpFB+02I7u3GyWBf+C960iwRRfHYDaExjOaXt0AIgSIA8miXt028CeNk7PCREOBQ4lw2IJThuaHB/9SYqTb8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl2yPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6RA//dGcD7myXCB6pg8vovQbngV3hNP1iCn/6DWgKHv6AamKskRiY\r\nZdyOlTemyJ30K/3bkLXroaIeOVfKzmSz9JcQCT90O6+nD5t+slOb335zr68Y\r\nolXtVcMidQDIj69T64YzzrNbgZXcZrcK40is34X27yw330Jp9PjOb9d2TwLP\r\nw5ktDwnFDED/Rvyzo/y2i8m+zLEvD6DSFqqFrSClvDezcrU1/ZNu0lCwq5L6\r\nFmMEFYvzI2BMpr80a6fkwfCx27B/Kbxyd1ygkptjXrrB5iA6IInOwc+T49Yc\r\nAeaezbQB1T4/WHLeqLeDMzJ//s8WwpMfkOLYHABLKgHd7VEhz3oqqkUitqwg\r\nWa+Wuo2RRAOSrxf3zv3/lRAyOiBL5W8+c0yswkVmlpB2ZDofapyOTqo7P0rY\r\nsb9D6WuntYoqPNupon9BKqCGN8a8oxkqpMJlhZjRxIUtRTZGwgsB8iriw+cK\r\nd8BHzbwQRVU0zfhidZeo0AIR5Qm+Moun16/Vd+LyaLiGrt1p1UzykxhiQuif\r\nr1BXGOExZgPebdCcrF3udFHV/8rRVlj1/eaPzcJWjCapDYuQZXu3LNzOvf5Z\r\nv1dti01Mbu8Hsa7lnkvAbhw0/2X/f1K/zJjLXc2+OJcK6kr+WJB7Ga+djw26\r\nvSEDczN4TJUV6PE4k0PV2IMQYVPTC633Az8=\r\n=EFrN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"emanuele-em","email":"mike97.e@gmail.com"},"directories":{},"maintainers":[{"name":"emanuele-em","email":"mike97.e@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nuxt-swipe_1.0.1_1670868111066_0.19974824084612064"},"_hasShrinkwrap":false},"1.0.2":{"name":"@emanuele-em/nuxt-swipe","version":"1.0.2","license":"MIT","type":"module","exports":{".":{"import":"./dist/module.mjs","require":"./dist/module.cjs"}},"main":"./dist/module.cjs","types":"./dist/types.d.ts","scripts":{"prepack":"nuxt-module-build","dev":"nuxi dev playground","dev:build":"nuxi build playground","dev:prepare":"nuxt-module-build --stub && nuxi prepare playground"},"dependencies":{"@nuxt/kit":"^3.0.0","mitt":"^3.0.0"},"devDependencies":{"@nuxt/module-builder":"^0.2.1","@nuxt/schema":"^3.0.0","@nuxtjs/eslint-config-typescript":"^12.0.0","eslint":"^8.29.0","nuxt":"^3.0.0"},"description":"## Development","repository":{"type":"git","url":"git+https://github.com/emanuele-em/nuxt-swipe.git"},"keywords":["gesture","swipe","nuxt3","vue3","vue","nuxt"],"author":{"name":"emanuele-em"},"bugs":{"url":"https://github.com/emanuele-em/nuxt-swipe/issues"},"homepage":"https://github.com/emanuele-em/nuxt-swipe#readme","gitHead":"181acba2d5c7cf3a228640cac48aa8db01332776","_id":"@emanuele-em/nuxt-swipe@1.0.2","_nodeVersion":"19.1.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-qeSIvXsSCjy9ZId4ecQebIx3t4nIPgqgx2DSiOI6zZdOg1Yc6qM8/L7QaNbHWI+hT7xJwG7wbjrPfQtopD7gKA==","shasum":"5b990be3e9121f080d36f76ad6596af893a963a8","tarball":"https://registry.npmjs.org/@emanuele-em/nuxt-swipe/-/nuxt-swipe-1.0.2.tgz","fileCount":10,"unpackedSize":7615,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHZuA1jB/t1gys5QBSpOKo7IbnkaTQo8c4dE5MgbgvTzAiEAuiX2GVu82C9md3G284v+t3ePTJQITNvlXxhTPQMosgI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmJ2JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQmg//SkNWUMYEuN3UruPVOFw2l31R8KXPYLUH+kCkT9O9tsJz+APj\r\nknOV3dlsbSv7FWBMLo9lbZP860l3YKKa2mzQ9LTstHCL3qW3+6OFmE2cqfqk\r\nw9v+HbvYFjG+KYL2p++3OHtSoOopn4JEnHzlO3MFUUHBXSRwtsF99HyPsi9F\r\nOr8GH/Nd+ksDXCmkO+PN86kZRw542vABVu5NzcF7tGHpE+uRDAjm/ZdWnsmm\r\ny6oDY2eBjtOX0Ds7hipJbM1kZ3BBGtYhpVqCveLMgvDTWTa275Gf9NSQ3P3Z\r\nEBsc2wOiHIgra082MoL78xNQQ43LDw/XGZuEvV9ERMdNgCmCsyhqxqQCI+kM\r\nzf5lRW8yy5i3WO4XYbH36jlc8KfT4YvxV3t7NI07dzMYoCku3gEGFnnmfZc1\r\nKITSsIQLG1+Pztxcp8nCog9r2Iq/ylE8mF4lolCSwgyWxxrQglla3CDB++gb\r\nQ6owkafaf0Hw5XwpXWmRxFPbHXtPmVr1kThdjQXSSdbVLOQyR3yoHpOP7nFn\r\nIQ0ds6iT5CxST03WlO6sKVaJfkq1NhhOy5RB/KRfqXC/dDbE+0EpSBiW4vIp\r\nPVaSt06NuPx0tkQ6j5Cxla45Qu1S4L3Csmfuhka2ecRxpWjCzgafTgT201lq\r\nEFfCa3FqHI5nFVgopzks3Ielnoaq0mA+CGM=\r\n=i1Pc\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"emanuele-em","email":"mike97.e@gmail.com"},"directories":{},"maintainers":[{"name":"emanuele-em","email":"mike97.e@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nuxt-swipe_1.0.2_1670946185321_0.8929630693559314"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-12T17:06:53.398Z","1.0.0":"2022-12-12T17:06:53.667Z","modified":"2022-12-13T15:43:05.514Z","1.0.1":"2022-12-12T18:01:51.211Z","1.0.2":"2022-12-13T15:43:05.434Z"},"maintainers":[{"name":"emanuele-em","email":"mike97.e@gmail.com"}],"description":"## Development","homepage":"https://github.com/emanuele-em/nuxt-swipe#readme","keywords":["gesture","swipe","nuxt3","vue3","vue","nuxt"],"repository":{"type":"git","url":"git+https://github.com/emanuele-em/nuxt-swipe.git"},"author":{"name":"emanuele-em"},"bugs":{"url":"https://github.com/emanuele-em/nuxt-swipe/issues"},"license":"MIT","readme":"\n# Nuxt-Swipe\n\nThis Nuxt 3 module allows you to easily add swipe gestures to your Vue 3 App. With just a few lines of code, you can enable swiping on your website or web application.\n\n\n\n## Installation\n\nTo add this module to your Nuxt.js project, run the following command:\n\n```bash\n  npm i @emanuele-em/nuxt-swipe\n\n```\nThen, add nuxt-swipe to the modules section of your nuxt.config.js file:\n\n```javascript\n  export default {\n    modules: [\n        '@emanuele-em/nuxt-swipe'\n    ]\n  }\n\n```    \n\n## Usage\n\nTo use the module, simply add `<Swipe>` component, it will be the component that will intercept the _swipe_ gesture\n\nFor example:\n```javascript\n<template>\n    <Swipe>\n        <slot />\n    </Swipe>\n</template>\n```\n\nThe module will create a plugin that will emit the `Swipe` event only after some checks to make sure that the gesture is really a swipe gesture.\n\nYou can handle that event in the script section of your component, **remember to import nuxtApp**:\n\n```html\n<script setup>\n\nimport { useNuxtApp } from '#app'\n\nconst nuxtApp = useNuxtApp()\n\nnuxtApp.$bus.$on('swipe', (direction) => {\n    switch (direction) {\n        case 'left': \n            // swiped left, do things\n            break;\n        case 'right':\n            // swiped right, do things\n            break;\n        case 'up':\n            // swiped up, do things\n            break;\n        case 'down':\n            // swiped down, do things\n            break;\n        default:\n            break;\n    }\n})\n\n</script>\n```\n## Examples\n\nSwipe navigation with `Swipe` component as Default Layout\n\n_layouts/default.vue_\n```javascript\n<template>\n    <Swipe>\n        <slot />\n    </Swipe>\n</template>\n  \n<script setup>\nimport { useNuxtApp, useRoute, navigateTo } from '#app'\n\nconst nuxtApp = useNuxtApp()\nconst routes = ['/', '/about']\n\nnuxtApp.$bus.$on('swipe', (direction) => {\n    let indexCurrentRoute = routes.indexOf(useRoute().path)\n    if (direction === 'left' && routes[indexCurrentRoute + 1]) {\n        indexCurrentRoute += 1\n    }\n    if (direction === 'right' && routes[indexCurrentRoute - 1]) {\n        indexCurrentRoute -= 1\n    }\n    return navigateTo(routes[indexCurrentRoute])\n})\n\n</script>\n  \n```\n\n\n## Demo\n\n[demo-nuxt-swipe.pages.dev](https://demo-nuxt-swipe.pages.dev/)\n\n\n## Roadmap\n\n- Typescript correct syntax\n\n- Swipe handling during the `touchEvent` and not just at `touchend` \n\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n","readmeFilename":"README.md"}