{"_id":"@interactjs/interactjs@1.10.28","bugs":{"url":"https://github.com/taye/interact.js/issues"},"dist":{"shasum":"0344867569b5f40f53bce7920bf5bdd97ddcf4a9","tarball":"http://registry-npm.ywwl.com/@interactjs/interactjs/download/@interactjs/interactjs-1.10.28.tgz","integrity":"sha512-s17jptL7RX5PzOeiwvmVdKQGz3BsPnbp4orZmL+6pkY0n6+Yo0DXMgHAwgor79nkI7YrTWWLWwww1dJ699q8sw==","fileCount":13,"unpackedSize":21381,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAqo3spL6W4jZMBdplU/GvQVFOKol3OAnteZH5odwNDhAiBrYXw0o4gyyqzQGTWxTAJPMm505Vc6t687zn9AUEUu6w=="}],"size":4510,"noattachment":false,"key":"/@interactjs/interactjs/-/@interactjs/interactjs-1.10.28.tgz"},"main":"index","name":"@interactjs/interactjs","type":"module","types":"./index.d.ts","module":"index","gitHead":"4188a91c","license":"MIT","version":"1.10.28","_npmUser":{"name":"taye","email":"dev@taye.me","approver":{"name":"taye","email":"dev@taye.me"}},"homepage":"https://github.com/taye/interact.js#readme","repository":{"url":"git+https://github.com/taye/interact.js.git","type":"git"},"_npmVersion":"11.16.0","description":"<a href=\"http://interactjs.io\"><img alt=\"interact.js\" src=\"https://c4d6f7d727e094887e93-4ea74b676357550bd514a6a5b344c625.ssl.cf2.rackcdn.com/ijs-solid.svg\" height=\"70px\" width=\"100%\"></a>","directories":{},"maintainers":[{"name":"interact.js","email":"npm@interactjs.io"},{"name":"taye","email":"dev@taye.me"}],"sideEffects":false,"_nodeVersion":"24.18.1","dependencies":{"@interactjs/core":"1.10.28","@interactjs/utils":"1.10.28","@interactjs/offset":"1.10.28","@interactjs/reflow":"1.10.28","@interactjs/actions":"1.10.28","@interactjs/inertia":"1.10.28","@interactjs/interact":"1.10.28","@interactjs/dev-tools":"1.10.28","@interactjs/modifiers":"1.10.28","@interactjs/auto-start":"1.10.28","@interactjs/auto-scroll":"1.10.28","@interactjs/pointer-events":"1.10.28"},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/interactjs_1.10.28_1785557141566_0.060496975034835865"},"_hasShrinkwrap":false,"readme":"<a href=\"http://interactjs.io\"><img alt=\"interact.js\" src=\"https://c4d6f7d727e094887e93-4ea74b676357550bd514a6a5b344c625.ssl.cf2.rackcdn.com/ijs-solid.svg\" height=\"70px\" width=\"100%\"></a>\n\n<h2>\n  JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+).\n</h2>\n\n<div align=\"center\">\n<a href=\"https://gitter.im/taye/interact.js\"><img src=\"https://badges.gitter.im/taye/interact.js.svg\" alt=\"Gitter\"></a>\n<a href=\"https://www.jsdelivr.com/package/npm/interactjs\"><img src=\"https://data.jsdelivr.com/v1/package/npm/interactjs/badge\" alt=\"jsDelivr\"></a>\n<a href=\"https://github.com/taye/interact.js/actions/workflows/workflow.yml\"><img src=\"https://github.com/taye/interact.js/actions/workflows/workflow.yml/badge.svg\" alt=\"Build Status\"></a>\n<a href=\"https://codeclimate.com/github/taye/interact.js/test_coverage\"><img src=\"https://api.codeclimate.com/v1/badges/0168aeaeed781a949088/test_coverage\"/></a>\n</div>\n<br>\n\nFeatures include:\n\n- **inertia** and **snapping**\n- **multi-touch**, simultaneous interactions\n- cross browser and device, supporting the **desktop and mobile** versions of\n  Chrome, Firefox and Opera as well as **Internet Explorer 9+**\n- interaction with [**SVG**](http://interactjs.io/#use_in_svg_files) elements\n- being **standalone and customizable**\n- **not modifying the DOM** except to change the cursor (but you can disable\n  that)\n\n## Installation\n\n- [npm](https://www.npmjs.org/): `npm install interactjs`\n- [jsDelivr CDN](https://cdn.jsdelivr.net/npm/interactjs/): `<script src=\"https://cdn.jsdelivr.net/npm/interactjs/dist/interact.min.js\"></script>`\n- [unpkg CDN](https://unpkg.com/interactjs/): `<script src=\"https://unpkg.com/interactjs/dist/interact.min.js\"></script>`\n- [Rails 5.1+](https://rubyonrails.org/):\n  1. `yarn add interactjs`\n  2. `//= require interactjs/interact`\n- [Webjars SBT/Play 2](https://www.webjars.org/): `libraryDependencies ++= Seq(\"org.webjars.npm\" % \"interactjs\" % version)`\n\n### Typescript definitions\n\nThe project is written in Typescript and the npm package includes the type\ndefinitions, but if you need the typings alone, you can install them with:\n\n```\nnpm install --save-dev @interactjs/types\n```\n\n## Documentation\n\nhttp://interactjs.io/docs\n\n## Example\n\n```javascript\nvar pixelSize = 16;\n\ninteract('.rainbow-pixel-canvas')\n  .origin('self')\n  .draggable({\n    modifiers: [\n      interact.modifiers.snap({\n        // snap to the corners of a grid\n        targets: [\n          interact.snappers.grid({ x: pixelSize, y: pixelSize }),\n        ],\n      })\n    ],\n    listeners: {\n      // draw colored squares on move\n      move: function (event) {\n        var context = event.target.getContext('2d'),\n            // calculate the angle of the drag direction\n            dragAngle = 180 * Math.atan2(event.dx, event.dy) / Math.PI;\n\n        // set color based on drag angle and speed\n        context.fillStyle = 'hsl(' + dragAngle + ', 86%, '\n                            + (30 + Math.min(event.speed / 1000, 1) * 50) + '%)';\n\n        // draw squares\n        context.fillRect(event.pageX - pixelSize / 2, event.pageY - pixelSize / 2,\n                         pixelSize, pixelSize);\n      }\n    }\n  })\n  // clear the canvas on doubletap\n  .on('doubletap', function (event) {\n    var context = event.target.getContext('2d');\n\n    context.clearRect(0, 0, context.canvas.width, context.canvas.height);\n  });\n\n  function resizeCanvases () {\n    [].forEach.call(document.querySelectorAll('.rainbow-pixel-canvas'), function (canvas) {\n      canvas.width = document.body.clientWidth;\n      canvas.height = window.innerHeight * 0.7;\n    });\n  }\n\n  // interact.js can also add DOM event listeners\n  interact(document).on('DOMContentLoaded', resizeCanvases);\n  interact(window).on('resize', resizeCanvases);\n```\n\nSee the above code in action at https://codepen.io/taye/pen/tCKAm\n\n## License\n\ninteract.js is released under the [MIT License](http://taye.mit-license.org).\n\n[ijs-twitter]: https://twitter.com/interactjs\n[upcoming-changes]: https://github.com/taye/interact.js/blob/main/CHANGELOG.md#upcoming-changes\n","publish_time":1785557141651,"_cnpm_publish_time":1785557141651,"dist-tags":{"latest":"1.10.28","next":"1.8.3"}}