@slidev/client 0.49.29 → 0.50.0-beta.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.
- package/builtin/Arrow.vue +1 -1
- package/builtin/CodeBlockWrapper.vue +3 -3
- package/builtin/KaTexBlockWrapper.vue +3 -3
- package/builtin/Mermaid.vue +1 -1
- package/builtin/Monaco.vue +6 -5
- package/builtin/RenderWhen.vue +2 -2
- package/builtin/ShikiMagicMove.vue +5 -5
- package/builtin/SlidevVideo.vue +2 -2
- package/builtin/Toc.vue +1 -1
- package/builtin/TocList.vue +6 -3
- package/builtin/Tweet.vue +1 -1
- package/builtin/VAfter.ts +1 -1
- package/builtin/VClick.ts +1 -1
- package/builtin/VClickGap.vue +1 -1
- package/builtin/VClicks.ts +1 -1
- package/builtin/VDrag.vue +1 -1
- package/builtin/VDragArrow.vue +1 -1
- package/builtin/VSwitch.ts +4 -4
- package/composables/useClicks.ts +1 -1
- package/composables/useDragElements.ts +3 -3
- package/composables/useDrawings.ts +3 -3
- package/composables/useNav.ts +8 -8
- package/composables/useSlideInfo.ts +2 -2
- package/composables/useSwipeControls.ts +1 -1
- package/composables/useTimer.ts +20 -0
- package/composables/useViewTransition.ts +2 -3
- package/constants.ts +3 -1
- package/context.ts +2 -2
- package/env.ts +2 -2
- package/index.ts +23 -5
- package/internals/ClicksSlider.vue +1 -1
- package/internals/CodeRunner.vue +5 -5
- package/internals/ContextMenu.vue +8 -6
- package/internals/Controls.vue +6 -6
- package/internals/DevicesList.vue +2 -2
- package/internals/DragControl.vue +2 -2
- package/internals/Draggable.vue +1 -1
- package/internals/DrawingControls.vue +140 -139
- package/internals/DrawingLayer.vue +1 -1
- package/internals/Goto.vue +3 -3
- package/internals/NavControls.vue +21 -21
- package/internals/NoteDisplay.vue +1 -1
- package/internals/NoteEditable.vue +2 -2
- package/internals/PrintContainer.vue +4 -4
- package/internals/PrintSlide.vue +1 -1
- package/internals/PrintSlideClick.vue +3 -3
- package/internals/QuickOverview.vue +11 -9
- package/internals/RecordingControls.vue +5 -5
- package/internals/RecordingDialog.vue +2 -2
- package/internals/SelectList.vue +6 -4
- package/internals/Settings.vue +1 -1
- package/internals/ShikiEditor.vue +1 -1
- package/internals/SideEditor.vue +7 -7
- package/internals/SlideContainer.vue +31 -3
- package/internals/SlideWrapper.vue +5 -4
- package/internals/SlidesShow.vue +6 -6
- package/internals/WebCamera.vue +1 -1
- package/layouts/error.vue +5 -1
- package/logic/contextMenu.ts +3 -3
- package/logic/recording.ts +4 -4
- package/logic/shortcuts.ts +3 -3
- package/logic/slides.ts +2 -2
- package/logic/snapshot.ts +86 -0
- package/logic/utils.ts +0 -23
- package/main.ts +7 -3
- package/modules/context.ts +1 -1
- package/modules/mermaid.ts +3 -3
- package/modules/v-click.ts +1 -1
- package/modules/v-drag.ts +1 -1
- package/modules/v-mark.ts +2 -2
- package/modules/v-motion.ts +3 -3
- package/package.json +26 -25
- package/pages/entry.vue +4 -4
- package/pages/notes.vue +11 -11
- package/pages/overview.vue +27 -14
- package/pages/play.vue +14 -12
- package/pages/presenter/print.vue +2 -2
- package/pages/presenter.vue +38 -39
- package/pages/print.vue +3 -3
- package/setup/code-runners.ts +4 -4
- package/setup/context-menu.ts +15 -24
- package/setup/main.ts +4 -4
- package/setup/mermaid.ts +1 -1
- package/setup/monaco.ts +18 -18
- package/setup/root.ts +9 -9
- package/setup/shortcuts.ts +6 -7
- package/state/drawings.ts +1 -0
- package/state/index.ts +1 -1
- package/state/shared.ts +2 -1
- package/state/snapshot.ts +13 -0
- package/state/syncState.ts +76 -24
- package/styles/index.css +5 -0
- package/uno.config.ts +5 -2
|
@@ -1,139 +1,140 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { Menu } from 'floating-vue'
|
|
3
|
-
import { useDrawings } from '../composables/useDrawings'
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
const {
|
|
9
|
-
brush,
|
|
10
|
-
canClear,
|
|
11
|
-
canRedo,
|
|
12
|
-
canUndo,
|
|
13
|
-
clear,
|
|
14
|
-
drauu,
|
|
15
|
-
drawingEnabled,
|
|
16
|
-
drawingMode,
|
|
17
|
-
drawingPinned,
|
|
18
|
-
brushColors,
|
|
19
|
-
} = useDrawings()
|
|
20
|
-
|
|
21
|
-
function undo() {
|
|
22
|
-
drauu.undo()
|
|
23
|
-
}
|
|
24
|
-
function redo() {
|
|
25
|
-
drauu.redo()
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
let lastDrawingMode: typeof drawingMode.value = 'stylus'
|
|
29
|
-
function setDrawingMode(mode: typeof drawingMode.value) {
|
|
30
|
-
drawingMode.value = mode
|
|
31
|
-
drawingEnabled.value = true
|
|
32
|
-
if (mode !== 'eraseLine')
|
|
33
|
-
lastDrawingMode = mode
|
|
34
|
-
}
|
|
35
|
-
function setBrushColor(color: typeof brush.color) {
|
|
36
|
-
brush.color = color
|
|
37
|
-
drawingEnabled.value = true
|
|
38
|
-
drawingMode.value = lastDrawingMode
|
|
39
|
-
}
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<template>
|
|
43
|
-
<Draggable
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
:initial-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
<line x1="2" y1="
|
|
78
|
-
<line x1="
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
</
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Menu } from 'floating-vue'
|
|
3
|
+
import { useDrawings } from '../composables/useDrawings'
|
|
4
|
+
import Draggable from './Draggable.vue'
|
|
5
|
+
import IconButton from './IconButton.vue'
|
|
6
|
+
import VerticalDivider from './VerticalDivider.vue'
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
brush,
|
|
10
|
+
canClear,
|
|
11
|
+
canRedo,
|
|
12
|
+
canUndo,
|
|
13
|
+
clear,
|
|
14
|
+
drauu,
|
|
15
|
+
drawingEnabled,
|
|
16
|
+
drawingMode,
|
|
17
|
+
drawingPinned,
|
|
18
|
+
brushColors,
|
|
19
|
+
} = useDrawings()
|
|
20
|
+
|
|
21
|
+
function undo() {
|
|
22
|
+
drauu.undo()
|
|
23
|
+
}
|
|
24
|
+
function redo() {
|
|
25
|
+
drauu.redo()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let lastDrawingMode: typeof drawingMode.value = 'stylus'
|
|
29
|
+
function setDrawingMode(mode: typeof drawingMode.value) {
|
|
30
|
+
drawingMode.value = mode
|
|
31
|
+
drawingEnabled.value = true
|
|
32
|
+
if (mode !== 'eraseLine')
|
|
33
|
+
lastDrawingMode = mode
|
|
34
|
+
}
|
|
35
|
+
function setBrushColor(color: typeof brush.color) {
|
|
36
|
+
brush.color = color
|
|
37
|
+
drawingEnabled.value = true
|
|
38
|
+
drawingMode.value = lastDrawingMode
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<Draggable
|
|
44
|
+
v-if="drawingEnabled || drawingPinned"
|
|
45
|
+
class="flex flex-wrap text-xl p-2 gap-1 rounded-md bg-main shadow transition-opacity duration-200 z-20 border border-main"
|
|
46
|
+
:class="!drawingEnabled && drawingPinned ? 'opacity-40 hover:opacity-90' : ''"
|
|
47
|
+
storage-key="slidev-drawing-pos"
|
|
48
|
+
:initial-x="10"
|
|
49
|
+
:initial-y="10"
|
|
50
|
+
>
|
|
51
|
+
<IconButton title="Draw with stylus" :class="{ shallow: drawingMode !== 'stylus' }" @click="setDrawingMode('stylus')">
|
|
52
|
+
<div class="i-carbon:pen" />
|
|
53
|
+
</IconButton>
|
|
54
|
+
<IconButton title="Draw a line" :class="{ shallow: drawingMode !== 'line' }" @click="setDrawingMode('line')">
|
|
55
|
+
<svg width="1em" height="1em" class="-mt-0.5" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">
|
|
56
|
+
<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" />
|
|
57
|
+
</svg>
|
|
58
|
+
</IconButton>
|
|
59
|
+
<IconButton title="Draw an arrow" :class="{ shallow: drawingMode !== 'arrow' }" @click="setDrawingMode('arrow')">
|
|
60
|
+
<div class="i-carbon:arrow-up-right" />
|
|
61
|
+
</IconButton>
|
|
62
|
+
<IconButton title="Draw an ellipse" :class="{ shallow: drawingMode !== 'ellipse' }" @click="setDrawingMode('ellipse')">
|
|
63
|
+
<div class="i-carbon:radio-button" />
|
|
64
|
+
</IconButton>
|
|
65
|
+
<IconButton title="Draw a rectangle" :class="{ shallow: drawingMode !== 'rectangle' }" @click="setDrawingMode('rectangle')">
|
|
66
|
+
<div class="i-carbon:checkbox" />
|
|
67
|
+
</IconButton>
|
|
68
|
+
<IconButton title="Erase" :class="{ shallow: drawingMode !== 'eraseLine' }" @click="setDrawingMode('eraseLine')">
|
|
69
|
+
<div class="i-carbon:erase" />
|
|
70
|
+
</IconButton>
|
|
71
|
+
|
|
72
|
+
<VerticalDivider />
|
|
73
|
+
|
|
74
|
+
<Menu>
|
|
75
|
+
<IconButton title="Adjust stroke width" :class="{ shallow: drawingMode === 'eraseLine' }">
|
|
76
|
+
<svg viewBox="0 0 32 32" width="1.2em" height="1.2em">
|
|
77
|
+
<line x1="2" y1="15" x2="22" y2="4" stroke="currentColor" stroke-width="1" stroke-linecap="round" />
|
|
78
|
+
<line x1="2" y1="24" x2="28" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
|
|
79
|
+
<line x1="7" y1="31" x2="29" y2="19" stroke="currentColor" stroke-width="3" stroke-linecap="round" />
|
|
80
|
+
</svg>
|
|
81
|
+
</IconButton>
|
|
82
|
+
<template #popper>
|
|
83
|
+
<div class="flex bg-main p-2">
|
|
84
|
+
<div class="inline-block w-7 text-center">
|
|
85
|
+
{{ brush.size }}
|
|
86
|
+
</div>
|
|
87
|
+
<div class="pt-.5">
|
|
88
|
+
<input v-model="brush.size" type="range" min="1" max="15" @change="drawingMode = lastDrawingMode">
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
92
|
+
</Menu>
|
|
93
|
+
<IconButton
|
|
94
|
+
v-for="color of brushColors"
|
|
95
|
+
:key="color"
|
|
96
|
+
title="Set brush color"
|
|
97
|
+
:class="brush.color === color && drawingMode !== 'eraseLine' ? 'active' : 'shallow'"
|
|
98
|
+
@click="setBrushColor(color)"
|
|
99
|
+
>
|
|
100
|
+
<div
|
|
101
|
+
class="w-6 h-6 transition-all transform border"
|
|
102
|
+
:class="brush.color !== color ? 'rounded-1/2 scale-85 border-white' : 'rounded-md border-gray-300/50'"
|
|
103
|
+
:style="drawingEnabled ? { background: color } : { borderColor: color }"
|
|
104
|
+
/>
|
|
105
|
+
</IconButton>
|
|
106
|
+
|
|
107
|
+
<VerticalDivider />
|
|
108
|
+
|
|
109
|
+
<IconButton title="Undo" :class="{ disabled: !canUndo }" @click="undo()">
|
|
110
|
+
<div class="i-carbon:undo" />
|
|
111
|
+
</IconButton>
|
|
112
|
+
<IconButton title="Redo" :class="{ disabled: !canRedo }" @click="redo()">
|
|
113
|
+
<div class="i-carbon:redo" />
|
|
114
|
+
</IconButton>
|
|
115
|
+
<IconButton title="Delete" :class="{ disabled: !canClear }" @click="clear()">
|
|
116
|
+
<div class="i-carbon:trash-can" />
|
|
117
|
+
</IconButton>
|
|
118
|
+
|
|
119
|
+
<VerticalDivider />
|
|
120
|
+
<IconButton :title="drawingPinned ? 'Unpin drawing' : 'Pin drawing'" :class="{ shallow: !drawingPinned }" @click="drawingPinned = !drawingPinned">
|
|
121
|
+
<div v-show="drawingPinned" class="i-carbon:pin-filled transform -rotate-45" />
|
|
122
|
+
<div v-show="!drawingPinned" class="i-carbon:pin" />
|
|
123
|
+
</IconButton>
|
|
124
|
+
<IconButton
|
|
125
|
+
v-if="drawingEnabled"
|
|
126
|
+
:title="drawingPinned ? 'Drawing pinned' : 'Drawing unpinned'"
|
|
127
|
+
:class="{ shallow: !drawingEnabled }"
|
|
128
|
+
@click="drawingEnabled = !drawingEnabled"
|
|
129
|
+
>
|
|
130
|
+
<div v-show="drawingPinned" class="i-carbon:error" />
|
|
131
|
+
<div v-show="!drawingPinned" class="i-carbon:close-outline" />
|
|
132
|
+
</IconButton>
|
|
133
|
+
</Draggable>
|
|
134
|
+
</template>
|
|
135
|
+
|
|
136
|
+
<style>
|
|
137
|
+
.v-popper--theme-menu .v-popper__arrow-inner {
|
|
138
|
+
--uno: border-main;
|
|
139
|
+
}
|
|
140
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
3
|
-
import { useSlideContext } from '../context'
|
|
4
3
|
import { useDrawings } from '../composables/useDrawings'
|
|
4
|
+
import { useSlideContext } from '../context'
|
|
5
5
|
|
|
6
6
|
const { drauu, drawingEnabled, loadCanvas } = useDrawings()
|
|
7
7
|
|
package/internals/Goto.vue
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import TitleRenderer from '#slidev/title-renderer'
|
|
3
3
|
import Fuse from 'fuse.js'
|
|
4
|
-
import {
|
|
4
|
+
import { computed, ref, watch } from 'vue'
|
|
5
5
|
import { useNav } from '../composables/useNav'
|
|
6
|
-
import
|
|
6
|
+
import { activeElement, showGotoDialog } from '../state'
|
|
7
7
|
|
|
8
8
|
const container = ref<HTMLDivElement>()
|
|
9
9
|
const input = ref<HTMLInputElement>()
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import CustomNavControls from '#slidev/custom-nav-controls'
|
|
2
3
|
import { computed, ref, shallowRef } from 'vue'
|
|
4
|
+
import { useDrawings } from '../composables/useDrawings'
|
|
5
|
+
import { useNav } from '../composables/useNav'
|
|
6
|
+
import { configs } from '../env'
|
|
3
7
|
import { isColorSchemaConfigured, isDark, toggleDark } from '../logic/dark'
|
|
4
|
-
import { downloadPDF } from '../utils'
|
|
5
8
|
import { activeElement, breakpoints, fullscreen, presenterLayout, showEditor, showInfoDialog, showPresenterCursor, toggleOverview, togglePresenterLayout } from '../state'
|
|
6
|
-
import {
|
|
7
|
-
import { useNav } from '../composables/useNav'
|
|
8
|
-
import { useDrawings } from '../composables/useDrawings'
|
|
9
|
-
import Settings from './Settings.vue'
|
|
10
|
-
import MenuButton from './MenuButton.vue'
|
|
11
|
-
import VerticalDivider from './VerticalDivider.vue'
|
|
9
|
+
import { downloadPDF } from '../utils'
|
|
12
10
|
import IconButton from './IconButton.vue'
|
|
11
|
+
import MenuButton from './MenuButton.vue'
|
|
12
|
+
import Settings from './Settings.vue'
|
|
13
13
|
|
|
14
|
-
import
|
|
14
|
+
import VerticalDivider from './VerticalDivider.vue'
|
|
15
15
|
|
|
16
16
|
const props = defineProps({
|
|
17
17
|
persist: {
|
|
@@ -63,17 +63,17 @@ if (__SLIDEV_FEATURE_RECORD__)
|
|
|
63
63
|
@mouseleave="onMouseLeave"
|
|
64
64
|
>
|
|
65
65
|
<IconButton v-if="!isEmbedded" :title="isFullscreen ? 'Close fullscreen' : 'Enter fullscreen'" @click="toggleFullscreen">
|
|
66
|
-
<
|
|
67
|
-
<
|
|
66
|
+
<div v-if="isFullscreen" class="i-carbon:minimize" />
|
|
67
|
+
<div v-else class="i-carbon:maximize" />
|
|
68
68
|
</IconButton>
|
|
69
69
|
<IconButton :class="{ disabled: !hasPrev }" title="Go to previous slide" @click="prev">
|
|
70
|
-
<carbon:arrow-left />
|
|
70
|
+
<div class="i-carbon:arrow-left" />
|
|
71
71
|
</IconButton>
|
|
72
72
|
<IconButton :class="{ disabled: !hasNext }" title="Go to next slide" @click="next">
|
|
73
|
-
<carbon:arrow-right />
|
|
73
|
+
<div class="i-carbon:arrow-right" />
|
|
74
74
|
</IconButton>
|
|
75
75
|
<IconButton v-if="!isEmbedded" title="Show slide overview" @click="toggleOverview()">
|
|
76
|
-
<carbon:apps />
|
|
76
|
+
<div class="i-carbon:apps" />
|
|
77
77
|
</IconButton>
|
|
78
78
|
<IconButton
|
|
79
79
|
v-if="!isColorSchemaConfigured"
|
|
@@ -104,7 +104,7 @@ if (__SLIDEV_FEATURE_RECORD__)
|
|
|
104
104
|
|
|
105
105
|
<template v-if="__SLIDEV_FEATURE_DRAWINGS__ && (!configs.drawings.presenterOnly || isPresenter) && !isEmbedded">
|
|
106
106
|
<IconButton class="relative" :title="drawingEnabled ? 'Hide drawing toolbar' : 'Show drawing toolbar'" @click="drawingEnabled = !drawingEnabled">
|
|
107
|
-
<carbon:pen />
|
|
107
|
+
<div class="i-carbon:pen" />
|
|
108
108
|
<div
|
|
109
109
|
v-if="drawingEnabled"
|
|
110
110
|
class="absolute left-1 right-1 bottom-0 h-0.7 rounded-full"
|
|
@@ -116,10 +116,10 @@ if (__SLIDEV_FEATURE_RECORD__)
|
|
|
116
116
|
|
|
117
117
|
<template v-if="!isEmbedded">
|
|
118
118
|
<IconButton v-if="isPresenter" title="Play Mode" @click="exitPresenter">
|
|
119
|
-
<carbon:presentation-file />
|
|
119
|
+
<div class="i-carbon:presentation-file" />
|
|
120
120
|
</IconButton>
|
|
121
121
|
<IconButton v-if="__SLIDEV_FEATURE_PRESENTER__ && isPresenterAvailable" title="Presenter Mode" @click="enterPresenter">
|
|
122
|
-
<carbon:user-speaker />
|
|
122
|
+
<div class="i-carbon:user-speaker" />
|
|
123
123
|
</IconButton>
|
|
124
124
|
|
|
125
125
|
<IconButton
|
|
@@ -128,17 +128,17 @@ if (__SLIDEV_FEATURE_RECORD__)
|
|
|
128
128
|
class="lt-md:hidden"
|
|
129
129
|
@click="showEditor = !showEditor"
|
|
130
130
|
>
|
|
131
|
-
<carbon:text-annotation-toggle />
|
|
131
|
+
<div class="i-carbon:text-annotation-toggle" />
|
|
132
132
|
</IconButton>
|
|
133
133
|
|
|
134
134
|
<IconButton v-if="isPresenter" title="Toggle Presenter Layout" class="aspect-ratio-initial" @click="togglePresenterLayout">
|
|
135
|
-
<carbon:template />
|
|
135
|
+
<div class="i-carbon:template" />
|
|
136
136
|
{{ presenterLayout }}
|
|
137
137
|
</IconButton>
|
|
138
138
|
</template>
|
|
139
139
|
<template v-if="!__DEV__">
|
|
140
140
|
<IconButton v-if="configs.download" title="Download as PDF" @click="downloadPDF">
|
|
141
|
-
<carbon:download />
|
|
141
|
+
<div class="i-carbon:download" />
|
|
142
142
|
</IconButton>
|
|
143
143
|
</template>
|
|
144
144
|
|
|
@@ -147,14 +147,14 @@ if (__SLIDEV_FEATURE_RECORD__)
|
|
|
147
147
|
title="Show info"
|
|
148
148
|
@click="showInfoDialog = !showInfoDialog"
|
|
149
149
|
>
|
|
150
|
-
<carbon:information />
|
|
150
|
+
<div class="i-carbon:information" />
|
|
151
151
|
</IconButton>
|
|
152
152
|
|
|
153
153
|
<template v-if="!isPresenter && !isEmbedded">
|
|
154
154
|
<MenuButton>
|
|
155
155
|
<template #button>
|
|
156
156
|
<IconButton title="Adjust settings">
|
|
157
|
-
<carbon:settings-adjust />
|
|
157
|
+
<div class="i-carbon:settings-adjust" />
|
|
158
158
|
</IconButton>
|
|
159
159
|
</template>
|
|
160
160
|
<template #menu>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, nextTick, onMounted, ref, watch, watchEffect } from 'vue'
|
|
3
2
|
import type { ClicksContext } from '@slidev/types'
|
|
3
|
+
import { computed, nextTick, onMounted, ref, watch, watchEffect } from 'vue'
|
|
4
4
|
import { CLICKS_MAX } from '../constants'
|
|
5
5
|
|
|
6
6
|
const props = withDefaults(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import type { ClicksContext } from '@slidev/types'
|
|
2
3
|
import type { PropType } from 'vue'
|
|
3
|
-
import { nextTick, ref, toRef, watch, watchEffect } from 'vue'
|
|
4
4
|
import { ignorableWatch, onClickOutside, useVModel } from '@vueuse/core'
|
|
5
|
-
import
|
|
5
|
+
import { nextTick, ref, toRef, watch, watchEffect } from 'vue'
|
|
6
6
|
import { useDynamicSlideInfo } from '../composables/useSlideInfo'
|
|
7
7
|
import NoteDisplay from './NoteDisplay.vue'
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { parseRangeString } from '@slidev/parser/
|
|
3
|
-
import { computed } from 'vue'
|
|
2
|
+
import { parseRangeString } from '@slidev/parser/utils'
|
|
4
3
|
import { provideLocal } from '@vueuse/core'
|
|
5
|
-
import {
|
|
6
|
-
import { injectionSlideScale } from '../constants'
|
|
4
|
+
import { computed } from 'vue'
|
|
7
5
|
import { useNav } from '../composables/useNav'
|
|
6
|
+
import { injectionSlideScale } from '../constants'
|
|
7
|
+
import { configs, slideAspect, slideWidth } from '../env'
|
|
8
8
|
import PrintSlide from './PrintSlide.vue'
|
|
9
9
|
|
|
10
10
|
const props = defineProps<{
|
package/internals/PrintSlide.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { SlideRoute } from '@slidev/types'
|
|
3
|
-
import { useFixedNav, useNav } from '../composables/useNav'
|
|
4
3
|
import { createFixedClicks } from '../composables/useClicks'
|
|
4
|
+
import { useFixedNav, useNav } from '../composables/useNav'
|
|
5
5
|
import { CLICKS_MAX } from '../constants'
|
|
6
6
|
import PrintSlideClick from './PrintSlideClick.vue'
|
|
7
7
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { SlidevContextNav } from '../composables/useNav'
|
|
3
|
+
import { GlobalBottom, GlobalTop } from '#slidev/global-layers'
|
|
3
4
|
import { provideLocal } from '@vueuse/core'
|
|
5
|
+
import { computed, reactive, shallowRef } from 'vue'
|
|
4
6
|
import { injectionSlidevContext } from '../constants'
|
|
5
7
|
import { configs, slideHeight, slideWidth } from '../env'
|
|
6
8
|
import { getSlideClass } from '../utils'
|
|
7
|
-
import type { SlidevContextNav } from '../composables/useNav'
|
|
8
9
|
import SlideWrapper from './SlideWrapper.vue'
|
|
9
|
-
import { GlobalBottom, GlobalTop } from '#slidev/global-layers'
|
|
10
10
|
|
|
11
11
|
const { nav } = defineProps<{
|
|
12
12
|
nav: SlidevContextNav
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useEventListener } from '@vueuse/core'
|
|
3
3
|
import { computed, ref, watchEffect } from 'vue'
|
|
4
|
-
import { breakpoints, showOverview, windowSize } from '../state'
|
|
5
|
-
import { currentOverviewPage, overviewRowCount } from '../logic/overview'
|
|
6
4
|
import { createFixedClicks } from '../composables/useClicks'
|
|
7
|
-
import { CLICKS_MAX } from '../constants'
|
|
8
5
|
import { useNav } from '../composables/useNav'
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
6
|
+
import { CLICKS_MAX } from '../constants'
|
|
7
|
+
import { configs, pathPrefix } from '../env'
|
|
8
|
+
import { currentOverviewPage, overviewRowCount } from '../logic/overview'
|
|
9
|
+
import { breakpoints, showOverview, windowSize } from '../state'
|
|
12
10
|
import DrawingPreview from './DrawingPreview.vue'
|
|
13
11
|
import IconButton from './IconButton.vue'
|
|
12
|
+
import SlideContainer from './SlideContainer.vue'
|
|
13
|
+
import SlideWrapper from './SlideWrapper.vue'
|
|
14
14
|
|
|
15
15
|
const { currentSlideNo, go: goSlide, slides } = useNav()
|
|
16
16
|
|
|
@@ -109,7 +109,7 @@ watchEffect(() => {
|
|
|
109
109
|
>
|
|
110
110
|
<div
|
|
111
111
|
v-if="showOverview"
|
|
112
|
-
class="fixed left-0 right-0 top-0 h-[calc(var(--vh,1vh)*100)] z-20 bg-main !bg-opacity-75 p-16 py-20 overflow-y-auto backdrop-blur-5px"
|
|
112
|
+
class="fixed left-0 right-0 top-0 h-[calc(var(--vh,1vh)*100)] z-20 bg-main !bg-opacity-75 p-16 py-20 overflow-y-auto backdrop-blur-5px select-none"
|
|
113
113
|
@click="close"
|
|
114
114
|
>
|
|
115
115
|
<div
|
|
@@ -128,6 +128,8 @@ watchEffect(() => {
|
|
|
128
128
|
>
|
|
129
129
|
<SlideContainer
|
|
130
130
|
:key="route.no"
|
|
131
|
+
:no="route.no"
|
|
132
|
+
:use-snapshot="configs.overviewSnapshots"
|
|
131
133
|
:width="cardWidth"
|
|
132
134
|
class="pointer-events-none"
|
|
133
135
|
>
|
|
@@ -157,7 +159,7 @@ watchEffect(() => {
|
|
|
157
159
|
</Transition>
|
|
158
160
|
<div v-if="showOverview" class="fixed top-4 right-4 z-20 text-gray-400 flex flex-col items-center gap-2">
|
|
159
161
|
<IconButton title="Close" class="text-2xl" @click="close">
|
|
160
|
-
<carbon:close />
|
|
162
|
+
<div class="i-carbon:close" />
|
|
161
163
|
</IconButton>
|
|
162
164
|
<IconButton
|
|
163
165
|
v-if="__SLIDEV_FEATURE_PRESENTER__"
|
|
@@ -168,7 +170,7 @@ watchEffect(() => {
|
|
|
168
170
|
tab-index="-1"
|
|
169
171
|
class="text-2xl"
|
|
170
172
|
>
|
|
171
|
-
<carbon:list-boxes />
|
|
173
|
+
<div class="i-carbon:list-boxes" />
|
|
172
174
|
</IconButton>
|
|
173
175
|
</div>
|
|
174
176
|
</template>
|
|
@@ -4,8 +4,8 @@ import { onMounted, watch } from 'vue'
|
|
|
4
4
|
import { recorder } from '../logic/recording'
|
|
5
5
|
import { currentCamera, showRecordingDialog } from '../state'
|
|
6
6
|
import DevicesList from './DevicesList.vue'
|
|
7
|
-
import MenuButton from './MenuButton.vue'
|
|
8
7
|
import IconButton from './IconButton.vue'
|
|
8
|
+
import MenuButton from './MenuButton.vue'
|
|
9
9
|
|
|
10
10
|
const {
|
|
11
11
|
recording,
|
|
@@ -41,7 +41,7 @@ onMounted(() => {
|
|
|
41
41
|
title="Toggle camera view"
|
|
42
42
|
@click="toggleAvatar"
|
|
43
43
|
>
|
|
44
|
-
<carbon:user-avatar />
|
|
44
|
+
<div class="i-carbon:user-avatar" />
|
|
45
45
|
</IconButton>
|
|
46
46
|
|
|
47
47
|
<IconButton
|
|
@@ -49,13 +49,13 @@ onMounted(() => {
|
|
|
49
49
|
:title="recording ? 'Stop record video' : 'Record video'"
|
|
50
50
|
@click="toggleRecording"
|
|
51
51
|
>
|
|
52
|
-
<
|
|
53
|
-
<
|
|
52
|
+
<div v-if="recording" class="i-carbon:stop-outline" />
|
|
53
|
+
<div v-else class="i-carbon:video" />
|
|
54
54
|
</IconButton>
|
|
55
55
|
<MenuButton :disabled="recording">
|
|
56
56
|
<template #button>
|
|
57
57
|
<IconButton title="Select recording device" class="h-full !text-sm !px-0 aspect-initial">
|
|
58
|
-
<carbon:chevron-up
|
|
58
|
+
<div class="i-carbon:chevron-up opacity-50" />
|
|
59
59
|
</IconButton>
|
|
60
60
|
</template>
|
|
61
61
|
<template #menu>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { useVModel } from '@vueuse/core'
|
|
3
3
|
import { nextTick } from 'vue'
|
|
4
4
|
import { getFilename, mimeType, recordCamera, recorder, recordingName } from '../logic/recording'
|
|
5
|
-
import Modal from './Modal.vue'
|
|
6
5
|
import DevicesList from './DevicesList.vue'
|
|
6
|
+
import Modal from './Modal.vue'
|
|
7
7
|
|
|
8
8
|
const props = defineProps({
|
|
9
9
|
modelValue: {
|
|
@@ -34,7 +34,7 @@ async function start() {
|
|
|
34
34
|
<template>
|
|
35
35
|
<Modal v-model="value" class="px-6 py-4 recording-dialog flex flex-col gap-2">
|
|
36
36
|
<div class="flex gap-2 text-xl">
|
|
37
|
-
<carbon:video
|
|
37
|
+
<div class="i-carbon:video my-auto" />Recording
|
|
38
38
|
</div>
|
|
39
39
|
<div class="grid grid-cols-2 gap-4">
|
|
40
40
|
<div class="flex flex-col gap-2 py-2">
|
package/internals/SelectList.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useVModel } from '@vueuse/core'
|
|
3
2
|
import type { PropType } from 'vue'
|
|
4
3
|
import type { SelectionItem } from './types'
|
|
4
|
+
import { useVModel } from '@vueuse/core'
|
|
5
5
|
|
|
6
6
|
const props = defineProps({
|
|
7
7
|
modelValue: {
|
|
@@ -34,8 +34,10 @@ const value = useVModel(props, 'modelValue', emit, { passive: true })
|
|
|
34
34
|
:class="{ active: value === item.value }"
|
|
35
35
|
@click="() => { value = item.value; item.onClick?.() }"
|
|
36
36
|
>
|
|
37
|
-
<carbon:checkmark
|
|
38
|
-
{
|
|
37
|
+
<div class="i-carbon:checkmark text-green-500 mya" :class="{ 'opacity-0': value !== item.value }" />
|
|
38
|
+
<div :class="{ 'opacity-50': value !== item.value }">
|
|
39
|
+
{{ item.display || item.value }}
|
|
40
|
+
</div>
|
|
39
41
|
</div>
|
|
40
42
|
</div>
|
|
41
43
|
</div>
|
|
@@ -47,7 +49,7 @@ const value = useVModel(props, 'modelValue', emit, { passive: true })
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
.item {
|
|
50
|
-
@apply flex rounded whitespace-nowrap py-1 px-
|
|
52
|
+
@apply flex rounded whitespace-nowrap py-1 gap-1 px-2 cursor-default hover:bg-gray-400 hover:bg-opacity-10;
|
|
51
53
|
|
|
52
54
|
svg {
|
|
53
55
|
@apply mr-1 -ml-2 my-auto;
|
package/internals/Settings.vue
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import type { SelectionItem } from './types'
|
|
2
3
|
import { useWakeLock } from '@vueuse/core'
|
|
3
4
|
import { slideScale, wakeLockEnabled } from '../state'
|
|
4
5
|
import SelectList from './SelectList.vue'
|
|
5
|
-
import type { SelectionItem } from './types'
|
|
6
6
|
|
|
7
7
|
const scaleItems: SelectionItem<number>[] = [
|
|
8
8
|
{
|