@slidev/client 0.36.4 → 0.36.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.
|
@@ -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>
|
package/internals/WebCamera.vue
CHANGED
|
@@ -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, {
|
|
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)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Usage:
|
|
3
|
+
```md
|
|
4
|
+
---
|
|
5
|
+
layout: two-cols-header
|
|
6
|
+
---
|
|
7
|
+
This spans both
|
|
8
|
+
::left::
|
|
9
|
+
# Left
|
|
10
|
+
This shows on the left
|
|
11
|
+
::right::
|
|
12
|
+
# Right
|
|
13
|
+
This shows on the right
|
|
14
|
+
```
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
class: {
|
|
20
|
+
type: String,
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="slidev-layout two-columns w-full h-full">
|
|
27
|
+
<div class="col-span-2">
|
|
28
|
+
<slot />
|
|
29
|
+
</div>
|
|
30
|
+
<div class="grid grid-cols-2">
|
|
31
|
+
<div class="col-left" :class="props.class">
|
|
32
|
+
<slot name="left" />
|
|
33
|
+
</div>
|
|
34
|
+
<div class="col-right" :class="props.class">
|
|
35
|
+
<slot name="right" />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
package/modules/directives.ts
CHANGED
|
@@ -45,7 +45,7 @@ export default function createDirectives() {
|
|
|
45
45
|
elements.value.push(el)
|
|
46
46
|
|
|
47
47
|
// Set default dir.value
|
|
48
|
-
if (dir.value
|
|
48
|
+
if (dir.value == null)
|
|
49
49
|
dir.value = elements?.value.length
|
|
50
50
|
|
|
51
51
|
// If orderMap didn't have dir.value aka the order key, then initialize it.
|
|
@@ -123,7 +123,7 @@ export default function createDirectives() {
|
|
|
123
123
|
const prev = elements?.value.length
|
|
124
124
|
|
|
125
125
|
// Set default dir.value
|
|
126
|
-
if (dir.value
|
|
126
|
+
if (dir.value == null)
|
|
127
127
|
dir.value = elements?.value.length
|
|
128
128
|
|
|
129
129
|
// If a v-click order before v-after is lower than v-after, the order map will
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.6",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,34 +16,34 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@antfu/utils": "^0.5.2",
|
|
19
|
-
"@slidev/parser": "0.36.
|
|
20
|
-
"@slidev/types": "0.36.
|
|
21
|
-
"@unocss/reset": "^0.45.
|
|
22
|
-
"@vueuse/core": "^9.
|
|
23
|
-
"@vueuse/head": "^0.7
|
|
24
|
-
"@vueuse/math": "^9.
|
|
25
|
-
"@vueuse/motion": "^2.0.0-beta.
|
|
19
|
+
"@slidev/parser": "0.36.6",
|
|
20
|
+
"@slidev/types": "0.36.6",
|
|
21
|
+
"@unocss/reset": "^0.45.29",
|
|
22
|
+
"@vueuse/core": "^9.3.0",
|
|
23
|
+
"@vueuse/head": "^0.9.7",
|
|
24
|
+
"@vueuse/math": "^9.3.0",
|
|
25
|
+
"@vueuse/motion": "^2.0.0-beta.23",
|
|
26
26
|
"codemirror": "^5.65.5",
|
|
27
27
|
"defu": "^6.1.0",
|
|
28
|
-
"drauu": "^0.3.
|
|
28
|
+
"drauu": "^0.3.2",
|
|
29
29
|
"file-saver": "^2.0.5",
|
|
30
30
|
"js-base64": "^3.7.2",
|
|
31
31
|
"js-yaml": "^4.1.0",
|
|
32
32
|
"katex": "^0.16.2",
|
|
33
|
-
"mermaid": "^9.1.
|
|
33
|
+
"mermaid": "^9.1.7",
|
|
34
34
|
"monaco-editor": "^0.33.0",
|
|
35
35
|
"nanoid": "^4.0.0",
|
|
36
36
|
"prettier": "^2.7.1",
|
|
37
37
|
"recordrtc": "^5.6.2",
|
|
38
38
|
"resolve": "^1.22.1",
|
|
39
|
-
"unocss": "^0.45.
|
|
39
|
+
"unocss": "^0.45.29",
|
|
40
40
|
"vite-plugin-windicss": "^1.8.8",
|
|
41
|
-
"vue": "^3.2.
|
|
41
|
+
"vue": "^3.2.40",
|
|
42
42
|
"vue-router": "^4.1.5",
|
|
43
43
|
"vue-starport": "^0.3.0",
|
|
44
44
|
"windicss": "^3.5.6"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"vite": "^3.1.
|
|
47
|
+
"vite": "^3.1.6"
|
|
48
48
|
}
|
|
49
49
|
}
|