{"_id":"@bukunmikuti/view-router","_rev":"2-5eecb4433e99b34a81c700e6ba108818","name":"@bukunmikuti/view-router","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@bukunmikuti/view-router","version":"1.0.0","description":"A super simple in-page router/navigator","type":"module","main":"./dist/viewrouter.umd.min.js","browser":"./dist/viewrouter.umd.min.js","module":"./dist/viewrouter.esm.min.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bili"},"repository":{"type":"git","url":"git+https://github.com/Bukunmikuti/view-router.git"},"bugs":{"url":"https://github.com/Bukunmikuti/view-router/issues"},"keywords":["view router","view transitions","navigator","javascript","simple","browser","esm"],"devDependencies":{"bili":"5.0.5"},"author":{"name":"Bukunmikuti"},"license":"ISC","gitHead":"de5b8d7b22060f575cfaafbd40b4fcfe3be0a8d0","homepage":"https://github.com/Bukunmikuti/view-router#readme","_id":"@bukunmikuti/view-router@1.0.0","_nodeVersion":"12.18.3","_npmVersion":"7.16.0","dist":{"integrity":"sha512-D19THxMfwYmaUia6IuigIsSN2lyHRnpD1IT8u4zaMJwjcYns2HKKyJhKBxzPqGlcB3YGd0u3js7d52+WsYjENg==","shasum":"efbd96338d1288e8b76408a575c80adfa95da10d","tarball":"https://registry.npmjs.org/@bukunmikuti/view-router/-/view-router-1.0.0.tgz","fileCount":12,"unpackedSize":24277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2zt/CRA9TVsSAnZWagAAr0IP/3JJiUYgTZg0/JpKjZM9\n3n4+bSV8acbqais9wMaN+0TSwlhvZHdYva5Rt1LzWO+PzREK4IfuShfvNiZp\n3W+KKANKtOvKDfrOmxG2MVSYxKy2uADYILFmzqwUDpmRx9rMkonkiKLur59R\nDPB8cWABxxltrXMBpo5tHuSrFF6mR4w7pAiZnKLfxdENxAR0Qn7EQKABcVtd\n5EZ7crqEwXgeaISzlJG5lD2ezjavPyb48us5Hn02NhOiQ9rShA9K7xZZ9bWw\ntOwwTJRkNXLEaH9tpAYD7XKJqqeDlz72h31AZ2kkkzqGD5a0MwBMnBhIW3Sy\nCCScFGXWHEqZYm58MUPw83ylwFEODgSaK1NksklJjpw6A8f9hmqQCG/qMdc5\np4nmUOzApcbRYxyweRH5F+6RhtOs/QW2MhoWHsUXaM75P7l85Iiefoa88oI7\npjSA0LxWoiqRxoEiqrxsXvoY6pVRat3QHItDNq4jS3WW7YK2MeHfjCnn9ACo\ndYIUoRPUQhf1Bx46zkMaBd5LTk7igNcWLfaOp75otbYFGQ8RrPKCljZj3KQ8\nHA2bZhvlVjG1gqsvliMP2LEFyy0HasXc9mzmMR6GAbK3NacjFbYIDOFyxz1Z\n8hXS+OnH9t1sIYNQgyGnIkBfF3BUwk2PflHvEdSpm7dQIKJh0ijM9kRLZswo\ncrpB\r\n=yC5y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjbRqaJkAnt+qqsGBJ2VJDC0wQX8U1qHPUzohKeLCtWAIhANa1pq+oFKVC4LtJ2ZPIHHBHdeKlfR9Ehu7J7aCUBPG/"}]},"_npmUser":{"name":"bukunmikuti","email":"bukunmikuti@gmail.com"},"directories":{},"maintainers":[{"name":"bukunmikuti","email":"bukunmikuti@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/view-router_1.0.0_1624980350645_0.8071876608904205"},"_hasShrinkwrap":false},"1.0.1":{"name":"@bukunmikuti/view-router","version":"1.0.1","description":"A super simple in-page router/navigator","type":"module","main":"./dist/viewrouter.umd.min.js","browser":"./dist/viewrouter.umd.min.js","module":"./dist/viewrouter.esm.min.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bili"},"repository":{"type":"git","url":"git+https://github.com/Bukunmikuti/view-router.git"},"bugs":{"url":"https://github.com/Bukunmikuti/view-router/issues"},"keywords":["view router","view transitions","navigator","javascript","simple","browser","esm"],"devDependencies":{"bili":"5.0.5"},"author":{"name":"Bukunmikuti"},"license":"ISC","gitHead":"34e5e5dc40aee3f31dac1897d3fda0f03ea9c714","homepage":"https://github.com/Bukunmikuti/view-router#readme","_id":"@bukunmikuti/view-router@1.0.1","_nodeVersion":"12.18.3","_npmVersion":"7.16.0","dist":{"integrity":"sha512-nt09XrucEnZkiNY+0MOXtKUH0+CLFKJe10j/PSukKpm3FgmL3LIyFfDcpO7Jgvq4zv6g2ocZA3uFHWe8N3q7fA==","shasum":"a1b5ecb9962c95a410d9362a24790127d88f0164","tarball":"https://registry.npmjs.org/@bukunmikuti/view-router/-/view-router-1.0.1.tgz","fileCount":11,"unpackedSize":23749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg24uOCRA9TVsSAnZWagAACW8P/3Ikw4zrW2L7jz1pr++9\nwppjCK9llnGcnetOkftNb3iDP1J9vkkUdPC7vnNgqAilAPu3H9cC5473IL3z\n8uX6vvBJxaMElJ8iEN/unY0crIo3GJzdHokHvqmgm/JBpl6C8nEjjmabSxdS\nbsS3nWLdZrcqykZrqiSaaLg3r2u6frvVD7FTIBV4qYJA0AFPWx01em6SwUff\ns2eX054//b0StGDN14ITQqcjhsmYMheQzbGzoHFZCnQHVTodBcgYrxgSqxEo\nvfqMshUIQklGpuggvbBNrvSqVYal1TaHrETS5ueqfMGbmkzp50N3UVk8tFac\nzVzUnfYrxQP4OpAmrjDYtsl37VGGdTNQbc7gbfDCGpFc//r9sA4iwMSKriJh\n7hIfvbJYJ0JszT2knWAEl1we3sruVfiLsDPCTGTzvxN398Zn4qpXVluL1d07\nK1HXQB63dSM0TfesKU0fIYkg20OMMSVEvyHMyDPvHoD8Rh2MWIaY5pPsHb3h\nGUERlvY8NrpWXFrLKJqsWCt4ILek3BnTB1GvI492m9BaCJIbscqYDAKEeTQ2\nDcTBx6VhkopJcckke/doyw1qmvXzFucj5NTbcW01SH/wVIHmiqbuAapTAa7g\nyWvwTTmlRSD1z0CN63guqgWIpRHnXepyRZVuk9fRwbNO94z4L4yTjRgSE4Mm\nfDOD\r\n=qijg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAsBUttyawhfQ2mo4BFq38D13WwU596tOMZnbsZENrohAiB66AS+zWWoaYI5zHbLKYwcZkacC8a9ikLpUf/eh+2jmQ=="}]},"_npmUser":{"name":"bukunmikuti","email":"bukunmikuti@gmail.com"},"directories":{},"maintainers":[{"name":"bukunmikuti","email":"bukunmikuti@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/view-router_1.0.1_1625000845874_0.8178127994103521"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-29T15:25:50.602Z","1.0.0":"2021-06-29T15:25:50.743Z","modified":"2022-04-04T21:03:12.300Z","1.0.1":"2021-06-29T21:07:25.996Z"},"maintainers":[{"name":"bukunmikuti","email":"bukunmikuti@gmail.com"}],"description":"A super simple in-page router/navigator","homepage":"https://github.com/Bukunmikuti/view-router#readme","keywords":["view router","view transitions","navigator","javascript","simple","browser","esm"],"repository":{"type":"git","url":"git+https://github.com/Bukunmikuti/view-router.git"},"author":{"name":"Bukunmikuti"},"bugs":{"url":"https://github.com/Bukunmikuti/view-router/issues"},"license":"ISC","readme":"# View Router\n\n<p align=\"center\">A minimal, super simple in-page router ⚡ </p>\n\n<p align=\"center\">\n<a href=\"#\">\n <img alt=\"npm bundle size (scoped)\" src=\"https://img.shields.io/bundlephobia/min/@bukunmikuti/view-router?style=flat-square\">\n</a>\n <a href=\"https://www.npmjs.com/package/@bukunmikuti/view-router\">\n <img alt=\"npm (scoped)\" src=\"https://img.shields.io/npm/v/@bukunmikuti/view-router?style=flat-square\">\n </a>\n <a href=\"\">\n  <img alt=\"GitHub top language\" src=\"https://img.shields.io/github/languages/top/Bukunmikuti/view-router?logoColor=%23880000&style=flat-square\">\n </a>\n </p>\n \n -------------------------\n \n > View Router is not in any way related to [vue-router](https://github.com/vuejs/vue-router) the official router of vue.js, neither are they alternatives. \n > \n > View Router is a simple standalone in-page navigator.\n \n -------------------------\n \n # Features 🎉\n View Router is a simple library that helps you navigate between different views with style.<br>\n \n - Super fast and minimal <br>\n - Includes view transitions <br>\n - Easy to set up <br>\n - History API or hash navigation — Optional<br>\n - Small sized (<10kb) <br>\n \n \n # Demo\n You might want to see how it works in a test environment before installing: <br><br>\nCheck for all demos [here](https://gist.github.com/Bukunmikuti/cbf1e75ec19dacd29f06420e695e31ad)\n \n # Installation\nView Router ships a browser build for \n```<script>``` tags \nand an ES Module format. You can also install via npm.\n<details>\n<summary>Check all options ➡️</summary>\n\n ### NPM\n ```\n npm i @bukunmikuti/view-router\n ```\n ### Script include\n ```html\n <script src=\"https://unpkg.com/@bukunmikuti/view-router\"></script>\n ```\n ### ES Module\n ```javascript\n import ViewRouter from \"https://cdn.skypack.dev/@bukunmikuti/view-router\"\n ```\n</details>\n \n # Set up 🚀\n View router exposes a single object: ```ViewRouter``` where you can pass your options.\n \n ```javascript\n const viewrouter = new ViewRouter(options)\n ```\n\n Instantiate the class by passing an object parameter which must include ```views: []``` and other optional properties.\n \n ```javascript\n const viewrouter = new ViewRouter({\n\tviews: [], //required\n\tnavigation: \"history\"||\"hash\",\n\ttransition: true||false, \n})\n ```\n\n \n## ```views: []```\n<details>\n<summary>see details ➡️</summary>\n<br>\n\n ```Type:``` Array of objects — required <br>\n ```Description:``` This property stores each view's property in an object. It can contain several view definitions.\n \n ```javascript\n const viewrouter = new ViewRouter({\n\tviews: [\n\t\t{\n\t\t\tid: \"login\", //required\n\t\t\tpath: \"/login\",\n\t\t\torigin: \"/login.html\",\n\t\t\tmounted() {}, //callback\n\t\t\trender() {} //callback\n\t\t},\n\t\t\n\t\t{/* another view */}\n\t\t{/* another view */}\n\t]\n})\n ```\n A view definition should include the following properties:\n \n | View property | Description | Default Value |\n| :---------------: | :---------------: | :---------------: |\n| ```id``` | The 'id' attribute of the template tag — Required| undefined |\n| ```path``` | The URL path that triggers the view when navigated to. | undefined |\n| ```origin``` | If the view is located in another html document, this will contain the relative path to the document. | undefined |\n| ```mounted``` | Views are not part of the DOM by default, they only get mounted when routed to for the first time. Put any logic that depends on accessing elements of the view here. It is called only once | callback undefined |\n| ```render``` | This method is called each time a view is routed to | callback undefined |\n</details>\n\n\n## ```navigation```\n<details>\n<summary>\nsee details ➡️\n</summary>\n<br>\n\n ```Type:``` String — history or hash (optional) <br>\n ```Description:``` Use hash navigation or Web history API. If undefined or false then routing is automatically disabled, else ```views: [{path: \"\"}]``` must be specified.\n </details>\n\n\n## ```transition```\n<details>\n<summary>see details ➡️</summary>\n<br>\n\n ```Type:``` Boolean — optional<br>\n ```Description:``` Enable or disable view transitions. Transition type must be specified on the view ```<template>``` tag. <br>All transitions — ```fadeIn``` ```fadeInTop``` ```fadeInBottom``` ```fadeInLeft``` ```fadeInRight```\n \n ```html\n <!--index.html-->\n <template id=\"login\" class=\"v-router fadeInLeft\"></template>\n \n <script type=\"module\">\n import ViewRouter from \"...\"\n \n let v = new ViewRouter({\n  //...\n  transition: true\n })\n </script>\n \n ```\n</details>\n\n\n## Methods\n<details>\n<summary>see details ➡️</summary>\n<br>\n\n| Method | Description | Return Value |\n| :---------------: | :---------------: | :---------------: |\n| ```routeTo()``` | Navigate to the specified view. Accepts view id as parameter | executes render() |\n </details>\n \n # Browser support\n View Router currently works on all modern browsers that support async/await, fetch API and other es6 features.\n We plan on supporting older browsers in future release.<br><br>\n Check all supported browsers [here](https://caniuse.com/?search=es6)\n \n\n # Contribution\n You can contribute by making pull requests to fix issues, \ndropping a code review/demo example or updating the readme.<br>\nYour changes should be clearly stated.<br>\nThank you! \n\n # License\n This project is available under the [ISC Liscense](./LICENSE)\n","readmeFilename":"README.md"}