@slidev/client 0.49.5 → 0.49.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.
- package/builtin/Monaco.vue +2 -1
- package/env.ts +2 -0
- package/internals/Goto.vue +23 -23
- package/internals/PrintSlideClick.vue +1 -3
- package/internals/QuickOverview.vue +2 -1
- package/internals/SlideWrapper.vue +7 -0
- package/internals/SlidesShow.vue +1 -3
- package/logic/slides.ts +2 -1
- package/package.json +3 -3
- package/setup/monaco.ts +3 -3
package/builtin/Monaco.vue
CHANGED
|
@@ -97,7 +97,7 @@ const stopWatchTypesLoading = whenever(
|
|
|
97
97
|
onMounted(async () => {
|
|
98
98
|
// Lazy load monaco, so it will be bundled in async chunk
|
|
99
99
|
const { default: setup } = await import('../setup/monaco')
|
|
100
|
-
const { ata, monaco } = await setup()
|
|
100
|
+
const { ata, monaco, editorOptions } = await setup()
|
|
101
101
|
const model = monaco.editor.createModel(code.value, lang, monaco.Uri.parse(`file:///${makeId()}.${ext}`))
|
|
102
102
|
model.onDidChangeContent(() => code.value = model.getValue())
|
|
103
103
|
const commonOptions = {
|
|
@@ -114,6 +114,7 @@ onMounted(async () => {
|
|
|
114
114
|
fontSize: 11.5,
|
|
115
115
|
fontFamily: 'var(--slidev-code-font-family)',
|
|
116
116
|
scrollBeyondLastLine: false,
|
|
117
|
+
...editorOptions,
|
|
117
118
|
...props.editorOptions,
|
|
118
119
|
} satisfies monaco.editor.IStandaloneEditorConstructionOptions & monaco.editor.IDiffEditorConstructionOptions
|
|
119
120
|
|
package/env.ts
CHANGED
package/internals/Goto.vue
CHANGED
|
@@ -135,35 +135,35 @@ watch(activeElement, () => {
|
|
|
135
135
|
@input="updateText"
|
|
136
136
|
>
|
|
137
137
|
</div>
|
|
138
|
-
<
|
|
138
|
+
<div
|
|
139
139
|
v-if="result.length > 0"
|
|
140
140
|
ref="list"
|
|
141
141
|
class="autocomplete-list"
|
|
142
142
|
shadow="~"
|
|
143
143
|
border="~ transparent rounded dark:main"
|
|
144
144
|
>
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
</
|
|
166
|
-
</
|
|
145
|
+
<ul table w-full border-collapse>
|
|
146
|
+
<li
|
|
147
|
+
v-for="(item, index) of result"
|
|
148
|
+
ref="items"
|
|
149
|
+
:key="item.id"
|
|
150
|
+
role="button"
|
|
151
|
+
tabindex="0"
|
|
152
|
+
cursor-pointer
|
|
153
|
+
hover="op100"
|
|
154
|
+
table-row
|
|
155
|
+
items-center
|
|
156
|
+
:border="index === 0 ? undefined : 't main'"
|
|
157
|
+
:class="selectedIndex === index ? 'bg-active op100' : 'op80'"
|
|
158
|
+
@click.stop.prevent="select(item.no)"
|
|
159
|
+
>
|
|
160
|
+
<div text-right op50 text-sm table-cell py-2 pl-4 pr-3 vertical-middle>
|
|
161
|
+
{{ item.no }}
|
|
162
|
+
</div>
|
|
163
|
+
<TitleRenderer table-cell py-2 pr-4 w-full :no="item.no" />
|
|
164
|
+
</li>
|
|
165
|
+
</ul>
|
|
166
|
+
</div>
|
|
167
167
|
</div>
|
|
168
168
|
</template>
|
|
169
169
|
|
|
@@ -6,9 +6,7 @@ import { configs, slideHeight, slideWidth } from '../env'
|
|
|
6
6
|
import { getSlideClass } from '../utils'
|
|
7
7
|
import type { SlidevContextNav } from '../composables/useNav'
|
|
8
8
|
import SlideWrapper from './SlideWrapper.vue'
|
|
9
|
-
|
|
10
|
-
import GlobalTop from '#slidev/global-components/top'
|
|
11
|
-
import GlobalBottom from '#slidev/global-components/bottom'
|
|
9
|
+
import { GlobalBottom, GlobalTop } from '#slidev/global-layers'
|
|
12
10
|
|
|
13
11
|
const { nav } = defineProps<{
|
|
14
12
|
nav: SlidevContextNav
|
|
@@ -6,6 +6,7 @@ import { currentOverviewPage, overviewRowCount } from '../logic/overview'
|
|
|
6
6
|
import { createFixedClicks } from '../composables/useClicks'
|
|
7
7
|
import { CLICKS_MAX } from '../constants'
|
|
8
8
|
import { useNav } from '../composables/useNav'
|
|
9
|
+
import { pathPrefix } from '../env'
|
|
9
10
|
import SlideContainer from './SlideContainer.vue'
|
|
10
11
|
import SlideWrapper from './SlideWrapper.vue'
|
|
11
12
|
import DrawingPreview from './DrawingPreview.vue'
|
|
@@ -169,7 +170,7 @@ setTimeout(() => {
|
|
|
169
170
|
as="a"
|
|
170
171
|
title="Slides Overview"
|
|
171
172
|
target="_blank"
|
|
172
|
-
href="
|
|
173
|
+
:href="`${pathPrefix}overview`"
|
|
173
174
|
tab-index="-1"
|
|
174
175
|
class="text-2xl"
|
|
175
176
|
>
|
|
@@ -7,6 +7,7 @@ import { injectionClicksContext, injectionCurrentPage, injectionRenderContext, i
|
|
|
7
7
|
import { getSlideClass } from '../utils'
|
|
8
8
|
import { configs } from '../env'
|
|
9
9
|
import SlideLoading from './SlideLoading.vue'
|
|
10
|
+
import { SlideBottom, SlideTop } from '#slidev/global-layers'
|
|
10
11
|
|
|
11
12
|
const props = defineProps({
|
|
12
13
|
clicksContext: {
|
|
@@ -67,7 +68,13 @@ const SlideComponent = computed(() => props.route && defineAsyncComponent({
|
|
|
67
68
|
:class="getSlideClass(route, ['slide', 'presenter'].includes(props.renderContext) ? '' : 'disable-view-transition')"
|
|
68
69
|
:style="style"
|
|
69
70
|
>
|
|
71
|
+
<div v-if="SlideBottom" class="absolute inset-0">
|
|
72
|
+
<SlideBottom />
|
|
73
|
+
</div>
|
|
70
74
|
<SlideComponent />
|
|
75
|
+
<div v-if="SlideTop" class="absolute inset-0">
|
|
76
|
+
<SlideTop />
|
|
77
|
+
</div>
|
|
71
78
|
</div>
|
|
72
79
|
</template>
|
|
73
80
|
|
package/internals/SlidesShow.vue
CHANGED
|
@@ -9,9 +9,7 @@ import { activeDragElement } from '../state'
|
|
|
9
9
|
import { CLICKS_MAX } from '../constants'
|
|
10
10
|
import SlideWrapper from './SlideWrapper.vue'
|
|
11
11
|
import DragControl from './DragControl.vue'
|
|
12
|
-
|
|
13
|
-
import GlobalTop from '#slidev/global-components/top'
|
|
14
|
-
import GlobalBottom from '#slidev/global-components/bottom'
|
|
12
|
+
import { GlobalBottom, GlobalTop } from '#slidev/global-layers'
|
|
15
13
|
|
|
16
14
|
defineProps<{
|
|
17
15
|
renderContext: 'slide' | 'presenter'
|
package/logic/slides.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SlideRoute } from '@slidev/types'
|
|
2
|
+
import { pathPrefix } from '../env'
|
|
2
3
|
import { slides } from '#slidev/slides'
|
|
3
4
|
|
|
4
5
|
export { slides }
|
|
@@ -16,5 +17,5 @@ export function getSlidePath(
|
|
|
16
17
|
if (typeof route === 'number' || typeof route === 'string')
|
|
17
18
|
route = getSlide(route)!
|
|
18
19
|
const no = route.meta.slide?.frontmatter.routeAlias ?? route.no
|
|
19
|
-
return presenter ?
|
|
20
|
+
return presenter ? `${pathPrefix}presenter/${no}` : `${pathPrefix}${no}`
|
|
20
21
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.49.
|
|
4
|
+
"version": "0.49.6",
|
|
5
5
|
"description": "Presentation slides for developers",
|
|
6
6
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"vue": "^3.4.27",
|
|
60
60
|
"vue-router": "^4.3.2",
|
|
61
61
|
"yaml": "^2.4.2",
|
|
62
|
-
"@slidev/parser": "0.49.
|
|
63
|
-
"@slidev/types": "0.49.
|
|
62
|
+
"@slidev/parser": "0.49.6",
|
|
63
|
+
"@slidev/types": "0.49.6"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"vite": "^5.2.12"
|
package/setup/monaco.ts
CHANGED
|
@@ -95,10 +95,10 @@ const setup = createSingletonPromise(async () => {
|
|
|
95
95
|
const { shiki, themes, shikiToMonaco } = await import('#slidev/shiki')
|
|
96
96
|
const highlighter = await shiki
|
|
97
97
|
|
|
98
|
-
const
|
|
98
|
+
const editorOptions: MonacoSetupReturn['editorOptions'] & object = {}
|
|
99
99
|
for (const setup of setups) {
|
|
100
100
|
const result = await setup(monaco)
|
|
101
|
-
Object.assign(
|
|
101
|
+
Object.assign(editorOptions, result?.editorOptions)
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
// Use Shiki to highlight Monaco
|
|
@@ -117,7 +117,7 @@ const setup = createSingletonPromise(async () => {
|
|
|
117
117
|
return {
|
|
118
118
|
monaco,
|
|
119
119
|
ata,
|
|
120
|
-
|
|
120
|
+
editorOptions,
|
|
121
121
|
}
|
|
122
122
|
})
|
|
123
123
|
|