@slidev/client 0.42.2 → 0.42.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.
- package/builtin/CodeBlockWrapper.vue +10 -16
- package/package.json +3 -3
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.3",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
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.3",
|
|
45
|
+
"@slidev/types": "0.42.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"vite": "^4.3.9"
|