valaxy-theme-press 0.19.13 → 0.20.0-beta.5

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,28 +1,29 @@
1
1
  <script lang="ts" setup>
2
- import { useAppStore, useFrontmatter } from 'valaxy'
2
+ import { useFrontmatter } from 'valaxy'
3
+ import { usePressAppStore } from '../stores/app'
3
4
  import PressOutline from './PressOutline.vue'
4
5
 
5
6
  const frontmatter = useFrontmatter()
6
- const app = useAppStore()
7
+ const press = usePressAppStore()
7
8
  </script>
8
9
 
9
10
  <template>
10
11
  <button
11
12
  class="toc-btn shadow-lg fixed press-icon-btn z-99 lt-md:hidden! xl:hidden!"
12
13
  right="5" bottom="24"
13
- @click="app.toggleRightSidebar()"
14
+ @click="press.rightSidebar.toggle()"
14
15
  >
15
16
  <div i-ri-file-list-line />
16
17
  </button>
17
18
 
18
- <ValaxyOverlay :show="app.isRightSidebarOpen" @click="app.toggleRightSidebar()" />
19
+ <ValaxyOverlay :show="press.rightSidebar.isOpen" @click="press.rightSidebar.toggle()" />
19
20
 
20
21
  <aside
21
22
  class="press-aside lt-xl:fixed shadow xl:(shadow-none hover:shadow-none) hover:shadow-lg"
22
23
  flex="~ col grow"
23
24
  p="l-0 xl:l-8" text="center"
24
25
  z="$"
25
- :class="app.isRightSidebarOpen && 'open'"
26
+ :class="press.rightSidebar.isOpen && 'open'"
26
27
  >
27
28
  <div class="aside-curtain" />
28
29
  <div class="aside-container lt-xl:fixed" flex="~ col">
@@ -11,9 +11,8 @@ const { t } = useI18n()
11
11
  const container = ref()
12
12
  const marker = ref()
13
13
 
14
- useActiveAnchor(container, marker)
15
-
16
14
  const { headers, handleClick } = useOutline()
15
+ useActiveAnchor(container, marker)
17
16
  </script>
18
17
 
19
18
  <template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-press",
3
- "version": "0.19.13",
3
+ "version": "0.20.0-beta.5",
4
4
  "description": "Docs Theme for Valaxy",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
@@ -26,6 +26,6 @@
26
26
  "@docsearch/js": "^3.6.2"
27
27
  },
28
28
  "devDependencies": {
29
- "valaxy": "0.19.13"
29
+ "valaxy": "0.20.0-beta.5"
30
30
  }
31
31
  }
package/stores/app.ts ADDED
@@ -0,0 +1,17 @@
1
+ import { acceptHMRUpdate, defineStore } from 'pinia'
2
+ import { useToggle } from '@vueuse/core'
3
+
4
+ export const usePressAppStore = defineStore('press-app', () => {
5
+ // 右侧边栏
6
+ const [isRightSidebarOpen, toggleRightSidebar] = useToggle()
7
+
8
+ return {
9
+ rightSidebar: {
10
+ isOpen: isRightSidebarOpen,
11
+ toggle: toggleRightSidebar,
12
+ },
13
+ }
14
+ })
15
+
16
+ if (import.meta.hot)
17
+ import.meta.hot.accept(acceptHMRUpdate(usePressAppStore, import.meta.hot))
@@ -0,0 +1 @@
1
+ export * from './app'