@sewadah/selaras-docs 1.0.0 → 1.0.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/CHANGELOG.md +104 -0
- package/README.md +51 -2
- package/app/app.config.ts +20 -1
- package/app/app.vue +13 -0
- package/app/assets/style.css +109 -3
- package/app/components/DocsFooter.vue +3 -4
- package/app/components/DocsFooterBrand.vue +10 -0
- package/app/components/DocsHeader.vue +25 -24
- package/app/components/DocsHeaderBrand.vue +11 -0
- package/app/components/DocsLogo.vue +19 -0
- package/app/components/DocsSearchButton.vue +5 -3
- package/app/components/DocsSidebar.vue +4 -1
- package/app/composables/useDocsLogo.ts +30 -0
- package/app/composables/useDocsNavigation.ts +51 -2
- package/app/layouts/selaras-docs.vue +16 -2
- package/app/pages/[...slug].vue +15 -4
- package/content.config.ts +33 -4
- package/nuxt.config.mjs +10 -0
- package/package.json +8 -2
- package/types.d.ts +38 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v1.0.1
|
|
4
|
+
|
|
5
|
+
[compare changes](https://github.com/sewadahapp/selaras/compare/selaras-docs-v1.0.0...selaras-docs-v1.0.1)
|
|
6
|
+
|
|
7
|
+
### 🚀 Enhancements
|
|
8
|
+
|
|
9
|
+
- **feat(docs):** add Degung theme preset ([9af1f54](https://github.com/sewadahapp/selaras/commit/9af1f54af58d18bd9305ddf944243052bda9a022))
|
|
10
|
+
- **feat(docs):** tint logo with active theme color ([102f525](https://github.com/sewadahapp/selaras/commit/102f5254a553e5c646357307c685816a2147bcf7))
|
|
11
|
+
- **feat(docs):** add Pelog and Slendro theme presets ([90dfe04](https://github.com/sewadahapp/selaras/commit/90dfe04f247ad032cd3f6ef03fca662c46d9f936))
|
|
12
|
+
- **feat:** refine code tree viewer ([ef27831](https://github.com/sewadahapp/selaras/commit/ef2783151a5814abf9ca8711a386e303c1c9ab93))
|
|
13
|
+
- **feat(docs):** add app and navigation config ([9d71ef6](https://github.com/sewadahapp/selaras/commit/9d71ef61209dfb6f3c844a06d62660040cc51a7a))
|
|
14
|
+
- **feat(table):** support hierarchical tree rows ([fee43bb](https://github.com/sewadahapp/selaras/commit/fee43bb3da59299529a89fca97627a233ae54489))
|
|
15
|
+
- **feat(table):** move column filters to popovers ([12d2e88](https://github.com/sewadahapp/selaras/commit/12d2e88bf97776f85257968d3c6bd5c256f887ff))
|
|
16
|
+
- **feat(table):** make column sorting opt-in ([0cd56fb](https://github.com/sewadahapp/selaras/commit/0cd56fb0b6ce5127adf2cb71e2f9180361e5af48))
|
|
17
|
+
- **feat(table):** add row hover and click selection ([2dd2a7c](https://github.com/sewadahapp/selaras/commit/2dd2a7cf62ea1f40b575ecc7534cb9ac11b8dada))
|
|
18
|
+
- **feat(dropdown):** add adaptive mobile mode ([6403583](https://github.com/sewadahapp/selaras/commit/640358314fb706ee0a3eb59ebb6ca8de48a244eb))
|
|
19
|
+
- **feat(timeline):** add timeline component ([92438fe](https://github.com/sewadahapp/selaras/commit/92438fe10284ce9cdb7467b277f01d89fc904d28))
|
|
20
|
+
- **feat:** add keyboard shortcuts to menu items ([748a869](https://github.com/sewadahapp/selaras/commit/748a8696c124d7423c52696af4f85e483c484bcc))
|
|
21
|
+
- **feat(toast):** add positioning and stack controls ([9ff6a45](https://github.com/sewadahapp/selaras/commit/9ff6a45b78a47a857cbdfe4ebba19d50799e5aa7))
|
|
22
|
+
- **feat(code-group):** show icons in tabs ([be3f024](https://github.com/sewadahapp/selaras/commit/be3f024557ec4422ece61b685920230b67c6f14b))
|
|
23
|
+
- **feat(docs):** add temporary logo ([18bf96f](https://github.com/sewadahapp/selaras/commit/18bf96f8b78630413d27694719f54bd71dd7063c))
|
|
24
|
+
- **feat(docs):** place header navigation beside the brand ([cdf95ef](https://github.com/sewadahapp/selaras/commit/cdf95ef5afcff595cc70fa5b268d661d2cde713a))
|
|
25
|
+
- **feat(docs):** add brand override points and a favicon option ([78a1ac7](https://github.com/sewadahapp/selaras/commit/78a1ac72b4a95056aea1835c4a4cea2acf035b98))
|
|
26
|
+
- **feat(directives):** add v-mask input masking ([bf93ddc](https://github.com/sewadahapp/selaras/commit/bf93ddc40c99f94420f212a4b4e6a564a7fed039))
|
|
27
|
+
- **feat(overlay):** expose arrow and positioning controls ([7a89248](https://github.com/sewadahapp/selaras/commit/7a892487dd295754f1c662ca38fae874e39b9d77))
|
|
28
|
+
- **feat(overlay):** support configurable arrows ([2606363](https://github.com/sewadahapp/selaras/commit/2606363651be8ca712da9e821f648c1146de22c8))
|
|
29
|
+
- **feat(form-field):** add floating labels and grouped examples ([d5f8c9c](https://github.com/sewadahapp/selaras/commit/d5f8c9cce09348b675bdb8236ee38a75fe14f835))
|
|
30
|
+
- **feat(calendar):** add composable schedule examples ([fc85fd0](https://github.com/sewadahapp/selaras/commit/fc85fd0393f8e3254f5737a769a99a9fa5aa3b5b))
|
|
31
|
+
- **feat(theme):** use white text for light intent fills ([f382884](https://github.com/sewadahapp/selaras/commit/f382884f7d07817e9794e12cd0a6b98440959e13))
|
|
32
|
+
- **feat(tabs):** add scrolling, vertical layout, and panel retention ([5b86c32](https://github.com/sewadahapp/selaras/commit/5b86c32b82b5464079a15348d159c755ba70c815))
|
|
33
|
+
- **feat(docs):** add default powered by footer ([5a9b881](https://github.com/sewadahapp/selaras/commit/5a9b881d07195a4403f3ea1def943d666bd6dcd2))
|
|
34
|
+
- **feat(release):** ship a changelog with the docs layer ([8fe893c](https://github.com/sewadahapp/selaras/commit/8fe893c5ca44334e34107e05e761e10eaa3938bd))
|
|
35
|
+
|
|
36
|
+
### 🩹 Fixes
|
|
37
|
+
|
|
38
|
+
- **fix(docs):** enable default page navigation ([cf07fbb](https://github.com/sewadahapp/selaras/commit/cf07fbb8fc9fa719861d528c366df3e4b1956ff1))
|
|
39
|
+
- **fix(toast):** layer toasts into a scaled stack with enter and exit motion ([9e0f922](https://github.com/sewadahapp/selaras/commit/9e0f922d79a1e24526ae357c53ef39d42d7ce75d))
|
|
40
|
+
- **fix(code-tree):** follow scoped light and dark themes for syntax colors ([a98c8fb](https://github.com/sewadahapp/selaras/commit/a98c8fb4d8be3c703838f8e552f80d6864f60c4d))
|
|
41
|
+
- **fix(dropdown,timeline):** route new layout classes through the theme and class prefix ([08c65d6](https://github.com/sewadahapp/selaras/commit/08c65d6e4aa48034f5380c1c4978f8c6235d9228))
|
|
42
|
+
- **fix(dropdown):** keep adaptive trigger aria in sync after a resize ([15d1a59](https://github.com/sewadahapp/selaras/commit/15d1a5974f5decbf54993eff900236e59b76cdd8))
|
|
43
|
+
- **fix(table):** limit row hover to body rows ([16762ec](https://github.com/sewadahapp/selaras/commit/16762eccebb19fc407bbe485b4e15319352b72c9))
|
|
44
|
+
- **fix(navigation-menu):** bind item hotkeys page-wide like other menus ([5bbc6d5](https://github.com/sewadahapp/selaras/commit/5bbc6d5c7873d63a404c28d46ed2ca0c519be491))
|
|
45
|
+
- **fix(hotkey):** match shifted symbols and option chords ([b7a5acb](https://github.com/sewadahapp/selaras/commit/b7a5acb4524b808621602d875cc07f30857c9a9d))
|
|
46
|
+
- **fix(menus):** keep shortcut hints inside item slots ([bcffe01](https://github.com/sewadahapp/selaras/commit/bcffe01d1468fa0e9d9f05f337cab60a1ac862c7))
|
|
47
|
+
- **fix(dropdown):** keep disabled mobile link items inert ([c0a5c86](https://github.com/sewadahapp/selaras/commit/c0a5c86e19da37f9a3343836c0e33ae8acdaf377))
|
|
48
|
+
- **fix(code-tree):** ignore highlights for a file no longer selected ([40136c2](https://github.com/sewadahapp/selaras/commit/40136c2645431e8abdfaf96096e643c0712ebe88))
|
|
49
|
+
- **fix(toast):** make stacking the documented default ([0ae4f40](https://github.com/sewadahapp/selaras/commit/0ae4f40adf7dce709acda188ac8c516cbe3b1c74))
|
|
50
|
+
- **fix(docs):** theme native scrollbars ([5903f0f](https://github.com/sewadahapp/selaras/commit/5903f0f5eb6968b90b7acd5bb84b18ab8539c8a7))
|
|
51
|
+
- **fix(docs):** show navigation menu flyouts ([9330c39](https://github.com/sewadahapp/selaras/commit/9330c3983c5da84999e70ec4642f862b0e1905af))
|
|
52
|
+
- **fix(docs):** hide the search shortcut hint on small screens ([ec811bd](https://github.com/sewadahapp/selaras/commit/ec811bdda58027271ca573c0b0424ca9964b6f1c))
|
|
53
|
+
- **fix(calendar):** key weekday headers by index ([94943d6](https://github.com/sewadahapp/selaras/commit/94943d62ed23a1183459d885a00e418e7ac3ae0f))
|
|
54
|
+
- **fix(tabs):** scroll a controlled tab into view once ([80aaeae](https://github.com/sewadahapp/selaras/commit/80aaeae41f1dd698d4c18a8eb89ceb446f70a957))
|
|
55
|
+
- **fix(autocomplete):** select after home/end navigation ([12259f4](https://github.com/sewadahapp/selaras/commit/12259f45777d9b81c9173ac12d610c1f7c7a34ad))
|
|
56
|
+
- **fix(toast):** skip toasts added during server render ([8995cb4](https://github.com/sewadahapp/selaras/commit/8995cb47ffbcc7a8db6a084d4846241a605ca6e6))
|
|
57
|
+
- **fix(date-picker):** skip form submission while disabled ([9330b38](https://github.com/sewadahapp/selaras/commit/9330b385516a1eb5d5bfbd2d0050fa0159ae224f))
|
|
58
|
+
- **fix(color-picker):** keep one trigger mounted and respect form state ([2f7bd82](https://github.com/sewadahapp/selaras/commit/2f7bd828fc5a2fb52ef9debac569436c48098fc2))
|
|
59
|
+
- **fix(directives):** rewrite v-mask without a third-party dependency ([9d91636](https://github.com/sewadahapp/selaras/commit/9d916365673192190dafafed529f16662bfeb169))
|
|
60
|
+
- **fix(autocomplete):** improve multiple selection behavior ([66c8a86](https://github.com/sewadahapp/selaras/commit/66c8a86d03f05b87a59fc6fafe583ce4ad6fb68f))
|
|
61
|
+
- **fix(color-picker):** align popover to trigger start ([28c39a3](https://github.com/sewadahapp/selaras/commit/28c39a3381e9c82401422df41717e5ec5e889c81))
|
|
62
|
+
- **fix(calendar):** keep default grid compact ([4962470](https://github.com/sewadahapp/selaras/commit/4962470e46f40314d77b76e01cddc14234ffe74f))
|
|
63
|
+
- **fix(docs):** keep centered header sticky ([0bf8504](https://github.com/sewadahapp/selaras/commit/0bf8504baec22426273b49a78376244cb2d72452))
|
|
64
|
+
- **fix(docs):** preserve full width rules and layer hmr ([94ec893](https://github.com/sewadahapp/selaras/commit/94ec89321f9205ccb4a77bcc63116a3d51db4e8a))
|
|
65
|
+
|
|
66
|
+
### 📖 Documentation
|
|
67
|
+
|
|
68
|
+
- **docs(toast):** add a live position example ([8b2cc7d](https://github.com/sewadahapp/selaras/commit/8b2cc7d0a9f2e7b774b99e78de28b7039813aea7))
|
|
69
|
+
- **docs:** add a landing page with a live theming demo ([3d456c7](https://github.com/sewadahapp/selaras/commit/3d456c7eaa932e4d7fd7f5feff4795e720b63559))
|
|
70
|
+
- **docs:** add the selaras logo and favicon ([7bd2e9f](https://github.com/sewadahapp/selaras/commit/7bd2e9fe9b368cfe0ab7f10023d86b05ee8bd66c))
|
|
71
|
+
- **docs(directives):** drop plain Vue usage notes ([b6b514e](https://github.com/sewadahapp/selaras/commit/b6b514e7838e7772a9629e6ade52e11bd9928053))
|
|
72
|
+
- **docs:** highlight theme source snippets ([de7519c](https://github.com/sewadahapp/selaras/commit/de7519c42f31778abe1282f2345c2f2c9a15ce19))
|
|
73
|
+
- **docs:** clarify square button example ([349ea36](https://github.com/sewadahapp/selaras/commit/349ea36d546da40121606f054f884aa8fed9d25a))
|
|
74
|
+
- **docs:** rename blocks group to composites ([e14a727](https://github.com/sewadahapp/selaras/commit/e14a727ace5ff2a73d607f2098679612f699d468))
|
|
75
|
+
|
|
76
|
+
### 🤖 Other changes
|
|
77
|
+
|
|
78
|
+
- **test:** align packed checks with component defaults ([75c3eb9](https://github.com/sewadahapp/selaras/commit/75c3eb9beff0d45bacbc2af5402002679ddb938b))
|
|
79
|
+
- **test(docs):** align packed consumer content schema ([818cce7](https://github.com/sewadahapp/selaras/commit/818cce7f38d8ae0b5a22dadefe771dbd74a78edf))
|
|
80
|
+
- **test(compat):** allow unprefixed CSS size variance ([f55d537](https://github.com/sewadahapp/selaras/commit/f55d537a866ee75cab8641635307ca447cbe454f))
|
|
81
|
+
- **ci(docs):** add standalone pages deployment ([f322dcb](https://github.com/sewadahapp/selaras/commit/f322dcb1140023ce8a699ee5c2a91637ed5db439))
|
|
82
|
+
- **test(compat):** align packed CSS budgets ([cdced95](https://github.com/sewadahapp/selaras/commit/cdced95b46a92f5b5fd299839734b8b25c53eeb2))
|
|
83
|
+
- **test(css):** raise the prefixed stylesheet budget ([d501562](https://github.com/sewadahapp/selaras/commit/d50156269478e9bf13b60cb586f9fe7dd15ceab3))
|
|
84
|
+
- **style:** fix lint errors from recent changes ([9e7054c](https://github.com/sewadahapp/selaras/commit/9e7054cb0d9d8d13da63bca5b012ac0ed00e1130))
|
|
85
|
+
- **style(toast):** refine semantic toast styling ([dd879f6](https://github.com/sewadahapp/selaras/commit/dd879f69be398ad314b5012bee70fe3ccd6eb3b4))
|
|
86
|
+
- **style(docs):** refine dark modal scrim and docs header ([5cd1e22](https://github.com/sewadahapp/selaras/commit/5cd1e2269d8b0d3325afde39e74954273a5ae7a7))
|
|
87
|
+
- **ci:** use npm trusted publishing ([e5f3dd7](https://github.com/sewadahapp/selaras/commit/e5f3dd7bb4c726ff708363d2b2c75defb6918caf))
|
|
88
|
+
- **style(callout):** match alert surface ([0269454](https://github.com/sewadahapp/selaras/commit/0269454b6a2c9372b2e3b55ec015b7ecf436dc7e))
|
|
89
|
+
- **style(docs):** enlarge the brand name and search button ([e49a97d](https://github.com/sewadahapp/selaras/commit/e49a97d42ddb7e30d1bfeedc511caa77292a7da7))
|
|
90
|
+
- **test(form-library):** scope the date cell click to the picker ([4644ae6](https://github.com/sewadahapp/selaras/commit/4644ae699fe6c803e725278f63921f61638bf5b2))
|
|
91
|
+
- **test(compat):** fix packed consumer checks ([7e9d501](https://github.com/sewadahapp/selaras/commit/7e9d501ebc8902f6a362fad631ef30bfd33dcdab))
|
|
92
|
+
- **test(css):** update prefixed stylesheet budget ([122133f](https://github.com/sewadahapp/selaras/commit/122133f0759e0147380c38ba6cd636c84c0051f2))
|
|
93
|
+
- **style(docs):** remove sidebar border ([864d33c](https://github.com/sewadahapp/selaras/commit/864d33cfb6564b3b4521bead9b24320d874b9d68))
|
|
94
|
+
- **style(tabs):** refine pill variant ([09b9ee6](https://github.com/sewadahapp/selaras/commit/09b9ee600f3b5f053774e400d0c9aaea5a5fed7b))
|
|
95
|
+
- **style(docs):** constrain header and footer shells ([723afe6](https://github.com/sewadahapp/selaras/commit/723afe6b1dc90da72cff5a403a18d4c4c7a3958a))
|
|
96
|
+
- **style(docs):** center header and footer content ([3ec7f9c](https://github.com/sewadahapp/selaras/commit/3ec7f9cdd03975037e6658bbe96b9e01e5abc1e3))
|
|
97
|
+
|
|
98
|
+
Published against `@sewadah/selaras` ^0.3.1.
|
|
99
|
+
|
|
100
|
+
## v1.0.0
|
|
101
|
+
|
|
102
|
+
First tagged release of the documentation layer, published against `@sewadah/selaras` ^0.3.0.
|
|
103
|
+
|
|
104
|
+
The itemized history leading up to this release lives in the [core changelog](https://github.com/sewadahapp/selaras/blob/main/CHANGELOG.md) - every `docs:` and `docs-layer:` change shipped through the core release stream until the layer gained its own version.
|
package/README.md
CHANGED
|
@@ -47,12 +47,21 @@ export default defineAppConfig({
|
|
|
47
47
|
site: {
|
|
48
48
|
name: 'My project',
|
|
49
49
|
description: 'Documentation for my project.',
|
|
50
|
+
titleTemplate: '%s · My project',
|
|
51
|
+
url: 'https://example.com',
|
|
52
|
+
// Files in public/. Use one path, or separate light and dark images.
|
|
53
|
+
// `tint: true` colors a monochrome SVG with the active primary theme color.
|
|
54
|
+
logo: { light: '/logo.svg', dark: '/logo-dark.svg', tint: true },
|
|
55
|
+
favicon: '/favicon.svg',
|
|
50
56
|
},
|
|
51
57
|
repository: {
|
|
52
58
|
url: 'https://github.com/example/project',
|
|
53
59
|
editLinks: true,
|
|
54
60
|
},
|
|
55
61
|
header: {
|
|
62
|
+
search: true,
|
|
63
|
+
colorMode: true,
|
|
64
|
+
fluid: false,
|
|
56
65
|
links: [
|
|
57
66
|
{ label: 'Guide', to: '/guide/getting-started' },
|
|
58
67
|
{
|
|
@@ -64,12 +73,52 @@ export default defineAppConfig({
|
|
|
64
73
|
},
|
|
65
74
|
],
|
|
66
75
|
},
|
|
76
|
+
main: { fluid: false, padded: true },
|
|
77
|
+
sidebar: {
|
|
78
|
+
enabled: true,
|
|
79
|
+
collapsed: false,
|
|
80
|
+
exclude: ['/internal/draft'],
|
|
81
|
+
},
|
|
82
|
+
toc: { enabled: true, title: 'On this page' },
|
|
83
|
+
footer: { text: '© 2026 My project', fluid: false },
|
|
67
84
|
},
|
|
68
85
|
})
|
|
69
86
|
```
|
|
70
87
|
|
|
88
|
+
Folder navigation can be configured with a `.navigation.yml` file alongside
|
|
89
|
+
the Markdown pages in that folder:
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
title: Getting started
|
|
93
|
+
icon: hugeicons:rocket
|
|
94
|
+
order: 1
|
|
95
|
+
collapse: false
|
|
96
|
+
navBadges:
|
|
97
|
+
- New
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Use `navigation: false` in a page's frontmatter to omit it from navigation, or
|
|
101
|
+
set `navigation` to an object to override its navigation `title`, `icon`,
|
|
102
|
+
`order`, and `navBadges`. Page frontmatter can also set `toc: false`,
|
|
103
|
+
`aside: false`, `editLink: false`, or `prevNext: false` to hide those parts of
|
|
104
|
+
the page shell. The sidebar also accepts an app-wide `collapsed` default; a
|
|
105
|
+
folder's `collapse` value takes precedence. `main.fluid` expands the
|
|
106
|
+
content width, `main.padded: false` removes its outer inset, and `header.fluid`
|
|
107
|
+
and `footer.fluid` allow those regions to span the viewport.
|
|
108
|
+
|
|
71
109
|
Create an application component with the same name as a layer component, such
|
|
72
|
-
as `components/DocsHeader.vue`, to replace that part of the shell.
|
|
73
|
-
|
|
110
|
+
as `components/DocsHeader.vue`, to replace that part of the shell. Smaller
|
|
111
|
+
pieces can be replaced on their own:
|
|
112
|
+
|
|
113
|
+
| Component | Controls | Default |
|
|
114
|
+
| --- | --- | --- |
|
|
115
|
+
| `DocsHeaderBrand` | The header's home link content | `site.logo` and the site name |
|
|
116
|
+
| `DocsFooterBrand` | The start of the footer | `footer.text` |
|
|
117
|
+
| `DocsLogo` | The logo image, used by `DocsHeaderBrand` | `site.logo`, switching light/dark; size it with `--selaras-docs-logo-height` |
|
|
118
|
+
|
|
119
|
+
For example, a `components/DocsFooterBrand.vue` containing `<DocsLogo />` adds
|
|
120
|
+
the logo to the footer while leaving the header as configured.
|
|
121
|
+
|
|
122
|
+
For a host that owns Tailwind compilation or uses a class prefix, set
|
|
74
123
|
`selarasDocs: { css: false }` in `nuxt.config.ts` and import Selaras and the
|
|
75
124
|
docs stylesheet from the host CSS entry.
|
package/app/app.config.ts
CHANGED
|
@@ -12,11 +12,30 @@ export default defineAppConfig({
|
|
|
12
12
|
showTitle: true,
|
|
13
13
|
search: true,
|
|
14
14
|
colorMode: true,
|
|
15
|
+
fluid: false,
|
|
16
|
+
},
|
|
17
|
+
main: {
|
|
18
|
+
fluid: false,
|
|
19
|
+
padded: true,
|
|
20
|
+
},
|
|
21
|
+
sidebar: {
|
|
22
|
+
enabled: true,
|
|
23
|
+
collapsed: false,
|
|
15
24
|
},
|
|
16
25
|
toc: {
|
|
17
26
|
enabled: true,
|
|
18
27
|
title: 'On this page',
|
|
19
28
|
},
|
|
20
|
-
footer: {
|
|
29
|
+
footer: {
|
|
30
|
+
fluid: false,
|
|
31
|
+
links: [
|
|
32
|
+
{
|
|
33
|
+
label: 'Powered by Selaras',
|
|
34
|
+
to: 'https://sewadahapp.github.io/selaras',
|
|
35
|
+
target: '_blank',
|
|
36
|
+
rel: 'noreferrer',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
21
40
|
},
|
|
22
41
|
})
|
package/app/app.vue
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig()
|
|
3
|
+
const assetUrl = useDocsAssetUrl()
|
|
4
|
+
|
|
5
|
+
useHead(() => {
|
|
6
|
+
const favicon = assetUrl(appConfig.selarasDocs?.site?.favicon)
|
|
7
|
+
return {
|
|
8
|
+
link: favicon ? [{ rel: 'icon', href: favicon, type: favicon.endsWith('.svg') ? 'image/svg+xml' : undefined }] : [],
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
</script>
|
|
12
|
+
|
|
1
13
|
<template>
|
|
2
14
|
<SApp>
|
|
3
15
|
<NuxtLayout>
|
|
@@ -5,6 +17,7 @@
|
|
|
5
17
|
</NuxtLayout>
|
|
6
18
|
<ClientOnly>
|
|
7
19
|
<DocsSearch />
|
|
20
|
+
<SToast />
|
|
8
21
|
</ClientOnly>
|
|
9
22
|
</SApp>
|
|
10
23
|
</template>
|
package/app/assets/style.css
CHANGED
|
@@ -4,8 +4,19 @@
|
|
|
4
4
|
color: inherit;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
:root {
|
|
8
|
+
color-scheme: light;
|
|
9
|
+
background: var(--selaras-resolved-surface-canvas, var(--selaras-resolved-surface-default));
|
|
10
|
+
scrollbar-color: var(--selaras-resolved-border-default) var(--selaras-resolved-surface-canvas, var(--selaras-resolved-surface-default));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:root.dark {
|
|
14
|
+
color-scheme: dark;
|
|
15
|
+
}
|
|
16
|
+
|
|
7
17
|
.selaras-docs-root {
|
|
8
18
|
background: var(--selaras-resolved-surface-canvas, var(--selaras-resolved-surface-default));
|
|
19
|
+
scrollbar-color: var(--selaras-resolved-border-default) var(--selaras-resolved-surface-canvas, var(--selaras-resolved-surface-default));
|
|
9
20
|
}
|
|
10
21
|
|
|
11
22
|
.selaras-docs-skip-link {
|
|
@@ -27,6 +38,49 @@
|
|
|
27
38
|
outline-offset: 2px;
|
|
28
39
|
}
|
|
29
40
|
|
|
41
|
+
/* Match the main documentation shell's centered width. */
|
|
42
|
+
.selaras-docs-header {
|
|
43
|
+
position: sticky;
|
|
44
|
+
z-index: 20;
|
|
45
|
+
top: 0;
|
|
46
|
+
width: 100%;
|
|
47
|
+
background: var(--selaras-resolved-surface-canvas, var(--selaras-resolved-surface-default));
|
|
48
|
+
border-bottom: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.selaras-docs-header-inner {
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
width: min(100%, 90rem);
|
|
54
|
+
min-width: 0;
|
|
55
|
+
height: 100%;
|
|
56
|
+
margin-inline: auto;
|
|
57
|
+
padding-inline: 1.5rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.selaras-docs-header-inner--fluid {
|
|
61
|
+
width: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.selaras-docs-header-actions {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex: none;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: 0.5rem;
|
|
69
|
+
margin-inline-start: auto;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.selaras-docs-header::after {
|
|
73
|
+
position: absolute;
|
|
74
|
+
z-index: 1;
|
|
75
|
+
inset-inline-start: 50%;
|
|
76
|
+
bottom: 0;
|
|
77
|
+
width: 100vw;
|
|
78
|
+
transform: translateX(-50%);
|
|
79
|
+
border-bottom: 1px solid var(--selaras-resolved-border-default);
|
|
80
|
+
content: '';
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
30
84
|
.selaras-docs-shell {
|
|
31
85
|
display: flex;
|
|
32
86
|
width: min(100%, 90rem);
|
|
@@ -34,8 +88,8 @@
|
|
|
34
88
|
margin: 0 auto;
|
|
35
89
|
}
|
|
36
90
|
|
|
37
|
-
.selaras-docs-
|
|
38
|
-
|
|
91
|
+
.selaras-docs-root--fluid .selaras-docs-shell {
|
|
92
|
+
width: 100%;
|
|
39
93
|
}
|
|
40
94
|
|
|
41
95
|
.selaras-docs-main {
|
|
@@ -44,11 +98,19 @@
|
|
|
44
98
|
padding: 2rem;
|
|
45
99
|
}
|
|
46
100
|
|
|
101
|
+
.selaras-docs-main--unpadded {
|
|
102
|
+
padding: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
47
105
|
.selaras-docs-page {
|
|
48
106
|
max-width: 78rem;
|
|
49
107
|
margin: 0 auto;
|
|
50
108
|
}
|
|
51
109
|
|
|
110
|
+
.selaras-docs-page--fluid {
|
|
111
|
+
max-width: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
52
114
|
.selaras-docs-page-grid {
|
|
53
115
|
display: grid;
|
|
54
116
|
grid-template-columns: minmax(0, 1fr);
|
|
@@ -91,11 +153,31 @@
|
|
|
91
153
|
}
|
|
92
154
|
|
|
93
155
|
.selaras-docs-footer {
|
|
156
|
+
position: relative;
|
|
157
|
+
width: min(100%, 90rem);
|
|
158
|
+
margin-inline: auto;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.selaras-docs-footer--fluid {
|
|
162
|
+
width: 100%;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.selaras-docs-footer::before {
|
|
166
|
+
position: absolute;
|
|
167
|
+
inset-inline-start: 50%;
|
|
168
|
+
top: 0;
|
|
169
|
+
width: 100vw;
|
|
170
|
+
transform: translateX(-50%);
|
|
94
171
|
border-top: 1px solid var(--selaras-resolved-border-default);
|
|
172
|
+
content: '';
|
|
173
|
+
pointer-events: none;
|
|
95
174
|
}
|
|
96
175
|
|
|
97
176
|
.selaras-docs-footer-inner {
|
|
177
|
+
box-sizing: border-box;
|
|
98
178
|
display: flex;
|
|
179
|
+
width: 100%;
|
|
180
|
+
padding-inline: 1.5rem;
|
|
99
181
|
align-items: center;
|
|
100
182
|
justify-content: space-between;
|
|
101
183
|
gap: 1rem;
|
|
@@ -133,6 +215,14 @@
|
|
|
133
215
|
display: none;
|
|
134
216
|
}
|
|
135
217
|
|
|
218
|
+
/* Reserve the sidebar's width for the brand, so the header menu's first
|
|
219
|
+
label lines up with the page content: sidebar (16rem) + the content's
|
|
220
|
+
inset from it (4rem), less the header's own padding (1.5rem), the
|
|
221
|
+
brand-to-menu gap (0.5rem), and the menu link's own padding (0.625rem). */
|
|
222
|
+
.selaras-docs-brand-area {
|
|
223
|
+
min-width: 17.375rem;
|
|
224
|
+
}
|
|
225
|
+
|
|
136
226
|
.selaras-docs-page-grid {
|
|
137
227
|
grid-template-columns: minmax(0, 1fr) 14rem;
|
|
138
228
|
}
|
|
@@ -143,6 +233,10 @@
|
|
|
143
233
|
padding: 1.5rem;
|
|
144
234
|
}
|
|
145
235
|
|
|
236
|
+
.selaras-docs-main--unpadded {
|
|
237
|
+
padding: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
146
240
|
.selaras-docs-header-link.selaras-docs-header-link--desktop {
|
|
147
241
|
display: none;
|
|
148
242
|
}
|
|
@@ -165,13 +259,25 @@
|
|
|
165
259
|
|
|
166
260
|
.selaras-docs-brand {
|
|
167
261
|
gap: 0.625rem;
|
|
262
|
+
font-size: 1.125rem;
|
|
168
263
|
font-weight: 600;
|
|
264
|
+
letter-spacing: -0.01em;
|
|
169
265
|
}
|
|
170
266
|
|
|
171
267
|
.selaras-docs-logo {
|
|
172
268
|
display: block;
|
|
173
269
|
width: auto;
|
|
174
|
-
height: 1.75rem;
|
|
270
|
+
height: var(--selaras-docs-logo-height, 1.75rem);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.selaras-docs-logo--tinted {
|
|
274
|
+
width: var(--selaras-docs-logo-height, 1.75rem);
|
|
275
|
+
flex: none;
|
|
276
|
+
background-color: var(--selaras-resolved-color-primary-fill);
|
|
277
|
+
mask-image: var(--selaras-docs-logo-mask);
|
|
278
|
+
mask-repeat: no-repeat;
|
|
279
|
+
mask-position: center;
|
|
280
|
+
mask-size: contain;
|
|
175
281
|
}
|
|
176
282
|
|
|
177
283
|
.selaras-docs-logo--dark {
|
|
@@ -5,17 +5,16 @@ const footer = computed(() => docsConfig.value.footer)
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<template>
|
|
8
|
-
<footer v-if="footer?.text || footer?.links?.length" class="selaras-docs-footer">
|
|
8
|
+
<footer v-if="footer?.text || footer?.links?.length" class="selaras-docs-footer" :class="{ 'selaras-docs-footer--fluid': footer?.fluid }">
|
|
9
9
|
<SContainer size="full" class="selaras-docs-footer-inner">
|
|
10
|
-
<
|
|
11
|
-
{{ footer.text }}
|
|
12
|
-
</p>
|
|
10
|
+
<DocsFooterBrand />
|
|
13
11
|
<nav v-if="footer?.links?.length" class="selaras-docs-footer-links" aria-label="Footer navigation">
|
|
14
12
|
<NuxtLink
|
|
15
13
|
v-for="link in footer.links"
|
|
16
14
|
:key="`${link.to}:${link.label ?? link.icon ?? ''}`"
|
|
17
15
|
:to="link.to"
|
|
18
16
|
:target="link.target"
|
|
17
|
+
:rel="link.rel"
|
|
19
18
|
:aria-label="link.ariaLabel ?? link.label"
|
|
20
19
|
>
|
|
21
20
|
<SIcon v-if="link.icon" :name="link.icon" />
|
|
@@ -6,14 +6,9 @@ const navigationOpen = ref(false)
|
|
|
6
6
|
|
|
7
7
|
const docsConfig = computed(() => appConfig.selarasDocs ?? {})
|
|
8
8
|
const siteName = computed(() => docsConfig.value.header?.title ?? docsConfig.value.site?.name ?? 'Documentation')
|
|
9
|
-
const showTitle = computed(() => docsConfig.value.header?.showTitle !== false)
|
|
10
|
-
const logo = computed(() => docsConfig.value.site?.logo)
|
|
11
|
-
const logoAlt = computed(() => typeof logo.value === 'object' ? (logo.value.alt ?? siteName.value) : siteName.value)
|
|
12
|
-
const lightLogo = computed(() => typeof logo.value === 'string' ? logo.value : (logo.value?.light ?? logo.value?.dark))
|
|
13
|
-
const darkLogo = computed(() => typeof logo.value === 'object' ? (logo.value.dark ?? logo.value.light) : logo.value)
|
|
14
|
-
const hasDistinctLogos = computed(() => Boolean(lightLogo.value && darkLogo.value && lightLogo.value !== darkLogo.value))
|
|
15
9
|
const headerLinks = computed(() => docsConfig.value.header?.links ?? [])
|
|
16
10
|
const repositoryUrl = computed(() => docsConfig.value.repository?.url)
|
|
11
|
+
const sidebarEnabled = computed(() => docsConfig.value.sidebar?.enabled !== false)
|
|
17
12
|
|
|
18
13
|
watch(() => route.path, () => {
|
|
19
14
|
navigationOpen.value = false
|
|
@@ -21,23 +16,28 @@ watch(() => route.path, () => {
|
|
|
21
16
|
</script>
|
|
22
17
|
|
|
23
18
|
<template>
|
|
24
|
-
<SHeader
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
<SHeader
|
|
20
|
+
:ui="{
|
|
21
|
+
root: 'selaras-docs-header',
|
|
22
|
+
left: docsConfig.header?.fluid ? 'selaras-docs-header-inner selaras-docs-header-inner--fluid' : 'selaras-docs-header-inner',
|
|
23
|
+
right: 'hidden',
|
|
24
|
+
}"
|
|
25
|
+
>
|
|
26
|
+
<div class="selaras-docs-brand-area">
|
|
27
|
+
<NuxtLink to="/" class="selaras-docs-brand" :aria-label="`${siteName} home`">
|
|
28
|
+
<DocsHeaderBrand />
|
|
29
|
+
</NuxtLink>
|
|
30
|
+
</div>
|
|
31
|
+
<SNavigationMenu
|
|
32
|
+
v-if="headerLinks.length"
|
|
33
|
+
:items="headerLinks"
|
|
34
|
+
variant="link"
|
|
35
|
+
:ui="{ root: 'hidden w-auto lg:flex' }"
|
|
36
|
+
/>
|
|
37
|
+
<div class="selaras-docs-header-actions">
|
|
39
38
|
<DocsSearchButton v-if="docsConfig.header?.search !== false" />
|
|
40
39
|
<SColorModeToggle v-if="docsConfig.header?.colorMode !== false" />
|
|
40
|
+
<DocsThemePicker v-if="docsConfig.header?.themePicker" />
|
|
41
41
|
<SButton
|
|
42
42
|
v-if="repositoryUrl"
|
|
43
43
|
as="a"
|
|
@@ -51,6 +51,7 @@ watch(() => route.path, () => {
|
|
|
51
51
|
color="neutral"
|
|
52
52
|
/>
|
|
53
53
|
<SButton
|
|
54
|
+
v-if="sidebarEnabled"
|
|
54
55
|
variant="ghost"
|
|
55
56
|
color="neutral"
|
|
56
57
|
class="selaras-docs-nav-toggle"
|
|
@@ -59,11 +60,11 @@ watch(() => route.path, () => {
|
|
|
59
60
|
>
|
|
60
61
|
Menu
|
|
61
62
|
</SButton>
|
|
62
|
-
</
|
|
63
|
+
</div>
|
|
63
64
|
</SHeader>
|
|
64
|
-
<SDrawer v-model:open="navigationOpen" side="left" title="Documentation navigation" :handle="false">
|
|
65
|
+
<SDrawer v-if="sidebarEnabled" v-model:open="navigationOpen" side="left" title="Documentation navigation" :handle="false">
|
|
65
66
|
<template #body>
|
|
66
|
-
<SContentNavigation :navigation="navigation ?? []" />
|
|
67
|
+
<SContentNavigation :navigation="navigation ?? []" :collapsed="docsConfig.sidebar?.collapsed" />
|
|
67
68
|
</template>
|
|
68
69
|
</SDrawer>
|
|
69
70
|
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig()
|
|
3
|
+
const docsConfig = computed(() => appConfig.selarasDocs ?? {})
|
|
4
|
+
const siteName = computed(() => docsConfig.value.header?.title ?? docsConfig.value.site?.name ?? 'Documentation')
|
|
5
|
+
const showTitle = computed(() => docsConfig.value.header?.showTitle !== false)
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DocsLogo />
|
|
10
|
+
<span v-if="showTitle">{{ siteName }}</span>
|
|
11
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const logo = useDocsLogo()
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<template v-if="logo.light">
|
|
7
|
+
<span
|
|
8
|
+
v-if="logo.tint"
|
|
9
|
+
role="img"
|
|
10
|
+
:aria-label="logo.alt"
|
|
11
|
+
class="selaras-docs-logo selaras-docs-logo--tinted"
|
|
12
|
+
:style="{ '--selaras-docs-logo-mask': `url('${logo.light}')` }"
|
|
13
|
+
/>
|
|
14
|
+
<template v-else>
|
|
15
|
+
<img :src="logo.light" :alt="logo.alt" class="selaras-docs-logo" :class="{ 'selaras-docs-logo--light': logo.distinct }">
|
|
16
|
+
<img v-if="logo.distinct" :src="logo.dark" :alt="logo.alt" class="selaras-docs-logo selaras-docs-logo--dark">
|
|
17
|
+
</template>
|
|
18
|
+
</template>
|
|
19
|
+
</template>
|
|
@@ -5,9 +5,11 @@ const messages = useMessages()
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<template>
|
|
8
|
-
<SButton variant="soft" color="neutral" size="sm" :icon="icons.search" aria-label="Search documentation" @click="open">
|
|
8
|
+
<SButton variant="soft" color="neutral" size="sm" :icon="icons.search" aria-label="Search documentation" class="sm:min-w-48 xl:min-w-60" @click="open">
|
|
9
9
|
<span class="hidden sm:inline">{{ messages.search }}</span>
|
|
10
|
-
<
|
|
11
|
-
|
|
10
|
+
<span class="ms-auto hidden gap-1 sm:flex">
|
|
11
|
+
<SKbd value="meta" size="sm" />
|
|
12
|
+
<SKbd value="K" size="sm" />
|
|
13
|
+
</span>
|
|
12
14
|
</SButton>
|
|
13
15
|
</template>
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig()
|
|
2
3
|
const { data: navigation } = useDocsNavigation()
|
|
4
|
+
const sidebar = computed(() => appConfig.selarasDocs?.sidebar)
|
|
3
5
|
</script>
|
|
4
6
|
|
|
5
7
|
<template>
|
|
6
8
|
<SPageAside
|
|
9
|
+
v-if="sidebar?.enabled !== false"
|
|
7
10
|
class="selaras-docs-sidebar"
|
|
8
11
|
aria-label="Documentation navigation"
|
|
9
12
|
:ui="{ root: 'top-16 h-[calc(100vh-4rem)]' }"
|
|
10
13
|
>
|
|
11
|
-
<SContentNavigation :navigation="navigation ?? []" />
|
|
14
|
+
<SContentNavigation :navigation="navigation ?? []" :collapsed="sidebar?.collapsed" />
|
|
12
15
|
</SPageAside>
|
|
13
16
|
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefixes a root-relative path (`/logo.svg`) with the app's base URL, so a
|
|
3
|
+
* file in `public/` still resolves when the site is served from a subpath.
|
|
4
|
+
* Absolute URLs and relative paths pass through unchanged.
|
|
5
|
+
*/
|
|
6
|
+
export function useDocsAssetUrl() {
|
|
7
|
+
const baseURL = useRuntimeConfig().app.baseURL.replace(/\/$/, '')
|
|
8
|
+
return (path: string | undefined) => path?.startsWith('/') && !path.startsWith('//') ? `${baseURL}${path}` : path
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** The configured `site.logo`, resolved into light/dark image sources. */
|
|
12
|
+
export function useDocsLogo() {
|
|
13
|
+
const appConfig = useAppConfig()
|
|
14
|
+
const assetUrl = useDocsAssetUrl()
|
|
15
|
+
|
|
16
|
+
return computed(() => {
|
|
17
|
+
const config = appConfig.selarasDocs ?? {}
|
|
18
|
+
const logo = config.site?.logo
|
|
19
|
+
const name = config.header?.title ?? config.site?.name ?? 'Documentation'
|
|
20
|
+
const light = assetUrl(typeof logo === 'string' ? logo : (logo?.light ?? logo?.dark))
|
|
21
|
+
const dark = assetUrl(typeof logo === 'string' ? logo : (logo?.dark ?? logo?.light))
|
|
22
|
+
return {
|
|
23
|
+
light,
|
|
24
|
+
dark,
|
|
25
|
+
alt: typeof logo === 'object' ? (logo.alt ?? name) : name,
|
|
26
|
+
distinct: Boolean(light && dark && light !== dark),
|
|
27
|
+
tint: typeof logo === 'object' && logo.tint === true,
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
}
|
|
@@ -1,4 +1,53 @@
|
|
|
1
|
+
interface DocsNavigationNode {
|
|
2
|
+
title: string
|
|
3
|
+
path: string
|
|
4
|
+
icon?: string | false
|
|
5
|
+
order?: number
|
|
6
|
+
collapse?: boolean
|
|
7
|
+
navBadges?: Array<string | { text: string }>
|
|
8
|
+
navigation?: boolean | {
|
|
9
|
+
title?: string
|
|
10
|
+
icon?: string | false
|
|
11
|
+
order?: number
|
|
12
|
+
navBadges?: Array<string | { text: string }>
|
|
13
|
+
}
|
|
14
|
+
children?: DocsNavigationNode[]
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
export function useDocsNavigation() {
|
|
2
|
-
|
|
3
|
-
|
|
18
|
+
const appConfig = useAppConfig()
|
|
19
|
+
|
|
20
|
+
return useAsyncData('selaras-docs-navigation', async () => {
|
|
21
|
+
const tree = await queryCollectionNavigation('docs', ['order', 'icon', 'collapse', 'navBadges'])
|
|
22
|
+
.order('order', 'ASC')
|
|
23
|
+
|
|
24
|
+
const excluded = new Set(appConfig.selarasDocs?.sidebar?.exclude ?? [])
|
|
25
|
+
const visit = (items: DocsNavigationNode[], applyExclusions = false): DocsNavigationNode[] => items
|
|
26
|
+
.filter(item => !applyExclusions || !excluded.has(item.path))
|
|
27
|
+
.map((item) => {
|
|
28
|
+
const metadata = typeof item.navigation === 'object' && item.navigation ? item.navigation : {}
|
|
29
|
+
const children = item.children ? visit(item.children, applyExclusions) : undefined
|
|
30
|
+
return {
|
|
31
|
+
...item,
|
|
32
|
+
...metadata,
|
|
33
|
+
title: metadata.title ?? item.title,
|
|
34
|
+
icon: metadata.icon ?? item.icon,
|
|
35
|
+
order: metadata.order ?? item.order,
|
|
36
|
+
navBadges: metadata.navBadges ?? item.navBadges,
|
|
37
|
+
...(children && { children }),
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
.filter(item => !applyExclusions || !item.children || item.children.length > 0)
|
|
41
|
+
.sort((a, b) => {
|
|
42
|
+
if (a.order == null && b.order == null)
|
|
43
|
+
return 0
|
|
44
|
+
if (a.order == null)
|
|
45
|
+
return 1
|
|
46
|
+
if (b.order == null)
|
|
47
|
+
return -1
|
|
48
|
+
return a.order - b.order
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
return visit(tree as DocsNavigationNode[], excluded.size > 0)
|
|
52
|
+
})
|
|
4
53
|
}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig()
|
|
3
|
+
</script>
|
|
4
|
+
|
|
1
5
|
<template>
|
|
2
|
-
<div
|
|
6
|
+
<div
|
|
7
|
+
class="selaras-docs-root min-h-screen text-[var(--selaras-resolved-text-default)]"
|
|
8
|
+
:class="{
|
|
9
|
+
'selaras-docs-root--fluid': appConfig.selarasDocs?.main?.fluid,
|
|
10
|
+
}"
|
|
11
|
+
>
|
|
3
12
|
<a class="selaras-docs-skip-link" href="#selaras-docs-main">Skip to content</a>
|
|
4
13
|
<DocsHeader />
|
|
5
14
|
<div class="selaras-docs-shell">
|
|
6
15
|
<DocsSidebar />
|
|
7
|
-
<main
|
|
16
|
+
<main
|
|
17
|
+
id="selaras-docs-main"
|
|
18
|
+
class="selaras-docs-main"
|
|
19
|
+
:class="{ 'selaras-docs-main--unpadded': appConfig.selarasDocs?.main?.padded === false }"
|
|
20
|
+
tabindex="-1"
|
|
21
|
+
>
|
|
8
22
|
<slot />
|
|
9
23
|
</main>
|
|
10
24
|
</div>
|
package/app/pages/[...slug].vue
CHANGED
|
@@ -18,6 +18,12 @@ if (!page.value) {
|
|
|
18
18
|
|
|
19
19
|
definePageMeta({ layout: 'selaras-docs' })
|
|
20
20
|
useSeoMeta({ title: page.value.title, description: page.value.description ?? appConfig.selarasDocs?.site?.description })
|
|
21
|
+
useHead(() => ({
|
|
22
|
+
...(appConfig.selarasDocs?.site?.titleTemplate && { titleTemplate: appConfig.selarasDocs.site.titleTemplate }),
|
|
23
|
+
...(appConfig.selarasDocs?.site?.url && {
|
|
24
|
+
link: [{ rel: 'canonical', href: new URL(route.path, appConfig.selarasDocs.site.url).href }],
|
|
25
|
+
}),
|
|
26
|
+
}))
|
|
21
27
|
|
|
22
28
|
const proseComponents = {
|
|
23
29
|
h1: ProseH1,
|
|
@@ -34,17 +40,22 @@ const surround = useDocsSurround()
|
|
|
34
40
|
</script>
|
|
35
41
|
|
|
36
42
|
<template>
|
|
37
|
-
<SContainer size="full" class="selaras-docs-page">
|
|
43
|
+
<SContainer size="full" class="selaras-docs-page" :class="{ 'selaras-docs-page--fluid': appConfig.selarasDocs?.main?.fluid }">
|
|
38
44
|
<div class="selaras-docs-page-grid">
|
|
39
45
|
<article class="selaras-docs-article">
|
|
40
46
|
<p v-if="page!.description" class="selaras-docs-description">
|
|
41
47
|
{{ page!.description }}
|
|
42
48
|
</p>
|
|
43
49
|
<ContentRenderer :value="page!" :components="proseComponents" class="selaras-docs-content selaras-prose" />
|
|
44
|
-
<DocsEditLink :path="route.path" />
|
|
45
|
-
<SContentSurround
|
|
50
|
+
<DocsEditLink v-if="page!.editLink !== false" :path="route.path" />
|
|
51
|
+
<SContentSurround
|
|
52
|
+
v-if="page!.prevNext !== false"
|
|
53
|
+
:prev="surround.prev"
|
|
54
|
+
:next="surround.next"
|
|
55
|
+
class="selaras-docs-surround"
|
|
56
|
+
/>
|
|
46
57
|
</article>
|
|
47
|
-
<DocsTableOfContents :links="tocLinks" />
|
|
58
|
+
<DocsTableOfContents v-if="page!.toc !== false && page!.aside !== false" :links="tocLinks" />
|
|
48
59
|
</div>
|
|
49
60
|
</SContainer>
|
|
50
61
|
</template>
|
package/content.config.ts
CHANGED
|
@@ -8,12 +8,41 @@ export default defineContentConfig({
|
|
|
8
8
|
collections: {
|
|
9
9
|
docs: defineCollection({
|
|
10
10
|
type: 'page',
|
|
11
|
-
source:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
source: [
|
|
12
|
+
{
|
|
13
|
+
cwd: resolve(options.rootDir, 'content'),
|
|
14
|
+
include: '**/*.md',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
cwd: resolve(options.rootDir, 'content'),
|
|
18
|
+
// Nuxt Content reads this metadata into the navigation tree.
|
|
19
|
+
include: '**/.navigation.yml',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
15
22
|
schema: z.object({
|
|
16
23
|
order: z.number().optional(),
|
|
24
|
+
icon: z.union([z.string(), z.literal(false)]).optional(),
|
|
25
|
+
collapse: z.boolean().optional(),
|
|
26
|
+
navBadges: z.array(z.union([
|
|
27
|
+
z.string(),
|
|
28
|
+
z.object({ text: z.string() }),
|
|
29
|
+
])).optional(),
|
|
30
|
+
navigation: z.union([
|
|
31
|
+
z.boolean(),
|
|
32
|
+
z.object({
|
|
33
|
+
title: z.string().optional(),
|
|
34
|
+
icon: z.union([z.string(), z.literal(false)]).optional(),
|
|
35
|
+
order: z.number().optional(),
|
|
36
|
+
navBadges: z.array(z.union([
|
|
37
|
+
z.string(),
|
|
38
|
+
z.object({ text: z.string() }),
|
|
39
|
+
])).optional(),
|
|
40
|
+
}),
|
|
41
|
+
]).optional(),
|
|
42
|
+
toc: z.boolean().default(true),
|
|
43
|
+
aside: z.boolean().default(true),
|
|
44
|
+
editLink: z.boolean().default(true),
|
|
45
|
+
prevNext: z.boolean().default(true),
|
|
17
46
|
}),
|
|
18
47
|
}),
|
|
19
48
|
},
|
package/nuxt.config.mjs
CHANGED
|
@@ -8,6 +8,16 @@ export default defineNuxtConfig({
|
|
|
8
8
|
// Selaras supports Node versions with node:sqlite. Keeping Content on its
|
|
9
9
|
// native connector lets an installed docs layer avoid a native addon.
|
|
10
10
|
content: {
|
|
11
|
+
// Include h3 headings in the docs sidebar TOC; Nuxt Content defaults to
|
|
12
|
+
// including headings through h2 only.
|
|
13
|
+
build: {
|
|
14
|
+
markdown: {
|
|
15
|
+
toc: {
|
|
16
|
+
depth: 3,
|
|
17
|
+
searchDepth: 3,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
11
21
|
experimental: {
|
|
12
22
|
sqliteConnector: 'native',
|
|
13
23
|
},
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sewadah/selaras-docs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "Nuxt Content documentation layer for Selaras",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/sewadahapp/selaras.git",
|
|
9
|
+
"directory": "packages/docs"
|
|
10
|
+
},
|
|
6
11
|
"exports": {
|
|
7
12
|
".": {
|
|
8
13
|
"types": "./types.d.ts",
|
|
@@ -12,6 +17,7 @@
|
|
|
12
17
|
},
|
|
13
18
|
"main": "./nuxt.config.mjs",
|
|
14
19
|
"files": [
|
|
20
|
+
"CHANGELOG.md",
|
|
15
21
|
"app",
|
|
16
22
|
"content.config.ts",
|
|
17
23
|
"modules",
|
|
@@ -27,7 +33,7 @@
|
|
|
27
33
|
"dependencies": {
|
|
28
34
|
"@nuxt/content": "^3.16.0",
|
|
29
35
|
"@nuxt/kit": "^4.5.2",
|
|
30
|
-
"@sewadah/selaras": "^0.3.
|
|
36
|
+
"@sewadah/selaras": "^0.3.1",
|
|
31
37
|
"tailwindcss": "^4.3.0"
|
|
32
38
|
}
|
|
33
39
|
}
|
package/types.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface SelarasDocsLink {
|
|
|
12
12
|
to: string
|
|
13
13
|
icon?: string
|
|
14
14
|
target?: string
|
|
15
|
+
rel?: string
|
|
15
16
|
ariaLabel?: string
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -32,13 +33,21 @@ export interface SelarasDocsLogo {
|
|
|
32
33
|
light?: string
|
|
33
34
|
dark?: string
|
|
34
35
|
alt?: string
|
|
36
|
+
/** Tint a monochrome SVG with the active primary theme color. */
|
|
37
|
+
tint?: boolean
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
export interface SelarasDocsAppConfig {
|
|
38
41
|
site?: {
|
|
39
42
|
name?: string
|
|
40
43
|
description?: string
|
|
44
|
+
/** Applied to browser titles; `%s` is replaced with the current page title. */
|
|
45
|
+
titleTemplate?: string
|
|
46
|
+
url?: string
|
|
47
|
+
/** Shown in the header and footer. A `/`-rooted path is served from `public/` under the app's base URL. */
|
|
41
48
|
logo?: string | SelarasDocsLogo
|
|
49
|
+
/** The browser tab icon, e.g. `/favicon.svg`, resolved like `logo`. */
|
|
50
|
+
favicon?: string
|
|
42
51
|
}
|
|
43
52
|
repository?: {
|
|
44
53
|
url?: string
|
|
@@ -51,8 +60,26 @@ export interface SelarasDocsAppConfig {
|
|
|
51
60
|
showTitle?: boolean
|
|
52
61
|
search?: boolean
|
|
53
62
|
colorMode?: boolean
|
|
63
|
+
/** Show the consuming site's visual preset picker. @default false */
|
|
64
|
+
themePicker?: boolean
|
|
65
|
+
/** Let the header span the viewport instead of the docs shell width. */
|
|
66
|
+
fluid?: boolean
|
|
54
67
|
links?: SelarasDocsNavigationItem[]
|
|
55
68
|
}
|
|
69
|
+
main?: {
|
|
70
|
+
/** Let the content area use the available width. @default false */
|
|
71
|
+
fluid?: boolean
|
|
72
|
+
/** Remove the default content inset. @default false */
|
|
73
|
+
padded?: boolean
|
|
74
|
+
}
|
|
75
|
+
sidebar?: {
|
|
76
|
+
/** Hide the desktop sidebar and its mobile navigation control. @default true */
|
|
77
|
+
enabled?: boolean
|
|
78
|
+
/** Start folder groups collapsed. Folder `.navigation.yml` can override this. @default false */
|
|
79
|
+
collapsed?: boolean
|
|
80
|
+
/** Exact page paths to omit from the sidebar. */
|
|
81
|
+
exclude?: string[]
|
|
82
|
+
}
|
|
56
83
|
toc?: {
|
|
57
84
|
enabled?: boolean
|
|
58
85
|
title?: string
|
|
@@ -60,9 +87,20 @@ export interface SelarasDocsAppConfig {
|
|
|
60
87
|
footer?: {
|
|
61
88
|
text?: string
|
|
62
89
|
links?: SelarasDocsLink[]
|
|
90
|
+
/** Let the footer span the viewport instead of the docs shell width. */
|
|
91
|
+
fluid?: boolean
|
|
63
92
|
}
|
|
64
93
|
}
|
|
65
94
|
|
|
95
|
+
/** Metadata accepted in a content page's `.navigation.yml` folder config. */
|
|
96
|
+
export interface SelarasDocsContentNavigationItem {
|
|
97
|
+
title?: string
|
|
98
|
+
icon?: string | false
|
|
99
|
+
order?: number
|
|
100
|
+
collapse?: boolean
|
|
101
|
+
navBadges?: Array<string | { text: string }>
|
|
102
|
+
}
|
|
103
|
+
|
|
66
104
|
declare module '@nuxt/schema' {
|
|
67
105
|
interface AppConfig {
|
|
68
106
|
selarasDocs?: SelarasDocsAppConfig
|