@slidev/client 0.42.2 → 0.42.4
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/CodeBlockWrapper.vue +10 -16
- package/composables/useNav.ts +1 -1
- package/logic/nav.ts +1 -1
- package/logic/overview.ts +1 -3
- package/package.json +7 -7
- package/styles/layouts-base.css +4 -0
|
@@ -23,12 +23,13 @@ const props = defineProps({
|
|
|
23
23
|
ranges: {
|
|
24
24
|
default: () => [],
|
|
25
25
|
},
|
|
26
|
-
|
|
27
|
-
type:
|
|
28
|
-
default:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
startLine: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 1,
|
|
29
|
+
},
|
|
30
|
+
lines: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: configs.lineNumbers,
|
|
32
33
|
},
|
|
33
34
|
at: {
|
|
34
35
|
type: Number,
|
|
@@ -78,7 +79,7 @@ onMounted(() => {
|
|
|
78
79
|
return
|
|
79
80
|
const isDuoTone = el.value.querySelector('.shiki-dark')
|
|
80
81
|
const targets = isDuoTone ? Array.from(el.value.querySelectorAll('.shiki')) : [el.value]
|
|
81
|
-
const startLine = props.
|
|
82
|
+
const startLine = props.startLine
|
|
82
83
|
for (const target of targets) {
|
|
83
84
|
const lines = Array.from(target.querySelectorAll('.line'))
|
|
84
85
|
const highlights: number[] = parseRangeString(lines.length + startLine - 1, rangeStr.value)
|
|
@@ -110,25 +111,18 @@ function copyCode() {
|
|
|
110
111
|
if (code)
|
|
111
112
|
copy(code)
|
|
112
113
|
}
|
|
113
|
-
|
|
114
|
-
function showLines() {
|
|
115
|
-
if (props.options.lines == null)
|
|
116
|
-
return configs.lineNumbers ?? false
|
|
117
|
-
else
|
|
118
|
-
return props.options.lines ?? false
|
|
119
|
-
}
|
|
120
114
|
</script>
|
|
121
115
|
|
|
122
116
|
<template>
|
|
123
117
|
<div
|
|
124
118
|
ref="el" class="slidev-code-wrapper relative group"
|
|
125
119
|
:class="{
|
|
126
|
-
'slidev-code-line-numbers':
|
|
120
|
+
'slidev-code-line-numbers': props.lines,
|
|
127
121
|
}"
|
|
128
122
|
:style="{
|
|
129
123
|
'max-height': props.maxHeight,
|
|
130
124
|
'overflow-y': props.maxHeight ? 'scroll' : undefined,
|
|
131
|
-
'--start': props.
|
|
125
|
+
'--start': props.startLine,
|
|
132
126
|
}"
|
|
133
127
|
>
|
|
134
128
|
<slot />
|
package/composables/useNav.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { rawRoutes } from '../routes'
|
|
|
8
8
|
|
|
9
9
|
export function useNav(route: ComputedRef<RouteRecordRaw | RouteLocationNormalizedLoaded>): SlidevContextNav {
|
|
10
10
|
const path = computed(() => route.value.path)
|
|
11
|
-
const total = computed(() => rawRoutes.length
|
|
11
|
+
const total = computed(() => rawRoutes.length)
|
|
12
12
|
|
|
13
13
|
const currentPage = computed(() => parseInt(path.value.split(/\//g).slice(-1)[0]) || 1)
|
|
14
14
|
const currentPath = computed(() => getPath(currentPage.value))
|
package/logic/nav.ts
CHANGED
|
@@ -32,7 +32,7 @@ export const presenterPassword = computed(() => route.value.query.password)
|
|
|
32
32
|
export const showPresenter = computed(() => !isPresenter.value && (!configs.remote || presenterPassword.value === configs.remote))
|
|
33
33
|
|
|
34
34
|
export const queryClicks = useRouteQuery('clicks', '0')
|
|
35
|
-
export const total = computed(() => rawRoutes.length
|
|
35
|
+
export const total = computed(() => rawRoutes.length)
|
|
36
36
|
export const path = computed(() => route.value.path)
|
|
37
37
|
|
|
38
38
|
export const currentPage = computed(() => parseInt(path.value.split(/\//g).slice(-1)[0]) || 1)
|
package/logic/overview.ts
CHANGED
|
@@ -3,9 +3,7 @@ import { rawRoutes } from '../routes'
|
|
|
3
3
|
|
|
4
4
|
// To have same format(.value) as max, wrap it with ref.
|
|
5
5
|
const min = ref(1)
|
|
6
|
-
|
|
7
|
-
// so we need to subtract 1.
|
|
8
|
-
const max = computed(() => rawRoutes.length - 1)
|
|
6
|
+
const max = computed(() => rawRoutes.length)
|
|
9
7
|
|
|
10
8
|
export const currentOverviewPage = ref(0)
|
|
11
9
|
export const overviewRowCount = ref(0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.4",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"node": ">=14.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@antfu/utils": "^0.7.
|
|
19
|
-
"@unocss/reset": "^0.
|
|
18
|
+
"@antfu/utils": "^0.7.4",
|
|
19
|
+
"@unocss/reset": "^0.53.0",
|
|
20
20
|
"@vueuse/core": "^10.1.2",
|
|
21
21
|
"@vueuse/head": "^1.1.26",
|
|
22
22
|
"@vueuse/math": "^10.1.2",
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
"js-base64": "^3.7.5",
|
|
30
30
|
"js-yaml": "^4.1.0",
|
|
31
31
|
"katex": "^0.16.7",
|
|
32
|
-
"mermaid": "^10.2.
|
|
32
|
+
"mermaid": "^10.2.2",
|
|
33
33
|
"monaco-editor": "^0.37.1",
|
|
34
34
|
"nanoid": "^4.0.2",
|
|
35
35
|
"prettier": "^2.8.8",
|
|
36
36
|
"recordrtc": "^5.6.2",
|
|
37
37
|
"resolve": "^1.22.2",
|
|
38
|
-
"unocss": "^0.
|
|
38
|
+
"unocss": "^0.53.0",
|
|
39
39
|
"vite-plugin-windicss": "^1.9.0",
|
|
40
40
|
"vue": "^3.3.4",
|
|
41
41
|
"vue-router": "^4.2.2",
|
|
42
42
|
"vue-starport": "^0.3.0",
|
|
43
43
|
"windicss": "^3.5.6",
|
|
44
|
-
"@slidev/parser": "0.42.
|
|
45
|
-
"@slidev/types": "0.42.
|
|
44
|
+
"@slidev/parser": "0.42.4",
|
|
45
|
+
"@slidev/types": "0.42.4"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"vite": "^4.3.9"
|