@slidev/client 0.43.13 → 0.43.14

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.
@@ -10,8 +10,17 @@ export function useViewTransition() {
10
10
 
11
11
  const supportViewTransition = typeof document !== 'undefined' && 'startViewTransition' in document
12
12
 
13
- router.beforeResolve((from, to) => {
14
- if (!(from.meta.transition === 'view-transition' || to.meta.transition === 'view-transition')) {
13
+ router.beforeResolve((to, from) => {
14
+ const fromNo = from.meta.slide?.no
15
+ const toNo = to.meta.slide?.no
16
+ if (
17
+ !(
18
+ fromNo !== undefined && toNo !== undefined && (
19
+ (from.meta.transition === 'view-transition' && fromNo < toNo)
20
+ || (to.meta.transition === 'view-transition' && toNo < fromNo)
21
+ )
22
+ )
23
+ ) {
15
24
  isViewTransition.value = false
16
25
  return
17
26
  }
@@ -141,7 +141,7 @@ onMounted(() => {
141
141
  <div v-if="__DEV__ && __SLIDEV_FEATURE_EDITOR__ && Editor && showEditor" class="grid-section note of-auto">
142
142
  <Editor />
143
143
  </div>
144
- <div v-else class="grid-section note grid grid-rows-[1fr_min-content]">
144
+ <div v-else class="grid-section note grid grid-rows-[1fr_min-content] overflow-hidden">
145
145
  <NoteEditor
146
146
  v-if="__DEV__"
147
147
  class="w-full max-w-full h-full overflow-auto p-2 lg:p-4"
@@ -8,6 +8,7 @@ import PrintSlideClick from './PrintSlideClick.vue'
8
8
  const props = defineProps<{ route: RouteRecordRaw }>()
9
9
 
10
10
  const clicksElements = ref(props.route.meta?.__clicksElements || [])
11
+ const clicks = computed(() => props.route.meta?.clicks ?? clicksElements.value.length)
11
12
 
12
13
  const route = computed(() => props.route)
13
14
  const nav = useNav(route)
@@ -16,6 +17,6 @@ const nav = useNav(route)
16
17
  <template>
17
18
  <PrintSlideClick v-model:clicks-elements="clicksElements" :clicks="0" :nav="nav" :route="route" />
18
19
  <template v-if="!isClicksDisabled">
19
- <PrintSlideClick v-for="i of (clicksElements.length)" :key="i" :clicks="i" :nav="nav" :route="route" />
20
+ <PrintSlideClick v-for="i of clicks" :key="i" :clicks="i" :nav="nav" :route="route" />
20
21
  </template>
21
22
  </template>
@@ -11,6 +11,9 @@ This shows on the left
11
11
  ::right::
12
12
  # Right
13
13
  This shows on the right
14
+ ::bottom::
15
+ # Bottom
16
+ This shows at bottom, below left and right
14
17
  ```
15
18
  -->
16
19
 
@@ -36,6 +39,9 @@ const props = defineProps({
36
39
  <div class="col-right" :class="props.class">
37
40
  <slot name="right" />
38
41
  </div>
42
+ <div class="col-bottom" :class="props.class">
43
+ <slot name="bottom" />
44
+ </div>
39
45
  </div>
40
46
  </template>
41
47
 
@@ -46,7 +52,8 @@ const props = defineProps({
46
52
  grid-template-rows: repeat(2, 1fr);
47
53
  }
48
54
 
49
- .col-header { grid-area: 1 / 1 / 2 / 3; }
50
- .col-left { grid-area: 2 / 1 / 3 / 2; }
51
- .col-right { grid-area: 2 / 2 / 3 / 3; }
55
+ .col-header,
56
+ .col-bottom { grid-column: -1/1; }
57
+ .col-left,
58
+ .col-right { grid-column: span 2; }
52
59
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
- "version": "0.43.13",
3
+ "version": "0.43.14",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@antfu/utils": "^0.7.6",
23
- "@unocss/reset": "^0.57.1",
23
+ "@unocss/reset": "^0.57.2",
24
24
  "@vueuse/core": "^10.5.0",
25
25
  "@vueuse/head": "^2.0.0",
26
26
  "@vueuse/math": "^10.5.0",
@@ -33,20 +33,20 @@
33
33
  "js-base64": "^3.7.5",
34
34
  "js-yaml": "^4.1.0",
35
35
  "katex": "^0.16.9",
36
- "mermaid": "^10.6.0",
36
+ "mermaid": "^10.6.1",
37
37
  "monaco-editor": "^0.37.1",
38
- "nanoid": "^5.0.2",
38
+ "nanoid": "^5.0.3",
39
39
  "prettier": "^3.0.3",
40
40
  "recordrtc": "^5.6.2",
41
41
  "resolve": "^1.22.8",
42
- "unocss": "^0.57.1",
42
+ "unocss": "^0.57.2",
43
43
  "vite-plugin-windicss": "^1.9.1",
44
- "vue": "^3.3.7",
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/types": "0.43.13",
49
- "@slidev/parser": "0.43.13"
48
+ "@slidev/parser": "0.43.14",
49
+ "@slidev/types": "0.43.14"
50
50
  },
51
51
  "devDependencies": {
52
52
  "vite": "^4.5.0"
package/routes.ts CHANGED
@@ -82,6 +82,7 @@ declare module 'vue-router' {
82
82
  class?: string
83
83
  clicks?: number
84
84
  transition?: string | TransitionGroupProps | undefined
85
+ preload?: boolean
85
86
 
86
87
  // slide info
87
88
  slide?: {
package/setup/root.ts CHANGED
@@ -8,6 +8,7 @@ import { initDrawingState } from '../state/drawings'
8
8
  import { clicks, currentPage, getPath, isNotesViewer, isPresenter } from '../logic/nav'
9
9
  import { router } from '../routes'
10
10
  import { TRUST_ORIGINS } from '../constants'
11
+ import { skipTransition } from '../composables/hmr'
11
12
 
12
13
  export default function setupRoot() {
13
14
  // @ts-expect-error injected in runtime
@@ -58,6 +59,7 @@ export default function setupRoot() {
58
59
  if (!routePath.match(/^\/(\d+|presenter)\/?/))
59
60
  return
60
61
  if (state.lastUpdate?.type === 'presenter' && (+state.page !== +currentPage.value || +clicks.value !== +state.clicks)) {
62
+ skipTransition.value = false
61
63
  router.replace({
62
64
  path: getPath(state.page),
63
65
  query: {