@slidev/client 0.43.15 → 0.45.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.
@@ -50,16 +50,25 @@ export default defineComponent({
50
50
  ]])
51
51
  }
52
52
 
53
+ const openAllTopLevelSlots = <T extends VNodeArrayChildren | VNode[]>(children: T): T => {
54
+ return children.flatMap((i) => {
55
+ if (isVNode(i) && typeof i.type === 'symbol' && Array.isArray(i.children))
56
+ return openAllTopLevelSlots(i.children)
57
+ else
58
+ return [i]
59
+ }) as T
60
+ }
61
+
53
62
  let defaults = this.$slots.default?.()
54
63
 
55
64
  if (!defaults)
56
65
  return
57
66
 
58
- defaults = toArray(defaults)
67
+ defaults = openAllTopLevelSlots(toArray(defaults))
59
68
 
60
69
  const mapSubList = (children: VNodeArrayChildren, depth = 1): [VNodeArrayChildren, number] => {
61
70
  let idx = 0
62
- const vNodes = children.map((i) => {
71
+ const vNodes = openAllTopLevelSlots(children).map((i) => {
63
72
  if (!isVNode(i))
64
73
  return i
65
74
  if (listTags.includes(i.type as string) && Array.isArray(i.children)) {
@@ -76,7 +85,7 @@ export default defineComponent({
76
85
  let globalIdx = 0
77
86
  const mapChildren = (children: VNodeArrayChildren, depth = 1): [VNodeArrayChildren, number] => {
78
87
  let idx = 0
79
- const vNodes = children.map((i) => {
88
+ const vNodes = openAllTopLevelSlots(children).map((i) => {
80
89
  if (!isVNode(i) || i.type === Comment)
81
90
  return i
82
91
  const directive = idx % this.every === 0 ? click : after
@@ -109,6 +118,24 @@ export default defineComponent({
109
118
  if (defaults.length === 1 && listTags.includes(defaults[0].type as string) && Array.isArray(defaults[0].children))
110
119
  return h(defaults[0], {}, [mapChildren(defaults[0].children)[0]])
111
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
+
112
139
  return mapChildren(defaults)[0]
113
140
  },
114
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
 
@@ -11,6 +11,8 @@ This shows on the left
11
11
  ::right::
12
12
  # Right
13
13
  This shows on the right
14
+ ::bottom::
15
+ This shows at the bottom, aligned to the end (bottom) of the grid
14
16
  ```
15
17
  -->
16
18
 
@@ -36,6 +38,9 @@ const props = defineProps({
36
38
  <div class="col-right" :class="props.class">
37
39
  <slot name="right" />
38
40
  </div>
41
+ <div class="col-bottom" :class="props.class">
42
+ <slot name="bottom" />
43
+ </div>
39
44
  </div>
40
45
  </template>
41
46
 
@@ -49,4 +54,8 @@ const props = defineProps({
49
54
  .col-header { grid-area: 1 / 1 / 2 / 3; }
50
55
  .col-left { grid-area: 2 / 1 / 3 / 2; }
51
56
  .col-right { grid-area: 2 / 2 / 3 / 3; }
57
+ .col-bottom {
58
+ align-self: end;
59
+ grid-area: 3 / 1 / 3 / 3;
60
+ }
52
61
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
- "version": "0.43.15",
3
+ "version": "0.45.0",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -20,10 +20,10 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@antfu/utils": "^0.7.6",
23
- "@unhead/vue": "^1.8.3",
24
- "@unocss/reset": "^0.57.3",
25
- "@vueuse/core": "^10.5.0",
26
- "@vueuse/math": "^10.5.0",
23
+ "@unhead/vue": "^1.8.8",
24
+ "@unocss/reset": "^0.58.0",
25
+ "@vueuse/core": "^10.6.1",
26
+ "@vueuse/math": "^10.6.1",
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.0.3",
38
+ "nanoid": "^5.0.4",
39
+ "prettier": "^3.1.0",
40
40
  "recordrtc": "^5.6.2",
41
41
  "resolve": "^1.22.8",
42
- "unocss": "^0.57.3",
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.9",
45
45
  "vue-router": "^4.2.5",
46
46
  "vue-starport": "^0.4.0",
47
47
  "windicss": "^3.5.6",
48
- "@slidev/parser": "0.43.15",
49
- "@slidev/types": "0.43.15"
48
+ "@slidev/parser": "0.45.0",
49
+ "@slidev/types": "0.45.0"
50
50
  },
51
51
  "devDependencies": {
52
- "vite": "^4.5.0"
52
+ "vite": "^5.0.5"
53
53
  }
54
54
  }