@slidev/client 0.51.0-beta.2 → 0.51.0-beta.3

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,6 @@
1
1
  import type { Ref } from 'vue'
2
2
  import { useEventListener } from '@vueuse/core'
3
- import { computed } from 'vue'
3
+ import { computed, watch } from 'vue'
4
4
  import { hideCursorIdle } from '../state'
5
5
 
6
6
  const TIMEOUT = 2000
@@ -19,15 +19,24 @@ export function useHideCursorIdle(
19
19
 
20
20
  let timer: ReturnType<typeof setTimeout> | null = null
21
21
 
22
+ // If disabled, immediately show the cursor
23
+ watch(
24
+ shouldHide,
25
+ (value) => {
26
+ if (!value)
27
+ show()
28
+ },
29
+ )
30
+
22
31
  useEventListener(
23
32
  document.body,
24
33
  ['pointermove', 'pointerdown'],
25
34
  () => {
26
35
  show()
27
- if (!shouldHide.value)
28
- return
29
36
  if (timer)
30
37
  clearTimeout(timer)
38
+ if (!shouldHide.value)
39
+ return
31
40
  timer = setTimeout(hide, TIMEOUT)
32
41
  },
33
42
  { passive: true },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
3
  "type": "module",
4
- "version": "0.51.0-beta.2",
4
+ "version": "0.51.0-beta.3",
5
5
  "description": "Presentation slides for developers",
6
6
  "author": "antfu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -60,8 +60,8 @@
60
60
  "vue": "^3.5.13",
61
61
  "vue-router": "^4.5.0",
62
62
  "yaml": "^2.6.1",
63
- "@slidev/parser": "0.51.0-beta.2",
64
- "@slidev/types": "0.51.0-beta.2"
63
+ "@slidev/parser": "0.51.0-beta.3",
64
+ "@slidev/types": "0.51.0-beta.3"
65
65
  },
66
66
  "devDependencies": {
67
67
  "vite": "^6.0.6"