{"_id":"@bitovi/router-4-web-component","_rev":"16-67e3a9b318ba98b626057a74a7cbe103","name":"@bitovi/router-4-web-component","dist-tags":{"alpha3":"0.1.0-alpha3","alpha4":"0.1.0-alpha4","alpha5":"0.1.0-alpha5","latest":"0.1.0-alpha12"},"versions":{"0.1.0-alpha3":{"name":"@bitovi/router-4-web-component","version":"0.1.0-alpha3","keywords":["router","routing","web-component","web component"],"author":{"name":"Bitovi"},"license":"MIT","_id":"@bitovi/router-4-web-component@0.1.0-alpha3","maintainers":[{"name":"janebitovi","email":"jane@bitovi.com"},{"name":"kyle-n","email":"kylebnazario@gmail.com"},{"name":"bitovi-os","email":"os@bitovi.com"},{"name":"bitovi-core-os","email":"core@donejs.com"},{"name":"mickmcgrath13","email":"mick.mc.13@gmail.com"},{"name":"phillipskevin","email":"kphillips86@gmail.com"},{"name":"tehfedaykin","email":"jennifer.wadella@gmail.com"},{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},{"name":"mhaynie_bitovi","email":"mhaynie@bitovi.com"},{"name":"fabioemoutinho","email":"fabioemoutinho@gmail.com"},{"name":"christopherjbaker","email":"slithytove2@gmail.com"},{"name":"justinbmeyer","email":"justin@bitovi.com"},{"name":"cherif_b","email":"cherif.bouchelaghem@gmail.com"},{"name":"alishouman","email":"alyshouman@gmail.com"}],"homepage":"https://www.bitovi.com/services/frontend-development-consulting","bugs":{"url":"https://github.com/bitovi/router-4-web-component/issues"},"dist":{"shasum":"aed4645d1a553e39cf522f717553843592fbb86a","tarball":"https://registry.npmjs.org/@bitovi/router-4-web-component/-/router-4-web-component-0.1.0-alpha3.tgz","fileCount":39,"integrity":"sha512-7hVdFNwONMjZepXzLbY1eiLmki71s0lOZzIbRHBNGM5HClzLjd46h804CWog1jpIASAhTU5XQTA+6s2JAyUTXQ==","signatures":[{"sig":"MEQCIENaqEpRfmZyyi4EnWZSe7jeKUNTL9A3M9h9TYSJhr8lAiBHK45SsmpKakTQVIutDGjNCyMnP/NIooTm989BFZjkzg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81358},"types":"./src/index.d.ts","module":"./src/index.js","exports":{".":"./src/index.js"},"gitHead":"dc3f7d19118743504c6dbd107f428363b94392c4","scripts":{},"_npmUser":{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},"repository":{"url":"git+https://github.com/bitovi/router-4-web-component.git","type":"git"},"_npmVersion":"9.6.7","description":"A router for Web Components.","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/router-4-web-component_0.1.0-alpha3_1693444329998_0.6465538548128131","host":"s3://npm-registry-packages"}},"0.1.0-alpha4":{"name":"@bitovi/router-4-web-component","version":"0.1.0-alpha4","keywords":["router","routing","web-component","web component"],"author":{"name":"Bitovi"},"license":"MIT","_id":"@bitovi/router-4-web-component@0.1.0-alpha4","maintainers":[{"name":"janebitovi","email":"jane@bitovi.com"},{"name":"kyle-n","email":"kylebnazario@gmail.com"},{"name":"bitovi-os","email":"os@bitovi.com"},{"name":"bitovi-core-os","email":"core@donejs.com"},{"name":"mickmcgrath13","email":"mick.mc.13@gmail.com"},{"name":"phillipskevin","email":"kphillips86@gmail.com"},{"name":"tehfedaykin","email":"jennifer.wadella@gmail.com"},{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},{"name":"mhaynie_bitovi","email":"mhaynie@bitovi.com"},{"name":"fabioemoutinho","email":"fabioemoutinho@gmail.com"},{"name":"christopherjbaker","email":"slithytove2@gmail.com"},{"name":"justinbmeyer","email":"justin@bitovi.com"},{"name":"cherif_b","email":"cherif.bouchelaghem@gmail.com"},{"name":"alishouman","email":"alyshouman@gmail.com"}],"homepage":"https://www.bitovi.com/services/frontend-development-consulting","bugs":{"url":"https://github.com/bitovi/router-4-web-component/issues"},"dist":{"shasum":"643270d00685b7ed57214c4bfab230eba4f00b1b","tarball":"https://registry.npmjs.org/@bitovi/router-4-web-component/-/router-4-web-component-0.1.0-alpha4.tgz","fileCount":39,"integrity":"sha512-HZu0T8/m2c24Nd+N/0X/NpNcsftgw907NmXBq4KqWBZbjrnEbwx8Aio6DQiQ24g3PadXURhnRp/5WtnglxIrHA==","signatures":[{"sig":"MEYCIQD76dEtHRYJNkt6jZaH0/7tvPsBqwCAu3j72FNsdeRaAgIhAMGgwKSG7TRZfUOZN50y2XQ1msy19vv3iGE/Hfo7lK7H","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78089},"types":"./src/index.d.ts","module":"./src/index.js","exports":{".":"./src/index.js"},"gitHead":"c2091454f7197467441ba12e64cbe31df9decab9","scripts":{},"_npmUser":{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},"repository":{"url":"git+https://github.com/bitovi/router-4-web-component.git","type":"git"},"_npmVersion":"9.6.7","description":"A router for Web Components.","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/router-4-web-component_0.1.0-alpha4_1693861090919_0.5832019248547862","host":"s3://npm-registry-packages"}},"0.1.0-alpha5":{"name":"@bitovi/router-4-web-component","version":"0.1.0-alpha5","keywords":["router","routing","web-component","web component"],"author":{"name":"Bitovi"},"license":"MIT","_id":"@bitovi/router-4-web-component@0.1.0-alpha5","maintainers":[{"name":"janebitovi","email":"jane@bitovi.com"},{"name":"kyle-n","email":"kylebnazario@gmail.com"},{"name":"bitovi-os","email":"os@bitovi.com"},{"name":"bitovi-core-os","email":"core@donejs.com"},{"name":"mickmcgrath13","email":"mick.mc.13@gmail.com"},{"name":"phillipskevin","email":"kphillips86@gmail.com"},{"name":"tehfedaykin","email":"jennifer.wadella@gmail.com"},{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},{"name":"mhaynie_bitovi","email":"mhaynie@bitovi.com"},{"name":"fabioemoutinho","email":"fabioemoutinho@gmail.com"},{"name":"christopherjbaker","email":"slithytove2@gmail.com"},{"name":"justinbmeyer","email":"justin@bitovi.com"},{"name":"cherif_b","email":"cherif.bouchelaghem@gmail.com"},{"name":"alishouman","email":"alyshouman@gmail.com"}],"homepage":"https://www.bitovi.com/services/frontend-development-consulting","bugs":{"url":"https://github.com/bitovi/router-4-web-component/issues"},"dist":{"shasum":"5c7608381064a06dd89e0077c58d5755c9094bad","tarball":"https://registry.npmjs.org/@bitovi/router-4-web-component/-/router-4-web-component-0.1.0-alpha5.tgz","fileCount":42,"integrity":"sha512-5+XjIMS7MbvA0XKJ3lglv3GM/9BlZVMcTURkEsvYpD814Objk2V9thubfB4Esw93AuGgOs1wlrqf6qd5v98Deg==","signatures":[{"sig":"MEQCICPNP1wDibj4pbxVfQwPh5JQZIQH42Hy/IoiTzfTRZBRAiBzu/mR8CODDbIB/FrusUO9TD7aSdPZw/8I712Qi2BiTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103246},"types":"./src/index.d.ts","module":"./src/index.js","readme":"# @bitovi/router-4-web-component\n\nA router for web components.\n\n## Install\n\nUse Skypack and import this module into a source file where you need to use the router.\n\n```ts\nimport from \"https://cdn.skypack.dev/@bitovi/router-4-web-component\";\n```\n\nThen you can use the router in your HTML.\n\n```html\n<r4w-router>\n  <r4w-route path=\"/foo\" src=\"/foo.js\">\n    <my-web-component />\n  </r4w-route>\n</r4w-router>\n```\n\n### API\n\n#### class `Params`\n\nThis class is used as a base for web components that want to get params\ninformation from a route's path. Must be a descendant of an `<r4w-route>`\nelement.\n\nCan be used in a [mixin\ndefinition](https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/)\nof a web component.\n\nCreate a web component.\n\n```ts\nimport { Params } from \"https://cdn.skypack.dev/@bitovi/router-4-web-component\";\n\nexport class MyWebComponent extends Params {\n  override onParamsChange(params: Record<string, string>): void {\n    // The params information in the `params` object depends on the tokens\n    // included in the value of an `<r4w-route>` `path` attrbute.\n    console.log(\"onParamsChange: params=\", params);\n  }\n}\n\nif (!customElements.get(\"my-web-component\")) {\n  customElements.define(\"my-web-component\", MyWebComponent);\n}\n```\n\nUse the web component.\n\n```html\n<r4w-router>\n  <r4w-link to=\"/items/42\">The meaning of...</r4w-link>\n  <r4w-route path=\"/items/:item\">\n    <my-web-component />\n  </r4w-route>\n</r4w-router>\n```\n\nWhen this code is executed the text \"onParamsChange: params= { item: 42 }\" will\nbe logged.\n\n#### class `PathnameChanged`\n\nThis class is used as a base for web components that want to be informed when\nthe browser's path changes. Must be a descendant of an `<r4w-router>` element.\n\nCan be used in a [mixin\ndefinition](https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/)\nof a web component.\n\nCreate a web component.\n\n```ts\nimport { PathnameChanged } from \"https://cdn.skypack.dev/@bitovi/router-4-web-component\";\n\nexport class MyWebComponent extends PathnameChanged {\n  override onPathnameChange(pathname: string): void {\n    console.log(\"onPathnameChange: pathname=\", pathname);\n  }\n}\n\nif (!customElements.get(\"my-web-component\")) {\n  customElements.define(\"my-web-component\", MyWebComponent);\n}\n```\n\nUse the web component.\n\n```html\n<r4w-router>\n  <r4w-link to=\"/items/42\">The meaning of...</r4w-link>\n  <r4w-route path=\"/items/:item\">\n    <my-web-component />\n  </r4w-route>\n</r4w-router>\n```\n\nWhen this code is executed the text \"onPathnameChange: pathname= /items/42\" will\nbe logged.\n\n---\n\n#### element `<r4w-link>`\n\nMust be a **descendant** of an `<rw4-router>` element. When the element is\nclicked browser history is updated and a matching route that is a child of the\nsame `<rw4-router>` ancestor element is activated.\n\n##### Attributes\n\n- `to` - The path that will be pushed to browser history. Must match the `path`\n  attribute of an `<r4w-route>` element.\n\n##### Descendants\n\nSame descendants as an `<a>` tag.\n\n---\n\n#### element `<r4w-redirect>`\n\nMust be an immediate child of `<r4w-router>`. Will be used to update browser\nhistory if none of the `<r4w-route>` elements match the current URL.\n\n##### Attributes\n\n- `to` - Must match the path of a sibling `<r4w-route>` element.\n\n##### Descendants\n\nNone.\n\n---\n\n#### element `<r4w-route>`\n\nMust be an immediate child of `<r4w-router>`. Child elements will be added to the DOM when\nthe route becomes active, and will be removed when it is deactivated. Usually\nactivated when the user clicks an `<r4w-link>` element. If the route has a `src`\nattribute the source file will be dynamically imported (and cached) then the\nchildren added to the DOM; otherwise children are immediately attached to the\nDOM.\n\n##### Attributes\n\n- `path` - The path pushed to browser history. Must match the `to` attribute of\n  an `<r4w-link>` that shares the same ancestor `<r4w-router>`.\n- `src` - A path to a source code file. Will be imported dynamically (and\n  cached) the first time the route is activated.\n\n##### Descendants\n\nAny element.\n\n---\n\n#### element `<r4w-router>`\n\nActivates child `<r4w-route>` elements when a descendant `<r4w-link>` element\nis clicked or an `<rw4-redirect>` takes effect.\n\n##### Attributes\n\nNone\n\n##### Descendants\n\nAny element. The `<r4w-route>` and `<r4w-redirect>` elements must be a direct\nchildren of this element.\n\n---\n\n### Routing Sequence\n\n[![](https://mermaid.ink/img/pako:eNqFlM9v2jAUx_-VJ19GEdBCIxhWxak77FBt2tbLlEM859FYJDazHVaG-N_3HCeBQaVe0CP-2N_v-2EfmDQ5Ms4c_q5RS3xU4sWKKtUAW2G9kmortIdSb0A4eLDJn3Gp9GZ1CVhTe7Q9E_--Tf0PXTGydt5UDRTDsTTV1mjU_op1aHdRNUapDoQ2JGLCAtnm8ExrIEslNw6C94CEfMarVQRy5bbCywKyLr0x7kgui8fFXIiOAQfcibIWpHHNn4t3-Oc1NMsfHG1ovj2rPIPcoHv4ZeF2RVugagwI-NYAAa0DREuF0i-RWxsLvhC-hcAbOmQCn16Vn0SrpTHbIGb3IAtV5pd17pJpcm9CTpXzX4UvBjcBQJ2fJX3CKA2jn4LHwL0vFcVE6aldvmhyhT7NuPiWlxyF9GpHtY12euocinJkG7LQuVLsuabxyOIGLB1G0eEwyA6H74meS3ZUcN6bLsQOoTJ5XWK33tsK58TZ46BoTK0fZEE9uzmh7ZSOzzQtOhpp15_X170Rbw21V6H73F6McEoMQ73WSuMgZZc3JWW9_mkgu13X94rm63alHChNA4bw-OWpLWZnqw8uxpvDDxqA2HrMlUXp2-6fWtnqshGr0FZC5fTcHAKSMhKrMGWcQkpF1CUZT_WRUFF7832vJePe1jhi9Tano9rXifG1oDaPGD0CjB_YK-Oz5G4yn8_ul8vZcko_sxHbM55MpouP9_PFfJoskvndMjmO2F9DXvi02fyziYPC8R9HT7LA?type=png)](https://mermaid.live/edit#pako:eNqFlM9v2jAUx_-VJ19GEdBCIxhWxak77FBt2tbLlEM859FYJDazHVaG-N_3HCeBQaVe0CP-2N_v-2EfmDQ5Ms4c_q5RS3xU4sWKKtUAW2G9kmortIdSb0A4eLDJn3Gp9GZ1CVhTe7Q9E_--Tf0PXTGydt5UDRTDsTTV1mjU_op1aHdRNUapDoQ2JGLCAtnm8ExrIEslNw6C94CEfMarVQRy5bbCywKyLr0x7kgui8fFXIiOAQfcibIWpHHNn4t3-Oc1NMsfHG1ovj2rPIPcoHv4ZeF2RVugagwI-NYAAa0DREuF0i-RWxsLvhC-hcAbOmQCn16Vn0SrpTHbIGb3IAtV5pd17pJpcm9CTpXzX4UvBjcBQJ2fJX3CKA2jn4LHwL0vFcVE6aldvmhyhT7NuPiWlxyF9GpHtY12euocinJkG7LQuVLsuabxyOIGLB1G0eEwyA6H74meS3ZUcN6bLsQOoTJ5XWK33tsK58TZ46BoTK0fZEE9uzmh7ZSOzzQtOhpp15_X170Rbw21V6H73F6McEoMQ73WSuMgZZc3JWW9_mkgu13X94rm63alHChNA4bw-OWpLWZnqw8uxpvDDxqA2HrMlUXp2-6fWtnqshGr0FZC5fTcHAKSMhKrMGWcQkpF1CUZT_WRUFF7832vJePe1jhi9Tano9rXifG1oDaPGD0CjB_YK-Oz5G4yn8_ul8vZcko_sxHbM55MpouP9_PFfJoskvndMjmO2F9DXvi02fyziYPC8R9HT7LA)\n","exports":{".":"./src/index.js"},"gitHead":"4a5f9dead56e24c3a566053e4be74f7c07a4586c","scripts":{},"_npmUser":{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},"repository":{"url":"git+https://github.com/bitovi/router-4-web-component.git","type":"git"},"_npmVersion":"9.6.7","description":"A router for Web Components.","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/router-4-web-component_0.1.0-alpha5_1694377934127_0.6911412097004945","host":"s3://npm-registry-packages"}},"0.1.0-alpha6":{"name":"@bitovi/router-4-web-component","version":"0.1.0-alpha6","keywords":["router","routing","web-component","web component"],"author":{"name":"Bitovi"},"license":"MIT","_id":"@bitovi/router-4-web-component@0.1.0-alpha6","maintainers":[{"name":"janebitovi","email":"jane@bitovi.com"},{"name":"kyle-n","email":"kylebnazario@gmail.com"},{"name":"bitovi-os","email":"os@bitovi.com"},{"name":"bitovi-core-os","email":"core@donejs.com"},{"name":"mickmcgrath13","email":"mick.mc.13@gmail.com"},{"name":"phillipskevin","email":"kphillips86@gmail.com"},{"name":"tehfedaykin","email":"jennifer.wadella@gmail.com"},{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},{"name":"mhaynie_bitovi","email":"mhaynie@bitovi.com"},{"name":"fabioemoutinho","email":"fabioemoutinho@gmail.com"},{"name":"christopherjbaker","email":"slithytove2@gmail.com"},{"name":"justinbmeyer","email":"justin@bitovi.com"},{"name":"cherif_b","email":"cherif.bouchelaghem@gmail.com"},{"name":"alishouman","email":"alyshouman@gmail.com"}],"homepage":"https://www.bitovi.com/services/frontend-development-consulting","bugs":{"url":"https://github.com/bitovi/router-4-web-component/issues"},"dist":{"shasum":"40a8a0a690b7c06adb6267b9ec96f1582781050c","tarball":"https://registry.npmjs.org/@bitovi/router-4-web-component/-/router-4-web-component-0.1.0-alpha6.tgz","fileCount":51,"integrity":"sha512-P1gd3JF9tJvf0kC1AJ9lqK1yKQp9SOUDLjyDXCNYxSrDjMtB86TdxYOq/+GILB5TeECVY7dazuauQDxtNwEXzQ==","signatures":[{"sig":"MEUCIE5mH+ico9DL0eTaOuJqZZRT6bCMSEwI7yzZCrDFlsGiAiEAjqf92p+Hjv/gHW6JJV5u6lHGWKvdnH1VNoLqY/Z1fkU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":318821},"types":"./src/index.d.ts","module":"./src/index.js","exports":{".":"./src/index.js"},"gitHead":"113ba057e4baab1085cd9bc0d8ef6ba56430a359","scripts":{},"_npmUser":{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},"repository":{"url":"git+https://github.com/bitovi/router-4-web-component.git","type":"git"},"_npmVersion":"9.6.7","description":"A router for Web Components.","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/router-4-web-component_0.1.0-alpha6_1695085388933_0.13191577849282754","host":"s3://npm-registry-packages"}},"0.1.0-alpha7":{"name":"@bitovi/router-4-web-component","version":"0.1.0-alpha7","keywords":["router","routing","web-component","web component"],"author":{"name":"Bitovi"},"license":"MIT","_id":"@bitovi/router-4-web-component@0.1.0-alpha7","maintainers":[{"name":"janebitovi","email":"jane@bitovi.com"},{"name":"kyle-n","email":"kylebnazario@gmail.com"},{"name":"bitovi-os","email":"os@bitovi.com"},{"name":"bitovi-core-os","email":"core@donejs.com"},{"name":"mickmcgrath13","email":"mick.mc.13@gmail.com"},{"name":"phillipskevin","email":"kphillips86@gmail.com"},{"name":"tehfedaykin","email":"jennifer.wadella@gmail.com"},{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},{"name":"mhaynie_bitovi","email":"mhaynie@bitovi.com"},{"name":"fabioemoutinho","email":"fabioemoutinho@gmail.com"},{"name":"christopherjbaker","email":"slithytove2@gmail.com"},{"name":"justinbmeyer","email":"justin@bitovi.com"},{"name":"cherif_b","email":"cherif.bouchelaghem@gmail.com"},{"name":"alishouman","email":"alyshouman@gmail.com"}],"homepage":"https://www.bitovi.com/services/frontend-development-consulting","bugs":{"url":"https://github.com/bitovi/router-4-web-component/issues"},"dist":{"shasum":"f765ab9d1a65d96e3adefd60b17205e1882d2006","tarball":"https://registry.npmjs.org/@bitovi/router-4-web-component/-/router-4-web-component-0.1.0-alpha7.tgz","fileCount":51,"integrity":"sha512-qJoQdWrCoPwi1Wis9f0H1IitX391MY/sf+Bh2mDc3zow9wrAIQX3sVfJz2C3kRJPAB887w0fRn5KM1jkQlE+ng==","signatures":[{"sig":"MEUCIQDhpk4kyZh/cVUdHUYFbimfEDzcMq98JSBi+HNmdTu3wQIgJwUQ5njmQ6Nc2z4HJme49WklKA36tpuRqYl5P1G5JT8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":358827},"types":"./src/index.d.ts","module":"./src/index.js","exports":{".":"./src/index.js"},"gitHead":"99ef0a27bf1becfc698df07d3e808bbfc34ad803","scripts":{},"_npmUser":{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},"repository":{"url":"git+https://github.com/bitovi/router-4-web-component.git","type":"git"},"_npmVersion":"9.6.7","description":"A router for Web Components.","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/router-4-web-component_0.1.0-alpha7_1695096793873_0.6983936620722084","host":"s3://npm-registry-packages"}},"0.1.0-alpha8":{"name":"@bitovi/router-4-web-component","version":"0.1.0-alpha8","keywords":["router","routing","web-component","web component"],"author":{"name":"Bitovi"},"license":"MIT","_id":"@bitovi/router-4-web-component@0.1.0-alpha8","maintainers":[{"name":"janebitovi","email":"jane@bitovi.com"},{"name":"kyle-n","email":"kylebnazario@gmail.com"},{"name":"bitovi-os","email":"os@bitovi.com"},{"name":"bitovi-core-os","email":"core@donejs.com"},{"name":"mickmcgrath13","email":"mick.mc.13@gmail.com"},{"name":"phillipskevin","email":"kphillips86@gmail.com"},{"name":"tehfedaykin","email":"jennifer.wadella@gmail.com"},{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},{"name":"mhaynie_bitovi","email":"mhaynie@bitovi.com"},{"name":"fabioemoutinho","email":"fabioemoutinho@gmail.com"},{"name":"christopherjbaker","email":"slithytove2@gmail.com"},{"name":"justinbmeyer","email":"justin@bitovi.com"},{"name":"cherif_b","email":"cherif.bouchelaghem@gmail.com"},{"name":"alishouman","email":"alyshouman@gmail.com"}],"homepage":"https://www.bitovi.com/services/frontend-development-consulting","bugs":{"url":"https://github.com/bitovi/router-4-web-component/issues"},"dist":{"shasum":"dcdf9e908493ec8eedaecd3f45ddc6b7a506fbe2","tarball":"https://registry.npmjs.org/@bitovi/router-4-web-component/-/router-4-web-component-0.1.0-alpha8.tgz","fileCount":54,"integrity":"sha512-cZLf6lbAJqgbu4vXlWUryAlfIU8R984CLH6z1cbf2LcEXy117l5D62xTyWiJZsgfsFWNxTHhIjsqVFi/9pwc0g==","signatures":[{"sig":"MEYCIQDEkuKCD2q3eB/W1t8IwaXbcoDa9scw0uJABKv9MNy+ywIhALirxVl+ugSRVEEQ92NrtbPEVFNUifn2l0xX5xGHp4Hb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":402169},"types":"./src/index.d.ts","module":"./src/index.js","exports":{".":"./src/index.js"},"gitHead":"a6aefe449f8980e6274a0c97800bac9304bbc369","scripts":{},"_npmUser":{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},"repository":{"url":"git+https://github.com/bitovi/router-4-web-component.git","type":"git"},"_npmVersion":"9.6.7","description":"A router for Web Components.","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/router-4-web-component_0.1.0-alpha8_1695585772855_0.2619988669441302","host":"s3://npm-registry-packages"}},"0.1.0-alpha9":{"name":"@bitovi/router-4-web-component","version":"0.1.0-alpha9","keywords":["router","routing","web-component","web component"],"author":{"name":"Bitovi"},"license":"MIT","_id":"@bitovi/router-4-web-component@0.1.0-alpha9","maintainers":[{"name":"janebitovi","email":"jane@bitovi.com"},{"name":"kyle-n","email":"kylebnazario@gmail.com"},{"name":"bitovi-os","email":"os@bitovi.com"},{"name":"bitovi-core-os","email":"core@donejs.com"},{"name":"mickmcgrath13","email":"mick.mc.13@gmail.com"},{"name":"phillipskevin","email":"kphillips86@gmail.com"},{"name":"tehfedaykin","email":"jennifer.wadella@gmail.com"},{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},{"name":"mhaynie_bitovi","email":"mhaynie@bitovi.com"},{"name":"fabioemoutinho","email":"fabioemoutinho@gmail.com"},{"name":"christopherjbaker","email":"slithytove2@gmail.com"},{"name":"justinbmeyer","email":"justin@bitovi.com"},{"name":"cherif_b","email":"cherif.bouchelaghem@gmail.com"},{"name":"alishouman","email":"alyshouman@gmail.com"}],"homepage":"https://www.bitovi.com/services/frontend-development-consulting","bugs":{"url":"https://github.com/bitovi/router-4-web-component/issues"},"dist":{"shasum":"3dc5d7b4f36d42b87d50e7ab68e4c499e7ce5c2d","tarball":"https://registry.npmjs.org/@bitovi/router-4-web-component/-/router-4-web-component-0.1.0-alpha9.tgz","fileCount":54,"integrity":"sha512-/MU9rvA4wMgI7PW9WBpByHe2eVe+E1zgU0J6iEnnhpxcIFGxCFFmF4x2a7gUo5oNUF7BGCWPxHUm5yfjiXFfQg==","signatures":[{"sig":"MEQCIHwq2tkQ4Yxl8SgZ4TuTENqw0sREHe8bTwz7tPlTirpVAiBI07+pbFKxXB7drZPnfMaXtozFBbGMb3BRVOXnFHf5yA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":402340},"types":"./src/index.d.ts","module":"./src/index.js","exports":{".":"./src/index.js"},"gitHead":"e861ed093789b9f3e77c7e6fce922d1db2315304","scripts":{},"_npmUser":{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},"repository":{"url":"git+https://github.com/bitovi/router-4-web-component.git","type":"git"},"_npmVersion":"9.6.7","description":"A router for Web Components.","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/router-4-web-component_0.1.0-alpha9_1696272866123_0.5253350470299574","host":"s3://npm-registry-packages"}},"0.1.0-alpha10":{"name":"@bitovi/router-4-web-component","version":"0.1.0-alpha10","keywords":["router","routing","web-component","web component"],"author":{"name":"Bitovi"},"license":"MIT","_id":"@bitovi/router-4-web-component@0.1.0-alpha10","maintainers":[{"name":"janebitovi","email":"jane@bitovi.com"},{"name":"kyle-n","email":"kylebnazario@gmail.com"},{"name":"bitovi-os","email":"os@bitovi.com"},{"name":"bitovi-core-os","email":"core@donejs.com"},{"name":"mickmcgrath13","email":"mick.mc.13@gmail.com"},{"name":"phillipskevin","email":"kphillips86@gmail.com"},{"name":"tehfedaykin","email":"jennifer.wadella@gmail.com"},{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},{"name":"mhaynie_bitovi","email":"mhaynie@bitovi.com"},{"name":"fabioemoutinho","email":"fabioemoutinho@gmail.com"},{"name":"christopherjbaker","email":"slithytove2@gmail.com"},{"name":"justinbmeyer","email":"justin@bitovi.com"},{"name":"cherif_b","email":"cherif.bouchelaghem@gmail.com"},{"name":"alishouman","email":"alyshouman@gmail.com"}],"homepage":"https://www.bitovi.com/services/frontend-development-consulting","bugs":{"url":"https://github.com/bitovi/router-4-web-component/issues"},"dist":{"shasum":"485acf50e7c782ba32c414a806eb014699c79b53","tarball":"https://registry.npmjs.org/@bitovi/router-4-web-component/-/router-4-web-component-0.1.0-alpha10.tgz","fileCount":54,"integrity":"sha512-CpnB8e/32HtpZrqKFuIYqeNIuFSW0YkNE15apuJr9fFteR/R8FDf13uvB4H/TUumf8l+1L9j5yiJ0k+q+uHCSw==","signatures":[{"sig":"MEYCIQC70WKBIkEsVZskzqL9AvPeHpz/8jP6BJ/1boLFiiP1qAIhAKYJCAyMnEh3RczQdbnpyh2Ie7/S04awKc8QEZZu5Zc0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":402073},"types":"./src/index.d.ts","module":"./src/index.js","exports":{".":"./src/index.js"},"gitHead":"d9479da9ec1fe9503cfaf54ead31ef94b8d211f7","scripts":{},"_npmUser":{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},"repository":{"url":"git+https://github.com/bitovi/router-4-web-component.git","type":"git"},"_npmVersion":"9.6.7","description":"A router for Web Components.","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/router-4-web-component_0.1.0-alpha10_1696282362879_0.8183254022397648","host":"s3://npm-registry-packages"}},"0.1.0-alpha11":{"name":"@bitovi/router-4-web-component","version":"0.1.0-alpha11","keywords":["router","routing","web-component","web component"],"author":{"name":"Bitovi"},"license":"MIT","_id":"@bitovi/router-4-web-component@0.1.0-alpha11","maintainers":[{"name":"janebitovi","email":"jane@bitovi.com"},{"name":"kyle-n","email":"kylebnazario@gmail.com"},{"name":"bitovi-os","email":"os@bitovi.com"},{"name":"bitovi-core-os","email":"core@donejs.com"},{"name":"mickmcgrath13","email":"mick.mc.13@gmail.com"},{"name":"phillipskevin","email":"kphillips86@gmail.com"},{"name":"tehfedaykin","email":"jennifer.wadella@gmail.com"},{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},{"name":"mhaynie_bitovi","email":"mhaynie@bitovi.com"},{"name":"fabioemoutinho","email":"fabioemoutinho@gmail.com"},{"name":"christopherjbaker","email":"slithytove2@gmail.com"},{"name":"justinbmeyer","email":"justin@bitovi.com"},{"name":"cherif_b","email":"cherif.bouchelaghem@gmail.com"},{"name":"alishouman","email":"alyshouman@gmail.com"}],"homepage":"https://www.bitovi.com/services/frontend-development-consulting","bugs":{"url":"https://github.com/bitovi/router-4-web-component/issues"},"dist":{"shasum":"261c42c4a99c11b1ce60233aa1dfe4ac50f505aa","tarball":"https://registry.npmjs.org/@bitovi/router-4-web-component/-/router-4-web-component-0.1.0-alpha11.tgz","fileCount":59,"integrity":"sha512-j85MbNDAlW67ftU/FOpq27VZltUylEVDlyHAzaON4SjzlxqJoAEAilDoIBFq3i2FCBHkcT+xHjUy04O2oaAWAQ==","signatures":[{"sig":"MEUCIFEWlyMnJunJoBK9XKp3VehNMvoEjWVE8zwGNFh2m1GbAiEAokNeB1L3qCzHySb/8kheXks+AkoOSna/9dFR2BHuo7o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":407334},"types":"./src/index.d.ts","module":"./src/index.js","exports":{".":"./src/index.js"},"gitHead":"3cdd72e8b13faf9e2201ffab851ee10d376ed0b0","scripts":{},"_npmUser":{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},"repository":{"url":"git+https://github.com/bitovi/router-4-web-component.git","type":"git"},"_npmVersion":"9.6.7","description":"A router for Web Components.","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/router-4-web-component_0.1.0-alpha11_1696371055789_0.31768345930451636","host":"s3://npm-registry-packages"}},"0.1.0-alpha12":{"name":"@bitovi/router-4-web-component","version":"0.1.0-alpha12","keywords":["router","routing","web-component","web component"],"author":{"name":"Bitovi"},"license":"MIT","_id":"@bitovi/router-4-web-component@0.1.0-alpha12","maintainers":[{"name":"bmomberger-bitovi","email":"brad@bitovi.com"},{"name":"janebitovi","email":"jane@bitovi.com"},{"name":"kyle-n","email":"kylebnazario@gmail.com"},{"name":"bitovi-os","email":"os@bitovi.com"},{"name":"bitovi-core-os","email":"core@donejs.com"},{"name":"mickmcgrath13","email":"mick.mc.13@gmail.com"},{"name":"phillipskevin","email":"kphillips86@gmail.com"},{"name":"tehfedaykin","email":"jennifer.wadella@gmail.com"},{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},{"name":"mhaynie_bitovi","email":"mhaynie@bitovi.com"},{"name":"fabioemoutinho","email":"fabioemoutinho@gmail.com"},{"name":"christopherjbaker","email":"slithytove2@gmail.com"},{"name":"justinbmeyer","email":"justin@bitovi.com"},{"name":"cherif_b","email":"cherif.bouchelaghem@gmail.com"},{"name":"alishouman","email":"alyshouman@gmail.com"}],"homepage":"https://www.bitovi.com/services/frontend-development-consulting","bugs":{"url":"https://github.com/bitovi/router-4-web-component/issues"},"dist":{"shasum":"161910849535a11d8806d24a7f7539a64e65b052","tarball":"https://registry.npmjs.org/@bitovi/router-4-web-component/-/router-4-web-component-0.1.0-alpha12.tgz","fileCount":59,"integrity":"sha512-fbMbFj2MiYrzhfWhAaJ4uDa1WpN57QyfLam5KyrnmBlH7VtXCFy2GcS5jw41WKC3WJ0/N3sG+i8pWssdvzvkhA==","signatures":[{"sig":"MEYCIQDLgAImCkXEKgrSS/jN9RNtEbI+c3Du+J7WYsH7widUfQIhAON2X+lrqPdVEeUk4v4jT6olfgRqgRto7qRgODMFBAIy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":411215},"types":"./src/index.d.ts","module":"./src/index.js","exports":{".":"./src/index.js"},"gitHead":"7096dc154f4e6f965c861dc9ecf1b09f68d793a5","scripts":{},"_npmUser":{"name":"rlmcneary2","email":"rlmcneary2@gmail.com"},"repository":{"url":"git+https://github.com/bitovi/router-4-web-component.git","type":"git"},"_npmVersion":"9.6.7","description":"A router for Web Components.","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/router-4-web-component_0.1.0-alpha12_1697667828008_0.2738290847108198","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-08-31T01:12:09.925Z","modified":"2026-05-21T14:19:18.489Z","0.1.0-alpha3":"2023-08-31T01:12:10.210Z","0.1.0-alpha4":"2023-09-04T20:58:11.109Z","0.1.0-alpha5":"2023-09-10T20:32:14.341Z","0.1.0-alpha6":"2023-09-19T01:03:09.206Z","0.1.0-alpha7":"2023-09-19T04:13:14.134Z","0.1.0-alpha8":"2023-09-24T20:02:53.080Z","0.1.0-alpha9":"2023-10-02T18:54:26.313Z","0.1.0-alpha10":"2023-10-02T21:32:43.123Z","0.1.0-alpha11":"2023-10-03T22:10:56.068Z","0.1.0-alpha12":"2023-10-18T22:23:48.560Z"},"bugs":{"url":"https://github.com/bitovi/router-4-web-component/issues"},"author":{"name":"Bitovi"},"license":"MIT","homepage":"https://www.bitovi.com/services/frontend-development-consulting","keywords":["router","routing","web-component","web component"],"repository":{"url":"git+https://github.com/bitovi/router-4-web-component.git","type":"git"},"description":"A router for Web Components.","maintainers":[{"email":"justin@bitovi.com","name":"justinbmeyer"},{"email":"cherif.bouchelaghem@gmail.com","name":"cherif_b"},{"email":"alyshouman@gmail.com","name":"alishouman"},{"email":"os@bitovi.com","name":"bitovi-os"},{"email":"kylebnazario@gmail.com","name":"kyle-n"},{"email":"mhaynie@bitovi.com","name":"mhaynie_bitovi"},{"email":"brad@bitovi.com","name":"bmomberger-bitovi"},{"email":"fabioemoutinho@gmail.com","name":"fabioemoutinho"},{"email":"rich@limnous.com","name":"rlmcneary2"},{"email":"jennifer.wadella@gmail.com","name":"tehfedaykin"},{"email":"kphillips86@gmail.com","name":"phillipskevin"},{"email":"mick.mc.13@gmail.com","name":"mickmcgrath13"},{"email":"core@donejs.com","name":"bitovi-core-os"},{"email":"jane@bitovi.com","name":"janebitovi"},{"email":"DanD.Tran89@gmail.com","name":"dandamantran89"},{"email":"sandover@gmail.com","name":"sandover"}],"readme":"# @bitovi/router-4-web-component\n\nA router for web components.\n\n## Install\n\n### As part of an ES module\n\nUse \"esm.sh\" and import this module into a source file where you need to use the\nrouter.\n\n```ts\nimport from \"https://esm.sh/@bitovi/router-4-web-component\";\n```\n\n### As part of a bundle\n\nIf you are bundling your source code you may need to use a dynamic `import` to\nload the library like so:\n\n```ts\nasync function main() {\n  await import(\"https://esm.sh/@bitovi/router-4-web-component\");\n}\n```\n\n### Using a script element\n\nThe script can also be loaded in an HTML file, typically as part of the `<head>`\nelement.\n\n```html\n<head>\n  <script\n    src=\"https://esm.sh/@bitovi/router-4-web-component\"\n    type=\"module\"\n  ></script>\n</head>\n```\n\nThen you can use the router in your HTML.\n\n```html\n<r4w-router>\n  <r4w-route path=\"/foo\" src=\"/foo.js\">\n    <my-web-component />\n  </r4w-route>\n</r4w-router>\n```\n\n## API\n\n### Elements\n\n#### `<r4w-link>`\n\nMust be a **descendant** of the `<rw4-router>` element. When the link is clicked\nbrowser history is updated, a matching route that is a child of the same\n`<rw4-router>` ancestor element will be activated.\n\n##### Attributes\n\nAll attributes that can be applied to an `<a>` element - except `href` - as well\nas:\n\n- `to` - The path that will be pushed to browser history.\n\n##### Descendants\n\nSame descendants as an `<a>` tag.\n\n---\n\n#### `<r4w-redirect />`\n\nMust be an **immediate** child of `<r4w-switch>`. Will be used to update browser\nhistory if none of the immediate child `<r4w-route>` elements match the current\nURL.\n\n##### Attributes\n\n- `to` - The path that will be pushed to browser history.\n\n##### Descendants\n\nNone\n\n---\n\n#### `<r4w-route>`\n\nChild elements will be added to the DOM when its `path` matches the browser\nlocation and the route becomes active; child elements will be removed when it is\ndeactivated.\n\nIf the route has a `src` attribute the source file will be dynamically imported\n(and cached) when the route is activated then the children will be added to the\nDOM; otherwise children are immediately attached to the DOM. A common use case\nis a web component as the route's child and the `src` is the URL of a JavaScript\nfile that creates the web component's class and defines the web component in\n`customElements`.\n\n##### Attributes\n\n- `path` - The path pushed to browser history.\n- `src` - Optional URL to a resource, commonly another ES module. Will be\n  imported dynamically (and cached) the first time the route is activated.\n\n##### Descendants\n\nAny element\n\n---\n\n#### `<r4w-router>`\n\nAll r4w elements must be nested under a single r4w-router. This is the most\nbasic component and should probably be placed close to the `<body` element of\nthe document.\n\n##### Attributes\n\nNone\n\n##### Descendants\n\nAny element\n\n---\n\n#### `<r4w-switch>`\n\nActivates a single child `<r4w-route>` element (that is an immediate child of\nthe switch) when a `path` matches the browser location or an `<rw4-redirect>`\ntakes effect.\n\n##### Attributes\n\nNone\n\n##### Descendants\n\nAny element. The `<r4w-redirect>` element must be a direct child of this\nelement.\n\n---\n\n### Mixins\n\n#### `ParamsListenerMixin`\n\nThis mixin is used as a base for web components that want to get params\ninformation from a route's path. Must be a descendant of an `<r4w-route>`\nelement.\n\nCan be used in a [mixin\ndefinition](https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/)\nof a web component.\n\nCreate a web component.\n\n```ts\nimport { ParamsListenerMixin } from \"https://esm.sh/@bitovi/router-4-web-component\";\n\nexport class MyWebComponent extends ParamsListenerMixin(HTMLElement) {\n  override _onParamsChange(params: Record<string, string>): void {\n    // The params information in the `params` object depends on the tokens\n    // included in the value of an `<r4w-route>` `path` attrbute.\n    console.log(\"_onParamsChange: params=\", params);\n  }\n}\n\nif (!customElements.get(\"my-web-component\")) {\n  customElements.define(\"my-web-component\", MyWebComponent);\n}\n```\n\nUse the web component.\n\n```html\n<r4w-router>\n  <r4w-link to=\"/items/42\">The meaning of...</r4w-link>\n  <r4w-route path=\"/items/:item\">\n    <my-web-component />\n  </r4w-route>\n</r4w-router>\n```\n\nWhen this code is executed the text \"\\_onParamsChange: params= { item: 42 }\" will\nbe logged.\n\n---\n\n#### `TemplateMixin`\n\nFetch an HTML file and make its body available as a string to clients. The\nstring can be set as the `innerHTML` of an element, typically a `<template>`.\n\nCan be used in a [mixin\ndefinition](https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/)\nof a web component.\n\nCreate a web component and apply the mixin to it.\n\n```ts\nimport { TemplateMixin } from \"https://esm.sh/@bitovi/router-4-web-component\";\n\nexport class MyWebComponent extends TemplateMixin(HTMLElement) {\n  constructor() {\n    super();\n    // Setting the `templateSrc` property starts the download.\n    this.templateSrc = \"//example.com/template.html\";\n  }\n\n  override _onTemplateReady(html: string) {\n    // The download has completed and the contents of the file are passes as the `html` arg.\n    const template = document.createElement(\"template\");\n    template.innerHTML = html;\n  }\n}\n\nif (!customElements.get(\"my-web-component\")) {\n  customElements.define(\"my-web-component\", MyWebComponent);\n}\n```\n\n### Functions\n\n#### `receive`\n\nVarious messages are used to communicate status changes in the router system.\nThe `receive` function is the method used to listen for those messages. Provide\na handler that will be invoked when the named message arrives.\n\n##### parameters\n\n- `name` {keyof R4WDetailMap} The name of the message to listen for.\n- `callback` {ReceiveCallback} This will be invoked when a message arrives.\n- `target` {EventTarget} An optional parameter that indicates the element that\n  message refers to, when provided this is the object that will receive\n  messages; defaults to `window`.\n\n##### returns\n\n{DisconnectCallback} Invoke when the you no longer need to receive messages.\n","readmeFilename":"README.md"}