{"_id":"detect-hover","_rev":"11-407a1577965047ddc3cb3311e56cc03c","name":"detect-hover","description":"JavaScript wrapper for hover and any-hover media queries","dist-tags":{"latest":"1.0.3"},"versions":{"0.1.0":{"name":"detect-hover","version":"0.1.0","description":"JS wrapper for hover media query","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-hover.git"},"keywords":["hover","any-hover","media query"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-hover/issues"},"homepage":"https://github.com/rafrex/detect-hover#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"49cf8f6ab80d8e49f5cfe47f36181f59092a8ce0","_id":"detect-hover@0.1.0","_shasum":"594de525f1d8cb9f1a18e355018928690b9a69b6","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"594de525f1d8cb9f1a18e355018928690b9a69b6","tarball":"https://registry.npmjs.org/detect-hover/-/detect-hover-0.1.0.tgz","integrity":"sha512-iyNagbSQ1SpHF3mNsmXCCfGp9A3Phovusvv+yAm/MOxoyRtw1giek5CLrTBb61yVV1sPT26en7tmAuhgJavfxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA+xTCxolT76j7RMKwjrIeUXxtv0u3JvzfA8HLc63RVlAiBIPEtoc35oCKbUzufpEPMn9y/pMi0BW1skTI/COZ3pjA=="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/detect-hover-0.1.0.tgz_1467775003199_0.38864662148989737"},"directories":{}},"0.1.1":{"name":"detect-hover","version":"0.1.1","description":"JavaScript wrapper for hover and any-hover media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-hover.git"},"keywords":["hover","any-hover","media query"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-hover/issues"},"homepage":"https://github.com/rafrex/detect-hover#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"0ec85ef2a13172ad3214f665c54f2e4d40ebfcaa","_id":"detect-hover@0.1.1","_shasum":"007b2c4db9bed9fd5c0ae7612c0de08fee60f5c6","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"007b2c4db9bed9fd5c0ae7612c0de08fee60f5c6","tarball":"https://registry.npmjs.org/detect-hover/-/detect-hover-0.1.1.tgz","integrity":"sha512-1uhd2nAsgU1FuTV64nX5xWQikgZr9a9SnuT7ef029fjSBQ792Row5tz2XCSvSIvZrKu8lRQiQwWPihQsJo/Gmw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuyNUJOjHNX/2BCtxXTfVLzdf+uF9IK8XeQmjo/78sogIgOe9DZOVDl+TTyIOfqk7t2OHojPgEH6qW/ku0ItXbZmA="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/detect-hover-0.1.1.tgz_1467951228190_0.6987514512147754"},"directories":{}},"0.2.0":{"name":"detect-hover","version":"0.2.0","description":"JavaScript wrapper for hover and any-hover media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-hover.git"},"keywords":["hover","any-hover","media query"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-hover/issues"},"homepage":"https://github.com/rafrex/detect-hover#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"0f6dde788a853e9d5aaaf887ca553f9442ff1e9a","_id":"detect-hover@0.2.0","_shasum":"6e5332136d0c43cab06a8c9fc7a8169cc353f124","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"6e5332136d0c43cab06a8c9fc7a8169cc353f124","tarball":"https://registry.npmjs.org/detect-hover/-/detect-hover-0.2.0.tgz","integrity":"sha512-vwecAkWMypu2cCf4n4aBnOgPgPW4Mj5xtoBKpBZaV1pmnrfUwcasbHluDmbGJX5wVtfbIO9LKheG5ZwR6YGMEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxnDJby1YYeE/TjGYQULxyOXqF3iC27p/ayjbUgYzBEgIgJfbH+qjoo9TJ0Q67EJnsxcXC1cEw23kLzJejbaGFkz4="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/detect-hover-0.2.0.tgz_1468956797827_0.388587458524853"},"directories":{}},"1.0.0":{"name":"detect-hover","version":"1.0.0","description":"JavaScript wrapper for hover and any-hover media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-hover.git"},"keywords":["detect","hover","any-hover","media query"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-hover/issues"},"homepage":"https://github.com/rafrex/detect-hover#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"5d8cbc6e69ba4e00d38cb5db5aa0f436d07cd32a","_id":"detect-hover@1.0.0","_shasum":"df1d698ebf5789a937b5c2aec08248ec5c2a30e5","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"df1d698ebf5789a937b5c2aec08248ec5c2a30e5","tarball":"https://registry.npmjs.org/detect-hover/-/detect-hover-1.0.0.tgz","integrity":"sha512-QVZwpTmQ6a/+xxjGaLsU42apCUP1lMnR976zh36u7J5Y7hlN0oosyGE1ZuKj4Xq0U2ERfcq2mjUJTxwvFGLbcg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2ZMD+NdPn/DdZM3nzM7/iIJPSpU2OQtqz7aXNAOSaGgIhANfStpz1PlfxV4JEWMlvCZ8z/xbziB4pAjCAzIVcThV4"}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/detect-hover-1.0.0.tgz_1469141403868_0.21492783911526203"},"directories":{}},"1.0.1":{"name":"detect-hover","version":"1.0.1","description":"JavaScript wrapper for hover and any-hover media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-hover.git"},"keywords":["detect","hover","any-hover","media query"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-hover/issues"},"homepage":"https://github.com/rafrex/detect-hover#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"a3879e251207dfaf377ec219d5072bee5fa2abfc","_id":"detect-hover@1.0.1","_shasum":"cf8293b91bdc16b35a8dbbe52be06553ad23d3fc","_from":".","_npmVersion":"4.2.0","_nodeVersion":"6.9.5","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"cf8293b91bdc16b35a8dbbe52be06553ad23d3fc","tarball":"https://registry.npmjs.org/detect-hover/-/detect-hover-1.0.1.tgz","integrity":"sha512-aeVFDy/jdNLzEbngs/N6OSo7409ccS8+u7DFVydUXWc/UeVKNmL/r5hMe1tN+LxtK/RXQjnlN3y4QU4cjH5bUg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzi7P88XXvujkf10lsdu2LknJ3EWLY4hIEZKlVfnucCwIgUlIzeBHpYDsjfSfjw+DHLxP2zpi3ZomuJjrvwz5y/No="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/detect-hover-1.0.1.tgz_1487964404655_0.18320056982338428"},"directories":{}},"1.0.2":{"name":"detect-hover","version":"1.0.2","description":"JavaScript wrapper for hover and any-hover media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-hover.git"},"keywords":["detect","hover","any-hover","media query"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-hover/issues"},"homepage":"https://github.com/rafrex/detect-hover#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"52c8e1e030109ffd6c552f65a51ca5a4700ec674","_id":"detect-hover@1.0.2","_shasum":"589fb0b469220897a9eee3fa36a917e1eda37a21","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"589fb0b469220897a9eee3fa36a917e1eda37a21","tarball":"https://registry.npmjs.org/detect-hover/-/detect-hover-1.0.2.tgz","integrity":"sha512-BXNcK1+oSNvtJ0/E5chWxc0Qpujp0ZipclmOrArmkNsmwssgEN6TtvcSJHPYbyyDjWJ3pF+G4rENh1CYuRaNYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDhvt/XgnsWCUls60yLcYdcD2drTMCFWBnqARVpwY+pMAiEAnkRrzTbvfMSYJWsGkwRvWm/4b3qVKdW0L4DOGDYn97E="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-hover-1.0.2.tgz_1506364798567_0.5811895548831671"},"directories":{}},"1.0.3":{"name":"detect-hover","version":"1.0.3","description":"JavaScript wrapper for hover and any-hover media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-hover.git"},"keywords":["detect","hover","any-hover","media query"],"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"license":"MIT","bugs":{"url":"https://github.com/rafgraph/detect-hover/issues"},"homepage":"https://github.com/rafgraph/detect-hover#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"9e26c4021e3cb3460d1421b92f5d277a67e548ab","_id":"detect-hover@1.0.3","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-HtLoY+tClgYucJNiovNICGWFp9nOGVmHY44s7L62iPqORXM9vujeWFaVcqtA7XRvp/2Y+4RBUfHbDKFGN+xxZQ==","shasum":"7392507cbced1bedc9f129a56b197c1eef9076c3","tarball":"https://registry.npmjs.org/detect-hover/-/detect-hover-1.0.3.tgz","fileCount":5,"unpackedSize":7447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWmVUCRA9TVsSAnZWagAA9uoP/1wRUIn/yc4cOh1iSBtT\nj4M43mAiVAn5yQzB2U7LteuEWQ0SQ/vOOtCBka5UJHpA0sfIRvjdQ96Aj716\n1jc0/ggQwWGWdsAmqZaYgC+5xKWSZ/G+uZLQEkiFH1tfJzt46wD8Il6nfkNU\n5O76ql9tqgTjtkQNSjI8nImNn6NaXtPOP2sB72XR7n+1oNytQJxuQEFDwJ0S\nuUh7wK0i84JRuJ+HNb2ecX5cK2FKNVq/mBbVYGxtQbZ59FhzKzrDZ5IFw/Mp\n2gmIMxLvrl5xgnGVW7On1HCMMV/Qle9vwi/gRmXmoROivl3OXU0Wqp+fZEaK\nOrx/oGJ0K9nAXdmlJjeYL86GRClpxGR9SoOgXRTQOWNwsudzU1fOkgTVb5QQ\nYPoKiUnICHgUdqoz/2NuXEOQfI0i2+Ufgv48k4xFT5S9hJNzzrEi+IKbuKRa\nQASyf6W7xifpf4G/4rjkr5D6WI/uSWNoMj3gUUkSJGTD2u7HxJQ3jtCsev8M\nn1xQqfrgSQSd3vMY0YOtbOV/VhgeXoRuwdbLPPtFRiy5B3c0Dn3ux07NPruL\njj12+N2ZC0Vp2xPrFar15oi5FYh6TdmIzoyM8kMN/tfkzVU5/c0WNxLeofj4\npPzNZNRL7H2uubwni8yJWJST1ffrsaN7GnN/MObpuDiPLoLWFQsnCeD5tVnV\n/wMh\r\n=ZDbp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBB23hf/khUE0+/GLL1/cmlOcGO/K8Z3Xatokey17SlPAiBE/5/fNOJi3cg3nOYMvuF5pHStneXtz0OOROnTerCW4A=="}]},"maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"_npmUser":{"name":"rafgraph","email":"rafael@rafgraph.dev"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-hover_1.0.3_1599759700134_0.3306496836598116"},"_hasShrinkwrap":false}},"readme":"# Detect Hover\n\nJavaScript wrapper for `hover` and `any-hover` media queries.\n\n[Live detection test][liveDetectionTest]\n\nExports a reference to a singleton object (a micro state machine with an update function) with its state set to the results of the `hover` and `any-hover` media queries, as well as an `update()` function which re-runs the tests and updates the object's state.\n\nNote that `detect-hover` is one of the micro state machines used by [`detect-it`][detectItRepo] to determine if a device is `mouseOnly`, `touchOnly`, or `hybrid`.\n\n*For more information on the `hover` and `any-hover` media queries, please see the [W3C Media Queries Level 4 specification][w3cSpecLatest]. For information on browser compatibility, please see [Can I Use matchMedia][canIUseMatchMedia].*\n\n\n### `detectHover` micro state machine\n```javascript\nconst detectHover = {\n  // mutually exclusive (only one will be true)\n  hover: boolean,\n  none: boolean,\n\n  // not mutually exclusive\n  anyHover: boolean,\n  anyNone: boolean,\n\n  // re-run all the detection tests and update state\n  update() {...},\n}\n```\n\n### Installing `detect-hover`\n```terminal\n$ npm install detect-hover\n```\n\n### Using `detect-hover`\n```javascript\nimport detectHover from 'detect-hover';\n```\n```javascript\n// using the state\ndetectHover.hover === true; // primary pointing system can hover\ndetectHover.none === true; // primary pointing system can’t hover, or there is no pointing system\n\n/*\n * identical to the hover media feature, but they correspond to the\n * union of capabilities of all the pointing devices available to the user -\n * more than one of their values can be true, if different pointing devices have\n * different characteristics\n */\ndetectHover.anyHover === true;\ndetectHover.anyNone === true;\n\n\n// updating the state - most apps won't need to use this at all\ndetectHover.update();\n```\n\n```javascript\n/*\n * note that in the case of a legacy computer and browser, one that\n * doesn't support detect-hover's detection tests, the default state will be:\n */\nconst detectHover = {\n  hover: undefined,\n  none: undefined,\n  anyHover: undefined,\n  anyNone: undefined,\n}\n```\n\nNote that the `update()` function is run once at the time of import to set the object's initial state, and generally doesn't need to be run again. If it doesn't have access to the `window` or the browser doesn't support the `matchMedia()` function (all modern browser do), then the state will be `undefined` (`detect-hover` will not throw an error). If `detect-hover` doesn't have access to the `window` at the time of import, you will have to call the `update()` function manually at a later time to update its state.\n\nNote that the hover on-demand value was removed from the [July 6th 2016 W3C Media Queries Level 4][w3cSpec7-6-2016] draft specification, but was included in the [previous draft (January 26th 2016)][w3cSpec1-26-2016] of the spec. Any device that registers as having hover on-demand capabilities will show up as hover `none` in `detectHover`'s state. As a side note, hover on-demand is pretty much useless for practical purposes, and Android touch only devices register that they can hover on-demand, which is achieved via a long press - I view this as a feature that is a bug.\n\n### Part of the [`detect-it`][detectItRepo] family\n- [`detect-it`][detectItRepo]\n  - **`detect-hover`**\n  - [`detect-pointer`][detectPointerRepo]\n  - [`detect-touch-events`][detectTouchEventsRepo]\n  - [`detect-passive-events`][detectPassiveEventsRepo]\n\n\n<!-- links -->\n[liveDetectionTest]: https://detect-it.rafgraph.dev/#detect-hover\n[w3cSpecLatest]: https://www.w3.org/TR/mediaqueries-4/#hover\n[w3cSpec7-6-2016]: https://www.w3.org/TR/2016/WD-mediaqueries-4-20160706/#hover\n[w3cSpec1-26-2016]: https://www.w3.org/TR/2016/WD-mediaqueries-4-20160126/#hover\n[canIUseMatchMedia]: https://caniuse.com/#feat=matchmedia\n[detectItRepo]: https://github.com/rafgraph/detect-it\n[detectPointerRepo]: https://github.com/rafgraph/detect-pointer\n[detectTouchEventsRepo]: https://github.com/rafgraph/detect-touch-events\n[detectPassiveEventsRepo]: https://github.com/rafgraph/detect-passive-events\n","maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"time":{"modified":"2022-06-15T01:55:58.946Z","created":"2016-07-06T03:16:43.771Z","0.1.0":"2016-07-06T03:16:43.771Z","0.1.1":"2016-07-08T04:13:48.651Z","0.2.0":"2016-07-19T19:33:19.613Z","1.0.0":"2016-07-21T22:50:04.085Z","1.0.1":"2017-02-24T19:26:44.905Z","1.0.2":"2017-09-25T18:39:58.680Z","1.0.3":"2020-09-10T17:41:40.262Z"},"homepage":"https://github.com/rafgraph/detect-hover#readme","keywords":["detect","hover","any-hover","media query"],"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-hover.git"},"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"bugs":{"url":"https://github.com/rafgraph/detect-hover/issues"},"license":"MIT","readmeFilename":"README.md"}