@slidev/client 52.6.0 → 52.8.0
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/ShikiMagicMove.vue +27 -3
- package/constants.ts +2 -0
- package/index.ts +1 -0
- package/internals/TitleIcon.vue +1 -0
- package/package.json +14 -14
- package/setup/code-runners.ts +2 -0
- package/state/storage.ts +0 -5
|
@@ -34,6 +34,10 @@ const props = defineProps({
|
|
|
34
34
|
type: String,
|
|
35
35
|
default: '',
|
|
36
36
|
},
|
|
37
|
+
duration: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: configs.magicMoveDuration,
|
|
40
|
+
},
|
|
37
41
|
})
|
|
38
42
|
|
|
39
43
|
const steps = JSON.parse(lz.decompressFromBase64(props.stepsLz)) as KeyedTokensInfo[]
|
|
@@ -42,6 +46,8 @@ const { isPrintMode } = useNav()
|
|
|
42
46
|
const id = makeId()
|
|
43
47
|
|
|
44
48
|
const stepIndex = ref(0)
|
|
49
|
+
// Used to skip the animation on the first tick.
|
|
50
|
+
const isFirstTick = ref(true)
|
|
45
51
|
const container = ref<HTMLElement>()
|
|
46
52
|
|
|
47
53
|
const showCopyButton = computed(() => {
|
|
@@ -89,6 +95,7 @@ onMounted(() => {
|
|
|
89
95
|
const clickInfo = clicks.calculateSince(props.at, clickCounts - 1)
|
|
90
96
|
clicks.register(id, clickInfo)
|
|
91
97
|
|
|
98
|
+
let cancelTick: () => void = () => { }
|
|
92
99
|
watch(
|
|
93
100
|
() => clicks.current,
|
|
94
101
|
() => {
|
|
@@ -107,9 +114,24 @@ onMounted(() => {
|
|
|
107
114
|
currentClickSum += current.length || 1
|
|
108
115
|
}
|
|
109
116
|
|
|
117
|
+
// It seems ticks may not be executed in order. Cancel previous ones, because
|
|
118
|
+
// clicks.current is first 0 then immediately updated when refreshing the slide.
|
|
119
|
+
cancelTick()
|
|
120
|
+
let isCanceled = false
|
|
121
|
+
cancelTick = () => {
|
|
122
|
+
isCanceled = true
|
|
123
|
+
}
|
|
124
|
+
|
|
110
125
|
nextTick(async () => {
|
|
126
|
+
if (isCanceled) {
|
|
127
|
+
return
|
|
128
|
+
}
|
|
111
129
|
stepIndex.value = step
|
|
112
|
-
|
|
130
|
+
if (isFirstTick.value) {
|
|
131
|
+
nextTick(() => {
|
|
132
|
+
isFirstTick.value = false
|
|
133
|
+
})
|
|
134
|
+
}
|
|
113
135
|
await sleep(0)
|
|
114
136
|
|
|
115
137
|
const pre = container.value?.querySelector('.shiki') as HTMLElement
|
|
@@ -158,8 +180,10 @@ onMounted(() => {
|
|
|
158
180
|
:animate="!isPrintMode"
|
|
159
181
|
:options="{
|
|
160
182
|
globalScale: scale * zoom,
|
|
161
|
-
//
|
|
162
|
-
|
|
183
|
+
// Use duration 0 to skip animation instead of using the animate prop,
|
|
184
|
+
// because moving from non-animated to animated causes issues with
|
|
185
|
+
// new elements. Unfortunately, this causes a flash.
|
|
186
|
+
duration: isFirstTick ? 0 : $props.duration,
|
|
163
187
|
stagger: 1,
|
|
164
188
|
}"
|
|
165
189
|
/>
|
package/constants.ts
CHANGED
|
@@ -66,6 +66,7 @@ export const HEADMATTER_FIELDS = [
|
|
|
66
66
|
'monacoTypesSource',
|
|
67
67
|
'monacoTypesAdditionalPackages',
|
|
68
68
|
'monacoRunAdditionalDeps',
|
|
69
|
+
'monacoRunUseStrict',
|
|
69
70
|
'remoteAssets',
|
|
70
71
|
'selectable',
|
|
71
72
|
'record',
|
|
@@ -85,4 +86,5 @@ export const HEADMATTER_FIELDS = [
|
|
|
85
86
|
'wakeLock',
|
|
86
87
|
'seoMeta',
|
|
87
88
|
'notesAutoRuby',
|
|
89
|
+
'magicMoveDuration',
|
|
88
90
|
]
|
package/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ export type { DrawingsState } from './state/drawings'
|
|
|
23
23
|
export { drawingState, onDrawingUpdate } from './state/drawings'
|
|
24
24
|
export type { SharedState } from './state/shared'
|
|
25
25
|
export { onSharedUpdate, sharedState } from './state/shared'
|
|
26
|
+
export { lockShortcuts } from './state/storage'
|
|
26
27
|
|
|
27
28
|
export {
|
|
28
29
|
addSyncMethod,
|
package/internals/TitleIcon.vue
CHANGED
|
@@ -61,6 +61,7 @@ const builtinIcons: Record<string, string> = {
|
|
|
61
61
|
'.yml': 'i-vscode-icons:file-type-light-yaml',
|
|
62
62
|
'.yaml': 'i-vscode-icons:file-type-light-yaml',
|
|
63
63
|
'.php': 'i-vscode-icons:file-type-php',
|
|
64
|
+
'.svg': 'i-vscode-icons:file-type-svg',
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
function matchIcon(title: string) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "52.
|
|
4
|
+
"version": "52.8.0",
|
|
5
5
|
"description": "Presentation slides for developers",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"@iconify-json/carbon": "^1.2.14",
|
|
33
33
|
"@iconify-json/ph": "^1.2.2",
|
|
34
34
|
"@iconify-json/svg-spinners": "^1.2.4",
|
|
35
|
-
"@shikijs/engine-javascript": "^3.
|
|
36
|
-
"@shikijs/monaco": "^3.
|
|
37
|
-
"@shikijs/vitepress-twoslash": "^3.
|
|
35
|
+
"@shikijs/engine-javascript": "^3.15.0",
|
|
36
|
+
"@shikijs/monaco": "^3.15.0",
|
|
37
|
+
"@shikijs/vitepress-twoslash": "^3.15.0",
|
|
38
38
|
"@slidev/rough-notation": "^0.1.0",
|
|
39
39
|
"@typescript/ata": "^0.9.8",
|
|
40
40
|
"@unhead/vue": "^2.0.19",
|
|
41
|
-
"@unocss/reset": "^66.5.
|
|
41
|
+
"@unocss/reset": "^66.5.5",
|
|
42
42
|
"@vueuse/core": "^14.0.0",
|
|
43
43
|
"@vueuse/math": "^14.0.0",
|
|
44
44
|
"@vueuse/motion": "^3.0.3",
|
|
@@ -48,23 +48,23 @@
|
|
|
48
48
|
"fuse.js": "^7.1.0",
|
|
49
49
|
"katex": "^0.16.25",
|
|
50
50
|
"lz-string": "^1.5.0",
|
|
51
|
-
"mermaid": "^11.12.
|
|
52
|
-
"monaco-editor": "^0.
|
|
51
|
+
"mermaid": "^11.12.1",
|
|
52
|
+
"monaco-editor": "^0.54.0",
|
|
53
53
|
"nanotar": "^0.2.0",
|
|
54
54
|
"pptxgenjs": "^4.0.1",
|
|
55
55
|
"prettier": "^3.6.2",
|
|
56
56
|
"recordrtc": "^5.6.2",
|
|
57
|
-
"shiki": "^3.
|
|
58
|
-
"shiki-magic-move": "^1.2.
|
|
57
|
+
"shiki": "^3.15.0",
|
|
58
|
+
"shiki-magic-move": "^1.2.1",
|
|
59
59
|
"typescript": "^5.9.3",
|
|
60
|
-
"unocss": "^66.5.
|
|
61
|
-
"vue": "^3.5.
|
|
60
|
+
"unocss": "^66.5.5",
|
|
61
|
+
"vue": "^3.5.24",
|
|
62
62
|
"vue-router": "^4.6.3",
|
|
63
63
|
"yaml": "^2.8.1",
|
|
64
|
-
"@slidev/parser": "52.
|
|
65
|
-
"@slidev/types": "52.
|
|
64
|
+
"@slidev/parser": "52.8.0",
|
|
65
|
+
"@slidev/types": "52.8.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"vite": "^7.
|
|
68
|
+
"vite": "^7.2.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/setup/code-runners.ts
CHANGED
|
@@ -5,6 +5,7 @@ import deps from '#slidev/monaco-run-deps'
|
|
|
5
5
|
import setups from '#slidev/setups/code-runners'
|
|
6
6
|
import { createSingletonPromise } from '@antfu/utils'
|
|
7
7
|
import { ref } from 'vue'
|
|
8
|
+
import { configs } from '../env'
|
|
8
9
|
|
|
9
10
|
export default createSingletonPromise(async () => {
|
|
10
11
|
const runners: Record<string, CodeRunner> = {
|
|
@@ -63,6 +64,7 @@ function runJavaScript(code: string): CodeRunnerOutputs {
|
|
|
63
64
|
vmConsole.clear = () => result.value.length = 0
|
|
64
65
|
try {
|
|
65
66
|
const safeJS = `return async (console, __slidev_import, __slidev_on_error) => {
|
|
67
|
+
${configs.monacoRunUseStrict ? `"use strict";` : ''}
|
|
66
68
|
try {
|
|
67
69
|
${sanitizeJS(code)}
|
|
68
70
|
} catch (e) {
|
package/state/storage.ts
CHANGED
|
@@ -17,11 +17,6 @@ export const disableTransition = ref(false)
|
|
|
17
17
|
|
|
18
18
|
export const shortcutsEnabled = ref(true)
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Whether the keyboard shortcuts are enabled. Readonly,
|
|
22
|
-
* use `lockShortcuts` and `releaseShortcuts` to modify.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
20
|
// Use a locking mechanism to support multiple simultaneous locks
|
|
26
21
|
// and avoid race conditions. Race conditions may occur, for example,
|
|
27
22
|
// when locking shortcuts on editor focus and moving from one editor
|