@slidev/client 0.46.0 → 0.46.2

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.
@@ -63,19 +63,27 @@ onMounted(() => {
63
63
  watchEffect(() => {
64
64
  if (!el.value)
65
65
  return
66
- const baseTargets = Array.from(el.value.querySelectorAll('.col-align-c > .vlist-t > .vlist-r > .vlist'))
66
+ // KaTeX equations have col-align-XXX as parent
67
+ const equationParents = el.value.querySelectorAll('.mtable > [class*=col-align]')
68
+ if (!equationParents)
69
+ return
70
+
71
+ // For each row we extract the individual equation rows
72
+ const equationRowsOfEachParent = Array.from(equationParents)
73
+ .map(item => Array.from(item.querySelectorAll('.vlist-t > .vlist-r > .vlist > span > .mord')))
74
+ // This list maps rows from different parents to line them up
67
75
  const lines: Element[][] = []
68
- baseTargets.forEach((baseTarget) => {
69
- Array.from(baseTarget.children).forEach((childNode, idx) => {
70
- const realNode = childNode.querySelector('.mord')
71
- if (!realNode)
76
+ for (const equationRowParent of equationRowsOfEachParent) {
77
+ equationRowParent.forEach((equationRow, idx) => {
78
+ if (!equationRow)
72
79
  return
73
80
  if (Array.isArray(lines[idx]))
74
- lines[idx].push(realNode)
81
+ lines[idx].push(equationRow)
75
82
  else
76
- lines[idx] = [realNode]
83
+ lines[idx] = [equationRow]
77
84
  })
78
- })
85
+ }
86
+
79
87
  const startLine = props.startLine
80
88
  const highlights: number[] = parseRangeString(lines.length + startLine - 1, rangeStr.value)
81
89
  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' && keyboardBuffer.value) {
58
+ if (e.key === 'Enter') {
59
59
  e.preventDefault()
60
- go(+keyboardBuffer.value)
61
- keyboardBuffer.value = ''
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.0",
3
+ "version": "0.46.2",
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.9",
24
- "@unocss/reset": "^0.58.0",
25
- "@vueuse/core": "^10.7.0",
26
- "@vueuse/math": "^10.7.0",
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.3",
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
33
  "js-base64": "^3.7.5",
34
34
  "js-yaml": "^4.1.0",
35
35
  "katex": "^0.16.9",
36
- "mermaid": "^10.6.1",
36
+ "mermaid": "^10.7.0",
37
37
  "monaco-editor": "^0.37.1",
38
38
  "nanoid": "^5.0.4",
39
- "prettier": "^3.1.1",
39
+ "prettier": "^3.2.3",
40
40
  "recordrtc": "^5.6.2",
41
41
  "resolve": "^1.22.8",
42
- "unocss": "^0.58.0",
43
- "vite-plugin-windicss": "^1.9.2",
44
- "vue": "^3.3.11",
42
+ "unocss": "^0.58.3",
43
+ "vite-plugin-windicss": "^1.9.3",
44
+ "vue": "^3.4.14",
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.0",
49
- "@slidev/types": "0.46.0"
48
+ "@slidev/types": "0.46.2",
49
+ "@slidev/parser": "0.46.2"
50
50
  },
51
51
  "devDependencies": {
52
- "vite": "^5.0.8"
52
+ "vite": "^5.0.11"
53
53
  }
54
54
  }