@slidev/client 0.43.14 → 0.44.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
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { useHead } from '@vueuse/head'
2
+ import { useHead } from '@unhead/vue'
3
3
  import { computed, ref, watch } from 'vue'
4
4
  import { useLocalStorage } from '@vueuse/core'
5
5
  import { configs } from '../env'
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { useHead } from '@vueuse/head'
2
+ import { useHead } from '@unhead/vue'
3
3
  import { computed, onMounted, reactive, ref, shallowRef, watch } from 'vue'
4
4
  import { useMouse, useWindowFocus } from '@vueuse/core'
5
5
  import { clicks, clicksTotal, currentPage, currentRoute, hasNext, nextRoute, total, useSwipeControls } from '../logic/nav'
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
  import { useStyleTag } from '@vueuse/core'
4
- import { useHead } from '@vueuse/head'
4
+ import { useHead } from '@unhead/vue'
5
5
  import { configs, themeVars } from '../env'
6
6
  import { rawRoutes, total } from '../logic/nav'
7
7
  import NoteDisplay from './NoteDisplay.vue'
@@ -12,8 +12,7 @@ This shows on the left
12
12
  # Right
13
13
  This shows on the right
14
14
  ::bottom::
15
- # Bottom
16
- This shows at bottom, below left and right
15
+ This shows at the bottom, aligned to the end (bottom) of the grid
17
16
  ```
18
17
  -->
19
18
 
@@ -52,8 +51,11 @@ const props = defineProps({
52
51
  grid-template-rows: repeat(2, 1fr);
53
52
  }
54
53
 
55
- .col-header,
56
- .col-bottom { grid-column: -1/1; }
57
- .col-left,
58
- .col-right { grid-column: span 2; }
54
+ .col-header { grid-area: 1 / 1 / 2 / 3; }
55
+ .col-left { grid-area: 2 / 1 / 3 / 2; }
56
+ .col-right { grid-area: 2 / 2 / 3 / 3; }
57
+ .col-bottom {
58
+ align-self: end;
59
+ grid-area: 3 / 1 / 3 / 3;
60
+ }
59
61
  </style>
package/main.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createApp } from 'vue'
2
- import { createHead } from '@vueuse/head'
2
+ import { createHead } from '@unhead/vue'
3
3
  import App from './App.vue'
4
4
  import setupMain from './setup/main'
5
5
  import { router } from './routes'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
- "version": "0.43.14",
3
+ "version": "0.44.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
- "@unocss/reset": "^0.57.2",
24
- "@vueuse/core": "^10.5.0",
25
- "@vueuse/head": "^2.0.0",
26
- "@vueuse/math": "^10.5.0",
23
+ "@unhead/vue": "^1.8.4",
24
+ "@unocss/reset": "^0.57.4",
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",
@@ -36,17 +36,17 @@
36
36
  "mermaid": "^10.6.1",
37
37
  "monaco-editor": "^0.37.1",
38
38
  "nanoid": "^5.0.3",
39
- "prettier": "^3.0.3",
39
+ "prettier": "^3.1.0",
40
40
  "recordrtc": "^5.6.2",
41
41
  "resolve": "^1.22.8",
42
- "unocss": "^0.57.2",
42
+ "unocss": "^0.57.4",
43
43
  "vite-plugin-windicss": "^1.9.1",
44
44
  "vue": "^3.3.8",
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.14",
49
- "@slidev/types": "0.43.14"
48
+ "@slidev/parser": "0.44.0",
49
+ "@slidev/types": "0.44.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "vite": "^4.5.0"
package/setup/root.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /* __imports__ */
2
2
  import { watch } from 'vue'
3
- import { useHead } from '@vueuse/head'
3
+ import { useHead } from '@unhead/vue'
4
4
  import { nanoid } from 'nanoid'
5
5
  import { configs } from '../env'
6
6
  import { initSharedState, onPatch, patch } from '../state/shared'