@limetech/kompendium 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +313 -0
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +13 -0
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js.map +1 -0
- package/dist/cjs/anchor-scroll-BmplAyR0.js +69 -0
- package/dist/cjs/anchor-scroll-BmplAyR0.js.map +1 -0
- package/dist/cjs/index-DYiJ6dQL.js +1866 -0
- package/dist/cjs/index-DYiJ6dQL.js.map +1 -0
- package/dist/cjs/index.cjs.js +3 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-app_7.cjs.entry.js +2924 -0
- package/dist/cjs/kompendium-code.cjs.entry.js +2724 -0
- package/dist/cjs/kompendium-code.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-component.cjs.entry.js +207 -0
- package/dist/cjs/kompendium-component.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-debug.cjs.entry.js +47 -0
- package/dist/cjs/kompendium-debug.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-example-code.cjs.entry.js +20 -0
- package/dist/cjs/kompendium-example-code.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-example-markdown.cjs.entry.js +165 -0
- package/dist/cjs/kompendium-example-markdown.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-guide.cjs.entry.js +33 -0
- package/dist/cjs/kompendium-guide.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-markdown.cjs.entry.js +48923 -0
- package/dist/cjs/kompendium-markdown.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-playground.cjs.entry.js +89 -0
- package/dist/cjs/kompendium-playground.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-proplist.kompendium-taglist.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-proplist_2.cjs.entry.js +49 -0
- package/dist/cjs/kompendium-type.cjs.entry.js +83 -0
- package/dist/cjs/kompendium-type.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium.cjs.js +25 -0
- package/dist/cjs/kompendium.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/markdown-types-B884tLd-.js +15 -0
- package/dist/cjs/markdown-types-B884tLd-.js.map +1 -0
- package/dist/cjs/methods-DoA78dOH.js +97 -0
- package/dist/cjs/methods-DoA78dOH.js.map +1 -0
- package/dist/cjs/types-SjA7Kcy_.js +8 -0
- package/dist/cjs/types-SjA7Kcy_.js.map +1 -0
- package/dist/collection/assets/favicon.svg +65 -0
- package/dist/collection/assets/icons/bookmark-fill.svg +1 -0
- package/dist/collection/assets/icons/danger.svg +1 -0
- package/dist/collection/assets/icons/debug.svg +1 -0
- package/dist/collection/assets/icons/important.svg +1 -0
- package/dist/collection/assets/icons/info.svg +1 -0
- package/dist/collection/assets/icons/logo.svg +1 -0
- package/dist/collection/assets/icons/note.svg +1 -0
- package/dist/collection/assets/icons/search.svg +1 -0
- package/dist/collection/assets/icons/tip.svg +1 -0
- package/dist/collection/assets/icons/warning.svg +1 -0
- package/dist/collection/assets/logotype.svg +64 -0
- package/dist/collection/collection-manifest.json +35 -0
- package/dist/collection/components/anchor-scroll.js +61 -0
- package/dist/collection/components/anchor-scroll.js.map +1 -0
- package/dist/collection/components/app/app.css +125 -0
- package/dist/collection/components/app/app.js +149 -0
- package/dist/collection/components/app/app.js.map +1 -0
- package/dist/collection/components/code/code.css +250 -0
- package/dist/collection/components/code/code.js +82 -0
- package/dist/collection/components/code/code.js.map +1 -0
- package/dist/collection/components/code/examples/code.js +14 -0
- package/dist/collection/components/code/examples/code.js.map +1 -0
- package/dist/collection/components/component/component.css +383 -0
- package/dist/collection/components/component/component.js +191 -0
- package/dist/collection/components/component/component.js.map +1 -0
- package/dist/collection/components/component/templates/events.js +32 -0
- package/dist/collection/components/component/templates/events.js.map +1 -0
- package/dist/collection/components/component/templates/examples.js +17 -0
- package/dist/collection/components/component/templates/examples.js.map +1 -0
- package/dist/collection/components/component/templates/methods.js +54 -0
- package/dist/collection/components/component/templates/methods.js.map +1 -0
- package/dist/collection/components/component/templates/props.js +36 -0
- package/dist/collection/components/component/templates/props.js.map +1 -0
- package/dist/collection/components/component/templates/slots.js +14 -0
- package/dist/collection/components/component/templates/slots.js.map +1 -0
- package/dist/collection/components/component/templates/style.js +14 -0
- package/dist/collection/components/component/templates/style.js.map +1 -0
- package/dist/collection/components/darkmode-switch/darkmode-switch.css +141 -0
- package/dist/collection/components/darkmode-switch/darkmode-switch.js +90 -0
- package/dist/collection/components/darkmode-switch/darkmode-switch.js.map +1 -0
- package/dist/collection/components/darkmode-switch/types.js +2 -0
- package/dist/collection/components/darkmode-switch/types.js.map +1 -0
- package/dist/collection/components/debug/debug.js +146 -0
- package/dist/collection/components/debug/debug.js.map +1 -0
- package/dist/collection/components/guide/guide.js +61 -0
- package/dist/collection/components/guide/guide.js.map +1 -0
- package/dist/collection/components/markdown/examples/markdown-example.js +150 -0
- package/dist/collection/components/markdown/examples/markdown-example.js.map +1 -0
- package/dist/collection/components/markdown/examples/markdown.js +14 -0
- package/dist/collection/components/markdown/examples/markdown.js.map +1 -0
- package/dist/collection/components/markdown/markdown-types.js +8 -0
- package/dist/collection/components/markdown/markdown-types.js.map +1 -0
- package/dist/collection/components/markdown/markdown.css +660 -0
- package/dist/collection/components/markdown/markdown.js +83 -0
- package/dist/collection/components/markdown/markdown.js.map +1 -0
- package/dist/collection/components/navigation/navigation.css +403 -0
- package/dist/collection/components/navigation/navigation.js +184 -0
- package/dist/collection/components/navigation/navigation.js.map +1 -0
- package/dist/collection/components/playground/playground.css +198 -0
- package/dist/collection/components/playground/playground.js +174 -0
- package/dist/collection/components/playground/playground.js.map +1 -0
- package/dist/collection/components/playground/playground.types.js +2 -0
- package/dist/collection/components/playground/playground.types.js.map +1 -0
- package/dist/collection/components/proplist/proplist.css +334 -0
- package/dist/collection/components/proplist/proplist.js +53 -0
- package/dist/collection/components/proplist/proplist.js.map +1 -0
- package/dist/collection/components/search/search.css +183 -0
- package/dist/collection/components/search/search.js +76 -0
- package/dist/collection/components/search/search.js.map +1 -0
- package/dist/collection/components/taglist/taglist.css +58 -0
- package/dist/collection/components/taglist/taglist.js +82 -0
- package/dist/collection/components/taglist/taglist.js.map +1 -0
- package/dist/collection/components/type/templates/alias.js +11 -0
- package/dist/collection/components/type/templates/alias.js.map +1 -0
- package/dist/collection/components/type/templates/enum.js +25 -0
- package/dist/collection/components/type/templates/enum.js.map +1 -0
- package/dist/collection/components/type/templates/interface.js +13 -0
- package/dist/collection/components/type/templates/interface.js.map +1 -0
- package/dist/collection/components/type/type.js +97 -0
- package/dist/collection/components/type/type.js.map +1 -0
- package/dist/collection/index.js +4 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/kompendium/config.js +7 -0
- package/dist/collection/kompendium/config.js.map +1 -0
- package/dist/collection/kompendium/filesystem.js +9 -0
- package/dist/collection/kompendium/filesystem.js.map +1 -0
- package/dist/collection/kompendium/generator.js +217 -0
- package/dist/collection/kompendium/generator.js.map +1 -0
- package/dist/collection/kompendium/guides.js +30 -0
- package/dist/collection/kompendium/guides.js.map +1 -0
- package/dist/collection/kompendium/index.js +2 -0
- package/dist/collection/kompendium/index.js.map +1 -0
- package/dist/collection/kompendium/markdown-admonitions.js +82 -0
- package/dist/collection/kompendium/markdown-admonitions.js.map +1 -0
- package/dist/collection/kompendium/markdown-code.js +40 -0
- package/dist/collection/kompendium/markdown-code.js.map +1 -0
- package/dist/collection/kompendium/markdown-frontmatter.js +12 -0
- package/dist/collection/kompendium/markdown-frontmatter.js.map +1 -0
- package/dist/collection/kompendium/markdown-nodes.js +10 -0
- package/dist/collection/kompendium/markdown-nodes.js.map +1 -0
- package/dist/collection/kompendium/markdown-typelinks.js +115 -0
- package/dist/collection/kompendium/markdown-typelinks.js.map +1 -0
- package/dist/collection/kompendium/markdown.js +35 -0
- package/dist/collection/kompendium/markdown.js.map +1 -0
- package/dist/collection/kompendium/menu.js +149 -0
- package/dist/collection/kompendium/menu.js.map +1 -0
- package/dist/collection/kompendium/schema.js +167 -0
- package/dist/collection/kompendium/schema.js.map +1 -0
- package/dist/collection/kompendium/search.js +144 -0
- package/dist/collection/kompendium/search.js.map +1 -0
- package/dist/collection/kompendium/source.js +81 -0
- package/dist/collection/kompendium/source.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/basic.js +48 -0
- package/dist/collection/kompendium/test/fixtures/basic.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/example-type.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/example-type.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/node-modules-type.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/node-modules-type.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/private-types.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/private-types.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/stencil-component-types.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/stencil-component-types.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/test-helper-type.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/test-helper-type.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/valid-types.js +29 -0
- package/dist/collection/kompendium/test/fixtures/filtering/valid-types.js.map +1 -0
- package/dist/collection/kompendium/typedoc.js +481 -0
- package/dist/collection/kompendium/typedoc.js.map +1 -0
- package/dist/collection/kompendium/watch.js +9 -0
- package/dist/collection/kompendium/watch.js.map +1 -0
- package/dist/collection/types.js +2 -0
- package/dist/collection/types.js.map +1 -0
- package/dist/config.ts +8 -0
- package/dist/esm/_commonjsHelpers-BFTU3MAI.js +10 -0
- package/dist/esm/_commonjsHelpers-BFTU3MAI.js.map +1 -0
- package/dist/esm/anchor-scroll-BAGXN2n6.js +65 -0
- package/dist/esm/anchor-scroll-BAGXN2n6.js.map +1 -0
- package/dist/esm/index-9UrzenzW.js +1857 -0
- package/dist/esm/index-9UrzenzW.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.js.map +1 -0
- package/dist/esm/kompendium-app_7.entry.js +2916 -0
- package/dist/esm/kompendium-code.entry.js +2722 -0
- package/dist/esm/kompendium-code.entry.js.map +1 -0
- package/dist/esm/kompendium-component.entry.js +205 -0
- package/dist/esm/kompendium-component.entry.js.map +1 -0
- package/dist/esm/kompendium-debug.entry.js +45 -0
- package/dist/esm/kompendium-debug.entry.js.map +1 -0
- package/dist/esm/kompendium-example-code.entry.js +18 -0
- package/dist/esm/kompendium-example-code.entry.js.map +1 -0
- package/dist/esm/kompendium-example-markdown.entry.js +163 -0
- package/dist/esm/kompendium-example-markdown.entry.js.map +1 -0
- package/dist/esm/kompendium-guide.entry.js +31 -0
- package/dist/esm/kompendium-guide.entry.js.map +1 -0
- package/dist/esm/kompendium-markdown.entry.js +48921 -0
- package/dist/esm/kompendium-markdown.entry.js.map +1 -0
- package/dist/esm/kompendium-playground.entry.js +87 -0
- package/dist/esm/kompendium-playground.entry.js.map +1 -0
- package/dist/esm/kompendium-proplist.kompendium-taglist.entry.js.map +1 -0
- package/dist/esm/kompendium-proplist_2.entry.js +46 -0
- package/dist/esm/kompendium-type.entry.js +81 -0
- package/dist/esm/kompendium-type.entry.js.map +1 -0
- package/dist/esm/kompendium.js +21 -0
- package/dist/esm/kompendium.js.map +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/markdown-types-Ajsawr_9.js +12 -0
- package/dist/esm/markdown-types-Ajsawr_9.js.map +1 -0
- package/dist/esm/methods-BAjd6f7g.js +94 -0
- package/dist/esm/methods-BAjd6f7g.js.map +1 -0
- package/dist/esm/types-BIPLEi1G.js +6 -0
- package/dist/esm/types-BIPLEi1G.js.map +1 -0
- package/dist/filesystem.ts +9 -0
- package/dist/generator.ts +302 -0
- package/dist/guides.ts +49 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/index.ts +1 -0
- package/dist/kompendium/index.esm.js +2 -0
- package/dist/kompendium/index.esm.js.map +1 -0
- package/dist/kompendium/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-code.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-component.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-debug.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-example-code.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-example-markdown.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-guide.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-markdown.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-playground.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-proplist.kompendium-taglist.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-type.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium.css +47 -0
- package/dist/kompendium/kompendium.esm.js +2 -0
- package/dist/kompendium/kompendium.esm.js.map +1 -0
- package/dist/kompendium/loader.esm.js.map +1 -0
- package/dist/kompendium/p-15e4b2c0.entry.js +2 -0
- package/dist/kompendium/p-15e4b2c0.entry.js.map +1 -0
- package/dist/kompendium/p-1cf0168f.entry.js +2 -0
- package/dist/kompendium/p-1cf0168f.entry.js.map +1 -0
- package/dist/kompendium/p-29c23c89.entry.js +2 -0
- package/dist/kompendium/p-29c23c89.entry.js.map +1 -0
- package/dist/kompendium/p-3981d11f.entry.js +2 -0
- package/dist/kompendium/p-3981d11f.entry.js.map +1 -0
- package/dist/kompendium/p-93f0548d.entry.js +2 -0
- package/dist/kompendium/p-93f0548d.entry.js.map +1 -0
- package/dist/kompendium/p-97b02575.entry.js +2 -0
- package/dist/kompendium/p-97b02575.entry.js.map +1 -0
- package/dist/kompendium/p-9UrzenzW.js +3 -0
- package/dist/kompendium/p-9UrzenzW.js.map +1 -0
- package/dist/kompendium/p-Ajsawr_9.js +2 -0
- package/dist/kompendium/p-Ajsawr_9.js.map +1 -0
- package/dist/kompendium/p-BAGXN2n6.js +2 -0
- package/dist/kompendium/p-BAGXN2n6.js.map +1 -0
- package/dist/kompendium/p-BFTU3MAI.js +2 -0
- package/dist/kompendium/p-BFTU3MAI.js.map +1 -0
- package/dist/kompendium/p-BIPLEi1G.js +2 -0
- package/dist/kompendium/p-BIPLEi1G.js.map +1 -0
- package/dist/kompendium/p-CnQEA7KO.js +2 -0
- package/dist/kompendium/p-CnQEA7KO.js.map +1 -0
- package/dist/kompendium/p-b0f95bd6.entry.js +2 -0
- package/dist/kompendium/p-b0f95bd6.entry.js.map +1 -0
- package/dist/kompendium/p-d9bcc473.entry.js +10 -0
- package/dist/kompendium/p-d9bcc473.entry.js.map +1 -0
- package/dist/kompendium/p-e36f3f1e.entry.js +2 -0
- package/dist/kompendium/p-e36f3f1e.entry.js.map +1 -0
- package/dist/kompendium/p-e52a2f57.entry.js +2 -0
- package/dist/kompendium/p-e52a2f57.entry.js.map +1 -0
- package/dist/kompendium/p-ec5861de.entry.js +2 -0
- package/dist/kompendium/p-ec5861de.entry.js.map +1 -0
- package/dist/markdown-admonitions.ts +112 -0
- package/dist/markdown-code.ts +51 -0
- package/dist/markdown-frontmatter.ts +19 -0
- package/dist/markdown-nodes.ts +23 -0
- package/dist/markdown-typelinks.ts +166 -0
- package/dist/markdown.ts +49 -0
- package/dist/menu.ts +189 -0
- package/dist/schema.ts +233 -0
- package/dist/search.ts +197 -0
- package/dist/source.ts +129 -0
- package/dist/typedoc.ts +665 -0
- package/dist/types/components/anchor-scroll.d.ts +36 -0
- package/dist/types/components/app/app.d.ts +22 -0
- package/dist/types/components/code/code.d.ts +26 -0
- package/dist/types/components/code/examples/code.d.ts +3 -0
- package/dist/types/components/component/component.d.ts +32 -0
- package/dist/types/components/component/templates/events.d.ts +5 -0
- package/dist/types/components/component/templates/examples.d.ts +9 -0
- package/dist/types/components/component/templates/methods.d.ts +5 -0
- package/dist/types/components/component/templates/props.d.ts +5 -0
- package/dist/types/components/component/templates/slots.d.ts +5 -0
- package/dist/types/components/component/templates/style.d.ts +5 -0
- package/dist/types/components/darkmode-switch/darkmode-switch.d.ts +18 -0
- package/dist/types/components/darkmode-switch/types.d.ts +2 -0
- package/dist/types/components/debug/debug.d.ts +24 -0
- package/dist/types/components/guide/guide.d.ts +14 -0
- package/dist/types/components/markdown/examples/markdown-example.d.ts +1 -0
- package/dist/types/components/markdown/examples/markdown.d.ts +7 -0
- package/dist/types/components/markdown/markdown-types.d.ts +2 -0
- package/dist/types/components/markdown/markdown.d.ts +20 -0
- package/dist/types/components/navigation/navigation.d.ts +35 -0
- package/dist/types/components/playground/playground.d.ts +32 -0
- package/dist/types/components/playground/playground.types.d.ts +1 -0
- package/dist/types/components/proplist/proplist.d.ts +12 -0
- package/dist/types/components/search/search.d.ts +15 -0
- package/dist/types/components/taglist/taglist.d.ts +16 -0
- package/dist/types/components/type/templates/alias.d.ts +4 -0
- package/dist/types/components/type/templates/enum.d.ts +4 -0
- package/dist/types/components/type/templates/interface.d.ts +4 -0
- package/dist/types/components/type/type.d.ts +15 -0
- package/dist/types/components.d.ts +517 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/kompendium/config.d.ts +2 -0
- package/dist/types/kompendium/filesystem.d.ts +1 -0
- package/dist/types/kompendium/generator.d.ts +4 -0
- package/dist/types/kompendium/guides.d.ts +9 -0
- package/dist/types/kompendium/index.d.ts +1 -0
- package/dist/types/kompendium/markdown-admonitions.d.ts +3 -0
- package/dist/types/kompendium/markdown-code.d.ts +2 -0
- package/dist/types/kompendium/markdown-frontmatter.d.ts +6 -0
- package/dist/types/kompendium/markdown-nodes.d.ts +12 -0
- package/dist/types/kompendium/markdown-typelinks.d.ts +21 -0
- package/dist/types/kompendium/markdown.d.ts +8 -0
- package/dist/types/kompendium/menu.d.ts +12 -0
- package/dist/types/kompendium/schema.d.ts +9 -0
- package/dist/types/kompendium/search.d.ts +3 -0
- package/dist/types/kompendium/source.d.ts +10 -0
- package/dist/types/kompendium/test/fixtures/basic.d.ts +65 -0
- package/dist/types/kompendium/test/fixtures/filtering/example-type.d.ts +8 -0
- package/dist/types/kompendium/test/fixtures/filtering/node-modules-type.d.ts +8 -0
- package/dist/types/kompendium/test/fixtures/filtering/private-types.d.ts +23 -0
- package/dist/types/kompendium/test/fixtures/filtering/stencil-component-types.d.ts +19 -0
- package/dist/types/kompendium/test/fixtures/filtering/test-helper-type.d.ts +8 -0
- package/dist/types/kompendium/test/fixtures/filtering/valid-types.d.ts +42 -0
- package/dist/types/kompendium/typedoc.d.ts +2 -0
- package/dist/types/kompendium/watch.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1746 -0
- package/dist/types/types.d.ts +119 -0
- package/dist/watch.ts +14 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +116 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
<img width="100%" alt="hero" src="https://user-images.githubusercontent.com/35954987/99229931-f5889200-27ee-11eb-934e-6284b6978b07.png">
|
|
2
|
+
|
|
3
|
+
# Kompendium
|
|
4
|
+
 [](https://www.npmjs.com/package/kompendium) [](https://github.com/semantic-release/semantic-release)
|
|
5
|
+
|
|
6
|
+
> **Note:** This is [Lundalogik's maintained fork](https://github.com/Lundalogik/kompendium)
|
|
7
|
+
> of [jgroth/kompendium](https://github.com/jgroth/kompendium), published on npm as
|
|
8
|
+
> [`@limetech/kompendium`](https://www.npmjs.com/package/@limetech/kompendium).
|
|
9
|
+
> Changes made here are also offered upstream as pull requests, and upstream
|
|
10
|
+
> is merged back continuously. See [FORK.md](./FORK.md) for how the fork works.
|
|
11
|
+
|
|
12
|
+
# Introduction
|
|
13
|
+
Kompendium is a simple, fast and elegant tool for generating documentation for components made with Stencil.
|
|
14
|
+
|
|
15
|
+
Just type everything in Markdown, from your code blocks to description texts of example components. Then enjoy a lightning fast responsive compendium of your components, with component API and live playground.
|
|
16
|
+
|
|
17
|
+
### Please note
|
|
18
|
+
Kompendium is still in development. Consider this an early preview!
|
|
19
|
+
|
|
20
|
+
# Features
|
|
21
|
+
* **Live playground** — No matter if you are updating your docs, working on your examples, or tweaking css, Kompendium will instantly auto-refresh and you will see the latest changes right away. No need for manual rebuilding and refreshing the browser!
|
|
22
|
+
|
|
23
|
+
* **Elegant design** — Your examples and their description text are displayed on the left part of the documentation, while the code that generates them is resides on the right, and is smartly divided into tabs that show contents of connected files. It goes without saying that the layout is fully responsive and flawlessly adapts to tablets and phones.
|
|
24
|
+
|
|
25
|
+
* **Dark mode** — Kompendium seamlessly switches between light and dark theme using `prefers-color-scheme` media query. All colors get automatically dimmed in dark mode, to provide a more decent experience and a more accessible user interface. Additionally, users can easily switch to their desired theme and Kompendium will remember their choice.
|
|
26
|
+
|
|
27
|
+
* **Multi page** — Kompendium divides your documentation into several pages, making sure that linkability is provided.
|
|
28
|
+
|
|
29
|
+
* **Markdown support** — Who doesn’t want to write in Markdown? While coding and articulating features, functionalities, and notes.
|
|
30
|
+
|
|
31
|
+
* **Admonitions support** — You can easily add admonitions within your markdown text to generate side content that do not interrupt the document flow. Kompendium comes with custom-made visual support for six types of these call-out blocks (`info`, `warning`, `danger`, `note`, `tip`, and `important`). [read more](https://github.com/elviswolcott/remark-admonitions).
|
|
32
|
+
|
|
33
|
+
* **Syntax highlighting** — Tabs that show the source code of for example `.tsx` or `.scss` files used in the Stencil example components have inbuilt syntax highlighting for each language. Also, code-blocks inside your documentations can benefit from syntax highlighting, if you specify their respective language. For the highlighting, we have hand-picked colors that look gorgeous both in light- and dark-mode.
|
|
34
|
+
|
|
35
|
+
* **Debug mode** — You can isolate individual examples of the components which are showcased in the documentation, simply by pressing a button. This feature helps cleaning up the DOM and therefore an easier debugging experience.
|
|
36
|
+
|
|
37
|
+
* **Search** — Kompendium has a simple search engine that makes finding information easier for users.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# Demo
|
|
42
|
+
You can see a live demo of Kompendium, being used by Lime Technologies to create their [component library and design system docs](https://lundalogik.github.io/lime-elements/versions/latest).
|
|
43
|
+
|
|
44
|
+
<img width="50%" alt="kompendium-dark" src="https://github.com/jgroth/kompendium/assets/35954987/45ef80b7-a850-4647-a708-48dfeadb8e7a"><img width="50%" alt="kompendium-light" src="https://github.com/jgroth/kompendium/assets/35954987/f1a38bdb-1fee-4d87-895b-ecc4221e62b9">
|
|
45
|
+
|
|
46
|
+
# Contributing
|
|
47
|
+
Please see CONTRIBUTING for details.
|
|
48
|
+
|
|
49
|
+
# Credits
|
|
50
|
+
* [Johan Groth](https://github.com/jgroth) — Development
|
|
51
|
+
* [Adrian Schmidt](https://github.com/adrianschmidt) — Development
|
|
52
|
+
* [Kiarokh Moattar](https://github.com/Kiarokh) — Design
|
|
53
|
+
|
|
54
|
+
# License
|
|
55
|
+
The MIT License (MIT).
|
|
56
|
+
_____________
|
|
57
|
+
|
|
58
|
+
# Documentation
|
|
59
|
+
## Getting started
|
|
60
|
+
### Installation
|
|
61
|
+
Kompendium is available as a package on NPM and is installed using the NPM CLI
|
|
62
|
+
````
|
|
63
|
+
npm install kompendium
|
|
64
|
+
|
|
65
|
+
````
|
|
66
|
+
|
|
67
|
+
## Configuration
|
|
68
|
+
Next, we need to configure Kompendium to generate our documentation. Kompendium runs using the `docs-custom` target in Stencil. We also need to copy the Kompendium components to our `www` folder in order to use them with the Stencil dev server.
|
|
69
|
+
````ts
|
|
70
|
+
stencil.config.ts
|
|
71
|
+
import { Config } from '@stencil/core';
|
|
72
|
+
import { kompendium } from 'kompendium';
|
|
73
|
+
|
|
74
|
+
export const config: Config = {
|
|
75
|
+
namespace: 'my-project',
|
|
76
|
+
outputTargets: [
|
|
77
|
+
{
|
|
78
|
+
type: 'docs-custom',
|
|
79
|
+
strict: true,
|
|
80
|
+
generator: kompendium()
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: 'www',
|
|
84
|
+
serviceWorker: null,
|
|
85
|
+
copy: [{
|
|
86
|
+
src: '../node_modules/kompendium/dist/',
|
|
87
|
+
dest: 'assets/kompendium/'
|
|
88
|
+
}]
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
};
|
|
92
|
+
````
|
|
93
|
+
To get the generated documentation up and running, simply use the `kompendium-app` component in your `index.html` file. Don't forget to also include the scripts and styles, both for your own components and the ones that we copied during the build.
|
|
94
|
+
|
|
95
|
+
````html
|
|
96
|
+
index.html
|
|
97
|
+
<!DOCTYPE html>
|
|
98
|
+
<html>
|
|
99
|
+
<head>
|
|
100
|
+
<meta charset="UTF-8">
|
|
101
|
+
<meta name="description" content="My Stencil components">
|
|
102
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
103
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
104
|
+
<base href="/">
|
|
105
|
+
<title>My Project</title>
|
|
106
|
+
</head>
|
|
107
|
+
|
|
108
|
+
<body>
|
|
109
|
+
<link href="/build/my-project.css" rel="stylesheet" />
|
|
110
|
+
<script type="module" src="/build/my-project.esm.js"></script>
|
|
111
|
+
<script nomodule src="/build/my-project.js"></script>
|
|
112
|
+
|
|
113
|
+
<link href="/assets/kompendium/kompendium/kompendium.css" rel="stylesheet" />
|
|
114
|
+
<script type="module" src="/assets/kompendium/kompendium/kompendium.esm.js"></script>
|
|
115
|
+
<script nomodule src="/assets/kompendium/kompendium/kompendium.js"></script>
|
|
116
|
+
|
|
117
|
+
<kompendium-app></kompendium-app>
|
|
118
|
+
</body>
|
|
119
|
+
</html>
|
|
120
|
+
````
|
|
121
|
+
|
|
122
|
+
### Running the dev server
|
|
123
|
+
Next, we can start the dev server by running
|
|
124
|
+
````
|
|
125
|
+
stencil build --dev --watch --serve --docs
|
|
126
|
+
````
|
|
127
|
+
|
|
128
|
+
## Writing documentation
|
|
129
|
+
The generated documentation is fetched from the doc blocks inside the components source files. If we would have a component like the one below, it would generate the corresponding documentation. Kompendium understands how to read Markdown, so any additional markup will automatically be parsed.
|
|
130
|
+
|
|
131
|
+
````tsx
|
|
132
|
+
my-component.tsx
|
|
133
|
+
import { Component, h, Prop } from '@stencil/core';
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* This is a sample component
|
|
137
|
+
*
|
|
138
|
+
* Kompendium will parse the doc blocks and render it using Markdown
|
|
139
|
+
*/
|
|
140
|
+
@Component({
|
|
141
|
+
tag: 'my-component',
|
|
142
|
+
shadow: true,
|
|
143
|
+
})
|
|
144
|
+
export class MyComponent {
|
|
145
|
+
/**
|
|
146
|
+
* This is a sample property
|
|
147
|
+
*/
|
|
148
|
+
@Prop()
|
|
149
|
+
public name: string;
|
|
150
|
+
|
|
151
|
+
render() {
|
|
152
|
+
return <p>Hello, {this.name}!</p>;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
````
|
|
156
|
+
|
|
157
|
+
## Adding examples
|
|
158
|
+
To improve the documentation even more, you can add examples of how to use your components. An example component is just another component that displays how your component is used. The example will be displayed both live and with the source code for the example.
|
|
159
|
+
To include an example, the custom `@exampleComponent` doc block decorator should be used together with the name of the component. There is no limit to the number of components you can include.
|
|
160
|
+
|
|
161
|
+
````tsx
|
|
162
|
+
my-component.tsx
|
|
163
|
+
import { Component, h, Prop } from '@stencil/core';
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* This is a sample component
|
|
167
|
+
*
|
|
168
|
+
* Kompendium will parse the doc blocks and render it using Markdown
|
|
169
|
+
*
|
|
170
|
+
* @exampleComponent my-component-example
|
|
171
|
+
*/
|
|
172
|
+
@Component({
|
|
173
|
+
tag: 'my-component',
|
|
174
|
+
shadow: true,
|
|
175
|
+
})
|
|
176
|
+
export class MyComponent {
|
|
177
|
+
/**
|
|
178
|
+
* This is a sample property
|
|
179
|
+
*/
|
|
180
|
+
@Prop()
|
|
181
|
+
public name: string;
|
|
182
|
+
|
|
183
|
+
render() {
|
|
184
|
+
return <p>Hello, {this.name}!</p>;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
````
|
|
188
|
+
The example component in this case is very simple
|
|
189
|
+
|
|
190
|
+
````tsx
|
|
191
|
+
my-component-example.tsx
|
|
192
|
+
import { Component, h } from '@stencil/core';
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* This is an example for the `my-component` component
|
|
196
|
+
*/
|
|
197
|
+
@Component({
|
|
198
|
+
tag: 'my-component-example',
|
|
199
|
+
shadow: true,
|
|
200
|
+
})
|
|
201
|
+
export class MyComponentExample {
|
|
202
|
+
render() {
|
|
203
|
+
return <my-component name="World" />;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
````
|
|
207
|
+
It's recomended to either name all the examples in a similar fashion, or to place them in an examples/ folder or similar. This way, it's very easy to exclude them from the production build by excluding them in the Stencil configuration.
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## Type information
|
|
211
|
+
Kompendium can generate documentation about any custom Typescript types that you use in your components. You might have props or events that implement a custom interface and this should be documented as well so it is easy for the consumer of your components to use them.
|
|
212
|
+
### Configuration
|
|
213
|
+
All types needs to be exported from a single file. The default name of this file is ./src/types.ts, but this can be configured if needed.
|
|
214
|
+
````ts
|
|
215
|
+
stencil.config.ts
|
|
216
|
+
{
|
|
217
|
+
type: 'docs-custom',
|
|
218
|
+
strict: true,
|
|
219
|
+
generator: kompendium({
|
|
220
|
+
typeRoot: './src/interface.d.ts'
|
|
221
|
+
})
|
|
222
|
+
}
|
|
223
|
+
````
|
|
224
|
+
**Note:** This file should also be exported from the `index.ts` file so type hints will be available when consuming the components in a code editor.
|
|
225
|
+
### Example
|
|
226
|
+
````tsx
|
|
227
|
+
my-component.tsx
|
|
228
|
+
import { Component, h, Prop } from '@stencil/core';
|
|
229
|
+
import { MyData } from './my-data.ts';
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* This is a sample component
|
|
233
|
+
*
|
|
234
|
+
* Kompendium will parse the doc blocks and render it using Markdown
|
|
235
|
+
*/
|
|
236
|
+
@Component({
|
|
237
|
+
tag: 'my-component',
|
|
238
|
+
shadow: true,
|
|
239
|
+
})
|
|
240
|
+
export class MyComponent {
|
|
241
|
+
/**
|
|
242
|
+
* This is a sample property
|
|
243
|
+
*/
|
|
244
|
+
@Prop()
|
|
245
|
+
public data: MyData;
|
|
246
|
+
|
|
247
|
+
render() {
|
|
248
|
+
return <p>Hello, {this.data.name}!</p>;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
````
|
|
252
|
+
````ts
|
|
253
|
+
my-data.ts
|
|
254
|
+
/**
|
|
255
|
+
* This is a custom interface used in `my-component`
|
|
256
|
+
*/
|
|
257
|
+
export interface MyData {
|
|
258
|
+
/**
|
|
259
|
+
* The name to display when the component renders
|
|
260
|
+
*/
|
|
261
|
+
name: string;
|
|
262
|
+
}
|
|
263
|
+
````
|
|
264
|
+
````ts
|
|
265
|
+
interface.d.ts
|
|
266
|
+
export * from './my-component/my-data.ts';
|
|
267
|
+
````
|
|
268
|
+
## Configuration options
|
|
269
|
+
| Option | Description | Default value |
|
|
270
|
+
|------------ |--------------------------------------------------------------- |--------------------------- |
|
|
271
|
+
| `path` | Path to folder where Kompendium will store the generated data | `.kompendium/ |
|
|
272
|
+
| `publicPath` | The public web distribution directory used by Stencil. | `www` |
|
|
273
|
+
| `title` | Title to display on top of the documentation | Fetched from `package.json` |
|
|
274
|
+
| `typeRoot` | Entry point for type information | `./src/types.ts` |
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Inheritance of styles and overriding them
|
|
279
|
+
|
|
280
|
+
You will be using Kompendium to generate documentation for your Stencil components and show both you and your consumers a preview of these components. Web components are inherently isolated, carrying their own styles that are not easily manipulated externally. However, it's important to note that Kompendium introduces its own styles, some of which are inherited by the web components displayed on the documentation page.
|
|
281
|
+
|
|
282
|
+
In most scenarios, this style-inheritance is inconsequential. However, when developing a comprehensive component library, certain generic CSS properties require careful attention to prevent them from being inherited from Kompendium. These typically include font-related styles such as `font-family`, `font-size`, `line-height`, and `color`.
|
|
283
|
+
|
|
284
|
+
Exactly because these are inherited properties, these are usually set at the `:root` level in the application consuming your web components, eliminating the need to specify them individually in each web component. To maintain style consistency, you can override these properties on the documentation page.
|
|
285
|
+
|
|
286
|
+
Kompendium offers a few CSS Custom Properties which enables you to do so.
|
|
287
|
+
|
|
288
|
+
- `--kompendium-example-color`: Overrides the inherited `color` affecting text color in your web components.
|
|
289
|
+
- `--kompendium-example-font-family`: Overrides the inherited `font-family` in your web components.
|
|
290
|
+
- `--kompendium-example-font-size`: Optionally overrides the inherited `font-size`, depending on the font-family in use.
|
|
291
|
+
- `--kompendium-example-line-height`: Optionally overrides the inherited `line-height`, depending on the font-family in use.
|
|
292
|
+
|
|
293
|
+
You can define these properties for your instance of Kompendium as shown below:
|
|
294
|
+
|
|
295
|
+
```html
|
|
296
|
+
<!DOCTYPE html>
|
|
297
|
+
<html dir="ltr">
|
|
298
|
+
<head>
|
|
299
|
+
<!-- other stuff in the `head` section -->
|
|
300
|
+
<style>
|
|
301
|
+
:root {
|
|
302
|
+
--kompendium-example-color: #1d1d1d;
|
|
303
|
+
--kompendium-example-font-family: 'Roboto', sans-serif;
|
|
304
|
+
}
|
|
305
|
+
</style>
|
|
306
|
+
</head>
|
|
307
|
+
|
|
308
|
+
<body>
|
|
309
|
+
<!-- other stuff in the `body` section -->
|
|
310
|
+
<kompendium-app path="/kompendium.json"></kompendium-app>
|
|
311
|
+
</body>
|
|
312
|
+
</html>
|
|
313
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
|
+
|
|
5
|
+
function getDefaultExportFromCjs (x) {
|
|
6
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
exports.commonjsGlobal = commonjsGlobal;
|
|
10
|
+
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
|
11
|
+
//# sourceMappingURL=_commonjsHelpers-BJu3ubxk.js.map
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=_commonjsHelpers-BJu3ubxk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_commonjsHelpers-BJu3ubxk.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Utility functions for handling anchor link scrolling in shadow DOM components.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get the current route from the URL hash (without the leading #).
|
|
8
|
+
*
|
|
9
|
+
* For hash-based routing where the entire hash is the route.
|
|
10
|
+
* Example: "#/component/limel-button/examples/" → "/component/limel-button/examples/"
|
|
11
|
+
* @returns {string} The route extracted from the URL hash
|
|
12
|
+
*/
|
|
13
|
+
function getRoute() {
|
|
14
|
+
return window.location.hash.substring(1);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Extract the anchor ID from the current URL hash.
|
|
18
|
+
*
|
|
19
|
+
* Handles both simple anchors (#section) and route-based anchors (#/guide/page#section).
|
|
20
|
+
* Returns null if no valid anchor is found.
|
|
21
|
+
*
|
|
22
|
+
* Example: "#/guide/changelog#v2-features" → "v2-features"
|
|
23
|
+
* @returns {string | null} The anchor ID or null if not found
|
|
24
|
+
*/
|
|
25
|
+
function getAnchorId() {
|
|
26
|
+
const hash = window.location.hash;
|
|
27
|
+
if (!hash) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
// Match the last #fragment in the hash
|
|
31
|
+
// This handles both "#section" and "#/route/path#section"
|
|
32
|
+
const anchorMatch = hash.match(/#([^#]+)$/);
|
|
33
|
+
return anchorMatch ? anchorMatch[1] : null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Scroll to an anchor element within a shadow root.
|
|
37
|
+
*
|
|
38
|
+
* Uses requestAnimationFrame to ensure the DOM is ready before scrolling.
|
|
39
|
+
* @param {ShadowRoot} shadowRoot - The shadow root to search for the element
|
|
40
|
+
* @param {ScrollBehavior} behavior - Scroll behavior ('auto' or 'smooth')
|
|
41
|
+
*/
|
|
42
|
+
function scrollToAnchor(shadowRoot, behavior = 'auto') {
|
|
43
|
+
const anchorId = getAnchorId();
|
|
44
|
+
if (!anchorId) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
requestAnimationFrame(() => {
|
|
48
|
+
scrollToElement(shadowRoot, anchorId, behavior);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Scroll to a specific element by ID within a shadow root.
|
|
53
|
+
* @param {ShadowRoot} shadowRoot - The shadow root to search for the element
|
|
54
|
+
* @param {string} id - The element ID to scroll to
|
|
55
|
+
* @param {ScrollBehavior} behavior - Scroll behavior ('auto' or 'smooth')
|
|
56
|
+
*/
|
|
57
|
+
function scrollToElement(shadowRoot, id, behavior = 'auto') {
|
|
58
|
+
const element = shadowRoot.getElementById(id);
|
|
59
|
+
if (element) {
|
|
60
|
+
element.scrollIntoView({ behavior: behavior });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
exports.getRoute = getRoute;
|
|
65
|
+
exports.scrollToAnchor = scrollToAnchor;
|
|
66
|
+
exports.scrollToElement = scrollToElement;
|
|
67
|
+
//# sourceMappingURL=anchor-scroll-BmplAyR0.js.map
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=anchor-scroll-BmplAyR0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor-scroll-BmplAyR0.js","sources":["src/components/anchor-scroll.ts"],"sourcesContent":["/**\n * Utility functions for handling anchor link scrolling in shadow DOM components.\n */\n\n/**\n * Get the current route from the URL hash (without the leading #).\n *\n * For hash-based routing where the entire hash is the route.\n * Example: \"#/component/limel-button/examples/\" → \"/component/limel-button/examples/\"\n * @returns {string} The route extracted from the URL hash\n */\nexport function getRoute(): string {\n return window.location.hash.substring(1);\n}\n\n/**\n * Extract the anchor ID from the current URL hash.\n *\n * Handles both simple anchors (#section) and route-based anchors (#/guide/page#section).\n * Returns null if no valid anchor is found.\n *\n * Example: \"#/guide/changelog#v2-features\" → \"v2-features\"\n * @returns {string | null} The anchor ID or null if not found\n */\nexport function getAnchorId(): string | null {\n const hash = window.location.hash;\n if (!hash) {\n return null;\n }\n\n // Match the last #fragment in the hash\n // This handles both \"#section\" and \"#/route/path#section\"\n const anchorMatch = hash.match(/#([^#]+)$/);\n\n return anchorMatch ? anchorMatch[1] : null;\n}\n\n/**\n * Scroll to an anchor element within a shadow root.\n *\n * Uses requestAnimationFrame to ensure the DOM is ready before scrolling.\n * @param {ShadowRoot} shadowRoot - The shadow root to search for the element\n * @param {ScrollBehavior} behavior - Scroll behavior ('auto' or 'smooth')\n */\nexport function scrollToAnchor(\n shadowRoot: ShadowRoot,\n behavior: ScrollBehavior = 'auto',\n): void {\n const anchorId = getAnchorId();\n if (!anchorId) {\n return;\n }\n\n requestAnimationFrame(() => {\n scrollToElement(shadowRoot, anchorId, behavior);\n });\n}\n\n/**\n * Scroll to a specific element by ID within a shadow root.\n * @param {ShadowRoot} shadowRoot - The shadow root to search for the element\n * @param {string} id - The element ID to scroll to\n * @param {ScrollBehavior} behavior - Scroll behavior ('auto' or 'smooth')\n */\nexport function scrollToElement(\n shadowRoot: ShadowRoot,\n id: string,\n behavior: ScrollBehavior = 'auto',\n): void {\n const element = shadowRoot.getElementById(id);\n if (element) {\n element.scrollIntoView({ behavior: behavior });\n }\n}\n"],"names":[],"mappings":";;AAAA;;AAEG;AAEH;;;;;;AAMG;SACa,QAAQ,GAAA;IACpB,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;AAC5C;AAEA;;;;;;;;AAQG;SACa,WAAW,GAAA;AACvB,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI;IACjC,IAAI,CAAC,IAAI,EAAE;AACP,QAAA,OAAO,IAAI;;;;IAKf,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;AAE3C,IAAA,OAAO,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI;AAC9C;AAEA;;;;;;AAMG;SACa,cAAc,CAC1B,UAAsB,EACtB,WAA2B,MAAM,EAAA;AAEjC,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE;IAC9B,IAAI,CAAC,QAAQ,EAAE;QACX;;IAGJ,qBAAqB,CAAC,MAAK;AACvB,QAAA,eAAe,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC;AACnD,KAAC,CAAC;AACN;AAEA;;;;;AAKG;AACG,SAAU,eAAe,CAC3B,UAAsB,EACtB,EAAU,EACV,WAA2B,MAAM,EAAA;IAEjC,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;IAC7C,IAAI,OAAO,EAAE;QACT,OAAO,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;;AAEtD;;;;;;"}
|