@slidev/client 0.50.0-beta.4 → 0.50.0-beta.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.
|
@@ -21,7 +21,7 @@ Learn more: https://sli.dev/guide/syntax.html#latex-line-highlighting
|
|
|
21
21
|
|
|
22
22
|
<script setup lang="ts">
|
|
23
23
|
import type { PropType } from 'vue'
|
|
24
|
-
import { parseRangeString } from '@slidev/parser'
|
|
24
|
+
import { parseRangeString } from '@slidev/parser/utils'
|
|
25
25
|
import { computed, onMounted, onUnmounted, ref, watchEffect } from 'vue'
|
|
26
26
|
import { CLASS_VCLICK_HIDDEN, CLASS_VCLICK_TARGET, CLICKS_MAX } from '../constants'
|
|
27
27
|
import { useSlideContext } from '../context'
|
package/builtin/TocList.vue
CHANGED
|
@@ -11,6 +11,7 @@ import type { TocItem } from '@slidev/types'
|
|
|
11
11
|
import TitleRenderer from '#slidev/title-renderer'
|
|
12
12
|
import { toArray } from '@antfu/utils'
|
|
13
13
|
import { computed } from 'vue'
|
|
14
|
+
import { useNav } from '../composables/useNav'
|
|
14
15
|
|
|
15
16
|
const props = withDefaults(defineProps<{
|
|
16
17
|
level: number
|
|
@@ -20,6 +21,8 @@ const props = withDefaults(defineProps<{
|
|
|
20
21
|
listClass?: string | string[]
|
|
21
22
|
}>(), { level: 1 })
|
|
22
23
|
|
|
24
|
+
const { isPresenter } = useNav()
|
|
25
|
+
|
|
23
26
|
const classes = computed(() => {
|
|
24
27
|
return [
|
|
25
28
|
...toArray(props.listClass || []),
|
|
@@ -47,7 +50,7 @@ const styles = computed(() => {
|
|
|
47
50
|
:key="item.path" class="slidev-toc-item"
|
|
48
51
|
:class="[{ 'slidev-toc-item-active': item.active }, { 'slidev-toc-item-parent-active': item.activeParent }]"
|
|
49
52
|
>
|
|
50
|
-
<Link :to="item.path">
|
|
53
|
+
<Link :to="isPresenter ? `/presenter${item.path}` : item.path">
|
|
51
54
|
<TitleRenderer :no="item.no" />
|
|
52
55
|
</Link>
|
|
53
56
|
<TocList
|
|
@@ -17,7 +17,7 @@ export function useViewTransition() {
|
|
|
17
17
|
const toMeta = getSlide(to.params.no as string)?.meta
|
|
18
18
|
const fromNo = fromMeta?.slide?.no
|
|
19
19
|
const toNo = toMeta?.slide?.no
|
|
20
|
-
const transitionType = fromNo != null && toNo != null
|
|
20
|
+
const transitionType = fromNo != null && toNo != null && fromNo !== toNo
|
|
21
21
|
&& ((fromNo < toNo ? fromMeta?.transition : toMeta?.transition) ?? configs.transition)
|
|
22
22
|
if (transitionType !== 'view-transition') {
|
|
23
23
|
isViewTransition.value = false
|
|
@@ -41,7 +41,6 @@ export function useViewTransition() {
|
|
|
41
41
|
|
|
42
42
|
// Wait for `TransitionGroup` to become normal `div`
|
|
43
43
|
setTimeout(() => {
|
|
44
|
-
// @ts-expect-error missing types
|
|
45
44
|
document.startViewTransition(() => {
|
|
46
45
|
changeRoute()
|
|
47
46
|
return promise
|
|
@@ -85,13 +85,12 @@ onMounted(() => {
|
|
|
85
85
|
<slot name="controls" />
|
|
86
86
|
</div>
|
|
87
87
|
<!-- Image preview -->
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
</template>
|
|
88
|
+
<img
|
|
89
|
+
v-else
|
|
90
|
+
:src="snapshot"
|
|
91
|
+
class="w-full object-cover"
|
|
92
|
+
:style="containerStyle"
|
|
93
|
+
>
|
|
95
94
|
</template>
|
|
96
95
|
|
|
97
96
|
<style scoped lang="postcss">
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.50.0-beta.
|
|
4
|
+
"version": "0.50.0-beta.6",
|
|
5
5
|
"description": "Presentation slides for developers",
|
|
6
6
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"@iconify-json/carbon": "^1.2.3",
|
|
33
33
|
"@iconify-json/ph": "^1.2.1",
|
|
34
34
|
"@iconify-json/svg-spinners": "^1.2.1",
|
|
35
|
-
"@shikijs/monaco": "^1.22.
|
|
36
|
-
"@shikijs/vitepress-twoslash": "^1.22.
|
|
35
|
+
"@shikijs/monaco": "^1.22.1",
|
|
36
|
+
"@shikijs/vitepress-twoslash": "^1.22.1",
|
|
37
37
|
"@slidev/rough-notation": "^0.1.0",
|
|
38
38
|
"@typescript/ata": "^0.9.7",
|
|
39
39
|
"@unhead/vue": "^1.11.10",
|
|
40
|
-
"@unocss/reset": "^0.63.
|
|
40
|
+
"@unocss/reset": "^0.63.6",
|
|
41
41
|
"@vueuse/core": "^11.1.0",
|
|
42
42
|
"@vueuse/math": "^11.1.0",
|
|
43
43
|
"@vueuse/motion": "^2.2.6",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"vue": "^3.5.12",
|
|
60
60
|
"vue-router": "^4.4.5",
|
|
61
61
|
"yaml": "^2.6.0",
|
|
62
|
-
"@slidev/
|
|
63
|
-
"@slidev/
|
|
62
|
+
"@slidev/types": "0.50.0-beta.6",
|
|
63
|
+
"@slidev/parser": "0.50.0-beta.6"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"vite": "^5.4.9"
|
package/pages/play.vue
CHANGED
|
@@ -38,7 +38,8 @@ if (__SLIDEV_FEATURE_WAKE_LOCK__)
|
|
|
38
38
|
useWakeLock()
|
|
39
39
|
|
|
40
40
|
if (import.meta.hot) {
|
|
41
|
-
useStyleTag(computed(() =>
|
|
41
|
+
useStyleTag(computed(() => showEditor.value
|
|
42
|
+
? `
|
|
42
43
|
vite-error-overlay {
|
|
43
44
|
--width: calc(100vw - ${isEditorVertical.value ? 0 : editorWidth.value}px);
|
|
44
45
|
--height: calc(100vh - ${isEditorVertical.value ? editorHeight.value : 0}px);
|
|
@@ -49,7 +50,8 @@ if (import.meta.hot) {
|
|
|
49
50
|
height: calc(var(--height) / var(--slidev-slide-scale));
|
|
50
51
|
transform-origin: top left;
|
|
51
52
|
transform: scale(var(--slidev-slide-scale));
|
|
52
|
-
}
|
|
53
|
+
}`
|
|
54
|
+
: '',
|
|
53
55
|
))
|
|
54
56
|
}
|
|
55
57
|
|
package/setup/monaco.ts
CHANGED
|
@@ -51,14 +51,13 @@ class ContextViewService2 extends ContextViewService {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
})
|
|
54
|
+
// Initialize services first, otherwise we can't override them.
|
|
55
|
+
StandaloneServices.initialize({
|
|
56
|
+
contextViewService: new SyncDescriptor(ContextViewService2, [], true),
|
|
57
|
+
})
|
|
59
58
|
|
|
59
|
+
const setup = createSingletonPromise(async () => {
|
|
60
60
|
const defaults = monaco.languages.typescript.typescriptDefaults
|
|
61
|
-
|
|
62
61
|
defaults.setCompilerOptions({
|
|
63
62
|
...defaults.getCompilerOptions(),
|
|
64
63
|
strict: true,
|