@slidev/client 0.38.5 → 0.38.8
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/builtin/TocList.vue +1 -1
- package/builtin/Tweet.vue +1 -1
- package/internals/Play.vue +2 -0
- package/internals/Print.vue +4 -11
- package/internals/PrintContainer.vue +1 -1
- package/internals/PrintSlideClick.vue +1 -1
- package/internals/PrintStyle.vue +16 -0
- package/internals/SlideContainer.vue +3 -2
- package/internals/SlideWrapper.ts +1 -0
- package/internals/SlidesShow.vue +34 -13
- package/logic/drawings.ts +1 -0
- package/package.json +3 -3
package/builtin/TocList.vue
CHANGED
package/builtin/Tweet.vue
CHANGED
|
@@ -58,7 +58,7 @@ else {
|
|
|
58
58
|
|
|
59
59
|
<template>
|
|
60
60
|
<Transform :scale="scale || 1">
|
|
61
|
-
<div ref="tweet" class="tweet"
|
|
61
|
+
<div ref="tweet" class="tweet">
|
|
62
62
|
<div v-if="!loaded || tweetNotFound" class="w-30 h-30 my-10px bg-gray-400 bg-opacity-10 rounded-lg flex opacity-50">
|
|
63
63
|
<div class="m-auto animate-pulse text-4xl">
|
|
64
64
|
<carbon:logo-twitter />
|
package/internals/Play.vue
CHANGED
|
@@ -9,6 +9,7 @@ import Controls from './Controls.vue'
|
|
|
9
9
|
import SlideContainer from './SlideContainer.vue'
|
|
10
10
|
import NavControls from './NavControls.vue'
|
|
11
11
|
import SlidesShow from './SlidesShow.vue'
|
|
12
|
+
import PrintStyle from './PrintStyle.vue'
|
|
12
13
|
|
|
13
14
|
registerShortcuts()
|
|
14
15
|
|
|
@@ -40,6 +41,7 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
|
|
|
40
41
|
</script>
|
|
41
42
|
|
|
42
43
|
<template>
|
|
44
|
+
<PrintStyle v-if="isPrintMode" />
|
|
43
45
|
<div id="page-root" ref="root" class="grid grid-cols-[1fr_max-content]" :style="themeVars">
|
|
44
46
|
<SlideContainer
|
|
45
47
|
class="w-full h-full"
|
package/internals/Print.vue
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import { h, watchEffect } from 'vue'
|
|
2
|
+
import { watchEffect } from 'vue'
|
|
4
3
|
import { windowSize } from '../state'
|
|
5
4
|
import { isPrintMode } from '../logic/nav'
|
|
6
|
-
import {
|
|
5
|
+
import { themeVars } from '../env'
|
|
7
6
|
import PrintContainer from './PrintContainer.vue'
|
|
8
|
-
|
|
9
|
-
function vStyle<Props>(props: Props, { slots }: { slots: Slots }) {
|
|
10
|
-
if (slots.default)
|
|
11
|
-
return h('style', slots.default())
|
|
12
|
-
}
|
|
7
|
+
import PrintStyle from './PrintStyle.vue'
|
|
13
8
|
|
|
14
9
|
watchEffect(() => {
|
|
15
10
|
if (isPrintMode)
|
|
@@ -20,9 +15,7 @@ watchEffect(() => {
|
|
|
20
15
|
</script>
|
|
21
16
|
|
|
22
17
|
<template>
|
|
23
|
-
<
|
|
24
|
-
@page { size: {{ slideWidth }}px {{ slideHeight }}px; margin: 0px; }
|
|
25
|
-
</vStyle>
|
|
18
|
+
<PrintStyle v-if="isPrintMode" />
|
|
26
19
|
<div id="page-root" class="grid grid-cols-[1fr_max-content]" :style="themeVars">
|
|
27
20
|
<PrintContainer
|
|
28
21
|
class="w-full h-full"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Slots } from 'vue'
|
|
3
|
+
import { h } from 'vue'
|
|
4
|
+
import { slideHeight, slideWidth } from '../env'
|
|
5
|
+
|
|
6
|
+
function vStyle<Props>(props: Props, { slots }: { slots: Slots }) {
|
|
7
|
+
if (slots.default)
|
|
8
|
+
return h('style', slots.default())
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<vStyle>
|
|
14
|
+
@page { size: {{ slideWidth }}px {{ slideHeight }}px; margin: 0px; }
|
|
15
|
+
</vStyle>
|
|
16
|
+
</template>
|
|
@@ -3,6 +3,7 @@ import { useElementSize } from '@vueuse/core'
|
|
|
3
3
|
import { computed, provide, ref, watchEffect } from 'vue'
|
|
4
4
|
import { configs, slideAspect, slideHeight, slideWidth } from '../env'
|
|
5
5
|
import { injectionSlideScale } from '../constants'
|
|
6
|
+
import { isPrintMode } from '../logic/nav'
|
|
6
7
|
|
|
7
8
|
const props = defineProps({
|
|
8
9
|
width: {
|
|
@@ -34,7 +35,7 @@ if (props.width) {
|
|
|
34
35
|
const screenAspect = computed(() => width.value / height.value)
|
|
35
36
|
|
|
36
37
|
const scale = computed(() => {
|
|
37
|
-
if (props.scale)
|
|
38
|
+
if (props.scale && !isPrintMode.value)
|
|
38
39
|
return props.scale
|
|
39
40
|
if (screenAspect.value < slideAspect)
|
|
40
41
|
return width.value / slideWidth
|
|
@@ -66,7 +67,7 @@ provide(injectionSlideScale, scale)
|
|
|
66
67
|
|
|
67
68
|
<style lang="postcss">
|
|
68
69
|
#slide-container {
|
|
69
|
-
@apply relative overflow-hidden;
|
|
70
|
+
@apply relative overflow-hidden break-after-page;
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
#slide-content {
|
|
@@ -3,6 +3,7 @@ import { defineComponent, h, provide } from 'vue'
|
|
|
3
3
|
import { injectionClicks, injectionClicksDisabled, injectionClicksElements, injectionOrderMap, injectionRoute, injectionSlideContext } from '../constants'
|
|
4
4
|
|
|
5
5
|
export default defineComponent({
|
|
6
|
+
name: 'SlideWrapper',
|
|
6
7
|
props: {
|
|
7
8
|
clicks: {
|
|
8
9
|
type: [Number, String],
|
package/internals/SlidesShow.vue
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { shallowRef, watch } from 'vue'
|
|
2
|
+
import { computed, ref, shallowRef, watch } from 'vue'
|
|
3
3
|
import { clicks, currentRoute, isPresenter, nextRoute, rawRoutes } from '../logic/nav'
|
|
4
4
|
import { getSlideClass } from '../utils'
|
|
5
|
+
import { configs } from '../env'
|
|
5
6
|
import SlideWrapper from './SlideWrapper'
|
|
6
7
|
// @ts-expect-error virtual module
|
|
7
8
|
import GlobalTop from '/@slidev/global-components/top'
|
|
@@ -22,6 +23,18 @@ watch(currentRoute, () => {
|
|
|
22
23
|
const DrawingLayer = shallowRef<any>()
|
|
23
24
|
if (__SLIDEV_FEATURE_DRAWINGS__ || __SLIDEV_FEATURE_DRAWINGS_PERSIST__)
|
|
24
25
|
import('./DrawingLayer.vue').then(v => DrawingLayer.value = v.default)
|
|
26
|
+
|
|
27
|
+
const routes = computed(() => rawRoutes.filter(r => r.meta?.__preloaded || r === currentRoute.value))
|
|
28
|
+
|
|
29
|
+
const isLeaving = ref(false)
|
|
30
|
+
function onBeforeLeave() {
|
|
31
|
+
if (configs.pageTransition?.crossfade === false)
|
|
32
|
+
isLeaving.value = true
|
|
33
|
+
}
|
|
34
|
+
function onAfterLeave() {
|
|
35
|
+
if (configs.pageTransition?.crossfade === false)
|
|
36
|
+
isLeaving.value = false
|
|
37
|
+
}
|
|
25
38
|
</script>
|
|
26
39
|
|
|
27
40
|
<template>
|
|
@@ -29,18 +42,26 @@ if (__SLIDEV_FEATURE_DRAWINGS__ || __SLIDEV_FEATURE_DRAWINGS_PERSIST__)
|
|
|
29
42
|
<GlobalBottom />
|
|
30
43
|
|
|
31
44
|
<!-- Slides -->
|
|
32
|
-
<template
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
<template
|
|
46
|
+
v-for="route of routes"
|
|
47
|
+
:key="route.path"
|
|
48
|
+
>
|
|
49
|
+
<Transition
|
|
50
|
+
v-bind="configs.pageTransition"
|
|
51
|
+
@before-leave="onBeforeLeave()"
|
|
52
|
+
@after-leave="onAfterLeave()"
|
|
53
|
+
>
|
|
54
|
+
<SlideWrapper
|
|
55
|
+
:is="route?.component as any"
|
|
56
|
+
v-show="route === currentRoute && !isLeaving"
|
|
57
|
+
:clicks="route === currentRoute ? clicks : 0"
|
|
58
|
+
:clicks-elements="route.meta?.__clicksElements || []"
|
|
59
|
+
:clicks-disabled="false"
|
|
60
|
+
:class="getSlideClass(route)"
|
|
61
|
+
:route="route"
|
|
62
|
+
:context="context"
|
|
63
|
+
/>
|
|
64
|
+
</Transition>
|
|
44
65
|
</template>
|
|
45
66
|
|
|
46
67
|
<!-- Global Top -->
|
package/logic/drawings.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.8",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"vue-router": "^4.1.6",
|
|
41
41
|
"vue-starport": "^0.3.0",
|
|
42
42
|
"windicss": "^3.5.6",
|
|
43
|
-
"@slidev/parser": "0.38.
|
|
44
|
-
"@slidev/types": "0.38.
|
|
43
|
+
"@slidev/parser": "0.38.8",
|
|
44
|
+
"@slidev/types": "0.38.8"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"vite": "^4.0.4"
|