valaxy 0.15.10 → 0.15.11
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/bin/valaxy.cjs +1 -1
- package/bin/valaxy.mjs +1 -1
- package/client/App.vue +1 -1
- package/client/components/AppLink.vue +2 -2
- package/client/components/ValaxyMd.vue +1 -1
- package/client/components/ValaxyOverlay.vue +2 -2
- package/client/components/ValaxyPagination.vue +6 -6
- package/client/components/debug/ValaxyDevtools.vue +6 -0
- package/client/composables/dark.ts +37 -0
- package/client/layouts/404.vue +1 -1
- package/client/layouts/layout.vue +2 -2
- package/client/locales/zh-CN.yml +1 -1
- package/client/pages/[...all].vue +2 -0
- package/client/styles/common/transition.scss +23 -0
- package/dist/chunk-3EJGKTUH.mjs +130 -0
- package/dist/chunk-RDNVTVQ5.cjs +129 -0
- package/dist/{config-29a16f62.d.ts → config-e5704a2c.d.ts} +223 -1
- package/dist/node/cli/index.cjs +1 -0
- package/dist/node/cli/index.mjs +2 -0
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +14 -2
- package/dist/node/index.d.ts +14 -2
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.cts +3 -220
- package/dist/types/index.d.ts +3 -220
- package/dist/types/index.mjs +1 -1
- package/package.json +12 -11
- package/types/config.ts +6 -0
- package/dist/chunk-2EVEFEO4.mjs +0 -130
- package/dist/chunk-BYK2L2MY.cjs +0 -129
- package/dist/node/cli.cjs +0 -1
- package/dist/node/cli.mjs +0 -2
- /package/dist/node/{cli.d.cts → cli/index.d.cts} +0 -0
- /package/dist/node/{cli.d.ts → cli/index.d.ts} +0 -0
package/bin/valaxy.cjs
CHANGED
package/bin/valaxy.mjs
CHANGED
package/client/App.vue
CHANGED
|
@@ -20,7 +20,7 @@ const isExternalLink = computed(() => {
|
|
|
20
20
|
<slot />
|
|
21
21
|
<div v-if="showExternalIcon" class="icon-link inline-block" i-ri-arrow-right-up-line />
|
|
22
22
|
</a>
|
|
23
|
-
<
|
|
23
|
+
<RouterLink v-else v-bind="$attrs" :to="link">
|
|
24
24
|
<slot />
|
|
25
|
-
</
|
|
25
|
+
</RouterLink>
|
|
26
26
|
</template>
|
|
@@ -65,7 +65,7 @@ useVanillaLazyLoad()
|
|
|
65
65
|
<slot v-if="frontmatter.end !== undefined" name="end">
|
|
66
66
|
<div m="y-4" class="end flex justify-center items-center">
|
|
67
67
|
<hr class="line inline-flex" w="full" m="!y-2">
|
|
68
|
-
<span p="x-4" font="
|
|
68
|
+
<span p="x-4" font="bold" class="whitespace-nowrap">
|
|
69
69
|
{{ frontmatter.end ? 'Q.E.D.' : 'To Be Continued.' }}
|
|
70
70
|
</span>
|
|
71
71
|
<hr class="line inline-flex" w="full" m="!y-2">
|
|
@@ -48,14 +48,14 @@ function jumpTo(page: number) {
|
|
|
48
48
|
|
|
49
49
|
<template>
|
|
50
50
|
<nav class="pagination">
|
|
51
|
-
<
|
|
51
|
+
<RouterLink v-if="curPage !== 1" class="page-number" :to="jumpTo(curPage - 1)" aria-label="prev">
|
|
52
52
|
<div i-ri-arrow-left-s-line />
|
|
53
|
-
</
|
|
53
|
+
</RouterLink>
|
|
54
54
|
|
|
55
55
|
<template v-for="i in totalPages">
|
|
56
|
-
<
|
|
56
|
+
<RouterLink v-if="showPage(i)" :key="i" class="page-number" :class="curPage === i && 'active'" :to="jumpTo(i)">
|
|
57
57
|
{{ i }}
|
|
58
|
-
</
|
|
58
|
+
</RouterLink>
|
|
59
59
|
<span v-else-if="i === curPage - surLen" :key="`prev-space-${i}`" class="space" disabled>
|
|
60
60
|
...
|
|
61
61
|
</span>
|
|
@@ -64,9 +64,9 @@ function jumpTo(page: number) {
|
|
|
64
64
|
</span>
|
|
65
65
|
</template>
|
|
66
66
|
|
|
67
|
-
<
|
|
67
|
+
<RouterLink v-if="curPage !== totalPages" class="page-number" :to="jumpTo(curPage + 1)" aria-label="next">
|
|
68
68
|
<div i-ri-arrow-right-s-line />
|
|
69
|
-
</
|
|
69
|
+
</RouterLink>
|
|
70
70
|
</nav>
|
|
71
71
|
</template>
|
|
72
72
|
|
|
@@ -2,3 +2,40 @@ import { useDark, useToggle } from '@vueuse/core'
|
|
|
2
2
|
|
|
3
3
|
export const isDark = useDark()
|
|
4
4
|
export const toggleDark = useToggle(isDark)
|
|
5
|
+
|
|
6
|
+
export function toggleDarkWithTransition(event: MouseEvent, options: { duration?: number; easing?: EffectTiming['easing'] } = {}) {
|
|
7
|
+
// @ts-expect-error startViewTransition is not defined
|
|
8
|
+
if (!document.startViewTransition) {
|
|
9
|
+
toggleDark()
|
|
10
|
+
return
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const x = event.clientX
|
|
14
|
+
const y = event.clientY
|
|
15
|
+
const endRadius = Math.hypot(
|
|
16
|
+
Math.max(x, innerWidth - x),
|
|
17
|
+
Math.max(y, innerHeight - y),
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
// @ts-expect-error startViewTransition is not defined
|
|
21
|
+
const transition = document.startViewTransition(() => {
|
|
22
|
+
toggleDark()
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
transition.ready.then(() => {
|
|
26
|
+
const clipPath = [
|
|
27
|
+
`circle(0px at ${x}px ${y}px)`,
|
|
28
|
+
`circle(${endRadius}px at ${x}px ${y}px)`,
|
|
29
|
+
]
|
|
30
|
+
document.documentElement.animate(
|
|
31
|
+
{
|
|
32
|
+
clipPath: isDark.value ? clipPath.reverse() : clipPath,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
duration: options.duration || 300,
|
|
36
|
+
easing: options.easing || 'ease-in',
|
|
37
|
+
pseudoElement: isDark.value ? '::view-transition-old(root)' : '::view-transition-new(root)',
|
|
38
|
+
},
|
|
39
|
+
)
|
|
40
|
+
})
|
|
41
|
+
}
|
package/client/layouts/404.vue
CHANGED
|
@@ -4,7 +4,7 @@ import { asAny } from 'valaxy'
|
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<template>
|
|
7
|
-
<
|
|
7
|
+
<RouterView v-slot="{ Component }">
|
|
8
8
|
<Component :is="asAny(Component)">
|
|
9
9
|
<template #main-header>
|
|
10
10
|
<slot name="main-header" />
|
|
@@ -35,5 +35,5 @@ import { asAny } from 'valaxy'
|
|
|
35
35
|
<slot name="footer" />
|
|
36
36
|
</template>
|
|
37
37
|
</Component>
|
|
38
|
-
</
|
|
38
|
+
</RouterView>
|
|
39
39
|
</template>
|
package/client/locales/zh-CN.yml
CHANGED
|
@@ -21,3 +21,26 @@
|
|
|
21
21
|
opacity: 0;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
// dark toggle
|
|
26
|
+
// transition
|
|
27
|
+
::view-transition-old(root),
|
|
28
|
+
::view-transition-new(root) {
|
|
29
|
+
animation: none;
|
|
30
|
+
mix-blend-mode: normal;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* 进入dark模式和退出dark模式时,两个图像的位置顺序正好相反 */
|
|
34
|
+
.dark::view-transition-old(root) {
|
|
35
|
+
z-index: 9999;
|
|
36
|
+
}
|
|
37
|
+
.dark::view-transition-new(root) {
|
|
38
|
+
z-index: 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
::view-transition-old(root) {
|
|
42
|
+
z-index: 1;
|
|
43
|
+
}
|
|
44
|
+
::view-transition-new(root) {
|
|
45
|
+
z-index: 9999;
|
|
46
|
+
}
|