@axerity/cli 0.1.4 → 0.2.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/bin/axerity.js +70 -218
- package/dist/client/_app/immutable/assets/0.jCJXzoiy.css +1 -0
- package/dist/client/_app/immutable/assets/2.DZRzHaE1.css +1 -0
- package/dist/client/_app/immutable/assets/geist-cyrillic-ext-wght-normal.DjL33-gN.woff2 +0 -0
- package/dist/client/_app/immutable/assets/geist-cyrillic-wght-normal.BEAKL7Jp.woff2 +0 -0
- package/dist/client/_app/immutable/assets/geist-latin-ext-wght-normal.DC-KSUi6.woff2 +0 -0
- package/dist/client/_app/immutable/assets/geist-latin-wght-normal.BgDaEnEv.woff2 +0 -0
- package/dist/client/_app/immutable/assets/geist-mono-cyrillic-ext-wght-normal.I4S5GZfc.woff2 +0 -0
- package/dist/client/_app/immutable/assets/geist-mono-cyrillic-wght-normal.BmXc_FBt.woff2 +0 -0
- package/dist/client/_app/immutable/assets/geist-mono-latin-ext-wght-normal.DrnZ1wKl.woff2 +0 -0
- package/dist/client/_app/immutable/assets/geist-mono-latin-wght-normal.B_7UjwxQ.woff2 +0 -0
- package/dist/client/_app/immutable/assets/geist-mono-symbols2-wght-normal.GZpp1pK2.woff2 +0 -0
- package/dist/client/_app/immutable/assets/geist-mono-vietnamese-wght-normal.D8KDMBhC.woff2 +0 -0
- package/dist/client/_app/immutable/assets/geist-vietnamese-wght-normal.6IgcOCM7.woff2 +0 -0
- package/dist/client/_app/immutable/chunks/0CIKaoUA.js +139 -0
- package/dist/client/_app/immutable/chunks/0tC8Ubqr.js +2 -0
- package/dist/client/_app/immutable/chunks/29nvmPLe2.js +1 -0
- package/dist/client/_app/immutable/chunks/9IV9o0dV2.js +4 -0
- package/dist/client/_app/immutable/chunks/B-elEOLV.js +24 -0
- package/dist/client/_app/immutable/chunks/B1R9-4vu.js +89 -0
- package/dist/client/_app/immutable/chunks/B1eXHGII2.js +10 -0
- package/dist/client/_app/immutable/chunks/B2NKIbe62.js +206 -0
- package/dist/client/_app/immutable/chunks/B5Brrqz92.js +1 -0
- package/dist/client/_app/immutable/chunks/B6nymVS3.js +1 -0
- package/dist/client/_app/immutable/chunks/B8E5l9fg2.js +1 -0
- package/dist/client/_app/immutable/chunks/B8gBHxth2.js +1 -0
- package/dist/client/_app/immutable/chunks/BC8A8xkk.js +2 -0
- package/dist/client/_app/immutable/chunks/BGU5ZGjx.js +1 -0
- package/dist/client/_app/immutable/chunks/BLhBgXDr2.js +1 -0
- package/dist/client/_app/immutable/chunks/BNdlLOgu2.js +2 -0
- package/dist/client/_app/immutable/chunks/BQyPqLag.js +84 -0
- package/dist/client/_app/immutable/chunks/BRQspS80.js +162 -0
- package/dist/client/_app/immutable/chunks/BVz-DmJs2.js +132 -0
- package/dist/client/_app/immutable/chunks/BWPyau1x.js +1 -0
- package/dist/client/_app/immutable/chunks/BXD4L9Ly.js +9 -0
- package/dist/client/_app/immutable/chunks/B_Yg36qy2.js +1 -0
- package/dist/client/_app/immutable/chunks/BcuUc08l.js +292 -0
- package/dist/client/_app/immutable/chunks/BdsP84LY.js +231 -0
- package/dist/client/_app/immutable/chunks/Bie0X5s02.js +62 -0
- package/dist/client/_app/immutable/chunks/BifhSqXX.js +1 -0
- package/dist/client/_app/immutable/chunks/BjVjgMFk2.js +15 -0
- package/dist/client/_app/immutable/chunks/BpwmCo88.js +1 -0
- package/dist/client/_app/immutable/chunks/BxQVBtgJ.js +1 -0
- package/dist/client/_app/immutable/chunks/C2oEw9bf.js +34 -0
- package/dist/client/_app/immutable/chunks/C6Oj8XFW.js +1 -0
- package/dist/client/_app/immutable/chunks/C6v0vZRT2.js +36 -0
- package/dist/client/_app/immutable/chunks/C7H7uo1r.js +70 -0
- package/dist/client/_app/immutable/chunks/C8Fc0cco.js +1 -0
- package/dist/client/_app/immutable/chunks/CDfHwfr9.js +1 -0
- package/dist/client/_app/immutable/chunks/CEW3xh3M.js +124 -0
- package/dist/client/_app/immutable/chunks/CFNmf5NX.js +1 -0
- package/dist/client/_app/immutable/chunks/CGhzzHe4.js +1 -0
- package/dist/client/_app/immutable/chunks/CJMWL00f.js +1 -0
- package/dist/client/_app/immutable/chunks/CLrCY0qQ2.js +1 -0
- package/dist/client/_app/immutable/chunks/COu5VFF2.js +78 -0
- package/dist/client/_app/immutable/chunks/CSKSodPl2.js +1 -0
- package/dist/client/_app/immutable/chunks/CVNFCEpi.js +1 -0
- package/dist/client/_app/immutable/chunks/CWUJwgR2.js +1 -0
- package/dist/client/_app/immutable/chunks/CXC42hVj.js +70 -0
- package/dist/client/_app/immutable/chunks/CZqBFf11.js +30 -0
- package/dist/client/_app/immutable/chunks/CaWcga612.js +1 -0
- package/dist/client/_app/immutable/chunks/CcX7Oofq.js +1 -0
- package/dist/client/_app/immutable/chunks/Chn8RaCU2.js +1 -0
- package/dist/client/_app/immutable/chunks/CtmfIXf-.js +161 -0
- package/dist/client/_app/immutable/chunks/D0Co2O6p.js +7 -0
- package/dist/client/_app/immutable/chunks/D1O9pT8r.js +1 -0
- package/dist/client/_app/immutable/chunks/D1z0eUZA.js +3 -0
- package/dist/client/_app/immutable/chunks/D5KVydqU.js +1 -0
- package/dist/client/_app/immutable/chunks/D6jRqBbL.js +1 -0
- package/dist/client/_app/immutable/chunks/DDXR3Aw12.js +1 -0
- package/dist/client/_app/immutable/chunks/DG5yTEkY.js +1 -0
- package/dist/client/_app/immutable/chunks/DGHybmkM2.js +1 -0
- package/dist/client/_app/immutable/chunks/DITdNjTm.js +7 -0
- package/dist/client/_app/immutable/chunks/D_nZbl6c.js +162 -0
- package/dist/client/_app/immutable/chunks/Dg6QheNk.js +85 -0
- package/dist/client/_app/immutable/chunks/Dn1BfjD4.js +1 -0
- package/dist/client/_app/immutable/chunks/DpEnPnBc.js +1 -0
- package/dist/client/_app/immutable/chunks/Drl36yuV.js +40 -0
- package/dist/client/_app/immutable/chunks/Dt_5ZQE2.js +1 -0
- package/dist/client/_app/immutable/chunks/ED9-GWAc2.js +10 -0
- package/dist/client/_app/immutable/chunks/FqbQrHcz2.js +321 -0
- package/dist/client/_app/immutable/chunks/O1MNaiG9.js +3 -0
- package/dist/client/_app/immutable/chunks/PLsDE8Xa.js +24 -0
- package/dist/client/_app/immutable/chunks/PwGqCEPd.js +106 -0
- package/dist/client/_app/immutable/chunks/QmWylQL4.js +96 -0
- package/dist/client/_app/immutable/chunks/SbORYBuH.js +1 -0
- package/dist/client/_app/immutable/chunks/Vhh-h91d.js +257 -0
- package/dist/client/_app/immutable/chunks/Y3d8lUBM.js +120 -0
- package/dist/client/_app/immutable/chunks/aheLp5ES.js +32 -0
- package/dist/client/_app/immutable/chunks/dcFrWhgf.js +1 -0
- package/dist/client/_app/immutable/chunks/dqbyyLvi2.js +10 -0
- package/dist/client/_app/immutable/chunks/hFfQmBrk2.js +1 -0
- package/dist/client/_app/immutable/chunks/mktnrgVa.js +1 -0
- package/dist/client/_app/immutable/chunks/qD2cSsUD2.js +1 -0
- package/dist/client/_app/immutable/chunks/v-V-aVm52.js +43 -0
- package/dist/client/_app/immutable/chunks/wCc4pE4l.js +3 -0
- package/dist/client/_app/immutable/chunks/xihTtKlq.js +1 -0
- package/dist/client/_app/immutable/entry/app.D6KBNU0y.js +2 -0
- package/dist/client/_app/immutable/entry/start.CQdeQUt-.js +1 -0
- package/dist/client/_app/immutable/nodes/0.DBZ13WOO.js +1 -0
- package/dist/client/_app/immutable/nodes/1.B_AZbN4M.js +1 -0
- package/dist/client/_app/immutable/nodes/2.OqcLisIf.js +28 -0
- package/dist/client/_app/version.json +1 -0
- package/dist/env.js +94 -0
- package/dist/handler.js +1494 -0
- package/dist/index.js +345 -0
- package/dist/server/chunks/0-oTZ8HCk-.js +40 -0
- package/dist/server/chunks/0-oTZ8HCk-.js.map +1 -0
- package/dist/server/chunks/1-nu6YvZRQ.js +9 -0
- package/dist/server/chunks/1-nu6YvZRQ.js.map +1 -0
- package/dist/server/chunks/2-YpqcBGyH.js +54 -0
- package/dist/server/chunks/2-YpqcBGyH.js.map +1 -0
- package/dist/server/chunks/Icon-D37LtZZG.js +186 -0
- package/dist/server/chunks/Icon-D37LtZZG.js.map +1 -0
- package/dist/server/chunks/_error.svelte-NKP81ks-.js +48 -0
- package/dist/server/chunks/_error.svelte-NKP81ks-.js.map +1 -0
- package/dist/server/chunks/_layout.svelte-2Eq-_AqW.js +31 -0
- package/dist/server/chunks/_layout.svelte-2Eq-_AqW.js.map +1 -0
- package/dist/server/chunks/_page.svelte-Chjw6C-d.js +2206 -0
- package/dist/server/chunks/_page.svelte-Chjw6C-d.js.map +1 -0
- package/dist/server/chunks/_server.ts-5K31OG2_.js +31 -0
- package/dist/server/chunks/_server.ts-5K31OG2_.js.map +1 -0
- package/dist/server/chunks/_server.ts-BRaXDyO1.js +29 -0
- package/dist/server/chunks/_server.ts-BRaXDyO1.js.map +1 -0
- package/dist/server/chunks/_server.ts-BuDGLKUC.js +213 -0
- package/dist/server/chunks/_server.ts-BuDGLKUC.js.map +1 -0
- package/dist/server/chunks/_server.ts-Bx1daJ1-.js +53 -0
- package/dist/server/chunks/_server.ts-Bx1daJ1-.js.map +1 -0
- package/dist/server/chunks/_server.ts-By7FRFNB.js +37 -0
- package/dist/server/chunks/_server.ts-By7FRFNB.js.map +1 -0
- package/dist/server/chunks/_server.ts-DIxsjlQ0.js +32 -0
- package/dist/server/chunks/_server.ts-DIxsjlQ0.js.map +1 -0
- package/dist/server/chunks/_server.ts-Dgpc__Yz.js +41 -0
- package/dist/server/chunks/_server.ts-Dgpc__Yz.js.map +1 -0
- package/dist/server/chunks/_server.ts-kWOJv5IZ.js +26 -0
- package/dist/server/chunks/_server.ts-kWOJv5IZ.js.map +1 -0
- package/dist/server/chunks/content-store-DV5Rlfo3.js +5252 -0
- package/dist/server/chunks/content-store-DV5Rlfo3.js.map +1 -0
- package/dist/server/chunks/docpage-BkHysAhp.js +5 -0
- package/dist/server/chunks/docpage-BkHysAhp.js.map +1 -0
- package/dist/server/chunks/exports-C0PApeP1.js +758 -0
- package/dist/server/chunks/exports-C0PApeP1.js.map +1 -0
- package/dist/server/chunks/hooks.server-BnfZljxX.js +42 -0
- package/dist/server/chunks/hooks.server-BnfZljxX.js.map +1 -0
- package/dist/server/chunks/internal-pc3wKdix.js +5374 -0
- package/dist/server/chunks/internal-pc3wKdix.js.map +1 -0
- package/dist/server/chunks/mdfile-DBiwGtNY.js +5 -0
- package/dist/server/chunks/mdfile-DBiwGtNY.js.map +1 -0
- package/dist/server/chunks/site-CmugjRXT.js +57 -0
- package/dist/server/chunks/site-CmugjRXT.js.map +1 -0
- package/dist/server/index.js +4356 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/manifest.js +103 -0
- package/dist/server/manifest.js.map +1 -0
- package/dist/shims.js +32 -0
- package/package.json +24 -16
- package/runtime/crawl.js +58 -0
- package/runtime/preview.js +42 -0
- package/runtime/serve.js +78 -0
- package/runtime/static.js +76 -0
- package/mdsvex.config.js +0 -261
- package/scripts/prepare-engine.mjs +0 -20
- package/src/app.d.ts +0 -17
- package/src/app.html +0 -39
- package/src/content/demo/api/meta.json +0 -5
- package/src/content/demo/api/pet/add-pet.md +0 -105
- package/src/content/demo/api/pet/delete-pet.md +0 -70
- package/src/content/demo/api/pet/find-by-status.md +0 -72
- package/src/content/demo/api/pet/find-by-tags.md +0 -64
- package/src/content/demo/api/pet/get-pet.md +0 -99
- package/src/content/demo/api/pet/meta.json +0 -15
- package/src/content/demo/api/pet/pet-object.md +0 -112
- package/src/content/demo/api/pet/update-pet-with-form.md +0 -69
- package/src/content/demo/api/pet/update-pet.md +0 -79
- package/src/content/demo/api/pet/upload-image.md +0 -79
- package/src/content/demo/api/store/delete-order.md +0 -62
- package/src/content/demo/api/store/get-order.md +0 -70
- package/src/content/demo/api/store/inventory.md +0 -54
- package/src/content/demo/api/store/meta.json +0 -5
- package/src/content/demo/api/store/order-object.md +0 -77
- package/src/content/demo/api/store/place-order.md +0 -83
- package/src/content/demo/api/user/create-user.md +0 -69
- package/src/content/demo/api/user/create-with-list.md +0 -57
- package/src/content/demo/api/user/delete-user.md +0 -61
- package/src/content/demo/api/user/get-user.md +0 -69
- package/src/content/demo/api/user/login.md +0 -80
- package/src/content/demo/api/user/logout.md +0 -45
- package/src/content/demo/api/user/meta.json +0 -14
- package/src/content/demo/api/user/update-user.md +0 -69
- package/src/content/demo/api/user/user-object.md +0 -85
- package/src/content/demo/changelog.md +0 -44
- package/src/content/demo/components/accordion.md +0 -70
- package/src/content/demo/components/api.md +0 -185
- package/src/content/demo/components/badge.md +0 -34
- package/src/content/demo/components/callout.md +0 -83
- package/src/content/demo/components/cards.md +0 -88
- package/src/content/demo/components/code-group.md +0 -55
- package/src/content/demo/components/columns.md +0 -42
- package/src/content/demo/components/frame.md +0 -51
- package/src/content/demo/components/icon.md +0 -54
- package/src/content/demo/components/kbd.md +0 -28
- package/src/content/demo/components/meta.json +0 -26
- package/src/content/demo/components/roadmap.md +0 -86
- package/src/content/demo/components/steps.md +0 -72
- package/src/content/demo/components/tabs.md +0 -146
- package/src/content/demo/components/tooltip.md +0 -44
- package/src/content/demo/components/tree.md +0 -83
- package/src/content/demo/components/type-table.md +0 -77
- package/src/content/demo/components/update.md +0 -48
- package/src/content/demo/components/video.md +0 -56
- package/src/content/demo/components/webhooks.md +0 -109
- package/src/content/demo/components/websockets.md +0 -101
- package/src/content/demo/configuration/ai.md +0 -40
- package/src/content/demo/configuration/cli.md +0 -48
- package/src/content/demo/configuration/deployment.md +0 -105
- package/src/content/demo/configuration/index.md +0 -92
- package/src/content/demo/configuration/layouts.md +0 -51
- package/src/content/demo/configuration/meta.json +0 -5
- package/src/content/demo/configuration/navigation.md +0 -167
- package/src/content/demo/configuration/openapi.md +0 -103
- package/src/content/demo/configuration/search.md +0 -36
- package/src/content/demo/index.md +0 -59
- package/src/content/demo/installation.md +0 -66
- package/src/content/demo/meta.json +0 -15
- package/src/content/demo/quick-start.md +0 -47
- package/src/content/demo/theming/advanced.md +0 -116
- package/src/content/demo/theming/code.md +0 -66
- package/src/content/demo/theming/colors.md +0 -103
- package/src/content/demo/theming/index.md +0 -88
- package/src/content/demo/theming/layout.md +0 -71
- package/src/content/demo/theming/meta.json +0 -5
- package/src/content/demo/theming/themes.md +0 -99
- package/src/content/demo/theming/typography.md +0 -83
- package/src/content/demo/writing/code-blocks.md +0 -154
- package/src/content/demo/writing/diagrams.md +0 -44
- package/src/content/demo/writing/frontmatter.md +0 -33
- package/src/content/demo/writing/markdown.md +0 -62
- package/src/content/demo/writing/meta.json +0 -5
- package/src/hooks.server.ts +0 -49
- package/src/lib/assets/favicon.svg +0 -1
- package/src/lib/base.ts +0 -12
- package/src/lib/components/DynamicIcon.svelte +0 -41
- package/src/lib/components/docs/Analytics.svelte +0 -38
- package/src/lib/components/docs/Banner.svelte +0 -44
- package/src/lib/components/docs/Breadcrumbs.svelte +0 -38
- package/src/lib/components/docs/CopyPageMenu.svelte +0 -119
- package/src/lib/components/docs/DocsLayout.svelte +0 -192
- package/src/lib/components/docs/Footer.svelte +0 -60
- package/src/lib/components/docs/Mermaid.svelte +0 -39
- package/src/lib/components/docs/Navbar.svelte +0 -144
- package/src/lib/components/docs/PageMeta.svelte +0 -35
- package/src/lib/components/docs/PageNav.svelte +0 -44
- package/src/lib/components/docs/SearchDialog.svelte +0 -182
- package/src/lib/components/docs/Sidebar.svelte +0 -85
- package/src/lib/components/docs/SidebarDropdown.svelte +0 -56
- package/src/lib/components/docs/SidebarFooterLinks.svelte +0 -19
- package/src/lib/components/docs/SidebarGroup.svelte +0 -54
- package/src/lib/components/docs/SidebarLink.svelte +0 -67
- package/src/lib/components/docs/TableOfContents.svelte +0 -77
- package/src/lib/components/docs/ThemeToggle.svelte +0 -19
- package/src/lib/components/docs/VersionSwitcher.svelte +0 -80
- package/src/lib/components/kit/Accordion.svelte +0 -60
- package/src/lib/components/kit/AccordionGroup.svelte +0 -13
- package/src/lib/components/kit/Badge.svelte +0 -32
- package/src/lib/components/kit/Callout.svelte +0 -51
- package/src/lib/components/kit/Card.svelte +0 -72
- package/src/lib/components/kit/CardGroup.svelte +0 -21
- package/src/lib/components/kit/CodeGroup.svelte +0 -65
- package/src/lib/components/kit/Columns.svelte +0 -26
- package/src/lib/components/kit/Event.svelte +0 -23
- package/src/lib/components/kit/EventList.svelte +0 -9
- package/src/lib/components/kit/File.svelte +0 -15
- package/src/lib/components/kit/Folder.svelte +0 -46
- package/src/lib/components/kit/Frame.svelte +0 -81
- package/src/lib/components/kit/Icon.svelte +0 -17
- package/src/lib/components/kit/Kbd.svelte +0 -11
- package/src/lib/components/kit/Roadmap.svelte +0 -15
- package/src/lib/components/kit/RoadmapItem.svelte +0 -109
- package/src/lib/components/kit/Step.svelte +0 -63
- package/src/lib/components/kit/Steps.svelte +0 -16
- package/src/lib/components/kit/Tab.svelte +0 -27
- package/src/lib/components/kit/Tabs.svelte +0 -75
- package/src/lib/components/kit/Tooltip.svelte +0 -33
- package/src/lib/components/kit/Tree.svelte +0 -11
- package/src/lib/components/kit/TypeTable.svelte +0 -187
- package/src/lib/components/kit/Update.svelte +0 -32
- package/src/lib/components/kit/Video.svelte +0 -64
- package/src/lib/components/kit/accordion-context.ts +0 -1
- package/src/lib/components/kit/api/Api.svelte +0 -80
- package/src/lib/components/kit/api/ApiExamplePanel.svelte +0 -100
- package/src/lib/components/kit/api/ApiField.svelte +0 -124
- package/src/lib/components/kit/api/Channel.svelte +0 -121
- package/src/lib/components/kit/api/Endpoint.svelte +0 -116
- package/src/lib/components/kit/api/Enum.svelte +0 -44
- package/src/lib/components/kit/api/EnumValues.svelte +0 -35
- package/src/lib/components/kit/api/Expandable.svelte +0 -70
- package/src/lib/components/kit/api/Message.svelte +0 -67
- package/src/lib/components/kit/api/ObjectExample.svelte +0 -11
- package/src/lib/components/kit/api/RequestExample.svelte +0 -11
- package/src/lib/components/kit/api/ResponseExample.svelte +0 -11
- package/src/lib/components/kit/api/Webhook.svelte +0 -115
- package/src/lib/components/kit/api/api-context.ts +0 -15
- package/src/lib/components/kit/tabs-context.ts +0 -8
- package/src/lib/components/kit/tabs-store.svelte.ts +0 -28
- package/src/lib/config/site.ts +0 -34
- package/src/lib/content/index.ts +0 -50
- package/src/lib/content/raw.ts +0 -21
- package/src/lib/content/tree.ts +0 -169
- package/src/lib/index.ts +0 -79
- package/src/lib/nav-match.ts +0 -23
- package/src/lib/openapi/generate.ts +0 -629
- package/src/lib/server/og.ts +0 -140
- package/src/lib/state/search.svelte.ts +0 -9
- package/src/lib/state/theme.svelte.ts +0 -58
- package/src/lib/types.ts +0 -216
- package/src/params/docpage.ts +0 -3
- package/src/params/mdfile.ts +0 -3
- package/src/routes/+error.svelte +0 -46
- package/src/routes/+layout.svelte +0 -25
- package/src/routes/[...path=mdfile]/+server.ts +0 -21
- package/src/routes/[...slug=docpage]/+page.svelte +0 -63
- package/src/routes/[...slug=docpage]/+page.ts +0 -44
- package/src/routes/layout.css +0 -897
- package/src/routes/llms-full.txt/+server.ts +0 -22
- package/src/routes/llms.txt/+server.ts +0 -20
- package/src/routes/og/[...slug]/+server.ts +0 -77
- package/src/routes/rss.xml/+server.ts +0 -65
- package/src/routes/search.json/+server.ts +0 -54
- package/src/routes/sitemap.xml/+server.ts +0 -21
- package/svelte.config.js +0 -35
- package/tsconfig.json +0 -20
- package/vite.config.ts +0 -67
- /package/{static → dist/client}/favicon-dark.svg +0 -0
- /package/{static → dist/client}/favicon-light.svg +0 -0
- /package/{static → dist/client}/favicon.svg +0 -0
- /package/{static → dist/client}/fonts/geist-400.ttf +0 -0
- /package/{static → dist/client}/fonts/geist-600.ttf +0 -0
- /package/{static → dist/client}/fonts/geist-700.ttf +0 -0
- /package/{static → dist/client}/og-image.png +0 -0
- /package/{static → dist/client}/robots.txt +0 -0
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { tick } from 'svelte';
|
|
3
|
-
import { afterNavigate } from '$app/navigation';
|
|
4
|
-
import { theme } from '$lib/state/theme.svelte';
|
|
5
|
-
|
|
6
|
-
type MermaidApi = typeof import('mermaid').default;
|
|
7
|
-
let mermaid: MermaidApi | null = null;
|
|
8
|
-
|
|
9
|
-
async function render(resolved: 'light' | 'dark') {
|
|
10
|
-
const blocks = Array.from(document.querySelectorAll('pre.mermaid')) as HTMLElement[];
|
|
11
|
-
if (!blocks.length) return;
|
|
12
|
-
|
|
13
|
-
if (!mermaid) mermaid = (await import('mermaid')).default;
|
|
14
|
-
|
|
15
|
-
for (const block of blocks) {
|
|
16
|
-
if (block.dataset.src === undefined) block.dataset.src = block.textContent ?? '';
|
|
17
|
-
block.removeAttribute('data-processed');
|
|
18
|
-
block.innerHTML = block.dataset.src;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
mermaid.initialize({
|
|
22
|
-
startOnLoad: false,
|
|
23
|
-
securityLevel: 'strict',
|
|
24
|
-
theme: resolved === 'dark' ? 'dark' : 'neutral',
|
|
25
|
-
fontFamily: 'inherit'
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
await mermaid.run({ nodes: blocks });
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
$effect(() => {
|
|
32
|
-
const resolved = theme.resolved;
|
|
33
|
-
tick().then(() => render(resolved));
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
afterNavigate(() => {
|
|
37
|
-
tick().then(() => render(theme.resolved));
|
|
38
|
-
});
|
|
39
|
-
</script>
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { page } from '$app/state';
|
|
3
|
-
import Menu from '@lucide/svelte/icons/menu';
|
|
4
|
-
import Search from '@lucide/svelte/icons/search';
|
|
5
|
-
import type { SiteConfig } from '$lib/types';
|
|
6
|
-
import { activeFor } from '$lib/nav-match';
|
|
7
|
-
import DynamicIcon from '$lib/components/DynamicIcon.svelte';
|
|
8
|
-
import ThemeToggle from './ThemeToggle.svelte';
|
|
9
|
-
import VersionSwitcher from './VersionSwitcher.svelte';
|
|
10
|
-
import { searchState } from '$lib/state/search.svelte';
|
|
11
|
-
|
|
12
|
-
let {
|
|
13
|
-
site,
|
|
14
|
-
onMenuClick,
|
|
15
|
-
resolveVersion
|
|
16
|
-
}: {
|
|
17
|
-
site: SiteConfig;
|
|
18
|
-
onMenuClick?: () => void;
|
|
19
|
-
resolveVersion?: (pathname: string, versionPath: string) => string;
|
|
20
|
-
} = $props();
|
|
21
|
-
|
|
22
|
-
const innerClass = $derived(
|
|
23
|
-
(site.layout ?? 'flat') === 'boxed'
|
|
24
|
-
? 'mx-auto flex h-full max-w-400 items-center gap-4 px-4 sm:px-6'
|
|
25
|
-
: 'flex h-full items-center gap-4 px-4 sm:px-6'
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
const activeDropdown = $derived(
|
|
29
|
-
site.dropdowns && site.dropdowns.length
|
|
30
|
-
? (activeFor(page.url.pathname, site.dropdowns) ?? site.dropdowns[0])
|
|
31
|
-
: undefined
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const tabs = $derived(activeDropdown?.tabs ?? site.topNav);
|
|
35
|
-
const activeTab = $derived(activeFor(page.url.pathname, tabs));
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<header
|
|
39
|
-
class="sticky top-0 z-40 h-(--spacing-header) border-b border-border bg-header/80 backdrop-blur-md"
|
|
40
|
-
>
|
|
41
|
-
<div class={innerClass}>
|
|
42
|
-
<!-- Mobile sidebar toggle -->
|
|
43
|
-
<button
|
|
44
|
-
type="button"
|
|
45
|
-
onclick={onMenuClick}
|
|
46
|
-
class="-ml-1 inline-flex h-9 w-9 items-center justify-center rounded-lg text-fg-muted hover:bg-bg-subtle hover:text-fg lg:hidden"
|
|
47
|
-
aria-label="Open navigation"
|
|
48
|
-
>
|
|
49
|
-
<Menu size={20} />
|
|
50
|
-
</button>
|
|
51
|
-
|
|
52
|
-
<a
|
|
53
|
-
href={site.logo?.href ?? '/'}
|
|
54
|
-
class="flex shrink-0 items-center gap-2"
|
|
55
|
-
aria-label={site.logo?.alt ?? site.name}
|
|
56
|
-
>
|
|
57
|
-
{#if site.logo?.light || site.logo?.dark}
|
|
58
|
-
{#if site.logo.light}
|
|
59
|
-
<img
|
|
60
|
-
src={site.logo.light}
|
|
61
|
-
alt={site.logo.alt ?? site.name}
|
|
62
|
-
class="h-6 w-auto dark:hidden"
|
|
63
|
-
/>
|
|
64
|
-
{/if}
|
|
65
|
-
{#if site.logo.dark}
|
|
66
|
-
<img
|
|
67
|
-
src={site.logo.dark}
|
|
68
|
-
alt={site.logo.alt ?? site.name}
|
|
69
|
-
class="hidden h-6 w-auto dark:block"
|
|
70
|
-
/>
|
|
71
|
-
{/if}
|
|
72
|
-
{:else}
|
|
73
|
-
<span class="text-base font-semibold text-fg">{site.name}</span>
|
|
74
|
-
{/if}
|
|
75
|
-
</a>
|
|
76
|
-
|
|
77
|
-
{#if site.versions && site.versions.length}
|
|
78
|
-
<VersionSwitcher versions={site.versions} {resolveVersion} />
|
|
79
|
-
{/if}
|
|
80
|
-
|
|
81
|
-
<nav class="hidden items-center gap-1 md:flex" aria-label="Main">
|
|
82
|
-
{#each tabs as tab (tab.href)}
|
|
83
|
-
<a
|
|
84
|
-
href={tab.href}
|
|
85
|
-
target={tab.external ? '_blank' : undefined}
|
|
86
|
-
rel={tab.external ? 'noreferrer' : undefined}
|
|
87
|
-
aria-current={tab === activeTab ? 'page' : undefined}
|
|
88
|
-
class="flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition
|
|
89
|
-
{tab === activeTab ? 'text-accent' : 'text-fg-muted hover:text-fg'}"
|
|
90
|
-
>
|
|
91
|
-
{#if tab.icon}
|
|
92
|
-
<DynamicIcon name={tab.icon} size={15} />
|
|
93
|
-
{/if}
|
|
94
|
-
{tab.title}
|
|
95
|
-
</a>
|
|
96
|
-
{/each}
|
|
97
|
-
</nav>
|
|
98
|
-
|
|
99
|
-
<div class="flex flex-1 items-center justify-end gap-2">
|
|
100
|
-
<!-- Search (full pill on sm+, icon-only on mobile) -->
|
|
101
|
-
<button
|
|
102
|
-
type="button"
|
|
103
|
-
onclick={() => (searchState.open = true)}
|
|
104
|
-
class="hidden w-56 items-center gap-2 rounded-lg border border-border bg-surface px-3 py-1.5 text-sm text-fg-subtle transition hover:border-border-strong hover:text-fg-muted sm:flex lg:w-72"
|
|
105
|
-
aria-label="Search documentation"
|
|
106
|
-
>
|
|
107
|
-
<Search size={15} />
|
|
108
|
-
<span>Search</span>
|
|
109
|
-
<kbd
|
|
110
|
-
class="ml-auto rounded border border-border bg-bg-subtle px-1.5 py-0.5 font-mono text-[10px] text-fg-subtle"
|
|
111
|
-
>
|
|
112
|
-
⌘K
|
|
113
|
-
</kbd>
|
|
114
|
-
</button>
|
|
115
|
-
<button
|
|
116
|
-
type="button"
|
|
117
|
-
onclick={() => (searchState.open = true)}
|
|
118
|
-
class="inline-flex h-9 w-9 items-center justify-center rounded-lg text-fg-muted transition hover:bg-bg-subtle hover:text-fg sm:hidden"
|
|
119
|
-
aria-label="Search documentation"
|
|
120
|
-
>
|
|
121
|
-
<Search size={18} />
|
|
122
|
-
</button>
|
|
123
|
-
|
|
124
|
-
{#if site.github}
|
|
125
|
-
<a
|
|
126
|
-
href={site.github}
|
|
127
|
-
target="_blank"
|
|
128
|
-
rel="noreferrer"
|
|
129
|
-
class="inline-flex h-9 w-9 items-center justify-center rounded-lg text-fg-muted transition hover:bg-bg-subtle hover:text-fg"
|
|
130
|
-
aria-label="GitHub repository"
|
|
131
|
-
>
|
|
132
|
-
<!-- Lucide dropped brand marks, so the GitHub glyph is inlined. -->
|
|
133
|
-
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
134
|
-
<path
|
|
135
|
-
d="M12 1.27a11 11 0 0 0-3.48 21.46c.55.09.73-.24.73-.53v-1.85c-3.03.66-3.67-1.45-3.67-1.45-.5-1.27-1.21-1.61-1.21-1.61-.99-.68.07-.66.07-.66 1.1.08 1.67 1.13 1.67 1.13.97 1.67 2.55 1.19 3.17.91.1-.71.38-1.19.69-1.46-2.42-.28-4.96-1.21-4.96-5.38 0-1.19.42-2.16 1.13-2.92-.11-.28-.49-1.39.11-2.89 0 0 .92-.3 3.02 1.12a10.4 10.4 0 0 1 5.5 0c2.1-1.42 3.02-1.12 3.02-1.12.6 1.5.22 2.61.11 2.89.71.76 1.13 1.73 1.13 2.92 0 4.18-2.55 5.1-4.98 5.37.39.34.74 1 .74 2.03v3.01c0 .29.18.63.74.52A11 11 0 0 0 12 1.27"
|
|
136
|
-
/>
|
|
137
|
-
</svg>
|
|
138
|
-
</a>
|
|
139
|
-
{/if}
|
|
140
|
-
|
|
141
|
-
<ThemeToggle />
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
</header>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import PencilLine from '@lucide/svelte/icons/pencil-line';
|
|
3
|
-
|
|
4
|
-
let { editUrl, updated }: { editUrl?: string; updated?: string } = $props();
|
|
5
|
-
|
|
6
|
-
const formatted = $derived.by(() => {
|
|
7
|
-
if (!updated) return undefined;
|
|
8
|
-
const date = new Date(updated);
|
|
9
|
-
if (Number.isNaN(date.getTime())) return updated;
|
|
10
|
-
return date.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' });
|
|
11
|
-
});
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
{#if editUrl || formatted}
|
|
15
|
-
<div
|
|
16
|
-
class="mt-8 flex flex-wrap items-center justify-between gap-2 border-t border-border pt-4 text-sm text-fg-subtle"
|
|
17
|
-
>
|
|
18
|
-
{#if formatted}
|
|
19
|
-
<span>Last updated {formatted}</span>
|
|
20
|
-
{:else}
|
|
21
|
-
<span></span>
|
|
22
|
-
{/if}
|
|
23
|
-
{#if editUrl}
|
|
24
|
-
<a
|
|
25
|
-
href={editUrl}
|
|
26
|
-
target="_blank"
|
|
27
|
-
rel="noreferrer"
|
|
28
|
-
class="inline-flex items-center gap-1.5 transition hover:text-fg"
|
|
29
|
-
>
|
|
30
|
-
<PencilLine size={14} />
|
|
31
|
-
Edit this page
|
|
32
|
-
</a>
|
|
33
|
-
{/if}
|
|
34
|
-
</div>
|
|
35
|
-
{/if}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { page } from '$app/state';
|
|
3
|
-
import ChevronLeft from '@lucide/svelte/icons/chevron-left';
|
|
4
|
-
import ChevronRight from '@lucide/svelte/icons/chevron-right';
|
|
5
|
-
import type { NavLink } from '$lib/types';
|
|
6
|
-
|
|
7
|
-
let { pages }: { pages: NavLink[] } = $props();
|
|
8
|
-
|
|
9
|
-
const index = $derived(pages.findIndex((entry) => entry.href === page.url.pathname));
|
|
10
|
-
const prev = $derived(index > 0 ? pages[index - 1] : undefined);
|
|
11
|
-
const next = $derived(index >= 0 && index < pages.length - 1 ? pages[index + 1] : undefined);
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
{#if prev || next}
|
|
15
|
-
<nav class="mt-12 grid gap-3 border-t border-border pt-6 sm:grid-cols-2" aria-label="Pagination">
|
|
16
|
-
{#if prev}
|
|
17
|
-
<a
|
|
18
|
-
href={prev.href}
|
|
19
|
-
class="flex items-center gap-3 rounded-lg border border-border p-4 transition hover:border-border-strong hover:bg-bg-subtle"
|
|
20
|
-
>
|
|
21
|
-
<ChevronLeft size={18} class="shrink-0 text-fg-subtle" />
|
|
22
|
-
<span class="min-w-0">
|
|
23
|
-
<span class="block text-xs text-fg-subtle">Previous</span>
|
|
24
|
-
<span class="block truncate text-sm font-medium text-fg">{prev.title}</span>
|
|
25
|
-
</span>
|
|
26
|
-
</a>
|
|
27
|
-
{:else}
|
|
28
|
-
<span class="hidden sm:block"></span>
|
|
29
|
-
{/if}
|
|
30
|
-
|
|
31
|
-
{#if next}
|
|
32
|
-
<a
|
|
33
|
-
href={next.href}
|
|
34
|
-
class="flex items-center justify-end gap-3 rounded-lg border border-border p-4 text-right transition hover:border-border-strong hover:bg-bg-subtle"
|
|
35
|
-
>
|
|
36
|
-
<span class="min-w-0">
|
|
37
|
-
<span class="block text-xs text-fg-subtle">Next</span>
|
|
38
|
-
<span class="block truncate text-sm font-medium text-fg">{next.title}</span>
|
|
39
|
-
</span>
|
|
40
|
-
<ChevronRight size={18} class="shrink-0 text-fg-subtle" />
|
|
41
|
-
</a>
|
|
42
|
-
{/if}
|
|
43
|
-
</nav>
|
|
44
|
-
{/if}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { goto } from '$app/navigation';
|
|
3
|
-
import { fade, scale } from 'svelte/transition';
|
|
4
|
-
import { create, insertMultiple, search } from '@orama/orama';
|
|
5
|
-
import SearchIcon from '@lucide/svelte/icons/search';
|
|
6
|
-
import FileText from '@lucide/svelte/icons/file-text';
|
|
7
|
-
import CornerDownLeft from '@lucide/svelte/icons/corner-down-left';
|
|
8
|
-
import { searchState } from '$lib/state/search.svelte';
|
|
9
|
-
|
|
10
|
-
interface Doc {
|
|
11
|
-
title: string;
|
|
12
|
-
section: string;
|
|
13
|
-
description: string;
|
|
14
|
-
href: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
let term = $state('');
|
|
18
|
-
let results = $state<Doc[]>([]);
|
|
19
|
-
let activeIndex = $state(0);
|
|
20
|
-
let loaded = $state(false);
|
|
21
|
-
let input = $state<HTMLInputElement>();
|
|
22
|
-
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
-
const orama: { db: any } = { db: null };
|
|
25
|
-
|
|
26
|
-
const schema = {
|
|
27
|
-
title: 'string',
|
|
28
|
-
section: 'string',
|
|
29
|
-
description: 'string',
|
|
30
|
-
content: 'string',
|
|
31
|
-
href: 'string'
|
|
32
|
-
} as const;
|
|
33
|
-
|
|
34
|
-
async function ensureLoaded() {
|
|
35
|
-
if (orama.db) return;
|
|
36
|
-
const docs = await (await fetch('/search.json')).json();
|
|
37
|
-
orama.db = create({ schema });
|
|
38
|
-
await insertMultiple(orama.db, docs);
|
|
39
|
-
loaded = true;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
$effect(() => {
|
|
43
|
-
function onKey(event: KeyboardEvent) {
|
|
44
|
-
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === 'k') {
|
|
45
|
-
event.preventDefault();
|
|
46
|
-
searchState.toggle();
|
|
47
|
-
} else if (event.key === 'Escape' && searchState.open) {
|
|
48
|
-
searchState.open = false;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
window.addEventListener('keydown', onKey);
|
|
52
|
-
return () => window.removeEventListener('keydown', onKey);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
$effect(() => {
|
|
56
|
-
if (searchState.open) {
|
|
57
|
-
ensureLoaded();
|
|
58
|
-
setTimeout(() => input?.focus(), 0);
|
|
59
|
-
} else {
|
|
60
|
-
term = '';
|
|
61
|
-
results = [];
|
|
62
|
-
activeIndex = 0;
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
$effect(() => {
|
|
67
|
-
const query = term.trim();
|
|
68
|
-
if (!query || !loaded || !orama.db) {
|
|
69
|
-
results = [];
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
Promise.resolve(
|
|
73
|
-
search(orama.db, {
|
|
74
|
-
term: query,
|
|
75
|
-
properties: ['title', 'description', 'content', 'section'],
|
|
76
|
-
boost: { title: 4, description: 2 },
|
|
77
|
-
tolerance: 1,
|
|
78
|
-
limit: 8
|
|
79
|
-
})
|
|
80
|
-
).then((response) => {
|
|
81
|
-
results = response.hits.map((hit: { document: Doc }) => hit.document);
|
|
82
|
-
activeIndex = 0;
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
function go(href: string) {
|
|
87
|
-
searchState.open = false;
|
|
88
|
-
goto(href);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function onInputKey(event: KeyboardEvent) {
|
|
92
|
-
if (event.key === 'ArrowDown') {
|
|
93
|
-
event.preventDefault();
|
|
94
|
-
activeIndex = Math.min(activeIndex + 1, results.length - 1);
|
|
95
|
-
} else if (event.key === 'ArrowUp') {
|
|
96
|
-
event.preventDefault();
|
|
97
|
-
activeIndex = Math.max(activeIndex - 1, 0);
|
|
98
|
-
} else if (event.key === 'Enter' && results[activeIndex]) {
|
|
99
|
-
event.preventDefault();
|
|
100
|
-
go(results[activeIndex].href);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
{#if searchState.open}
|
|
106
|
-
<div class="fixed inset-0 z-60 flex items-start justify-center px-4 pt-[12vh]">
|
|
107
|
-
<button
|
|
108
|
-
type="button"
|
|
109
|
-
class="absolute inset-0 cursor-default bg-black/50 backdrop-blur-sm"
|
|
110
|
-
aria-label="Close search"
|
|
111
|
-
onclick={() => (searchState.open = false)}
|
|
112
|
-
transition:fade={{ duration: 120 }}
|
|
113
|
-
></button>
|
|
114
|
-
|
|
115
|
-
<div
|
|
116
|
-
class="relative w-full max-w-xl overflow-hidden rounded-xl border border-border bg-surface shadow-2xl"
|
|
117
|
-
transition:scale={{ duration: 130, start: 0.97 }}
|
|
118
|
-
>
|
|
119
|
-
<div class="flex items-center gap-3 border-b border-border px-4">
|
|
120
|
-
<SearchIcon size={18} class="shrink-0 text-fg-subtle" />
|
|
121
|
-
<input
|
|
122
|
-
bind:this={input}
|
|
123
|
-
bind:value={term}
|
|
124
|
-
onkeydown={onInputKey}
|
|
125
|
-
type="text"
|
|
126
|
-
placeholder="Search documentation…"
|
|
127
|
-
class="w-full border-0 bg-transparent py-3.5 text-sm text-fg shadow-none outline-none placeholder:text-fg-subtle focus:border-0 focus:ring-0 focus:outline-none"
|
|
128
|
-
/>
|
|
129
|
-
<kbd
|
|
130
|
-
class="rounded border border-border bg-bg-subtle px-1.5 py-0.5 font-mono text-[10px] text-fg-subtle"
|
|
131
|
-
>
|
|
132
|
-
Esc
|
|
133
|
-
</kbd>
|
|
134
|
-
</div>
|
|
135
|
-
|
|
136
|
-
<div class="max-h-[60vh] overflow-y-auto p-2">
|
|
137
|
-
{#if term.trim() && results.length === 0}
|
|
138
|
-
<p class="px-3 py-8 text-center text-sm text-fg-subtle">
|
|
139
|
-
No results for “{term.trim()}”.
|
|
140
|
-
</p>
|
|
141
|
-
{:else if !term.trim()}
|
|
142
|
-
<p class="px-3 py-8 text-center text-sm text-fg-subtle">
|
|
143
|
-
Start typing to search the docs.
|
|
144
|
-
</p>
|
|
145
|
-
{:else}
|
|
146
|
-
<ul class="flex flex-col gap-0.5">
|
|
147
|
-
{#each results as result, index (result.href)}
|
|
148
|
-
<li>
|
|
149
|
-
<button
|
|
150
|
-
type="button"
|
|
151
|
-
onmouseenter={() => (activeIndex = index)}
|
|
152
|
-
onclick={() => go(result.href)}
|
|
153
|
-
class="flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left transition
|
|
154
|
-
{activeIndex === index ? 'bg-accent/10' : ''}"
|
|
155
|
-
>
|
|
156
|
-
<FileText size={16} class="shrink-0 text-fg-subtle" />
|
|
157
|
-
<span class="min-w-0 flex-1">
|
|
158
|
-
<span class="block truncate text-sm font-medium text-fg">{result.title}</span>
|
|
159
|
-
<span class="block truncate text-xs text-fg-subtle">
|
|
160
|
-
{result.section}{result.description ? ` · ${result.description}` : ''}
|
|
161
|
-
</span>
|
|
162
|
-
</span>
|
|
163
|
-
{#if activeIndex === index}
|
|
164
|
-
<CornerDownLeft size={14} class="shrink-0 text-fg-subtle" />
|
|
165
|
-
{/if}
|
|
166
|
-
</button>
|
|
167
|
-
</li>
|
|
168
|
-
{/each}
|
|
169
|
-
</ul>
|
|
170
|
-
{/if}
|
|
171
|
-
</div>
|
|
172
|
-
|
|
173
|
-
<div
|
|
174
|
-
class="flex items-center gap-3 border-t border-border px-4 py-2 text-[11px] text-fg-subtle"
|
|
175
|
-
>
|
|
176
|
-
<span><kbd class="font-mono">↑↓</kbd> navigate</span>
|
|
177
|
-
<span><kbd class="font-mono">↵</kbd> select</span>
|
|
178
|
-
<span class="ml-auto">Search by Orama</span>
|
|
179
|
-
</div>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
{/if}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { page } from '$app/state';
|
|
3
|
-
import type { Dropdown, NavEntry, NavSection, TopNavLink } from '$lib/types';
|
|
4
|
-
import { activeFor } from '$lib/nav-match';
|
|
5
|
-
import DynamicIcon from '$lib/components/DynamicIcon.svelte';
|
|
6
|
-
import SidebarLink from './SidebarLink.svelte';
|
|
7
|
-
import SidebarGroup from './SidebarGroup.svelte';
|
|
8
|
-
import SidebarDropdown from './SidebarDropdown.svelte';
|
|
9
|
-
|
|
10
|
-
let { sections, dropdowns }: { sections: NavSection[]; dropdowns?: Dropdown[] } = $props();
|
|
11
|
-
|
|
12
|
-
const activeDropdown = $derived(
|
|
13
|
-
dropdowns && dropdowns.length
|
|
14
|
-
? (activeFor(page.url.pathname, dropdowns) ?? dropdowns[0])
|
|
15
|
-
: undefined
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const tabs = $derived(activeDropdown?.tabs ?? []);
|
|
19
|
-
const activeTab = $derived(
|
|
20
|
-
tabs.length ? (activeFor(page.url.pathname, tabs) ?? tabs[0]) : undefined
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
function firstHref(entries: NavEntry[]): string | undefined {
|
|
24
|
-
for (const entry of entries) {
|
|
25
|
-
const href = 'href' in entry ? entry.href : firstHref(entry.items);
|
|
26
|
-
if (href) return href;
|
|
27
|
-
}
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function pruneByTab(entries: NavEntry[], tabList: TopNavLink[], target: TopNavLink): NavEntry[] {
|
|
32
|
-
const result: NavEntry[] = [];
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
if ('href' in entry) {
|
|
35
|
-
if (activeFor(entry.href, tabList) === target) result.push(entry);
|
|
36
|
-
} else {
|
|
37
|
-
const items = pruneByTab(entry.items, tabList, target);
|
|
38
|
-
if (items.length) result.push({ ...entry, items });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const visibleSections = $derived.by(() => {
|
|
45
|
-
let result = sections;
|
|
46
|
-
if (dropdowns && activeDropdown) {
|
|
47
|
-
result = result.filter((section) => {
|
|
48
|
-
const href = firstHref(section.items);
|
|
49
|
-
return !href || activeFor(href, dropdowns) === activeDropdown;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
if (tabs.length && activeTab) {
|
|
53
|
-
result = result
|
|
54
|
-
.map((section) => ({ ...section, items: pruneByTab(section.items, tabs, activeTab) }))
|
|
55
|
-
.filter((section) => section.items.length);
|
|
56
|
-
}
|
|
57
|
-
return result;
|
|
58
|
-
});
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<nav class="flex flex-col gap-6" aria-label="Documentation">
|
|
62
|
-
{#if dropdowns && dropdowns.length && activeDropdown}
|
|
63
|
-
<SidebarDropdown {dropdowns} active={activeDropdown} />
|
|
64
|
-
{/if}
|
|
65
|
-
|
|
66
|
-
{#each visibleSections as section (section.title)}
|
|
67
|
-
<div class="flex flex-col gap-0.5">
|
|
68
|
-
<h2
|
|
69
|
-
class="mb-1 flex items-center gap-2 px-3 text-xs font-semibold tracking-wide text-fg-subtle uppercase"
|
|
70
|
-
>
|
|
71
|
-
{#if section.icon}
|
|
72
|
-
<DynamicIcon name={section.icon} size={14} />
|
|
73
|
-
{/if}
|
|
74
|
-
{section.title}
|
|
75
|
-
</h2>
|
|
76
|
-
{#each section.items as entry ('href' in entry ? entry.href : entry.title)}
|
|
77
|
-
{#if 'href' in entry}
|
|
78
|
-
<SidebarLink item={entry} />
|
|
79
|
-
{:else}
|
|
80
|
-
<SidebarGroup group={entry} />
|
|
81
|
-
{/if}
|
|
82
|
-
{/each}
|
|
83
|
-
</div>
|
|
84
|
-
{/each}
|
|
85
|
-
</nav>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { fade } from 'svelte/transition';
|
|
3
|
-
import ChevronDown from '@lucide/svelte/icons/chevron-down';
|
|
4
|
-
import Check from '@lucide/svelte/icons/check';
|
|
5
|
-
import DynamicIcon from '$lib/components/DynamicIcon.svelte';
|
|
6
|
-
import type { Dropdown } from '$lib/types';
|
|
7
|
-
|
|
8
|
-
let { dropdowns, active }: { dropdowns: Dropdown[]; active: Dropdown } = $props();
|
|
9
|
-
|
|
10
|
-
let open = $state(false);
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<div class="relative mb-5">
|
|
14
|
-
<button
|
|
15
|
-
type="button"
|
|
16
|
-
onclick={() => (open = !open)}
|
|
17
|
-
aria-expanded={open}
|
|
18
|
-
class="flex w-full items-center gap-2.5 rounded-lg border border-border bg-surface px-3 py-2.5 text-sm font-medium text-fg transition hover:border-border-strong"
|
|
19
|
-
>
|
|
20
|
-
{#if active.icon}
|
|
21
|
-
<DynamicIcon name={active.icon} size={16} class="text-fg-muted" />
|
|
22
|
-
{/if}
|
|
23
|
-
<span class="flex-1 text-left">{active.label}</span>
|
|
24
|
-
<ChevronDown size={15} class="text-fg-subtle transition-transform {open ? 'rotate-180' : ''}" />
|
|
25
|
-
</button>
|
|
26
|
-
|
|
27
|
-
{#if open}
|
|
28
|
-
<button
|
|
29
|
-
type="button"
|
|
30
|
-
class="fixed inset-0 z-40 cursor-default"
|
|
31
|
-
aria-label="Close"
|
|
32
|
-
onclick={() => (open = false)}
|
|
33
|
-
></button>
|
|
34
|
-
<div
|
|
35
|
-
class="absolute right-0 left-0 z-50 mt-1.5 overflow-hidden rounded-lg border border-border bg-surface-raised p-1 shadow-lg"
|
|
36
|
-
transition:fade={{ duration: 100 }}
|
|
37
|
-
>
|
|
38
|
-
{#each dropdowns as dropdown (dropdown.label)}
|
|
39
|
-
<a
|
|
40
|
-
href={dropdown.href}
|
|
41
|
-
onclick={() => (open = false)}
|
|
42
|
-
class="flex items-center gap-2.5 rounded-md px-2.5 py-2 text-sm transition hover:bg-bg-subtle
|
|
43
|
-
{dropdown === active ? 'font-medium text-fg' : 'text-fg-muted'}"
|
|
44
|
-
>
|
|
45
|
-
{#if dropdown.icon}
|
|
46
|
-
<DynamicIcon name={dropdown.icon} size={16} />
|
|
47
|
-
{/if}
|
|
48
|
-
<span class="flex-1">{dropdown.label}</span>
|
|
49
|
-
{#if dropdown === active}
|
|
50
|
-
<Check size={15} class="text-fg-subtle" />
|
|
51
|
-
{/if}
|
|
52
|
-
</a>
|
|
53
|
-
{/each}
|
|
54
|
-
</div>
|
|
55
|
-
{/if}
|
|
56
|
-
</div>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import ArrowUpRight from '@lucide/svelte/icons/arrow-up-right';
|
|
3
|
-
|
|
4
|
-
let { links }: { links: { title: string; href: string }[] } = $props();
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<div class="flex flex-col gap-0.5 border-t border-border pt-3">
|
|
8
|
-
{#each links as link (link.href)}
|
|
9
|
-
<a
|
|
10
|
-
href={link.href}
|
|
11
|
-
target="_blank"
|
|
12
|
-
rel="noreferrer"
|
|
13
|
-
class="group flex items-center justify-between gap-2 rounded-md px-3 py-1.5 text-sm text-fg-muted transition hover:bg-bg-subtle hover:text-fg"
|
|
14
|
-
>
|
|
15
|
-
<span>{link.title}</span>
|
|
16
|
-
<ArrowUpRight size={14} class="text-fg-subtle transition group-hover:text-fg-muted" />
|
|
17
|
-
</a>
|
|
18
|
-
{/each}
|
|
19
|
-
</div>
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { untrack } from 'svelte';
|
|
3
|
-
import { slide } from 'svelte/transition';
|
|
4
|
-
import { page } from '$app/state';
|
|
5
|
-
import ChevronRight from '@lucide/svelte/icons/chevron-right';
|
|
6
|
-
import type { NavEntry, NavGroup } from '$lib/types';
|
|
7
|
-
import DynamicIcon from '$lib/components/DynamicIcon.svelte';
|
|
8
|
-
import SidebarLink from './SidebarLink.svelte';
|
|
9
|
-
import Self from './SidebarGroup.svelte';
|
|
10
|
-
|
|
11
|
-
let { group, depth = 0 }: { group: NavGroup; depth?: number } = $props();
|
|
12
|
-
|
|
13
|
-
function containsActive(items: NavEntry[], path: string): boolean {
|
|
14
|
-
return items.some((entry) =>
|
|
15
|
-
'href' in entry ? entry.href === path : containsActive(entry.items, path)
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Open when the meta sets `defaultOpen`, or when a descendant is the current
|
|
20
|
-
// page (so the active page is never hidden).
|
|
21
|
-
let open = $state(
|
|
22
|
-
untrack(() => group.defaultOpen === true || containsActive(group.items, page.url.pathname))
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
const key = (entry: NavEntry) => ('href' in entry ? entry.href : entry.title);
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<div>
|
|
29
|
-
<button
|
|
30
|
-
type="button"
|
|
31
|
-
onclick={() => (open = !open)}
|
|
32
|
-
aria-expanded={open}
|
|
33
|
-
style="padding-left: {0.75 + depth * 0.75}rem"
|
|
34
|
-
class="group flex w-full items-center gap-2.5 rounded-md py-1.5 pr-3 text-sm font-medium text-fg-muted transition hover:bg-bg-subtle hover:text-fg"
|
|
35
|
-
>
|
|
36
|
-
{#if group.icon}
|
|
37
|
-
<DynamicIcon name={group.icon} size={16} class="text-fg-subtle" />
|
|
38
|
-
{/if}
|
|
39
|
-
<span class="flex-1 text-left">{group.title}</span>
|
|
40
|
-
<ChevronRight size={14} class="text-fg-subtle transition-transform {open ? 'rotate-90' : ''}" />
|
|
41
|
-
</button>
|
|
42
|
-
|
|
43
|
-
{#if open}
|
|
44
|
-
<div transition:slide={{ duration: 150 }} class="mt-0.5 flex flex-col gap-0.5">
|
|
45
|
-
{#each group.items as entry (key(entry))}
|
|
46
|
-
{#if 'href' in entry}
|
|
47
|
-
<SidebarLink item={entry} depth={depth + 1} />
|
|
48
|
-
{:else}
|
|
49
|
-
<Self group={entry} depth={depth + 1} />
|
|
50
|
-
{/if}
|
|
51
|
-
{/each}
|
|
52
|
-
</div>
|
|
53
|
-
{/if}
|
|
54
|
-
</div>
|