@happydesigns/ui 0.15.1 → 0.17.0

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 (46) hide show
  1. package/README.md +64 -53
  2. package/app/app.config.ts +138 -165
  3. package/app/app.vue +0 -2
  4. package/app/assets/css/styles.css +38 -0
  5. package/app/components/Carousel.vue +33 -0
  6. package/app/components/{content/Snippet.vue → Snippet.vue} +6 -2
  7. package/app/components/article/ArticleGrid.vue +4 -4
  8. package/app/components/article/ArticleGridDate.vue +19 -16
  9. package/app/components/article/ArticleHeaderBody.vue +26 -20
  10. package/app/components/article/ArticleHeadlineMeta.vue +37 -26
  11. package/app/components/article/ArticleList.vue +5 -5
  12. package/app/components/article/ArticlePage.vue +1 -1
  13. package/app/components/footer/FooterColumns.vue +60 -101
  14. package/app/components/search/ContentSearch.client.vue +59 -0
  15. package/app/components/studio/StudioLoginButton.client.vue +11 -3
  16. package/app/components/traits/Category.vue +1 -1
  17. package/app/components/traits/CopyButton.vue +40 -32
  18. package/app/components/traits/Links.vue +21 -17
  19. package/app/components/traits/Surround.vue +6 -7
  20. package/app/components/traits/Toc.vue +18 -16
  21. package/app/composables/useArticleList.ts +37 -46
  22. package/app/composables/useClipboard.ts +48 -26
  23. package/app/composables/useContentSearchData.ts +42 -0
  24. package/app/composables/useNavigationLinks.ts +40 -0
  25. package/app/composables/usePageContent.ts +1 -3
  26. package/app/composables/usePageSeo.ts +7 -15
  27. package/app/internal/pageLayout.ts +7 -0
  28. package/app/layouts/article.vue +137 -120
  29. package/app/layouts/content.vue +63 -59
  30. package/app/types/config.ts +91 -13
  31. package/app/utils/createContentSearchLoader.ts +45 -0
  32. package/app/utils/formatDate.ts +1 -1
  33. package/app/utils/formatDateTime.ts +1 -1
  34. package/app/utils/isNavigationTargetActive.ts +12 -0
  35. package/app/utils/resolveUsers.ts +56 -42
  36. package/nuxt.config.ts +4 -16
  37. package/package.json +17 -9
  38. package/schemas/collections.ts +4 -0
  39. package/schemas/indexes.ts +10 -0
  40. package/schemas/traits.ts +9 -4
  41. package/server/api/navigation.json.get.ts +11 -0
  42. package/server/api/search.json.get.ts +11 -0
  43. package/server/utils/contentSearch.ts +67 -0
  44. package/shared/types/app-config.d.ts +23 -0
  45. package/app/assets/css/main.css +0 -14
  46. package/app/components/content/Carousel.vue +0 -11
@@ -6,7 +6,7 @@ import { computed, toValue } from 'vue'
6
6
  export interface ArticleFilter {
7
7
  field: string
8
8
  operator: SQLOperator
9
- value?: any
9
+ value?: unknown
10
10
  }
11
11
 
12
12
  export interface UseArticleListOptions<C extends keyof PageCollections = 'article'> {
@@ -20,8 +20,8 @@ export interface UseArticleListOptions<C extends keyof PageCollections = 'articl
20
20
  where?: MaybeRefOrGetter<ArticleFilter[] | undefined>
21
21
  /** Field to sort by. Set to false to disable default sorting. Defaults to { field: 'date', direction: 'DESC' }. */
22
22
  sort?: MaybeRefOrGetter<{ field: string, direction: 'ASC' | 'DESC' } | false | undefined>
23
- /** Status to filter by. Set to false to disable default status filtering. Defaults to 'published'. */
24
- status?: MaybeRefOrGetter<string | false | undefined>
23
+ /** Whether to return only published entries. Defaults to true. */
24
+ publishedOnly?: MaybeRefOrGetter<boolean | undefined>
25
25
  /** Whether the list should load lazily during client-side navigation. Defaults to false. */
26
26
  lazy?: MaybeRefOrGetter<boolean | undefined>
27
27
  }
@@ -45,8 +45,8 @@ export function useArticleList<C extends keyof PageCollections = 'article'>(opti
45
45
  if (w)
46
46
  return w
47
47
 
48
- // Fallback to config where but filter out status if handled separately
49
- return config.value.query?.where?.filter(f => f.field !== 'status') || []
48
+ // Fallback to config where but filter out publication if handled separately
49
+ return config.value.query?.where?.filter(f => f.field !== 'published') || []
50
50
  })
