valaxy-theme-lolimeow 1.0.2 → 1.0.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/client/index.ts +1 -1
- package/components/LmBackgroundLayer.vue +2 -2
- package/components/LmComment.vue +1 -1
- package/components/LmFooter.vue +2 -2
- package/components/LmHelper.vue +1 -1
- package/components/LmNotice.vue +3 -3
- package/components/about/LmAbout.vue +1 -1
- package/components/about/LmAboutSocialLinks.vue +1 -1
- package/components/archive/LmArchiveEntryList.vue +1 -1
- package/components/archive/LmArchiveRail.vue +1 -1
- package/components/archive/LmArchiveTimeline.vue +2 -2
- package/components/archive/LmArchives.vue +2 -2
- package/components/article/LmArticleHeader.vue +1 -1
- package/components/article/LmPostNav.vue +1 -1
- package/components/article/LmToc.vue +1 -1
- package/components/article/LmTocMobile.vue +2 -2
- package/components/category/LmCategories.vue +2 -2
- package/components/category/LmCategoryEntryList.vue +1 -1
- package/components/category/LmCategoryTree.vue +1 -1
- package/components/core/layout.vue +1 -1
- package/components/home/LmHero.vue +4 -3
- package/components/home/LmHeroIdentity.vue +3 -2
- package/components/home/LmHeroSocialLinks.vue +1 -1
- package/components/home/LmHomeContent.vue +1 -1
- package/components/home/LmPagination.vue +2 -2
- package/components/home/LmPinned.vue +2 -2
- package/components/home/LmPostCard.vue +2 -2
- package/components/home/LmPostList.vue +2 -2
- package/components/link/LmLinkCard.vue +1 -1
- package/components/link/LmLinkList.vue +1 -1
- package/components/link/LmLinkStatus.vue +1 -1
- package/components/link/LmLinks.vue +2 -2
- package/components/navbar/LmMobileDrawer.vue +5 -5
- package/components/navbar/LmNav.vue +2 -2
- package/components/navbar/LmNavItem.vue +2 -2
- package/components/navbar/LmNavTools.vue +1 -1
- package/components/search/LmFuseSearchProvider.vue +3 -3
- package/components/search/LmSearchBody.vue +1 -1
- package/components/search/LmSearchResultList.vue +1 -1
- package/components/search/LmSearchShell.vue +1 -1
- package/components/tag/LmTagCloud.vue +2 -2
- package/components/tag/LmTagEntryList.vue +1 -1
- package/components/tag/LmTagIndex.vue +1 -1
- package/components/tag/LmTags.vue +2 -2
- package/composables/config.ts +1 -1
- package/composables/use-about-profile.ts +1 -1
- package/composables/use-archive-groups.ts +1 -1
- package/composables/use-archive-timeline-state.ts +1 -1
- package/composables/use-article-header-meta.ts +1 -1
- package/composables/use-article-toc-state.ts +1 -1
- package/composables/use-background-runtime.ts +2 -2
- package/composables/use-category-groups.ts +1 -1
- package/composables/use-hero-motto.ts +63 -32
- package/composables/use-hero-stage.ts +1 -1
- package/composables/use-home-pagination-scroll.ts +1 -1
- package/composables/use-layout-shell.ts +1 -1
- package/composables/use-link-groups.ts +1 -1
- package/composables/use-link-status.ts +1 -1
- package/composables/use-nav-active.ts +1 -1
- package/composables/use-navbar-visibility.ts +1 -1
- package/composables/use-pinned-entries.ts +1 -1
- package/composables/use-post-card-view-model.ts +1 -1
- package/composables/use-resolved-background.ts +1 -1
- package/composables/use-search-modal.ts +1 -1
- package/composables/use-tag-groups.ts +1 -1
- package/layouts/404.vue +1 -1
- package/node/config.ts +1 -1
- package/node/plugins.ts +1 -1
- package/package.json +4 -5
- package/types/hero.d.ts +21 -3
- package/utils/background.ts +1 -1
- package/utils/hitokoto.ts +56 -0
- package/utils/index.ts +1 -0
- package/valaxy.config.ts +0 -17
package/client/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '../composables'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { useBackgroundRuntime, useResolvedBackground } from '@theme/composables'
|
|
3
|
-
import { createBackgroundImageStyle } from '@theme/utils'
|
|
4
2
|
import { computed } from 'vue'
|
|
3
|
+
import { useBackgroundRuntime, useResolvedBackground } from '../composables'
|
|
4
|
+
import { createBackgroundImageStyle } from '../utils'
|
|
5
5
|
|
|
6
6
|
const background = useResolvedBackground('app')
|
|
7
7
|
const runtimeBackground = useBackgroundRuntime('app', background)
|
package/components/LmComment.vue
CHANGED
|
@@ -4,7 +4,7 @@ import { computed, defineAsyncComponent } from 'vue'
|
|
|
4
4
|
|
|
5
5
|
type CommentProvider = 'waline'
|
|
6
6
|
|
|
7
|
-
const WalineComment = defineAsyncComponent(() => import('
|
|
7
|
+
const WalineComment = defineAsyncComponent(() => import('../components/plugins/LmWaline.vue'))
|
|
8
8
|
|
|
9
9
|
const siteConfig = useSiteConfig()
|
|
10
10
|
const frontmatter = useFrontmatter()
|
package/components/LmFooter.vue
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { useThemeConfig } from '@theme/composables'
|
|
3
2
|
import { useSiteConfig, useValaxyConfig } from 'valaxy'
|
|
4
3
|
import pkg from 'valaxy/package.json'
|
|
5
|
-
|
|
6
4
|
import { capitalize, computed } from 'vue'
|
|
5
|
+
|
|
7
6
|
import { useI18n } from 'vue-i18n'
|
|
7
|
+
import { useThemeConfig } from '../composables'
|
|
8
8
|
|
|
9
9
|
const { t } = useI18n()
|
|
10
10
|
|
package/components/LmHelper.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { getDocumentElement, getWindow } from '@theme/utils'
|
|
3
2
|
import { isClient, useWindowScroll } from '@vueuse/core'
|
|
4
3
|
import { computed } from 'vue'
|
|
4
|
+
import { getDocumentElement, getWindow } from '../utils'
|
|
5
5
|
|
|
6
6
|
const { y } = useWindowScroll()
|
|
7
7
|
|
package/components/LmNotice.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useThemeConfig } from '@theme/composables'
|
|
3
|
-
import { getSessionStorage } from '@theme/utils'
|
|
4
2
|
import { computed, ref, watch } from 'vue'
|
|
3
|
+
import { useThemeConfig } from '../composables'
|
|
4
|
+
import { getSessionStorage } from '../utils'
|
|
5
5
|
|
|
6
6
|
const themeConfig = useThemeConfig()
|
|
7
7
|
|
|
@@ -79,7 +79,7 @@ function closeNotice() {
|
|
|
79
79
|
</template>
|
|
80
80
|
|
|
81
81
|
<style lang="scss" scoped>
|
|
82
|
-
@use '
|
|
82
|
+
@use '../styles/mixins/surface' as *;
|
|
83
83
|
|
|
84
84
|
.lm-notice {
|
|
85
85
|
@include lm-surface-panel(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { ArchiveGroup } from '
|
|
3
|
-
import { useArchiveTimelineState } from '
|
|
2
|
+
import type { ArchiveGroup } from '../../composables'
|
|
3
|
+
import { useArchiveTimelineState } from '../../composables'
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
6
6
|
groups: ArchiveGroup[]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useArchiveGroups } from '@theme/composables'
|
|
3
|
-
import { resolveFrontmatterCover, resolveFrontmatterText } from '@theme/utils'
|
|
4
2
|
import { useFrontmatter } from 'valaxy'
|
|
5
3
|
import { computed } from 'vue'
|
|
6
4
|
import { useI18n } from 'vue-i18n'
|
|
5
|
+
import { useArchiveGroups } from '../../composables'
|
|
6
|
+
import { resolveFrontmatterCover, resolveFrontmatterText } from '../../utils'
|
|
7
7
|
|
|
8
8
|
const { t } = useI18n()
|
|
9
9
|
const frontmatter = useFrontmatter()
|
|
@@ -36,7 +36,7 @@ const hasPostNav = computed(() => navEnabled.value && (!!prevPath.value || !!nex
|
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
38
|
<style lang="scss" scoped>
|
|
39
|
-
@use '
|
|
39
|
+
@use '../../styles/mixins/surface' as *;
|
|
40
40
|
|
|
41
41
|
.lm-post-nav {
|
|
42
42
|
@apply mx-auto mt-4 flex w-full flex-col gap-3 md:flex-row md:justify-between px-4 sm:px-6 xl:px-0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useArticleTocState } from '@theme/composables'
|
|
3
2
|
import { nextTick, ref, watch } from 'vue'
|
|
3
|
+
import { useArticleTocState } from '../../composables'
|
|
4
4
|
|
|
5
5
|
const { items, visible, activeLink, handleClick } = useArticleTocState()
|
|
6
6
|
const navRef = ref<HTMLElement>()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useArticleTocState } from '@theme/composables'
|
|
3
|
-
import { removeDocumentClass, toggleDocumentClass } from '@theme/utils'
|
|
4
2
|
import { onBeforeUnmount, ref, watch } from 'vue'
|
|
3
|
+
import { useArticleTocState } from '../../composables'
|
|
4
|
+
import { removeDocumentClass, toggleDocumentClass } from '../../utils'
|
|
5
5
|
|
|
6
6
|
const { items, visible, activeLink, handleClick } = useArticleTocState()
|
|
7
7
|
const open = ref(false)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useCategoryGroups } from '@theme/composables'
|
|
3
|
-
import { resolveFrontmatterCover, resolveFrontmatterText } from '@theme/utils'
|
|
4
2
|
import { useFrontmatter } from 'valaxy'
|
|
5
3
|
import { computed } from 'vue'
|
|
6
4
|
import { useI18n } from 'vue-i18n'
|
|
5
|
+
import { useCategoryGroups } from '../../composables'
|
|
6
|
+
import { resolveFrontmatterCover, resolveFrontmatterText } from '../../utils'
|
|
7
7
|
|
|
8
8
|
const { t } = useI18n()
|
|
9
9
|
const frontmatter = useFrontmatter()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useHomePaginationScrollBehavior, useLayoutShell } from '@theme/composables'
|
|
3
2
|
import { useRouter } from 'vue-router'
|
|
3
|
+
import { useHomePaginationScrollBehavior, useLayoutShell } from '../../composables'
|
|
4
4
|
|
|
5
5
|
defineProps<{
|
|
6
6
|
hideFooter?: boolean
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { useHeroMotto, useHeroStage, useThemeConfig } from '@theme/composables'
|
|
3
2
|
import { useSiteConfig } from 'valaxy'
|
|
4
3
|
import { computed, useTemplateRef } from 'vue'
|
|
4
|
+
import { useHeroMotto, useHeroStage, useThemeConfig } from '../../composables'
|
|
5
5
|
|
|
6
6
|
interface SocialLink {
|
|
7
7
|
name: string
|
|
@@ -17,7 +17,7 @@ interface SiteAuthor {
|
|
|
17
17
|
|
|
18
18
|
const siteConfig = useSiteConfig()
|
|
19
19
|
const themeConfig = useThemeConfig()
|
|
20
|
-
const { hasMotto, renderedMotto } = useHeroMotto()
|
|
20
|
+
const { hasMotto, renderedMotto, shouldShowMotto } = useHeroMotto()
|
|
21
21
|
const heroSection = useTemplateRef<HTMLElement>('heroSection')
|
|
22
22
|
|
|
23
23
|
const {
|
|
@@ -81,6 +81,7 @@ const showSocialIcons = computed(() => themeConfig.value.hero.showSocialIcons &&
|
|
|
81
81
|
:subtitle="siteSubtitle"
|
|
82
82
|
:has-motto="hasMotto"
|
|
83
83
|
:rendered-motto="renderedMotto"
|
|
84
|
+
:should-show-motto="shouldShowMotto"
|
|
84
85
|
/>
|
|
85
86
|
|
|
86
87
|
<LmHeroSocialLinks
|
|
@@ -102,7 +103,7 @@ const showSocialIcons = computed(() => themeConfig.value.hero.showSocialIcons &&
|
|
|
102
103
|
</template>
|
|
103
104
|
|
|
104
105
|
<style scoped lang="scss">
|
|
105
|
-
@use '
|
|
106
|
+
@use '../../styles/mixins/surface' as *;
|
|
106
107
|
|
|
107
108
|
.lm-hero-content {
|
|
108
109
|
@apply relative z-10 flex w-full max-w-5xl flex-col justify-center px-4 sm:px-6 lg:px-8;
|
|
@@ -6,6 +6,7 @@ const props = defineProps<{
|
|
|
6
6
|
subtitle?: string
|
|
7
7
|
hasMotto: boolean
|
|
8
8
|
renderedMotto: string
|
|
9
|
+
shouldShowMotto: boolean
|
|
9
10
|
}>()
|
|
10
11
|
</script>
|
|
11
12
|
|
|
@@ -34,7 +35,7 @@ const props = defineProps<{
|
|
|
34
35
|
</div>
|
|
35
36
|
|
|
36
37
|
<div
|
|
37
|
-
v-if="props.
|
|
38
|
+
v-if="props.shouldShowMotto"
|
|
38
39
|
class="lm-hero-motto-strip"
|
|
39
40
|
>
|
|
40
41
|
<p
|
|
@@ -47,7 +48,7 @@ const props = defineProps<{
|
|
|
47
48
|
</template>
|
|
48
49
|
|
|
49
50
|
<style scoped lang="scss">
|
|
50
|
-
@use '
|
|
51
|
+
@use '../../styles/mixins/surface' as *;
|
|
51
52
|
|
|
52
53
|
.lm-hero-avatar-badge {
|
|
53
54
|
@apply relative z-10 flex h-22 w-22 items-center justify-center rounded-full p-1.5 md:h-24 md:w-24;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { usePaginationItems } from '
|
|
2
|
+
import { usePaginationItems } from '../../composables'
|
|
3
3
|
|
|
4
4
|
const props = withDefaults(defineProps<{
|
|
5
5
|
currentPage?: number
|
|
@@ -62,7 +62,7 @@ const {
|
|
|
62
62
|
</template>
|
|
63
63
|
|
|
64
64
|
<style lang="scss" scoped>
|
|
65
|
-
@use '
|
|
65
|
+
@use '../../styles/mixins/surface' as *;
|
|
66
66
|
|
|
67
67
|
.lm-pagination {
|
|
68
68
|
@apply mt-6 flex items-center justify-center gap-3;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { usePinnedEntries } from '
|
|
2
|
+
import { usePinnedEntries } from '../../composables'
|
|
3
3
|
|
|
4
4
|
const {
|
|
5
5
|
sectionTitle,
|
|
@@ -56,7 +56,7 @@ const {
|
|
|
56
56
|
</template>
|
|
57
57
|
|
|
58
58
|
<style scoped lang="scss">
|
|
59
|
-
@use '
|
|
59
|
+
@use '../../styles/mixins/surface' as *;
|
|
60
60
|
|
|
61
61
|
.lm-pinned {
|
|
62
62
|
@apply pt-6 md:pt-8;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import type { Post } from 'valaxy'
|
|
3
|
-
import { usePostCardMediaState, usePostCardViewModel } from '
|
|
3
|
+
import { usePostCardMediaState, usePostCardViewModel } from '../../composables'
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
6
6
|
post: Post
|
|
@@ -75,7 +75,7 @@ const {
|
|
|
75
75
|
</template>
|
|
76
76
|
|
|
77
77
|
<style lang="scss" scoped>
|
|
78
|
-
@use '
|
|
78
|
+
@use '../../styles/mixins/surface' as *;
|
|
79
79
|
|
|
80
80
|
.lm-post-card {
|
|
81
81
|
@include lm-surface-panel;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Post } from 'valaxy'
|
|
3
|
-
import { useThemeConfig } from '@theme/composables'
|
|
4
|
-
import { clampColumnCount, getRootFontSize, resolveGridColumnCount, resolveLengthToPx } from '@theme/utils'
|
|
5
3
|
import { useElementSize } from '@vueuse/core'
|
|
6
4
|
import { useSiteStore } from 'valaxy'
|
|
7
5
|
import { computed, ref } from 'vue'
|
|
6
|
+
import { useThemeConfig } from '../../composables'
|
|
7
|
+
import { clampColumnCount, getRootFontSize, resolveGridColumnCount, resolveLengthToPx } from '../../utils'
|
|
8
8
|
|
|
9
9
|
const props = withDefaults(defineProps<{
|
|
10
10
|
type?: string
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useLinkGroups } from '@theme/composables'
|
|
3
|
-
import { resolveFrontmatterCover, resolveFrontmatterText } from '@theme/utils'
|
|
4
2
|
import { useFrontmatter } from 'valaxy'
|
|
5
3
|
import { computed } from 'vue'
|
|
6
4
|
import { useI18n } from 'vue-i18n'
|
|
5
|
+
import { useLinkGroups } from '../../composables'
|
|
6
|
+
import { resolveFrontmatterCover, resolveFrontmatterText } from '../../utils'
|
|
7
7
|
|
|
8
8
|
const { t } = useI18n()
|
|
9
9
|
const frontmatter = useFrontmatter()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { NavItem } from '
|
|
3
|
-
import type { BrowserTimeout } from '
|
|
4
|
-
import { useNavActive } from '@theme/composables'
|
|
5
|
-
import { clearBrowserTimeout, getWindow, setBrowserTimeout } from '@theme/utils'
|
|
2
|
+
import type { NavItem } from '../../types'
|
|
3
|
+
import type { BrowserTimeout } from '../../utils'
|
|
6
4
|
import { useRouter } from 'vue-router'
|
|
5
|
+
import { useNavActive } from '../../composables'
|
|
6
|
+
import { clearBrowserTimeout, getWindow, setBrowserTimeout } from '../../utils'
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
9
9
|
open: boolean
|
|
@@ -125,7 +125,7 @@ function leave(el: Element) {
|
|
|
125
125
|
</template>
|
|
126
126
|
|
|
127
127
|
<style lang="scss" scoped>
|
|
128
|
-
@use '
|
|
128
|
+
@use '../../styles/mixins/surface' as *;
|
|
129
129
|
|
|
130
130
|
.lm-mobile-nav-panel {
|
|
131
131
|
@include lm-surface-panel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { NavItem } from '
|
|
2
|
+
import type { NavItem } from '../../types'
|
|
3
3
|
|
|
4
4
|
const props = defineProps<{
|
|
5
5
|
drawerOpen: boolean
|
|
@@ -37,7 +37,7 @@ const emit = defineEmits<{
|
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
39
|
<style lang="scss" scoped>
|
|
40
|
-
@use '
|
|
40
|
+
@use '../../styles/mixins/surface' as *;
|
|
41
41
|
|
|
42
42
|
.lm-nav {
|
|
43
43
|
@include lm-surface-nav;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { NavItem } from '
|
|
3
|
-
import { useNavActive } from '
|
|
2
|
+
import type { NavItem } from '../../types'
|
|
3
|
+
import { useNavActive } from '../../composables'
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
6
6
|
item: NavItem
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { useNavbarTools, useThemeConfig } from '@theme/composables'
|
|
3
2
|
import { useAppStore } from 'valaxy'
|
|
4
3
|
import { computed } from 'vue'
|
|
4
|
+
import { useNavbarTools, useThemeConfig } from '../../composables'
|
|
5
5
|
|
|
6
6
|
const props = defineProps<{
|
|
7
7
|
drawerOpen: boolean
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { LmFuseSearchResult } from '
|
|
3
|
-
import { useLmFuseSearch } from '@theme/composables'
|
|
4
|
-
import { createDebouncedFunction } from '@theme/utils'
|
|
2
|
+
import type { LmFuseSearchResult } from '../../composables'
|
|
5
3
|
import { computed, onUnmounted, ref, watch } from 'vue'
|
|
6
4
|
import { useRouter } from 'vue-router'
|
|
5
|
+
import { useLmFuseSearch } from '../../composables'
|
|
6
|
+
import { createDebouncedFunction } from '../../utils'
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
9
9
|
open: boolean
|
|
@@ -34,7 +34,7 @@ const emit = defineEmits<{
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<style scoped lang="scss">
|
|
37
|
-
@use '
|
|
37
|
+
@use '../../styles/mixins/surface' as *;
|
|
38
38
|
|
|
39
39
|
.lm-search-shell {
|
|
40
40
|
@apply px-4 pt-[8vh] flex pointer-events-none items-start inset-0 justify-center fixed z-[var(--lm-z-modal)];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { TagCloudSourceItem } from '
|
|
3
|
-
import { useTagCloud } from '
|
|
2
|
+
import type { TagCloudSourceItem } from '../../composables'
|
|
3
|
+
import { useTagCloud } from '../../composables'
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
6
6
|
items: TagCloudSourceItem[]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useTagGroups } from '@theme/composables'
|
|
3
|
-
import { resolveFrontmatterCover, resolveFrontmatterText } from '@theme/utils'
|
|
4
2
|
import { useFrontmatter } from 'valaxy'
|
|
5
3
|
import { computed } from 'vue'
|
|
6
4
|
import { useI18n } from 'vue-i18n'
|
|
5
|
+
import { useTagGroups } from '../../composables'
|
|
6
|
+
import { resolveFrontmatterCover, resolveFrontmatterText } from '../../utils'
|
|
7
7
|
|
|
8
8
|
const { t } = useI18n()
|
|
9
9
|
const frontmatter = useFrontmatter()
|
package/composables/config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { resolveFrontmatterCover, resolveFrontmatterText } from '@theme/utils'
|
|
2
1
|
import { useFrontmatter, useSiteConfig } from 'valaxy'
|
|
3
2
|
import { computed } from 'vue'
|
|
4
3
|
import { useI18n } from 'vue-i18n'
|
|
4
|
+
import { resolveFrontmatterCover, resolveFrontmatterText } from '../utils'
|
|
5
5
|
|
|
6
6
|
interface SiteAuthor {
|
|
7
7
|
avatar?: string
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Post } from 'valaxy'
|
|
2
|
-
import { isVisiblePost, normalizePostTitle, resolvePostTimestamp } from '@theme/utils'
|
|
3
2
|
import { useSiteStore } from 'valaxy'
|
|
4
3
|
import { computed } from 'vue'
|
|
4
|
+
import { isVisiblePost, normalizePostTitle, resolvePostTimestamp } from '../utils'
|
|
5
5
|
|
|
6
6
|
export interface ArchiveEntry {
|
|
7
7
|
path: string
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ArchiveGroup } from './use-archive-groups'
|
|
2
|
-
import { ARCHIVE_ACCORDION_BREAKPOINT } from '@theme/utils'
|
|
3
2
|
import { useWindowSize } from '@vueuse/core'
|
|
4
3
|
import { computed, ref, watch } from 'vue'
|
|
4
|
+
import { ARCHIVE_ACCORDION_BREAKPOINT } from '../utils'
|
|
5
5
|
|
|
6
6
|
export function useArchiveTimelineState(getGroups: () => ArchiveGroup[]) {
|
|
7
7
|
const { width } = useWindowSize()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { resolveFrontmatterCover, resolveFrontmatterText } from '@theme/utils'
|
|
2
1
|
import { formatDate, useFrontmatter } from 'valaxy'
|
|
3
2
|
import { computed } from 'vue'
|
|
3
|
+
import { resolveFrontmatterCover, resolveFrontmatterText } from '../utils'
|
|
4
4
|
|
|
5
5
|
interface ArticleInfoItem {
|
|
6
6
|
icon: string
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MenuItem } from '@valaxyjs/utils'
|
|
2
|
-
import { createThrottledFunction, getDocument, getDocumentElement, getWindow, lockNavbarScrollReaction } from '@theme/utils'
|
|
3
2
|
import { useOutline } from 'valaxy'
|
|
4
3
|
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
4
|
+
import { createThrottledFunction, getDocument, getDocumentElement, getWindow, lockNavbarScrollReaction } from '../utils'
|
|
5
5
|
|
|
6
6
|
const HASH_PREFIX_RE = /^#/
|
|
7
7
|
const ACTIVE_SCROLL_GAP = 24
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { BrowserTimeout } from '@theme/utils'
|
|
2
1
|
import type { CSSProperties, Ref } from 'vue'
|
|
2
|
+
import type { BrowserTimeout } from '../utils'
|
|
3
3
|
import type { ResolvedBackground } from './use-resolved-background'
|
|
4
|
-
import { clearBrowserTimeout, getBackgroundCacheKey, getRotationCandidate, getWindow, pickRandomUrl, requestBrowserAnimationFrame, setBrowserTimeout, shouldUseTransparentFallback } from '@theme/utils'
|
|
5
4
|
import { computed, onBeforeUnmount, ref, watch } from 'vue'
|
|
5
|
+
import { clearBrowserTimeout, getBackgroundCacheKey, getRotationCandidate, getWindow, pickRandomUrl, requestBrowserAnimationFrame, setBrowserTimeout, shouldUseTransparentFallback } from '../utils'
|
|
6
6
|
|
|
7
7
|
type BackgroundRuntimeScope = 'app' | 'hero'
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Post } from 'valaxy'
|
|
2
|
-
import { isVisiblePost, normalizePostTitle, resolvePostTimestamp } from '@theme/utils'
|
|
3
2
|
import { useSiteStore } from 'valaxy'
|
|
4
3
|
import { computed } from 'vue'
|
|
4
|
+
import { isVisiblePost, normalizePostTitle, resolvePostTimestamp } from '../utils'
|
|
5
5
|
|
|
6
6
|
export interface CategoryEntry {
|
|
7
7
|
path: string
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { BrowserTimeout } from '
|
|
2
|
-
import { clearBrowserTimeout, getWindow, setBrowserTimeout } from '@theme/utils'
|
|
3
|
-
import { useAddonHitokoto } from 'valaxy-addon-hitokoto'
|
|
1
|
+
import type { BrowserTimeout } from '../utils'
|
|
4
2
|
import { computed, onBeforeUnmount, ref, watch } from 'vue'
|
|
3
|
+
import { clearBrowserTimeout, fetchHitokoto, getWindow, setBrowserTimeout } from '../utils'
|
|
5
4
|
import { useThemeConfig } from './config'
|
|
6
5
|
|
|
7
6
|
const MIN_TYPING_SPEED = 24
|
|
@@ -12,14 +11,12 @@ export function useHeroMotto() {
|
|
|
12
11
|
const themeConfig = useThemeConfig()
|
|
13
12
|
const activeIndex = ref(0)
|
|
14
13
|
const renderedMotto = ref('')
|
|
14
|
+
const hitokotoMotto = ref('')
|
|
15
|
+
const isHitokotoPending = ref(false)
|
|
15
16
|
let typingTimer: BrowserTimeout | undefined
|
|
16
17
|
let rotationTimer: BrowserTimeout | undefined
|
|
17
18
|
|
|
18
|
-
const
|
|
19
|
-
? useAddonHitokoto()
|
|
20
|
-
: undefined
|
|
21
|
-
|
|
22
|
-
const useHitokoto = computed(() => themeConfig.value.hero.mottoSource === 'hitokoto' && Boolean(hitokotoApi))
|
|
19
|
+
const useHitokoto = computed(() => themeConfig.value.hero.mottoSource === 'hitokoto')
|
|
23
20
|
|
|
24
21
|
const configMottoList = computed(() => {
|
|
25
22
|
const { motto } = themeConfig.value.hero
|
|
@@ -30,34 +27,18 @@ export function useHeroMotto() {
|
|
|
30
27
|
return motto ? [motto] : []
|
|
31
28
|
})
|
|
32
29
|
|
|
33
|
-
const hitokotoMotto = computed(() => {
|
|
34
|
-
const currentHitokoto = hitokotoApi?.hitokoto.value
|
|
35
|
-
if (!currentHitokoto)
|
|
36
|
-
return ''
|
|
37
|
-
|
|
38
|
-
const text = currentHitokoto.hitokoto.trim()
|
|
39
|
-
if (!text)
|
|
40
|
-
return ''
|
|
41
|
-
|
|
42
|
-
const hitokotoOptions = themeConfig.value.hero.hitokoto
|
|
43
|
-
if (!hitokotoOptions?.showFrom)
|
|
44
|
-
return text
|
|
45
|
-
|
|
46
|
-
const from = (currentHitokoto.from || currentHitokoto.fromWho || '').trim()
|
|
47
|
-
if (!from)
|
|
48
|
-
return text
|
|
49
|
-
|
|
50
|
-
return `${text} ${hitokotoOptions.fromSeparator || DEFAULT_HITOKOTO_SEPARATOR} ${from}`
|
|
51
|
-
})
|
|
52
|
-
|
|
53
30
|
const mottoList = computed(() => {
|
|
54
31
|
if (!useHitokoto.value)
|
|
55
32
|
return configMottoList.value
|
|
56
33
|
|
|
34
|
+
if (isHitokotoPending.value)
|
|
35
|
+
return []
|
|
36
|
+
|
|
57
37
|
return hitokotoMotto.value ? [hitokotoMotto.value] : configMottoList.value
|
|
58
38
|
})
|
|
59
39
|
|
|
60
40
|
const hasMotto = computed(() => mottoList.value.length > 0)
|
|
41
|
+
const shouldShowMotto = computed(() => hasMotto.value || (useHitokoto.value && isHitokotoPending.value))
|
|
61
42
|
const shouldRotate = computed(() => mottoList.value.length > 1)
|
|
62
43
|
const shouldType = computed(() => Boolean(themeConfig.value.hero.typewriter))
|
|
63
44
|
const typingSpeed = computed(() => Math.max(themeConfig.value.hero.typingSpeed || 100, MIN_TYPING_SPEED))
|
|
@@ -71,8 +52,43 @@ export function useHeroMotto() {
|
|
|
71
52
|
rotationTimer = undefined
|
|
72
53
|
}
|
|
73
54
|
|
|
55
|
+
async function refreshHitokoto() {
|
|
56
|
+
const currentWindow = getWindow()
|
|
57
|
+
if (!currentWindow)
|
|
58
|
+
return false
|
|
59
|
+
|
|
60
|
+
isHitokotoPending.value = true
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
const data = await fetchHitokoto({
|
|
64
|
+
sentenceTypes: themeConfig.value.hero.hitokoto.sentenceTypes,
|
|
65
|
+
minLength: themeConfig.value.hero.hitokoto.minLength,
|
|
66
|
+
maxLength: themeConfig.value.hero.hitokoto.maxLength,
|
|
67
|
+
})
|
|
68
|
+
const text = data.hitokoto?.trim()
|
|
69
|
+
if (!text)
|
|
70
|
+
return false
|
|
71
|
+
|
|
72
|
+
const hitokotoOptions = themeConfig.value.hero.hitokoto
|
|
73
|
+
const from = (data.from || data.fromWho || '').trim()
|
|
74
|
+
|
|
75
|
+
hitokotoMotto.value = hitokotoOptions?.showFrom && from
|
|
76
|
+
? `${text} ${hitokotoOptions.fromSeparator || DEFAULT_HITOKOTO_SEPARATOR} ${from}`
|
|
77
|
+
: text
|
|
78
|
+
|
|
79
|
+
return true
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
console.error('[lolimeow] Failed to fetch hitokoto.', error)
|
|
83
|
+
return false
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
isHitokotoPending.value = false
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
74
90
|
function scheduleNextMotto() {
|
|
75
|
-
if (useHitokoto.value
|
|
91
|
+
if (useHitokoto.value) {
|
|
76
92
|
const currentWindow = getWindow()
|
|
77
93
|
if (!currentWindow)
|
|
78
94
|
return
|
|
@@ -80,10 +96,9 @@ export function useHeroMotto() {
|
|
|
80
96
|
rotationTimer = setBrowserTimeout(async () => {
|
|
81
97
|
rotationTimer = undefined
|
|
82
98
|
const currentMottoKey = mottoList.value.join('\u0000')
|
|
99
|
+
const fetched = await refreshHitokoto()
|
|
83
100
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (mottoList.value.join('\u0000') === currentMottoKey)
|
|
101
|
+
if (!fetched || mottoList.value.join('\u0000') === currentMottoKey)
|
|
87
102
|
scheduleNextMotto()
|
|
88
103
|
}, rotationDelay.value)
|
|
89
104
|
return
|
|
@@ -180,6 +195,21 @@ export function useHeroMotto() {
|
|
|
180
195
|
{ immediate: true },
|
|
181
196
|
)
|
|
182
197
|
|
|
198
|
+
watch(
|
|
199
|
+
useHitokoto,
|
|
200
|
+
async (enabled) => {
|
|
201
|
+
if (!enabled) {
|
|
202
|
+
isHitokotoPending.value = false
|
|
203
|
+
hitokotoMotto.value = ''
|
|
204
|
+
return
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
renderedMotto.value = ''
|
|
208
|
+
await refreshHitokoto()
|
|
209
|
+
},
|
|
210
|
+
{ immediate: true },
|
|
211
|
+
)
|
|
212
|
+
|
|
183
213
|
onBeforeUnmount(() => {
|
|
184
214
|
clearTimers()
|
|
185
215
|
})
|
|
@@ -187,5 +217,6 @@ export function useHeroMotto() {
|
|
|
187
217
|
return {
|
|
188
218
|
hasMotto,
|
|
189
219
|
renderedMotto,
|
|
220
|
+
shouldShowMotto,
|
|
190
221
|
}
|
|
191
222
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties, ShallowRef } from 'vue'
|
|
2
|
-
import { createBackgroundImageStyle, getDocumentElement, getWindow } from '@theme/utils'
|
|
3
2
|
import { useCssVar, useElementBounding } from '@vueuse/core'
|
|
4
3
|
import { computed, onBeforeUnmount, watch } from 'vue'
|
|
4
|
+
import { createBackgroundImageStyle, getDocumentElement, getWindow } from '../utils'
|
|
5
5
|
import { useThemeConfig } from './config'
|
|
6
6
|
import { useBackgroundRuntime } from './use-background-runtime'
|
|
7
7
|
import { useResolvedBackground } from './use-resolved-background'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Router } from 'vue-router'
|
|
2
|
-
import { isHomePaginationPath, lockNavbarScrollReaction } from '@theme/utils'
|
|
3
2
|
import { onMounted } from 'vue'
|
|
3
|
+
import { isHomePaginationPath, lockNavbarScrollReaction } from '../utils'
|
|
4
4
|
|
|
5
5
|
export function useHomePaginationScrollBehavior(router: Router) {
|
|
6
6
|
onMounted(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getDocumentElement } from '@theme/utils'
|
|
2
1
|
import { useCssVar } from '@vueuse/core'
|
|
3
2
|
import { computed, watch } from 'vue'
|
|
4
3
|
import { useRoute } from 'vue-router'
|
|
4
|
+
import { getDocumentElement } from '../utils'
|
|
5
5
|
import { useThemeConfig } from './config'
|
|
6
6
|
import { useMobileDrawer } from './use-mobile-drawer'
|
|
7
7
|
import { useNavbarVisibility } from './use-navbar-visibility'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Post } from 'valaxy'
|
|
2
|
-
import { appendSeedQuery, normalizeExcerpt, pickBySeed } from '@theme/utils'
|
|
3
2
|
import { computed, ref, watch } from 'vue'
|
|
3
|
+
import { appendSeedQuery, normalizeExcerpt, pickBySeed } from '../utils'
|
|
4
4
|
import { useThemeConfig } from './config'
|
|
5
5
|
|
|
6
6
|
export function usePostCardViewModel(post: Post, index = 0) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { clampOpacity, normalizeUrls, pickFirstUrl, pickRandomUrl } from '@theme/utils'
|
|
2
1
|
import { useColorMode, useWindowSize } from '@vueuse/core'
|
|
3
2
|
import { computed } from 'vue'
|
|
3
|
+
import { clampOpacity, normalizeUrls, pickFirstUrl, pickRandomUrl } from '../utils'
|
|
4
4
|
import { useThemeConfig } from './config'
|
|
5
5
|
|
|
6
6
|
type BackgroundScope = 'app' | 'hero'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isVisiblePost, normalizePostTitle, resolvePostTimestamp } from '@theme/utils'
|
|
2
1
|
import { useSiteStore } from 'valaxy'
|
|
3
2
|
import { computed } from 'vue'
|
|
3
|
+
import { isVisiblePost, normalizePostTitle, resolvePostTimestamp } from '../utils'
|
|
4
4
|
|
|
5
5
|
export interface TagEntry {
|
|
6
6
|
path: string
|
package/layouts/404.vue
CHANGED
package/node/config.ts
CHANGED
package/node/plugins.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valaxy-theme-lolimeow",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"author": {
|
|
6
6
|
"email": "Andreas99514@outlook.com",
|
|
7
7
|
"name": "Yoyo514",
|
|
@@ -23,11 +23,10 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@iconify-json/ant-design": "^1.2.5",
|
|
25
25
|
"@iconify-json/simple-icons": "^1.2.79",
|
|
26
|
-
"@vueuse/core": "^14.2.1"
|
|
27
|
-
"valaxy-addon-hitokoto": "^0.0.1",
|
|
28
|
-
"valaxy-addon-waline": "^0.2.1"
|
|
26
|
+
"@vueuse/core": "^14.2.1"
|
|
29
27
|
},
|
|
30
28
|
"devDependencies": {
|
|
31
|
-
"valaxy": "^0.28.5"
|
|
29
|
+
"valaxy": "^0.28.5",
|
|
30
|
+
"valaxy-addon-waline": "^0.2.1"
|
|
32
31
|
}
|
|
33
32
|
}
|
package/types/hero.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { HitokotoSentenceType } from '../utils'
|
|
2
|
+
|
|
1
3
|
export type HeroMottoSource = 'config' | 'hitokoto'
|
|
2
4
|
|
|
3
|
-
export interface
|
|
5
|
+
export interface HitokotoOptions {
|
|
4
6
|
/**
|
|
5
7
|
* 是否在一言后展示来源
|
|
6
8
|
* @default false
|
|
@@ -12,6 +14,22 @@ export interface HeroHitokotoDisplayOptions {
|
|
|
12
14
|
* @default '——'
|
|
13
15
|
*/
|
|
14
16
|
fromSeparator?: string
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 一言句子类型,可配置多个分类
|
|
20
|
+
* 例如:['a', 'c']
|
|
21
|
+
*/
|
|
22
|
+
sentenceTypes?: HitokotoSentenceType[]
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 一言最小长度
|
|
26
|
+
*/
|
|
27
|
+
minLength?: number
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 一言最大长度
|
|
31
|
+
*/
|
|
32
|
+
maxLength?: number
|
|
15
33
|
}
|
|
16
34
|
|
|
17
35
|
export interface Hero {
|
|
@@ -44,9 +62,9 @@ export interface Hero {
|
|
|
44
62
|
mottoSource: HeroMottoSource
|
|
45
63
|
|
|
46
64
|
/**
|
|
47
|
-
* 一言在 Hero motto
|
|
65
|
+
* 一言在 Hero motto 中的展示与请求配置
|
|
48
66
|
*/
|
|
49
|
-
hitokoto:
|
|
67
|
+
hitokoto: HitokotoOptions
|
|
50
68
|
|
|
51
69
|
/**
|
|
52
70
|
* 签名切换间隔(ms),仅在 motto 为字符串数组时生效
|
package/utils/background.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ResolvedBackground } from '@theme/composables/use-resolved-background'
|
|
2
1
|
import type { CSSProperties } from 'vue'
|
|
2
|
+
import type { ResolvedBackground } from '../composables/use-resolved-background'
|
|
3
3
|
|
|
4
4
|
interface BackgroundImageStyleOptions {
|
|
5
5
|
fixed?: boolean
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export type HitokotoSentenceType
|
|
2
|
+
= | 'a'
|
|
3
|
+
| 'b'
|
|
4
|
+
| 'c'
|
|
5
|
+
| 'd'
|
|
6
|
+
| 'e'
|
|
7
|
+
| 'f'
|
|
8
|
+
| 'g'
|
|
9
|
+
| 'h'
|
|
10
|
+
| 'i'
|
|
11
|
+
| 'j'
|
|
12
|
+
| 'k'
|
|
13
|
+
| 'l'
|
|
14
|
+
|
|
15
|
+
export interface HitokotoResponse {
|
|
16
|
+
hitokoto?: string
|
|
17
|
+
from?: string
|
|
18
|
+
fromWho?: string | null
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface FetchHitokotoOptions {
|
|
22
|
+
sentenceTypes?: HitokotoSentenceType[]
|
|
23
|
+
minLength?: number
|
|
24
|
+
maxLength?: number
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const HITOKOTO_API_URL = 'https://v1.hitokoto.cn/'
|
|
28
|
+
|
|
29
|
+
function appendNumberParam(searchParams: URLSearchParams, key: string, value?: number) {
|
|
30
|
+
if (typeof value !== 'number' || Number.isNaN(value) || value < 0)
|
|
31
|
+
return
|
|
32
|
+
|
|
33
|
+
searchParams.set(key, String(Math.floor(value)))
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function createHitokotoUrl(options: FetchHitokotoOptions = {}) {
|
|
37
|
+
const searchParams = new URLSearchParams()
|
|
38
|
+
|
|
39
|
+
options.sentenceTypes
|
|
40
|
+
?.filter((type, index, list) => Boolean(type) && list.indexOf(type) === index)
|
|
41
|
+
.forEach(type => searchParams.append('c', type))
|
|
42
|
+
|
|
43
|
+
appendNumberParam(searchParams, 'min_length', options.minLength)
|
|
44
|
+
appendNumberParam(searchParams, 'max_length', options.maxLength)
|
|
45
|
+
|
|
46
|
+
const queryString = searchParams.toString()
|
|
47
|
+
return queryString ? `${HITOKOTO_API_URL}?${queryString}` : HITOKOTO_API_URL
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export async function fetchHitokoto(options: FetchHitokotoOptions = {}) {
|
|
51
|
+
const response = await fetch(createHitokotoUrl(options))
|
|
52
|
+
if (!response.ok)
|
|
53
|
+
throw new Error(`Failed to fetch hitokoto: ${response.status}`)
|
|
54
|
+
|
|
55
|
+
return await response.json() as HitokotoResponse
|
|
56
|
+
}
|
package/utils/index.ts
CHANGED
package/valaxy.config.ts
CHANGED
|
@@ -1,29 +1,12 @@
|
|
|
1
1
|
import type { ThemeConfig } from './types'
|
|
2
|
-
import { resolve } from 'node:path'
|
|
3
|
-
import { fileURLToPath } from 'node:url'
|
|
4
2
|
import { defineTheme } from 'valaxy'
|
|
5
3
|
import { defaultThemeConfig, generateSafelist, themePlugin } from './node'
|
|
6
4
|
|
|
7
|
-
const themeRoot = fileURLToPath(new URL('.', import.meta.url))
|
|
8
|
-
const workspaceRoot = fileURLToPath(new URL('..', import.meta.url))
|
|
9
|
-
|
|
10
5
|
export default defineTheme<ThemeConfig>((options) => {
|
|
11
6
|
return {
|
|
12
7
|
themeConfig: defaultThemeConfig,
|
|
13
8
|
vite: {
|
|
14
9
|
plugins: [themePlugin(options)],
|
|
15
|
-
resolve: {
|
|
16
|
-
alias: [
|
|
17
|
-
{
|
|
18
|
-
find: '@theme',
|
|
19
|
-
replacement: themeRoot,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
find: '@demo',
|
|
23
|
-
replacement: resolve(workspaceRoot, 'demo'),
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
10
|
optimizeDeps: {
|
|
28
11
|
include: [
|
|
29
12
|
'@braintree/sanitize-url',
|