@slidev/client 0.50.0-beta.11 → 0.50.0-beta.13

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.
@@ -87,7 +87,7 @@ function onMousedown() {
87
87
  v-model="current"
88
88
  class="range"
89
89
  type="range" :min="start" :max="total" :step="1"
90
- absolute inset-0 z-10 op0
90
+ absolute inset-0 z-label op0
91
91
  :class="readonly ? 'pointer-events-none' : ''"
92
92
  :style="{ '--thumb-width': `${1 / (length + 1) * 100}%` }"
93
93
  @mousedown="onMousedown"
@@ -61,7 +61,7 @@ const top = computed(() => {
61
61
  v-if="currentContextMenu"
62
62
  ref="container"
63
63
  :style="`left:${left}px;top:${top}px`"
64
- class="fixed z-100 w-60 flex flex-wrap justify-items-start p-1 animate-fade-in animate-duration-100 backdrop-blur bg-main bg-opacity-75! border border-main rounded-md shadow overflow-hidden select-none"
64
+ class="slidev-glass-effect fixed z-context-menu w-60 flex flex-wrap justify-items-start p-1 animate-fade-in animate-duration-100 rounded-md shadow overflow-hidden select-none"
65
65
  @contextmenu.prevent=""
66
66
  @click="closeContextMenu"
67
67
  >
@@ -375,7 +375,7 @@ watchEffect(() => {
375
375
  @pointermove="onPointermove"
376
376
  @pointerup="onPointerup"
377
377
  >
378
- <div class="absolute inset-0 z-100 dark:b-gray-400" :class="isArrow ? '' : 'b b-dark'">
378
+ <div class="absolute inset-0 z-nav dark:b-gray-400" :class="isArrow ? '' : 'b b-dark'">
379
379
  <template v-if="!autoHeight">
380
380
  <div v-bind="getCornerProps(true, true)" />
381
381
  <div v-bind="getCornerProps(false, false)" />
@@ -42,7 +42,7 @@ function setBrushColor(color: typeof brush.color) {
42
42
  <template>
43
43
  <Draggable
44
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"
45
+ class="flex flex-wrap text-xl p-2 gap-1 rounded-md bg-main shadow transition-opacity duration-200 z-nav border border-main"
46
46
  :class="!drawingEnabled && drawingPinned ? 'opacity-40 hover:opacity-90' : ''"
47
47
  storage-key="slidev-drawing-pos"
48
48
  :initial-x="10"
@@ -11,6 +11,6 @@ const value = defineModel<boolean>('modelValue', {
11
11
  <template>
12
12
  <div border="~ main rounded" flex="~ gap-2 items-center" relative h-5 w-5 p0.5 hover:bg-active p1>
13
13
  <div i-ri-check-line :class="value ? '' : 'op0'" />
14
- <input v-model="value" type="checkbox" absolute inset-0 z-10 opacity-0.1 :disabled="disabled">
14
+ <input v-model="value" type="checkbox" absolute inset-0 opacity-0.1 :disabled="disabled">
15
15
  </div>
16
16
  </template>
@@ -1,6 +1,5 @@
1
1
  <script setup lang="ts">
2
2
  import { Tooltip } from 'floating-vue'
3
- import { defineEmits, defineProps } from 'vue'
4
3
 
5
4
  defineProps<{
6
5
  title: string
@@ -30,7 +30,7 @@ onClickOutside(el, () => {
30
30
  <KeepAlive>
31
31
  <div
32
32
  v-if="value"
33
- class="rounded-md bg-main text-main shadow absolute bottom-10 left-0 z-20"
33
+ class="rounded-md bg-main text-main shadow-xl absolute bottom-10 left-0 z-menu"
34
34
  dark:border="~ main"
35
35
  >
36
36
  <slot name="menu" />
@@ -20,7 +20,7 @@ function onClick() {
20
20
 
21
21
  <template>
22
22
  <KeepAlive>
23
- <div v-if="value" class="fixed top-0 bottom-0 left-0 right-0 grid z-20">
23
+ <div v-if="value" class="fixed top-0 bottom-0 left-0 right-0 grid z-modal">
24
24
  <div
25
25
  bg="black opacity-80"
26
26
  class="absolute top-0 bottom-0 left-0 right-0 -z-1"
@@ -48,7 +48,7 @@ function onMouseLeave() {
48
48
 
49
49
  const barStyle = computed(() => props.persist
50
50
  ? 'text-$slidev-controls-foreground bg-transparent'
51
- : 'rounded-md bg-main shadow dark:border dark:border-main')
51
+ : 'rounded-md bg-main shadow-xl dark:border dark:border-main')
52
52
 
53
53
  const RecordingControls = shallowRef<any>()
54
54
  if (__SLIDEV_FEATURE_RECORD__)
@@ -143,7 +143,7 @@ if (__SLIDEV_FEATURE_RECORD__)
143
143
  </template>
144
144
 
145
145
  <template v-if="__SLIDEV_FEATURE_BROWSER_EXPORTER__">
146
- <IconButton title="Browser Explorer" to="/export">
146
+ <IconButton title="Browser Exporter" to="/export">
147
147
  <div class="i-carbon:document-pdf" />
148
148
  </IconButton>
149
149
  </template>
@@ -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 select-none"
112
+ class="fixed left-0 right-0 top-0 h-[calc(var(--vh,1vh)*100)] z-modal 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
@@ -157,7 +157,7 @@ watchEffect(() => {
157
157
  </div>
158
158
  </div>
159
159
  </Transition>
160
- <div v-if="showOverview" class="fixed top-4 right-4 z-20 text-gray-400 flex flex-col items-center gap-2">
160
+ <div v-if="showOverview" class="fixed top-4 right-4 z-modal text-gray-400 flex flex-col items-center gap-2">
161
161
  <IconButton title="Close" class="text-2xl" @click="close">
162
162
  <div class="i-carbon:close" />
163
163
  </IconButton>
@@ -121,7 +121,7 @@ throttledWatch(
121
121
 
122
122
  <template>
123
123
  <div
124
- v-if="resize" class="fixed bg-gray-400 select-none opacity-0 hover:opacity-10 z-100"
124
+ v-if="resize" class="fixed bg-gray-400 select-none opacity-0 hover:opacity-10 z-dragging"
125
125
  :class="vertical ? 'left-0 right-0 w-full h-10px' : 'top-0 bottom-0 w-10px h-full'" :style="{
126
126
  opacity: handlerDown ? '0.3' : undefined,
127
127
  bottom: vertical ? `${editorHeight - 5}px` : undefined,
@@ -63,7 +63,7 @@ onMounted(fixPosition)
63
63
  <template>
64
64
  <div
65
65
  v-if="streamCamera && showAvatar && currentCamera !== 'none'"
66
- class="fixed z-10"
66
+ class="fixed z-camera"
67
67
  :style="containerStyle"
68
68
  >
69
69
  <div
@@ -83,7 +83,7 @@ onMounted(fixPosition)
83
83
 
84
84
  <div
85
85
  ref="handler"
86
- class="absolute bottom-0 right-0 rounded-full bg-main shadow opacity-0 shadow z-30 hover:opacity-100 dark:border dark:border-true-gray-700"
86
+ class="absolute bottom-0 right-0 rounded-full bg-main shadow opacity-0 shadow z-dragging hover:opacity-100 dark:border dark:border-true-gray-700"
87
87
  :style="handleStyle"
88
88
  :class="handlerDown ? '!opacity-100' : ''"
89
89
  />
package/logic/dark.ts CHANGED
@@ -26,12 +26,23 @@ export const isDark = computed<boolean>({
26
26
  export const toggleDark = useToggle(isDark)
27
27
 
28
28
  if (isClient) {
29
+ const CSS_DISABLE_TRANS = '*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}'
30
+
29
31
  watch(
30
32
  isDark,
31
33
  (v) => {
34
+ const style = window!.document.createElement('style')
35
+ style.appendChild(document.createTextNode(CSS_DISABLE_TRANS))
36
+ window!.document.head.appendChild(style)
37
+
32
38
  const html = document.querySelector('html')!
33
39
  html.classList.toggle('dark', v)
34
40
  html.classList.toggle('light', !v)
41
+
42
+ // Calling getComputedStyle forces the browser to redraw
43
+ // @ts-expect-error unused variable
44
+ const _ = window!.getComputedStyle(style!).opacity
45
+ document.head.removeChild(style!)
35
46
  },
36
47
  { immediate: true },
37
48
  )
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
3
  "type": "module",
4
- "version": "0.50.0-beta.11",
4
+ "version": "0.50.0-beta.13",
5
5
  "description": "Presentation slides for developers",
6
6
  "author": "antfu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@antfu/utils": "^0.7.10",
32
- "@iconify-json/carbon": "^1.2.4",
33
- "@iconify-json/ph": "^1.2.1",
34
- "@iconify-json/svg-spinners": "^1.2.1",
32
+ "@iconify-json/carbon": "^1.2.5",
33
+ "@iconify-json/ph": "^1.2.2",
34
+ "@iconify-json/svg-spinners": "^1.2.2",
35
35
  "@shikijs/monaco": "^1.24.2",
36
36
  "@shikijs/vitepress-twoslash": "^1.24.2",
37
37
  "@slidev/rough-notation": "^0.1.0",
@@ -46,7 +46,7 @@
46
46
  "floating-vue": "^5.2.2",
47
47
  "fuse.js": "^7.0.0",
48
48
  "html-to-image": "^1.11.11",
49
- "katex": "^0.16.15",
49
+ "katex": "^0.16.17",
50
50
  "lz-string": "^1.5.0",
51
51
  "mermaid": "^11.4.1",
52
52
  "monaco-editor": "0.51.0",
@@ -61,8 +61,8 @@
61
61
  "vue": "^3.5.13",
62
62
  "vue-router": "^4.5.0",
63
63
  "yaml": "^2.6.1",
64
- "@slidev/types": "0.50.0-beta.11",
65
- "@slidev/parser": "0.50.0-beta.11"
64
+ "@slidev/types": "0.50.0-beta.13",
65
+ "@slidev/parser": "0.50.0-beta.13"
66
66
  },
67
67
  "devDependencies": {
68
68
  "vite": "^6.0.3"
package/pages/export.vue CHANGED
@@ -281,7 +281,7 @@ if (import.meta.hot) {
281
281
  </div>
282
282
  </div>
283
283
  <div id="export-container" ref="export-container" relative>
284
- <div print:hidden fixed right-5 bottom-5 bg-main px2 py0 shadow z-1000 border="~ main rounded">
284
+ <div print:hidden fixed right-5 bottom-5 px2 py0 z-label slidev-glass-effect>
285
285
  <span op75>Rendering as {{ capturedImages ? 'Captured Images' : 'DOM' }} </span>
286
286
  </div>
287
287
  <div v-show="!capturedImages" id="export-content" ref="export-content">
@@ -135,7 +135,7 @@ onMounted(() => {
135
135
  </button>
136
136
  <div
137
137
  v-if="route.meta?.slide?.title"
138
- class="pointer-events-none select-none absolute left-110% backdrop-blur-8 top-50% translate-y--50% ws-nowrap z-10 px2 shadow-xl rounded border border-main transition duration-400 op0 group-hover:op100"
138
+ class="pointer-events-none select-none absolute left-110% top-50% translate-y--50% ws-nowrap z-label px2 slidev-glass-effect transition duration-400 op0 group-hover:op100"
139
139
  :class="activeBlocks.includes(idx) ? 'text-primary' : 'text-main important-text-op-50'"
140
140
  >
141
141
  {{ route.meta?.slide?.title }}
package/styles/index.css CHANGED
@@ -10,7 +10,7 @@ body,
10
10
  overflow: hidden;
11
11
  print-color-adjust: exact;
12
12
  -webkit-print-color-adjust: exact;
13
- @apply font-sans;
13
+ --uno: font-sans bg-main;
14
14
  }
15
15
 
16
16
  html {
package/uno.config.ts CHANGED
@@ -30,6 +30,17 @@ export default defineConfig({
30
30
  'abs-b': 'absolute bottom-0 left-0 right-0',
31
31
  'abs-bl': 'absolute bottom-0 left-0',
32
32
  'abs-br': 'absolute bottom-0 right-0',
33
+
34
+ 'z-drawing': 'z-10',
35
+ 'z-camera': 'z-15',
36
+ 'z-dragging': 'z-18',
37
+ 'z-menu': 'z-20',
38
+ 'z-label': 'z-40',
39
+ 'z-nav': 'z-50',
40
+ 'z-context-menu': 'z-60',
41
+ 'z-modal': 'z-70',
42
+
43
+ 'slidev-glass-effect': 'shadow-xl backdrop-blur-8 border border-main bg-main bg-opacity-75!',
33
44
  },
34
45
  // Slidev Specific Variants, probably extrat to a preset later
35
46
  variants: [