@slidev/client 0.48.0-beta.5 → 0.48.0-beta.6
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/constants.ts +10 -8
- package/internals/Editor.vue +5 -0
- package/logic/note.ts +4 -4
- package/package.json +3 -3
package/constants.ts
CHANGED
|
@@ -3,14 +3,16 @@ import type { RouteRecordRaw } from 'vue-router'
|
|
|
3
3
|
import type { ClicksContext, RenderContext } from '@slidev/types'
|
|
4
4
|
import type { SlidevContext } from './modules/context'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
6
|
+
// Here we use string literal instead of symbols to make HMR more stable
|
|
7
|
+
// The value of the injections keys are implementation details, you should always use them with the reference to the constant instead of the value
|
|
8
|
+
export const injectionClicksContext = '$$slidev-clicks-context' as unknown as InjectionKey<Ref<ClicksContext>>
|
|
9
|
+
export const injectionCurrentPage = '$$slidev-page' as unknown as InjectionKey<Ref<number>>
|
|
10
|
+
export const injectionSlideScale = '$$slidev-slide-scale' as unknown as InjectionKey<ComputedRef<number>>
|
|
11
|
+
export const injectionSlidevContext = '$$slidev-context' as unknown as InjectionKey<UnwrapNestedRefs<SlidevContext>>
|
|
12
|
+
export const injectionRoute = '$$slidev-route' as unknown as InjectionKey<RouteRecordRaw>
|
|
13
|
+
export const injectionRenderContext = '$$slidev-render-context' as unknown as InjectionKey<Ref<RenderContext>>
|
|
14
|
+
export const injectionActive = '$$slidev-active' as unknown as InjectionKey<Ref<boolean>>
|
|
15
|
+
export const injectionFrontmatter = '$$slidev-fontmatter' as unknown as InjectionKey<Record<string, any>>
|
|
14
16
|
|
|
15
17
|
export const CLASS_VCLICK_TARGET = 'slidev-vclick-target'
|
|
16
18
|
export const CLASS_VCLICK_HIDDEN = 'slidev-vclick-hidden'
|
package/internals/Editor.vue
CHANGED
package/logic/note.ts
CHANGED
|
@@ -2,11 +2,11 @@ import type { MaybeRef } from '@vueuse/core'
|
|
|
2
2
|
import { useFetch } from '@vueuse/core'
|
|
3
3
|
import type { Ref } from 'vue'
|
|
4
4
|
import { computed, ref, unref } from 'vue'
|
|
5
|
-
import type { SlideInfo } from '@slidev/types'
|
|
5
|
+
import type { SlideInfo, SlidePatch } from '@slidev/types'
|
|
6
6
|
|
|
7
7
|
export interface UseSlideInfo {
|
|
8
8
|
info: Ref<SlideInfo | undefined>
|
|
9
|
-
update: (data:
|
|
9
|
+
update: (data: SlidePatch) => Promise<SlideInfo | void>
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function useSlideInfo(id: number | undefined): UseSlideInfo {
|
|
@@ -21,7 +21,7 @@ export function useSlideInfo(id: number | undefined): UseSlideInfo {
|
|
|
21
21
|
|
|
22
22
|
execute()
|
|
23
23
|
|
|
24
|
-
const update = async (data:
|
|
24
|
+
const update = async (data: SlidePatch) => {
|
|
25
25
|
return await fetch(
|
|
26
26
|
url,
|
|
27
27
|
{
|
|
@@ -64,7 +64,7 @@ export function useDynamicSlideInfo(id: MaybeRef<number | undefined>) {
|
|
|
64
64
|
|
|
65
65
|
return {
|
|
66
66
|
info: computed(() => get(unref(id)).info.value),
|
|
67
|
-
update: async (data:
|
|
67
|
+
update: async (data: SlidePatch, newId?: number) => {
|
|
68
68
|
const info = get(newId ?? unref(id))
|
|
69
69
|
const newData = await info.update(data)
|
|
70
70
|
if (newData)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.48.0-beta.
|
|
4
|
+
"version": "0.48.0-beta.6",
|
|
5
5
|
"description": "Presentation slides for developers",
|
|
6
6
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"unocss": "^0.58.5",
|
|
54
54
|
"vue": "^3.4.19",
|
|
55
55
|
"vue-router": "^4.2.5",
|
|
56
|
-
"@slidev/parser": "0.48.0-beta.
|
|
57
|
-
"@slidev/types": "0.48.0-beta.
|
|
56
|
+
"@slidev/parser": "0.48.0-beta.6",
|
|
57
|
+
"@slidev/types": "0.48.0-beta.6"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"vite": "^5.1.3"
|