valaxy 0.20.1 → 0.20.2

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,17 +1,14 @@
1
- <script lang="ts">
2
- import { PopperWrapper } from 'floating-vue'
3
-
4
- const Component = ({
5
- ...PopperWrapper,
6
- name: 'ValaxyFootnoteTooltip',
7
- vPopperTheme: 'tooltip',
8
- }) as unknown as typeof PopperWrapper
9
-
10
- export default Component
1
+ <script setup lang="ts">
2
+ import { Tooltip } from 'floating-vue'
3
+ // distance offset for sup
11
4
  </script>
12
5
 
13
- <style scoped>
14
- div .v-popper {
15
- display: inline
16
- }
17
- </style>
6
+ <template>
7
+ <Tooltip class="inline-block" :distance="8">
8
+ <slot />
9
+
10
+ <template #popper>
11
+ <slot name="popper" />
12
+ </template>
13
+ </Tooltip>
14
+ </template>
@@ -6,13 +6,7 @@ import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
6
6
  import type { ComputedRef } from 'vue'
7
7
 
8
8
  export async function install({ app }: ViteSSGContext, config: ComputedRef<ValaxyConfig<DefaultTheme.Config>>) {
9
- app.use(FloatingVue, Object.assign({
10
- themes: {
11
- tooltip: {
12
- delay: {
13
- show: 0,
14
- },
15
- },
16
- },
17
- }, config.value.siteConfig.floatingVue || {}))
9
+ // @see https://floating-vue.starpad.dev/guide/config#default-values
10
+ const defaultFloatingVueConfig = {}
11
+ app.use(FloatingVue, Object.assign(defaultFloatingVueConfig, config.value.siteConfig.floatingVue || {}))
18
12
  }
@@ -1,6 +1,6 @@
1
1
  import { acceptHMRUpdate, defineStore } from 'pinia'
2
- import { ref } from 'vue'
3
- import { useMobile, useThemeConfig, useValaxyDark } from 'valaxy'
2
+ import { computed, ref } from 'vue'
3
+ import { useMobile, useSiteConfig, useThemeConfig, useValaxyDark } from 'valaxy'
4
4
 
5
5
  /**
6
6
  * Global store for users
@@ -11,16 +11,25 @@ import { useMobile, useThemeConfig, useValaxyDark } from 'valaxy'
11
11
  * ```
12
12
  */
13
13
  export const useAppStore = defineStore('app', () => {
14
+ const siteConfig = useSiteConfig()
15
+
14
16
  const themeConfig = useThemeConfig()
15
17
  const { isDark, toggleDark, toggleDarkWithTransition, themeColor } = useValaxyDark(themeConfig.value.valaxyDarkOptions)
16
18
 
17
19
  const isMobile = useMobile()
18
20
  const showLoading = ref(true)
19
21
 
22
+ const showToggleLocale = computed(() => siteConfig.value.languages.length > 1)
23
+
20
24
  return {
21
25
  isMobile,
22
26
  // for dark
23
27
  isDark,
28
+ /**
29
+ * show toggle locale btn
30
+ * only show toggle when `siteConfig.languages.length > 1`
31
+ */
32
+ showToggleLocale,
24
33
  themeColor,
25
34
  toggleDark,
26
35
  toggleDarkWithTransition,