@slidev/client 0.38.5 → 0.38.7
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/builtin/TocList.vue +1 -1
- package/internals/SlideWrapper.ts +1 -0
- package/internals/SlidesShow.vue +34 -13
- package/logic/drawings.ts +1 -0
- package/package.json +3 -3
package/builtin/TocList.vue
CHANGED
|
@@ -3,6 +3,7 @@ import { defineComponent, h, provide } from 'vue'
|
|
|
3
3
|
import { injectionClicks, injectionClicksDisabled, injectionClicksElements, injectionOrderMap, injectionRoute, injectionSlideContext } from '../constants'
|
|
4
4
|
|
|
5
5
|
export default defineComponent({
|
|
6
|
+
name: 'SlideWrapper',
|
|
6
7
|
props: {
|
|
7
8
|
clicks: {
|
|
8
9
|
type: [Number, String],
|
package/internals/SlidesShow.vue
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { shallowRef, watch } from 'vue'
|
|
2
|
+
import { computed, ref, shallowRef, watch } from 'vue'
|
|
3
3
|
import { clicks, currentRoute, isPresenter, nextRoute, rawRoutes } from '../logic/nav'
|
|
4
4
|
import { getSlideClass } from '../utils'
|
|
5
|
+
import { configs } from '../env'
|
|
5
6
|
import SlideWrapper from './SlideWrapper'
|
|
6
7
|
// @ts-expect-error virtual module
|
|
7
8
|
import GlobalTop from '/@slidev/global-components/top'
|
|
@@ -22,6 +23,18 @@ watch(currentRoute, () => {
|
|
|
22
23
|
const DrawingLayer = shallowRef<any>()
|
|
23
24
|
if (__SLIDEV_FEATURE_DRAWINGS__ || __SLIDEV_FEATURE_DRAWINGS_PERSIST__)
|
|
24
25
|
import('./DrawingLayer.vue').then(v => DrawingLayer.value = v.default)
|
|
26
|
+
|
|
27
|
+
const routes = computed(() => rawRoutes.filter(r => r.meta?.__preloaded || r === currentRoute.value))
|
|
28
|
+
|
|
29
|
+
const isLeaving = ref(false)
|
|
30
|
+
function onBeforeLeave() {
|
|
31
|
+
if (configs.pageTransition?.crossfade === false)
|
|
32
|
+
isLeaving.value = true
|
|
33
|
+
}
|
|
34
|
+
function onAfterLeave() {
|
|
35
|
+
if (configs.pageTransition?.crossfade === false)
|
|
36
|
+
isLeaving.value = false
|
|
37
|
+
}
|
|
25
38
|
</script>
|
|
26
39
|
|
|
27
40
|
<template>
|
|
@@ -29,18 +42,26 @@ if (__SLIDEV_FEATURE_DRAWINGS__ || __SLIDEV_FEATURE_DRAWINGS_PERSIST__)
|
|
|
29
42
|
<GlobalBottom />
|
|
30
43
|
|
|
31
44
|
<!-- Slides -->
|
|
32
|
-
<template
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
<template
|
|
46
|
+
v-for="route of routes"
|
|
47
|
+
:key="route.path"
|
|
48
|
+
>
|
|
49
|
+
<Transition
|
|
50
|
+
v-bind="configs.pageTransition"
|
|
51
|
+
@before-leave="onBeforeLeave()"
|
|
52
|
+
@after-leave="onAfterLeave()"
|
|
53
|
+
>
|
|
54
|
+
<SlideWrapper
|
|
55
|
+
:is="route?.component as any"
|
|
56
|
+
v-show="route === currentRoute && !isLeaving"
|
|
57
|
+
:clicks="route === currentRoute ? clicks : 0"
|
|
58
|
+
:clicks-elements="route.meta?.__clicksElements || []"
|
|
59
|
+
:clicks-disabled="false"
|
|
60
|
+
:class="getSlideClass(route)"
|
|
61
|
+
:route="route"
|
|
62
|
+
:context="context"
|
|
63
|
+
/>
|
|
64
|
+
</Transition>
|
|
44
65
|
</template>
|
|
45
66
|
|
|
46
67
|
<!-- Global Top -->
|
package/logic/drawings.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.7",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"vue-router": "^4.1.6",
|
|
41
41
|
"vue-starport": "^0.3.0",
|
|
42
42
|
"windicss": "^3.5.6",
|
|
43
|
-
"@slidev/parser": "0.38.
|
|
44
|
-
"@slidev/types": "0.38.
|
|
43
|
+
"@slidev/parser": "0.38.7",
|
|
44
|
+
"@slidev/types": "0.38.7"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"vite": "^4.0.4"
|