@slidev/client 0.32.2 → 0.32.3

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.
@@ -16,6 +16,7 @@ pie
16
16
  import { computed, getCurrentInstance, ref, watch, watchEffect } from 'vue'
17
17
  import { renderMermaid } from '../modules/mermaid'
18
18
  import ShadowRoot from '../internals/ShadowRoot.vue'
19
+ import { isDark } from '../logic/dark'
19
20
 
20
21
  const props = defineProps<{
21
22
  code: string
@@ -25,7 +26,13 @@ const props = defineProps<{
25
26
 
26
27
  const vm = getCurrentInstance()
27
28
  const el = ref<HTMLDivElement>()
28
- const svgObj = computed(() => renderMermaid(props.code || '', Object.assign({ theme: props.theme }, vm!.attrs)))
29
+ const svgObj = computed(() => renderMermaid(
30
+ props.code || '',
31
+ {
32
+ theme: props.theme || (isDark.value ? 'dark' : undefined),
33
+ ...vm!.attrs,
34
+ },
35
+ ))
29
36
  const html = computed(() => svgObj.value)
30
37
  const actualHeight = ref<number>()
31
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
- "version": "0.32.2",
3
+ "version": "0.32.3",
4
4
  "description": "Presentation slides for developers",
5
5
  "homepage": "https://sli.dev",
6
6
  "bugs": "https://github.com/slidevjs/slidev/issues",
@@ -13,8 +13,8 @@
13
13
  "funding": "https://github.com/sponsors/antfu",
14
14
  "dependencies": {
15
15
  "@antfu/utils": "^0.5.2",
16
- "@slidev/parser": "0.32.2",
17
- "@slidev/types": "0.32.2",
16
+ "@slidev/parser": "0.32.3",
17
+ "@slidev/types": "0.32.3",
18
18
  "@vueuse/core": "^8.5.0",
19
19
  "@vueuse/head": "^0.7.6",
20
20
  "@vueuse/motion": "^2.0.0-beta.18",