valaxy-theme-press 0.0.1 → 0.0.3
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/README.md +8 -0
- package/client/index.ts +1 -0
- package/components/DocsBoard.vue +24 -0
- package/components/PressArticle.vue +15 -10
- package/components/PressArticleCard.vue +6 -2
- package/components/PressAside.vue +87 -0
- package/components/PressBackdrop.vue +39 -0
- package/components/PressButton.vue +31 -0
- package/components/PressCategories.vue +71 -0
- package/components/PressCategory.vue +58 -0
- package/components/PressDocFooter.vue +15 -0
- package/components/PressDocFooterLastUpdated.vue +44 -0
- package/components/PressFeature.vue +61 -0
- package/components/PressFeatures.vue +26 -0
- package/components/PressFooter.vue +53 -0
- package/components/PressHome.vue +15 -0
- package/components/PressHomeFeatures.vue +12 -0
- package/components/PressHomeHero.vue +34 -0
- package/components/PressLocalNav.vue +109 -0
- package/components/PressNav.vue +17 -35
- package/components/PressOutline.vue +111 -0
- package/components/PressOutlineItem.vue +48 -0
- package/components/PressSidebar.vue +88 -0
- package/components/PressToggleLocale.vue +1 -1
- package/components/ValaxyMain.vue +56 -12
- package/components/nav/PressNavBar.vue +111 -0
- package/components/nav/PressNavItemGroup.vue +101 -0
- package/components/nav/PressNavItemLink.vue +39 -0
- package/components/nav/PressSwitchAppearance.vue +71 -0
- package/composables/edit-link.ts +14 -0
- package/composables/index.ts +1 -0
- package/config/index.ts +7 -12
- package/layouts/404.vue +13 -12
- package/layouts/home.vue +1 -7
- package/layouts/layout.vue +52 -39
- package/node/index.ts +1 -42
- package/package.json +16 -15
- package/pages/[..all].vue +15 -0
- package/setup/main.ts +89 -0
- package/styles/css-vars.scss +46 -0
- package/styles/helper.scss +34 -0
- package/styles/index.scss +7 -0
- package/styles/markdown.scss +49 -0
- package/types/home.d.ts +5 -0
- package/types/index.d.ts +71 -0
- package/valaxy.config.ts +38 -0
- package/LICENSE +0 -21
- package/components/PressHeader.vue +0 -26
- package/pages/index.vue +0 -8
- package/tsup.config.ts +0 -16
- package/types/index.ts +0 -30
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@use "valaxy/client/styles/mixins" as *;
|
|
2
|
+
|
|
3
|
+
.prose {
|
|
4
|
+
--un-prose-body: var(--va-c-text);
|
|
5
|
+
--un-prose-hr: var(--va-c-text);
|
|
6
|
+
--un-prose-borders: var(--va-c-brand);
|
|
7
|
+
--un-prose-links: var(--va-c-brand);
|
|
8
|
+
--un-prose-code: var(--va-c-text);
|
|
9
|
+
--un-prose-font-mono: var(--va-font-mono);
|
|
10
|
+
|
|
11
|
+
blockquote {
|
|
12
|
+
font-style: normal;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
a {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
border-bottom: 1px solid transparent;
|
|
19
|
+
transition: all 0.4s;
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
border-bottom-color: var(--va-c-brand);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
code:not(pre > code) {
|
|
27
|
+
color: var(--pr-c-text-code);
|
|
28
|
+
background-color: var(--va-c-bg-mute);
|
|
29
|
+
padding: 3px 6px;
|
|
30
|
+
border-radius: 4px;
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
|
|
33
|
+
&::before {
|
|
34
|
+
content: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&::after {
|
|
38
|
+
content: none;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@include mobile {
|
|
44
|
+
.markdown-body {
|
|
45
|
+
div[class*="language-"] {
|
|
46
|
+
margin: 0 -1.5rem;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
package/types/home.d.ts
ADDED
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export * from '../composables'
|
|
2
|
+
export * from './home.d'
|
|
3
|
+
|
|
4
|
+
export namespace PressTheme {
|
|
5
|
+
export type Sidebar = any
|
|
6
|
+
|
|
7
|
+
export interface Footer {
|
|
8
|
+
message?: string;
|
|
9
|
+
copyright?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface EditLink {
|
|
13
|
+
/**
|
|
14
|
+
* Pattern for edit link.
|
|
15
|
+
*
|
|
16
|
+
* @example 'https://github.com/YunYouJun/valaxy/edit/main/docs/:path'
|
|
17
|
+
*/
|
|
18
|
+
pattern: string
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Custom text for edit link.
|
|
22
|
+
*
|
|
23
|
+
* @default 'Edit this page'
|
|
24
|
+
*/
|
|
25
|
+
text?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface Config {
|
|
29
|
+
/**
|
|
30
|
+
* toc title
|
|
31
|
+
* @default 'On this page'
|
|
32
|
+
*/
|
|
33
|
+
outlineTitle: string
|
|
34
|
+
|
|
35
|
+
colors: {
|
|
36
|
+
/**
|
|
37
|
+
* primary color
|
|
38
|
+
* @default '#0078E7'
|
|
39
|
+
*/
|
|
40
|
+
primary: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
nav: Array<NavItem>
|
|
44
|
+
sidebar: string[]
|
|
45
|
+
|
|
46
|
+
editLink: EditLink
|
|
47
|
+
|
|
48
|
+
footer: Footer
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface NavItemLink {
|
|
53
|
+
link: string
|
|
54
|
+
text: string
|
|
55
|
+
active?: string
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface NavItemGroup {
|
|
59
|
+
text: string
|
|
60
|
+
items: NavItemLink[]
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type NavItem = NavItemLink | NavItemGroup
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Theme Config
|
|
69
|
+
*/
|
|
70
|
+
export type ThemeConfig = PressTheme.Config
|
|
71
|
+
export type ThemeUserConfig = Partial<ThemeConfig>
|
package/valaxy.config.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ResolvedValaxyOptions } from 'valaxy'
|
|
2
|
+
import { defineTheme } from 'valaxy'
|
|
3
|
+
import type { Plugin } from 'vite'
|
|
4
|
+
import { defaultThemeConfig } from './config'
|
|
5
|
+
import type { ThemeConfig } from './types'
|
|
6
|
+
|
|
7
|
+
function ThemeVitePlugin(options: ResolvedValaxyOptions<ThemeConfig>): Plugin {
|
|
8
|
+
const themeConfig = options.config.themeConfig!
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
name: 'valaxy-theme-press',
|
|
12
|
+
enforce: 'pre',
|
|
13
|
+
config() {
|
|
14
|
+
return {
|
|
15
|
+
css: {
|
|
16
|
+
preprocessorOptions: {
|
|
17
|
+
scss: {
|
|
18
|
+
additionalData: `$c-primary: ${themeConfig.colors?.primary || '#0078E7'} !default;`,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
optimizeDeps: {
|
|
24
|
+
exclude: ['@docsearch/js'],
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default defineTheme<ThemeConfig>((options) => {
|
|
32
|
+
return {
|
|
33
|
+
themeConfig: defaultThemeConfig,
|
|
34
|
+
vite: {
|
|
35
|
+
plugins: [ThemeVitePlugin(options)],
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
})
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 云游君 YunYouJun <me@yunyoujun.cn>
|
|
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.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { useConfig } from 'valaxy'
|
|
3
|
-
|
|
4
|
-
const config = useConfig()
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template>
|
|
8
|
-
<div class="pt-6 pb-8 space-y-2 md:space-y-5">
|
|
9
|
-
<h1
|
|
10
|
-
class="
|
|
11
|
-
text-3xl
|
|
12
|
-
leading-9
|
|
13
|
-
font-extrabold
|
|
14
|
-
text-gray-900
|
|
15
|
-
tracking-tight
|
|
16
|
-
sm:text-4xl sm:leading-10
|
|
17
|
-
md:text-6xl md:leading-14
|
|
18
|
-
"
|
|
19
|
-
>
|
|
20
|
-
{{ config.title }}
|
|
21
|
-
</h1>
|
|
22
|
-
<p class="text-lg leading-7 text-gray-500">
|
|
23
|
-
{{ config.subtitle }}
|
|
24
|
-
</p>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
package/pages/index.vue
DELETED
package/tsup.config.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
2
|
-
|
|
3
|
-
export default defineConfig((options) => {
|
|
4
|
-
return {
|
|
5
|
-
entry: ['node/index.ts'],
|
|
6
|
-
// disable for dev watch before valaxy watch
|
|
7
|
-
clean: !options.watch,
|
|
8
|
-
dts: true,
|
|
9
|
-
format: ['cjs', 'esm'],
|
|
10
|
-
minify: !options.watch,
|
|
11
|
-
external: [
|
|
12
|
-
'valaxy',
|
|
13
|
-
'vite',
|
|
14
|
-
],
|
|
15
|
-
}
|
|
16
|
-
})
|
package/types/index.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export namespace DocsTheme {
|
|
2
|
-
export type Config = ThemeConfig
|
|
3
|
-
export type Sidebar = any
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Theme Config
|
|
8
|
-
*/
|
|
9
|
-
export interface ThemeConfig {
|
|
10
|
-
/**
|
|
11
|
-
* toc title
|
|
12
|
-
* @default 'On this page'
|
|
13
|
-
*/
|
|
14
|
-
outlineTitle: string
|
|
15
|
-
|
|
16
|
-
colors: {
|
|
17
|
-
/**
|
|
18
|
-
* primary color
|
|
19
|
-
* @default '#0078E7'
|
|
20
|
-
*/
|
|
21
|
-
primary: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
nav: {
|
|
25
|
-
link: string
|
|
26
|
-
text: string
|
|
27
|
-
}[]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type ThemeUserConfig = Partial<ThemeConfig>
|