@slidev/client 0.44.0 → 0.46.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/README.md CHANGED
@@ -7,4 +7,3 @@ Client code for [Slidev](https://sli.dev). Shipped with [`@slidev/cli`](https://
7
7
  ## License
8
8
 
9
9
  MIT License © 2021 [Anthony Fu](https://github.com/antfu)
10
-
@@ -73,7 +73,7 @@ onMounted(() => {
73
73
  const targets = isDuoTone ? Array.from(el.value.querySelectorAll('.shiki')) : [el.value]
74
74
  const startLine = props.startLine
75
75
  for (const target of targets) {
76
- const lines = Array.from(target.querySelectorAll('.line'))
76
+ const lines = Array.from(target.querySelectorAll('code > .line'))
77
77
  const highlights: number[] = parseRangeString(lines.length + startLine - 1, rangeStr.value)
78
78
  lines.forEach((line, idx) => {
79
79
  const highlighted = highlights.includes(idx + startLine)
@@ -118,6 +118,24 @@ export default defineComponent({
118
118
  if (defaults.length === 1 && listTags.includes(defaults[0].type as string) && Array.isArray(defaults[0].children))
119
119
  return h(defaults[0], {}, [mapChildren(defaults[0].children)[0]])
120
120
 
121
+ if (defaults.length === 1 && defaults[0].type as string === 'table') {
122
+ const tableNode = defaults[0]
123
+ if (Array.isArray(tableNode.children)) {
124
+ return h(tableNode, {}, tableNode.children.map((i) => {
125
+ if (!isVNode(i)) {
126
+ return i
127
+ }
128
+ else {
129
+ if (i.type === 'tbody' && Array.isArray(i.children))
130
+ return h(i, {}, [mapChildren(i.children)[0]])
131
+
132
+ else
133
+ return h(i)
134
+ }
135
+ }))
136
+ }
137
+ }
138
+
121
139
  return mapChildren(defaults)[0]
122
140
  },
123
141
  })
@@ -4,7 +4,7 @@ import { useDraggable, useLocalStorage } from '@vueuse/core'
4
4
 
5
5
  const props = defineProps<{
6
6
  storageKey?: string
7
- initial?: { x: number; y: number }
7
+ initial?: { x: number, y: number }
8
8
  }>()
9
9
 
10
10
  const el = ref<HTMLElement | null>(null)
@@ -19,6 +19,7 @@ import Goto from './Goto.vue'
19
19
  import SlidesShow from './SlidesShow.vue'
20
20
  import SlideWrapper from './SlideWrapper'
21
21
  import DrawingControls from './DrawingControls.vue'
22
+ import HiddenText from './HiddenText.vue'
22
23
 
23
24
  const main = ref<HTMLDivElement>()
24
25
 
@@ -20,7 +20,7 @@ const style = computed(() => handleBackground(props.image, false, props.backgrou
20
20
 
21
21
  <template>
22
22
  <div class="grid grid-cols-2 w-full h-full auto-rows-fr">
23
- <div class="w-full w-full" :style="style" />
23
+ <div class="w-full h-full" :style="style" />
24
24
  <div class="slidev-layout default" :class="props.class">
25
25
  <slot />
26
26
  </div>
@@ -23,6 +23,6 @@ const style = computed(() => handleBackground(props.image, false, props.backgrou
23
23
  <div class="slidev-layout default" :class="props.class">
24
24
  <slot />
25
25
  </div>
26
- <div class="w-full w-full" :style="style" />
26
+ <div class="w-full h-full" :style="style" />
27
27
  </div>
28
28
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
- "version": "0.44.0",
3
+ "version": "0.46.0",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -19,11 +19,11 @@
19
19
  "node": ">=18.0.0"
20
20
  },
21
21
  "dependencies": {
22
- "@antfu/utils": "^0.7.6",
23
- "@unhead/vue": "^1.8.4",
24
- "@unocss/reset": "^0.57.4",
25
- "@vueuse/core": "^10.6.1",
26
- "@vueuse/math": "^10.6.1",
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",
27
27
  "@vueuse/motion": "^2.0.0",
28
28
  "codemirror": "^5.65.5",
29
29
  "defu": "^6.1.3",
@@ -35,20 +35,20 @@
35
35
  "katex": "^0.16.9",
36
36
  "mermaid": "^10.6.1",
37
37
  "monaco-editor": "^0.37.1",
38
- "nanoid": "^5.0.3",
39
- "prettier": "^3.1.0",
38
+ "nanoid": "^5.0.4",
39
+ "prettier": "^3.1.1",
40
40
  "recordrtc": "^5.6.2",
41
41
  "resolve": "^1.22.8",
42
- "unocss": "^0.57.4",
43
- "vite-plugin-windicss": "^1.9.1",
44
- "vue": "^3.3.8",
42
+ "unocss": "^0.58.0",
43
+ "vite-plugin-windicss": "^1.9.2",
44
+ "vue": "^3.3.11",
45
45
  "vue-router": "^4.2.5",
46
46
  "vue-starport": "^0.4.0",
47
47
  "windicss": "^3.5.6",
48
- "@slidev/parser": "0.44.0",
49
- "@slidev/types": "0.44.0"
48
+ "@slidev/parser": "0.46.0",
49
+ "@slidev/types": "0.46.0"
50
50
  },
51
51
  "devDependencies": {
52
- "vite": "^4.5.0"
52
+ "vite": "^5.0.8"
53
53
  }
54
54
  }
package/styles/code.css CHANGED
@@ -2,6 +2,7 @@ html.dark:root {
2
2
  color-scheme: dark;
3
3
  }
4
4
 
5
+ /* Shiki */
5
6
  html.dark .shiki-light {
6
7
  display: none;
7
8
  }
@@ -10,6 +11,45 @@ html:not(.dark) .shiki-dark {
10
11
  display: none;
11
12
  }
12
13
 
14
+ .shiki-container {
15
+ @apply relative flex flex-col;
16
+ }
17
+
18
+ .shiki-container > .shiki {
19
+ @apply h-full;
20
+ }
21
+
22
+ /* Shikiji */
23
+ html.dark .shikiji {
24
+ color: var(--shiki-dark, inherit);
25
+ background: var(--shiki-dark-bg, inherit);
26
+ --twoslash-popup-bg: var(--shiki-dark-bg, inherit);
27
+ }
28
+
29
+ html.dark .shikiji span {
30
+ color: var(--shiki-dark);
31
+ }
32
+
33
+ html:not(.dark) .shikiji {
34
+ color: var(--shiki-light, inherit);
35
+ background: var(--shiki-light-bg, inherit);
36
+ --twoslash-popup-bg: var(--shiki-light-bg, inherit);
37
+ }
38
+
39
+ html:not(.dark) .shikiji span {
40
+ color: var(--shiki-light);
41
+ }
42
+
43
+ .shikiji.twoslash {
44
+ /* Do not set overflow so the hover popover can be displayed */
45
+ overflow: inherit;
46
+ }
47
+
48
+ .twoslash-meta-line.twoslash-popover-line {
49
+ margin-top: -10px;
50
+ }
51
+
52
+ /* Slidev */
13
53
  .slidev-code-wrapper {
14
54
  margin: var(--slidev-code-margin) !important;
15
55
  scroll-padding: var(--slidev-code-padding);
@@ -31,14 +71,7 @@ html:not(.dark) .shiki-dark {
31
71
  }
32
72
  .slidev-code .line.dishonored {
33
73
  opacity: 0.3;
34
- }
35
-
36
- .shiki-container {
37
- @apply relative flex flex-col;
38
- }
39
-
40
- .shiki-container > .shiki {
41
- @apply h-full;
74
+ pointer-events: none;
42
75
  }
43
76
 
44
77
  .slidev-code-line-numbers .slidev-code code {
@@ -52,12 +85,12 @@ html:not(.dark) .shiki-dark {
52
85
  @apply w-4 mr-6 inline-block text-right text-gray-400 dark:text-gray-600;
53
86
  }
54
87
 
55
- /* revert windicss preflight for katex */
88
+ /* Revert CSS reset for KaTex */
56
89
  .katex,
57
90
  .katex :after,
58
91
  .katex :before {
59
92
  border-color: currentColor;
60
93
  }
61
94
 
62
- /* codemirror */
95
+ /* CodeMirror */
63
96
  .CodeMirror pre.CodeMirror-placeholder { opacity: 0.4; }