@slidev/client 0.36.3 → 0.36.5

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,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { useLocalStorage } from '@vueuse/core'
3
+ import { onMounted, watch } from 'vue'
2
4
  import { recorder } from '../logic/recording'
3
5
  import { currentCamera, showRecordingDialog } from '../state'
4
6
  import DevicesList from './DevicesList.vue'
@@ -12,12 +14,22 @@ const {
12
14
  toggleAvatar,
13
15
  } = recorder
14
16
 
17
+ const previousAvatar = useLocalStorage('slidev-webcam-show', false)
18
+ watch(showAvatar, () => {
19
+ previousAvatar.value = showAvatar.value
20
+ })
21
+
15
22
  function toggleRecording() {
16
23
  if (recording.value)
17
24
  stopRecording()
18
25
  else
19
26
  showRecordingDialog.value = true
20
27
  }
28
+
29
+ onMounted(() => {
30
+ if (previousAvatar.value && !showAvatar.value)
31
+ toggleAvatar()
32
+ })
21
33
  </script>
22
34
 
23
35
  <template>
@@ -8,7 +8,7 @@ const size = useStorage('slidev-webcam-size', Math.round(Math.min(window.innerHe
8
8
  const position = useStorage('slidev-webcam-pos', {
9
9
  x: window.innerWidth - size.value - 30,
10
10
  y: window.innerHeight - size.value - 30,
11
- })
11
+ }, undefined, { deep: true })
12
12
 
13
13
  const frame = ref<HTMLDivElement | undefined>()
14
14
  const handler = ref<HTMLDivElement | undefined>()
@@ -16,7 +16,13 @@ const video = ref<HTMLVideoElement | undefined>()
16
16
 
17
17
  const { streamCamera, showAvatar } = recorder
18
18
 
19
- const { style: containerStyle } = useDraggable(frame, { initialValue: position })
19
+ const { style: containerStyle } = useDraggable(frame, {
20
+ initialValue: position,
21
+ onMove({ x, y }) {
22
+ position.value.x = x
23
+ position.value.y = y
24
+ },
25
+ })
20
26
  const { isDragging: handlerDown } = useDraggable(handler, {
21
27
  onMove({ x, y }) {
22
28
  size.value = Math.max(10, Math.min(x - position.value.x, y - position.value.y) / 0.8536)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
- "version": "0.36.3",
3
+ "version": "0.36.5",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -16,9 +16,9 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@antfu/utils": "^0.5.2",
19
- "@slidev/parser": "0.36.3",
20
- "@slidev/types": "0.36.3",
21
- "@unocss/reset": "^0.45.20",
19
+ "@slidev/parser": "0.36.5",
20
+ "@slidev/types": "0.36.5",
21
+ "@unocss/reset": "^0.45.21",
22
22
  "@vueuse/core": "^9.2.0",
23
23
  "@vueuse/head": "^0.7.10",
24
24
  "@vueuse/math": "^9.2.0",
@@ -36,7 +36,7 @@
36
36
  "prettier": "^2.7.1",
37
37
  "recordrtc": "^5.6.2",
38
38
  "resolve": "^1.22.1",
39
- "unocss": "^0.45.20",
39
+ "unocss": "^0.45.21",
40
40
  "vite-plugin-windicss": "^1.8.8",
41
41
  "vue": "^3.2.39",
42
42
  "vue-router": "^4.1.5",