@slidev/client 0.49.13 → 0.49.15
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/context.ts +1 -23
- package/internals/NoteDisplay.vue +1 -1
- package/internals/SlideWrapper.vue +2 -1
- package/package.json +5 -5
- package/shim-vue.d.ts +2 -2
package/context.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, ref, toRef } from 'vue'
|
|
2
|
-
import { injectLocal, objectOmit
|
|
2
|
+
import { injectLocal, objectOmit } from '@vueuse/core'
|
|
3
3
|
import {
|
|
4
4
|
FRONTMATTER_FIELDS,
|
|
5
5
|
HEADMATTER_FIELDS,
|
|
@@ -44,28 +44,6 @@ export function useSlideContext() {
|
|
|
44
44
|
|
|
45
45
|
export type SlideContext = ReturnType<typeof useSlideContext>
|
|
46
46
|
|
|
47
|
-
/**
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
|
-
export function provideFrontmatter(frontmatter: Record<string, any>) {
|
|
51
|
-
provideLocal(injectionFrontmatter, frontmatter)
|
|
52
|
-
|
|
53
|
-
const {
|
|
54
|
-
$slidev,
|
|
55
|
-
$page,
|
|
56
|
-
} = useSlideContext()
|
|
57
|
-
|
|
58
|
-
// update frontmatter in router to make HMR work better
|
|
59
|
-
const route = $slidev.nav.slides.find(i => i.no === $page.value)
|
|
60
|
-
if (route?.meta?.slide?.frontmatter) {
|
|
61
|
-
for (const key of Object.keys(route.meta.slide.frontmatter)) {
|
|
62
|
-
if (!(key in frontmatter))
|
|
63
|
-
delete route.meta.slide.frontmatter[key]
|
|
64
|
-
}
|
|
65
|
-
Object.assign(route.meta.slide.frontmatter, frontmatter)
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
47
|
/**
|
|
70
48
|
* Convert frontmatter options to props for v-bind
|
|
71
49
|
* It removes known options fields, and expose an extra `frontmatter` field that contains full frontmatter
|
|
@@ -3,7 +3,7 @@ import { computed, defineAsyncComponent, defineComponent, h, ref, toRef } from '
|
|
|
3
3
|
import type { CSSProperties, PropType } from 'vue'
|
|
4
4
|
import { provideLocal } from '@vueuse/core'
|
|
5
5
|
import type { ClicksContext, RenderContext, SlideRoute } from '@slidev/types'
|
|
6
|
-
import { injectionClicksContext, injectionCurrentPage, injectionRenderContext, injectionRoute, injectionSlideZoom } from '../constants'
|
|
6
|
+
import { injectionClicksContext, injectionCurrentPage, injectionFrontmatter, injectionRenderContext, injectionRoute, injectionSlideZoom } from '../constants'
|
|
7
7
|
import { getSlideClass } from '../utils'
|
|
8
8
|
import { configs } from '../env'
|
|
9
9
|
import SlideLoading from './SlideLoading.vue'
|
|
@@ -27,6 +27,7 @@ const props = defineProps({
|
|
|
27
27
|
const zoom = computed(() => props.route.meta?.slide?.frontmatter.zoom ?? 1)
|
|
28
28
|
|
|
29
29
|
provideLocal(injectionRoute, props.route)
|
|
30
|
+
provideLocal(injectionFrontmatter, props.route.meta.slide.frontmatter)
|
|
30
31
|
provideLocal(injectionCurrentPage, ref(props.route.no))
|
|
31
32
|
provideLocal(injectionRenderContext, ref(props.renderContext))
|
|
32
33
|
provideLocal(injectionClicksContext, toRef(props, 'clicksContext'))
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.49.
|
|
4
|
+
"version": "0.49.15",
|
|
5
5
|
"description": "Presentation slides for developers",
|
|
6
6
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@slidev/rough-notation": "^0.1.0",
|
|
38
38
|
"@typescript/ata": "^0.9.6",
|
|
39
39
|
"@unhead/vue": "^1.9.14",
|
|
40
|
-
"@unocss/reset": "^0.61.
|
|
40
|
+
"@unocss/reset": "^0.61.2",
|
|
41
41
|
"@vueuse/core": "^10.11.0",
|
|
42
42
|
"@vueuse/math": "^10.11.0",
|
|
43
43
|
"@vueuse/motion": "^2.2.3",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"shiki": "^1.10.0",
|
|
55
55
|
"shiki-magic-move": "^0.4.2",
|
|
56
56
|
"typescript": "^5.5.2",
|
|
57
|
-
"unocss": "^0.61.
|
|
57
|
+
"unocss": "^0.61.2",
|
|
58
58
|
"vue": "^3.4.31",
|
|
59
59
|
"vue-router": "^4.4.0",
|
|
60
60
|
"yaml": "^2.4.5",
|
|
61
|
-
"@slidev/
|
|
62
|
-
"@slidev/
|
|
61
|
+
"@slidev/parser": "0.49.15",
|
|
62
|
+
"@slidev/types": "0.49.15"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"vite": "^5.3.2"
|
package/shim-vue.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ declare module 'vue-router' {
|
|
|
9
9
|
|
|
10
10
|
interface RouteMeta {
|
|
11
11
|
// inherited from frontmatter
|
|
12
|
-
layout
|
|
12
|
+
layout?: string
|
|
13
13
|
name?: string
|
|
14
14
|
class?: string
|
|
15
15
|
clicks?: number
|
|
@@ -26,7 +26,7 @@ declare module 'vue-router' {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// private fields
|
|
29
|
-
__clicksContext: import('@slidev/types').ClicksContext |
|
|
29
|
+
__clicksContext: import('@slidev/types').ClicksContext | null
|
|
30
30
|
__preloaded?: boolean
|
|
31
31
|
}
|
|
32
32
|
}
|