valaxy-theme-yun 0.18.1 → 0.18.2
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.
@@ -1,14 +1,25 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { useRuntimeConfig } from 'valaxy'
|
3
|
+
import { computed, ref } from 'vue'
|
3
4
|
|
4
5
|
const runtimeConfig = useRuntimeConfig()
|
6
|
+
const supportCommentAddons = ['valaxy-addon-waline', 'valaxy-addon-twikoo']
|
7
|
+
|
8
|
+
const commentSystems = computed(() => {
|
9
|
+
return supportCommentAddons.filter(addonName => runtimeConfig.value.addons[addonName]).map(addonName => addonName.split('-')[2])
|
10
|
+
})
|
11
|
+
|
12
|
+
const activeComment = ref(commentSystems.value[0])
|
5
13
|
</script>
|
6
14
|
|
7
15
|
<template>
|
8
16
|
<YunCard w="full" p="4" class="comment yun-comment sm:p-6 lg:px-12 xl:px-16">
|
9
17
|
<ClientOnly>
|
10
|
-
<
|
11
|
-
|
18
|
+
<div v-if="commentSystems.length > 1" class="flex justify-end w-full mb-2">
|
19
|
+
<YunSelect v-model="activeComment" :options="commentSystems" />
|
20
|
+
</div>
|
21
|
+
<YunWaline v-if="activeComment === 'waline'" />
|
22
|
+
<YunTwikoo v-if="activeComment === 'twikoo'" />
|
12
23
|
<slot />
|
13
24
|
</ClientOnly>
|
14
25
|
</YunCard>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
<script setup lang='ts'>
|
2
|
+
import { useEventListener } from '@vueuse/core'
|
3
|
+
import { ref } from 'vue'
|
4
|
+
|
5
|
+
defineProps<{
|
6
|
+
options: string[]
|
7
|
+
}>()
|
8
|
+
|
9
|
+
const activeValue = defineModel()
|
10
|
+
const optionVisible = ref(false)
|
11
|
+
|
12
|
+
useEventListener('click', () => {
|
13
|
+
optionVisible.value = false
|
14
|
+
})
|
15
|
+
</script>
|
16
|
+
|
17
|
+
<template>
|
18
|
+
<div class="relative h-8 w-30 text-[var(--va-c-text-2)] z-100">
|
19
|
+
<button
|
20
|
+
class="flex h-full w-full px-2 items-center justify-between border rounded-2 transition"
|
21
|
+
:class="optionVisible ? 'border-[var(--va-c-primary)] shadow-lg' : ''"
|
22
|
+
@click.stop="optionVisible = true"
|
23
|
+
>
|
24
|
+
<span>{{ activeValue }}</span>
|
25
|
+
<div inline-flex i-ri-arrow-down-s-line />
|
26
|
+
</button>
|
27
|
+
<Transition>
|
28
|
+
<ul
|
29
|
+
v-show="optionVisible"
|
30
|
+
class="select-options absolute translate-y-1 left-0 top-full w-full bg-[var(--va-c-bg-light)] overflow-hidden rounded-1 border"
|
31
|
+
>
|
32
|
+
<li
|
33
|
+
v-for="option in options"
|
34
|
+
:key="option"
|
35
|
+
class="cursor-pointer list-none px-2 hover:bg-[var(--va-c-primary-lighter)] hover:text-white"
|
36
|
+
@click="activeValue = option"
|
37
|
+
>
|
38
|
+
{{ option }}
|
39
|
+
</li>
|
40
|
+
</ul>
|
41
|
+
</Transition>
|
42
|
+
</div>
|
43
|
+
</template>
|
44
|
+
|
45
|
+
<style lang="scss" scoped>
|
46
|
+
.select-options {
|
47
|
+
margin: 0;
|
48
|
+
}
|
49
|
+
|
50
|
+
.v-enter-active,
|
51
|
+
.v-leave-active {
|
52
|
+
transition: opacity .3s ease;
|
53
|
+
}
|
54
|
+
|
55
|
+
.v-enter-from,
|
56
|
+
.v-leave-to {
|
57
|
+
opacity: 0;
|
58
|
+
}
|
59
|
+
</style>
|
package/layouts/post.vue
CHANGED
@@ -41,6 +41,11 @@ useSchemaOrg(
|
|
41
41
|
</script>
|
42
42
|
|
43
43
|
<template>
|
44
|
+
<YunSidebar v-if="$slots['sidebar-child']">
|
45
|
+
<slot name="sidebar-child" />
|
46
|
+
</YunSidebar>
|
47
|
+
<YunSidebar v-else />
|
48
|
+
|
44
49
|
<RouterView v-slot="{ Component }">
|
45
50
|
<component :is="Component">
|
46
51
|
<template #main-header-after>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "valaxy-theme-yun",
|
3
|
-
"version": "0.18.
|
3
|
+
"version": "0.18.2",
|
4
4
|
"author": {
|
5
5
|
"email": "me@yunyoujun.cn",
|
6
6
|
"name": "YunYouJun",
|
@@ -20,12 +20,12 @@
|
|
20
20
|
"dependencies": {
|
21
21
|
"@explosions/fireworks": "^0.0.2",
|
22
22
|
"@iconify-json/ant-design": "^1.1.15",
|
23
|
-
"@iconify-json/simple-icons": "^1.1.
|
23
|
+
"@iconify-json/simple-icons": "^1.1.92",
|
24
24
|
"animejs": "^3.2.2"
|
25
25
|
},
|
26
26
|
"devDependencies": {
|
27
27
|
"@types/animejs": "^3.1.12",
|
28
|
-
"valaxy": "0.18.
|
29
|
-
"valaxy-addon-waline": "0.1.
|
28
|
+
"valaxy": "0.18.2",
|
29
|
+
"valaxy-addon-waline": "0.1.2"
|
30
30
|
}
|
31
31
|
}
|