@slidev/client 52.14.2 → 52.15.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.
- package/builtin/BlueSky.vue +167 -0
- package/builtin/CodeBlockWrapper.vue +1 -1
- package/builtin/Link.vue +2 -2
- package/builtin/Monaco.vue +1 -2
- package/builtin/Tweet.vue +1 -1
- package/builtin/VClick.ts +8 -0
- package/builtin/VClicks.ts +24 -4
- package/builtin/VDrag.vue +1 -0
- package/composables/useDragElements.ts +5 -2
- package/composables/useDrawings.ts +6 -6
- package/composables/useMousePosInSlide.ts +21 -0
- package/composables/usePreloadImages.ts +2 -1
- package/composables/useSlideInfo.ts +1 -2
- package/constants.ts +2 -1
- package/internals/DrawingControls.vue +25 -7
- package/internals/IconButton.vue +3 -1
- package/internals/LaserPointer.vue +66 -0
- package/internals/MenuButton.vue +1 -1
- package/internals/NavControls.vue +28 -18
- package/internals/PresenterMouse.vue +1 -1
- package/internals/Settings.vue +10 -1
- package/internals/ShikiEditor.vue +2 -4
- package/internals/SideEditor.vue +3 -1
- package/internals/SlideContainer.vue +18 -1
- package/logic/recording.ts +16 -8
- package/logic/slides.ts +20 -7
- package/modules/v-click.ts +42 -8
- package/package.json +22 -21
- package/pages/404.vue +3 -1
- package/pages/export.vue +5 -1
- package/pages/notes-edit.vue +3 -1
- package/pages/play.vue +2 -0
- package/pages/presenter.vue +18 -23
- package/setup/main.ts +1 -2
- package/setup/monaco.ts +4 -4
- package/setup/root.ts +1 -1
- package/shim-vue.d.ts +3 -1
- package/state/shared.ts +1 -0
- package/state/storage.ts +7 -0
- package/styles/index.css +8 -22
- package/styles/index.ts +23 -0
- package/styles/layouts-base.css +1 -1
- package/styles/vclick.css +54 -0
package/pages/presenter.vue
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useHead } from '@unhead/vue'
|
|
3
|
-
import { useEventListener, useLocalStorage, useMediaQuery,
|
|
4
|
-
import { computed, onMounted,
|
|
3
|
+
import { useEventListener, useLocalStorage, useMediaQuery, useWindowFocus } from '@vueuse/core'
|
|
4
|
+
import { computed, onMounted, ref, shallowRef, watch, watchEffect } from 'vue'
|
|
5
5
|
import { createClicksContextBase } from '../composables/useClicks'
|
|
6
6
|
import { useDrawings } from '../composables/useDrawings'
|
|
7
|
+
import { useMousePosInSlide } from '../composables/useMousePosInSlide'
|
|
7
8
|
import { useNav } from '../composables/useNav'
|
|
8
9
|
import { useSwipeControls } from '../composables/useSwipeControls'
|
|
9
10
|
import { useWakeLock } from '../composables/useWakeLock'
|
|
@@ -14,6 +15,7 @@ import CurrentProgressBar from '../internals/CurrentProgressBar.vue'
|
|
|
14
15
|
import DrawingControls from '../internals/DrawingControls.vue'
|
|
15
16
|
import Goto from '../internals/Goto.vue'
|
|
16
17
|
import IconButton from '../internals/IconButton.vue'
|
|
18
|
+
import LaserPointer from '../internals/LaserPointer.vue'
|
|
17
19
|
import NavControls from '../internals/NavControls.vue'
|
|
18
20
|
import NoteEditable from '../internals/NoteEditable.vue'
|
|
19
21
|
import NoteStatic from '../internals/NoteStatic.vue'
|
|
@@ -27,7 +29,7 @@ import TimerBar from '../internals/TimerBar.vue'
|
|
|
27
29
|
import TimerInlined from '../internals/TimerInlined.vue'
|
|
28
30
|
import { onContextMenu } from '../logic/contextMenu'
|
|
29
31
|
import { registerShortcuts } from '../logic/shortcuts'
|
|
30
|
-
import { decreasePresenterFontSize, increasePresenterFontSize, presenterLayout, presenterNotesFontSize, showEditor, showPresenterCursor } from '../state'
|
|
32
|
+
import { cursorStyle, decreasePresenterFontSize, increasePresenterFontSize, presenterLayout, presenterNotesFontSize, showEditor, showPresenterCursor } from '../state'
|
|
31
33
|
import { sharedState } from '../state/shared'
|
|
32
34
|
|
|
33
35
|
const inFocus = useWindowFocus()
|
|
@@ -244,28 +246,20 @@ if (__DEV__ && __SLIDEV_FEATURE_EDITOR__)
|
|
|
244
246
|
|
|
245
247
|
// sync presenter cursor
|
|
246
248
|
onMounted(() => {
|
|
247
|
-
const
|
|
248
|
-
const mouse = reactive(useMouse())
|
|
249
|
+
const mouse = useMousePosInSlide()
|
|
249
250
|
const focus = useWindowFocus()
|
|
250
251
|
|
|
251
|
-
|
|
252
|
-
()
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
return { x, y }
|
|
264
|
-
},
|
|
265
|
-
(pos) => {
|
|
266
|
-
sharedState.cursor = pos
|
|
267
|
-
},
|
|
268
|
-
)
|
|
252
|
+
watchEffect(() => {
|
|
253
|
+
if (!mouse.value || !focus.value || isDrawing.value || !showPresenterCursor.value) {
|
|
254
|
+
sharedState.cursor = undefined
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
sharedState.cursor = {
|
|
258
|
+
...mouse.value,
|
|
259
|
+
style: cursorStyle.value,
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
})
|
|
269
263
|
})
|
|
270
264
|
</script>
|
|
271
265
|
|
|
@@ -328,6 +322,7 @@ onMounted(() => {
|
|
|
328
322
|
@contextmenu="onContextMenu"
|
|
329
323
|
>
|
|
330
324
|
<SlidesShow render-context="presenter" />
|
|
325
|
+
<LaserPointer />
|
|
331
326
|
</SlideContainer>
|
|
332
327
|
|
|
333
328
|
<ClicksSlider
|
package/setup/main.ts
CHANGED
|
@@ -9,8 +9,7 @@ import { createVDragDirective } from '../modules/v-drag'
|
|
|
9
9
|
import { createVMarkDirective } from '../modules/v-mark'
|
|
10
10
|
import { createVMotionDirectives } from '../modules/v-motion'
|
|
11
11
|
import setupRoutes from '../setup/routes'
|
|
12
|
-
|
|
13
|
-
import '#slidev/styles'
|
|
12
|
+
import '../styles'
|
|
14
13
|
|
|
15
14
|
export default async function setupMain(app: App) {
|
|
16
15
|
function setMaxHeight() {
|
package/setup/monaco.ts
CHANGED
|
@@ -56,12 +56,12 @@ StandaloneServices.initialize({
|
|
|
56
56
|
})
|
|
57
57
|
|
|
58
58
|
const setup = createSingletonPromise(async () => {
|
|
59
|
-
const defaults = monaco.
|
|
59
|
+
const defaults = monaco.typescript.typescriptDefaults
|
|
60
60
|
defaults.setCompilerOptions({
|
|
61
61
|
...defaults.getCompilerOptions(),
|
|
62
62
|
strict: true,
|
|
63
|
-
moduleResolution: monaco.
|
|
64
|
-
module: monaco.
|
|
63
|
+
moduleResolution: monaco.typescript.ModuleResolutionKind.NodeJs,
|
|
64
|
+
module: monaco.typescript.ModuleKind.ESNext,
|
|
65
65
|
})
|
|
66
66
|
|
|
67
67
|
const ata = configs.monacoTypesSource === 'cdn'
|
|
@@ -137,7 +137,7 @@ const setup = createSingletonPromise(async () => {
|
|
|
137
137
|
async function _addFile(raw: () => Promise<{ default: string }>, path: string) {
|
|
138
138
|
const uri = monaco.Uri.file(path)
|
|
139
139
|
const code = (await raw()).default
|
|
140
|
-
monaco.
|
|
140
|
+
monaco.typescript.typescriptDefaults.addExtraLib(code, `file:///${path}`)
|
|
141
141
|
monaco.editor.createModel(code, 'javascript', uri)
|
|
142
142
|
}
|
|
143
143
|
|
package/setup/root.ts
CHANGED
package/shim-vue.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
declare module 'vue' {
|
|
2
|
-
type
|
|
2
|
+
import type { ShallowUnwrapRef } from 'vue'
|
|
3
|
+
|
|
4
|
+
type SlideContext = ShallowUnwrapRef<import('./context').SlideContext>
|
|
3
5
|
interface ComponentCustomProperties extends SlideContext {
|
|
4
6
|
}
|
|
5
7
|
}
|
package/state/shared.ts
CHANGED
package/state/storage.ts
CHANGED
|
@@ -55,6 +55,13 @@ export const skipExportPdfTip = useLocalStorage('slidev-skip-export-pdf-tip', fa
|
|
|
55
55
|
export const captureDelay = useLocalStorage('slidev-export-capture-delay', 400, { listenToStorageChanges: false })
|
|
56
56
|
|
|
57
57
|
export const showPresenterCursor = useLocalStorage('slidev-presenter-cursor', true, { listenToStorageChanges: false })
|
|
58
|
+
|
|
59
|
+
export const cursorStyle = useLocalStorage<'cursor' | 'laser'>('slidev-cursor-style', 'cursor', { listenToStorageChanges: false })
|
|
60
|
+
|
|
61
|
+
export function togglePresenterCursor() {
|
|
62
|
+
showPresenterCursor.value = !showPresenterCursor.value
|
|
63
|
+
}
|
|
64
|
+
|
|
58
65
|
export const showEditor = useLocalStorage('slidev-show-editor', false, { listenToStorageChanges: false })
|
|
59
66
|
export const isEditorVertical = useLocalStorage('slidev-editor-vertical', false, { listenToStorageChanges: false })
|
|
60
67
|
export const editorWidth = useLocalStorage('slidev-editor-width', isClient ? window.innerWidth * 0.4 : 318, { listenToStorageChanges: false })
|
package/styles/index.css
CHANGED
|
@@ -45,24 +45,6 @@ html {
|
|
|
45
45
|
@apply border-none hover:border-none hover:text-white;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.slidev-vclick-target {
|
|
49
|
-
@apply transition-opacity duration-100;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.slidev-vclick-hidden {
|
|
53
|
-
opacity: 0 !important;
|
|
54
|
-
pointer-events: none !important;
|
|
55
|
-
user-select: none !important;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.slidev-vclick-display-none {
|
|
59
|
-
display: none !important;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.slidev-vclick-fade {
|
|
63
|
-
opacity: 0.5;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
48
|
.slidev-icon {
|
|
67
49
|
display: inline-block;
|
|
68
50
|
vertical-align: sub;
|
|
@@ -142,11 +124,15 @@ html {
|
|
|
142
124
|
|
|
143
125
|
#twoslash-container {
|
|
144
126
|
position: fixed;
|
|
145
|
-
}
|
|
146
127
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
128
|
+
.v-popper__wrapper:not(.no-slide-scale > *) {
|
|
129
|
+
zoom: var(--slidev-slide-scale);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.v-popper__popper:not(.no-slide-scale > *) {
|
|
133
|
+
translate: calc(10px * (1 - var(--slidev-slide-scale))) 0;
|
|
134
|
+
width: max-content;
|
|
135
|
+
}
|
|
150
136
|
}
|
|
151
137
|
|
|
152
138
|
.slidev-note ul {
|
package/styles/index.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import '@unocss/reset/tailwind.css'
|
|
2
|
+
|
|
3
|
+
import 'uno:preflights.css'
|
|
4
|
+
import 'uno:typography.css'
|
|
5
|
+
import 'uno:shortcuts.css'
|
|
6
|
+
|
|
7
|
+
import '@shikijs/vitepress-twoslash/style.css'
|
|
8
|
+
import 'shiki-magic-move/style.css'
|
|
9
|
+
import 'markdown-it-github-alerts/styles/github-colors-light.css'
|
|
10
|
+
import 'markdown-it-github-alerts/styles/github-colors-dark-media.css'
|
|
11
|
+
import 'markdown-it-github-alerts/styles/github-base.css'
|
|
12
|
+
|
|
13
|
+
import './vars.css'
|
|
14
|
+
import './index.css'
|
|
15
|
+
import './code.css'
|
|
16
|
+
import './katex.css'
|
|
17
|
+
import './transitions.css'
|
|
18
|
+
import './shiki-twoslash.css'
|
|
19
|
+
import './vclick.css'
|
|
20
|
+
|
|
21
|
+
import '#slidev/conditional-styles'
|
|
22
|
+
|
|
23
|
+
import 'uno.css'
|
package/styles/layouts-base.css
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.slidev-vclick-target {
|
|
2
|
+
transition: all 0.1s ease;
|
|
3
|
+
|
|
4
|
+
&.slidev-vclick-anim-none {
|
|
5
|
+
transition: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&.slidev-vclick-anim-fade-in {
|
|
9
|
+
transition: all 0.3s ease;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.slidev-vclick-hidden {
|
|
14
|
+
opacity: 0 !important;
|
|
15
|
+
pointer-events: none !important;
|
|
16
|
+
user-select: none !important;
|
|
17
|
+
|
|
18
|
+
&.slidev-vclick-anim-fade {
|
|
19
|
+
opacity: 0.5 !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.slidev-vclick-anim-fade-in {
|
|
23
|
+
opacity: 0 !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.slidev-vclick-anim-up {
|
|
27
|
+
translate: 0 20px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.slidev-vclick-anim-down {
|
|
31
|
+
translate: 0 -20px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.slidev-vclick-anim-left {
|
|
35
|
+
translate: 20px 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.slidev-vclick-anim-right {
|
|
39
|
+
translate: -20px 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.slidev-vclick-anim-scale {
|
|
43
|
+
scale: 0.9;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.slidev-vclick-display-none {
|
|
48
|
+
display: none !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* No longer used, but kept for backward compatibility */
|
|
52
|
+
.slidev-vclick-fade {
|
|
53
|
+
opacity: 0.5;
|
|
54
|
+
}
|