valaxy-theme-lolimeow 1.0.2 → 1.0.4

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.
Files changed (77) hide show
  1. package/client/index.ts +1 -1
  2. package/components/LmBackgroundLayer.vue +2 -2
  3. package/components/LmComment.vue +4 -4
  4. package/components/LmFooter.vue +2 -2
  5. package/components/LmHelper.vue +1 -1
  6. package/components/LmNotice.vue +3 -3
  7. package/components/about/LmAbout.vue +1 -1
  8. package/components/about/LmAboutSocialLinks.vue +1 -1
  9. package/components/archive/LmArchiveEntryList.vue +1 -1
  10. package/components/archive/LmArchiveRail.vue +1 -1
  11. package/components/archive/LmArchiveTimeline.vue +2 -2
  12. package/components/archive/LmArchives.vue +2 -2
  13. package/components/article/LmArticleHeader.vue +1 -1
  14. package/components/article/LmPostNav.vue +1 -1
  15. package/components/article/LmToc.vue +1 -1
  16. package/components/article/LmTocMobile.vue +2 -2
  17. package/components/category/LmCategories.vue +2 -2
  18. package/components/category/LmCategoryEntryList.vue +1 -1
  19. package/components/category/LmCategoryTree.vue +1 -1
  20. package/components/core/layout.vue +1 -1
  21. package/components/home/LmHero.vue +6 -3
  22. package/components/home/LmHeroIdentity.vue +31 -8
  23. package/components/home/LmHeroSocialLinks.vue +1 -1
  24. package/components/home/LmHomeContent.vue +1 -1
  25. package/components/home/LmPagination.vue +2 -2
  26. package/components/home/LmPinned.vue +2 -2
  27. package/components/home/LmPostCard.vue +7 -3
  28. package/components/home/LmPostList.vue +2 -2
  29. package/components/link/LmLinkCard.vue +1 -1
  30. package/components/link/LmLinkList.vue +1 -1
  31. package/components/link/LmLinkStatus.vue +1 -1
  32. package/components/link/LmLinks.vue +2 -2
  33. package/components/navbar/LmMobileDrawer.vue +5 -5
  34. package/components/navbar/LmNav.vue +2 -2
  35. package/components/navbar/LmNavItem.vue +2 -2
  36. package/components/navbar/LmNavTools.vue +1 -1
  37. package/components/plugins/LmWaline.vue +11 -5
  38. package/components/search/LmFuseSearchProvider.vue +3 -3
  39. package/components/search/LmSearchBody.vue +1 -1
  40. package/components/search/LmSearchResultList.vue +16 -3
  41. package/components/search/LmSearchShell.vue +10 -2
  42. package/components/tag/LmTagCloud.vue +2 -2
  43. package/components/tag/LmTagEntryList.vue +1 -1
  44. package/components/tag/LmTagIndex.vue +1 -1
  45. package/components/tag/LmTags.vue +2 -2
  46. package/composables/config.ts +1 -1
  47. package/composables/use-about-profile.ts +1 -1
  48. package/composables/use-archive-groups.ts +1 -1
  49. package/composables/use-archive-timeline-state.ts +1 -1
  50. package/composables/use-article-header-meta.ts +1 -1
  51. package/composables/use-article-toc-state.ts +1 -1
  52. package/composables/use-background-runtime.ts +13 -7
  53. package/composables/use-category-groups.ts +1 -1
  54. package/composables/use-hero-motto.ts +86 -34
  55. package/composables/use-hero-stage.ts +1 -1
  56. package/composables/use-home-pagination-scroll.ts +1 -1
  57. package/composables/use-layout-shell.ts +1 -1
  58. package/composables/use-link-groups.ts +1 -1
  59. package/composables/use-link-status.ts +1 -1
  60. package/composables/use-lm-fuse-search.ts +83 -2
  61. package/composables/use-nav-active.ts +1 -1
  62. package/composables/use-navbar-visibility.ts +1 -1
  63. package/composables/use-pinned-entries.ts +1 -1
  64. package/composables/use-post-card-media-state.ts +24 -2
  65. package/composables/use-post-card-view-model.ts +1 -1
  66. package/composables/use-resolved-background.ts +3 -3
  67. package/composables/use-search-modal.ts +1 -1
  68. package/composables/use-tag-groups.ts +1 -1
  69. package/layouts/404.vue +1 -1
  70. package/node/config.ts +1 -12
  71. package/node/plugins.ts +1 -1
  72. package/package.json +5 -6
  73. package/types/hero.d.ts +26 -12
  74. package/utils/background.ts +1 -1
  75. package/utils/hitokoto.ts +56 -0
  76. package/utils/index.ts +1 -0
  77. package/valaxy.config.ts +0 -17
