@slidev/client 0.43.9 → 0.43.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.
@@ -1,6 +1,5 @@
1
1
  import { useVModel } from '@vueuse/core'
2
- import type { Ref } from 'vue'
3
- import { defineComponent, h, provide, ref, toRef } from 'vue'
2
+ import { computed, defineComponent, h, provide, ref, toRef } from 'vue'
4
3
  import type { RenderContext } from '@slidev/types'
5
4
  import { injectionActive, injectionClicks, injectionClicksDisabled, injectionClicksElements, injectionCurrentPage, injectionOrderMap, injectionRenderContext, injectionRoute } from '../constants'
6
5
 
@@ -48,11 +47,22 @@ export default defineComponent({
48
47
 
49
48
  clicksElements.value.length = 0
50
49
 
50
+ const clicksWithDisable = computed({
51
+ get() {
52
+ if (clicksDisabled.value)
53
+ return 9999999
54
+ return +clicks.value
55
+ },
56
+ set(value) {
57
+ clicks.value = value
58
+ },
59
+ })
60
+
51
61
  provide(injectionRoute, props.route as any)
52
62
  provide(injectionCurrentPage, ref(+props.route?.path))
53
63
  provide(injectionRenderContext, ref(props.renderContext as RenderContext))
54
64
  provide(injectionActive, toRef(props, 'active'))
55
- provide(injectionClicks, clicks as Ref<number>)
65
+ provide(injectionClicks, clicksWithDisable)
56
66
  provide(injectionClicksDisabled, clicksDisabled)
57
67
  provide(injectionClicksElements, clicksElements as any)
58
68
  provide(injectionOrderMap, clicksOrderMap as any)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
- "version": "0.43.9",
3
+ "version": "0.43.10",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -45,8 +45,8 @@
45
45
  "vue-router": "^4.2.5",
46
46
  "vue-starport": "^0.4.0",
47
47
  "windicss": "^3.5.6",
48
- "@slidev/parser": "0.43.9",
49
- "@slidev/types": "0.43.9"
48
+ "@slidev/parser": "0.43.10",
49
+ "@slidev/types": "0.43.10"
50
50
  },
51
51
  "devDependencies": {
52
52
  "vite": "^4.5.0"