51
51
 
52
52
  const sort = computed(() => {
@@ -57,33 +57,19 @@ export function useArticleList<C extends keyof PageCollections = 'article'>(opti
57
57
  return config.value.query?.order
58
58
  })
59
59
 
60
- const status = computed(() => {
61
- const s = toValue(options.status)
62
- if (s === false)
63
- return false
64
-
65
- if (s)
66
- return s
67
-
68
- // Try to find status in config where
69
- const statusFilter = config.value.query?.where?.find(f => f.field === 'status')
70
- return statusFilter?.value || 'published'
71
- })
60
+ const publishedOnly = computed(() => toValue(options.publishedOnly) ?? true)
72
61
 
73
62
  // The key must be reactive and stable
74
- const queryKey = computed(() => `${String(collection.value)}-list-${page.value}-${itemsPerPage.value}-${category.value || 'all'}-${labelAll.value}-${JSON.stringify(where.value)}-${JSON.stringify(sort.value)}-${status.value}`)
63
+ const queryKey = computed(() => `${String(collection.value)}-list-${page.value}-${itemsPerPage.value}-${category.value || 'all'}-${labelAll.value}-${JSON.stringify(where.value)}-${JSON.stringify(sort.value)}-${publishedOnly.value}`)
75
64
 
76
65
  return useAsyncData(queryKey, async () => {
77
- // We cast the query to a version that includes the standard article fields
78
- // This avoids 'any' while still allowing the query to work with generic collections
66
+ // The result keeps consumer collection fields together with the article fields used by the UI.
79
67
  type ArticleItem = Collections[C] & Collections['article']
80
- type ArticleQueryBuilder = ReturnType<typeof queryCollection<'article'>>
81
-
82
68
  const getDataQuery = () => {
83
- let query = queryCollection(collection.value) as unknown as ArticleQueryBuilder
69
+ let query = queryCollection(collection.value)
84
70
 
85
- if (status.value) {
86
- query = query.where('status', '=', status.value)
71
+ if (publishedOnly.value) {
72
+ query = query.where('published', '=', true)
87
73
  }
88
74
 
89
75
  if (category.value && category.value !== labelAll.value) {
@@ -93,7 +79,7 @@ export function useArticleList<C extends keyof PageCollections = 'article'>(opti
93
79
  // Apply additional filters
94
80
  if (where.value && Array.isArray(where.value)) {
95
81
  where.value.forEach((filter) => {
96
- query = query.where(filter.field as any, filter.operator, filter.value)
82
+ query = query.where(filter.field, filter.operator, filter.value)
97
83
  })
98
84
  }
99
85
  return query
@@ -102,16 +88,25 @@ export function useArticleList<C extends keyof PageCollections = 'article'>(opti
102
88
  let finalQuery = getDataQuery()
103
89
 
104
90
  if (sort.value) {
105
- finalQuery = finalQuery.order(sort.value.field as any, sort.value.direction)
91
+ finalQuery = finalQuery.order(sort.value.field as keyof Collections[C], sort.value.direction)
106
92
  }
107
93
 
108
- const articles = await finalQuery
109
- .skip((page.value - 1) * itemsPerPage.value)
110
- .limit(itemsPerPage.value)
111
- .all() as ArticleItem[]
112
-
113
- // Resolve details for each article
114
- const resolved = await Promise.all(articles.map(async (article) => {
94
+ const [articles, total] = await Promise.all([
95
+ finalQuery
96
+ .skip((page.value - 1) * itemsPerPage.value)
97
+ .limit(itemsPerPage.value)
98
+ .all() as Promise<ArticleItem[]>,
99
+ getDataQuery().count() as Promise<number>,
100
+ ])
101
+
102
+ const userProps = config.value.user ?? {}
103
+ const authorsByUsername = await resolveUserMap(
104
+ articles.flatMap(article => article.authors ?? []),
105
+ userProps,
106
+ )
107
+
108
+ // Resolve display details without issuing additional collection queries.
109
+ const resolved = articles.map((article) => {
115
110
  // Resolve Category Badge directly
116
111
  const categoryKey = article.category
117
112
  let resolvedBadge: BadgeProps | undefined
@@ -123,23 +118,19 @@ export function useArticleList<C extends keyof PageCollections = 'article'>(opti
123
118
  }
124
119
  }
125
120
 
126
- // Resolve Authors
127
- let resolvedAuthors: Awaited<ReturnType<typeof resolveUsers>> = []
128
- if (article.authors?.length) {
129
- const userProps = config.value.user ?? {}
130
- resolvedAuthors = await resolveUsers(article.authors, userProps)
131
- }
132
-
121
+ // Preserve the author order declared in front matter.
122
+ const resolvedAuthors = (article.authors ?? []).flatMap((username) => {
123
+ const author = authorsByUsername.get(username)
124
+ return author ? [author] : []
125
+ })
126
+
133
127
  return {
134
128
  ...article,
135
129
  resolvedBadge,
136
130
  resolvedAuthors,
137
131
  }
138
- }))
139
-
140
- // Total count for pagination
141
- const total = await getDataQuery().count() as number
142
-
132
+ })
133
+
143
134
  return {
144
135
  articles: resolved,
145
136
  total,
@@ -1,26 +1,48 @@
1
- import type { ToastProps } from '#ui/types'
2
- import { useClipboard as _useClipboard } from '@vueuse/core'
3
-
4
- export function useClipboard() {
5
- const { copy: _copy, copied } = _useClipboard()
6
-
7
- const toast = useToast()
8
-
9
- const copy = (source: string, options?: Partial<ToastProps> & { id?: string | number }) => {
10
- _copy(source)
11
- if (options) {
12
- // Check if toast with this ID already exists to prevent spam
13
- if (options.id && toast.toasts.value.some(t => t.id === options.id)) {
14
- toast.update(options.id, options)
15
- }
16
- else {
17
- toast.add(options as any)
18
- }
19
- }
20
- }
21
-
22
- return {
23
- copy,
24
- copied,
25
- }
26
- }
1
+ import type { ToastProps } from '#ui/types'
2
+ import { useClipboard as _useClipboard } from '@vueuse/core'
3
+
4
+ type ClipboardToast = Partial<ToastProps> & { id?: string | number }
5
+
6
+ export type ClipboardCopyOptions = ClipboardToast & {
7
+ error?: ClipboardToast
8
+ }
9
+
10
+ export function useClipboard() {
11
+ const { copy: copyToClipboard, copied } = _useClipboard()
12
+ const toast = useToast()
13
+
14
+ function upsertToast(options: ClipboardToast) {
15
+ const { id, ...toastOptions } = options
16
+
17
+ if (id !== undefined && toast.toasts.value.some(toastItem => toastItem.id === id)) {
18
+ toast.update(id, toastOptions)
19
+ return
20
+ }
21
+
22
+ toast.add(id === undefined ? toastOptions : { ...toastOptions, id })
23
+ }
24
+
25
+ const copy = async (source: string, options?: ClipboardCopyOptions): Promise<boolean> => {
26
+ const { error: errorToast, ...successToast } = options ?? {}
27
+
28
+ try {
29
+ await copyToClipboard(source)
30
+
31
+ if (Object.keys(successToast).length > 0)
32
+ upsertToast(successToast)
33
+
34
+ return true
35
+ }
36
+ catch {
37
+ if (errorToast)
38
+ upsertToast(errorToast)
39
+
40
+ return false
41
+ }
42
+ }
43
+
44
+ return {
45
+ copy,
46
+ copied,
47
+ }
48
+ }
@@ -0,0 +1,42 @@
1
+ import type { ContentNavigationItem } from '@nuxt/content'
2
+ import type { ContentSearchFile } from '@nuxt/ui'
3
+ import { createContentSearchLoader } from '../utils/createContentSearchLoader'
4
+
5
+ export interface ContentSearchDataLoaders {
6
+ navigation?: () => Promise<ContentNavigationItem[]>
7
+ files?: () => Promise<ContentSearchFile[]>
8
+ }
9
+
10
+ export function useContentSearchData(loaders: ContentSearchDataLoaders = {}) {
11
+ const navigation = shallowRef<ContentNavigationItem[]>([])
12
+ const files = shallowRef<ContentSearchFile[]>([])
13
+ const status = ref<'idle' | 'pending' | 'success' | 'error'>('idle')
14
+ const error = shallowRef<Error>()
15
+
16
+ const loader = createContentSearchLoader({
17
+ navigation: loaders.navigation ?? (() => $fetch<ContentNavigationItem[]>('/api/navigation.json')),
18
+ files: loaders.files ?? (() => $fetch<ContentSearchFile[]>('/api/search.json')),
19
+ }, {
20
+ pending: () => {
21
+ status.value = 'pending'
22
+ error.value = undefined
23
+ },
24
+ success: (loadedNavigation, loadedFiles) => {
25
+ navigation.value = loadedNavigation
26
+ files.value = loadedFiles
27
+ status.value = 'success'
28
+ },
29
+ error: (cause) => {
30
+ error.value = cause
31
+ status.value = 'error'
32
+ },
33
+ })
34
+
35
+ return {
36
+ navigation,
37
+ files,
38
+ status,
39
+ error,
40
+ load: loader.load,
41
+ }
42
+ }
@@ -0,0 +1,40 @@
1
+ import type { FooterColumn, FooterColumnLink, NavigationMenuItem } from '@nuxt/ui'
2
+ import { createSharedComposable } from '@vueuse/core'
3
+
4
+ function withActiveState<T extends { to?: unknown, children?: T[] }>(items: T[], currentPath: string): T[] {
5
+ return items.map((item) => {
6
+ const children = item.children ? withActiveState(item.children, currentPath) : undefined
7
+
8
+ return {
9
+ ...item,
10
+ ...(children ? { children } : {}),
11
+ active: isNavigationTargetActive(currentPath, item.to)
12
+ || Boolean(children?.some(child => 'active' in child && child.active)),
13
+ }
14
+ })
15
+ }
16
+
17
+ function _useHeaderLinks() {
18
+ const appConfig = useAppConfig()
19
+ const route = useRoute()
20
+ const headerLinks = computed(() => withActiveState(
21
+ (appConfig.app.links.header ?? []) as NavigationMenuItem[],
22
+ route.path,
23
+ ))
24
+
25
+ return { headerLinks }
26
+ }
27
+
28
+ function _useFooterLinks() {
29
+ const appConfig = useAppConfig()
30
+ const route = useRoute()
31
+ const footerLinks = computed(() => ((appConfig.app.links.footer ?? []) as FooterColumn[]).map(column => ({
32
+ ...column,
33
+ children: withActiveState((column.children ?? []) as FooterColumnLink[], route.path),
34
+ })))
35
+
36
+ return { footerLinks }
37
+ }
38
+
39
+ export const useHeaderLinks = import.meta.client ? createSharedComposable(_useHeaderLinks) : _useHeaderLinks
40
+ export const useFooterLinks = import.meta.client ? createSharedComposable(_useFooterLinks) : _useFooterLinks
@@ -25,7 +25,5 @@ export function usePageContent<C extends keyof PageCollections = 'page', B = obj
25
25
 
26
26
  const handler = () => queryCollection(resolvedCollection.value as keyof PageCollections).path(resolvedPath.value).first()
27
27
 
28
- return useAsyncData(key, handler, {
29
- watch: [resolvedPath, resolvedCollection],
30
- }) as unknown as AsyncData<(PageCollections[C] & B) | null, Error | null>
28
+ return useAsyncData(key, handler) as unknown as AsyncData<(PageCollections[C] & B) | null, Error | null>
31
29
  }
@@ -1,5 +1,3 @@
1
- import { watchEffect } from 'vue'
2
-
3
1
  interface SeoRelevantPageData {
4
2
  seo?: {
5
3
  title?: string
@@ -12,19 +10,13 @@ interface SeoRelevantPageData {
12
10
  }
13
11
 
14
12
  export function usePageSeo(page: Ref<SeoRelevantPageData | null | undefined>) {
15
- watchEffect(() => {
16
- if (page.value) {
17
- const title = page.value.seo?.title || page.value.title
18
- const description = page.value.seo?.description || page.value.description
19
- const ogTitle = page.value.seo?.ogTitle || title
20
- const ogDescription = page.value.seo?.ogDescription || description
13
+ const title = () => page.value?.seo?.title || page.value?.title
14
+ const description = () => page.value?.seo?.description || page.value?.description
21
15
 
22
- useSeoMeta({
23
- title,
24
- ogTitle,
25
- description,
26
- ogDescription,
27
- })
28
- }
16
+ useSeoMeta({
17
+ title,
18
+ ogTitle: () => page.value?.seo?.ogTitle || title(),
19
+ description,
20
+ ogDescription: () => page.value?.seo?.ogDescription || description(),
29
21
  })
30
22
  }
@@ -0,0 +1,7 @@
1
+ export function getPageLayoutUi(hasToc: boolean) {
2
+ return {
3
+ root: 'lg:grid-cols-12',
4
+ center: hasToc ? 'lg:col-span-9' : 'lg:col-span-12',
5
+ right: 'lg:col-span-3',
6
+ }
7
+ }
@@ -1,120 +1,137 @@
1
- <script setup lang="ts" generic="C extends keyof PageCollections = 'article'">
2
- import type { PageCollections } from '@nuxt/content'
3
-
4
- const props = defineProps<{
5
- path?: string
6
- collection?: C
7
- }>()
8
-
9
- const route = useRoute()
10
- const collection = computed(() => props.collection ?? 'article')
11
-
12
- const { data: page } = await usePageContent({
13
- path: () => props.path,
14
- collection: () => collection.value,
15
- })
16
-
17
- const { config, has } = useVariant(collection)
18
- const hasHeader = has('header')
19
- const hasBackButton = has('backButton')
20
- const hasCopyButton = has('copyButton')
21
- const hasSeparator = has('separator')
22
- const hasSurround = has('surround')
23
- const hasToc = has('toc')
24
- const tocEnabled = computed(() => !page.value || !('toc' in page.value) || page.value.toc !== false)
25
-
26
- if (!page.value) {
27
- throw createError({
28
- statusCode: 404,
29
- statusMessage: `${collection.value} ${props.path || route.path} not found`,
30
- fatal: true,
31
- })
32
- }
33
-
34
- usePageSeo(page)
35
-
36
- const header = computed(() => resolvePageHeader(page.value))
37
-
38
- const breadcrumbsBase = computed(() => config.value.breadcrumbs ?? [])
39
-
40
- const breadcrumbItems = computed(() => {
41
- return [
42
- ...breadcrumbsBase.value,
43
- { label: page.value?.title, to: page.value?.path },
44
- ]
45
- })
46
-
47
- const backLink = computed(() => {
48
- const lastBreadcrumb = breadcrumbsBase.value.at(-1)
49
-
50
- if (!lastBreadcrumb && !config.value?.backButton)
51
- return null
52
-
53
- return { ...(lastBreadcrumb ?? {}), ...config.value?.backButton }
54
- })
55
- </script>
56
-
57
- <template>
58
- <UContainer v-if="page">
59
- <UPageHeader
60
- v-if="hasHeader && header"
61
- v-bind="header"
62
- :ui="{
63
- headline: 'all:flex flex-col gap-y-8 items-start',
64
- wrapper: 'lg:flex-row',
65
- }"
66
- >
67
- <template #headline>
68
- <UBreadcrumb
69
- :ui="{ root: 'max-w-full' }"
70
- :items="breadcrumbItems"
71
- />
72
- <HArticleHeadlineMeta :page="page" :collection="collection" />
73
- </template>
74
- <HArticleHeaderBody :page="page" :collection="collection">
75
- <slot name="header" />
76
- </HArticleHeaderBody>
77
- </UPageHeader>
78
-
79
- <UPage>
80
- <UPageBody>
81
- <slot />
82
-
83
- <div
84
- v-if="hasBackButton || hasCopyButton"
85
- class="all:flex items-center justify-between mt-12"
86
- >
87
- <HBackButton
88
- v-if="hasBackButton && backLink"
89
- v-bind="backLink"
90
- />
91
- <div class="all:flex justify-end items-center gap-1.5 ml-auto">
92
- <HCopyButton v-if="hasCopyButton" v-bind="config.copyButton" />
93
- </div>
94
- </div>
95
-
96
- <HSeparator
97
- v-if="hasSeparator"
98
- :stem="page?.stem"
99
- :extension="page?.extension"
100
- v-bind="config.separator"
101
- />
102
-
103
- <HSurround
104
- v-if="hasSurround"
105
- :collection="collection"
106
- v-bind="config.surround"
107
- :query="config.query"
108
- />
109
- </UPageBody>
110
-
111
- <template #right>
112
- <HToc
113
- v-if="hasToc && tocEnabled"
114
- :links="page?.body?.toc?.links"
115
- :title="page?.body?.toc?.title"
116
- />
117
- </template>
118
- </UPage>
119
- </UContainer>
120
- </template>
1
+ <script setup lang="ts" generic="C extends keyof PageCollections = 'article'">
2
+ import type { PageCollections } from '@nuxt/content'
3
+ import type { BreadcrumbItem } from '@nuxt/ui'
4
+ import { getPageLayoutUi } from '../internal/pageLayout'
5
+
6
+ const props = defineProps<{
7
+ path?: string
8
+ collection?: C
9
+ }>()
10
+
11
+ const route = useRoute()
12
+ const collection = computed(() => props.collection ?? 'article')
13
+
14
+ const { data: page } = await usePageContent({
15
+ path: () => props.path,
16
+ collection: () => collection.value,
17
+ })
18
+
19
+ const { config, has } = useVariant(collection)
20
+ const hasHeader = has('header')
21
+ const hasBackButton = has('backButton')
22
+ const hasCopyButton = has('copyButton')
23
+ const hasSeparator = has('separator')
24
+ const hasSurround = has('surround')
25
+ const hasToc = has('toc')
26
+ const tocEnabled = computed(() => !page.value || !('toc' in page.value) || page.value.toc !== false)
27
+ const renderToc = computed(() => hasToc.value
28
+ && tocEnabled.value
29
+ && Boolean(page.value?.body?.toc?.links?.length))
30
+ const pageUi = computed(() => getPageLayoutUi(renderToc.value))
31
+
32
+ if (!page.value) {
33
+ throw createError({
34
+ statusCode: 404,
35
+ statusMessage: `${collection.value} ${props.path || route.path} not found`,
36
+ fatal: true,
37
+ })
38
+ }
39
+
40
+ usePageSeo(page)
41
+
42
+ const header = computed(() => resolvePageHeader(page.value))
43
+
44
+ const breadcrumbsBase = computed(() => (config.value.breadcrumbs ?? []) as BreadcrumbItem[])
45
+
46
+ const breadcrumbItems = computed(() => {
47
+ const baseItems = breadcrumbsBase.value.map((item, index) => ({
48
+ ...item,
49
+ ...(index === breadcrumbsBase.value.length - 1
50
+ ? { ui: { ...item.ui, separator: 'hidden sm:flex' } }
51
+ : {}),
52
+ }))
53
+
54
+ return [
55
+ ...baseItems,
56
+ {
57
+ label: page.value?.title,
58
+ to: page.value?.path,
59
+ ui: { item: 'hidden sm:flex' },
60
+ },
61
+ ]
62
+ })
63
+
64
+ const backLink = computed(() => {
65
+ const lastBreadcrumb = breadcrumbsBase.value.at(-1)
66
+
67
+ if (!lastBreadcrumb && !config.value?.backButton)
68
+ return null
69
+
70
+ return { ...(lastBreadcrumb ?? {}), ...config.value?.backButton }
71
+ })
72
+ </script>
73
+
74
+ <template>
75
+ <UContainer v-if="page">
76
+ <UPageHeader
77
+ v-if="hasHeader && header"
78
+ v-bind="header"
79
+ :ui="{
80
+ headline: 'all:flex flex-col gap-y-8 items-start',
81
+ wrapper: 'lg:flex-row',
82
+ }"
83
+ >
84
+ <template #headline>
85
+ <UBreadcrumb
86
+ :ui="{ root: 'max-w-full' }"
87
+ :items="breadcrumbItems"
88
+ />
89
+ <HArticleHeadlineMeta :page="page" :collection="collection" />
90
+ </template>
91
+ <HArticleHeaderBody :page="page" :collection="collection">
92
+ <slot name="header" />
93
+ </HArticleHeaderBody>
94
+ </UPageHeader>
95
+
96
+ <UPage :ui="pageUi">
97
+ <UPageBody>
98
+ <slot />
99
+
100
+ <div
101
+ v-if="hasBackButton || hasCopyButton"
102
+ class="all:flex items-center justify-between mt-12"
103
+ >
104
+ <HBackButton
105
+ v-if="hasBackButton && backLink"
106
+ v-bind="backLink"
107
+ />
108
+ <div class="all:flex justify-end items-center gap-1.5 ml-auto">
109
+ <HCopyButton v-if="hasCopyButton" v-bind="config.copyButton" />
110
+ </div>
111
+ </div>
112
+
113
+ <HSeparator
114
+ v-if="hasSeparator"
115
+ :stem="page?.stem"
116
+ :extension="page?.extension"
117
+ v-bind="config.separator"
118
+ />
119
+
120
+ <HSurround
121
+ v-if="hasSurround"
122
+ :collection="collection"
123
+ v-bind="config.surround"
124
+ :query="config.query"
125
+ />
126
+ </UPageBody>
127
+
128
+ <template #right>
129
+ <HToc
130
+ v-if="renderToc"
131
+ :links="page?.body?.toc?.links"
132
+ :title="page?.body?.toc?.title"
133
+ />
134
+ </template>
135
+ </UPage>
136
+ </UContainer>
137
+ </template>