@slidev/client 0.31.2 → 0.31.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.
package/builtin/Link.vue CHANGED
@@ -19,8 +19,8 @@ defineProps<{
19
19
  </script>
20
20
 
21
21
  <template>
22
- <RouterLink v-if="!isPrintMode && title" :to="to" @click="$event.target.blur()" v-html="title" />
23
- <RouterLink v-else-if="!isPrintMode && !title" :to="to" @click="$event.target.blur()">
22
+ <RouterLink v-if="!isPrintMode && title" :to="String(to)" @click="$event.target.blur()" v-html="title" />
23
+ <RouterLink v-else-if="!isPrintMode && !title" :to="String(to)" @click="$event.target.blur()">
24
24
  <slot />
25
25
  </RouterLink>
26
26
  <a v-else-if="isPrintMode && title" :href="`#${to}`" v-html="title" />
@@ -15,6 +15,7 @@ pie
15
15
  <script setup lang="ts">
16
16
  import { computed, getCurrentInstance, ref, watch, watchEffect } from 'vue'
17
17
  import { renderMermaid } from '../modules/mermaid'
18
+ import ShadowRoot from '../internals/ShadowRoot.vue'
18
19
 
19
20
  const props = defineProps<{
20
21
  code: string
@@ -51,5 +52,5 @@ watchEffect(() => {
51
52
  </script>
52
53
 
53
54
  <template>
54
- <div ref="el" class="mermaid" v-html="html" />
55
+ <ShadowRoot class="mermaid" :inner-html="html" />
55
56
  </template>
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { inject, onBeforeUnmount, onMounted, ref, watch } from 'vue'
3
- import { drauu, loadCanvas } from '../logic/drawings'
3
+ import { drauu, drawingEnabled, loadCanvas } from '../logic/drawings'
4
4
  import { injectionSlideScale } from '../constants'
5
5
 
6
6
  const scale = inject(injectionSlideScale)!
@@ -20,6 +20,7 @@ onBeforeUnmount(() => {
20
20
  <template>
21
21
  <svg
22
22
  ref="svg"
23
- class="w-full h-full absolute top-0 pointer-events-none"
23
+ class="w-full h-full absolute top-0"
24
+ :class="{ 'pointer-events-none': !drawingEnabled, 'touch-none': drawingEnabled }"
24
25
  />
25
26
  </template>
@@ -0,0 +1,18 @@
1
+ <script setup lang="ts">
2
+ import { computed, ref, watchEffect } from 'vue'
3
+
4
+ const props = defineProps<{
5
+ innerHtml: string
6
+ }>()
7
+
8
+ const el = ref<HTMLDivElement>()
9
+ const shadow = computed(() => el.value ? (el.value.shadowRoot || el.value.attachShadow({ mode: 'open' })) : null)
10
+ watchEffect(() => {
11
+ if (shadow.value)
12
+ shadow.value.innerHTML = props.innerHtml
13
+ })
14
+ </script>
15
+
16
+ <template>
17
+ <div ref="el" />
18
+ </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
- "version": "0.31.2",
3
+ "version": "0.31.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.1",
16
- "@slidev/parser": "0.31.2",
17
- "@slidev/types": "0.31.2",
16
+ "@slidev/parser": "0.31.3",
17
+ "@slidev/types": "0.31.3",
18
18
  "@vueuse/core": "^8.4.2",
19
19
  "@vueuse/head": "^0.7.6",
20
20
  "@vueuse/motion": "^2.0.0-beta.18",