valaxy 0.20.6 → 0.21.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/client/components/ValaxyApp.vue +0 -1
- package/client/components/ValaxyDecrypt.vue +8 -7
- package/client/components/ValaxyLogo.vue +5 -1
- package/client/composables/app/useValaxyHead.ts +10 -3
- package/client/composables/outline/anchor.ts +8 -7
- package/client/setups.ts +1 -1
- package/client/styles/common/README.md +7 -0
- package/client/styles/common/index.scss +7 -0
- package/client/styles/common/markdown.scss +4 -4
- package/client/styles/index.scss +0 -9
- package/dist/{chunk-BQRH2D76.mjs → chunk-KYTMXSIQ.mjs} +4 -4
- package/dist/{chunk-F3UFLKIV.cjs → chunk-WIV35YXE.cjs} +25 -25
- package/dist/node/cli/index.cjs +1 -1
- package/dist/node/cli/index.mjs +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.mjs +1 -1
- package/package.json +24 -24
- package/client/styles/common/scrollbar.scss +0 -30
- /package/dist/{chunk-WE2LNW3F.mjs → chunk-KQEK3EI2.mjs} +0 -0
- /package/dist/{chunk-6GE64PZD.cjs → chunk-QBQ5XWB7.cjs} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { runContentUpdated, useDecrypt, useFrontmatter } from 'valaxy'
|
|
3
|
-
import { defineComponent, h,
|
|
3
|
+
import { computed, defineComponent, h, ref } from 'vue'
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
6
6
|
encryptedContent: string
|
|
7
|
+
hint?: string
|
|
7
8
|
}>()
|
|
8
9
|
|
|
9
10
|
const password = ref('')
|
|
@@ -58,11 +59,7 @@ const ValaxyDeprecatedContent = defineComponent({
|
|
|
58
59
|
},
|
|
59
60
|
})
|
|
60
61
|
|
|
61
|
-
const hasWarning =
|
|
62
|
-
onMounted(() => {
|
|
63
|
-
if (location.protocol !== 'https:')
|
|
64
|
-
hasWarning.value = true
|
|
65
|
-
})
|
|
62
|
+
const hasWarning = computed(() => location.protocol !== 'https:')
|
|
66
63
|
</script>
|
|
67
64
|
|
|
68
65
|
<template>
|
|
@@ -83,13 +80,17 @@ onMounted(() => {
|
|
|
83
80
|
@keyup.enter="decryptContent"
|
|
84
81
|
>
|
|
85
82
|
<div
|
|
83
|
+
class="text-gray/70 hover:text-gray transition"
|
|
86
84
|
cursor-pointer
|
|
87
85
|
absolute text-2xl
|
|
88
86
|
i-ri-arrow-right-circle-line right-3
|
|
89
|
-
text-gray hover:text-black
|
|
90
87
|
@click="decryptContent"
|
|
91
88
|
/>
|
|
92
89
|
|
|
90
|
+
<div v-if="hint" class="-top-6" absolute text-xs op="50">
|
|
91
|
+
<div v-html="hint" />
|
|
92
|
+
</div>
|
|
93
|
+
|
|
93
94
|
<div v-if="hasWarning" class="-bottom-6" absolute text-xs op="50">
|
|
94
95
|
<a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API" target="_blank">
|
|
95
96
|
<span>Web Crypto API</span>
|
|
@@ -5,7 +5,11 @@ import valaxyLogoPng from '../assets/images/valaxy-logo.png'
|
|
|
5
5
|
<template>
|
|
6
6
|
<div class="valaxy-logo-container" relative inline-flex justify="center" items="center">
|
|
7
7
|
<div class="absolute bg-img" />
|
|
8
|
-
<img
|
|
8
|
+
<img
|
|
9
|
+
class="fly-animation h-50"
|
|
10
|
+
aspect="420/386" m="auto"
|
|
11
|
+
:src="valaxyLogoPng" alt="Valaxy Logo" z="1"
|
|
12
|
+
>
|
|
9
13
|
</div>
|
|
10
14
|
</template>
|
|
11
15
|
|
|
@@ -11,10 +11,12 @@ export function useValaxyHead() {
|
|
|
11
11
|
|
|
12
12
|
const fm = useFrontmatter()
|
|
13
13
|
const siteConfig = useSiteConfig()
|
|
14
|
-
const title = computed(() => fm.value[`title_${locale.value}`] || fm.value.title)
|
|
14
|
+
const title = computed<string>(() => fm.value[`title_${locale.value}`] || fm.value.title)
|
|
15
15
|
useHead({
|
|
16
16
|
title,
|
|
17
|
-
titleTemplate:
|
|
17
|
+
titleTemplate: (title) => {
|
|
18
|
+
return fm.value.titleTemplate || (title ? `${title} - ${siteConfig.value.title}` : siteConfig.value.title)
|
|
19
|
+
},
|
|
18
20
|
link: [
|
|
19
21
|
{
|
|
20
22
|
rel: 'icon',
|
|
@@ -23,7 +25,12 @@ export function useValaxyHead() {
|
|
|
23
25
|
},
|
|
24
26
|
],
|
|
25
27
|
meta: [
|
|
26
|
-
|
|
28
|
+
computed(() => {
|
|
29
|
+
return {
|
|
30
|
+
name: 'description',
|
|
31
|
+
content: fm.value.description || siteConfig.value.description,
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
27
34
|
{
|
|
28
35
|
name: 'generator',
|
|
29
36
|
content: `Valaxy ${pkg.version}`,
|
|
@@ -47,6 +47,10 @@ export function useActiveAnchor(
|
|
|
47
47
|
window.removeEventListener('scroll', onScroll)
|
|
48
48
|
})
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* 长目录自动滚动
|
|
52
|
+
* @TODO add e2e test
|
|
53
|
+
*/
|
|
50
54
|
const checkActiveLinkInViewport = () => {
|
|
51
55
|
const activeLink = prevActiveLink
|
|
52
56
|
if (!activeLink) {
|
|
@@ -54,15 +58,12 @@ export function useActiveAnchor(
|
|
|
54
58
|
return
|
|
55
59
|
}
|
|
56
60
|
|
|
57
|
-
const top = activeLink.getBoundingClientRect().top
|
|
58
|
-
const bottom = activeLink.getBoundingClientRect().bottom
|
|
59
|
-
|
|
60
61
|
const parentEl = document.querySelector('.yun-aside') as HTMLElement
|
|
61
62
|
if (parentEl) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
parentEl.scrollTo({ top
|
|
63
|
+
// 超出
|
|
64
|
+
const top = activeLink.offsetTop + topOffset + 60
|
|
65
|
+
if (top < parentEl.scrollTop || (top > parentEl.offsetHeight + parentEl.scrollTop))
|
|
66
|
+
parentEl.scrollTo({ top, behavior: 'smooth' })
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
|
package/client/setups.ts
CHANGED
package/client/styles/index.scss
CHANGED
|
@@ -9,13 +9,4 @@ $c-primary: #0078e7 !default;
|
|
|
9
9
|
// https://github.com/valaxyjs/css-i18n
|
|
10
10
|
@use "css-i18n/src/styles/index.scss" as *;
|
|
11
11
|
|
|
12
|
-
// common
|
|
13
|
-
@use "./common/code.scss" as *;
|
|
14
|
-
@use "./common/hamburger.scss" as *;
|
|
15
|
-
@use "./common/scrollbar.scss" as *;
|
|
16
|
-
@use "./common/transition.scss" as *;
|
|
17
|
-
|
|
18
|
-
// markdown
|
|
19
|
-
@use "./common/markdown.scss";
|
|
20
|
-
|
|
21
12
|
// components import by yourself
|