@fuzdev/fuz_ui 0.169.0
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 +93 -0
- package/dist/Alert.svelte +108 -0
- package/dist/Alert.svelte.d.ts +16 -0
- package/dist/Alert.svelte.d.ts.map +1 -0
- package/dist/ApiDeclarationList.svelte +35 -0
- package/dist/ApiDeclarationList.svelte.d.ts +9 -0
- package/dist/ApiDeclarationList.svelte.d.ts.map +1 -0
- package/dist/ApiIndex.svelte +65 -0
- package/dist/ApiIndex.svelte.d.ts +23 -0
- package/dist/ApiIndex.svelte.d.ts.map +1 -0
- package/dist/ApiModule.svelte +124 -0
- package/dist/ApiModule.svelte.d.ts +22 -0
- package/dist/ApiModule.svelte.d.ts.map +1 -0
- package/dist/Breadcrumb.svelte +83 -0
- package/dist/Breadcrumb.svelte.d.ts +23 -0
- package/dist/Breadcrumb.svelte.d.ts.map +1 -0
- package/dist/Card.svelte +157 -0
- package/dist/Card.svelte.d.ts +13 -0
- package/dist/Card.svelte.d.ts.map +1 -0
- package/dist/ColorSchemeInput.svelte +65 -0
- package/dist/ColorSchemeInput.svelte.d.ts +11 -0
- package/dist/ColorSchemeInput.svelte.d.ts.map +1 -0
- package/dist/Contextmenu.svelte +30 -0
- package/dist/Contextmenu.svelte.d.ts +32 -0
- package/dist/Contextmenu.svelte.d.ts.map +1 -0
- package/dist/ContextmenuEntry.svelte +74 -0
- package/dist/ContextmenuEntry.svelte.d.ts +12 -0
- package/dist/ContextmenuEntry.svelte.d.ts.map +1 -0
- package/dist/ContextmenuLinkEntry.svelte +112 -0
- package/dist/ContextmenuLinkEntry.svelte.d.ts +12 -0
- package/dist/ContextmenuLinkEntry.svelte.d.ts.map +1 -0
- package/dist/ContextmenuRoot.svelte +372 -0
- package/dist/ContextmenuRoot.svelte.d.ts +71 -0
- package/dist/ContextmenuRoot.svelte.d.ts.map +1 -0
- package/dist/ContextmenuRootForSafariCompatibility.svelte +541 -0
- package/dist/ContextmenuRootForSafariCompatibility.svelte.d.ts +79 -0
- package/dist/ContextmenuRootForSafariCompatibility.svelte.d.ts.map +1 -0
- package/dist/ContextmenuSeparator.svelte +16 -0
- package/dist/ContextmenuSeparator.svelte.d.ts +4 -0
- package/dist/ContextmenuSeparator.svelte.d.ts.map +1 -0
- package/dist/ContextmenuSubmenu.svelte +116 -0
- package/dist/ContextmenuSubmenu.svelte.d.ts +10 -0
- package/dist/ContextmenuSubmenu.svelte.d.ts.map +1 -0
- package/dist/ContextmenuTextEntry.svelte +21 -0
- package/dist/ContextmenuTextEntry.svelte.d.ts +10 -0
- package/dist/ContextmenuTextEntry.svelte.d.ts.map +1 -0
- package/dist/CopyToClipboard.svelte +81 -0
- package/dist/CopyToClipboard.svelte.d.ts +18 -0
- package/dist/CopyToClipboard.svelte.d.ts.map +1 -0
- package/dist/DeclarationDetail.svelte +340 -0
- package/dist/DeclarationDetail.svelte.d.ts +8 -0
- package/dist/DeclarationDetail.svelte.d.ts.map +1 -0
- package/dist/DeclarationLink.svelte +50 -0
- package/dist/DeclarationLink.svelte.d.ts +8 -0
- package/dist/DeclarationLink.svelte.d.ts.map +1 -0
- package/dist/Details.svelte +51 -0
- package/dist/Details.svelte.d.ts +20 -0
- package/dist/Details.svelte.d.ts.map +1 -0
- package/dist/Dialog.svelte +217 -0
- package/dist/Dialog.svelte.d.ts +30 -0
- package/dist/Dialog.svelte.d.ts.map +1 -0
- package/dist/Dialogs.svelte +28 -0
- package/dist/Dialogs.svelte.d.ts +11 -0
- package/dist/Dialogs.svelte.d.ts.map +1 -0
- package/dist/Docs.svelte +179 -0
- package/dist/Docs.svelte.d.ts +13 -0
- package/dist/Docs.svelte.d.ts.map +1 -0
- package/dist/DocsContent.svelte +40 -0
- package/dist/DocsContent.svelte.d.ts +14 -0
- package/dist/DocsContent.svelte.d.ts.map +1 -0
- package/dist/DocsFooter.svelte +64 -0
- package/dist/DocsFooter.svelte.d.ts +15 -0
- package/dist/DocsFooter.svelte.d.ts.map +1 -0
- package/dist/DocsLink.svelte +41 -0
- package/dist/DocsLink.svelte.d.ts +12 -0
- package/dist/DocsLink.svelte.d.ts.map +1 -0
- package/dist/DocsList.svelte +44 -0
- package/dist/DocsList.svelte.d.ts +11 -0
- package/dist/DocsList.svelte.d.ts.map +1 -0
- package/dist/DocsMenu.svelte +55 -0
- package/dist/DocsMenu.svelte.d.ts +11 -0
- package/dist/DocsMenu.svelte.d.ts.map +1 -0
- package/dist/DocsMenuHeader.svelte +15 -0
- package/dist/DocsMenuHeader.svelte.d.ts +9 -0
- package/dist/DocsMenuHeader.svelte.d.ts.map +1 -0
- package/dist/DocsModulesList.svelte +32 -0
- package/dist/DocsModulesList.svelte.d.ts +7 -0
- package/dist/DocsModulesList.svelte.d.ts.map +1 -0
- package/dist/DocsPageLinks.svelte +61 -0
- package/dist/DocsPageLinks.svelte.d.ts +8 -0
- package/dist/DocsPageLinks.svelte.d.ts.map +1 -0
- package/dist/DocsPrimaryNav.svelte +93 -0
- package/dist/DocsPrimaryNav.svelte.d.ts +11 -0
- package/dist/DocsPrimaryNav.svelte.d.ts.map +1 -0
- package/dist/DocsSearch.svelte +48 -0
- package/dist/DocsSearch.svelte.d.ts +11 -0
- package/dist/DocsSearch.svelte.d.ts.map +1 -0
- package/dist/DocsSecondaryNav.svelte +63 -0
- package/dist/DocsSecondaryNav.svelte.d.ts +9 -0
- package/dist/DocsSecondaryNav.svelte.d.ts.map +1 -0
- package/dist/DocsTertiaryNav.svelte +118 -0
- package/dist/DocsTertiaryNav.svelte.d.ts +10 -0
- package/dist/DocsTertiaryNav.svelte.d.ts.map +1 -0
- package/dist/EcosystemLinks.svelte +53 -0
- package/dist/EcosystemLinks.svelte.d.ts +7 -0
- package/dist/EcosystemLinks.svelte.d.ts.map +1 -0
- package/dist/EcosystemLinksPanel.svelte +22 -0
- package/dist/EcosystemLinksPanel.svelte.d.ts +8 -0
- package/dist/EcosystemLinksPanel.svelte.d.ts.map +1 -0
- package/dist/GithubLink.svelte +75 -0
- package/dist/GithubLink.svelte.d.ts +14 -0
- package/dist/GithubLink.svelte.d.ts.map +1 -0
- package/dist/Glyph.svelte +28 -0
- package/dist/Glyph.svelte.d.ts +9 -0
- package/dist/Glyph.svelte.d.ts.map +1 -0
- package/dist/Hashlink.svelte +41 -0
- package/dist/Hashlink.svelte.d.ts +8 -0
- package/dist/Hashlink.svelte.d.ts.map +1 -0
- package/dist/HiddenPersonalLinks.svelte +6 -0
- package/dist/HiddenPersonalLinks.svelte.d.ts +27 -0
- package/dist/HiddenPersonalLinks.svelte.d.ts.map +1 -0
- package/dist/HueInput.svelte +127 -0
- package/dist/HueInput.svelte.d.ts +11 -0
- package/dist/HueInput.svelte.d.ts.map +1 -0
- package/dist/ImgOrSvg.svelte +58 -0
- package/dist/ImgOrSvg.svelte.d.ts +25 -0
- package/dist/ImgOrSvg.svelte.d.ts.map +1 -0
- package/dist/LibraryDetail.svelte +297 -0
- package/dist/LibraryDetail.svelte.d.ts +15 -0
- package/dist/LibraryDetail.svelte.d.ts.map +1 -0
- package/dist/LibrarySummary.svelte +151 -0
- package/dist/LibrarySummary.svelte.d.ts +16 -0
- package/dist/LibrarySummary.svelte.d.ts.map +1 -0
- package/dist/MdnLink.svelte +40 -0
- package/dist/MdnLink.svelte.d.ts +8 -0
- package/dist/MdnLink.svelte.d.ts.map +1 -0
- package/dist/Mdz.svelte +30 -0
- package/dist/Mdz.svelte.d.ts +10 -0
- package/dist/Mdz.svelte.d.ts.map +1 -0
- package/dist/MdzNodeView.svelte +93 -0
- package/dist/MdzNodeView.svelte.d.ts +9 -0
- package/dist/MdzNodeView.svelte.d.ts.map +1 -0
- package/dist/ModuleLink.svelte +48 -0
- package/dist/ModuleLink.svelte.d.ts +8 -0
- package/dist/ModuleLink.svelte.d.ts.map +1 -0
- package/dist/PasteFromClipboard.svelte +35 -0
- package/dist/PasteFromClipboard.svelte.d.ts +9 -0
- package/dist/PasteFromClipboard.svelte.d.ts.map +1 -0
- package/dist/PendingAnimation.svelte +62 -0
- package/dist/PendingAnimation.svelte.d.ts +13 -0
- package/dist/PendingAnimation.svelte.d.ts.map +1 -0
- package/dist/PendingButton.svelte +75 -0
- package/dist/PendingButton.svelte.d.ts +17 -0
- package/dist/PendingButton.svelte.d.ts.map +1 -0
- package/dist/ProjectLinks.svelte +54 -0
- package/dist/ProjectLinks.svelte.d.ts +19 -0
- package/dist/ProjectLinks.svelte.d.ts.map +1 -0
- package/dist/Redirect.svelte +44 -0
- package/dist/Redirect.svelte.d.ts +23 -0
- package/dist/Redirect.svelte.d.ts.map +1 -0
- package/dist/Spiders.svelte +57 -0
- package/dist/Spiders.svelte.d.ts +9 -0
- package/dist/Spiders.svelte.d.ts.map +1 -0
- package/dist/Svg.svelte +99 -0
- package/dist/Svg.svelte.d.ts +54 -0
- package/dist/Svg.svelte.d.ts.map +1 -0
- package/dist/Teleport.svelte +48 -0
- package/dist/Teleport.svelte.d.ts +15 -0
- package/dist/Teleport.svelte.d.ts.map +1 -0
- package/dist/ThemeInput.svelte +75 -0
- package/dist/ThemeInput.svelte.d.ts +15 -0
- package/dist/ThemeInput.svelte.d.ts.map +1 -0
- package/dist/Themed.svelte +101 -0
- package/dist/Themed.svelte.d.ts +24 -0
- package/dist/Themed.svelte.d.ts.map +1 -0
- package/dist/TomeContent.svelte +67 -0
- package/dist/TomeContent.svelte.d.ts +12 -0
- package/dist/TomeContent.svelte.d.ts.map +1 -0
- package/dist/TomeHeader.svelte +56 -0
- package/dist/TomeHeader.svelte.d.ts +4 -0
- package/dist/TomeHeader.svelte.d.ts.map +1 -0
- package/dist/TomeLink.svelte +29 -0
- package/dist/TomeLink.svelte.d.ts +10 -0
- package/dist/TomeLink.svelte.d.ts.map +1 -0
- package/dist/TomeSection.svelte +65 -0
- package/dist/TomeSection.svelte.d.ts +24 -0
- package/dist/TomeSection.svelte.d.ts.map +1 -0
- package/dist/TomeSectionHeader.svelte +90 -0
- package/dist/TomeSectionHeader.svelte.d.ts +13 -0
- package/dist/TomeSectionHeader.svelte.d.ts.map +1 -0
- package/dist/TypeLink.svelte +19 -0
- package/dist/TypeLink.svelte.d.ts +7 -0
- package/dist/TypeLink.svelte.d.ts.map +1 -0
- package/dist/alert.d.ts +7 -0
- package/dist/alert.d.ts.map +1 -0
- package/dist/alert.js +6 -0
- package/dist/api_search.svelte.d.ts +16 -0
- package/dist/api_search.svelte.d.ts.map +1 -0
- package/dist/api_search.svelte.js +61 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +3 -0
- package/dist/context_helpers.d.ts +17 -0
- package/dist/context_helpers.d.ts.map +1 -0
- package/dist/context_helpers.js +19 -0
- package/dist/contextmenu_helpers.d.ts +16 -0
- package/dist/contextmenu_helpers.d.ts.map +1 -0
- package/dist/contextmenu_helpers.js +39 -0
- package/dist/contextmenu_state.svelte.d.ts +152 -0
- package/dist/contextmenu_state.svelte.d.ts.map +1 -0
- package/dist/contextmenu_state.svelte.js +424 -0
- package/dist/csp.d.ts +160 -0
- package/dist/csp.d.ts.map +1 -0
- package/dist/csp.js +354 -0
- package/dist/csp_of_ryanatkn.d.ts +6 -0
- package/dist/csp_of_ryanatkn.d.ts.map +1 -0
- package/dist/csp_of_ryanatkn.js +14 -0
- package/dist/declaration.svelte.d.ts +84 -0
- package/dist/declaration.svelte.d.ts.map +1 -0
- package/dist/declaration.svelte.js +66 -0
- package/dist/declaration_contextmenu.d.ts +4 -0
- package/dist/declaration_contextmenu.d.ts.map +1 -0
- package/dist/declaration_contextmenu.js +14 -0
- package/dist/dialog.d.ts +24 -0
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dialog.js +12 -0
- package/dist/dimensions.svelte.d.ts +5 -0
- package/dist/dimensions.svelte.d.ts.map +1 -0
- package/dist/dimensions.svelte.js +4 -0
- package/dist/docs_helpers.svelte.d.ts +48 -0
- package/dist/docs_helpers.svelte.d.ts.map +1 -0
- package/dist/docs_helpers.svelte.js +99 -0
- package/dist/helpers.d.ts +2 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +16 -0
- package/dist/intersect.svelte.d.ts +47 -0
- package/dist/intersect.svelte.d.ts.map +1 -0
- package/dist/intersect.svelte.js +92 -0
- package/dist/library.svelte.d.ts +197 -0
- package/dist/library.svelte.d.ts.map +1 -0
- package/dist/library.svelte.js +130 -0
- package/dist/library_gen.d.ts +34 -0
- package/dist/library_gen.d.ts.map +1 -0
- package/dist/library_gen.js +123 -0
- package/dist/library_gen_helpers.d.ts +85 -0
- package/dist/library_gen_helpers.d.ts.map +1 -0
- package/dist/library_gen_helpers.js +188 -0
- package/dist/library_helpers.d.ts +54 -0
- package/dist/library_helpers.d.ts.map +1 -0
- package/dist/library_helpers.js +102 -0
- package/dist/logos.d.ts +134 -0
- package/dist/logos.d.ts.map +1 -0
- package/dist/logos.js +281 -0
- package/dist/mdz.d.ts +106 -0
- package/dist/mdz.d.ts.map +1 -0
- package/dist/mdz.js +1481 -0
- package/dist/mdz_components.d.ts +37 -0
- package/dist/mdz_components.d.ts.map +1 -0
- package/dist/mdz_components.js +12 -0
- package/dist/module.svelte.d.ts +47 -0
- package/dist/module.svelte.d.ts.map +1 -0
- package/dist/module.svelte.js +56 -0
- package/dist/module_contextmenu.d.ts +4 -0
- package/dist/module_contextmenu.d.ts.map +1 -0
- package/dist/module_contextmenu.js +14 -0
- package/dist/module_helpers.d.ts +69 -0
- package/dist/module_helpers.d.ts.map +1 -0
- package/dist/module_helpers.js +87 -0
- package/dist/rune_helpers.svelte.d.ts +6 -0
- package/dist/rune_helpers.svelte.d.ts.map +1 -0
- package/dist/rune_helpers.svelte.js +10 -0
- package/dist/storage.d.ts +13 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +43 -0
- package/dist/svelte_helpers.d.ts +37 -0
- package/dist/svelte_helpers.d.ts.map +1 -0
- package/dist/svelte_helpers.js +245 -0
- package/dist/themer.svelte.d.ts +24 -0
- package/dist/themer.svelte.d.ts.map +1 -0
- package/dist/themer.svelte.js +43 -0
- package/dist/tome.d.ts +80 -0
- package/dist/tome.d.ts.map +1 -0
- package/dist/tome.js +27 -0
- package/dist/ts_helpers.d.ts +110 -0
- package/dist/ts_helpers.d.ts.map +1 -0
- package/dist/ts_helpers.js +533 -0
- package/dist/tsdoc_helpers.d.ts +98 -0
- package/dist/tsdoc_helpers.d.ts.map +1 -0
- package/dist/tsdoc_helpers.js +221 -0
- package/package.json +128 -0
- package/src/lib/alert.ts +14 -0
- package/src/lib/api_search.svelte.ts +85 -0
- package/src/lib/constants.ts +3 -0
- package/src/lib/context_helpers.ts +47 -0
- package/src/lib/contextmenu_helpers.ts +63 -0
- package/src/lib/contextmenu_state.svelte.ts +515 -0
- package/src/lib/csp.ts +576 -0
- package/src/lib/csp_of_ryanatkn.ts +16 -0
- package/src/lib/declaration.svelte.ts +102 -0
- package/src/lib/declaration_contextmenu.ts +22 -0
- package/src/lib/dialog.ts +35 -0
- package/src/lib/dimensions.svelte.ts +4 -0
- package/src/lib/docs_helpers.svelte.ts +149 -0
- package/src/lib/helpers.ts +10 -0
- package/src/lib/intersect.svelte.ts +152 -0
- package/src/lib/library.svelte.ts +162 -0
- package/src/lib/library_gen.ts +160 -0
- package/src/lib/library_gen_helpers.ts +262 -0
- package/src/lib/library_helpers.ts +123 -0
- package/src/lib/logos.ts +302 -0
- package/src/lib/mdz.ts +1819 -0
- package/src/lib/mdz_components.ts +34 -0
- package/src/lib/module.svelte.ts +78 -0
- package/src/lib/module_contextmenu.ts +20 -0
- package/src/lib/module_helpers.ts +113 -0
- package/src/lib/rune_helpers.svelte.ts +10 -0
- package/src/lib/storage.ts +48 -0
- package/src/lib/svelte_helpers.ts +303 -0
- package/src/lib/themer.svelte.ts +68 -0
- package/src/lib/tome.ts +38 -0
- package/src/lib/ts_helpers.ts +662 -0
- package/src/lib/tsdoc_helpers.ts +259 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Ryan Atkinson <mail@ryanatkn.com> <https://ryanatkn.com/>
|
|
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,93 @@
|
|
|
1
|
+
# Fuz
|
|
2
|
+
|
|
3
|
+
[<img src="static/logo.svg" alt="a friendly brown spider facing you" align="right" width="192" height="192">](https://www.fuz.dev/)
|
|
4
|
+
|
|
5
|
+
> friendly user zystem 🧶 [fuz.dev](https://www.fuz.dev/)
|
|
6
|
+
|
|
7
|
+
Fuz is a [Svelte](https://svelte.dev/) UI library
|
|
8
|
+
with components and helpers for making modern websites.
|
|
9
|
+
It's in early alpha and it will go through many breaking changes.
|
|
10
|
+
|
|
11
|
+
Fuz is being made to support
|
|
12
|
+
[my other projects](https://www.ryanatkn.com/)
|
|
13
|
+
that focus on end-users.
|
|
14
|
+
Fuz emphasizes capability and efficiency and tries to be simple for those goals.
|
|
15
|
+
Compared to most UI libraries, Fuz has fewer conventional features and more opinions.
|
|
16
|
+
|
|
17
|
+
To learn more see [the docs](https://www.fuz.dev/docs) and [contributing.md](contributing.md).
|
|
18
|
+
Feel free to take the ideas and code for your own purposes.
|
|
19
|
+
|
|
20
|
+
The Svelte components and helpers:
|
|
21
|
+
|
|
22
|
+
- builds on my CSS framework [Moss](https://github.com/fuzdev/fuz_css)
|
|
23
|
+
- plain CSS and minimal abstraction
|
|
24
|
+
- near-zero dependencies except for Svelte, SvelteKit, Moss,
|
|
25
|
+
and my utility library [`@fuzdev/fuz_util`](https://github.com/fuzdev/fuz_util)
|
|
26
|
+
(not all components require SvelteKit but some do import its modules, needs more consideration)
|
|
27
|
+
- not a fully-featured enterprise-ready set of components,
|
|
28
|
+
it's being developed for the needs of specific projects, though eventually it will fill out
|
|
29
|
+
- should be easy to copy/paste into your projects when you need full control like
|
|
30
|
+
[shadcn-svelte](https://github.com/huntabyte/shadcn-svelte),
|
|
31
|
+
I'll look into smoothing this pattern out in the future
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
> ⚠️ Expect a lot of breaking changes. If you want to help stabilize the API,
|
|
36
|
+
> thank you see [contributing.md](contributing.md), your input is appreciated.
|
|
37
|
+
>
|
|
38
|
+
> If you feel comfortable looking at the source code,
|
|
39
|
+
> Fuz is ready to use in your own projects,
|
|
40
|
+
> with the major caveat that there will be a lot of breaking changes ahead.
|
|
41
|
+
> The code is significantly incomplete but I think it's stable enough to use
|
|
42
|
+
> if you're willing to keep up with the relatively fast-moving changelog.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm i -D @ryanatkn/fuz
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Fuz uses my style framework [Moss](https://github.com/fuzdev/fuz_css).
|
|
49
|
+
Import modules at their full paths:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
// Moss has one main plain CSS stylesheet:
|
|
53
|
+
import '@fuzdev/fuz_css/style.css';
|
|
54
|
+
|
|
55
|
+
// and import a Moss theme:
|
|
56
|
+
import '@fuzdev/fuz_css/theme.css'; // or bring your own
|
|
57
|
+
|
|
58
|
+
// using Gro generates Moss' utility classes stylesheet by default:
|
|
59
|
+
import '$routes/moss.css';
|
|
60
|
+
|
|
61
|
+
// then import Fuz Svelte components:
|
|
62
|
+
import Themed from '@ryanatkn/fuz/Themed.svelte';
|
|
63
|
+
|
|
64
|
+
// and Fuz TypeScript modules:
|
|
65
|
+
import {type Theme, themer_context} from '@ryanatkn/fuz/themer.svelte.js';
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
See [the library](https://www.fuz.dev/docs) for more.
|
|
69
|
+
|
|
70
|
+
## Contributing
|
|
71
|
+
|
|
72
|
+
See [contributing.md](contributing.md).
|
|
73
|
+
|
|
74
|
+
## Develop
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm i # node >=20.10
|
|
78
|
+
|
|
79
|
+
# development
|
|
80
|
+
npm run dev
|
|
81
|
+
|
|
82
|
+
# production
|
|
83
|
+
npm run build
|
|
84
|
+
npm start
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Fuz uses [Gro](https://github.com/ryanatkn/gro),
|
|
88
|
+
my CLI and toolkit that I use to run tasks in all of my projects.
|
|
89
|
+
If you're not allergic it's handy to install globally.
|
|
90
|
+
|
|
91
|
+
## License 🐦
|
|
92
|
+
|
|
93
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type {Snippet} from 'svelte';
|
|
3
|
+
import type {HTMLAttributes} from 'svelte/elements';
|
|
4
|
+
|
|
5
|
+
import {alert_status_options, type AlertStatus} from './alert.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/alert/
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// TODO think through Alert+Card APIs together, one can be a button and the other a link atm
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
status = 'inform',
|
|
15
|
+
color,
|
|
16
|
+
onclick,
|
|
17
|
+
disabled,
|
|
18
|
+
attrs,
|
|
19
|
+
icon,
|
|
20
|
+
children,
|
|
21
|
+
}: {
|
|
22
|
+
status?: AlertStatus;
|
|
23
|
+
color?: string;
|
|
24
|
+
// TODO this API is a mess in part because of the types, maybe an explicit `AlertButton` is better,
|
|
25
|
+
// or rethink the design because `role="alert"` can't be put on buttons.
|
|
26
|
+
// $props must be destructured, so we can't use a union with narrowing right?
|
|
27
|
+
// so `disabled` only makes sense if `onclick` is defined, and we dont get the other HTMLButtonElement attributes
|
|
28
|
+
onclick?: (() => void) | undefined;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
attrs?: HTMLAttributes<HTMLElement> | undefined;
|
|
31
|
+
icon?: string | Snippet<[icon: string]> | null | undefined; // TODO experimenting with this, gets complex in the impl
|
|
32
|
+
children: Snippet;
|
|
33
|
+
} = $props();
|
|
34
|
+
|
|
35
|
+
const options = $derived(alert_status_options[status]);
|
|
36
|
+
// TODO change this to use the hue and put transparency on the borders, or add a borderColor option
|
|
37
|
+
const {color: status_color, icon: status_icon} = $derived(options);
|
|
38
|
+
const final_color = $derived(color ?? status_color);
|
|
39
|
+
const final_icon = $derived(
|
|
40
|
+
typeof icon === 'string' ? icon : (status_icon ?? alert_status_options.inform.icon!),
|
|
41
|
+
);
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
{#if onclick}
|
|
45
|
+
<button
|
|
46
|
+
class="message"
|
|
47
|
+
type="button"
|
|
48
|
+
style:--text_color={final_color}
|
|
49
|
+
{onclick}
|
|
50
|
+
{disabled}
|
|
51
|
+
{...attrs}
|
|
52
|
+
>
|
|
53
|
+
{@render content()}
|
|
54
|
+
</button>
|
|
55
|
+
{:else}
|
|
56
|
+
<div role="alert" class="message panel" style:--text_color={final_color} {...attrs}>
|
|
57
|
+
{@render content()}
|
|
58
|
+
</div>
|
|
59
|
+
{/if}
|
|
60
|
+
|
|
61
|
+
{#snippet content()}
|
|
62
|
+
{#if icon !== null}
|
|
63
|
+
<div class="icon">
|
|
64
|
+
{#if !icon || typeof icon === 'string'}
|
|
65
|
+
{final_icon}
|
|
66
|
+
{:else}
|
|
67
|
+
{@render icon(final_icon)}
|
|
68
|
+
{/if}
|
|
69
|
+
</div>
|
|
70
|
+
{/if}
|
|
71
|
+
<!-- TODO conflict in the names of content as the snippet and this inner div -->
|
|
72
|
+
<div class="content">
|
|
73
|
+
{@render children()}
|
|
74
|
+
</div>
|
|
75
|
+
{/snippet}
|
|
76
|
+
|
|
77
|
+
<style>
|
|
78
|
+
.message {
|
|
79
|
+
min-height: var(--message_min_height);
|
|
80
|
+
width: 100%;
|
|
81
|
+
color: var(--text_color);
|
|
82
|
+
font-size: var(--font_size_md);
|
|
83
|
+
border-width: var(--border_width_1);
|
|
84
|
+
border-style: var(--border_style);
|
|
85
|
+
border-color: var(--text_color);
|
|
86
|
+
display: flex;
|
|
87
|
+
justify-content: flex-start; /* override button horizontal centering */
|
|
88
|
+
align-items: center;
|
|
89
|
+
padding: var(--space_xs2) var(--space_lg) var(--space_xs2) var(--space_xs);
|
|
90
|
+
margin-bottom: var(--space_lg);
|
|
91
|
+
}
|
|
92
|
+
.message:last-child {
|
|
93
|
+
margin-bottom: 0;
|
|
94
|
+
}
|
|
95
|
+
.icon {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
margin-right: var(--space_md);
|
|
100
|
+
font-size: var(--font_size_xl2);
|
|
101
|
+
min-width: var(--font_size_xl2);
|
|
102
|
+
text-align: center;
|
|
103
|
+
}
|
|
104
|
+
.content {
|
|
105
|
+
text-align: left;
|
|
106
|
+
flex: 1;
|
|
107
|
+
}
|
|
108
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { type AlertStatus } from './alert.js';
|
|
4
|
+
type $$ComponentProps = {
|
|
5
|
+
status?: AlertStatus;
|
|
6
|
+
color?: string;
|
|
7
|
+
onclick?: (() => void) | undefined;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
attrs?: HTMLAttributes<HTMLElement> | undefined;
|
|
10
|
+
icon?: string | Snippet<[icon: string]> | null | undefined;
|
|
11
|
+
children: Snippet;
|
|
12
|
+
};
|
|
13
|
+
declare const Alert: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
14
|
+
type Alert = ReturnType<typeof Alert>;
|
|
15
|
+
export default Alert;
|
|
16
|
+
//# sourceMappingURL=Alert.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Alert.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAuB,KAAK,WAAW,EAAC,MAAM,YAAY,CAAC;AAEjE,KAAK,gBAAgB,GAAI;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;IAChD,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3D,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA8DH,QAAA,MAAM,KAAK,sDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type {Declaration} from './declaration.svelte.js';
|
|
3
|
+
import DeclarationDetail from './DeclarationDetail.svelte';
|
|
4
|
+
import TomeSection from './TomeSection.svelte';
|
|
5
|
+
import TomeSectionHeader from './TomeSectionHeader.svelte';
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
declarations,
|
|
9
|
+
search_query = '',
|
|
10
|
+
}: {
|
|
11
|
+
declarations: Array<Declaration>;
|
|
12
|
+
search_query?: string;
|
|
13
|
+
} = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
{#if declarations.length === 0}
|
|
17
|
+
<section>
|
|
18
|
+
{#if search_query}
|
|
19
|
+
<p>No declarations found matching "{search_query}"</p>
|
|
20
|
+
{:else}
|
|
21
|
+
<p>No declarations</p>
|
|
22
|
+
{/if}
|
|
23
|
+
</section>
|
|
24
|
+
{:else}
|
|
25
|
+
{#each declarations as declaration (`${declaration.module_path}:${declaration.name}`)}
|
|
26
|
+
<TomeSection>
|
|
27
|
+
<TomeSectionHeader text={declaration.name}>
|
|
28
|
+
<div class="word_break_break_all">{declaration.name}</div>
|
|
29
|
+
</TomeSectionHeader>
|
|
30
|
+
<article id={declaration.name}>
|
|
31
|
+
<DeclarationDetail {declaration} />
|
|
32
|
+
</article>
|
|
33
|
+
</TomeSection>
|
|
34
|
+
{/each}
|
|
35
|
+
{/if}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Declaration } from './declaration.svelte.js';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
declarations: Array<Declaration>;
|
|
4
|
+
search_query?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const ApiDeclarationList: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ApiDeclarationList = ReturnType<typeof ApiDeclarationList>;
|
|
8
|
+
export default ApiDeclarationList;
|
|
9
|
+
//# sourceMappingURL=ApiDeclarationList.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiDeclarationList.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiDeclarationList.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAKxD,KAAK,gBAAgB,GAAI;IACxB,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAoCH,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {library_context, type Library} from './library.svelte.js';
|
|
3
|
+
import {get_tome_by_name, type Tome} from './tome.js';
|
|
4
|
+
import TomeContent from './TomeContent.svelte';
|
|
5
|
+
import TomeSection from './TomeSection.svelte';
|
|
6
|
+
import TomeLink from './TomeLink.svelte';
|
|
7
|
+
import TomeSectionHeader from './TomeSectionHeader.svelte';
|
|
8
|
+
import DocsSearch from './DocsSearch.svelte';
|
|
9
|
+
import ApiDeclarationList from './ApiDeclarationList.svelte';
|
|
10
|
+
import {create_declaration_search} from './api_search.svelte.js';
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
library = library_context.get(),
|
|
14
|
+
tome = get_tome_by_name('api'),
|
|
15
|
+
minimal = false,
|
|
16
|
+
}: {
|
|
17
|
+
/**
|
|
18
|
+
* The library instance to render API docs for.
|
|
19
|
+
* Defaults to getting from library_context.
|
|
20
|
+
*/
|
|
21
|
+
library?: Library;
|
|
22
|
+
/**
|
|
23
|
+
* The tome for the API docs page.
|
|
24
|
+
* Defaults to looking up the 'api' tome.
|
|
25
|
+
*/
|
|
26
|
+
tome?: Tome;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to show minimal content (just a link to full API docs).
|
|
29
|
+
* Used when the API index is shown on a parent docs page.
|
|
30
|
+
*/
|
|
31
|
+
minimal?: boolean;
|
|
32
|
+
} = $props();
|
|
33
|
+
|
|
34
|
+
const search = create_declaration_search(library);
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<svelte:head>
|
|
38
|
+
<title>API docs - {library.package_json.name}</title>
|
|
39
|
+
</svelte:head>
|
|
40
|
+
|
|
41
|
+
<TomeContent {tome}>
|
|
42
|
+
{#if minimal}
|
|
43
|
+
<section>
|
|
44
|
+
<p>Browse the full <TomeLink name="api" /> docs.</p>
|
|
45
|
+
</section>
|
|
46
|
+
{:else}
|
|
47
|
+
<TomeSection>
|
|
48
|
+
<TomeSectionHeader text="Declarations" />
|
|
49
|
+
|
|
50
|
+
<section>
|
|
51
|
+
<p>{library.package_json.description}</p>
|
|
52
|
+
|
|
53
|
+
{#if search.all.length > 1}
|
|
54
|
+
<DocsSearch
|
|
55
|
+
total_count={search.all.length}
|
|
56
|
+
result_count={search.filtered.length}
|
|
57
|
+
bind:search_query={search.query}
|
|
58
|
+
/>
|
|
59
|
+
{/if}
|
|
60
|
+
</section>
|
|
61
|
+
|
|
62
|
+
<ApiDeclarationList declarations={search.filtered} search_query={search.query} />
|
|
63
|
+
</TomeSection>
|
|
64
|
+
{/if}
|
|
65
|
+
</TomeContent>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Library } from './library.svelte.js';
|
|
2
|
+
import { type Tome } from './tome.js';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The library instance to render API docs for.
|
|
6
|
+
* Defaults to getting from library_context.
|
|
7
|
+
*/
|
|
8
|
+
library?: Library;
|
|
9
|
+
/**
|
|
10
|
+
* The tome for the API docs page.
|
|
11
|
+
* Defaults to looking up the 'api' tome.
|
|
12
|
+
*/
|
|
13
|
+
tome?: Tome;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to show minimal content (just a link to full API docs).
|
|
16
|
+
* Used when the API index is shown on a parent docs page.
|
|
17
|
+
*/
|
|
18
|
+
minimal?: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare const ApiIndex: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
21
|
+
type ApiIndex = ReturnType<typeof ApiIndex>;
|
|
22
|
+
export default ApiIndex;
|
|
23
|
+
//# sourceMappingURL=ApiIndex.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiIndex.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiIndex.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAmB,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AASrD,KAAK,gBAAgB,GAAI;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAiDH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {library_context, type Library} from './library.svelte.js';
|
|
3
|
+
import {get_tome_by_name, type Tome} from './tome.js';
|
|
4
|
+
import TomeContent from './TomeContent.svelte';
|
|
5
|
+
import TomeSection from './TomeSection.svelte';
|
|
6
|
+
import TomeSectionHeader from './TomeSectionHeader.svelte';
|
|
7
|
+
import DocsSearch from './DocsSearch.svelte';
|
|
8
|
+
import ModuleLink from './ModuleLink.svelte';
|
|
9
|
+
import Mdz from './Mdz.svelte';
|
|
10
|
+
import ApiDeclarationList from './ApiDeclarationList.svelte';
|
|
11
|
+
import {create_module_declaration_search} from './api_search.svelte.js';
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
module_path: module_path_param,
|
|
15
|
+
library = library_context.get(),
|
|
16
|
+
tome = get_tome_by_name('api'),
|
|
17
|
+
}: {
|
|
18
|
+
/**
|
|
19
|
+
* The module path parameter from the route (e.g., "lib/Button.svelte").
|
|
20
|
+
*/
|
|
21
|
+
module_path: string | Array<string>;
|
|
22
|
+
/**
|
|
23
|
+
* The library instance to render API docs for.
|
|
24
|
+
* Defaults to getting from library_context.
|
|
25
|
+
*/
|
|
26
|
+
library?: Library;
|
|
27
|
+
/**
|
|
28
|
+
* The tome for the API docs page.
|
|
29
|
+
* Defaults to looking up the 'api' tome.
|
|
30
|
+
*/
|
|
31
|
+
tome?: Tome;
|
|
32
|
+
} = $props();
|
|
33
|
+
|
|
34
|
+
// normalize module_path to string (could be array from [...module_path] route param)
|
|
35
|
+
const module_path = $derived(
|
|
36
|
+
Array.isArray(module_path_param) ? module_path_param.join('/') : module_path_param,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// find the module using the lookup helper
|
|
40
|
+
const module = $derived(library.lookup_module(module_path));
|
|
41
|
+
|
|
42
|
+
// fallback for 404
|
|
43
|
+
const module_name = $derived(module?.path || '[missing module]');
|
|
44
|
+
|
|
45
|
+
const search = $derived(create_module_declaration_search(module?.declarations ?? []));
|
|
46
|
+
|
|
47
|
+
// GitHub source URL for the module
|
|
48
|
+
const source_url = $derived(module?.url_github);
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<svelte:head>
|
|
52
|
+
<title>{module_name} - API docs - {library.package_json.name}</title>
|
|
53
|
+
</svelte:head>
|
|
54
|
+
|
|
55
|
+
<TomeContent {tome}>
|
|
56
|
+
{#snippet header()}
|
|
57
|
+
<h1 class="mt_xl4">{module_name}</h1>
|
|
58
|
+
{/snippet}
|
|
59
|
+
|
|
60
|
+
{#if !module}
|
|
61
|
+
<section>
|
|
62
|
+
<p>Module not found: {module_path}</p>
|
|
63
|
+
</section>
|
|
64
|
+
{:else}
|
|
65
|
+
<!-- Declarations Section -->
|
|
66
|
+
<TomeSection>
|
|
67
|
+
<TomeSectionHeader text="Declarations" />
|
|
68
|
+
|
|
69
|
+
<section>
|
|
70
|
+
{#if module.module_comment}
|
|
71
|
+
<blockquote>
|
|
72
|
+
<Mdz content={module.module_comment} />
|
|
73
|
+
</blockquote>
|
|
74
|
+
{/if}
|
|
75
|
+
|
|
76
|
+
{#if search.all.length > 1}
|
|
77
|
+
<DocsSearch
|
|
78
|
+
placeholder="search declarations in this module..."
|
|
79
|
+
total_count={search.all.length}
|
|
80
|
+
result_count={search.filtered.length}
|
|
81
|
+
bind:search_query={search.query}
|
|
82
|
+
/>
|
|
83
|
+
{/if}
|
|
84
|
+
|
|
85
|
+
{#if source_url}
|
|
86
|
+
<p>
|
|
87
|
+
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
|
|
88
|
+
<a href={source_url} class="chip" target="_blank" rel="noopener">view source</a>
|
|
89
|
+
</p>
|
|
90
|
+
{/if}
|
|
91
|
+
</section>
|
|
92
|
+
|
|
93
|
+
<ApiDeclarationList declarations={search.filtered} search_query={search.query} />
|
|
94
|
+
</TomeSection>
|
|
95
|
+
|
|
96
|
+
<!-- Depends on Section -->
|
|
97
|
+
{#if module.dependencies}
|
|
98
|
+
<TomeSection>
|
|
99
|
+
<TomeSectionHeader text="Depends on" />
|
|
100
|
+
<ul>
|
|
101
|
+
{#each module.dependencies as dep_path (dep_path)}
|
|
102
|
+
<li>
|
|
103
|
+
<ModuleLink module_path={dep_path} />
|
|
104
|
+
</li>
|
|
105
|
+
{/each}
|
|
106
|
+
</ul>
|
|
107
|
+
</TomeSection>
|
|
108
|
+
{/if}
|
|
109
|
+
|
|
110
|
+
<!-- Imported by Section -->
|
|
111
|
+
{#if module.dependents}
|
|
112
|
+
<TomeSection>
|
|
113
|
+
<TomeSectionHeader text="Imported by" />
|
|
114
|
+
<ul>
|
|
115
|
+
{#each module.dependents as dependent_path (dependent_path)}
|
|
116
|
+
<li>
|
|
117
|
+
<ModuleLink module_path={dependent_path} />
|
|
118
|
+
</li>
|
|
119
|
+
{/each}
|
|
120
|
+
</ul>
|
|
121
|
+
</TomeSection>
|
|
122
|
+
{/if}
|
|
123
|
+
{/if}
|
|
124
|
+
</TomeContent>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Library } from './library.svelte.js';
|
|
2
|
+
import { type Tome } from './tome.js';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The module path parameter from the route (e.g., "lib/Button.svelte").
|
|
6
|
+
*/
|
|
7
|
+
module_path: string | Array<string>;
|
|
8
|
+
/**
|
|
9
|
+
* The library instance to render API docs for.
|
|
10
|
+
* Defaults to getting from library_context.
|
|
11
|
+
*/
|
|
12
|
+
library?: Library;
|
|
13
|
+
/**
|
|
14
|
+
* The tome for the API docs page.
|
|
15
|
+
* Defaults to looking up the 'api' tome.
|
|
16
|
+
*/
|
|
17
|
+
tome?: Tome;
|
|
18
|
+
};
|
|
19
|
+
declare const ApiModule: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
20
|
+
type ApiModule = ReturnType<typeof ApiModule>;
|
|
21
|
+
export default ApiModule;
|
|
22
|
+
//# sourceMappingURL=ApiModule.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiModule.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiModule.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAmB,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAUrD,KAAK,gBAAgB,GAAI;IACxB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AA4GH,QAAA,MAAM,SAAS,sDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {parse_path_pieces} from '@fuzdev/fuz_util/path.js';
|
|
3
|
+
import {resolve} from '$app/paths';
|
|
4
|
+
import {page} from '$app/state';
|
|
5
|
+
import type {Snippet} from 'svelte';
|
|
6
|
+
import {strip_start, ensure_end} from '@fuzdev/fuz_util/string.js';
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
path,
|
|
10
|
+
selected_path,
|
|
11
|
+
base_path,
|
|
12
|
+
separator,
|
|
13
|
+
children,
|
|
14
|
+
}: {
|
|
15
|
+
/**
|
|
16
|
+
* Prefixed with a slash and relative to the base path.
|
|
17
|
+
*/
|
|
18
|
+
path?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Prefixed with a slash and relative to the base path.
|
|
21
|
+
* `null` means none and `undefined` is detected from the current url.
|
|
22
|
+
*/
|
|
23
|
+
selected_path?: string | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Sets a custom base path of `path` and `selected_path`.
|
|
26
|
+
* Defaults to `base` from `$app/paths`.
|
|
27
|
+
*/
|
|
28
|
+
base_path?: string;
|
|
29
|
+
separator?: Snippet;
|
|
30
|
+
children?: Snippet;
|
|
31
|
+
} = $props();
|
|
32
|
+
|
|
33
|
+
const final_base_path = $derived(base_path ?? resolve('/').slice(0, -1));
|
|
34
|
+
|
|
35
|
+
const final_path = $derived(path ?? strip_start(page.url.pathname, final_base_path));
|
|
36
|
+
|
|
37
|
+
const final_selected_path = $derived(
|
|
38
|
+
selected_path === null ? null : (selected_path ?? final_path),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const path_pieces = $derived(parse_path_pieces(final_path));
|
|
42
|
+
|
|
43
|
+
const root_path = $derived(ensure_end(final_base_path, '/'));
|
|
44
|
+
|
|
45
|
+
// TODO animate these
|
|
46
|
+
// `transition:slide={{axis: 'x'}}`
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<div class="breadcrumb">
|
|
50
|
+
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
|
|
51
|
+
<a href={root_path} class:selected={root_path === final_base_path + final_selected_path}
|
|
52
|
+
>{#if children}{@render children()}{:else}•{/if}</a
|
|
53
|
+
>{#each path_pieces as path_piece (path_piece)}{#if path_piece.type === 'piece'}<!-- eslint-disable-next-line svelte/no-navigation-without-resolve --><a
|
|
54
|
+
href={final_base_path + path_piece.path}
|
|
55
|
+
class:selected={path_piece.path === final_selected_path}>{path_piece.name}</a
|
|
56
|
+
>{:else}<span class="separator"
|
|
57
|
+
>{#if separator}{@render separator()}{:else}/{/if}</span
|
|
58
|
+
>{/if}{/each}
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<style>
|
|
62
|
+
.breadcrumb {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-wrap: wrap;
|
|
65
|
+
align-items: center;
|
|
66
|
+
font-size: var(--font_size, var(--font_size_md));
|
|
67
|
+
}
|
|
68
|
+
a {
|
|
69
|
+
position: relative;
|
|
70
|
+
z-index: 1;
|
|
71
|
+
padding: 0 calc(var(--font_size, var(--font_size_md)) * 0.5);
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
}
|
|
75
|
+
.separator {
|
|
76
|
+
position: relative;
|
|
77
|
+
z-index: 0;
|
|
78
|
+
display: flex;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
align-items: center;
|
|
81
|
+
width: 0;
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Prefixed with a slash and relative to the base path.
|
|
5
|
+
*/
|
|
6
|
+
path?: string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Prefixed with a slash and relative to the base path.
|
|
9
|
+
* `null` means none and `undefined` is detected from the current url.
|
|
10
|
+
*/
|
|
11
|
+
selected_path?: string | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Sets a custom base path of `path` and `selected_path`.
|
|
14
|
+
* Defaults to `base` from `$app/paths`.
|
|
15
|
+
*/
|
|
16
|
+
base_path?: string;
|
|
17
|
+
separator?: Snippet;
|
|
18
|
+
children?: Snippet;
|
|
19
|
+
};
|
|
20
|
+
declare const Breadcrumb: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
21
|
+
type Breadcrumb = ReturnType<typeof Breadcrumb>;
|
|
22
|
+
export default Breadcrumb;
|
|
23
|
+
//# sourceMappingURL=Breadcrumb.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Breadcrumb.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAGnC,KAAK,gBAAgB,GAAI;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAyCH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|