package/client/index.ts CHANGED
@@ -1 +1 @@
1
- export * from '@theme/composables'
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)
@@ -1,17 +1,17 @@
1
1
  <script setup lang="ts">
2
- import { useFrontmatter, useRuntimeConfig, useSiteConfig } from 'valaxy'
2
+ import { useAddonConfig, useFrontmatter, useSiteConfig } from 'valaxy'
3
3
  import { computed, defineAsyncComponent } from 'vue'
4
4
 
5
5
  type CommentProvider = 'waline'
6
6
 
7
- const WalineComment = defineAsyncComponent(() => import('@theme/components/plugins/LmWaline.vue'))
7
+ const WalineComment = defineAsyncComponent(() => import('../components/plugins/LmWaline.vue'))
8
8
 
9
9
  const siteConfig = useSiteConfig()
10
10
  const frontmatter = useFrontmatter()
11
- const runtimeConfig = useRuntimeConfig()
11
+ const waline = useAddonConfig('valaxy-addon-waline')
12
12
 
13
13
  const provider = computed<CommentProvider | ''>(() => {
14
- if (runtimeConfig.value.addons?.['valaxy-addon-waline'])
14
+ if (waline.value)
15
15
  return 'waline'
16
16
 
17
17
  return ''
@@ -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
 
@@ -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
 
@@ -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 '@theme/styles/mixins/surface' as *;
82
+ @use '../styles/mixins/surface' as *;
83
83
 
84
84
  .lm-notice {
85
85
  @include lm-surface-panel(
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { useAboutProfile } from '@theme/composables'
2
+ import { useAboutProfile } from '../../composables'
3
3
 
4
4
  const {
5
5
  authorAvatar,
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { AboutSocialLink } from '@theme/composables'
2
+ import type { AboutSocialLink } from '../../composables'
3
3
 
4
4
  defineProps<{
5
5
  items: AboutSocialLink[]
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { ArchiveEntry } from '@theme/composables'
2
+ import type { ArchiveEntry } from '../../composables'
3
3
  import { formatDate } from 'valaxy'
4
4
 
5
5
  defineProps<{
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { ArchiveGroup } from '@theme/composables'
2
+ import type { ArchiveGroup } from '../../composables'
3
3
 
4
4
  defineProps<{
5
5
  groups: ArchiveGroup[]
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import type { ArchiveGroup } from '@theme/composables'
3
- import { useArchiveTimelineState } from '@theme/composables'
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()
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { useArticleHeaderMeta } from '@theme/composables'
2
+ import { useArticleHeaderMeta } from '../../composables'
3
3
 
4
4
  const {
5
5
  title,
@@ -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 '@theme/styles/mixins/surface' as *;
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,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { CategoryEntry } from '@theme/composables'
2
+ import type { CategoryEntry } from '../../composables'
3
3
  import { formatDate } from 'valaxy'
4
4
 
5
5
  defineProps<{
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { CategoryNode } from '@theme/composables'
2
+ import type { CategoryNode } from '../../composables'
3
3
  import { ref } from 'vue'
4
4
 
5
5
  const props = withDefaults(defineProps<{
@@ -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, mottoRenderKey, renderedMotto, shouldFadeMotto, shouldShowMotto } = useHeroMotto()
21
21
  const heroSection = useTemplateRef<HTMLElement>('heroSection')
22
22
 
23
23
  const {
@@ -80,7 +80,10 @@ const showSocialIcons = computed(() => themeConfig.value.hero.showSocialIcons &&
80
80
  :title="siteTitle"
81
81
  :subtitle="siteSubtitle"
82
82
  :has-motto="hasMotto"
83
+ :motto-render-key="mottoRenderKey"
83
84
  :rendered-motto="renderedMotto"
85
+ :should-fade-motto="shouldFadeMotto"
86
+ :should-show-motto="shouldShowMotto"
84
87
  />
85
88
 
86
89
  <LmHeroSocialLinks
@@ -102,7 +105,7 @@ const showSocialIcons = computed(() => themeConfig.value.hero.showSocialIcons &&
102
105
  </template>
103
106
 
104
107
  <style scoped lang="scss">
105
- @use '@theme/styles/mixins/surface' as *;
108
+ @use '../../styles/mixins/surface' as *;
106
109
 
107
110
  .lm-hero-content {
108
111
  @apply relative z-10 flex w-full max-w-5xl flex-col justify-center px-4 sm:px-6 lg:px-8;
@@ -5,7 +5,10 @@ const props = defineProps<{
5
5
  title: string
6
6
  subtitle?: string
7
7
  hasMotto: boolean
8
+ mottoRenderKey: number
8
9
  renderedMotto: string
10
+ shouldFadeMotto: boolean
11
+ shouldShowMotto: boolean
9
12
  }>()
10
13
  </script>
11
14
 
@@ -34,20 +37,23 @@ const props = defineProps<{
34
37
  </div>
35
38
 
36
39
  <div
37
- v-if="props.hasMotto"
40
+ v-if="props.shouldShowMotto"
38
41
  class="lm-hero-motto-strip"
39
42
  >
40
- <p
41
- class="lm-hero-motto"
42
- aria-live="polite"
43
- >
44
- {{ props.renderedMotto }}
45
- </p>
43
+ <Transition name="lm-hero-motto-fade" mode="out-in">
44
+ <p
45
+ :key="props.shouldFadeMotto ? props.mottoRenderKey : 'typewriter'"
46
+ class="lm-hero-motto"
47
+ aria-live="polite"
48
+ >
49
+ {{ props.renderedMotto }}
50
+ </p>
51
+ </Transition>
46
52
  </div>
47
53
  </template>
48
54
 
49
55
  <style scoped lang="scss">
50
- @use '@theme/styles/mixins/surface' as *;
56
+ @use '../../styles/mixins/surface' as *;
51
57
 
52
58
  .lm-hero-avatar-badge {
53
59
  @apply relative z-10 flex h-22 w-22 items-center justify-center rounded-full p-1.5 md:h-24 md:w-24;
@@ -179,6 +185,23 @@ const props = defineProps<{
179
185
  text-wrap: balance;
180
186
  }
181
187
 
188
+ .lm-hero-motto-fade-enter-active,
189
+ .lm-hero-motto-fade-leave-active {
190
+ transition:
191
+ opacity 180ms ease-out,
192
+ transform 180ms ease-out;
193
+ }
194
+
195
+ .lm-hero-motto-fade-enter-from {
196
+ opacity: 0;
197
+ transform: translateY(0.25rem);
198
+ }
199
+
200
+ .lm-hero-motto-fade-leave-to {
201
+ opacity: 0;
202
+ transform: translateY(-0.125rem);
203
+ }
204
+
182
205
  @media (max-width: 767px) {
183
206
  .lm-hero-identity-card {
184
207
  width: min(100%, 34rem);
@@ -35,7 +35,7 @@ const props = defineProps<{
35
35
  </template>
36
36
 
37
37
  <style scoped lang="scss">
38
- @use '@theme/styles/mixins/surface' as *;
38
+ @use '../../styles/mixins/surface' as *;
39
39
 
40
40
  .lm-hero-social-list {
41
41
  @apply mt-1 flex flex-wrap gap-2;
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { useHomePostFeed } from '@theme/composables'
3
2
  import { useTemplateRef } from 'vue'
3
+ import { useHomePostFeed } from '../../composables'
4
4
 
5
5
  const props = withDefaults(defineProps<{
6
6
  curPage?: number
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { usePaginationItems } from '@theme/composables'
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 '@theme/styles/mixins/surface' as *;
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 '@theme/composables'
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 '@theme/styles/mixins/surface' as *;
59
+ @use '../../styles/mixins/surface' as *;
60
60
 
61
61
  .lm-pinned {
62
62
  @apply pt-6 md:pt-8;
@@ -1,6 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import type { Post } from 'valaxy'
3
- import { usePostCardMediaState, usePostCardViewModel } from '@theme/composables'
3
+ import { shallowRef } from 'vue'
4
+ import { usePostCardMediaState, usePostCardViewModel } from '../../composables'
4
5
 
5
6
  const props = defineProps<{
6
7
  post: Post
@@ -18,11 +19,13 @@ const {
18
19
  handleCoverError,
19
20
  } = usePostCardViewModel(props.post, props.index ?? 0)
20
21
 
22
+ const imageElement = shallowRef<HTMLImageElement | null>(null)
23
+
21
24
  const {
22
25
  imageLoaded,
23
26
  showLoadingPlaceholder,
24
27
  handleImageLoad,
25
- } = usePostCardMediaState(hasMedia, cover)
28
+ } = usePostCardMediaState(hasMedia, cover, imageElement)
26
29
  </script>
27
30
 
28
31
  <template>
@@ -41,6 +44,7 @@ const {
41
44
 
42
45
  <img
43
46
  v-if="cover"
47
+ ref="imageElement"
44
48
  :src="cover"
45
49
  alt=""
46
50
  class="lm-post-card__image"
@@ -75,7 +79,7 @@ const {
75
79
  </template>
76
80
 
77
81
  <style lang="scss" scoped>
78
- @use '@theme/styles/mixins/surface' as *;
82
+ @use '../../styles/mixins/surface' as *;
79
83
 
80
84
  .lm-post-card {
81
85
  @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,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { ResolvedLinkItem } from '@theme/composables'
2
+ import type { ResolvedLinkItem } from '../../composables'
3
3
 
4
4
  defineProps<{
5
5
  item: ResolvedLinkItem
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { ResolvedLinkGroup } from '@theme/composables'
2
+ import type { ResolvedLinkGroup } from '../../composables'
3
3
 
4
4
  defineProps<{
5
5
  groups: ResolvedLinkGroup[]
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { useLinkStatus } from '@theme/composables'
3
2
  import { computed } from 'vue'
4
3
  import { useI18n } from 'vue-i18n'
4
+ import { useLinkStatus } from '../../composables'
5
5
 
6
6
  const props = defineProps<{
7
7
  url: 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 '@theme/types'
3
- import type { BrowserTimeout } from '@theme/utils'
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 '@theme/styles/mixins/surface' as *;
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 '@theme/types'
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 '@theme/styles/mixins/surface' as *;
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 '@theme/types'
3
- import { useNavActive } from '@theme/composables'
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,14 +1,20 @@
1
1
  <script setup lang="ts">
2
2
  // cspell:ignore waline
3
- // @ts-expect-error - `valaxy-addon-waline` 仅提供源码与导出映射,CI 下 `vue-tsc` 可能无法正确解析包根类型
4
- import { useAddonWaline } from 'valaxy-addon-waline'
3
+ import { useAddonConfig } from 'valaxy'
4
+ import { computed } from 'vue'
5
5
 
6
- const addon = useAddonWaline()
6
+ type WalineAddonOptions = {
7
+ serverURL: string
8
+ } & Record<string, unknown>
9
+
10
+ const waline = useAddonConfig<WalineAddonOptions>('valaxy-addon-waline')
11
+
12
+ const options = computed(() => waline.value?.options)
7
13
  </script>
8
14
 
9
15
  <template>
10
- <div class="lm-waline">
11
- <WalineClient w="full" :options="addon.options" />
16
+ <div v-if="options" class="lm-waline">
17
+ <WalineClient w="full" :options="options" />
12
18
  </div>
13
19
  </template>
14
20
 
@@ -1,9 +1,9 @@
1
1
  <script setup lang="ts">
2
- import type { LmFuseSearchResult } from '@theme/composables'
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
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { LmFuseSearchResult } from '@theme/composables'
2
+ import type { LmFuseSearchResult } from '../../composables'
3
3
  import { useI18n } from 'vue-i18n'
4
4
 
5
5
  defineProps<{
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { LmFuseSearchResult } from '@theme/composables'
2
+ import type { LmFuseSearchResult } from '../../composables'
3
3
 
4
4
  defineProps<{
5
5
  results: LmFuseSearchResult[]
@@ -22,10 +22,18 @@ const emit = defineEmits<{
22
22
  @click="emit('navigate', result)"
23
23
  >
24
24
  <span class="lm-search-result__title">
25
- {{ result.title }}
25
+ <span
26
+ v-for="(part, partIndex) in result.titleParts"
27
+ :key="`${result.id}-title-${partIndex}`"
28
+ :class="{ 'lm-search-result__highlight': part.highlighted }"
29
+ >{{ part.text }}</span>
26
30
  </span>
27
31
  <span v-if="result.excerpt" class="lm-search-result__excerpt">
28
- {{ result.excerpt }}
32
+ <span
33
+ v-for="(part, partIndex) in result.excerptParts"
34
+ :key="`${result.id}-excerpt-${partIndex}`"
35
+ :class="{ 'lm-search-result__highlight': part.highlighted }"
36
+ >{{ part.text }}</span>
29
37
  </span>
30
38
  </button>
31
39
  </div>
@@ -60,4 +68,9 @@ const emit = defineEmits<{
60
68
  @apply mt-1 line-clamp-2 text-xs leading-5;
61
69
  color: var(--lm-c-text-secondary);
62
70
  }
71
+
72
+ .lm-search-result__highlight {
73
+ color: var(--lm-c-brand);
74
+ font-weight: 800;
75
+ }
63
76
  </style>
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { onMounted, ref } from 'vue'
3
+
2
4
  const props = defineProps<{
3
5
  open: boolean
4
6
  }>()
@@ -6,10 +8,16 @@ const props = defineProps<{
6
8
  const emit = defineEmits<{
7
9
  close: []
8
10
  }>()
11
+
12
+ const mounted = ref(false)
13
+
14
+ onMounted(() => {
15
+ mounted.value = true
16
+ })
9
17
  </script>
10
18
 
11
19
  <template>
12
- <Teleport to="body">
20
+ <Teleport v-if="mounted" to="body">
13
21
  <div class="lm-search-shell">
14
22
  <Transition name="lm-search-backdrop">
15
23
  <button
@@ -34,7 +42,7 @@ const emit = defineEmits<{
34
42
  </template>
35
43
 
36
44
  <style scoped lang="scss">
37
- @use '@theme/styles/mixins/surface' as *;
45
+ @use '../../styles/mixins/surface' as *;
38
46
 
39
47
  .lm-search-shell {
40
48
  @apply px-4 pt-[8vh] flex pointer-events-none items-start inset-0 justify-center fixed z-[var(--lm-z-modal)];