@slidev/client 0.36.9 → 0.36.10
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/composables/useNav.ts +1 -1
- package/internals/PresenterPrint.vue +21 -22
- package/logic/nav.ts +1 -1
- package/package.json +3 -3
package/composables/useNav.ts
CHANGED
|
@@ -13,7 +13,7 @@ export function useNav(route: ComputedRef<RouteLocationNormalizedLoaded>) {
|
|
|
13
13
|
const currentPath = computed(() => getPath(currentPage.value))
|
|
14
14
|
const currentRoute = computed(() => rawRoutes.find(i => i.path === `${currentPage.value}`))
|
|
15
15
|
const currentSlideId = computed(() => currentRoute.value?.meta?.slide?.id)
|
|
16
|
-
const currentLayout = computed(() => currentRoute.value?.meta?.layout)
|
|
16
|
+
const currentLayout = computed(() => currentRoute.value?.meta?.layout || (currentPage.value === 1 ? 'cover' : 'default'))
|
|
17
17
|
|
|
18
18
|
const nextRoute = computed(() => rawRoutes.find(i => i.path === `${Math.min(rawRoutes.length, currentPage.value + 1)}`))
|
|
19
19
|
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useHead } from '@vueuse/head'
|
|
3
2
|
import { computed } from '@vue/reactivity'
|
|
4
|
-
import {
|
|
3
|
+
import { useStyleTag } from '@vueuse/core'
|
|
4
|
+
import { useHead } from '@vueuse/head'
|
|
5
5
|
import { configs, themeVars } from '../env'
|
|
6
|
+
import { rawRoutes, total } from '../logic/nav'
|
|
6
7
|
import NoteViewer from './NoteViewer.vue'
|
|
7
8
|
|
|
9
|
+
useStyleTag(`
|
|
10
|
+
@page {
|
|
11
|
+
size: A4;
|
|
12
|
+
margin-top: 1.5cm;
|
|
13
|
+
margin-bottom: 1cm;
|
|
14
|
+
}
|
|
15
|
+
* {
|
|
16
|
+
-webkit-print-color-adjust: exact;
|
|
17
|
+
}
|
|
18
|
+
html,
|
|
19
|
+
html body,
|
|
20
|
+
html #app,
|
|
21
|
+
html #page-root {
|
|
22
|
+
height: auto;
|
|
23
|
+
overflow: auto !important;
|
|
24
|
+
}
|
|
25
|
+
`)
|
|
26
|
+
|
|
8
27
|
useHead({ title: `Notes - ${configs.title}` })
|
|
9
28
|
|
|
10
29
|
const slidesWithNote = computed(() => rawRoutes
|
|
@@ -43,23 +62,3 @@ const slidesWithNote = computed(() => rawRoutes
|
|
|
43
62
|
</div>
|
|
44
63
|
</div>
|
|
45
64
|
</template>
|
|
46
|
-
|
|
47
|
-
<style scoped lang="postcss">
|
|
48
|
-
@page {
|
|
49
|
-
size: A4;
|
|
50
|
-
margin-top: 1.5cm;
|
|
51
|
-
margin-bottom: 1cm;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
* {
|
|
55
|
-
-webkit-print-color-adjust: exact;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
html,
|
|
59
|
-
html body,
|
|
60
|
-
html #app,
|
|
61
|
-
html #page-root {
|
|
62
|
-
height: auto;
|
|
63
|
-
overflow: auto !important;
|
|
64
|
-
}
|
|
65
|
-
</style>
|
package/logic/nav.ts
CHANGED
|
@@ -47,7 +47,7 @@ export const currentPage = computed(() => parseInt(path.value.split(/\//g).slice
|
|
|
47
47
|
export const currentPath = computed(() => getPath(currentPage.value))
|
|
48
48
|
export const currentRoute = computed(() => rawRoutes.find(i => i.path === `${currentPage.value}`))
|
|
49
49
|
export const currentSlideId = computed(() => currentRoute.value?.meta?.slide?.id)
|
|
50
|
-
export const currentLayout = computed(() => currentRoute.value?.meta?.layout)
|
|
50
|
+
export const currentLayout = computed(() => currentRoute.value?.meta?.layout || (currentPage.value === 1 ? 'cover' : 'default'))
|
|
51
51
|
|
|
52
52
|
export const nextRoute = computed(() => rawRoutes.find(i => i.path === `${Math.min(rawRoutes.length, currentPage.value + 1)}`))
|
|
53
53
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.10",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@antfu/utils": "^0.5.2",
|
|
19
|
-
"@slidev/parser": "0.36.
|
|
20
|
-
"@slidev/types": "0.36.
|
|
19
|
+
"@slidev/parser": "0.36.10",
|
|
20
|
+
"@slidev/types": "0.36.10",
|
|
21
21
|
"@unocss/reset": "^0.45.29",
|
|
22
22
|
"@vueuse/core": "^9.3.0",
|
|
23
23
|
"@vueuse/head": "^0.9.8",
|