@slidev/client 0.24.0 → 0.25.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.
- package/constants.ts +1 -2
- package/internals/DrawingLayer.vue +1 -4
- package/internals/NavControls.vue +1 -1
- package/internals/Play.vue +2 -2
- package/internals/SlideContainer.vue +0 -3
- package/logic/drawings.ts +7 -3
- package/package.json +9 -9
- package/styles/index.css +6 -0
package/constants.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InjectionKey, Ref } from 'vue'
|
|
2
2
|
|
|
3
3
|
export const injectionClicks: InjectionKey<Ref<number>> = Symbol('v-click-clicks')
|
|
4
4
|
export const injectionClicksElements: InjectionKey<Ref<(Element | string)[]>> = Symbol('v-click-clicks-elements')
|
|
5
5
|
export const injectionOrderMap: InjectionKey<Ref<Map<number, HTMLElement[]>>> = Symbol('v-click-clicks-order-map')
|
|
6
6
|
export const injectionClicksDisabled: InjectionKey<Ref<boolean>> = Symbol('v-click-clicks-disabled')
|
|
7
|
-
export const injectionSlideScale: InjectionKey<ComputedRef<number>> = Symbol('slidev-slide-scale')
|
|
8
7
|
|
|
9
8
|
export const CLASS_VCLICK_TARGET = 'slidev-vclick-target'
|
|
10
9
|
export const CLASS_VCLICK_HIDDEN = 'slidev-vclick-hidden'
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { onMounted, ref,
|
|
2
|
+
import { onMounted, ref, onBeforeUnmount } from 'vue'
|
|
3
3
|
import { drauu, loadCanvas } from '../logic/drawings'
|
|
4
|
-
import { injectionSlideScale } from '../constants'
|
|
5
4
|
|
|
6
|
-
const scale = inject(injectionSlideScale)!
|
|
7
5
|
const svg = ref<SVGSVGElement>()
|
|
8
6
|
|
|
9
7
|
onMounted(() => {
|
|
10
8
|
drauu.mount(svg.value!, svg.value!.parentElement!)
|
|
11
|
-
watch(scale, scale => drauu.options.coordinateScale = 1 / scale, { immediate: true })
|
|
12
9
|
loadCanvas()
|
|
13
10
|
})
|
|
14
11
|
|
|
@@ -94,7 +94,7 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
|
|
|
94
94
|
</button>
|
|
95
95
|
</template>
|
|
96
96
|
|
|
97
|
-
<template v-if="__SLIDEV_FEATURE_DRAWINGS__ && !isEmbedded">
|
|
97
|
+
<template v-if="__SLIDEV_FEATURE_DRAWINGS__ && !configs.drawings.presenterOnly && !isEmbedded">
|
|
98
98
|
<button class="icon-btn relative" title="Drawing" @click="drawingEnabled = !drawingEnabled">
|
|
99
99
|
<carbon:pen />
|
|
100
100
|
<div
|
package/internals/Play.vue
CHANGED
|
@@ -4,7 +4,7 @@ import { showEditor, windowSize, isScreenVertical, slideScale } from '../state'
|
|
|
4
4
|
import { isPrintMode, next, prev, useSwipeControls, isEmbedded } from '../logic/nav'
|
|
5
5
|
import { isDrawing } from '../logic/drawings'
|
|
6
6
|
import { registerShortcuts } from '../logic/shortcuts'
|
|
7
|
-
import { themeVars } from '../env'
|
|
7
|
+
import { themeVars, configs } from '../env'
|
|
8
8
|
import Controls from './Controls.vue'
|
|
9
9
|
import SlideContainer from './SlideContainer.vue'
|
|
10
10
|
import NavControls from './NavControls.vue'
|
|
@@ -61,7 +61,7 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
|
|
|
61
61
|
>
|
|
62
62
|
<NavControls class="m-auto" :persist="presistNav" />
|
|
63
63
|
</div>
|
|
64
|
-
<template v-if="__SLIDEV_FEATURE_DRAWINGS__ && !isEmbedded && DrawingControls">
|
|
64
|
+
<template v-if="__SLIDEV_FEATURE_DRAWINGS__ && !configs.drawings.presenterOnly && !isEmbedded && DrawingControls">
|
|
65
65
|
<DrawingControls class="ml-0" />
|
|
66
66
|
</template>
|
|
67
67
|
</template>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { useElementSize } from '@vueuse/core'
|
|
3
3
|
import { computed, provide, ref, watchEffect } from 'vue'
|
|
4
4
|
import { slideAspect, slideWidth, slideHeight, configs } from '../env'
|
|
5
|
-
import { injectionSlideScale } from '../constants'
|
|
6
5
|
|
|
7
6
|
const props = defineProps({
|
|
8
7
|
width: {
|
|
@@ -51,8 +50,6 @@ const className = computed(() => ({
|
|
|
51
50
|
'select-none': !configs.selectable,
|
|
52
51
|
'slidev-code-line-numbers': configs.lineNumbers,
|
|
53
52
|
}))
|
|
54
|
-
|
|
55
|
-
provide(injectionSlideScale, scale)
|
|
56
53
|
</script>
|
|
57
54
|
|
|
58
55
|
<template>
|
package/logic/drawings.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { computed, markRaw, nextTick, reactive, ref, watch } from 'vue'
|
|
1
|
+
import { computed, markRaw, nextTick, reactive, ref, watch, watchEffect } from 'vue'
|
|
2
2
|
import { Brush, createDrauu, DrawingMode, Options as DrauuOptions } from 'drauu'
|
|
3
3
|
import { useStorage, toReactive } from '@vueuse/core'
|
|
4
|
-
import { serverDrawingState as drawingState } from '../env'
|
|
5
|
-
import { currentPage } from './nav'
|
|
4
|
+
import { serverDrawingState as drawingState, configs } from '../env'
|
|
5
|
+
import { currentPage, isPresenter } from './nav'
|
|
6
6
|
|
|
7
7
|
export const brushColors = [
|
|
8
8
|
'#ff595e',
|
|
@@ -98,6 +98,10 @@ if (__DEV__) {
|
|
|
98
98
|
return
|
|
99
99
|
loadCanvas()
|
|
100
100
|
}, { immediate: true })
|
|
101
|
+
|
|
102
|
+
watchEffect(() => {
|
|
103
|
+
drawingState.$syncUp = configs.drawings.syncAll || isPresenter.value
|
|
104
|
+
})
|
|
101
105
|
})
|
|
102
106
|
|
|
103
107
|
drauu.on('start', () => isDrawing.value = true)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.3",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"homepage": "https://sli.dev",
|
|
6
6
|
"bugs": "https://github.com/slidevjs/slidev/issues",
|
|
@@ -13,25 +13,25 @@
|
|
|
13
13
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@antfu/utils": "^0.3.0",
|
|
16
|
-
"@slidev/parser": "0.
|
|
17
|
-
"@slidev/types": "0.
|
|
18
|
-
"@vueuse/core": "^6.
|
|
16
|
+
"@slidev/parser": "0.25.3",
|
|
17
|
+
"@slidev/types": "0.25.3",
|
|
18
|
+
"@vueuse/core": "^6.4.0",
|
|
19
19
|
"@vueuse/head": "^0.6.0",
|
|
20
20
|
"@vueuse/motion": "^1.6.0",
|
|
21
21
|
"codemirror": "^5.62.3",
|
|
22
|
-
"drauu": "^0.1.
|
|
22
|
+
"drauu": "^0.1.2",
|
|
23
23
|
"file-saver": "^2.0.5",
|
|
24
|
-
"js-base64": "^3.7.
|
|
24
|
+
"js-base64": "^3.7.1",
|
|
25
25
|
"js-yaml": "^4.1.0",
|
|
26
26
|
"katex": "^0.13.18",
|
|
27
27
|
"mermaid": "^8.12.1",
|
|
28
28
|
"monaco-editor": "^0.27.0",
|
|
29
29
|
"nanoid": "^3.1.25",
|
|
30
|
-
"prettier": "^2.4.
|
|
30
|
+
"prettier": "^2.4.1",
|
|
31
31
|
"recordrtc": "^5.6.2",
|
|
32
32
|
"resolve": "^1.20.0",
|
|
33
|
-
"vite-plugin-windicss": "^1.4.
|
|
34
|
-
"vue": "^3.2.
|
|
33
|
+
"vite-plugin-windicss": "^1.4.3",
|
|
34
|
+
"vue": "^3.2.12",
|
|
35
35
|
"vue-router": "^4.0.11",
|
|
36
36
|
"windicss": "^3.1.7"
|
|
37
37
|
},
|