@slidev/client 0.46.1 → 0.46.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.
|
@@ -34,6 +34,10 @@ const props = defineProps({
|
|
|
34
34
|
type: Number,
|
|
35
35
|
default: 1,
|
|
36
36
|
},
|
|
37
|
+
at: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: undefined,
|
|
40
|
+
},
|
|
37
41
|
})
|
|
38
42
|
|
|
39
43
|
const clicks = inject(injectionClicks)
|
|
@@ -44,7 +48,7 @@ const el = ref<HTMLDivElement>()
|
|
|
44
48
|
const vm = getCurrentInstance()
|
|
45
49
|
|
|
46
50
|
onMounted(() => {
|
|
47
|
-
const prev = elements?.value.length
|
|
51
|
+
const prev = props.at == null ? elements?.value.length : props.at
|
|
48
52
|
const index = computed(() => {
|
|
49
53
|
if (disabled?.value)
|
|
50
54
|
return props.ranges.length - 1
|
|
@@ -63,19 +67,27 @@ onMounted(() => {
|
|
|
63
67
|
watchEffect(() => {
|
|
64
68
|
if (!el.value)
|
|
65
69
|
return
|
|
66
|
-
|
|
70
|
+
// KaTeX equations have col-align-XXX as parent
|
|
71
|
+
const equationParents = el.value.querySelectorAll('.mtable > [class*=col-align]')
|
|
72
|
+
if (!equationParents)
|
|
73
|
+
return
|
|
74
|
+
|
|
75
|
+
// For each row we extract the individual equation rows
|
|
76
|
+
const equationRowsOfEachParent = Array.from(equationParents)
|
|
77
|
+
.map(item => Array.from(item.querySelectorAll(':scope > .vlist-t > .vlist-r > .vlist > span > .mord')))
|
|
78
|
+
// This list maps rows from different parents to line them up
|
|
67
79
|
const lines: Element[][] = []
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (!realNode)
|
|
80
|
+
for (const equationRowParent of equationRowsOfEachParent) {
|
|
81
|
+
equationRowParent.forEach((equationRow, idx) => {
|
|
82
|
+
if (!equationRow)
|
|
72
83
|
return
|
|
73
84
|
if (Array.isArray(lines[idx]))
|
|
74
|
-
lines[idx].push(
|
|
85
|
+
lines[idx].push(equationRow)
|
|
75
86
|
else
|
|
76
|
-
lines[idx] = [
|
|
87
|
+
lines[idx] = [equationRow]
|
|
77
88
|
})
|
|
78
|
-
}
|
|
89
|
+
}
|
|
90
|
+
|
|
79
91
|
const startLine = props.startLine
|
|
80
92
|
const highlights: number[] = parseRangeString(lines.length + startLine - 1, rangeStr.value)
|
|
81
93
|
lines.forEach((line, idx) => {
|
|
@@ -55,10 +55,15 @@ useEventListener('keypress', (e) => {
|
|
|
55
55
|
keyboardBuffer.value = ''
|
|
56
56
|
return
|
|
57
57
|
}
|
|
58
|
-
if (e.key === 'Enter'
|
|
58
|
+
if (e.key === 'Enter') {
|
|
59
59
|
e.preventDefault()
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
if (keyboardBuffer.value) {
|
|
61
|
+
go(+keyboardBuffer.value)
|
|
62
|
+
keyboardBuffer.value = ''
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
go(currentOverviewPage.value)
|
|
66
|
+
}
|
|
62
67
|
return
|
|
63
68
|
}
|
|
64
69
|
const num = Number.parseInt(e.key.replace(/[^0-9]/g, ''))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.3",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,35 +20,35 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@antfu/utils": "^0.7.7",
|
|
23
|
-
"@unhead/vue": "^1.8.
|
|
24
|
-
"@unocss/reset": "^0.58.
|
|
25
|
-
"@vueuse/core": "^10.7.
|
|
26
|
-
"@vueuse/math": "^10.7.
|
|
23
|
+
"@unhead/vue": "^1.8.10",
|
|
24
|
+
"@unocss/reset": "^0.58.3",
|
|
25
|
+
"@vueuse/core": "^10.7.2",
|
|
26
|
+
"@vueuse/math": "^10.7.2",
|
|
27
27
|
"@vueuse/motion": "^2.0.0",
|
|
28
28
|
"codemirror": "^5.65.5",
|
|
29
|
-
"defu": "^6.1.
|
|
29
|
+
"defu": "^6.1.4",
|
|
30
30
|
"drauu": "^0.3.7",
|
|
31
31
|
"file-saver": "^2.0.5",
|
|
32
32
|
"fuse.js": "^7.0.0",
|
|
33
|
-
"js-base64": "^3.7.
|
|
33
|
+
"js-base64": "^3.7.6",
|
|
34
34
|
"js-yaml": "^4.1.0",
|
|
35
35
|
"katex": "^0.16.9",
|
|
36
|
-
"mermaid": "^10.
|
|
36
|
+
"mermaid": "^10.7.0",
|
|
37
37
|
"monaco-editor": "^0.37.1",
|
|
38
38
|
"nanoid": "^5.0.4",
|
|
39
|
-
"prettier": "^3.
|
|
39
|
+
"prettier": "^3.2.4",
|
|
40
40
|
"recordrtc": "^5.6.2",
|
|
41
41
|
"resolve": "^1.22.8",
|
|
42
|
-
"unocss": "^0.58.
|
|
43
|
-
"vite-plugin-windicss": "^1.9.
|
|
44
|
-
"vue": "^3.
|
|
42
|
+
"unocss": "^0.58.3",
|
|
43
|
+
"vite-plugin-windicss": "^1.9.3",
|
|
44
|
+
"vue": "^3.4.15",
|
|
45
45
|
"vue-router": "^4.2.5",
|
|
46
46
|
"vue-starport": "^0.4.0",
|
|
47
47
|
"windicss": "^3.5.6",
|
|
48
|
-
"@slidev/parser": "0.46.
|
|
49
|
-
"@slidev/types": "0.46.
|
|
48
|
+
"@slidev/parser": "0.46.3",
|
|
49
|
+
"@slidev/types": "0.46.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"vite": "^5.0.
|
|
52
|
+
"vite": "^5.0.12"
|
|
53
53
|
}
|
|
54
54
|
}
|