valaxy 0.7.8 → 0.9.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/README.md +4 -0
- package/client/README.md +3 -0
- package/client/components/ValaxyCopyright.vue +1 -1
- package/client/components/ValaxyMd.vue +2 -4
- package/client/components/ValaxyOverlay.vue +2 -2
- package/client/components/ValaxySidebar.vue +1 -2
- package/client/composables/category.ts +1 -1
- package/client/composables/comments/index.ts +2 -1
- package/client/composables/comments/twikoo.ts +1 -1
- package/client/composables/comments/waline.ts +3 -2
- package/client/composables/common.ts +1 -1
- package/client/composables/{copy-code.ts → features/copy-code.ts} +0 -0
- package/client/composables/features/index.ts +1 -0
- package/client/composables/index.ts +2 -1
- package/client/composables/outline.ts +2 -2
- package/client/composables/post.ts +1 -1
- package/client/composables/tag.ts +1 -1
- package/client/composables/widgets/aplayer.ts +1 -1
- package/client/config.ts +14 -0
- package/client/index.ts +2 -0
- package/client/modules/nprogress.ts +1 -1
- package/client/modules/pinia.ts +1 -1
- package/client/modules/valaxy.ts +2 -2
- package/client/scaffolds/post.md +6 -0
- package/client/styles/common/code.scss +1 -1
- package/client/styles/common/scrollbar.scss +1 -1
- package/client/{types.ts → types/index.ts} +0 -0
- package/client/utils/time.ts +1 -1
- package/dist/{chunk-EYC2AAUG.js → chunk-6SOT7TNG.js} +207 -207
- package/dist/{chunk-EIYDDCHI.mjs → chunk-ORY7PPZG.mjs} +207 -207
- package/dist/config-60c840d8.d.ts +202 -0
- package/dist/node/cli.js +8 -8
- package/dist/node/cli.mjs +8 -8
- package/dist/node/index.d.ts +147 -14
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.ts +154 -9
- package/dist/types/index.js +1 -1
- package/dist/types/index.mjs +0 -1
- package/package.json +9 -5
- package/types/config.ts +218 -0
- package/types/data.ts +31 -0
- package/types/index.ts +3 -0
- package/types/posts.ts +133 -0
- package/client/app/data.ts +0 -0
- package/client/components/ValaxyRightSidebar.vue +0 -73
- package/client/components/ValaxyToc.vue +0 -140
- package/client/modules/README.md +0 -11
- package/client/pages/README.md +0 -20
- package/dist/chunk-2QVEQP3K.js +0 -1
- package/dist/chunk-4FKSRP5I.mjs +0 -0
- package/dist/chunk-IMWNMHRD.mjs +0 -0
- package/dist/chunk-KP3MIFG6.js +0 -1
- package/dist/client/index.d.ts +0 -227
- package/dist/client/index.js +0 -1
- package/dist/client/index.mjs +0 -1
- package/dist/index-328992a1.d.ts +0 -472
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
Read [YunYouJun/valaxy](https://github.com/YunYouJun/valaxy) for more info.
|
|
6
6
|
|
|
7
|
+
## Creating customized templates
|
|
8
|
+
|
|
9
|
+
Learn how to creating customized templates in [here](./docs/en/creating-templates.md)
|
|
10
|
+
|
|
7
11
|
## FAQ
|
|
8
12
|
|
|
9
13
|
- `exports`: `src/index.ts` for virtual module
|
package/client/README.md
ADDED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { Post } from 'valaxy'
|
|
3
2
|
import { onMounted, ref } from 'vue'
|
|
4
3
|
import { useI18n } from 'vue-i18n'
|
|
5
|
-
import { useAplayer, useCodePen } from '
|
|
6
|
-
import {
|
|
7
|
-
import { wrapTable } from '~/utils'
|
|
4
|
+
import { useAplayer, useCodePen, useCopyCode, wrapTable } from '..'
|
|
5
|
+
import type { Post } from '../../types'
|
|
8
6
|
|
|
9
7
|
const props = defineProps<{
|
|
10
8
|
frontmatter: Post
|
|
@@ -15,8 +15,8 @@ withDefaults(defineProps<{
|
|
|
15
15
|
<style lang="scss">
|
|
16
16
|
@use "sass:map";
|
|
17
17
|
|
|
18
|
-
@use "
|
|
19
|
-
@use "
|
|
18
|
+
@use "valaxy/client/styles/vars" as *;
|
|
19
|
+
@use "valaxy/client/styles/mixins" as *;
|
|
20
20
|
|
|
21
21
|
.va-overlay {
|
|
22
22
|
background-color: rgba(0, 0, 0, 0.3);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isClient, useScriptTag } from '@vueuse/core'
|
|
2
|
-
import { useConfig } from 'valaxy'
|
|
3
2
|
import { computed } from 'vue'
|
|
4
3
|
import { useI18n } from 'vue-i18n'
|
|
5
4
|
import { useRoute } from 'vue-router'
|
|
5
|
+
import { useConfig } from '../..'
|
|
6
6
|
|
|
7
7
|
declare global {
|
|
8
8
|
interface Window {
|
|
@@ -4,8 +4,6 @@ import { useI18n } from 'vue-i18n'
|
|
|
4
4
|
import { useRoute } from 'vue-router'
|
|
5
5
|
|
|
6
6
|
import type { WalineInitOptions, WalineInstance } from '@waline/client'
|
|
7
|
-
|
|
8
|
-
import '@waline/client/dist/waline.css'
|
|
9
7
|
import { cdnPrefix } from '../../utils'
|
|
10
8
|
|
|
11
9
|
/**
|
|
@@ -20,6 +18,9 @@ export function useWaline(options: {} = {}, cdn = cdnPrefix) {
|
|
|
20
18
|
if (!isClient)
|
|
21
19
|
return
|
|
22
20
|
|
|
21
|
+
// import css
|
|
22
|
+
import('@waline/client/dist/waline.css')
|
|
23
|
+
|
|
23
24
|
const route = useRoute()
|
|
24
25
|
|
|
25
26
|
const { locale } = useI18n()
|
|
@@ -2,7 +2,7 @@ import { useRoute } from 'vue-router'
|
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { isClient } from '@vueuse/core'
|
|
4
4
|
|
|
5
|
-
import type { Post } from '
|
|
5
|
+
import type { Post } from '../../types'
|
|
6
6
|
import { useConfig } from '../config'
|
|
7
7
|
|
|
8
8
|
export function useFrontmatter() {
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './copy-code'
|
|
@@ -5,7 +5,7 @@ export * from './tag'
|
|
|
5
5
|
|
|
6
6
|
// common
|
|
7
7
|
export * from './common'
|
|
8
|
-
|
|
8
|
+
export * from './features'
|
|
9
9
|
export * from './helper'
|
|
10
10
|
export * from './dark'
|
|
11
11
|
export * from './layout'
|
|
@@ -13,6 +13,7 @@ export * from './widgets'
|
|
|
13
13
|
export * from './locale'
|
|
14
14
|
|
|
15
15
|
export * from './sidebar'
|
|
16
|
+
export * from './outline'
|
|
16
17
|
|
|
17
18
|
// comment
|
|
18
19
|
export * from './comments'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Ref } from 'vue'
|
|
2
2
|
import { onMounted, onUnmounted, onUpdated } from 'vue'
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import { throttleAndDebounce } from '../utils'
|
|
4
|
+
import type { Header } from '../../types'
|
|
5
5
|
|
|
6
6
|
interface HeaderWithChildren extends Header {
|
|
7
7
|
children?: Header[]
|
|
@@ -2,7 +2,7 @@ import type { Ref } from 'vue'
|
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { useRoute, useRouter } from 'vue-router'
|
|
4
4
|
import { useI18n } from 'vue-i18n'
|
|
5
|
-
import type { Post } from '
|
|
5
|
+
import type { Post } from '../../types'
|
|
6
6
|
import { sortByDate } from '../utils'
|
|
7
7
|
|
|
8
8
|
export const usePostTitle = (post: Ref<Post>) => {
|
package/client/config.ts
CHANGED
|
@@ -5,6 +5,9 @@ import valaxyContext from '/@valaxyjs/context'
|
|
|
5
5
|
import type { ComputedRef, InjectionKey, Ref } from 'vue'
|
|
6
6
|
import { computed, inject, readonly, shallowRef } from 'vue'
|
|
7
7
|
// import type { RouteMeta } from 'vue-router'
|
|
8
|
+
// fix build caused by pnpm
|
|
9
|
+
// This is likely not portable. A type annotation is necessary.
|
|
10
|
+
// https://github.com/microsoft/TypeScript/issues/42873
|
|
8
11
|
import type { PageData, ValaxyConfig } from 'valaxy/types'
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -60,6 +63,17 @@ export function useConfig<ThemeConfig = any>() {
|
|
|
60
63
|
return config!
|
|
61
64
|
}
|
|
62
65
|
|
|
66
|
+
/**
|
|
67
|
+
* You can use like this: import { useThemeConfig } from 'valaxy-theme-xxx'
|
|
68
|
+
* if you want to: import { useThemeConfig } from 'valaxy'
|
|
69
|
+
* you need pass themeConfig by yourself
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
export function useThemeConfig<T = Record<string, any>>() {
|
|
73
|
+
const config = useConfig<T>()
|
|
74
|
+
return computed(() => config!.value.themeConfig)
|
|
75
|
+
}
|
|
76
|
+
|
|
63
77
|
export interface ValaxyData<T = any> {
|
|
64
78
|
page: Ref<PageData>
|
|
65
79
|
theme: Ref<T>
|
package/client/index.ts
CHANGED
package/client/modules/pinia.ts
CHANGED
package/client/modules/valaxy.ts
CHANGED
|
@@ -11,11 +11,11 @@ import { createI18n } from 'vue-i18n'
|
|
|
11
11
|
import { useStorage } from '@vueuse/core'
|
|
12
12
|
|
|
13
13
|
import type { Router } from 'vue-router'
|
|
14
|
-
import type { PageDataPayload } from '
|
|
14
|
+
import type { PageDataPayload } from '../../types'
|
|
15
15
|
import { initConfig, valaxyConfigSymbol } from '../config'
|
|
16
16
|
import { ensureSuffix } from '@antfu/utils'
|
|
17
17
|
|
|
18
|
-
import type { UserModule } from '
|
|
18
|
+
import type { UserModule } from 'valaxy/client/types'
|
|
19
19
|
|
|
20
20
|
// @ts-expect-error virtual
|
|
21
21
|
import messages from '/@valaxyjs/locales'
|
|
File without changes
|
package/client/utils/time.ts
CHANGED