@slidev/client 0.49.5 → 0.49.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.
@@ -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
@@ -18,3 +18,5 @@ export const themeVars = computed(() => {
18
18
  })
19
19
 
20
20
  export const slidesTitle = configs.slidesTitle
21
+
22
+ export const pathPrefix = import.meta.env.BASE_URL + (__SLIDEV_HASH_ROUTE__ ? '#/' : '')
@@ -135,35 +135,35 @@ watch(activeElement, () => {
135
135
  @input="updateText"
136
136
  >
137
137
  </div>
138
- <ul
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
- <li
146
- v-for="(item, index) of result"
147
- ref="items"
148
- :key="item.id"
149
- role="button"
150
- tabindex="0"
151
- p="x-4 y-2"
152
- cursor-pointer
153
- hover="op100"
154
- flex="~ gap-2"
155
- w-90
156
- items-center
157
- :border="index === 0 ? '' : 't main'"
158
- :class="selectedIndex === index ? 'bg-active op100' : 'op80'"
159
- @click.stop.prevent="select(item.no)"
160
- >
161
- <div w-4 text-right op50 text-sm>
162
- {{ item.no }}
163
- </div>
164
- <TitleRenderer :no="item.no" />
165
- </li>
166
- </ul>
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="/overview"
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,9 @@ 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
+ <SlideBottom />
70
72
  <SlideComponent />
73
+ <SlideTop />
71
74
  </div>
72
75
  </template>
73
76
 
@@ -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 ? `/presenter/${no}` : `/${no}`
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.5",
4
+ "version": "0.49.7",
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.5",
63
- "@slidev/types": "0.49.5"
62
+ "@slidev/parser": "0.49.7",
63
+ "@slidev/types": "0.49.7"
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 setupReturn: MonacoSetupReturn = {}
98
+ const editorOptions: MonacoSetupReturn['editorOptions'] & object = {}
99
99
  for (const setup of setups) {
100
100
  const result = await setup(monaco)
101
- Object.assign(setupReturn, result)
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
- ...setupReturn,
120
+ editorOptions,
121
121
  }
122
122
  })
123
123