@slidev/client 0.43.8 → 0.43.10

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.
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <div class="h-full w-full flex items-center justify-center gap-5 lt-md:flex-col">
3
+ <RouterLink
4
+ to="/"
5
+ class="flex flex-col gap-2 items-center justify-center h-40 min-w-40 rounded bg-gray:10 p4 hover:bg-gray/20"
6
+ >
7
+ <carbon:presentation-file class="text-3em op50" />
8
+ Slides
9
+ </RouterLink>
10
+ <RouterLink
11
+ to="/presenter"
12
+ class="flex flex-col gap-2 items-center justify-center h-40 min-w-40 rounded bg-gray:10 p4 hover:bg-gray/20"
13
+ >
14
+ <carbon:user-speaker class="text-3em op50" />
15
+ Presenter
16
+ </RouterLink>
17
+ <RouterLink
18
+ to="/notes"
19
+ class="flex flex-col gap-2 items-center justify-center h-40 min-w-40 rounded bg-gray:10 p4 hover:bg-gray/20"
20
+ >
21
+ <carbon:catalog class="text-3em op50" />
22
+ Notes
23
+ </RouterLink>
24
+ </div>
25
+ </template>
@@ -20,7 +20,6 @@ const { isFullscreen, toggle: toggleFullscreen } = fullscreen
20
20
  const fontSize = useLocalStorage('slidev-notes-font-size', 18)
21
21
  const pageNo = computed(() => sharedState.lastUpdate?.type === 'viewer' ? sharedState.viewerPage : sharedState.page)
22
22
  const currentRoute = computed(() => rawRoutes.find(i => i.path === `${pageNo.value}`))
23
- const nextRoute = computed(() => rawRoutes.find(i => i.path === `${pageNo.value + 1}`))
24
23
 
25
24
  function increaseFontSize() {
26
25
  fontSize.value = fontSize.value + 1
@@ -47,14 +46,6 @@ function decreaseFontSize() {
47
46
  :placeholder="`No notes for Slide ${pageNo}.`"
48
47
  />
49
48
  </div>
50
- <div v-if="nextRoute" class="px-5 py-2 max-h-60 overflow-auto border-t border-gray-400 border-opacity-20">
51
- <NoteDisplay
52
- class="opacity-50"
53
- :note="nextRoute?.meta?.slide?.note"
54
- :note-html="nextRoute?.meta?.slide?.noteHTML"
55
- placeholder="No notes for next slide."
56
- />
57
- </div>
58
49
  <div class="flex-none border-t border-gray-400 border-opacity-20">
59
50
  <div class="flex gap-1 items-center px-6 py-3">
60
51
  <button class="slidev-icon-btn" @click="toggleFullscreen">
@@ -1,6 +1,5 @@
1
1
  import { useVModel } from '@vueuse/core'
2
- import type { Ref } from 'vue'
3
- import { defineComponent, h, provide, ref, toRef } from 'vue'
2
+ import { computed, defineComponent, h, provide, ref, toRef } from 'vue'
4
3
  import type { RenderContext } from '@slidev/types'
5
4
  import { injectionActive, injectionClicks, injectionClicksDisabled, injectionClicksElements, injectionCurrentPage, injectionOrderMap, injectionRenderContext, injectionRoute } from '../constants'
6
5
 
@@ -48,11 +47,22 @@ export default defineComponent({
48
47
 
49
48
  clicksElements.value.length = 0
50
49
 
50
+ const clicksWithDisable = computed({
51
+ get() {
52
+ if (clicksDisabled.value)
53
+ return 9999999
54
+ return +clicks.value
55
+ },
56
+ set(value) {
57
+ clicks.value = value
58
+ },
59
+ })
60
+
51
61
  provide(injectionRoute, props.route as any)
52
62
  provide(injectionCurrentPage, ref(+props.route?.path))
53
63
  provide(injectionRenderContext, ref(props.renderContext as RenderContext))
54
64
  provide(injectionActive, toRef(props, 'active'))
55
- provide(injectionClicks, clicks as Ref<number>)
65
+ provide(injectionClicks, clicksWithDisable)
56
66
  provide(injectionClicksDisabled, clicksDisabled)
57
67
  provide(injectionClicksElements, clicksElements as any)
58
68
  provide(injectionOrderMap, clicksOrderMap as any)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
- "version": "0.43.8",
3
+ "version": "0.43.10",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -11,6 +11,10 @@
11
11
  "url": "https://github.com/slidevjs/slidev"
12
12
  },
13
13
  "bugs": "https://github.com/slidevjs/slidev/issues",
14
+ "exports": {
15
+ "./package.json": "./package.json",
16
+ "./*": "./*"
17
+ },
14
18
  "engines": {
15
19
  "node": ">=18.0.0"
16
20
  },
@@ -41,8 +45,8 @@
41
45
  "vue-router": "^4.2.5",
42
46
  "vue-starport": "^0.4.0",
43
47
  "windicss": "^3.5.6",
44
- "@slidev/parser": "0.43.8",
45
- "@slidev/types": "0.43.8"
48
+ "@slidev/parser": "0.43.10",
49
+ "@slidev/types": "0.43.10"
46
50
  },
47
51
  "devDependencies": {
48
52
  "vite": "^4.5.0"
package/routes.ts CHANGED
@@ -42,12 +42,19 @@ if (__SLIDEV_FEATURE_PRESENTER__) {
42
42
  return { path: '' }
43
43
  }
44
44
  routes.push({ path: '/presenter/print', component: () => import('./internals/PresenterPrint.vue') })
45
- routes.push({
46
- name: 'notes',
47
- path: '/notes',
48
- component: () => import('./internals/NotesView.vue'),
49
- beforeEnter: passwordGuard,
50
- })
45
+ if (__SLIDEV_HAS_SERVER__) {
46
+ routes.push({
47
+ name: 'entry',
48
+ path: '/entry',
49
+ component: () => import('./internals/EntrySelect.vue'),
50
+ })
51
+ routes.push({
52
+ name: 'notes',
53
+ path: '/notes',
54
+ component: () => import('./internals/NotesView.vue'),
55
+ beforeEnter: passwordGuard,
56
+ })
57
+ }
51
58
  routes.push({
52
59
  name: 'presenter',
53
60
  path: '/presenter/:no',
@@ -61,7 +68,9 @@ if (__SLIDEV_FEATURE_PRESENTER__) {
61
68
  }
62
69
 
63
70
  export const router = createRouter({
64
- history: __SLIDEV_HASH_ROUTE__ ? createWebHashHistory(import.meta.env.BASE_URL) : createWebHistory(import.meta.env.BASE_URL),
71
+ history: __SLIDEV_HASH_ROUTE__
72
+ ? createWebHashHistory(import.meta.env.BASE_URL)
73
+ : createWebHistory(import.meta.env.BASE_URL),
65
74
  routes,
66
75
  })
67
76