@slidev/client 0.47.5 → 0.48.0-beta.1

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.
@@ -13,7 +13,7 @@ import {
13
13
  } from '../logic/drawings'
14
14
  import VerticalDivider from './VerticalDivider.vue'
15
15
  import Draggable from './Draggable.vue'
16
- import HiddenText from './HiddenText.vue'
16
+ import IconButton from './IconButton.vue'
17
17
 
18
18
  function undo() {
19
19
  drauu.undo()
@@ -40,81 +40,69 @@ function setBrushColor(color: typeof brush.color) {
40
40
  :initial-x="10"
41
41
  :initial-y="10"
42
42
  >
43
- <button class="slidev-icon-btn" :class="{ shallow: drawingMode !== 'stylus' }" @click="setDrawingMode('stylus')">
44
- <HiddenText text="Draw with stylus" />
43
+ <IconButton title="Draw with stylus" :class="{ shallow: drawingMode !== 'stylus' }" @click="setDrawingMode('stylus')">
45
44
  <carbon:pen />
46
- </button>
47
- <button class="slidev-icon-btn" :class="{ shallow: drawingMode !== 'line' }" @click="setDrawingMode('line')">
48
- <HiddenText text="Draw a line" />
45
+ </IconButton>
46
+ <IconButton title="Draw a line" :class="{ shallow: drawingMode !== 'line' }" @click="setDrawingMode('line')">
49
47
  <svg width="1em" height="1em" class="-mt-0.5" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">
50
48
  <path d="M21.71 3.29a1 1 0 0 0-1.42 0l-18 18a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l18-18a1 1 0 0 0 0-1.42z" fill="currentColor" />
51
49
  </svg>
52
- </button>
53
- <button class="slidev-icon-btn" :class="{ shallow: drawingMode !== 'arrow' }" @click="setDrawingMode('arrow')">
54
- <HiddenText text="Draw an arrow" />
50
+ </IconButton>
51
+ <IconButton title="Draw an arrow" :class="{ shallow: drawingMode !== 'arrow' }" @click="setDrawingMode('arrow')">
55
52
  <carbon:arrow-up-right />
56
- </button>
57
- <button class="slidev-icon-btn" :class="{ shallow: drawingMode !== 'ellipse' }" @click="setDrawingMode('ellipse')">
58
- <HiddenText text="Draw an ellipse" />
53
+ </IconButton>
54
+ <IconButton title="Draw an ellipse" :class="{ shallow: drawingMode !== 'ellipse' }" @click="setDrawingMode('ellipse')">
59
55
  <carbon:radio-button />
60
- </button>
61
- <button class="slidev-icon-btn" :class="{ shallow: drawingMode !== 'rectangle' }" @click="setDrawingMode('rectangle')">
62
- <HiddenText text="Draw a rectangle" />
56
+ </IconButton>
57
+ <IconButton title="Draw a rectangle" :class="{ shallow: drawingMode !== 'rectangle' }" @click="setDrawingMode('rectangle')">
63
58
  <carbon:checkbox />
64
- </button>
59
+ </IconButton>
65
60
  <!-- TODO: not sure why it's not working! -->
66
- <!-- <button class="slidev-icon-btn" :class="{ shallow: drawingMode != 'eraseLine' }" @click="setDrawingMode('eraseLine')">
67
- <HiddenText text="Erase" />
61
+ <!-- <IconButton title="Erase" :class="{ shallow: drawingMode != 'eraseLine' }" @click="setDrawingMode('eraseLine')">
68
62
  <carbon:erase />
69
- </button> -->
63
+ </IconButton> -->
70
64
 
71
65
  <VerticalDivider />
72
66
 
73
- <button
67
+ <IconButton
74
68
  v-for="color of brushColors"
75
69
  :key="color"
76
- class="slidev-icon-btn"
70
+ title="Set brush color"
77
71
  :class="brush.color === color ? 'active' : 'shallow'"
78
72
  @click="setBrushColor(color)"
79
73
  >
80
- <HiddenText text="Set brush color" />
81
74
  <div
82
75
  class="w-6 h-6 transition-all transform border border-gray-400/50"
83
76
  :class="brush.color !== color ? 'rounded-1/2 scale-85' : 'rounded-md'"
84
77
  :style="drawingEnabled ? { background: color } : { borderColor: color }"
85
78
  />
86
- </button>
79
+ </IconButton>
87
80
 
88
81
  <VerticalDivider />
89
82
 
90
- <button class="slidev-icon-btn" :class="{ disabled: !canUndo }" @click="undo()">
91
- <HiddenText text="Undo" />
83
+ <IconButton title="Undo" :class="{ disabled: !canUndo }" @click="undo()">
92
84
  <carbon:undo />
93
- </button>
94
- <button class="slidev-icon-btn" :class="{ disabled: !canRedo }" @click="redo()">
95
- <HiddenText text="Redo" />
85
+ </IconButton>
86
+ <IconButton title="Redo" :class="{ disabled: !canRedo }" @click="redo()">
96
87
  <carbon:redo />
97
- </button>
98
- <button class="slidev-icon-btn" :class="{ disabled: !canClear }" @click="clearDrauu()">
99
- <HiddenText text="Delete" />
88
+ </IconButton>
89
+ <IconButton title="Delete" :class="{ disabled: !canClear }" @click="clearDrauu()">
100
90
  <carbon:delete />
101
- </button>
91
+ </IconButton>
102
92
 
103
93
  <VerticalDivider />
104
- <button class="slidev-icon-btn" :class="{ shallow: !drawingPinned }" @click="drawingPinned = !drawingPinned">
105
- <HiddenText :text="drawingPinned ? 'Unpin drawing' : 'Pin drawing'" />
94
+ <IconButton :title="drawingPinned ? 'Unpin drawing' : 'Pin drawing'" :class="{ shallow: !drawingPinned }" @click="drawingPinned = !drawingPinned">
106
95
  <carbon:pin-filled v-show="drawingPinned" class="transform -rotate-45" />
107
96
  <carbon:pin v-show="!drawingPinned" />
108
- </button>
109
- <button
97
+ </IconButton>
98
+ <IconButton
110
99
  v-if="drawingEnabled"
111
- class="slidev-icon-btn"
100
+ :title="drawingPinned ? 'Drawing pinned' : 'Drawing unpinned'"
112
101
  :class="{ shallow: !drawingEnabled }"
113
102
  @click="drawingEnabled = !drawingEnabled"
114
103
  >
115
- <HiddenText :text="drawingPinned ? 'Drawing pinned' : 'Drawing unpinned'" />
116
104
  <carbon:error v-show="drawingPinned" />
117
105
  <carbon:close-outline v-show="!drawingPinned" />
118
- </button>
106
+ </IconButton>
119
107
  </Draggable>
120
108
  </template>
@@ -1,14 +1,14 @@
1
1
  <script setup lang="ts">
2
2
  import { throttledWatch, useEventListener } from '@vueuse/core'
3
- import { computed, onMounted, ref, watch } from 'vue'
4
- import { activeElement, editorWidth, isInputting, showEditor } from '../state'
3
+ import { computed, nextTick, onMounted, ref, watch } from 'vue'
4
+ import { activeElement, editorHeight, editorWidth, isInputting, showEditor, isEditorVertical as vertical } from '../state'
5
5
  import { useCodeMirror } from '../setup/codemirror'
6
6
  import { currentSlideId, openInEditor } from '../logic/nav'
7
7
  import { useDynamicSlideInfo } from '../logic/note'
8
- import HiddenText from './HiddenText.vue'
8
+ import IconButton from './IconButton.vue'
9
9
 
10
10
  const props = defineProps<{
11
- resize: boolean
11
+ resize?: boolean
12
12
  }>()
13
13
 
14
14
  const tab = ref<'content' | 'note'>('content')
@@ -56,8 +56,8 @@ useEventListener('keydown', (e) => {
56
56
  }
57
57
  })
58
58
 
59
- onMounted(() => {
60
- useCodeMirror(
59
+ onMounted(async () => {
60
+ const contentEditor = await useCodeMirror(
61
61
  contentInput,
62
62
  computed({
63
63
  get() { return content.value },
@@ -77,7 +77,7 @@ onMounted(() => {
77
77
  },
78
78
  )
79
79
 
80
- useCodeMirror(
80
+ const noteEditor = await useCodeMirror(
81
81
  noteInput,
82
82
  computed({
83
83
  get() { return note.value },
@@ -94,14 +94,26 @@ onMounted(() => {
94
94
  fencedCodeBlockDefaultMode: 'javascript',
95
95
  },
96
96
  )
97
+
98
+ watch([tab, vertical], () => {
99
+ nextTick(() => {
100
+ if (tab.value === 'content')
101
+ contentEditor.refresh()
102
+ else
103
+ noteEditor.refresh()
104
+ })
105
+ })
97
106
  })
98
107
 
99
108
  const handlerDown = ref(false)
100
109
  function onHandlerDown() {
101
110
  handlerDown.value = true
102
111
  }
103
- function updateWidth(v: number) {
104
- editorWidth.value = Math.min(Math.max(200, v), window.innerWidth - 200)
112
+ function updateSize(v?: number) {
113
+ if (vertical.value)
114
+ editorHeight.value = Math.min(Math.max(300, v ?? editorHeight.value), window.innerHeight - 200)
115
+ else
116
+ editorWidth.value = Math.min(Math.max(318, v ?? editorWidth.value), window.innerWidth - 200)
105
117
  }
106
118
  function switchTab(newTab: typeof tab.value) {
107
119
  tab.value = newTab
@@ -111,14 +123,17 @@ function switchTab(newTab: typeof tab.value) {
111
123
 
112
124
  if (props.resize) {
113
125
  useEventListener('pointermove', (e) => {
114
- if (handlerDown.value)
115
- updateWidth(window.innerWidth - e.pageX)
126
+ if (handlerDown.value) {
127
+ updateSize(vertical.value
128
+ ? window.innerHeight - e.pageY
129
+ : window.innerWidth - e.pageX)
130
+ }
116
131
  }, { passive: true })
117
132
  useEventListener('pointerup', () => {
118
133
  handlerDown.value = false
119
134
  })
120
135
  useEventListener('resize', () => {
121
- updateWidth(editorWidth.value)
136
+ updateSize()
122
137
  })
123
138
  }
124
139
 
@@ -134,46 +149,61 @@ throttledWatch(
134
149
 
135
150
  <template>
136
151
  <div
137
- v-if="resize"
138
- class="fixed h-full top-0 bottom-0 w-10px bg-gray-400 select-none opacity-0 hover:opacity-10 z-100"
139
- :class="{ '!opacity-30': handlerDown }"
140
- :style="{ right: `${editorWidth - 5}px`, cursor: 'col-resize' }"
141
- @pointerdown="onHandlerDown"
152
+ v-if="resize" class="fixed bg-gray-400 select-none opacity-0 hover:opacity-10 z-100"
153
+ :class="vertical ? 'left-0 right-0 w-full h-10px' : 'top-0 bottom-0 w-10px h-full'" :style="{
154
+ opacity: handlerDown ? '0.3' : undefined,
155
+ bottom: vertical ? `${editorHeight - 5}px` : undefined,
156
+ right: !vertical ? `${editorWidth - 5}px` : undefined,
157
+ cursor: vertical ? 'row-resize' : 'col-resize',
158
+ }" @pointerdown="onHandlerDown"
142
159
  />
143
160
  <div
144
161
  class="shadow bg-main p-4 grid grid-rows-[max-content_1fr] h-full overflow-hidden"
145
162
  :class="resize ? 'border-l border-gray-400 border-opacity-20' : ''"
146
- :style="resize ? { width: `${editorWidth}px` } : {}"
163
+ :style="resize ? {
164
+ height: vertical ? `${editorHeight}px` : undefined,
165
+ width: !vertical ? `${editorWidth}px` : undefined,
166
+ } : {}"
147
167
  >
148
168
  <div class="flex pb-2 text-xl -mt-1">
149
169
  <div class="mr-4 rounded flex">
150
- <button class="slidev-icon-btn" :class="tab === 'content' ? 'text-$slidev-theme-primary' : ''" @click="switchTab('content')">
151
- <HiddenText text="Switch to content tab" />
170
+ <IconButton
171
+ title="Switch to content tab" :class="tab === 'content' ? 'text-$slidev-theme-primary' : ''"
172
+ @click="switchTab('content')"
173
+ >
152
174
  <carbon:account />
153
- </button>
154
- <button class="slidev-icon-btn" :class="tab === 'note' ? 'text-$slidev-theme-primary' : ''" @click="switchTab('note')">
155
- <HiddenText text="Switch to notes tab" />
175
+ </IconButton>
176
+ <IconButton
177
+ title="Switch to notes tab" :class="tab === 'note' ? 'text-$slidev-theme-primary' : ''"
178
+ @click="switchTab('note')"
179
+ >
156
180
  <carbon:align-box-bottom-right />
157
- </button>
181
+ </IconButton>
158
182
  </div>
159
183
  <span class="text-2xl pt-1">
160
184
  {{ tab === 'content' ? 'Slide' : 'Notes' }}
161
185
  </span>
162
186
  <div class="flex-auto" />
163
- <button class="slidev-icon-btn" @click="openInEditor()">
164
- <HiddenText text="Open in editor" />
187
+ <template v-if="resize">
188
+ <IconButton v-if="vertical" title="Dock to right" @click="vertical = false">
189
+ <carbon:open-panel-right />
190
+ </IconButton>
191
+ <IconButton v-else title="Dock to bottom" @click="vertical = true">
192
+ <carbon:open-panel-bottom />
193
+ </IconButton>
194
+ </template>
195
+ <IconButton title="Open in editor" @click="openInEditor()">
165
196
  <carbon:launch />
166
- </button>
167
- <button class="slidev-icon-btn" @click="close">
168
- <HiddenText text="Close" />
197
+ </IconButton>
198
+ <IconButton title="Close" @click="close">
169
199
  <carbon:close />
170
- </button>
200
+ </IconButton>
171
201
  </div>
172
- <div class="h-full overflow-auto">
173
- <div v-show="tab === 'content'" class="h-full overflow-auto">
202
+ <div class="overflow-hidden">
203
+ <div v-show="tab === 'content'" class="w-full h-full">
174
204
  <textarea ref="contentInput" placeholder="Create slide content..." />
175
205
  </div>
176
- <div v-show="tab === 'note'" class="h-full overflow-auto">
206
+ <div v-show="tab === 'note'" class="w-full h-full">
177
207
  <textarea ref="noteInput" placeholder="Write some notes..." />
178
208
  </div>
179
209
  </div>
@@ -182,6 +212,6 @@ throttledWatch(
182
212
 
183
213
  <style lang="postcss">
184
214
  .CodeMirror {
185
- @apply px-3 py-2 h-full overflow-auto bg-transparent font-mono text-sm z-0;
215
+ @apply px-3 py-2 h-full overflow-hidden bg-transparent font-mono text-sm z-0;
186
216
  }
187
217
  </style>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ import { defineProps } from 'vue'
3
+
4
+ defineProps<{
5
+ title: string
6
+ }>()
7
+ </script>
8
+
9
+ <template>
10
+ <button class="slidev-icon-btn" :title="title" v-bind="$attrs">
11
+ <span class="sr-only">{{ title }}</span>
12
+ <slot />
13
+ </button>
14
+ </template>
@@ -8,7 +8,7 @@ import { configs } from '../env'
8
8
  import Settings from './Settings.vue'
9
9
  import MenuButton from './MenuButton.vue'
10
10
  import VerticalDivider from './VerticalDivider.vue'
11
- import HiddenText from './HiddenText.vue'
11
+ import IconButton from './IconButton.vue'
12
12
 
13
13
  // @ts-expect-error virtual module
14
14
  import CustomNavControls from '/@slidev/custom-nav-controls'
@@ -52,47 +52,27 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
52
52
  :class="barStyle"
53
53
  @mouseleave="onMouseLeave"
54
54
  >
55
- <button v-if="!isEmbedded" class="slidev-icon-btn" @click="toggleFullscreen">
56
- <template v-if="isFullscreen">
57
- <HiddenText text="Close fullscreen" />
58
- <carbon:minimize />
59
- </template>
60
- <template v-else>
61
- <HiddenText text="Enter fullscreen" />
62
- <carbon:maximize />
63
- </template>
64
- </button>
65
-
66
- <button class="slidev-icon-btn" :class="{ disabled: !hasPrev }" @click="prev">
67
- <HiddenText text="Go to previous slide" />
55
+ <IconButton v-if="!isEmbedded" :title="isFullscreen ? 'Close fullscreen' : 'Enter fullscreen'" @click="toggleFullscreen">
56
+ <carbon:minimize v-if="isFullscreen" />
57
+ <carbon:maximize v-else />
58
+ </IconButton>
59
+ <IconButton :class="{ disabled: !hasPrev }" title="Go to previous slide" @click="prev">
68
60
  <carbon:arrow-left />
69
- </button>
70
-
71
- <button class="slidev-icon-btn" :class="{ disabled: !hasNext }" title="Next" @click="next">
72
- <HiddenText text="Go to next slide" />
61
+ </IconButton>
62
+ <IconButton :class="{ disabled: !hasNext }" title="Go to next slide" @click="next">
73
63
  <carbon:arrow-right />
74
- </button>
75
-
76
- <button v-if="!isEmbedded" class="slidev-icon-btn" title="Slides overview" @click="toggleOverview()">
77
- <HiddenText text="Show slide overview" />
64
+ </IconButton>
65
+ <IconButton v-if="!isEmbedded" title="Show slide overview" @click="toggleOverview()">
78
66
  <carbon:apps />
79
- </button>
80
-
81
- <button
67
+ </IconButton>
68
+ <IconButton
82
69
  v-if="!isColorSchemaConfigured"
83
- class="slidev-icon-btn"
84
- title="Toggle dark mode"
70
+ :title="isDark ? 'Switch to light mode theme' : 'Switch to dark mode theme'"
85
71
  @click="toggleDark()"
86
72
  >
87
- <template v-if="isDark">
88
- <HiddenText text="Switch to light theme" />
89
- <carbon-moon />
90
- </template>
91
- <template v-else>
92
- <HiddenText text="Switch to dark mode theme" />
93
- <carbon-sun />
94
- </template>
95
- </button>
73
+ <carbon-moon v-if="isDark" />
74
+ <carbon-sun v-else />
75
+ </IconButton>
96
76
 
97
77
  <VerticalDivider />
98
78
 
@@ -102,33 +82,25 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
102
82
  <VerticalDivider />
103
83
  </template>
104
84
 
105
- <button
85
+ <IconButton
106
86
  v-if="isPresenter"
107
- class="slidev-icon-btn"
108
- title="Show presenter cursor"
87
+ :title="showPresenterCursor ? 'Hide presenter cursor' : 'Show presenter cursor'"
109
88
  @click="showPresenterCursor = !showPresenterCursor"
110
89
  >
111
- <template v-if="showPresenterCursor">
112
- <HiddenText text="Hide presenter cursor" />
113
- <ph-cursor-fill />
114
- </template>
115
- <template v-else>
116
- <HiddenText text="Show presenter cursor" />
117
- <ph-cursor-duotone />
118
- </template>
119
- </button>
90
+ <ph-cursor-fill v-if="showPresenterCursor" />
91
+ <ph-cursor-duotone v-else />
92
+ </IconButton>
120
93
  </template>
121
94
 
122
95
  <template v-if="__SLIDEV_FEATURE_DRAWINGS__ && (!configs.drawings.presenterOnly || isPresenter) && !isEmbedded">
123
- <button class="slidev-icon-btn relative" title="Drawing" @click="drawingEnabled = !drawingEnabled">
124
- <HiddenText v-if="drawingEnabled" :text="drawingEnabled ? 'Hide drawing toolbar' : 'Show drawing toolbar'" />
96
+ <IconButton class="relative" :title="drawingEnabled ? 'Hide drawing toolbar' : 'Show drawing toolbar'" @click="drawingEnabled = !drawingEnabled">
125
97
  <carbon:pen />
126
98
  <div
127
99
  v-if="drawingEnabled"
128
100
  class="absolute left-1 right-1 bottom-0 h-0.7 rounded-full"
129
101
  :style="{ background: brush.color }"
130
102
  />
131
- </button>
103
+ </IconButton>
132
104
  <VerticalDivider />
133
105
  </template>
134
106
 
@@ -140,43 +112,40 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
140
112
  <carbon:user-speaker />
141
113
  </RouterLink>
142
114
 
143
- <button
115
+ <IconButton
144
116
  v-if="__DEV__ && __SLIDEV_FEATURE_EDITOR__"
145
- class="slidev-icon-btn <md:hidden"
117
+ :title="showEditor ? 'Hide editor' : 'Show editor'"
118
+ class="<md:hidden"
146
119
  @click="showEditor = !showEditor"
147
120
  >
148
- <HiddenText :text="showEditor ? 'Hide editor' : 'Show editor'" />
149
121
  <carbon:text-annotation-toggle />
150
- </button>
122
+ </IconButton>
151
123
 
152
- <button v-if="isPresenter" class="slidev-icon-btn" title="Toggle Presenter Layout" @click="togglePresenterLayout">
124
+ <IconButton v-if="isPresenter" title="Toggle Presenter Layout" @click="togglePresenterLayout">
153
125
  <carbon:template />
154
126
  {{ presenterLayout }}
155
- </button>
127
+ </IconButton>
156
128
  </template>
157
129
  <template v-if="!__DEV__">
158
- <button v-if="configs.download" class="slidev-icon-btn" @click="downloadPDF">
159
- <HiddenText text="Download as PDF" />
130
+ <IconButton v-if="configs.download" title="Download as PDF" @click="downloadPDF">
160
131
  <carbon:download />
161
- </button>
132
+ </IconButton>
162
133
  </template>
163
134
 
164
- <button
135
+ <IconButton
165
136
  v-if="!isPresenter && configs.info && !isEmbedded"
166
- class="slidev-icon-btn"
137
+ title="Show info"
167
138
  @click="showInfoDialog = !showInfoDialog"
168
139
  >
169
- <HiddenText text="Show info" />
170
140
  <carbon:information />
171
- </button>
141
+ </IconButton>
172
142
 
173
143
  <template v-if="!isPresenter && !isEmbedded">
174
144
  <MenuButton>
175
145
  <template #button>
176
- <button class="slidev-icon-btn">
177
- <HiddenText text="Adjust settings" />
146
+ <IconButton title="Adjust settings">
178
147
  <carbon:settings-adjust />
179
- </button>
148
+ </IconButton>
180
149
  </template>
181
150
  <template #menu>
182
151
  <Settings />
@@ -8,7 +8,7 @@ import { fullscreen } from '../state'
8
8
  import { total } from '../logic/nav'
9
9
  import { rawRoutes } from '../routes'
10
10
  import NoteDisplay from './NoteDisplay.vue'
11
- import HiddenText from './HiddenText.vue'
11
+ import IconButton from './IconButton.vue'
12
12
 
13
13
  const slideTitle = configs.titleTemplate.replace('%s', configs.title || 'Slidev')
14
14
  useHead({
@@ -55,19 +55,16 @@ function decreaseFontSize() {
55
55
  </div>
56
56
  <div class="flex-none border-t border-gray-400 border-opacity-20">
57
57
  <div class="flex gap-1 items-center px-6 py-3">
58
- <button class="slidev-icon-btn" @click="toggleFullscreen">
59
- <HiddenText :text="isFullscreen ? 'Close fullscreen' : 'Enter fullscreen'" />
58
+ <IconButton :title="isFullscreen ? 'Close fullscreen' : 'Enter fullscreen'" @click="toggleFullscreen">
60
59
  <carbon:minimize v-if="isFullscreen" />
61
60
  <carbon:maximize v-else />
62
- </button>
63
- <button class="slidev-icon-btn" @click="increaseFontSize">
64
- <HiddenText text="Increase font size" />
61
+ </IconButton>
62
+ <IconButton title="Increase font size" @click="increaseFontSize">
65
63
  <carbon:zoom-in />
66
- </button>
67
- <button class="slidev-icon-btn" @click="decreaseFontSize">
68
- <HiddenText text="Decrease font size" />
64
+ </IconButton>
65
+ <IconButton title="Decrease font size" @click="decreaseFontSize">
69
66
  <carbon:zoom-out />
70
- </button>
67
+ </IconButton>
71
68
  <div class="flex-auto" />
72
69
  <div class="p2 text-center">
73
70
  {{ pageNo }} / {{ total }}
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref, shallowRef } from 'vue'
3
- import { isScreenVertical, showEditor, slideScale, windowSize } from '../state'
3
+ import { isEditorVertical, isScreenVertical, showEditor, slideScale, windowSize } from '../state'
4
4
  import { isEmbedded, isPrintMode, next, prev, useSwipeControls } from '../logic/nav'
5
5
  import { isDrawing } from '../logic/drawings'
6
6
  import { registerShortcuts } from '../logic/shortcuts'
@@ -42,7 +42,7 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
42
42
 
43
43
  <template>
44
44
  <PrintStyle v-if="isPrintMode" />
45
- <div id="page-root" ref="root" class="grid grid-cols-[1fr_max-content]" :style="themeVars">
45
+ <div id="page-root" ref="root" class="grid" :class="isEditorVertical ? 'grid-rows-[1fr_max-content]' : 'grid-cols-[1fr_max-content]'" :style="themeVars">
46
46
  <SlideContainer
47
47
  class="w-full h-full"
48
48
  :style="{ background: 'var(--slidev-slide-container-background, black)' }"
@@ -58,7 +58,7 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
58
58
  <div
59
59
  class="absolute bottom-0 left-0 transition duration-300 opacity-0 hover:opacity-100"
60
60
  :class="[
61
- persistNav ? 'opacity-100 right-0' : 'opacity-0 p-2',
61
+ persistNav ? '!opacity-100 right-0' : 'opacity-0 p-2',
62
62
  isDrawing ? 'pointer-events-none' : '',
63
63
  ]"
64
64
  >