@slidev/client 0.43.6 → 0.43.7

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,15 +13,18 @@ Alice -> Bob : Hello!
13
13
  <script setup lang="ts">
14
14
  import { computed } from 'vue'
15
15
 
16
- const props = defineProps<{
16
+ const props = withDefaults(defineProps<{
17
17
  code: string
18
18
  server: string
19
19
  scale?: number
20
- }>()
20
+ alt?: string
21
+ }>(), {
22
+ alt: 'PlantUML diagram',
23
+ })
21
24
 
22
25
  const uri = computed(() => `${props.server}/svg/${props.code}`)
23
26
  </script>
24
27
 
25
28
  <template>
26
- <img alt="PlantUML diagram" :src="uri" :style="{ scale }">
29
+ <img :src="uri" :style="{ scale }" :alt="alt">
27
30
  </template>
@@ -13,6 +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
17
 
17
18
  function undo() {
18
19
  drauu.undo()
@@ -40,24 +41,30 @@ function setBrushColor(color: typeof brush.color) {
40
41
  :initial-y="10"
41
42
  >
42
43
  <button class="slidev-icon-btn" :class="{ shallow: drawingMode !== 'stylus' }" @click="setDrawingMode('stylus')">
44
+ <HiddenText text="Draw with stylus" />
43
45
  <carbon:pen />
44
46
  </button>
45
47
  <button class="slidev-icon-btn" :class="{ shallow: drawingMode !== 'line' }" @click="setDrawingMode('line')">
48
+ <HiddenText text="Draw a line" />
46
49
  <svg width="1em" height="1em" class="-mt-0.5" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">
47
50
  <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" />
48
51
  </svg>
49
52
  </button>
50
53
  <button class="slidev-icon-btn" :class="{ shallow: drawingMode !== 'arrow' }" @click="setDrawingMode('arrow')">
54
+ <HiddenText text="Draw an arrow" />
51
55
  <carbon:arrow-up-right />
52
56
  </button>
53
57
  <button class="slidev-icon-btn" :class="{ shallow: drawingMode !== 'ellipse' }" @click="setDrawingMode('ellipse')">
58
+ <HiddenText text="Draw an ellipse" />
54
59
  <carbon:radio-button />
55
60
  </button>
56
61
  <button class="slidev-icon-btn" :class="{ shallow: drawingMode !== 'rectangle' }" @click="setDrawingMode('rectangle')">
62
+ <HiddenText text="Draw a rectangle" />
57
63
  <carbon:checkbox />
58
64
  </button>
59
65
  <!-- TODO: not sure why it's not working! -->
60
66
  <!-- <button class="slidev-icon-btn" :class="{ shallow: drawingMode != 'eraseLine' }" @click="setDrawingMode('eraseLine')">
67
+ <HiddenText text="Erase" />
61
68
  <carbon:erase />
62
69
  </button> -->
63
70
 
@@ -70,6 +77,7 @@ function setBrushColor(color: typeof brush.color) {
70
77
  :class="brush.color === color ? 'active' : 'shallow'"
71
78
  @click="setBrushColor(color)"
72
79
  >
80
+ <HiddenText text="Set brush color" />
73
81
  <div
74
82
  class="w-6 h-6 transition-all transform border border-gray-400/50"
75
83
  :class="brush.color !== color ? 'rounded-1/2 scale-85' : 'rounded-md'"
@@ -80,17 +88,21 @@ function setBrushColor(color: typeof brush.color) {
80
88
  <VerticalDivider />
81
89
 
82
90
  <button class="slidev-icon-btn" :class="{ disabled: !canUndo }" @click="undo()">
91
+ <HiddenText text="Undo" />
83
92
  <carbon:undo />
84
93
  </button>
85
94
  <button class="slidev-icon-btn" :class="{ disabled: !canRedo }" @click="redo()">
95
+ <HiddenText text="Redo" />
86
96
  <carbon:redo />
87
97
  </button>
88
98
  <button class="slidev-icon-btn" :class="{ disabled: !canClear }" @click="clearDrauu()">
99
+ <HiddenText text="Delete" />
89
100
  <carbon:delete />
90
101
  </button>
91
102
 
92
103
  <VerticalDivider />
93
104
  <button class="slidev-icon-btn" :class="{ shallow: !drawingPinned }" @click="drawingPinned = !drawingPinned">
105
+ <HiddenText :text="drawingPinned ? 'Unpin drawing' : 'Pin drawing'" />
94
106
  <carbon:pin-filled v-show="drawingPinned" class="transform -rotate-45" />
95
107
  <carbon:pin v-show="!drawingPinned" />
96
108
  </button>
@@ -100,6 +112,7 @@ function setBrushColor(color: typeof brush.color) {
100
112
  :class="{ shallow: !drawingEnabled }"
101
113
  @click="drawingEnabled = !drawingEnabled"
102
114
  >
115
+ <HiddenText :text="drawingPinned ? 'Drawing pinned' : 'Drawing unpinned'" />
103
116
  <carbon:error v-show="drawingPinned" />
104
117
  <carbon:close-outline v-show="!drawingPinned" />
105
118
  </button>
@@ -5,6 +5,7 @@ import { activeElement, editorWidth, isInputting, showEditor } 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
9
 
9
10
  const props = defineProps<{
10
11
  resize: boolean
@@ -147,9 +148,11 @@ throttledWatch(
147
148
  <div class="flex pb-2 text-xl -mt-1">
148
149
  <div class="mr-4 rounded flex">
149
150
  <button class="slidev-icon-btn" :class="tab === 'content' ? 'text-$slidev-theme-primary' : ''" @click="switchTab('content')">
151
+ <HiddenText text="Switch to content tab" />
150
152
  <carbon:account />
151
153
  </button>
152
154
  <button class="slidev-icon-btn" :class="tab === 'note' ? 'text-$slidev-theme-primary' : ''" @click="switchTab('note')">
155
+ <HiddenText text="Switch to notes tab" />
153
156
  <carbon:align-box-bottom-right />
154
157
  </button>
155
158
  </div>
@@ -158,9 +161,11 @@ throttledWatch(
158
161
  </span>
159
162
  <div class="flex-auto" />
160
163
  <button class="slidev-icon-btn" @click="openInEditor()">
164
+ <HiddenText text="Open in editor" />
161
165
  <carbon:launch />
162
166
  </button>
163
167
  <button class="slidev-icon-btn" @click="close">
168
+ <HiddenText text="Close" />
164
169
  <carbon:close />
165
170
  </button>
166
171
  </div>
@@ -0,0 +1,9 @@
1
+ <script setup lang="ts">
2
+ defineProps<{
3
+ text: string
4
+ }>()
5
+ </script>
6
+
7
+ <template>
8
+ <span class="sr-only">{{ text }}</span>
9
+ </template>
@@ -33,7 +33,7 @@ const hasInfo = computed(() => typeof configs.info === 'string')
33
33
  <img
34
34
  class="w-5 h-5"
35
35
  src="../assets/logo.png"
36
- alt="Slidev"
36
+ alt="Slidev logo"
37
37
  >
38
38
  <div style="color: #2082A6">
39
39
  <b>Sli</b>dev
@@ -8,6 +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
12
 
12
13
  // @ts-expect-error virtual module
13
14
  import CustomNavControls from '/@slidev/custom-nav-controls'
@@ -52,19 +53,28 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
52
53
  @mouseleave="onMouseLeave"
53
54
  >
54
55
  <button v-if="!isEmbedded" class="slidev-icon-btn" @click="toggleFullscreen">
55
- <carbon:minimize v-if="isFullscreen" />
56
- <carbon:maximize v-else />
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>
57
64
  </button>
58
65
 
59
66
  <button class="slidev-icon-btn" :class="{ disabled: !hasPrev }" @click="prev">
67
+ <HiddenText text="Go to previous slide" />
60
68
  <carbon:arrow-left />
61
69
  </button>
62
70
 
63
71
  <button class="slidev-icon-btn" :class="{ disabled: !hasNext }" title="Next" @click="next">
72
+ <HiddenText text="Go to next slide" />
64
73
  <carbon:arrow-right />
65
74
  </button>
66
75
 
67
76
  <button v-if="!isEmbedded" class="slidev-icon-btn" title="Slides overview" @click="toggleOverview()">
77
+ <HiddenText text="Show slide overview" />
68
78
  <carbon:apps />
69
79
  </button>
70
80
 
@@ -74,8 +84,14 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
74
84
  title="Toggle dark mode"
75
85
  @click="toggleDark()"
76
86
  >
77
- <carbon-moon v-if="isDark" />
78
- <carbon-sun v-else />
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>
79
95
  </button>
80
96
 
81
97
  <VerticalDivider />
@@ -92,13 +108,20 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
92
108
  title="Show presenter cursor"
93
109
  @click="showPresenterCursor = !showPresenterCursor"
94
110
  >
95
- <ph-cursor-fill v-if="showPresenterCursor" />
96
- <ph-cursor-duotone v-else class="opacity-50" />
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>
97
119
  </button>
98
120
  </template>
99
121
 
100
122
  <template v-if="__SLIDEV_FEATURE_DRAWINGS__ && (!configs.drawings.presenterOnly || isPresenter) && !isEmbedded">
101
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'" />
102
125
  <carbon:pen />
103
126
  <div
104
127
  v-if="drawingEnabled"
@@ -122,11 +145,13 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
122
145
  class="slidev-icon-btn <md:hidden"
123
146
  @click="showEditor = !showEditor"
124
147
  >
148
+ <HiddenText :text="showEditor ? 'Hide editor' : 'Show editor'" />
125
149
  <carbon:text-annotation-toggle />
126
150
  </button>
127
151
  </template>
128
152
  <template v-if="!__DEV__">
129
153
  <button v-if="configs.download" class="slidev-icon-btn" @click="downloadPDF">
154
+ <HiddenText text="Download as PDF" />
130
155
  <carbon:download />
131
156
  </button>
132
157
  </template>
@@ -136,6 +161,7 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
136
161
  class="slidev-icon-btn"
137
162
  @click="showInfoDialog = !showInfoDialog"
138
163
  >
164
+ <HiddenText text="Show info" />
139
165
  <carbon:information />
140
166
  </button>
141
167
 
@@ -143,6 +169,7 @@ if (__SLIDEV_FEATURE_DRAWINGS__)
143
169
  <MenuButton>
144
170
  <template #button>
145
171
  <button class="slidev-icon-btn">
172
+ <HiddenText text="Adjust settings" />
146
173
  <carbon:settings-adjust />
147
174
  </button>
148
175
  </template>
@@ -8,6 +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
12
 
12
13
  const slideTitle = configs.titleTemplate.replace('%s', configs.title || 'Slidev')
13
14
  useHead({
@@ -57,13 +58,16 @@ function decreaseFontSize() {
57
58
  <div class="flex-none border-t border-gray-400 border-opacity-20">
58
59
  <div class="flex gap-1 items-center px-6 py-3">
59
60
  <button class="slidev-icon-btn" @click="toggleFullscreen">
61
+ <HiddenText :text="isFullscreen ? 'Close fullscreen' : 'Enter fullscreen'" />
60
62
  <carbon:minimize v-if="isFullscreen" />
61
63
  <carbon:maximize v-else />
62
64
  </button>
63
65
  <button class="slidev-icon-btn" @click="increaseFontSize">
66
+ <HiddenText text="Increase font size" />
64
67
  <carbon:zoom-in />
65
68
  </button>
66
69
  <button class="slidev-icon-btn" @click="decreaseFontSize">
70
+ <HiddenText text="Decrease font size" />
67
71
  <carbon:zoom-out />
68
72
  </button>
69
73
  <div class="flex-auto" />
@@ -88,7 +88,7 @@ onMounted(() => {
88
88
  <div class="bg-main h-full slidev-presenter">
89
89
  <div class="grid-container">
90
90
  <div class="grid-section top flex">
91
- <img src="../assets/logo-title-horizontal.png" class="ml-2 my-auto h-10 py-1 lg:h-14 lg:py-2" style="height: 3.5rem;">
91
+ <img src="../assets/logo-title-horizontal.png" class="ml-2 my-auto h-10 py-1 lg:h-14 lg:py-2" style="height: 3.5rem;" alt="Slidev logo">
92
92
  <div class="flex-auto" />
93
93
  <div
94
94
  class="timer-btn my-auto relative w-22px h-22px cursor-pointer text-lg"
@@ -5,6 +5,7 @@ import { recorder } from '../logic/recording'
5
5
  import { currentCamera, showRecordingDialog } from '../state'
6
6
  import DevicesList from './DevicesList.vue'
7
7
  import MenuButton from './MenuButton.vue'
8
+ import HiddenText from './HiddenText.vue'
8
9
 
9
10
  const {
10
11
  recording,
@@ -40,6 +41,7 @@ onMounted(() => {
40
41
  title="Show camera view"
41
42
  @click="toggleAvatar"
42
43
  >
44
+ <HiddenText text="Toggle camera view" />
43
45
  <carbon:user-avatar />
44
46
  </button>
45
47
 
@@ -49,12 +51,14 @@ onMounted(() => {
49
51
  title="Recording"
50
52
  @click="toggleRecording"
51
53
  >
54
+ <HiddenText :text="recording ? 'Stop record video' : 'Record video'" />
52
55
  <carbon:stop-outline v-if="recording" />
53
56
  <carbon:video v-else />
54
57
  </button>
55
58
  <MenuButton :disabled="recording">
56
59
  <template #button>
57
60
  <button class="slidev-icon-btn h-full !text-sm !px-0">
61
+ <HiddenText text="Select recording device" />
58
62
  <carbon:chevron-up class="opacity-50" />
59
63
  </button>
60
64
  </template>
@@ -9,6 +9,7 @@ import { getSlideClass } from '../utils'
9
9
  import SlideContainer from './SlideContainer.vue'
10
10
  import SlideWrapper from './SlideWrapper'
11
11
  import DrawingPreview from './DrawingPreview.vue'
12
+ import HiddenText from './HiddenText.vue'
12
13
 
13
14
  const props = defineProps<{ modelValue: boolean }>()
14
15
 
@@ -157,6 +158,7 @@ watchEffect(() => {
157
158
  </div>
158
159
  </Transition>
159
160
  <button v-if="value" class="fixed text-2xl top-4 right-4 slidev-icon-btn text-gray-400" @click="close">
161
+ <HiddenText text="Close" />
160
162
  <carbon:close />
161
163
  </button>
162
164
  </template>
@@ -17,9 +17,9 @@ const scaleInvertPercent = computed(() => `${(1 / (props.scale || 1)) * 100}%`)
17
17
  :src="url"
18
18
  :style="scale ? { transform: `scale(${scale})`, transformOrigin: 'top left' } : {}"
19
19
  />
20
- <div class="slidev-layout default" v-bind="$attrs">
21
- <slot />
22
- </div>
20
+ </div>
21
+ <div class="slidev-layout default" v-bind="$attrs">
22
+ <slot />
23
23
  </div>
24
24
  </div>
25
25
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
- "version": "0.43.6",
3
+ "version": "0.43.7",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -16,10 +16,10 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@antfu/utils": "^0.7.6",
19
- "@unocss/reset": "^0.56.4",
20
- "@vueuse/core": "^10.4.1",
19
+ "@unocss/reset": "^0.56.5",
20
+ "@vueuse/core": "^10.5.0",
21
21
  "@vueuse/head": "^2.0.0",
22
- "@vueuse/math": "^10.4.1",
22
+ "@vueuse/math": "^10.5.0",
23
23
  "@vueuse/motion": "^2.0.0",
24
24
  "codemirror": "^5.65.5",
25
25
  "defu": "^6.1.2",
@@ -28,23 +28,23 @@
28
28
  "fuse.js": "^6.6.2",
29
29
  "js-base64": "^3.7.5",
30
30
  "js-yaml": "^4.1.0",
31
- "katex": "^0.16.8",
32
- "mermaid": "^10.4.0",
31
+ "katex": "^0.16.9",
32
+ "mermaid": "^10.5.0",
33
33
  "monaco-editor": "^0.37.1",
34
34
  "nanoid": "^5.0.1",
35
35
  "prettier": "^3.0.3",
36
36
  "recordrtc": "^5.6.2",
37
37
  "resolve": "^1.22.6",
38
- "unocss": "^0.56.4",
38
+ "unocss": "^0.56.5",
39
39
  "vite-plugin-windicss": "^1.9.1",
40
40
  "vue": "^3.3.4",
41
41
  "vue-router": "^4.2.5",
42
42
  "vue-starport": "^0.4.0",
43
43
  "windicss": "^3.5.6",
44
- "@slidev/parser": "0.43.6",
45
- "@slidev/types": "0.43.6"
44
+ "@slidev/parser": "0.43.7",
45
+ "@slidev/types": "0.43.7"
46
46
  },
47
47
  "devDependencies": {
48
- "vite": "^4.4.9"
48
+ "vite": "^4.4.11"
49
49
  }
50
50
  }