valaxy 0.14.47 → 0.14.48

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.
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { useDecrypt, useFrontmatter } from 'valaxy'
3
3
  import type { Ref } from 'vue'
4
- import { defineComponent, h, inject, ref } from 'vue'
4
+ import { defineComponent, h, inject, onMounted, ref } from 'vue'
5
5
 
6
6
  const props = defineProps<{
7
7
  encryptedContent: string
@@ -59,6 +59,12 @@ const ValaxyDeprecatedContent = defineComponent({
59
59
  })
60
60
  },
61
61
  })
62
+
63
+ const hasWarning = ref(false)
64
+ onMounted(() => {
65
+ if (location.protocol !== 'https:')
66
+ hasWarning.value = true
67
+ })
62
68
  </script>
63
69
 
64
70
  <template>
@@ -84,6 +90,12 @@ const ValaxyDeprecatedContent = defineComponent({
84
90
  text-gray hover:text-black
85
91
  @click="decryptContent"
86
92
  />
93
+
94
+ <div v-if="hasWarning" class="-bottom-6" absolute text-xs op="50">
95
+ <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API" target="_blank">
96
+ <span>Web Crypto API</span>
97
+ </a> Only works in HTTPS
98
+ </div>
87
99
  </div>
88
100
  </div>
89
101
  <div v-else>