@slidev/client 0.49.0-beta.4 → 0.49.0-beta.6

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.
@@ -3,12 +3,11 @@ 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 { useSwipeControls } from '../composables/useSwipeControls'
6
- import { decreasePresenterFontSize, increasePresenterFontSize, presenterLayout, presenterNotesFontSize, showEditor, showOverview, showPresenterCursor } from '../state'
7
- import { configs } from '../env'
6
+ import { decreasePresenterFontSize, increasePresenterFontSize, presenterLayout, presenterNotesFontSize, showEditor, showPresenterCursor } from '../state'
7
+ import { slidesTitle } from '../env'
8
8
  import { sharedState } from '../state/shared'
9
9
  import { registerShortcuts } from '../logic/shortcuts'
10
10
  import { onContextMenu } from '../logic/contextMenu'
11
- import { getSlideClass } from '../utils'
12
11
  import { useTimer } from '../logic/utils'
13
12
  import { createFixedClicks } from '../composables/useClicks'
14
13
  import SlideWrapper from '../internals/SlideWrapper.vue'
@@ -44,10 +43,7 @@ const {
44
43
  } = useNav()
45
44
  const { isDrawing } = useDrawings()
46
45
 
47
- const slideTitle = configs.titleTemplate.replace('%s', configs.title || 'Slidev')
48
- useHead({
49
- title: `Presenter - ${slideTitle}`,
50
- })
46
+ useHead({ title: `Presenter - ${slidesTitle}` })
51
47
 
52
48
  const notesEditing = ref(false)
53
49
 
@@ -113,12 +109,11 @@ onMounted(() => {
113
109
  <div ref="main" class="relative grid-section main flex flex-col">
114
110
  <SlideContainer
115
111
  key="main"
116
- class="h-full w-full p-2 lg:p-4 flex-auto"
112
+ class="p-2 lg:p-4 flex-auto"
113
+ is-main
117
114
  @contextmenu="onContextMenu"
118
115
  >
119
- <template #default>
120
- <SlidesShow render-context="presenter" />
121
- </template>
116
+ <SlidesShow render-context="presenter" />
122
117
  </SlideContainer>
123
118
  <ClicksSlider
124
119
  :key="currentSlideRoute?.no"
@@ -130,16 +125,10 @@ onMounted(() => {
130
125
  </div>
131
126
  </div>
132
127
  <div class="relative grid-section next flex flex-col p-2 lg:p-4">
133
- <SlideContainer
134
- v-if="nextFrame && nextFrameClicksCtx"
135
- key="next"
136
- class="h-full w-full"
137
- >
128
+ <SlideContainer v-if="nextFrame && nextFrameClicksCtx" key="next">
138
129
  <SlideWrapper
139
- :is="nextFrame[0].component!"
140
130
  :key="nextFrame[0].no"
141
131
  :clicks-context="nextFrameClicksCtx"
142
- :class="getSlideClass(nextFrame[0])"
143
132
  :route="nextFrame[0]"
144
133
  render-context="previewNext"
145
134
  />
@@ -148,8 +137,7 @@ onMounted(() => {
148
137
  Next
149
138
  </div>
150
139
  </div>
151
- <!-- Notes -->
152
- <div v-if="__DEV__ && __SLIDEV_FEATURE_EDITOR__ && SideEditor && showEditor" class="grid-section note of-auto">
140
+ <div v-if="SideEditor && showEditor" class="grid-section note of-auto">
153
141
  <SideEditor />
154
142
  </div>
155
143
  <div v-else class="grid-section note grid grid-rows-[1fr_min-content] overflow-hidden">
@@ -206,12 +194,12 @@ onMounted(() => {
206
194
  <div class="progress-bar">
207
195
  <div
208
196
  class="progress h-3px bg-primary transition-all"
209
- :style="{ width: `${(currentSlideNo - 1) / (total - 1) * 100}%` }"
197
+ :style="{ width: `${(currentSlideNo - 1) / (total - 1) * 100 + 1}%` }"
210
198
  />
211
199
  </div>
212
200
  </div>
213
201
  <Goto />
214
- <QuickOverview v-model="showOverview" />
202
+ <QuickOverview />
215
203
  <ContextMenu />
216
204
  </template>
217
205
 
@@ -227,10 +215,6 @@ onMounted(() => {
227
215
  opacity: 1;
228
216
  }
229
217
 
230
- .section-title {
231
- --uno: px-4 py-2 text-xl;
232
- }
233
-
234
218
  .grid-container {
235
219
  --uno: bg-gray/20;
236
220
  height: 100%;
@@ -303,4 +287,4 @@ onMounted(() => {
303
287
  .grid-section.bottom {
304
288
  grid-area: bottom;
305
289
  }
306
- </style>../composables/drawings
290
+ </style>
package/setup/root.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { computed, getCurrentInstance, reactive, ref, shallowRef, watch } from 'vue'
2
2
  import { useHead } from '@unhead/vue'
3
3
  import { useRouter } from 'vue-router'
4
- import { configs } from '../env'
4
+ import { configs, slidesTitle } from '../env'
5
5
  import { initSharedState, onPatch, patch } from '../state/shared'
6
6
  import { initDrawingState } from '../state/drawings'
7
7
  import { TRUST_ORIGINS, injectionClicksContext, injectionCurrentPage, injectionRenderContext, injectionSlidevContext } from '../constants'
@@ -51,8 +51,6 @@ export default function setupRoot() {
51
51
  for (const setup of setups)
52
52
  setup()
53
53
 
54
- const title = configs.titleTemplate.replace('%s', configs.title || 'Slidev')
55
-
56
54
  const {
57
55
  clicksContext,
58
56
  currentSlideNo,
@@ -62,12 +60,12 @@ export default function setupRoot() {
62
60
  } = useNav()
63
61
 
64
62
  useHead({
65
- title,
63
+ title: slidesTitle,
66
64
  htmlAttrs: configs.htmlAttrs,
67
65
  })
68
66
 
69
- initSharedState(`${title} - shared`)
70
- initDrawingState(`${title} - drawings`)
67
+ initSharedState(`${slidesTitle} - shared`)
68
+ initDrawingState(`${slidesTitle} - drawings`)
71
69
 
72
70
  const id = `${location.origin}_${makeId()}`
73
71
 
package/styles/index.css CHANGED
@@ -49,6 +49,10 @@ html {
49
49
  user-select: none !important;
50
50
  }
51
51
 
52
+ .slidev-vclick-display-none {
53
+ display: none !important;
54
+ }
55
+
52
56
  .slidev-vclick-fade {
53
57
  opacity: 0.5;
54
58
  }
@@ -116,3 +120,7 @@ html {
116
120
  .rough-annotation {
117
121
  transform: scale(calc(1 / var(--slidev-slide-scale)));
118
122
  }
123
+
124
+ #twoslash-container {
125
+ position: fixed;
126
+ }
package/uno.config.ts CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  transformerVariantGroup,
10
10
  } from 'unocss'
11
11
  import { variantMatcher } from '@unocss/preset-mini/utils'
12
+ import extractorMdc from '@unocss/extractor-mdc'
12
13
 
13
14
  export default defineConfig({
14
15
  safelist: [
@@ -48,4 +49,7 @@ export default defineConfig({
48
49
  transformerDirectives({ enforce: 'pre' }),
49
50
  transformerVariantGroup(),
50
51
  ],
52
+ extractors: [
53
+ extractorMdc(),
54
+ ],
51
55
  })