{"_id":"vue-history-state","_rev":"27-056a8ef6d76f9489f477f60f6526742e","name":"vue-history-state","dist-tags":{"latest":"0.14.0","next":"0.14.0-5"},"versions":{"0.7.0":{"name":"vue-history-state","version":"0.7.0","description":"History State Module for Vue3 and Nuxt3","main":"lib/index.js","types":"types/index.d.ts","scripts":{"build":"tsc --build --clean && tsc --build","version.major":"standard-version --release-as major","version.minor":"standard-version --release-as minor","version.patch":"standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@tsconfig/recommended":"^1.0.1","@types/lz-string":"^1.3.34","@vue/test-utils":"^2.0.2","standard-version":"^9.5.0","typescript":"^4.8.3","vue":"^3.2.39","vue-router":"^4.1.5"},"dependencies":{"lz-string":"^1.4.4","tslib":"^2.4.0"},"gitHead":"713232d94d68345302c23fe3e45b3ec2d9caf76b","_id":"vue-history-state@0.7.0","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-4XrKi09W0by241MFHahB1melziK/u7oUoycsUPIKyAGGgTi9gILekV33N6N6tfYI2lIXrn3BBOJRoFxs41ut4A==","shasum":"826cbca87d97c40a023112bb2fc1d7d51f254ef0","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.7.0.tgz","fileCount":18,"unpackedSize":59921,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMyTtPUeQGdI7Md+LoZKA7eNrGMCqPp9PdoJ/KGNlAawIhALL+4L1yq2tDoQfNZ2piIiLsultX8cYvPIkwwoc0mTi+"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNby7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqA0g//c/XPKwA8OIql/pljKHu60skkSGtJLC9B27CHf5GOaP031JaP\r\ncM57sS375E5WrkLyWPjWNqIUcm2mV6+GlOhh/wra3yLXDGem8HiY43qjnat+\r\nNhC0GzdtocU+IFoW54PajWMvLUljXpF2YzbJWzlTTtP3MBO+8Phfyfh/mwoy\r\nfbE9i0EVKfMcQ43elKiUsYL3sgfBzB9iI9azRdpS/cCwXNCt++fjxFFc6xu+\r\nUxpX4T22MZ3BnEU1QnWDrneoO1GQi5w38eJ0Ph2ly0ADnHVSP6BQ2qSoMtl1\r\nKjIGvps7q4g0AFQ9fMzBo+AABoEdb/3R/1bhSjsmFJzM06qFbHGBhups/v0p\r\nW/bTuz2rY2/IPAgRs7+3MkPpRawaX6qvizF6l86m31oo62iAN9LN8k3cJd/r\r\nfJXkuG1F7OlwbFBidj+gWDyCE9RYfjikIfVcxWOwqnTMlKwzzPBAPkeEoaKx\r\nxaN2Ycs2pJFLoM58QCxwPD/QTuIP2ex6H9csbPy/gu7VV8erLjAdFDboKY0n\r\nxnHqVZWpHKjsKRSDQzXfkO0th+HQmJKFCwJ6Ukat6XL5ZRkWhtMY3/Pwi6Em\r\nBD3Xq7C1YnRiypjo4qesulfcGKZ9cqauI+Cs9eRFpc03pu6PGLiJatPnySM5\r\nfzYllj+H/C+xkKh1KTVI+G0Qt0FGdNZUGCM=\r\n=rs0G\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.7.0_1664466106810_0.7520537991314671"},"_hasShrinkwrap":false},"0.7.1":{"name":"vue-history-state","version":"0.7.1","description":"History State Module for Vue3 and Nuxt3","main":"lib/index.js","types":"types/index.d.ts","scripts":{"build":"tsc --build --clean && tsc --build","version.major":"standard-version --release-as major","version.minor":"standard-version --release-as minor","version.patch":"standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@tsconfig/recommended":"^1.0.1","@types/lz-string":"^1.3.34","@vue/test-utils":"^2.0.2","standard-version":"^9.5.0","typescript":"^4.8.3","vue":"^3.2.39","vue-router":"^4.1.5"},"dependencies":{"lz-string":"^1.4.4","tslib":"^2.4.0"},"gitHead":"30e54d8dd4e2035dc52a92ea920ebcdbee75dc55","_id":"vue-history-state@0.7.1","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-0lcE0nzMbEJmcPG5djO91/oUhqGYOTpJ+lgE2N2ISNAPxgbFjOvCBrdeJqhxhQOEcms2PagiymrjDlWD9BRohA==","shasum":"2b0058c0b27bef8d7ab04f2aa75f4c137ca4a913","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.7.1.tgz","fileCount":18,"unpackedSize":59254,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID0Hi/Yc/aK6p7DgV026u4lv+F91GcVXqO3uhwN98laVAiBQgm7SwXV3axyNrbhnHey7DCYvdwubM1HrnweHBMJs8A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjO2u5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmroBQ/5ADFnKYTMCvof9pYyqQs0UTSeh76LmWn31rjovUKnKzuVm33O\r\nF38glkEXPEXpDUeUwydFDghDhVdI2YP9oDMItIYGlOjj/XdBY9Kj0dctxGd9\r\n8Nsvbpn3rwoj8h0vPB276eMi+ZV9yw3vqDUx+qlHEXOAl3iqow32tgMDWFTM\r\nvgKGWnQ+mClydmaqZX5sYuFu5tdbbq54RQkGi4/fW3THwN6ysSPP2L33nbpq\r\nKq9A822bKlXxbg/rjM/wkalfgnXtujATH+tAalMwDzDzm1i/rFb3W2fNB2hF\r\nBpaHBNzQv8lC/mhiV9Rqez9gF07sKkv3ERVL8Q/KUk9t0HpPHBfOX5YBi1CQ\r\nA7HVO2mqxHmeftrJAXGDpB0nT/o/QpJ63M5ECvOKs/4EFTJNYIroyeYAflxQ\r\n791uh5/khOFlsAFPnrtRNsbIiTR/Uvtg0+ttYSU1hNGI32muk9Ap9I5EjGdy\r\naJM8qfBXOr/hjoMe5MjD0dUlXw2qMNA9Gj4/c2tu+q0Xy2WZARRI5Vktz+2l\r\nP8gvfrg0uwX+3jtZB51YN8i1fy0PkAKau/JfANJXsiBdewDlUIdSW2Ly3DgG\r\n4KvVTByac5otdCow6uBd3qDUn7k4Wr0ewHRAi6QNI1Hmfsan2XPx5+rSPooE\r\nAZTtppRxEckM/tA/2pMOoqwhT9qhFUqMmMg=\r\n=q1Pq\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.7.1_1664838584969_0.932520075636107"},"_hasShrinkwrap":false},"0.7.2":{"name":"vue-history-state","version":"0.7.2","description":"History State Module for Vue3 and Nuxt3","main":"lib/index.js","types":"types/index.d.ts","scripts":{"build":"tsc --build --clean && tsc --build","test":"jest --config jest.config.json","lint":"eslint","version.major":"standard-version --release-as major","version.minor":"standard-version --release-as minor","version.patch":"standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@tsconfig/recommended":"^1.0.1","@types/jest":"^29.1.2","@types/lz-string":"^1.3.34","@typescript-eslint/eslint-plugin":"^5.39.0","@typescript-eslint/parser":"^5.39.0","@vue/test-utils":"^2.0.2","eslint":"^8.24.0","jest":"^29.1.2","standard-version":"^9.5.0","ts-jest":"^29.0.3","typescript":"^4.8.4","vue":"^3.2.39","vue-router":"^4.1.5"},"dependencies":{"lz-string":"^1.4.4","tslib":"^2.4.0"},"gitHead":"0f2e6b3a4bb7375368a0b2fd767c48fcd49b9eb1","_id":"vue-history-state@0.7.2","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-qH0v/EJh6bOhIbfw9bLg6GQ8eGql+qvPkiQDifuEe5aCGK16TyOXjyXW4c8AOMDovACycoHKLNrlfr2AyJQi/g==","shasum":"2fbe57acd77dd09b580d0f53b467857b6f9bfd21","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.7.2.tgz","fileCount":22,"unpackedSize":61548,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOb7p3Cg0gcEWkP4DxzPaDhGt2un+C4lAPJfng6vwzNAIgGP0m1NLnZ6tGKDWETXdxaJW9maUePJFLtK9jvc8BSy4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQDnVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJ0xAAn3jFcLUrn5as5R7/wh2ktrnFC6cmG6QeAfq4oCGGXs9kNgpv\r\nwbbD69QlxJ2KobJFEvhQXAR6HGBgIb6b3qSayXYV8TUGbS36dtGorM8olGXx\r\nWolk0RZ4JxAMpeDm2+Fs7BZX8F85vR8M/yVOVGMha5DwaEfv/SYmfUajA2tM\r\n18Dj+hkjpbW8M0gvkqoNrsuNYlMJcOgf5yo6BvvWzimJqG2/DPREWzpp4un6\r\nrqZekB2jv/xZXiXUXsU7HVZv308fJtsUv78yVKi2O/6iOBnwCf6camNrlUn9\r\nDvK0soe+ysDYZ4KxGWvl18FuBB2ASVr2VSYy/ojkUgtpzm5iabFHGgGkSExu\r\ncERxtT7HmaME7hzn+CGplsNOqa/XhweC6/kv3n0w1Fr6sAWQxiw7/h/MWMQX\r\nc66N0dHZZjcktgZxl1pqqqFIkpHI06uBq+fugbSsqQ8lHVFn+bOVuCuzm7ow\r\nnYxSYcrEM9AINYW5YFAjvKetL8Wu7MavYOuPAZoL3isjlIQg0d6QCsBY8uiO\r\ncAiLNVeGJ1CBM0+h2Wt5ecpbsmPQnKNm7zxsUoh1xfPgiQF2wemSJdxwHERw\r\nxJOkmbcZ1v3GHIkq2xyE5hol4G9e1pbJDB8SgcbpcOvUiH/Juf98spRbddi0\r\ngbxRFgjrUPB4Q8fmhI8K7l0NF8HeptkOHvA=\r\n=Hby9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.7.2_1665153492924_0.286422424110814"},"_hasShrinkwrap":false},"0.7.3":{"name":"vue-history-state","version":"0.7.3","description":"History State Module for Vue3 and Nuxt3","main":"lib/index.js","types":"types/index.d.ts","scripts":{"build":"tsc --build --clean && tsc --build","test":"jest --config jest.config.json","lint":"eslint","version.major":"standard-version --release-as major","version.minor":"standard-version --release-as minor","version.patch":"standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@tsconfig/recommended":"^1.0.1","@types/jest":"^29.1.2","@types/lz-string":"^1.3.34","@typescript-eslint/eslint-plugin":"^5.39.0","@typescript-eslint/parser":"^5.39.0","@vue/test-utils":"^2.0.2","eslint":"^8.24.0","jest":"^29.1.2","standard-version":"^9.5.0","ts-jest":"^29.0.3","typescript":"^4.8.4","vue":"^3.2.39","vue-router":"^4.1.5"},"dependencies":{"lz-string":"^1.4.4","tslib":"^2.4.0"},"gitHead":"01f35368d883aed6d608d855dad618a614f5b74b","_id":"vue-history-state@0.7.3","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-6hxQ4dX1daMh8LZvDDkYs60yd1hCXVcWXIgeIJvncnwC+6bFFlUMjRn86IhcIO6O2cpCCPLh2IXcRM1WKOw8UA==","shasum":"db34a484b741ebf3bea51384f92b2c033e6fb034","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.7.3.tgz","fileCount":26,"unpackedSize":83553,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIWPjtaGWLPWuXrygZ4rKTjLHdvJsc8BEImE76rA26tgIhAKPuVnsl6CiDU54M/Q0XBEWccTWEgSMZB+FBjfiwcxNL"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQEChACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrTvg/5AMmE5/QUS6THFFYOFGcDkhADhK4pgNgXFZkCBKwNn5uWD3N+\r\nlck1yy8oNIWWm9/YdrQcMEjZ2+lattko+qUGJIJbbtH9j0qmXEmoDrOXsk5Q\r\nGKMftVRvz1oCu+h4pxQdNXPxtIUoZVE6a7ixt/dMh+N+p9LAINgjs7EjcfEx\r\n+X8eeVmNL/+rhObnV/XLm/kp6h9RN69jA1yOEA7fWJnwAQf8Kv+k8EJ9zlf3\r\nN0ALu2lkGe34mNYVrpdXxHTkeWMmWqngGiL8ELbeMOhKVB7wST4kGJAPDxNv\r\nsBqvPJyEc0ckJUD5zfOqb3suIHg9ahgyUp6zXbV5UCZTrHYxNwEIMXWd4VdJ\r\nVFN0npusm02wgo1AhmvYmdvafC8ryM81FJ9ZW+rAQf65aQm6ABeU2x3D8NMq\r\nteencWE/V8NBoxLmyQCPPWLIkU7R7QtVEPgGXW2tZQtpVFgBXZjpMB02Ldcy\r\nJwWGb3JDxqzviUKPE3qFfFJ8ryBso8U9d1KymfjEfXxadtpEwFvj9GRlKyX0\r\nSZDW823oWxUOL8gaoVxoVXc7sh3EYSsrKoR71jZiVTKoreaLQPaSQZ/23Fh/\r\n8BYSov6M8ztDMGn4beOFz4E0u+QYGmvVWauK7oTPJ9+38Ftb79jGJJpyW2Hv\r\n+Cm1gUpzRqjJIuddFjjEdWHJMXolJGQIUPI=\r\n=7Dg8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.7.3_1665155233685_0.55404043555385"},"_hasShrinkwrap":false},"0.7.4":{"name":"vue-history-state","version":"0.7.4","description":"History State Module for Vue3 and Nuxt3","main":"lib/index.js","types":"types/index.d.ts","scripts":{"build":"tsc --build --clean && tsc --build","test":"jest --config jest.config.json","lint":"eslint","version.major":"standard-version --release-as major","version.minor":"standard-version --release-as minor","version.patch":"standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@tsconfig/recommended":"^1.0.1","@types/jest":"^29.1.2","@types/lz-string":"^1.3.34","@typescript-eslint/eslint-plugin":"^5.39.0","@typescript-eslint/parser":"^5.39.0","@vue/test-utils":"^2.0.2","eslint":"^8.24.0","jest":"^29.1.2","standard-version":"^9.5.0","ts-jest":"^29.0.3","typescript":"^4.8.4","vue":"^3.2.39","vue-router":"^4.1.5"},"dependencies":{"lz-string":"^1.4.4","tslib":"^2.4.0"},"gitHead":"bd726a5f0c69a4918ae69daaed0534ac8900293c","_id":"vue-history-state@0.7.4","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-tD8oY+zkp/TdzNoGX3Jos/doNpisFK4/GidD3Ye7+GGE4PZk9OMfzceQrt/rDzhgsXVLZgIS9vfthMJYAPoWxw==","shasum":"eda3351443560bc2703681754545cb6bb5763224","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.7.4.tgz","fileCount":26,"unpackedSize":85874,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHXurV+FZ9gba0iqxFO9I4yhzvzwvVrpsk74b+MV/wNzAiAXN0LQ82aG7HeMPcc+YFQkC0XBj+JmauRWGaIo2W9tyQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRfj8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1PxAAjAQmV8I/N0mOChTin1p9W3WMWIRrI1z1SqDQ5nUSK2DY6TLF\r\nfK2v49c/OyCpB+jUvaxt8ZEhOeisbnEUPpHhOPTsk4Tn4QMIgmmFfuY4wNiO\r\n7orhwnJgcOHDtDYbQrv8nF+imsh/v2bL0n4gkzQ7vzv8uKmv0f7gXCrfDTZQ\r\n6F+6dkCParxzdcBuKcqcn9MStDCz8ttbmmOehK5gslNBh9sEVbhDLtu5ZtWG\r\nYPSLOWJy07x9Hy3MHxXa7hlwTc89c0JR0jnZT/mpF7ywNdQVHKsXGMbG3qxY\r\n8xWw2SfA+FCvVvR9pmaIxvf/BbBEILd3DQGCW3scEcNaOv7vS+PojMrWIfWY\r\n5Y1CUGNIghy1iTRSS8553IwgoSlx0K/dHijcEZakMmkVgOjJefLyMjHfxPd1\r\n+5bzZWeJvvx40yYJwFHmSto/0VlzsDGzYGWv2uhEXNie7kTxhD+8OBsnKJ7a\r\nB2QVCEZZVScGDWZ4fciwRb3T1w4XB5kktj9NopRbmJmA8iq3IMesbR9WwYty\r\nzzl72+KSkrzaNwDkmDJ6CZtikLMYIzSWZC6mEoVKi1ibpf1tLklvMzydrtvJ\r\n6/fsl15hRHp1/+CczQAW/YEgTMCYlJ7TqmnEZheyIMaUHvNALt18MBOp9dMv\r\n57IjjBb0TIkffDTClfE/7HNIC7sv+jQLzBw=\r\n=Tdtr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.7.4_1665530107817_0.5206002411255972"},"_hasShrinkwrap":false},"0.8.0":{"name":"vue-history-state","version":"0.8.0","description":"History State Module for Vue3 and Nuxt3","main":"lib/index.js","types":"types/index.d.ts","scripts":{"build":"tsc --build --clean && tsc --build","test":"jest --config jest.config.json","lint":"eslint","version.major":"standard-version --release-as major","version.minor":"standard-version --release-as minor","version.patch":"standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@tsconfig/recommended":"^1.0.1","@types/jest":"^29.1.2","@types/lz-string":"^1.3.34","@typescript-eslint/eslint-plugin":"^5.39.0","@typescript-eslint/parser":"^5.39.0","@vue/test-utils":"^2.0.2","eslint":"^8.24.0","jest":"^29.1.2","standard-version":"^9.5.0","ts-jest":"^29.0.3","typescript":"^4.8.4","vue":"^3.2.39","vue-router":"^4.1.5"},"dependencies":{"lz-string":"^1.4.4","tslib":"^2.4.0"},"gitHead":"f2029dcf0838c740b9f1f13623d452e09873b5b0","_id":"vue-history-state@0.8.0","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-3q1q1cNzavOBH/e78tl+sxRq8XscZLnHWg57oOGnGWvcLK3SNNkKod67WwNrQcmOH1rVcHeLu94JB137+wITpg==","shasum":"999afe63878efb511b70d5182d55b58d049b15b6","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.8.0.tgz","fileCount":26,"unpackedSize":87609,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDilRtrIPfi5Blc1NaB8AWYb/4vyNqmnoyDw9bgD/OfAIgEBeL52BpOYZgW/ffM3x7ZXRT/dmp57KFTzSV+kp7Cc4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRt21ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptbQ//azqWFpIWYd62fQnzUS357rKpzuv776WD6WR9YM53lecG5oOa\r\nAKUXykxMf/vZbiwtPihAs7WtMX9H4+G5KBtWzt76YlDj/DkZLmmCCJrjpk6E\r\nb3wbc5b4BNy1438orA3xEUNspCt1djg07VJw4vVTwG/W00EoTS8iF+gNtPU4\r\nDzs8DMxzcXuHBGPeqiti/4eomzzR2xj7CaymTlbjXOtYJ4lqNcLz7thEYVO6\r\nzyqn/zAjDEkgGvZG/4lXqNKi27mBiYSvifcwKQ+Ggqg3b5901zGIX0haQuuJ\r\nmykltNfvuQQUBgcshGkVom4q5sgIjZmbHieGrdlXor0zzoDSqFv7PU3ISmMT\r\nH+0GiVD3reVxMLeGdxAeXm2gk3Lj+J6Ldag5zLOYsPp/sibO1WISwX8Crshm\r\nykhTL7YcTAmRNzy89ZwQJjdLWPG9jLpWJ2+9JGjjYsZQfMQYJhW16942/Tam\r\nIqJhhWWRwWGsHz7ZuhzgBzeXsywhpoLEpHFkmdS1ykV1nuoWuc0wkvluhjog\r\n9eRzApsRJvlqmY/sGE6QRDXWhq+Af5WKJXJ9AAGnmUS416zk575+kdLwoH5r\r\nTPkWtSogfAxwjJKsOKpBp61LFmMu7FFuI4XQCj+QgcliYLgrG4tegu4VUIRD\r\nUncqXJvZNxtUy6P4hiN80UiC5WOhks/asO0=\r\n=bf+Z\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.8.0_1665588661397_0.348407597151809"},"_hasShrinkwrap":false},"0.9.0":{"name":"vue-history-state","version":"0.9.0","description":"History State Module for Vue3 and Nuxt3","main":"lib/index.js","types":"types/index.d.ts","scripts":{"build":"tsc --build --clean && tsc --build","test":"jest --config jest.config.json","lint":"eslint","version.major":"standard-version --release-as major","version.minor":"standard-version --release-as minor","version.patch":"standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@tsconfig/recommended":"^1.0.1","@types/jest":"^29.1.2","@types/lz-string":"^1.3.34","@typescript-eslint/eslint-plugin":"^5.39.0","@typescript-eslint/parser":"^5.39.0","@vue/test-utils":"^2.0.2","eslint":"^8.24.0","jest":"^29.1.2","standard-version":"^9.5.0","ts-jest":"^29.0.3","typescript":"^4.8.4","vue":"^3.2.39","vue-router":"^4.1.5"},"dependencies":{"lz-string":"^1.4.4","tslib":"^2.4.0"},"gitHead":"d742aa8c7d72c274a0e99cf163124c06bdb59200","_id":"vue-history-state@0.9.0","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-e4qWuCPhfwu1jyjgLYr35XKeyndnxFWX4wwGdTCVY9oF+eKMh885ONKq0vTAcXqz9K5KRlaHhxwQKDkiQrEvlw==","shasum":"f424d3ae982ed442419b9caea80a6fecdf1a141f","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.9.0.tgz","fileCount":26,"unpackedSize":88040,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHWvUaz0vcWnrG0zURuKtx9OcuRGzSNcN+y9B0vBTh2RAiAOQ4xZrUiJWvMX2fDYafpu2h7SyfaAWCIdi774BDj4kA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjS2oIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpOQQ//fUw1eQFToNjINJWrLiK4wwixtJK3vDEKJ1vmQLaXDsZPJuef\r\np2sH7O9gubUFopznd5ccaniK+hWa1kRKmD5glOlBn9yKmzilYxtt554vaPZG\r\nmr9GrIfeyhfmx05D2nNX+AXqgQ9E/UHHwtO4H28t2MfubEd1eNdyURhnYUR6\r\nyWlAaLwaC/wM0PKod/tEjFN+XRA+6m0CD2psKWMa9q+2efOXU4P0BaTnOkUS\r\nVENvS7+BY7ljNpAtn0gOJfD5pli90LhMgv6wh+jRoQcg7GOxV2ZNi4hJ/5c1\r\nHpdenUSoY8ky8dKFodyDC3BDVBMifL3uOlnCRLvRtvp0kA+OAghjmnJhT21H\r\nC9X6iKR1sUBZ+zeUWIYx3VjQWLolbHWrj6FHrjWfVNiDNuUiXnWMXZLdS4Qu\r\naQuxn6RDSrh2o2auhCbpIPCU34Bldj2FbZH+yOtJZrsAPx/YefZB6UJa4v+k\r\nn56+pOQ4L1Bl7BRdpLwiCD0pOEQNiTmRvaX5bkN76d0ph22iytqvRP4A7nvf\r\nrb66STG+OMeMH7HiFyp+cDd0MeRh60HEGaoRzSwJwbjgnwrQhxkY9goJ+NeE\r\nlk2CLE0WLUZ4yMI/diaDekV8ZT8YyOMRcX2g3yFHEXAZ0OuubNRuNvJnIZwW\r\nHucY9OvZDDFVHZP4+QRzsT9+A2SGf9Sv3AU=\r\n=Juol\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.9.0_1665886728212_0.21396192085361587"},"_hasShrinkwrap":false},"0.10.0":{"name":"vue-history-state","version":"0.10.0","description":"History State Module for Vue3 and Nuxt3","main":"lib/index.js","types":"types/index.d.ts","scripts":{"build":"tsc --build --clean && tsc --build","test":"jest --config jest.config.json","lint":"eslint","version.major":"standard-version --release-as major","version.minor":"standard-version --release-as minor","version.patch":"standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@tsconfig/recommended":"^1.0.1","@types/jest":"^29.1.2","@types/lz-string":"^1.3.34","@typescript-eslint/eslint-plugin":"^5.39.0","@typescript-eslint/parser":"^5.39.0","@vue/test-utils":"^2.0.2","eslint":"^8.24.0","jest":"^29.1.2","standard-version":"^9.5.0","ts-jest":"^29.0.3","typescript":"^4.8.4","vue":"^3.2.39","vue-router":"^4.1.5"},"dependencies":{"lz-string":"^1.4.4","tslib":"^2.4.0"},"gitHead":"7181950ef5a8860ee549533e62864fc3c84ad3ab","_id":"vue-history-state@0.10.0","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-AbK+aUtmgT3UtnbalAy677z6XY6pHAKVqsmgimt26J5wB8a8ow8rLxVHO+7RyFISJAaCYTxdq0tC7x5d1yhCvw==","shasum":"42ef2f769fbb50440e77497c1fab74be93acaad5","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.10.0.tgz","fileCount":29,"unpackedSize":103428,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICyUYMtmgJx0MeI2fS7GjQQKmUvpb0hihh5ZuOVhsIAUAiEAqtGShtdheGQvKvsPuAjomW+U5zfP6R5VgctuY/I4zXc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWSbnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrO+g//axaszkvW3XKD+OGaHE8pJFp+MgHH7KAM5uspIVbPr9aADI9J\r\n7loYwERw8dShQpBDc4rD6+wlczwmbBqIhqhEgusaC2MHqbqAcATcN6ZIOsdN\r\nhB18BbTvZCVm6Z5DDqKD1uJ/Ln+CFTjWh3wFJr7rk1RYZI/M2UFIMsrCZZdE\r\nsdKi4yUfXTdt1gYZUQRZpKGhm85RvIA/UDxTZBmzl9X6vc1NSqSLFaFt0LkN\r\na8DDeAk0RVk2H2dvgi5wAn5MpwMh3rwNksKxsGWgV9SR3oEdd6Qj3yaDR2YO\r\nlRnue0g7G3xhIfOyosURDVbxyYjCs6DC/ug62kkWTim72z/VEaV//Hu9Nw30\r\nEEfwq3lOTdTN+XGN126b93g55/LL0pvo+2VP/5gF1KU3sys0FyQ/XJwQmikC\r\nmM4KzhF25MEkkw9nKOwxcmk3+DjWbiGTV+/SdiWfZXML5C/Xi/fpkMJqG7T5\r\nUcGeXPEhTL58u2gXyY/l9/4pkut63DEI7rfzrWTC9jjBjsHPi3vaGNcRClZp\r\nK8tLjTV2w5e5LXBpSZhxL4QGGIjLGWJZy0pkqiiv3oQUSrWC01jfHNhd4gXm\r\nG9G7zHqnYQ5FCywLP2PY3DtXoLL195Jf3sDVivLbaochM8CzXjEel4pADzf3\r\nho/QSVvB7r4+3YxABfTACDRd2ZTPlkx5i0U=\r\n=4yEW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.10.0_1666787047647_0.5366793356115658"},"_hasShrinkwrap":false},"0.11.0":{"name":"vue-history-state","version":"0.11.0","description":"History State Module for Vue3 and Nuxt3","main":"lib/index.js","types":"types/index.d.ts","scripts":{"build":"tsc --build --clean && tsc --build","test":"jest --config jest.config.json","lint":"eslint","version.major":"standard-version --release-as major","version.minor":"standard-version --release-as minor","version.patch":"standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@tsconfig/recommended":"^1.0.1","@types/jest":"^29.1.2","@types/lz-string":"^1.3.34","@typescript-eslint/eslint-plugin":"^5.39.0","@typescript-eslint/parser":"^5.39.0","@vue/test-utils":"^2.0.2","eslint":"^8.24.0","jest":"^29.1.2","standard-version":"^9.5.0","ts-jest":"^29.0.3","typescript":"^4.8.4","vue":"^3.2.39","vue-router":"^4.1.5"},"dependencies":{"lz-string":"^1.4.4","tslib":"^2.4.0"},"gitHead":"faa82ee20a5f7403506260f5a96f986e9f2be370","_id":"vue-history-state@0.11.0","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-RDjRrIUsSqnoOyVrjg92rLGWCVLM54b2/5SPfqnX2oJIPr5Z5Z/MBWHdI4BLroJh3fW9cve5fX04mGKZfw09ag==","shasum":"18b19ec0bdfeb1c34f4e7b979b41bad5c85c2efb","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.11.0.tgz","fileCount":29,"unpackedSize":104333,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDipqyLXzQ2cgslTBKidR+qeh52YxL+byhKTrhirrlHEwIgDANPy0KPxuJIzpKrDEIEOA1yVIa9hpeJdBzjbX+5XK8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW+VXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+4hAAgM3PkGtIC3GnGCsGnjxknz7dTct/ReL9CKSdAfytQhQTB8/N\r\nEtUmoAFFmaRlDglCIpJog5odJKNxXFMTp8XV93sKa+25lDI4r6xJOYUvaB0u\r\noEesydyCYryT7kaksC+C5URIywJn23WHlyVT1XjJ3B9ZS0Kd1M43dPIzvzyh\r\n2guhYqoH57rQ5mKWVvx1YoCV8yeZghWnkvJI3LD7DDYNi+rZAQSOywUeNDzL\r\nq2AQWa52RiFiJtAEx6fkcWw9kKYRSCQ7mPkDr6bigWDNulNkAroqY3zvztW4\r\ngezjUNHSWajHd3qL9Rbsz7MlcKSPDwGxVz/W8KgYkx8igVdlVwXO0mgiYM+K\r\n4Ww5cEPaUh6z2sOUsFZMG0zPKY+HzJugyj9UgyGqnHhWYponCD+cfFCQpKd4\r\n51N5K/NBqRUWGY95r2B6937fJ34nsKm3l28wCU5Ey0Qy0TYiKstGNwnAXVqd\r\nCJ0KmB/Llb9RInhQdLbrQwcLzlB5fkb/bVADED2D7+UaGMqm1kbG6cBd8y98\r\nI79ST42ov3i9u09DbuCdGs2EtUjFdf5cZIXbvZqscn0HodMASKaL9ynhNSUL\r\npE4iNf9GuCpyfQYDGnN+RzZ9IjUSLRlDTmgg31173kSeANkilM+QFjCrv921\r\noFJeaaeCEY8ZMhQvhGzzKx5dI9mKtKpFtp4=\r\n=U9Ol\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.11.0_1666966871632_0.8658819617412272"},"_hasShrinkwrap":false},"0.12.0-alpha.0":{"name":"vue-history-state","version":"0.12.0-alpha.0","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest --config vite.config.ts","lint":"eslint","version.major":"npm run build && standard-version --release-as major","version.major.alpha":"npm run build && standard-version --release-as major --prerelease alpha","version.minor":"npm run build && standard-version --release-as minor","version.minor.alpha":"npm run build && standard-version --release-as minor --prerelease alpha","version.patch":"npm run build && standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish","release.alpha":"git push --follow-tags origin main && npm publish --tag alpha"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@tsconfig/recommended":"^1.0.2","@typescript-eslint/eslint-plugin":"^5.53.0","@typescript-eslint/parser":"^5.53.0","@types/lz-string":"^1.3.34","eslint":"^8.34.0","standard-version":"^9.5.0","typescript":"^4.9.5","vitest":"^0.29.1","vue":"^3.2.47","vue-router":"^4.1.6"},"dependencies":{"lz-string":"^1.4.4","tslib":"^2.5.0"},"readme":"# Vue History State Plugin\n\nHistory state plugin for Vue 3 and Nuxt 3\n\n[![npm version](https://badge.fury.io/js/vue-history-state.svg)](https://badge.fury.io/js/vue-history-state)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nVue History State Plugin is usefull for restoring state when users press \"Back\" or \"Foward\".\n\nThis plugin is a new version of [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state) \nported to work with Vue 3 and Nuxt 3.\n\n## Features\n\n- Restore a last state when going forward or back.\n- Restore a state when reloading.\n- Restore a last state when going forward or back after reloading.\n\n## Supported Vuersion\n\n- Vue 3.x + Vue-Router 4.x\n- Nuxt 3.x\n\nIf you want to work with Nuxt 2, you need to use [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state).\n\n## Install\n\nUsing npm:\n\n```\nnpm install vue-history-state\n```\n\n## Setup\n\n### Vue 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\n...\n\napp.use(HistoryStatePlugin, {\n  /* optional options */\n})\n```\n\n### Nuxt 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\nexport default defineNuxtPlugin(app => {\n  app.vueApp.use(HistoryStatePlugin, {\n    /* optional options */\n  })\n})\n```\n\n### Options\n\n#### maxHistoryLength\n\nSets the maximum length of hisotries that can hold data.\n\nWhen this option is not set, it depends on a max history length of a browser.\n\n*Default:* undefined\n\n#### overrideDefaultScrollBehavior\n\nIndicates whether this module override a default scroll behavior of the router.\n\nIf you set this option to true, it manages a scroll behavior by using own saved position.\n\n*Default:* true\n\n#### scrollingElements\n\nIndicates to which element the overrode behavior is applied.\n\nIf you set this option to a selecter, it applies the scrolling to the selector, in addition to the window.\n\n*Default:* undefined\n\n## Usage\n\n### Reactivity API\n\nIf you want to backup data, you have to define a *onBackupState* lifecycle method.\n\n```javascript\nimport { useHistoryState, onBackupState } from 'vue-history-state'\n\nconst historyState = useHistoryState()\n\n// Restore data\nconst data = reactive(historyState.data || { key: \"value\" })\n\n// Fetch or restore data\nconst { data } = useAsyncData(() => $fetch('/api/data'), {\n    default: () => (historyState.data || { key: 'value' }),\n    immediate: !historyState.data,\n    server: false,\n})\n\n// Backup data\nonBackupState(() => data)\n```\n\n### Options API\n\nIf you want to backup data, you have to define a *backupData* lifecycle method.\n\n```javascript\nexport default {\n  // Restore data\n  data() {\n    return this.$historyState.data || { key: \"value\" }\n  }\n  // Backup data\n  backupData() {\n    return this.$data\n  }\n}\n```\n\n## API\n\n### HistoryState\n\n#### action\n\nA action type that caused a navigation.\n\n- navigate: When a new page is navigated.\n- reload: When a page is reloaded.\n- push: When a history.push is called.\n- back: When a back navigation is occurred.\n- forward: When a forward navigation is occurred.\n\nBy default this method returns basically 'navigate' on server. \nBut many browsers send cache-control='maxage=0' when reloading.\nIt heuristically returns 'reload' then.\n\n#### visited\n\nIf the action is back, forward or reload, this property returns true.\n#### page: number\n\nA current page number (an integer beginning with 0).\n\nThis method always returns 0 on server.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\nThis method always returns undefined on server.\n\n#### length: number\n\nA history length.\n\nThis method cannot be used on server.\n\n#### getItem(page): HistoryItem?\n\nYou can get a location and data of the specified page number.\n\nIf you set 'overrideDefaultScrollBehavior' option to true, the item has scrollPositions property.\n\nThis method cannot use on server.\n\n#### getItems(): HistoryItem[]\n\nYou can get a list of item.\n\nThis method cannot be used on server.\n\n#### findBackPage(location): number?\n\nYou can get a page number of the first matched history, \nsearching backward in the continuous same site starting at the current page.\nIf a history state is not found or is not in the continuous same site, this method will return undefined.\n\nIf the partial option sets true, it matches any subset of the location.\n\nThis method cannot be used on server.\n\n```javascript\nconst page = historyState.findBackPage({\n    path: '/test'\n    // hash: ...\n    // query: ...\n    // name: ...\n    // params: ...\n    // partial: true (default: false)\n})\nif (page != null) {\n    historyState.getItem(page).data = undefined\n\n    // go back to the page in site.\n    const router = useRouter()\n    router.go(page - historyState.page)\n}\n```\n\n### HistoryItem\n\n#### location: { path?, name?, params?, query?, hash? }\n\nA location of this saved page.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\n#### scrollPositions: object\n\nA saved scroll positions. A root window is obtained with 'window' key, the others by the selector.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Hidekatsu Izuno (hidekatsu.izuno@gmail.com)\n","readmeFilename":"README.md","gitHead":"3ac2cc298f14a21407063d3667499d1634f8234d","_id":"vue-history-state@0.12.0-alpha.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-cEU0pdaNGO/RIEBOYQjaNdMS61VEfICyxSDqNAVlPAqyoA0gwmkKoTuV2Lmow0IuWgIZO1fYCLSEyHyXdf83Zg==","shasum":"39db47cccea356f54e0933d9733edbd49cad673c","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.12.0-alpha.0.tgz","fileCount":48,"unpackedSize":174301,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuweiHc2TODxOq1p+WaVTFwiTv83RUwvLf5FgL9Y3qjAIhAKMxidgEaDx0ExoSVbE2c/9oLeXdPiN4XL8SwLHAmiOc"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/JMUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoETRAAogGnzRvncxosSomixnqK3Q/3RxvuxF3m7OAjQpyeuc8dhhfe\r\n9xTQxNMElyQ7wuercT/K6ZLaywIRaBVypL+dJXmvJE6OzrJt/gzjQKG9brNS\r\noKwgSJt4N9eXD13umrbWG2fji/OGda1myhLdGl5BGoU8pkXLmJPcouCYeqpK\r\nOKOMlo5wd2wg2/dNuKvcII7NhZgSMcqKBB2lhNkdeAq4yII+fGaoOf/unjD9\r\nITD5W/FfdqpG1VbJH9L5kXMxXAPMzEB3suhnjlUrHJT3sDmaH+7dKedVYpE0\r\noDD4URl+KglDr9FOZ9KSgNMdjHNZmE95ER5KiGkrVQ988SelpYMs/1fQukfz\r\nitMrcfVCIv2izcWrMoSbhEHZDrOiiaha9NrOqSsOJEkCblGGe1O3nV2Zu6Fx\r\nRTbsV+IGy4ulzuk5fnvUU4Ep9Xn2EcRkId5DukCI5/r+QwneVDPxkVcdjd4G\r\ns+Q+cQklWKAWNV/6YV6G7RMifhaNU1rUM47V+DYIHDmZwSJ7vUqU4/B2jFRL\r\n4t75EewlZE7Zxh0ocaNQ2dLckVUm/ab0w/FqVkZYmdh++Awym+3LF6uuDFNi\r\nYPSZ4K3iindONoU6EYxu5IHK1N6/7a6qnoPwo/R6FAFSRKwzEP07IQ0IS1oO\r\nx1FhrKZCWt7ct8ha39aFvM7aZwzRBfncSCs=\r\n=AQdk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.12.0-alpha.0_1677497107905_0.5520253746404764"},"_hasShrinkwrap":false},"0.12.0":{"name":"vue-history-state","version":"0.12.0","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest --config vite.config.ts","lint":"eslint","version.major":"npm run build && standard-version --release-as major","version.major.alpha":"npm run build && standard-version --release-as major --prerelease alpha","version.minor":"npm run build && standard-version --release-as minor","version.minor.alpha":"npm run build && standard-version --release-as minor --prerelease alpha","version.patch":"npm run build && standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish","release.alpha":"git push --follow-tags origin main && npm publish --tag alpha"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@tsconfig/recommended":"^1.0.2","@typescript-eslint/eslint-plugin":"^5.53.0","@typescript-eslint/parser":"^5.53.0","@types/lz-string":"^1.3.34","eslint":"^8.34.0","standard-version":"^9.5.0","typescript":"^4.9.5","vitest":"^0.29.1","vue":"^3.2.47","vue-router":"^4.1.6"},"dependencies":{"lz-string":"^1.4.4","tslib":"^2.5.0"},"gitHead":"011b0478fbc0446d5230fe6a2bd28c87b8533f14","_id":"vue-history-state@0.12.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-DiX+c4KYrXiY2QWK8Fai4nqPtlNofPOICiZ/WciFU+zurRmcpRngRic84xdzJZztlYHLZJa2PK6js2kfJS7xhA==","shasum":"b7c03e989f7f6a37a3394d32030727ae72dec2dd","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.12.0.tgz","fileCount":48,"unpackedSize":174418,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEkaZ52fkDV4mOkE+0jnj16bQ1lSFigpUz7iHY9F+VPrAiBIfHtnxcTr7omLThS2hScbuewW2KbY4C2pfV5J9NJ9Yw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/NIAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmockBAAlcIvOd5P9NMfSmAtgJ9h0yp19yHJFcHokWAWgGI1w6bdvE5Z\r\n/Sk3pDoI1cZI4zWqV9nfCpe6+2HPsGXYqLjxbsdNHbqRtbHXbOVJ6zAe6YT4\r\n61qRbgVvBs++S7pOqErsMt+2+NZtyusmDtYnZwufnLZv2UPX5wCotBAlD3az\r\nJgBsa6Cbo0fmi8xy5GkmjGA5JsNz3dLuj1N7+/nCJQForPeFPFplkz3bHCpD\r\np0+6YY//Qn0DtgIwXY5TFuuzvYYDgz9qwcwUgKnSl3/+tHhMY5X9+E/epLHD\r\n2RZMEqAZ1ul1Z6pjqC0nXJYF1X6/4B1HbV3zK0tOcEOry7GUbZGpUqt8UhUf\r\n3A/mZMTofwNynr7davudw6Jj4SfBinJ34s3lUCu8uClUsz5JfVLOqlm96lOb\r\nCpZJEf8i9BgKDFvE/o7pRK+iYCZ3LoXi7868Ax3sWSkYzwgpJvs1p84d0VnI\r\n6mPhRLyTRT1VRJrPE34+D/+dQWaPNVe2ckFXZiYgEDFF3QkokGFvvnZWF+wt\r\nusF8T3tLDYhxAYHUUOP62Z8O8VEV0N+EKV8xuHL/l6ghtAt7PAoDy5lCqw2w\r\nGs6iWFs+4cfv9UGjEGKj+rhN+pv8gUhx1bZIrRTi7YfPUtyWsY9EKHntp9fO\r\nZm+XWz38SPCw3dMJXa/5qqjcGgomRHwd5D0=\r\n=lPGn\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.12.0_1677513216592_0.28475858070189397"},"_hasShrinkwrap":false},"0.13.0-alpha.0":{"name":"vue-history-state","version":"0.13.0-alpha.0","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest --config vite.config.ts","lint":"eslint","version.major":"npm run build && standard-version --release-as major","version.major.alpha":"npm run build && standard-version --release-as major --prerelease alpha","version.minor":"npm run build && standard-version --release-as minor","version.minor.alpha":"npm run build && standard-version --release-as minor --prerelease alpha","version.patch":"npm run build && standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish","release.alpha":"git push --follow-tags origin main && npm publish --tag alpha"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt.d.ts","default":"./module/nuxt.js"},"require":{"types":"./lib/nuxt.d.ts","default":"./lib/nuxt.js"},"default":"./lib/nuxt.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@nuxt/kit":"^3.3.1","@tsconfig/recommended":"^1.0.2","@types/lz-string":"^1.5.0","@typescript-eslint/eslint-plugin":"^5.55.0","@typescript-eslint/parser":"^5.55.0","eslint":"^8.36.0","standard-version":"^9.5.0","typescript":"^4.9.5","vitest":"^0.29.2","vue":"^3.2.47","vue-router":"^4.1.6"},"dependencies":{"lz-string":"^1.5.0","tslib":"^2.5.0"},"readme":"# Vue History State Plugin\n\nHistory state plugin for Vue 3 and Nuxt 3\n\n[![npm version](https://badge.fury.io/js/vue-history-state.svg)](https://badge.fury.io/js/vue-history-state)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nVue History State Plugin is usefull for restoring state when users press \"Back\" or \"Foward\".\n\nThis plugin is a new version of [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state) \nported to work with Vue 3 and Nuxt 3.\n\n## Features\n\n- Restore a last state when going forward or back.\n- Restore a state when reloading.\n- Restore a last state when going forward or back after reloading.\n\n## Supported Vuersion\n\n- Vue 3.x + Vue-Router 4.x\n- Nuxt 3.x\n\nIf you want to work with Nuxt 2, you need to use [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state).\n\n## Install\n\nUsing npm:\n\n```\nnpm install vue-history-state\n```\n\n## Setup\n\n### Vue 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\n...\n\napp.use(HistoryStatePlugin, {\n  /* optional options */\n})\n```\n\n### Nuxt 3\n\n```javascript:nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: [\n    \"vue-history-state/nuxt\"\n  ],\n  historyState: {\n    /* optional options */\n  }\n})\n```\n\n### Options\n\n#### maxHistoryLength\n\nSets the maximum length of hisotries that can hold data.\n\nWhen this option is not set, it depends on a max history length of a browser.\n\n*Default:* undefined\n\n#### overrideDefaultScrollBehavior\n\nIndicates whether this module override a default scroll behavior of the router.\n\nIf you set this option to true, it manages a scroll behavior by using own saved position.\n\n*Default:* true\n\n#### scrollingElements\n\nIndicates to which element the overrode behavior is applied.\n\nIf you set this option to a selecter, it applies the scrolling to the selector, in addition to the window.\n\n*Default:* undefined\n\n## Usage\n\n### Reactivity API\n\nIf you want to backup data, you have to define a *onBackupState* lifecycle method.\n\n```javascript\nimport { useHistoryState, onBackupState } from 'vue-history-state'\n\nconst historyState = useHistoryState()\n\n// Restore data\nconst data = reactive(historyState.data || { key: \"value\" })\n\n// Fetch or restore data\nconst { data } = useAsyncData(() => $fetch('/api/data'), {\n    default: () => (historyState.data || { key: 'value' }),\n    immediate: !historyState.data,\n    server: false,\n})\n\n// Backup data\nonBackupState(() => data)\n```\n\n### Options API\n\nIf you want to backup data, you have to define a *backupData* lifecycle method.\n\n```javascript\nexport default {\n  // Restore data\n  data() {\n    return this.$historyState.data || { key: \"value\" }\n  }\n  // Backup data\n  backupData() {\n    return this.$data\n  }\n}\n```\n\n## API\n\n### HistoryState\n\n#### action\n\nA action type that caused a navigation.\n\n- navigate: When a new page is navigated.\n- reload: When a page is reloaded.\n- push: When a history.push is called.\n- back: When a back navigation is occurred.\n- forward: When a forward navigation is occurred.\n\nBy default this method returns basically 'navigate' on server. \nBut many browsers send cache-control='maxage=0' when reloading.\nIt heuristically returns 'reload' then.\n\n#### visited\n\nIf the action is back, forward or reload, this property returns true.\n#### page: number\n\nA current page number (an integer beginning with 0).\n\nThis method always returns 0 on server.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\nThis method always returns undefined on server.\n\n#### length: number\n\nA history length.\n\nThis method cannot be used on server.\n\n#### getItem(page): HistoryItem?\n\nYou can get a location and data of the specified page number.\n\nIf you set 'overrideDefaultScrollBehavior' option to true, the item has scrollPositions property.\n\nThis method cannot use on server.\n\n#### getItems(): HistoryItem[]\n\nYou can get a list of item.\n\nThis method cannot be used on server.\n\n#### findBackPage(location): number?\n\nYou can get a page number of the first matched history, \nsearching backward in the continuous same site starting at the current page.\nIf a history state is not found or is not in the continuous same site, this method will return undefined.\n\nIf the partial option sets true, it matches any subset of the location.\n\nThis method cannot be used on server.\n\n```javascript\nconst page = historyState.findBackPage({\n    path: '/test'\n    // hash: ...\n    // query: ...\n    // name: ...\n    // params: ...\n    // partial: true (default: false)\n})\nif (page != null) {\n    historyState.getItem(page).data = undefined\n\n    // go back to the page in site.\n    const router = useRouter()\n    router.go(page - historyState.page)\n}\n```\n\n### HistoryItem\n\n#### location: { path?, name?, params?, query?, hash? }\n\nA location of this saved page.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\n#### scrollPositions: object\n\nA saved scroll positions. A root window is obtained with 'window' key, the others by the selector.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Hidekatsu Izuno (hidekatsu.izuno@gmail.com)\n","readmeFilename":"README.md","gitHead":"8b8b2a704324c90dac558aa41d972d7a5588ed93","_id":"vue-history-state@0.13.0-alpha.0","_nodeVersion":"18.12.1","_npmVersion":"9.6.0","dist":{"integrity":"sha512-sak2iJQNw/+PS5M4db4nBzKFdfaUL3TGLwDNR6Qd25iaS+HDqY7+/C8FiH8QIpyAAoT0CpreZ2x3/0KTf4d6fA==","shasum":"8eea4765332755facb97b546a0ea912c536175a8","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.13.0-alpha.0.tgz","fileCount":57,"unpackedSize":178932,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXecuuWLQKw/ewdxzENKBUhaEFnl98bTqQsDgPskKOsAiBIQ6F1DPBPIYAkc7gKBlbg9l1dBg3UmNpz8le4PhqwCQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEj1bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrLvhAAhbU8Tw9DT7R460v35L63TpdYeqHyOrwFyXNNk1D+6wv3+5r4\r\nk0hlVUMu7eB6saa+RylKQ2UQFJQGFkISbl4aQwOuYPqbw8W6XgtUHKaSxT1i\r\nt1RYck0L67wsSQtI1XKoV0+vauylDHuTQY48aAegfRqXbBy98wblytxT++Mq\r\n3SnHxYo1tGYZ25wT19JYUmcj660+ygKt19peBuszHfF2BTm7x6GuNLGhZ1wW\r\nAeziFtvCex/oytjyezc6e1/zxQMpBaPFsxeonVrNQSTtRMk/iVAF+VVfRNHz\r\n4aMVe5ENneffL1V6sbl5B66FlhpgcIlD/veIAcFBfnQkSMOE4uUlu3AeUEqF\r\nhWoyYNPk2+KRwPft0I2OlY+LpqRw8s7AU+PWDRcaML/NrILjkxG8pFgJJCOf\r\n4942YKvVUiP2lhAch+wF0DgeAryr37DdPd5fg35UMltaOXiuO+Put+PJZi2k\r\nH+185GEM1jVMDJR3k4W/cLZIHXwiGWvH7hWVESJ5TufasBLORhPjV6lJtamn\r\nmczp5YGMlpy/xWz8WufCVNK0RemQk2zypACQCLNr/C3MJtBSRe0vM1Z8QvmR\r\nNCpm63NuAmbshYcGeqWozQPmTFUSkknq/rsnO21Nxmsp7qsj+IC0fhnymb2D\r\nBKeDAEi+1hnd0dZwECx2Vj2lBHkL15sgksY=\r\n=Fw39\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.13.0-alpha.0_1678916955567_0.2751487974935758"},"_hasShrinkwrap":false},"0.13.0-alpha.1":{"name":"vue-history-state","version":"0.13.0-alpha.1","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest --config vite.config.ts","lint":"eslint","version.major":"npm run build && standard-version --release-as major","version.major.alpha":"npm run build && standard-version --release-as major --prerelease alpha","version.minor":"npm run build && standard-version --release-as minor","version.minor.alpha":"npm run build && standard-version --release-as minor --prerelease alpha","version.patch":"npm run build && standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish","release.alpha":"git push --follow-tags origin main && npm publish --tag alpha"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@nuxt/kit":"^3.3.1","@tsconfig/recommended":"^1.0.2","@types/lz-string":"^1.5.0","@typescript-eslint/eslint-plugin":"^5.55.0","@typescript-eslint/parser":"^5.55.0","eslint":"^8.36.0","standard-version":"^9.5.0","typescript":"^4.9.5","vitest":"^0.29.3","vue":"^3.2.47","vue-router":"^4.1.6"},"dependencies":{"lz-string":"^1.5.0","tslib":"^2.5.0"},"readme":"# Vue History State Plugin\n\nHistory state plugin for Vue 3 and Nuxt 3\n\n[![npm version](https://badge.fury.io/js/vue-history-state.svg)](https://badge.fury.io/js/vue-history-state)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nVue History State Plugin is usefull for restoring state when users press \"Back\" or \"Foward\".\n\nThis plugin is a new version of [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state) \nported to work with Vue 3 and Nuxt 3.\n\n## Features\n\n- Restore a last state when going forward or back.\n- Restore a state when reloading.\n- Restore a last state when going forward or back after reloading.\n\n## Supported Vuersion\n\n- Vue 3.x + Vue-Router 4.x\n- Nuxt 3.x\n\nIf you want to work with Nuxt 2, you need to use [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state).\n\n## Install\n\nUsing npm:\n\n```\nnpm install vue-history-state\n```\n\n## Setup\n\n### Vue 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\n...\n\napp.use(HistoryStatePlugin, {\n  /* optional options */\n})\n```\n\n### Nuxt 3\n\n```javascript:nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: [\n    \"vue-history-state/nuxt\"\n  ],\n  historyState: {\n    /* optional options */\n  }\n})\n```\n\n### Options\n\n#### maxHistoryLength\n\nSets the maximum length of hisotries that can hold data.\n\nWhen this option is not set, it depends on a max history length of a browser.\n\n*Default:* undefined\n\n#### overrideDefaultScrollBehavior\n\nIndicates whether this module override a default scroll behavior of the router.\n\nIf you set this option to true, it manages a scroll behavior by using own saved position.\n\n*Default:* true\n\n#### scrollingElements\n\nIndicates to which element the overrode behavior is applied.\n\nIf you set this option to a selecter, it applies the scrolling to the selector, in addition to the window.\n\n*Default:* undefined\n\n## Usage\n\n### Reactivity API\n\nIf you want to backup data, you have to define a *onBackupState* lifecycle method.\n\n```javascript\nimport { useHistoryState, onBackupState } from 'vue-history-state'\n\nconst historyState = useHistoryState()\n\n// Restore data\nconst data = reactive(historyState.data || { key: \"value\" })\n\n// Fetch or restore data\nconst { data } = useAsyncData(() => $fetch('/api/data'), {\n    default: () => (historyState.data || { key: 'value' }),\n    immediate: !historyState.data,\n    server: false,\n})\n\n// Backup data\nonBackupState(() => data)\n```\n\n### Options API\n\nIf you want to backup data, you have to define a *backupData* lifecycle method.\n\n```javascript\nexport default {\n  // Restore data\n  data() {\n    return this.$historyState.data || { key: \"value\" }\n  }\n  // Backup data\n  backupData() {\n    return this.$data\n  }\n}\n```\n\n## API\n\n### HistoryState\n\n#### action\n\nA action type that caused a navigation.\n\n- navigate: When a new page is navigated.\n- reload: When a page is reloaded.\n- push: When a history.push is called.\n- back: When a back navigation is occurred.\n- forward: When a forward navigation is occurred.\n\nBy default this method returns basically 'navigate' on server. \nBut many browsers send cache-control='maxage=0' when reloading.\nIt heuristically returns 'reload' then.\n\n#### visited\n\nIf the action is back, forward or reload, this property returns true.\n#### page: number\n\nA current page number (an integer beginning with 0).\n\nThis method always returns 0 on server.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\nThis method always returns undefined on server.\n\n#### length: number\n\nA history length.\n\nThis method cannot be used on server.\n\n#### getItem(page): HistoryItem?\n\nYou can get a location and data of the specified page number.\n\nIf you set 'overrideDefaultScrollBehavior' option to true, the item has scrollPositions property.\n\nThis method cannot use on server.\n\n#### getItems(): HistoryItem[]\n\nYou can get a list of item.\n\nThis method cannot be used on server.\n\n#### findBackPage(location): number?\n\nYou can get a page number of the first matched history, \nsearching backward in the continuous same site starting at the current page.\nIf a history state is not found or is not in the continuous same site, this method will return undefined.\n\nIf the partial option sets true, it matches any subset of the location.\n\nThis method cannot be used on server.\n\n```javascript\nconst page = historyState.findBackPage({\n    path: '/test'\n    // hash: ...\n    // query: ...\n    // name: ...\n    // params: ...\n    // partial: true (default: false)\n})\nif (page != null) {\n    historyState.getItem(page).data = undefined\n\n    // go back to the page in site.\n    const router = useRouter()\n    router.go(page - historyState.page)\n}\n```\n\n### HistoryItem\n\n#### location: { path?, name?, params?, query?, hash? }\n\nA location of this saved page.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\n#### scrollPositions: object\n\nA saved scroll positions. A root window is obtained with 'window' key, the others by the selector.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Hidekatsu Izuno (hidekatsu.izuno@gmail.com)\n","readmeFilename":"README.md","gitHead":"c83ad2199791d8f7da3eee3cef95a97932f73f4b","_id":"vue-history-state@0.13.0-alpha.1","_nodeVersion":"18.12.1","_npmVersion":"9.6.0","dist":{"integrity":"sha512-wCiy56YrWAvBcaNQc3EPmyYkszq4kqUlnC14CcpcL/T4Rdh6KOFw3pN8c+2bqzjgKnj0JS/dZcCNQjboPZaVbg==","shasum":"ebd34cfbba4ea4073e4c21732f3dcbdb78ad4992","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.13.0-alpha.1.tgz","fileCount":57,"unpackedSize":180980,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcAwxKrkThHq1hVwkI8DVqv+9RWxWq6hNKwpHTVuwHsAIgDTBsY9sXb3e2bqJ9c+jOQJsvZiviIi4BE2OcYNgNh/s="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkE6I0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFSQ//dRVGF7mEokGsvXQLUsGJLkBfrx2fTjZ5wDzyGc4bQ33/IX+D\r\nkOKLphgZkggfzvfbiqEsEkF3mH+09msmYLTfFgmrSQOZ1iGrjkpeIBZUFBg1\r\nhD44SigQYr5aZ/7WzPFsLey6MYL/rrx0dY+a4IpdOPOW3j4NVoljbA/jGeIt\r\nWtdKaisvrLXwuQDGXlh4CRkoK+GtHH+W/MbUGUoAPN5g5limmoP+cGT9J3/o\r\njWUc7JYsGnSniWBNCN5lZ1NltIFrkJqjfZezKCbpl8DSHQb5Eu2O7fxGDz+b\r\njLYuh/FoG5W8sW+u06mmaFCAap5TOutI5L3j2k3GfBD5CVvROFniV+jcNBFy\r\n1kXwlnC1vMon9CRatotLD+NBrx/p/dFs4kXM0xtZrG67m0Anq74mWUuZjm/Z\r\n1K2CszFMj2mRF5x/7qDBBZfRLV8MQBAK17F1XiGBwRXxD/u73G8pha1Tq1Zu\r\naN4Bfb7FeRVBKjlG2qqLVc63wDz/GTbBX74ZkEDUj886xSPkpE4uPqLYlYXp\r\n3yuuc2cZNGbsscYFgiXjSeGb/a8o5C+V8oh8axAb5qF0o1WEWiuNpbw0PYZd\r\nrKAGmQiTGdrVU2gTGHXS+zvQ8NZ2COugGrsHMlhnnne1oZU7Ap3mbQa3ndy8\r\nFCl8dSLdtYpP61WSJJ9+kxTxqIsgmTVrPIE=\r\n=ZAxW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.13.0-alpha.1_1679008308690_0.015849928696215487"},"_hasShrinkwrap":false},"0.13.0-alpha.2":{"name":"vue-history-state","version":"0.13.0-alpha.2","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest --config vite.config.ts","lint":"eslint","version.major":"npm run build && standard-version --release-as major","version.major.alpha":"npm run build && standard-version --release-as major --prerelease alpha","version.minor":"npm run build && standard-version --release-as minor","version.minor.alpha":"npm run build && standard-version --release-as minor --prerelease alpha","version.patch":"npm run build && standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish","release.alpha":"git push --follow-tags origin main && npm publish --tag alpha"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@nuxt/kit":"^3.3.1","@tsconfig/recommended":"^1.0.2","@types/lz-string":"^1.5.0","@typescript-eslint/eslint-plugin":"^5.55.0","@typescript-eslint/parser":"^5.55.0","eslint":"^8.36.0","standard-version":"^9.5.0","typescript":"^4.9.5","vitest":"^0.29.3","vue":"^3.2.47","vue-router":"^4.1.6"},"dependencies":{"lz-string":"^1.5.0","tslib":"^2.5.0"},"readme":"# Vue History State Plugin\n\nHistory state plugin for Vue 3 and Nuxt 3\n\n[![npm version](https://badge.fury.io/js/vue-history-state.svg)](https://badge.fury.io/js/vue-history-state)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nVue History State Plugin is usefull for restoring state when users press \"Back\" or \"Foward\".\n\nThis plugin is a new version of [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state) \nported to work with Vue 3 and Nuxt 3.\n\n## Features\n\n- Restore a last state when going forward or back.\n- Restore a state when reloading.\n- Restore a last state when going forward or back after reloading.\n\n## Supported Vuersion\n\n- Vue 3.x + Vue-Router 4.x\n- Nuxt 3.x\n\nIf you want to work with Nuxt 2, you need to use [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state).\n\n## Install\n\nUsing npm:\n\n```\nnpm install vue-history-state\n```\n\n## Setup\n\n### Vue 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\n...\n\napp.use(HistoryStatePlugin, {\n  /* optional options */\n})\n```\n\n### Nuxt 3\n\n```javascript:nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: [\n    \"vue-history-state/nuxt\"\n  ],\n  historyState: {\n    /* optional options */\n  }\n})\n```\n\n### Options\n\n#### maxHistoryLength\n\nSets the maximum length of hisotries that can hold data.\n\nWhen this option is not set, it depends on a max history length of a browser.\n\n*Default:* undefined\n\n#### overrideDefaultScrollBehavior\n\nIndicates whether this module override a default scroll behavior of the router.\n\nIf you set this option to true, it manages a scroll behavior by using own saved position.\n\n*Default:* true\n\n#### scrollingElements\n\nIndicates to which element the overrode behavior is applied.\n\nIf you set this option to a selecter, it applies the scrolling to the selector, in addition to the window.\n\n*Default:* undefined\n\n## Usage\n\n### Reactivity API\n\nIf you want to backup data, you have to define a *onBackupState* lifecycle method.\n\n```javascript\nimport { useHistoryState, onBackupState } from 'vue-history-state'\n\nconst historyState = useHistoryState()\n\n// Restore data\nconst data = reactive(historyState.data || { key: \"value\" })\n\n// Fetch or restore data\nconst { data } = useAsyncData(() => $fetch('/api/data'), {\n    default: () => (historyState.data || { key: 'value' }),\n    immediate: !historyState.data,\n    server: false,\n})\n\n// Backup data\nonBackupState(() => data)\n```\n\n### Options API\n\nIf you want to backup data, you have to define a *backupData* lifecycle method.\n\n```javascript\nexport default {\n  // Restore data\n  data() {\n    return this.$historyState.data || { key: \"value\" }\n  }\n  // Backup data\n  backupData() {\n    return this.$data\n  }\n}\n```\n\n## API\n\n### HistoryState\n\n#### action\n\nA action type that caused a navigation.\n\n- navigate: When a new page is navigated.\n- reload: When a page is reloaded.\n- push: When a history.push is called.\n- back: When a back navigation is occurred.\n- forward: When a forward navigation is occurred.\n\nBy default this method returns basically 'navigate' on server. \nBut many browsers send cache-control='maxage=0' when reloading.\nIt heuristically returns 'reload' then.\n\n#### visited\n\nIf the action is back, forward or reload, this property returns true.\n#### page: number\n\nA current page number (an integer beginning with 0).\n\nThis method always returns 0 on server.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\nThis method always returns undefined on server.\n\n#### length: number\n\nA history length.\n\nThis method cannot be used on server.\n\n#### getItem(page): HistoryItem?\n\nYou can get a location and data of the specified page number.\n\nIf you set 'overrideDefaultScrollBehavior' option to true, the item has scrollPositions property.\n\nThis method cannot use on server.\n\n#### getItems(): HistoryItem[]\n\nYou can get a list of item.\n\nThis method cannot be used on server.\n\n#### findBackPage(location): number?\n\nYou can get a page number of the first matched history, \nsearching backward in the continuous same site starting at the current page.\nIf a history state is not found or is not in the continuous same site, this method will return undefined.\n\nIf the partial option sets true, it matches any subset of the location.\n\nThis method cannot be used on server.\n\n```javascript\nconst page = historyState.findBackPage({\n    path: '/test'\n    // hash: ...\n    // query: ...\n    // name: ...\n    // params: ...\n    // partial: true (default: false)\n})\nif (page != null) {\n    historyState.getItem(page).data = undefined\n\n    // go back to the page in site.\n    const router = useRouter()\n    router.go(page - historyState.page)\n}\n```\n\n### HistoryItem\n\n#### location: { path?, name?, params?, query?, hash? }\n\nA location of this saved page.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\n#### scrollPositions: object\n\nA saved scroll positions. A value is obtained by the selector.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Hidekatsu Izuno (hidekatsu.izuno@gmail.com)\n","readmeFilename":"README.md","gitHead":"3204d6b3efabba3f15ec09db13934ce6ad0ee532","_id":"vue-history-state@0.13.0-alpha.2","_nodeVersion":"18.12.1","_npmVersion":"9.6.0","dist":{"integrity":"sha512-frOdsQuOK04R29EiALrQcdfHZ3UUWRN8DyyQhUTGg3u58yD96mkSewIhJ2DdPN2HmnIcEb+sEvNb0ZGzNGVpMQ==","shasum":"2f641cee3a7e8b67578d87d8d7c893388c6ec004","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.13.0-alpha.2.tgz","fileCount":57,"unpackedSize":181034,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZ+MqpGeJlV0So6jMp3nYpZoIPI7Phv8WgJblyOcYLtAIgN//Y1PnXIPg43oFHVRi+zW1XAimi990z97rdwOnN0ZM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkE6ljACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5VQ//XSK+N5c4CwOkU+zCnSFH6YSbn0KYO8TTajebfo6Eb5GmcV9P\r\nt1L5Pv8epl3TqMTkYj+7LAJuqmUTySq04AoGWZbFgTO4IFSjrNzNiiVjBDkq\r\nwqMkBlPqIeZm/lrCHKxd2+6QZJHXxhBtnEHDUEE4lRJs3lTesr5dAUJLQLeX\r\nOUrKz7Lanb6Qu2XxYiwT+dNAV4CLTH0rCLMIlRUE3PhQ2FVRTwYdJij91PGk\r\nlCRamIP/9lzVmEr1vhZ5fezFzHj1Tv4ysCVLswn/La9L1DtNFvrwx5TzAWWm\r\nM53DvkfMgIkdgNfQsdP1p0ygDwFmok1dC3Tbj4dlBuEfGTN0oKqTc6CGB9kQ\r\n78Ojc3eXKtxtFKr9o77pboLWS1pn9Fo8OIzIJmNOGYIo12cCJB7sBDginB0o\r\npuOKDv4t7GeVMhzb3/TJmu/sFi8YWS242fmoaHDTZVy6JCDPw4GRDA2dcGG0\r\nzTqTu3ya078/nCevZzntWKwpYMijJQVzmKNevd8lZ0aPewOmwaUy0Prg0CcO\r\nS/OPuI+O40uI4LkKWQE8a0hI4d2HGCPDS0lj1dn9ZMhY7NOupEgVq6eB7ues\r\nrVPJFyLSLaHSGX+2763jRgi+sRH+1lt9CqmQNntVksa8hDN7MB0vhhaezELz\r\npRCLVj0MVSBju83tOhdptlUmBHEHAOmERR8=\r\n=DSYr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.13.0-alpha.2_1679010147527_0.07180954779551074"},"_hasShrinkwrap":false},"0.13.0":{"name":"vue-history-state","version":"0.13.0","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest --config vite.config.ts","lint":"eslint","version.major":"npm run build && standard-version --release-as major","version.major.alpha":"npm run build && standard-version --release-as major --prerelease alpha","version.minor":"npm run build && standard-version --release-as minor","version.minor.alpha":"npm run build && standard-version --release-as minor --prerelease alpha","version.patch":"npm run build && standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish","release.alpha":"git push --follow-tags origin main && npm publish --tag alpha"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@nuxt/kit":"^3.3.1","@tsconfig/recommended":"^1.0.2","@types/lz-string":"^1.5.0","@typescript-eslint/eslint-plugin":"^5.55.0","@typescript-eslint/parser":"^5.55.0","eslint":"^8.36.0","standard-version":"^9.5.0","typescript":"^4.9.5","vitest":"^0.29.3","vue":"^3.2.47","vue-router":"^4.1.6"},"dependencies":{"lz-string":"^1.5.0","tslib":"^2.5.0"},"gitHead":"549675c7e6742ae9156ee331f8d5ba8e454d41ec","_id":"vue-history-state@0.13.0","_nodeVersion":"18.12.1","_npmVersion":"9.6.0","dist":{"integrity":"sha512-r6W3eSLcVv+PwHRLUlA0BrFzG7yksOUhKtI0tBvvjcFIDd5ciLM3vRL8+QT9PunrXJ/6K3wZks+SadKnGDtIqQ==","shasum":"3b3bf4e45fd32a3172a0de584749d08529f78e8b","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.13.0.tgz","fileCount":57,"unpackedSize":181345,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB4UTYsXEUjAatHqV13Qg2aCYLgf6uaCICDSATuWiNRcAiAFFaIKUHiL5VmwLcahnDfG7pag8rZvzmTrjolPN28RaQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkFCpeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpX4xAAlHmsktNd2VLYgZaMs2G3TTdtAm96LtUvAs3xL2hwr9VP6j9S\r\nMnfAHdGvd+It4Azr5rgFY3dwC62ui7V5XR+wLg2Ic5UJW8+B9yq0qXbYpsxg\r\ncRvWHlindq1fPhe5YXFiHijsnFO0ZzQggaJNfz4rL1Oc1aWLwqSoDIIPMm87\r\n98SgzMfXw7Dvfw1BmAPlMl6vh2rlxHK7NRbdeK/REBiRII5XZcSEXy7fkMtY\r\ncEEocWG1IYynV3mYwCH1ZF6wqiDVMFnMgQAl6TE+qCAMkKu0rLEXwnJEx4IA\r\nrY8TRAZJR38OEsPXkHQzZQANS4AfUFuBuBnEuDkkbwdMgz8evoAXiCfYETyP\r\nvIZlM9I6hQJfWHexj85DRpk2iqDU6bN7OUU1Dartfb2YAhxugrfBTYe+vJSf\r\nwffzGtZSVv1blZvbsFTkC/cxEShI2FMqzs6TV6O7W/7cL5G0+/GieBTY4akL\r\nwQ5hRxcRkdNEJeG0pZ2CM9O3eZD3AvwTLf4sZfGmktcd/X1rHoZz3J4YBNOH\r\nfB2avmfrjoExc87yu0QGlc5KoRwKBxL7GiJtqBMJAk4SHaPpqOhYR8AYFp2R\r\nMt1kZM7Eo7cxfs7EHpgNmzs3JLonD5bI8BN3W0eLeHpX2DfvfbVXyi1okouz\r\neYPU2UJAZ2cP/v0ZuXcfKMCSFbCzRJ2zixQ=\r\n=3V/J\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.13.0_1679043166074_0.8285317034004498"},"_hasShrinkwrap":false},"0.13.1":{"name":"vue-history-state","version":"0.13.1","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest --config vite.config.ts","lint":"eslint","version.major":"npm run build && standard-version --release-as major","version.major.alpha":"npm run build && standard-version --release-as major --prerelease alpha","version.minor":"npm run build && standard-version --release-as minor","version.minor.alpha":"npm run build && standard-version --release-as minor --prerelease alpha","version.patch":"npm run build && standard-version --release-as patch","release":"git push --follow-tags origin main && npm publish","release.alpha":"git push --follow-tags origin main && npm publish --tag alpha"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"devDependencies":{"@nuxt/kit":"^3.3.1","@tsconfig/recommended":"^1.0.2","@types/lz-string":"^1.5.0","@typescript-eslint/eslint-plugin":"^5.55.0","@typescript-eslint/parser":"^5.55.0","eslint":"^8.36.0","standard-version":"^9.5.0","typescript":"^4.9.5","vitest":"^0.29.3","vue":"^3.2.47","vue-router":"^4.1.6"},"dependencies":{"lz-string":"^1.5.0","tslib":"^2.5.0"},"gitHead":"256a6d0c46e8ea57036c36c0569b7a7e6b85b4c7","_id":"vue-history-state@0.13.1","_nodeVersion":"18.12.1","_npmVersion":"9.6.0","dist":{"integrity":"sha512-689tsnFEdUCHOG7CxulDC9SfMNdXaubgiC5zhDVD0DqTVStVvGrZqPOEKTXBX98+aO40La7rApOVs33poODPPw==","shasum":"44af245935c284f1323e51b506d5d9c09f066d45","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.13.1.tgz","fileCount":57,"unpackedSize":181339,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJkprgNgaArfyccYvoeFw3lSj+Z+B+PMk0encoyF7q7wIgApPKgIxu7Gv8EY7Evl17bqXW0NSJ/Dj9/l9RBf8tHo8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkH+I6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKIg/+INHU87HYye3qKUdNEuuJ54SY2Gc822R2DOKpMOHDIfNJX6pe\r\nihTGSKjNyhdBxetwdWZSjRYr8+hj5KK7vMAAqUDRbOWcTJsX7ncAhVbHqNBx\r\ntD1qvAyFl999aw3ufS2756Qgfyi02ZF4ctsx4tB/ntKfzNSkq6/KUVB5RhV2\r\nDWxAZWAyalDSIGU2Wq08NQU6ees0qYImvgVPPwgCzmvZpnWYXpV8tEqIBqLE\r\nQwqn0mfIinhAkJTZfINKVauNDTpTlL2ITQ2RITGzZU/I9XL3jKzEugMe5n9w\r\nCnnwQ67DU5cODAJi7EgNJFArBHV07rLMNvWMraEjwe0GMl30BehrAFSuvxgF\r\n3y5PhI6l2VT7cmc4xs55RmV0nOCMTp/+Px7rk4Wzo2T2XazXm25xWB70Dcf1\r\nFj63QVNOxjqXcm87sjeSoqv4BAvbvFjgOMa3bUvmz4Obq4WOnaVb1kotQ5wl\r\no4+grHSWuuT34nPmYIpMIbbp53HiMJdzIMmco24faIalXCu1cbAdcIGKwCPc\r\nl+R3EkJZ7JCsO4I0Y1Gr0rKH0iT3SlNuBC7JZZdXz6QZrZOgnFHedirsY7oz\r\nbooBz+E7/NrnnUQl/Cc8t9NoF2Hv8ajJfr1T3rlKUQ1n8ryvylpr2x+79eUa\r\nNOABQufrjfj6cMQdvUnPBOZMGp8UDrSiVKU=\r\n=jH+y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.13.1_1679811130367_0.8391675156254281"},"_hasShrinkwrap":false},"0.13.2":{"name":"vue-history-state","version":"0.13.2","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest run --config vite.config.ts","lint":"eslint --ext js,ts .","lint:fix":"eslint --ext js,ts --fix","release":"np"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"engines":{"node":">=18.0.0"},"devDependencies":{"@nuxt/kit":"^3.6.5","@tsconfig/recommended":"^1.0.2","@typescript-eslint/eslint-plugin":"^6.4.0","@typescript-eslint/parser":"^6.4.0","eslint":"^8.47.0","np":"^8.0.4","typescript":"^5.1.6","vitest":"^0.34.2","vue":"^3.3.4","vue-router":"^4.2.4"},"dependencies":{"lz-string":"^1.5.0"},"gitHead":"532c174666f3e9071c4198e0bef0f94c92dbb525","_id":"vue-history-state@0.13.2","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-o/I55Lpl4+/Uubuqir3G5UTkK+jJtUeJb9KXfXkpSo1jjWW3Q1OqspvTTsdz9ja8inuHph7U3VWLylYPET6Ipw==","shasum":"3266835d26a94c011d56666a76dab539a9f937ad","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.13.2.tgz","fileCount":57,"unpackedSize":180896,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyg2MLVKhRARKy0yKoU76Z4gtBCnhBia+mnk6kuDim8gIhAP+MELfvMGLlwZpvdO/2pdNXZc87Jm6cNCOaS3VNO8UK"}]},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.13.2_1692623629789_0.656800072433698"},"_hasShrinkwrap":false},"0.14.0-0":{"name":"vue-history-state","version":"0.14.0-0","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest run --config vite.config.ts","lint":"eslint --ext js,ts .","lint:fix":"eslint --ext js,ts --fix","release":"np"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"engines":{"node":">=18.0.0"},"devDependencies":{"@nuxt/kit":"^3.6.5","@tsconfig/recommended":"^1.0.2","@typescript-eslint/eslint-plugin":"^6.4.0","@typescript-eslint/parser":"^6.4.0","eslint":"^8.47.0","np":"^8.0.4","typescript":"^5.1.6","vitest":"^0.34.2","vue":"^3.3.4","vue-router":"^4.2.4"},"dependencies":{"lz-string":"^1.5.0"},"readme":"# Vue History State Plugin\n\nHistory state plugin for Vue 3 and Nuxt 3\n\n[![npm version](https://badge.fury.io/js/vue-history-state.svg)](https://badge.fury.io/js/vue-history-state)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nVue History State Plugin is usefull for restoring state when users press \"Back\" or \"Foward\".\n\nThis plugin is a new version of [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state) \nported to work with Vue 3 and Nuxt 3.\n\n## Features\n\n- Restore a last state when going forward or back.\n- Restore a state when reloading.\n- Restore a last state when going forward or back after reloading.\n\n## Supported Vuersion\n\n- Vue 3.x + Vue-Router 4.x\n- Nuxt 3.x\n\nIf you want to work with Nuxt 2, you need to use [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state).\n\n## Install\n\nUsing npm:\n\n```\nnpm install vue-history-state\n```\n\n## Setup\n\n### Vue 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\n...\n\napp.use(HistoryStatePlugin, {\n  /* optional options */\n})\n```\n\n### Nuxt 3\n\n```javascript:nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: [\n    \"vue-history-state/nuxt\"\n  ],\n  historyState: {\n    /* optional options */\n  }\n})\n```\n\n### Options\n\n#### maxHistoryLength\n\nSets the maximum length of hisotries that can hold data.\n\nWhen this option is not set, it depends on a max history length of a browser.\n\n*Default:* undefined\n\n#### overrideDefaultScrollBehavior\n\nIndicates whether this module override a default scroll behavior of the router.\n\nIf you set this option to true, it manages a scroll behavior by using own saved position.\n\n*Default:* true\n\n#### scrollingElements\n\nIndicates to which element the overrode behavior is applied.\n\nIf you set this option to a selecter, it applies the scrolling to the selector, in addition to the window.\n\n*Default:* undefined\n\n## Usage\n\n### Reactivity API\n\nIf you want to backup data, you have to define a *onBackupState* lifecycle method.\n\n```javascript\nimport { useHistoryState, onBackupState } from 'vue-history-state'\n\nconst historyState = useHistoryState()\n\n// Restore data\nconst data = reactive(historyState.data || { key: \"value\" })\n\n// Fetch or restore data\nconst { data } = useAsyncData(() => $fetch('/api/data'), {\n    default: () => (historyState.data || { key: 'value' }),\n    immediate: !historyState.data,\n    server: false,\n})\n\n// Backup data\nonBackupState(() => data)\n```\n\n### Options API\n\nIf you want to backup data, you have to define a *backupData* lifecycle method.\n\n```javascript\nexport default {\n  // Restore data\n  data() {\n    return this.$historyState.data || { key: \"value\" }\n  }\n  // Backup data\n  backupData() {\n    return this.$data\n  }\n}\n```\n\n## API\n\n### HistoryState\n\n#### action\n\nA action type that caused a navigation.\n\n- navigate: When a new page is navigated.\n- reload: When a page is reloaded.\n- push: When a history.push is called.\n- back: When a back navigation is occurred.\n- forward: When a forward navigation is occurred.\n\nBy default this method returns basically 'navigate' on server. \nBut many browsers send cache-control='maxage=0' when reloading.\nIt heuristically returns 'reload' then.\n\n#### visited\n\nIf the action is back, forward or reload, this property returns true.\n#### page: number\n\nA current page number (an integer beginning with 0).\n\nThis method always returns 0 on server.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\nThis method always returns undefined on server.\n\n#### length: number\n\nA history length.\n\nThis method cannot be used on server.\n\n#### getItem(page): HistoryItem?\n\nYou can get a location and data of the specified page number.\n\nIf you set 'overrideDefaultScrollBehavior' option to true, the item has scrollPositions property.\n\nThis method cannot use on server.\n\n#### getItems(): HistoryItem[]\n\nYou can get a list of item.\n\nThis method cannot be used on server.\n\n#### findBackPage(location): number?\n\nYou can get a page number of the first matched history, \nsearching backward in the continuous same site starting at the current page.\nIf a history state is not found or is not in the continuous same site, this method will return undefined.\n\nIf the partial option sets true, it matches any subset of the location.\n\nThis method cannot be used on server.\n\n```javascript\nconst page = historyState.findBackPage({\n    path: '/test'\n    // hash: ...\n    // query: ...\n    // name: ...\n    // params: ...\n    // partial: true (default: false)\n})\nif (page != null) {\n    historyState.getItem(page).data = undefined\n\n    // go back to the page in site.\n    const router = useRouter()\n    router.go(page - historyState.page)\n}\n```\n\n### HistoryItem\n\n#### location: { path?, name?, params?, query?, hash? }\n\nA location of this saved page.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\n#### scrollPositions: object\n\nA saved scroll positions. A root window is obtained with 'window' key, the others by the selector.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Hidekatsu Izuno (hidekatsu.izuno@gmail.com)\n","readmeFilename":"README.md","gitHead":"fedf8c3c78f2180041416e323354dd5b1624649e","_id":"vue-history-state@0.14.0-0","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-GMCxHEy6uth/jTf9rBe8qwCRxLmnbzzIeaSJHPvfu9fKM80r17YJr3e4Md5Dk5PDQRSDc+23gllyVuhiGOgOlw==","shasum":"98b22062a117b3e9160f2bee6614101938bd04db","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.14.0-0.tgz","fileCount":57,"unpackedSize":181358,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZ10tDEUDPDFTjYk3E8AodIJlx0xO/HjUfm4BLMJqd6AIhAKMcHU2SeyW0p3IaxRKyVEgJppfTUqk2iYq+7yRfFjKB"}]},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.14.0-0_1693160745846_0.7560989667429325"},"_hasShrinkwrap":false},"0.14.0-1":{"name":"vue-history-state","version":"0.14.0-1","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest run --config vite.config.ts","lint":"eslint --ext js,ts .","lint:fix":"eslint --ext js,ts --fix","release":"np"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"engines":{"node":">=18.0.0"},"devDependencies":{"@nuxt/kit":"^3.6.5","@tsconfig/recommended":"^1.0.2","@typescript-eslint/eslint-plugin":"^6.4.0","@typescript-eslint/parser":"^6.4.0","eslint":"^8.47.0","np":"^8.0.4","typescript":"^5.1.6","vitest":"^0.34.2","vue":"^3.3.4","vue-router":"^4.2.4"},"dependencies":{"lz-string":"^1.5.0"},"readme":"# Vue History State Plugin\n\nHistory state plugin for Vue 3 and Nuxt 3\n\n[![npm version](https://badge.fury.io/js/vue-history-state.svg)](https://badge.fury.io/js/vue-history-state)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nVue History State Plugin is usefull for restoring state when users press \"Back\" or \"Foward\".\n\nThis plugin is a new version of [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state) \nported to work with Vue 3 and Nuxt 3.\n\n## Features\n\n- Restore a last state when going forward or back.\n- Restore a state when reloading.\n- Restore a last state when going forward or back after reloading.\n\n## Supported Vuersion\n\n- Vue 3.x + Vue-Router 4.x\n- Nuxt 3.x\n\nIf you want to work with Nuxt 2, you need to use [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state).\n\n## Install\n\nUsing npm:\n\n```\nnpm install vue-history-state\n```\n\n## Setup\n\n### Vue 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\n...\n\napp.use(HistoryStatePlugin, {\n  /* optional options */\n})\n```\n\n### Nuxt 3\n\n```javascript:nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: [\n    \"vue-history-state/nuxt\"\n  ],\n  historyState: {\n    /* optional options */\n  }\n})\n```\n\n### Options\n\n#### maxHistoryLength\n\nSets the maximum length of hisotries that can hold data.\n\nWhen this option is not set, it depends on a max history length of a browser.\n\n*Default:* undefined\n\n#### overrideDefaultScrollBehavior\n\nIndicates whether this module override a default scroll behavior of the router.\n\nIf you set this option to true, it manages a scroll behavior by using own saved position.\n\n*Default:* true\n\n#### scrollingElements\n\nIndicates to which element the overrode behavior is applied.\n\nIf you set this option to a selecter, it applies the scrolling to the selector, in addition to the window.\n\n*Default:* undefined\n\n## Usage\n\n### Reactivity API\n\nIf you want to backup data, you have to define a *onBackupState* lifecycle method.\n\n```javascript\nimport { useHistoryState, onBackupState } from 'vue-history-state'\n\nconst historyState = useHistoryState()\n\n// Restore data\nconst data = reactive(historyState.data || { key: \"value\" })\n\n// Fetch or restore data\nconst { data } = useAsyncData(() => $fetch('/api/data'), {\n    default: () => (historyState.data || { key: 'value' }),\n    immediate: !historyState.data,\n    server: false,\n})\n\n// Backup data\nonBackupState(() => data)\n```\n\n### Options API\n\nIf you want to backup data, you have to define a *backupData* lifecycle method.\n\n```javascript\nexport default {\n  // Restore data\n  data() {\n    return this.$historyState.data || { key: \"value\" }\n  }\n  // Backup data\n  backupData() {\n    return this.$data\n  }\n}\n```\n\n## API\n\n### HistoryState\n\n#### action\n\nA action type that caused a navigation.\n\n- navigate: When a new page is navigated.\n- reload: When a page is reloaded.\n- push: When a history.push is called.\n- back: When a back navigation is occurred.\n- forward: When a forward navigation is occurred.\n\nBy default this method returns basically 'navigate' on server. \nBut many browsers send cache-control='maxage=0' when reloading.\nIt heuristically returns 'reload' then.\n\n#### visited\n\nIf the action is back, forward or reload, this property returns true.\n#### page: number\n\nA current page number (an integer beginning with 0).\n\nThis method always returns 0 on server.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\nThis method always returns undefined on server.\n\n#### length: number\n\nA history length.\n\nThis method cannot be used on server.\n\n#### getItem(page): HistoryItem?\n\nYou can get a location and data of the specified page number.\n\nIf you set 'overrideDefaultScrollBehavior' option to true, the item has scrollPositions property.\n\nThis method cannot use on server.\n\n#### getItems(): HistoryItem[]\n\nYou can get a list of item.\n\nThis method cannot be used on server.\n\n#### findBackPage(location): number?\n\nYou can get a page number of the first matched history, \nsearching backward in the continuous same site starting at the current page.\nIf a history state is not found or is not in the continuous same site, this method will return undefined.\n\nIf the partial option sets true, it matches any subset of the location.\n\nThis method cannot be used on server.\n\n```javascript\nconst page = historyState.findBackPage({\n    path: '/test'\n    // hash: ...\n    // query: ...\n    // name: ...\n    // params: ...\n    // partial: true (default: false)\n})\nif (page != null) {\n    historyState.getItem(page).data = undefined\n\n    // go back to the page in site.\n    const router = useRouter()\n    router.go(page - historyState.page)\n}\n```\n\n### HistoryItem\n\n#### location: { path?, name?, params?, query?, hash? }\n\nA location of this saved page.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\n#### scrollPositions: object\n\nA saved scroll positions. A root window is obtained with 'window' key, the others by the selector.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Hidekatsu Izuno (hidekatsu.izuno@gmail.com)\n","readmeFilename":"README.md","gitHead":"42c4605b7dd69729dea591ecb91b3dca252d91b2","_id":"vue-history-state@0.14.0-1","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-R7nizdWmdNaTGMvUYJKEc9nBJ2VLMAVWRXRAfLE8K/W7njfQw8WAzTavi4VSOLR9Y8bNCXECWVl8+XFTGI/WYw==","shasum":"e7d89328d345b6676b1c177be287b751876c61e1","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.14.0-1.tgz","fileCount":57,"unpackedSize":183701,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZLYatu3TWrMq+bKAI50QprIaEFhRKDlECqbcrCE26dAiEAu6B5RIt/X2dXfPRS15l57VsRRe2ydP1kE4fJhySQ6NY="}]},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.14.0-1_1693180621716_0.9452168291732708"},"_hasShrinkwrap":false},"0.14.0-2":{"name":"vue-history-state","version":"0.14.0-2","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest run --config vite.config.ts","lint":"eslint --ext js,ts .","lint:fix":"eslint --ext js,ts --fix","prerelease":"npm run build","release":"np"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"engines":{"node":">=18.0.0"},"devDependencies":{"@nuxt/kit":"^3.7.0","@tsconfig/recommended":"^1.0.2","@typescript-eslint/eslint-plugin":"^6.4.1","@typescript-eslint/parser":"^6.4.1","eslint":"^8.48.0","np":"^8.0.4","typescript":"^5.2.2","vitest":"^0.34.3","vue":"^3.3.4","vue-router":"^4.2.4"},"dependencies":{"lz-string":"^1.5.0"},"readme":"# Vue History State Plugin\n\nHistory state plugin for Vue 3 and Nuxt 3\n\n[![npm version](https://badge.fury.io/js/vue-history-state.svg)](https://badge.fury.io/js/vue-history-state)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nVue History State Plugin is usefull for restoring state when users press \"Back\" or \"Foward\".\n\nThis plugin is a new version of [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state) \nported to work with Vue 3 and Nuxt 3.\n\n## Features\n\n- Restore a last state when going forward or back.\n- Restore a state when reloading.\n- Restore a last state when going forward or back after reloading.\n\n## Supported Vuersion\n\n- Vue 3.x + Vue-Router 4.x\n- Nuxt 3.x\n\nIf you want to work with Nuxt 2, you need to use [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state).\n\n## Install\n\nUsing npm:\n\n```\nnpm install vue-history-state\n```\n\n## Setup\n\n### Vue 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\n...\n\napp.use(HistoryStatePlugin, {\n  /* optional options */\n})\n```\n\n### Nuxt 3\n\n```javascript:nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: [\n    \"vue-history-state/nuxt\"\n  ],\n  historyState: {\n    /* optional options */\n  }\n})\n```\n\n### Options\n\n#### maxHistoryLength\n\nSets the maximum length of hisotries that can hold data.\n\nWhen this option is not set, it depends on a max history length of a browser.\n\n*Default:* undefined\n\n#### overrideDefaultScrollBehavior\n\nIndicates whether this module override a default scroll behavior of the router.\n\nIf you set this option to true, it manages a scroll behavior by using own saved position.\n\n*Default:* true\n\n#### scrollingElements\n\nIndicates to which element the overrode behavior is applied.\n\nIf you set this option to a selecter, it applies the scrolling to the selector, in addition to the window.\n\n*Default:* undefined\n\n## Usage\n\n### Reactivity API\n\nIf you want to backup data, you have to define a *onBackupState* lifecycle method.\n\n```javascript\nimport { useHistoryState, onBackupState } from 'vue-history-state'\n\nconst historyState = useHistoryState()\n\n// Restore data\nconst data = reactive(historyState.data || { key: \"value\" })\n\n// Fetch or restore data\nconst { data } = useAsyncData(() => $fetch('/api/data'), {\n    default: () => (historyState.data || { key: 'value' }),\n    immediate: !historyState.data,\n    server: false,\n})\n\n// Backup data\nonBackupState(() => data)\n```\n\n### Options API\n\nIf you want to backup data, you have to define a *backupData* lifecycle method.\n\n```javascript\nexport default {\n  // Restore data\n  data() {\n    return this.$historyState.data || { key: \"value\" }\n  }\n  // Backup data\n  backupData() {\n    return this.$data\n  }\n}\n```\n\n## API\n\n### HistoryState\n\n#### action\n\nA action type that caused a navigation.\n\n- navigate: When a new page is navigated.\n- reload: When a page is reloaded.\n- push: When a history.push is called.\n- back: When a back navigation is occurred.\n- forward: When a forward navigation is occurred.\n\nBy default this method returns basically 'navigate' on server. \nBut many browsers send cache-control='maxage=0' when reloading.\nIt heuristically returns 'reload' then.\n\n#### visited\n\nIf the action is back, forward or reload, this property returns true.\n#### page: number\n\nA current page number (an integer beginning with 0).\n\nThis method always returns 0 on server.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\nThis method always returns undefined on server.\n\n#### length: number\n\nA history length.\n\nThis method cannot be used on server.\n\n#### getItem(page): HistoryItem?\n\nYou can get a location and data of the specified page number.\n\nIf you set 'overrideDefaultScrollBehavior' option to true, the item has scrollPositions property.\n\nThis method cannot use on server.\n\n#### getItems(): HistoryItem[]\n\nYou can get a list of item.\n\nThis method cannot be used on server.\n\n#### findBackPage(location): number?\n\nYou can get a page number of the first matched history, \nsearching backward in the continuous same site starting at the current page.\nIf a history state is not found or is not in the continuous same site, this method will return undefined.\n\nIf the partial option sets true, it matches any subset of the location.\n\nThis method cannot be used on server.\n\n```javascript\nconst page = historyState.findBackPage({\n    path: '/test'\n    // hash: ...\n    // query: ...\n    // name: ...\n    // params: ...\n    // partial: true (default: false)\n})\nif (page != null) {\n    historyState.getItem(page).data = undefined\n\n    // go back to the page in site.\n    const router = useRouter()\n    router.go(page - historyState.page)\n}\n```\n\n### HistoryItem\n\n#### location: { path?, name?, params?, query?, hash? }\n\nA location of this saved page.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\n#### scrollPositions: object\n\nA saved scroll positions. A root window is obtained with 'window' key, the others by the selector.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Hidekatsu Izuno (hidekatsu.izuno@gmail.com)\n","readmeFilename":"README.md","gitHead":"81bddbc0fae8e74bbf54a6f2a6189bead373e7b3","_id":"vue-history-state@0.14.0-2","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-Wox5Nuw6X8uRHkHW5SgZYyTyenWQSYX3niPOvCN+avvjRHuBbaDwcJAaQC3WZbw9iZapBD0ch/4Ky9acmZ8MWg==","shasum":"5fa0ff2ca0813e4d0094c66f820ba3fa064521ee","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.14.0-2.tgz","fileCount":57,"unpackedSize":188945,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFKpPomZV4snMA1ukX696h/4bp8VS8dcYK3iEYJXAnlYAiAZcaeqz/ELlA9exJP7Zk9G8d7soubhY90wbdDWHTbYRg=="}]},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.14.0-2_1693233062482_0.9113383985094363"},"_hasShrinkwrap":false},"0.14.0-3":{"name":"vue-history-state","version":"0.14.0-3","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest run --config vite.config.ts","lint":"eslint --ext js,ts .","lint:fix":"eslint --ext js,ts --fix","prerelease":"npm run build","release":"np"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"engines":{"node":">=18.0.0"},"devDependencies":{"@nuxt/kit":"^3.7.0","@tsconfig/recommended":"^1.0.2","@typescript-eslint/eslint-plugin":"^6.4.1","@typescript-eslint/parser":"^6.4.1","eslint":"^8.48.0","np":"^8.0.4","typescript":"^5.2.2","vitest":"^0.34.3","vue":"^3.3.4","vue-router":"^4.2.4"},"dependencies":{"lz-string":"^1.5.0"},"readme":"# Vue History State Plugin\n\nHistory state plugin for Vue 3 and Nuxt 3\n\n[![npm version](https://badge.fury.io/js/vue-history-state.svg)](https://badge.fury.io/js/vue-history-state)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nVue History State Plugin is usefull for restoring state when users press \"Back\" or \"Foward\".\n\nThis plugin is a new version of [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state) \nported to work with Vue 3 and Nuxt 3.\n\n## Features\n\n- Restore a last state when going forward or back.\n- Restore a state when reloading.\n- Restore a last state when going forward or back after reloading.\n\n## Supported Vuersion\n\n- Vue 3.x + Vue-Router 4.x\n- Nuxt 3.x\n\nIf you want to work with Nuxt 2, you need to use [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state).\n\n## Install\n\nUsing npm:\n\n```\nnpm install vue-history-state\n```\n\n## Setup\n\n### Vue 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\n...\n\napp.use(HistoryStatePlugin, {\n  /* optional options */\n})\n```\n\n### Nuxt 3\n\n```javascript:nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: [\n    \"vue-history-state/nuxt\"\n  ],\n  historyState: {\n    /* optional options */\n  }\n})\n```\n\n### Options\n\n#### maxHistoryLength\n\nSets the maximum length of hisotries that can hold data.\n\nWhen this option is not set, it depends on a max history length of a browser.\n\n*Default:* undefined\n\n#### overrideDefaultScrollBehavior\n\nIndicates whether this module override a default scroll behavior of the router.\n\nIf you set this option to true, it manages a scroll behavior by using own saved position.\n\n*Default:* true\n\n#### scrollingElements\n\nIndicates to which element the overrode behavior is applied.\n\nIf you set this option to a selecter, it applies the scrolling to the selector, in addition to the window.\n\n*Default:* undefined\n\n## Usage\n\n### Reactivity API\n\nIf you want to backup data, you have to define a *onBackupState* lifecycle method.\n\n```javascript\nimport { useHistoryState, onBackupState } from 'vue-history-state'\n\nconst historyState = useHistoryState()\n\n// Restore data\nconst data = reactive(historyState.data || { key: \"value\" })\n\n// Fetch or restore data\nconst { data } = useAsyncData(() => $fetch('/api/data'), {\n    default: () => (historyState.data || { key: 'value' }),\n    immediate: !historyState.data,\n    server: false,\n})\n\n// Backup data\nonBackupState(() => data)\n```\n\n### Options API\n\nIf you want to backup data, you have to define a *backupData* lifecycle method.\n\n```javascript\nexport default {\n  // Restore data\n  data() {\n    return this.$historyState.data || { key: \"value\" }\n  }\n  // Backup data\n  backupData() {\n    return this.$data\n  }\n}\n```\n\n## API\n\n### HistoryState\n\n#### action\n\nA action type that caused a navigation.\n\n- navigate: When a new page is navigated.\n- reload: When a page is reloaded.\n- push: When a history.push is called.\n- back: When a back navigation is occurred.\n- forward: When a forward navigation is occurred.\n\nBy default this method returns basically 'navigate' on server. \nBut many browsers send cache-control='maxage=0' when reloading.\nIt heuristically returns 'reload' then.\n\n#### visited\n\nIf the action is back, forward or reload, this property returns true.\n#### page: number\n\nA current page number (an integer beginning with 0).\n\nThis method always returns 0 on server.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\nThis method always returns undefined on server.\n\n#### length: number\n\nA history length.\n\nThis method cannot be used on server.\n\n#### getItem(page): HistoryItem?\n\nYou can get a location and data of the specified page number.\n\nIf you set 'overrideDefaultScrollBehavior' option to true, the item has scrollPositions property.\n\nThis method cannot use on server.\n\n#### getItems(): HistoryItem[]\n\nYou can get a list of item.\n\nThis method cannot be used on server.\n\n#### findBackPage(location): number?\n\nYou can get a page number of the first matched history, \nsearching backward in the continuous same site starting at the current page.\nIf a history state is not found or is not in the continuous same site, this method will return undefined.\n\nIf the partial option sets true, it matches any subset of the location.\n\nThis method cannot be used on server.\n\n```javascript\nconst page = historyState.findBackPage({\n    path: '/test'\n    // hash: ...\n    // query: ...\n    // name: ...\n    // params: ...\n    // partial: true (default: false)\n})\nif (page != null) {\n    historyState.getItem(page).data = undefined\n\n    // go back to the page in site.\n    const router = useRouter()\n    router.go(page - historyState.page)\n}\n```\n\n### HistoryItem\n\n#### location: { path?, name?, params?, query?, hash? }\n\nA location of this saved page.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\n#### scrollPositions: object\n\nA saved scroll positions. A root window is obtained with 'window' key, the others by the selector.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Hidekatsu Izuno (hidekatsu.izuno@gmail.com)\n","readmeFilename":"README.md","gitHead":"db13edc33614a6518d4ec43b4067c1029e34cc16","_id":"vue-history-state@0.14.0-3","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-3SPpku3mO0Y2yRdWCelNsd7a+P+GAZwKJSNTxGptNxyHyjC2VaO6fbAsgdlDREt86IxDCEwhK6Cwy4RTTzLXIw==","shasum":"4579f41e9f8a6413c6d0f399defdedfe803b2177","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.14.0-3.tgz","fileCount":57,"unpackedSize":189324,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDle8wFJve/kcDMOkOI5q8MUmEowB0hO/adbjomxZIj/AIgUXtJQh578EnWvU4C1oq8HEILjExBVrRGUdY5Z8EhxYQ="}]},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.14.0-3_1693266161207_0.10923185065966434"},"_hasShrinkwrap":false},"0.14.0-4":{"name":"vue-history-state","version":"0.14.0-4","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest run --config vite.config.ts","lint":"eslint --ext js,ts .","lint:fix":"eslint --ext js,ts --fix","prerelease":"npm run build","release":"np"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"engines":{"node":">=18.0.0"},"devDependencies":{"@nuxt/kit":"^3.7.0","@tsconfig/recommended":"^1.0.2","@typescript-eslint/eslint-plugin":"^6.4.1","@typescript-eslint/parser":"^6.4.1","eslint":"^8.48.0","np":"^8.0.4","typescript":"^5.2.2","vitest":"^0.34.3","vue":"^3.3.4","vue-router":"^4.2.4"},"dependencies":{"lz-string":"^1.5.0"},"readme":"# Vue History State Plugin\n\nHistory state plugin for Vue 3 and Nuxt 3\n\n[![npm version](https://badge.fury.io/js/vue-history-state.svg)](https://badge.fury.io/js/vue-history-state)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nVue History State Plugin is usefull for restoring state when users press \"Back\" or \"Foward\".\n\nThis plugin is a new version of [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state) \nported to work with Vue 3 and Nuxt 3.\n\n## Features\n\n- Restore a last state when going forward or back.\n- Restore a state when reloading.\n- Restore a last state when going forward or back after reloading.\n\n## Supported Vuersion\n\n- Vue 3.x + Vue-Router 4.x\n- Nuxt 3.x\n\nIf you want to work with Nuxt 2, you need to use [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state).\n\n## Install\n\nUsing npm:\n\n```\nnpm install vue-history-state\n```\n\n## Setup\n\n### Vue 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\n...\n\napp.use(HistoryStatePlugin, {\n  /* optional options */\n})\n```\n\n### Nuxt 3\n\n```javascript:nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: [\n    \"vue-history-state/nuxt\"\n  ],\n  historyState: {\n    /* optional options */\n  }\n})\n```\n\n### Options\n\n#### maxHistoryLength\n\nSets the maximum length of hisotries that can hold data.\n\nWhen this option is not set, it depends on a max history length of a browser.\n\n*Default:* undefined\n\n#### overrideDefaultScrollBehavior\n\nIndicates whether this module override a default scroll behavior of the router.\n\nIf you set this option to true, it manages a scroll behavior by using own saved position.\n\n*Default:* true\n\n#### scrollingElements\n\nIndicates to which element the overrode behavior is applied.\n\nIf you set this option to a selecter, it applies the scrolling to the selector, in addition to the window.\n\n*Default:* undefined\n\n## Usage\n\n### Reactivity API\n\nIf you want to backup data, you have to define a *onBackupState* lifecycle method.\n\n```javascript\nimport { useHistoryState, onBackupState } from 'vue-history-state'\n\nconst historyState = useHistoryState()\n\n// Restore data\nconst data = reactive(historyState.data || { key: \"value\" })\n\n// Fetch or restore data\nconst { data } = useAsyncData(() => $fetch('/api/data'), {\n    default: () => (historyState.data || { key: 'value' }),\n    immediate: !historyState.data,\n    server: false,\n})\n\n// Backup data\nonBackupState(() => data)\n```\n\n#### Experimental: New reactivity API\n\n```javascript\n// Backup and restore data\nconst data = useRestorableData({\n  key: \"value\"\n})\n\n// Backup, restore and fetch data\nconst data = await useRestorableAsyncData({\n  key: \"value\"\n}, async ({ visited, info }) => {\n  if (!visited && info?.mode === \"update\") {\n    return $fetch(\"rest@example.com\")\n  }\n})\n```\n\n### Options API\n\nIf you want to backup data, you have to define a *backupData* lifecycle method.\n\n```javascript\nexport default {\n  // Restore data\n  data() {\n    return this.$historyState.data || { key: \"value\" }\n  }\n  // Backup data\n  backupData() {\n    return this.$data\n  }\n}\n```\n\n## API\n\n### HistoryState\n\n#### action\n\nA action type that caused a navigation.\n\n- navigate: When a new page is navigated.\n- reload: When a page is reloaded.\n- push: When a history.push is called.\n- back: When a back navigation is occurred.\n- forward: When a forward navigation is occurred.\n\nBy default this method returns basically 'navigate' on server. \nBut many browsers send cache-control='maxage=0' when reloading.\nIt heuristically returns 'reload' then.\n\n#### visited\n\nIf the action is back, forward or reload, this property returns true.\n#### page: number\n\nA current page number (an integer beginning with 0).\n\nThis method always returns 0 on server.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\nThis method always returns undefined on server.\n\n#### length: number\n\nA history length.\n\nThis method cannot be used on server.\n\n#### getItem(page): HistoryItem?\n\nYou can get a location and data of the specified page number.\n\nIf you set 'overrideDefaultScrollBehavior' option to true, the item has scrollPositions property.\n\nThis method cannot use on server.\n\n#### getItems(): HistoryItem[]\n\nYou can get a list of item.\n\nThis method cannot be used on server.\n\n#### findBackPage(location): number?\n\nYou can get a page number of the first matched history, \nsearching backward in the continuous same site starting at the current page.\nIf a history state is not found or is not in the continuous same site, this method will return undefined.\n\nIf the partial option sets true, it matches any subset of the location.\n\nThis method cannot be used on server.\n\n```javascript\nconst page = historyState.findBackPage({\n    path: '/test'\n    // hash: ...\n    // query: ...\n    // name: ...\n    // params: ...\n    // partial: true (default: false)\n})\nif (page != null) {\n    historyState.getItem(page).data = undefined\n\n    // go back to the page in site.\n    const router = useRouter()\n    router.go(page - historyState.page)\n}\n```\n\n### HistoryItem\n\n#### location: { path?, name?, params?, query?, hash? }\n\nA location of this saved page.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\n#### scrollPositions: object\n\nA saved scroll positions. A root window is obtained with 'window' key, the others by the selector.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Hidekatsu Izuno (hidekatsu.izuno@gmail.com)\n","readmeFilename":"README.md","gitHead":"2db7e2829b5e3c518a61309cb39d54934a695042","_id":"vue-history-state@0.14.0-4","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-AzKkgR24zpq/6gcrEpWp4A7TsyMjYL5lSBY4uLYD7RHNY9fyWJRh/JdXyxDECFo+pypWIkKHMYE2atOeowQgEg==","shasum":"fa7751e1c21914b9f995647fe4e03fa71707a66c","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.14.0-4.tgz","fileCount":57,"unpackedSize":191591,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvhHB/etyPddNxp8H0XgCeih4d2plcgnXWY7Ru9RzWHwIhAIUDajJ2HA0IXU14nFLkNGQtwYuuMuwt9ZZPlZzVJS9m"}]},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.14.0-4_1693347266823_0.5674886307235831"},"_hasShrinkwrap":false},"0.14.0-5":{"name":"vue-history-state","version":"0.14.0-5","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest run --config vite.config.ts","lint":"eslint --ext js,ts .","lint:fix":"eslint --ext js,ts --fix","prerelease":"npm run build","release":"np"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"engines":{"node":">=18.0.0"},"devDependencies":{"@nuxt/kit":"^3.7.0","@tsconfig/recommended":"^1.0.2","@typescript-eslint/eslint-plugin":"^6.4.1","@typescript-eslint/parser":"^6.4.1","eslint":"^8.48.0","np":"^8.0.4","typescript":"^5.2.2","vitest":"^0.34.3","vue":"^3.3.4","vue-router":"^4.2.4"},"dependencies":{"lz-string":"^1.5.0"},"readme":"# Vue History State Plugin\n\nHistory state plugin for Vue 3 and Nuxt 3\n\n[![npm version](https://badge.fury.io/js/vue-history-state.svg)](https://badge.fury.io/js/vue-history-state)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nVue History State Plugin is usefull for restoring state when users press \"Back\" or \"Foward\".\n\nThis plugin is a new version of [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state) \nported to work with Vue 3 and Nuxt 3.\n\n## Features\n\n- Restore a last state when going forward or back.\n- Restore a state when reloading.\n- Restore a last state when going forward or back after reloading.\n\n## Supported Vuersion\n\n- Vue 3.x + Vue-Router 4.x\n- Nuxt 3.x\n\nIf you want to work with Nuxt 2, you need to use [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state).\n\n## Install\n\nUsing npm:\n\n```\nnpm install vue-history-state\n```\n\n## Setup\n\n### Vue 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\n...\n\napp.use(HistoryStatePlugin, {\n  /* optional options */\n})\n```\n\n### Nuxt 3\n\n```javascript:nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: [\n    \"vue-history-state/nuxt\"\n  ],\n  historyState: {\n    /* optional options */\n  }\n})\n```\n\n### Options\n\n#### maxHistoryLength\n\nSets the maximum length of hisotries that can hold data.\n\nWhen this option is not set, it depends on a max history length of a browser.\n\n*Default:* undefined\n\n#### overrideDefaultScrollBehavior\n\nIndicates whether this module override a default scroll behavior of the router.\n\nIf you set this option to true, it manages a scroll behavior by using own saved position.\n\n*Default:* true\n\n#### scrollingElements\n\nIndicates to which element the overrode behavior is applied.\n\nIf you set this option to a selecter, it applies the scrolling to the selector, in addition to the window.\n\n*Default:* undefined\n\n## Usage\n\n### Reactivity API\n\nIf you want to backup data, you have to define a *onBackupState* lifecycle method.\n\n```javascript\nimport { useHistoryState, onBackupState } from 'vue-history-state'\n\nconst historyState = useHistoryState()\n\n// Restore data\nconst data = reactive(historyState.data || { key: \"value\" })\n\n// Fetch or restore data\nconst { data } = useAsyncData(() => $fetch('/api/data'), {\n    default: () => (historyState.data || { key: 'value' }),\n    immediate: !historyState.data,\n    server: false,\n})\n\n// Backup data\nonBackupState(() => data)\n```\n\n#### New SSR-friendly reactivity APIs (experimental)\n\n```javascript\n// Backup and restore data\nconst data = useRestorableState({\n  key: \"value\"\n})\n\n// Backup, restore and fetch data\nconst data = useRestorableState({\n  mode: \"create\",\n  key: \"value\",\n}, ({ visited, info }) => {\n  if (!visited) {\n    if (info?.mode === \"update\" || info?.mode === \"delete\") {\n      return $fetch(\"api.example.com\").then(res => ({\n        ...res,\n        mode: info.mode,\n      }))\n    }\n  } else {\n    if (info?.refresh) {\n      return $fetch(\"api.example.com\")\n    }\n  }\n})\n```\n\n### Options API\n\nIf you want to backup data, you have to define a *backupData* lifecycle method.\n\n```javascript\nexport default {\n  // Restore data\n  data() {\n    return this.$historyState.data || { key: \"value\" }\n  }\n  // Backup data\n  backupData() {\n    return this.$data\n  }\n}\n```\n\n## API\n\n### HistoryState\n\n#### action\n\nA action type that caused a navigation.\n\n- navigate: When a new page is navigated.\n- reload: When a page is reloaded.\n- push: When a history.push is called.\n- back: When a back navigation is occurred.\n- forward: When a forward navigation is occurred.\n\nBy default this method returns basically 'navigate' on server. \nBut many browsers send cache-control='maxage=0' when reloading.\nIt heuristically returns 'reload' then.\n\n#### visited: boolean\n\nIf the action is back, forward or reload, this property returns true.\n\n#### canGoBack: boolean / canGoForward: boolean\n\nYou can test if you can go back/forward.\n\nThis method cannot be used on the server.\n\n#### page: number\n\nA current page number (an integer beginning with 0).\n\nThis method always returns 0 on server.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\nThis method always returns undefined on server.\n\n### info: object?\n\nA transferred data from the previous page.\n\nThis method always returns undefined on server.\n\n#### length: number\n\nA history length.\n\nThis method cannot be used on server.\n\n#### getItem(page): HistoryItem?\n\nYou can get a location and data of the specified page number.\n\nIf you set 'overrideDefaultScrollBehavior' option to true, the item has scrollPositions property.\n\nThis method cannot use on server.\n\n#### getItems(): HistoryItem[]\n\nYou can get a list of item.\n\nThis method cannot be used on server.\n\n#### findBackPage(location): number?\n\nYou can get a page number of the first matched history, \nsearching backward in the continuous same site starting at the current page.\nIf a history state is not found or is not in the continuous same site, this method will return undefined.\n\nIf the partial option sets true, it matches any subset of the location.\n\nThis method cannot be used on server.\n\n```javascript\nconst page = historyState.findBackPage({\n    path: '/test'\n    // hash: ...\n    // query: ...\n    // name: ...\n    // params: ...\n    // partial: true (default: false)\n})\nif (page != null) {\n    historyState.getItem(page).data = undefined\n\n    // go back to the page in site.\n    const router = useRouter()\n    router.go(page - historyState.page)\n}\n```\n\n#### push(url: string, info?: Record<string, any>)\n\nThis method is almost the same as router.push(url).\n\nIf you set info parameter, it passes info data (like a message) to the next page.\n\n#### back(info?: Record<string, any>)\n\nThis method is almost the same as window.history.back().\n\nIf you set info parameter, it passes info data (like a message) to the backwarded page.\n\n#### forward(info?: Record<string, any>)\n\nThis method is almost the same as window.history.forward().\n\nIf you set info parameter, it passes info data (like a message) to the forwarded page.\n\n#### goToPage(page: number, info?: Record<string, any>)\n\nThis method is almost the same as window.history.go(page - nav.page).\n\nIf you set info parameter, it passes info data (like a message) to the page.\n\n#### reload(info?: Record<string, any>)\n\nThis method is almost the same as window.location.reload().\n\n### HistoryItem\n\n#### location: { path?, name?, params?, query?, hash? }\n\nA location of this saved page.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\n#### scrollPositions: object\n\nA saved scroll positions. A root window is obtained with 'window' key, the others by the selector.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Hidekatsu Izuno (hidekatsu.izuno@gmail.com)\n","readmeFilename":"README.md","gitHead":"ca807dad8669fdbc4f87719cc4981765451d0aef","_id":"vue-history-state@0.14.0-5","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-5LVIj62WDNN/iG2ivBYHeiqUO4Jhn6i46xFtY5KazxqEF9777i1k+EoVnBfpS/Og4tiPiT/uxb+oO6wtF7vXGw==","shasum":"c49669f19bef45b7041a4214def7e3839fbe3860","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.14.0-5.tgz","fileCount":57,"unpackedSize":192001,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC24U28d/whgAZ34fFQbRxD+2Q2lKG2kUtLLpsTbQ+6lAIgagUk2nWbH20+bVdgeYQ68U3teMk9UGKw8qFjk6wR9E4="}]},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.14.0-5_1693408896447_0.9602156140988387"},"_hasShrinkwrap":false},"0.14.0":{"name":"vue-history-state","version":"0.14.0","description":"History State Module for Vue3 and Nuxt3","type":"module","main":"./lib/index.js","module":"./module/index.js","types":"./module/index.d.ts","scripts":{"build":"tsc --build --clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json","test":"vitest run --config vite.config.ts","lint":"eslint --ext js,ts .","lint:fix":"eslint --ext js,ts --fix","prerelease":"npm run build","release":"np"},"exports":{".":{"import":{"types":"./module/index.d.ts","default":"./module/index.js"},"require":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"default":"./lib/index.js"},"./nuxt":{"import":{"types":"./module/nuxt/index.d.ts","default":"./module/nuxt/index.js"},"require":{"types":"./lib/nuxt/index.d.ts","default":"./lib/nuxt/index.js"},"default":"./lib/nuxt/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"license":"MIT","bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"engines":{"node":">=18.0.0"},"devDependencies":{"@nuxt/kit":"^3.7.0","@tsconfig/recommended":"^1.0.2","@typescript-eslint/eslint-plugin":"^6.4.1","@typescript-eslint/parser":"^6.4.1","eslint":"^8.48.0","np":"^8.0.4","typescript":"^5.2.2","vitest":"^0.34.3","vue":"^3.3.4","vue-router":"^4.2.4"},"dependencies":{"lz-string":"^1.5.0"},"gitHead":"25454a1c28ecf481d291fb5d2ae107b8c5a578a9","_id":"vue-history-state@0.14.0","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-qXuWUVifu2UIAH3yveDHShbZMLSY0ifnbQsnIuPBXlXXEqIR5lXabzvxWt18UTifCkgrPy1BUvCIOzAiduO4CA==","shasum":"c4ac039e7167e0c73dc16566c95a4857ed54d2d8","tarball":"https://registry.npmjs.org/vue-history-state/-/vue-history-state-0.14.0.tgz","fileCount":57,"unpackedSize":192673,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFdfGgvm/3FA4qDzmzw3shHahZVgWcH3OZPu3sepfYk7AiEAgcCXP7aiQor1TG70yk4L0WmzGkJsds0WNeagoxyfdf8="}]},"_npmUser":{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"},"directories":{},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-history-state_0.14.0_1693492923817_0.5358756459000333"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-29T15:41:46.810Z","0.7.0":"2022-09-29T15:41:47.013Z","modified":"2023-08-31T14:42:04.231Z","0.7.1":"2022-10-03T23:09:45.172Z","0.7.2":"2022-10-07T14:38:13.067Z","0.7.3":"2022-10-07T15:07:13.865Z","0.7.4":"2022-10-11T23:15:08.040Z","0.8.0":"2022-10-12T15:31:01.628Z","0.9.0":"2022-10-16T02:18:48.397Z","0.10.0":"2022-10-26T12:24:07.836Z","0.11.0":"2022-10-28T14:21:11.836Z","0.12.0-alpha.0":"2023-02-27T11:25:08.074Z","0.12.0":"2023-02-27T15:53:36.809Z","0.13.0-alpha.0":"2023-03-15T21:49:15.717Z","0.13.0-alpha.1":"2023-03-16T23:11:48.899Z","0.13.0-alpha.2":"2023-03-16T23:42:27.731Z","0.13.0":"2023-03-17T08:52:46.296Z","0.13.1":"2023-03-26T06:12:10.608Z","0.13.1-0":"2023-08-21T13:00:08.738Z","0.13.2":"2023-08-21T13:13:49.990Z","0.14.0-0":"2023-08-27T18:25:46.109Z","0.14.1-0":"2023-08-27T18:30:04.212Z","0.14.0-1":"2023-08-27T23:57:01.953Z","0.14.0-2":"2023-08-28T14:31:02.786Z","0.14.0-3":"2023-08-28T23:42:41.478Z","0.14.0-4":"2023-08-29T22:14:27.064Z","0.14.0-5":"2023-08-30T15:21:36.668Z","0.14.0":"2023-08-31T14:42:04.056Z"},"maintainers":[{"name":"hidekatsu-izuno","email":"hidekatsu.izuno@gmail.com"}],"description":"History State Module for Vue3 and Nuxt3","homepage":"https://github.com/hidekatsu-izuno/vue-history-state#readme","keywords":["vue","nuxt","history"],"repository":{"type":"git","url":"git+https://github.com/hidekatsu-izuno/vue-history-state.git"},"author":{"name":"Hidekatsu Izuno","email":"hidekatsu.izuno@gmail.com","url":"https://github.com/hidekatsu-izuno/"},"bugs":{"url":"https://github.com/hidekatsu-izuno/vue-history-state/issues"},"license":"MIT","readme":"# Vue History State Plugin\n\nHistory state plugin for Vue 3 and Nuxt 3\n\n[![npm version](https://badge.fury.io/js/vue-history-state.svg)](https://badge.fury.io/js/vue-history-state)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nVue History State Plugin is usefull for restoring state when users press \"Back\" or \"Foward\".\n\nThis plugin is a new version of [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state) \nported to work with Vue 3 and Nuxt 3.\n\n## Features\n\n- Restore a last state when going forward or back.\n- Restore a state when reloading.\n- Restore a last state when going forward or back after reloading.\n\n## Supported Vuersion\n\n- Vue 3.x + Vue-Router 4.x\n- Nuxt 3.x\n\nIf you want to work with Nuxt 2, you need to use [nuxt-history-state](https://github.com/hidekatsu-izuno/nuxt-history-state).\n\n## Install\n\nUsing npm:\n\n```\nnpm install vue-history-state\n```\n\n## Setup\n\n### Vue 3\n\n```javascript\nimport HistoryStatePlugin from 'vue-history-state'\n\n...\n\napp.use(HistoryStatePlugin, {\n  /* optional options */\n})\n```\n\n### Nuxt 3\n\n```javascript:nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: [\n    \"vue-history-state/nuxt\"\n  ],\n  historyState: {\n    /* optional options */\n  }\n})\n```\n\n### Options\n\n#### maxHistoryLength\n\nSets the maximum length of hisotries that can hold data.\n\nWhen this option is not set, it depends on a max history length of a browser.\n\n*Default:* undefined\n\n#### overrideDefaultScrollBehavior\n\nIndicates whether this module override a default scroll behavior of the router.\n\nIf you set this option to true, it manages a scroll behavior by using own saved position.\n\n*Default:* true\n\n#### scrollingElements\n\nIndicates to which element the overrode behavior is applied.\n\nIf you set this option to a selecter, it applies the scrolling to the selector, in addition to the window.\n\n*Default:* undefined\n\n## Usage\n\n### Reactivity API\n\nIf you want to backup data, you have to define a *onBackupState* lifecycle method.\n\n```javascript\nimport { useHistoryState, onBackupState } from 'vue-history-state'\n\nconst historyState = useHistoryState()\n\n// Restore data\nconst data = reactive(historyState.data || { key: \"value\" })\n\n// Fetch or restore data\nconst { data } = useAsyncData(() => $fetch('/api/data'), {\n    default: () => (historyState.data || { key: 'value' }),\n    immediate: !historyState.data,\n    server: false,\n})\n\n// Backup data\nonBackupState(() => data)\n```\n\n#### New SSR-friendly reactivity APIs (experimental)\n\n```javascript\n// Backup and restore data\nconst data = useRestorableState({\n  key: \"value\"\n})\n\n// Backup, restore and fetch data\nconst data = useRestorableState({\n  mode: \"create\",\n  key: \"value\",\n}, ({ visited, info }) => {\n  if (!visited) {\n    if (info?.mode === \"update\" || info?.mode === \"delete\") {\n      return $fetch(\"api.example.com\").then(res => ({\n        ...res,\n        mode: info.mode,\n      }))\n    }\n  } else {\n    if (info?.refresh) {\n      return $fetch(\"api.example.com\")\n    }\n  }\n})\n```\n\n### Options API\n\nIf you want to backup data, you have to define a *backupData* lifecycle method.\n\n```javascript\nexport default {\n  // Restore data\n  data() {\n    return this.$historyState.data || { key: \"value\" }\n  }\n  // Backup data\n  backupData() {\n    return this.$data\n  }\n}\n```\n\n## API\n\n### HistoryState\n\n#### action\n\nA action type that caused a navigation.\n\n- navigate: When a new page is navigated.\n- reload: When a page is reloaded.\n- push: When a history.push is called.\n- back: When a back navigation is occurred.\n- forward: When a forward navigation is occurred.\n\nBy default this method returns basically 'navigate' on server. \nBut many browsers send cache-control='maxage=0' when reloading.\nIt heuristically returns 'reload' then.\n\n#### visited: boolean\n\nIf the action is back, forward or reload, this property returns true.\n\n#### canGoBack: boolean / canGoForward: boolean\n\nYou can test if you can go back/forward.\n\nThis method cannot be used on the server.\n\n#### page: number\n\nA current page number (an integer beginning with 0).\n\nThis method always returns 0 on server.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\nThis method always returns undefined on server.\n\n### info: object?\n\nA transferred data from the previous page.\n\nThis method always returns undefined on server.\n\n#### length: number\n\nA history length.\n\nThis method cannot be used on server.\n\n#### getItem(page): HistoryItem?\n\nYou can get a location and data of the specified page number.\n\nIf you set 'overrideDefaultScrollBehavior' option to true, the item has scrollPositions property.\n\nThis method cannot use on server.\n\n#### getItems(): HistoryItem[]\n\nYou can get a list of item.\n\nThis method cannot be used on server.\n\n#### findBackPage(location): number?\n\nYou can get a page number of the first matched history, \nsearching backward in the continuous same site starting at the current page.\nIf a history state is not found or is not in the continuous same site, this method will return undefined.\n\nIf the partial option sets true, it matches any subset of the location.\n\nThis method cannot be used on server.\n\n```javascript\nconst page = historyState.findBackPage({\n    path: '/test'\n    // hash: ...\n    // query: ...\n    // name: ...\n    // params: ...\n    // partial: true (default: false)\n})\nif (page != null) {\n    historyState.getItem(page).data = undefined\n\n    // go back to the page in site.\n    const router = useRouter()\n    router.go(page - historyState.page)\n}\n```\n\n#### push(url: string, info?: Record<string, any>)\n\nThis method is almost the same as router.push(url).\n\nIf you set info parameter, it passes info data (like a message) to the next page.\n\n#### back(info?: Record<string, any>)\n\nThis method is almost the same as window.history.back().\n\nIf you set info parameter, it passes info data (like a message) to the backwarded page.\n\n#### forward(info?: Record<string, any>)\n\nThis method is almost the same as window.history.forward().\n\nIf you set info parameter, it passes info data (like a message) to the forwarded page.\n\n#### goToPage(page: number, info?: Record<string, any>)\n\nThis method is almost the same as window.history.go(page - nav.page).\n\nIf you set info parameter, it passes info data (like a message) to the page.\n\n#### reload(info?: Record<string, any>)\n\nThis method is almost the same as window.location.reload().\n\n### HistoryItem\n\n#### location: { path?, name?, params?, query?, hash? }\n\nA location of this saved page.\n\n#### data: object?\n\nA backup data.\n\nIf you want to clear the backup data, you set undefined to this property.\n\n#### scrollPositions: object\n\nA saved scroll positions. A root window is obtained with 'window' key, the others by the selector.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Hidekatsu Izuno (hidekatsu.izuno@gmail.com)\n","readmeFilename":"README.md"}