kmcom-nuxt-layers 1.1.7 → 1.1.9
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/layers/core/app/components/ErrorBoundary.vue +6 -6
- package/layers/layout/app/components/Layout/Page/Container.vue +14 -13
- package/layers/layout/app/components/Layout/Section/index.vue +1 -4
- package/layers/ui/app/components/Links/Group.vue +19 -11
- package/layers/ui/app/components/Links/Named.vue +14 -16
- package/layers/ui/app/components/Media/Picture.vue +36 -27
- package/layers/ui/app/composables/picture.ts +11 -21
- package/package.json +15 -15
|
@@ -34,11 +34,11 @@ interface Props {
|
|
|
34
34
|
componentName?: string
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const
|
|
38
|
-
showDetails
|
|
39
|
-
message
|
|
40
|
-
componentName
|
|
41
|
-
})
|
|
37
|
+
const {
|
|
38
|
+
showDetails = true,
|
|
39
|
+
message = 'Something went wrong in this section.',
|
|
40
|
+
componentName = 'Unknown',
|
|
41
|
+
} = defineProps<Props>()
|
|
42
42
|
|
|
43
43
|
const { logError } = useErrorLog()
|
|
44
44
|
|
|
@@ -46,7 +46,7 @@ const { logError } = useErrorLog()
|
|
|
46
46
|
const handleError = (error: unknown) => {
|
|
47
47
|
// Log error with context
|
|
48
48
|
logError(error, {
|
|
49
|
-
component:
|
|
49
|
+
component: componentName,
|
|
50
50
|
info: 'Error caught by ErrorBoundary',
|
|
51
51
|
})
|
|
52
52
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
<!-- eslint-disable vue/require-default-prop -->
|
|
2
1
|
<script setup lang="ts">
|
|
3
2
|
/**
|
|
4
3
|
* PageContainer - Unified page wrapper component
|
|
@@ -39,12 +38,6 @@
|
|
|
39
38
|
* </PageContainer>
|
|
40
39
|
*/
|
|
41
40
|
|
|
42
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
43
|
-
showHeader: true,
|
|
44
|
-
headerPreset: 'centered',
|
|
45
|
-
layout: 'grid',
|
|
46
|
-
})
|
|
47
|
-
|
|
48
41
|
interface Props {
|
|
49
42
|
title: string
|
|
50
43
|
description?: string
|
|
@@ -53,20 +46,28 @@ interface Props {
|
|
|
53
46
|
layout?: 'grid' | 'upage'
|
|
54
47
|
}
|
|
55
48
|
|
|
49
|
+
const {
|
|
50
|
+
title,
|
|
51
|
+
description,
|
|
52
|
+
showHeader = true,
|
|
53
|
+
headerPreset = 'centered',
|
|
54
|
+
layout = 'grid',
|
|
55
|
+
} = defineProps<Props>()
|
|
56
|
+
|
|
56
57
|
// Set page metadata for SEO and browser tab
|
|
57
58
|
useHead({
|
|
58
|
-
title
|
|
59
|
-
meta:
|
|
59
|
+
title,
|
|
60
|
+
meta: description
|
|
60
61
|
? [
|
|
61
|
-
{ name: 'description', content:
|
|
62
|
-
{ property: 'og:title', content:
|
|
63
|
-
{ property: 'og:description', content:
|
|
62
|
+
{ name: 'description', content: description },
|
|
63
|
+
{ property: 'og:title', content: title },
|
|
64
|
+
{ property: 'og:description', content: description },
|
|
64
65
|
]
|
|
65
66
|
: undefined,
|
|
66
67
|
})
|
|
67
68
|
|
|
68
69
|
// Provide title to child components (e.g., for breadcrumbs, schema.org)
|
|
69
|
-
provide('pageTitle',
|
|
70
|
+
provide('pageTitle', title)
|
|
70
71
|
</script>
|
|
71
72
|
|
|
72
73
|
<template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
// eslint-disable-next-line no-restricted-imports
|
|
2
3
|
import { cloneVNode, defineComponent, Fragment, h, ref, type VNode } from 'vue'
|
|
3
4
|
|
|
4
5
|
export default defineComponent({
|
|
@@ -13,25 +14,32 @@ export default defineComponent({
|
|
|
13
14
|
|
|
14
15
|
return () => {
|
|
15
16
|
const children = (slots.default?.() ?? [])
|
|
16
|
-
.flatMap(node => node.type === Fragment ? (node.children as VNode[]) : [node])
|
|
17
|
-
.filter(node => typeof node.type === 'string' || typeof node.type === 'object')
|
|
17
|
+
.flatMap((node) => (node.type === Fragment ? (node.children as VNode[]) : [node]))
|
|
18
|
+
.filter((node) => typeof node.type === 'string' || typeof node.type === 'object')
|
|
18
19
|
|
|
19
20
|
const styledChildren = children.map((vnode, index) =>
|
|
20
21
|
cloneVNode(vnode, {
|
|
21
|
-
onMouseenter: () => {
|
|
22
|
+
onMouseenter: () => {
|
|
23
|
+
hoveredIndex.value = index
|
|
24
|
+
},
|
|
22
25
|
style: {
|
|
23
|
-
opacity:
|
|
24
|
-
? props.dimOpacity
|
|
25
|
-
: 1,
|
|
26
|
+
opacity:
|
|
27
|
+
hoveredIndex.value !== null && hoveredIndex.value !== index ? props.dimOpacity : 1,
|
|
26
28
|
transition: `opacity ${props.duration}ms ease-out`,
|
|
27
29
|
},
|
|
28
|
-
})
|
|
30
|
+
})
|
|
29
31
|
)
|
|
30
32
|
|
|
31
|
-
return h(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
return h(
|
|
34
|
+
props.tag,
|
|
35
|
+
{
|
|
36
|
+
...attrs,
|
|
37
|
+
onMouseleave: () => {
|
|
38
|
+
hoveredIndex.value = null
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
styledChildren
|
|
42
|
+
)
|
|
35
43
|
}
|
|
36
44
|
},
|
|
37
45
|
})
|
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
import { useColor } from '../../composables/color'
|
|
3
3
|
import type { UiColors } from '../../types/colors'
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)
|
|
20
|
-
const colorClass = useColor(props.color, 'text')
|
|
5
|
+
const {
|
|
6
|
+
name,
|
|
7
|
+
params = undefined,
|
|
8
|
+
query = undefined,
|
|
9
|
+
variant = undefined,
|
|
10
|
+
color = undefined,
|
|
11
|
+
} = defineProps<{
|
|
12
|
+
name: string
|
|
13
|
+
params?: Record<string, string>
|
|
14
|
+
query?: Record<string, string>
|
|
15
|
+
variant?: string
|
|
16
|
+
color?: UiColors
|
|
17
|
+
}>()
|
|
18
|
+
const colorClass = useColor(color, 'text')
|
|
21
19
|
</script>
|
|
22
20
|
|
|
23
21
|
<template>
|
|
@@ -1,41 +1,50 @@
|
|
|
1
|
-
<!-- eslint-disable vue/define-macros-order -->
|
|
2
1
|
<script lang="ts" setup>
|
|
3
2
|
import { usePicture } from '../../composables/picture'
|
|
4
3
|
import type { PictureProps } from '../../types/media'
|
|
5
4
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
quality
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
const {
|
|
6
|
+
src,
|
|
7
|
+
alt,
|
|
8
|
+
width,
|
|
9
|
+
height,
|
|
10
|
+
sizes = '100vw',
|
|
11
|
+
format = 'webp',
|
|
12
|
+
quality = 80,
|
|
13
|
+
fit = 'cover',
|
|
14
|
+
loading = 'lazy',
|
|
15
|
+
fetchpriority = 'auto',
|
|
16
|
+
decoding = 'async',
|
|
17
|
+
provider,
|
|
18
|
+
preset,
|
|
19
|
+
densities,
|
|
20
|
+
class: wrapperClass = '',
|
|
21
|
+
imgClass = '',
|
|
22
|
+
} = defineProps<PictureProps>()
|
|
17
23
|
|
|
18
|
-
const { sizesString, computedFormat } = usePicture(
|
|
24
|
+
const { sizesString, computedFormat } = usePicture(
|
|
25
|
+
() => sizes,
|
|
26
|
+
() => format
|
|
27
|
+
)
|
|
19
28
|
</script>
|
|
20
29
|
|
|
21
30
|
<template>
|
|
22
31
|
<NuxtPicture
|
|
23
|
-
:src
|
|
24
|
-
:alt
|
|
25
|
-
:width
|
|
26
|
-
:height
|
|
32
|
+
:src
|
|
33
|
+
:alt
|
|
34
|
+
:width
|
|
35
|
+
:height
|
|
27
36
|
:sizes="sizesString"
|
|
28
37
|
:format="computedFormat"
|
|
29
|
-
:quality
|
|
30
|
-
:fit
|
|
31
|
-
:loading
|
|
32
|
-
:fetchpriority
|
|
33
|
-
:decoding
|
|
34
|
-
:provider
|
|
35
|
-
:preset
|
|
36
|
-
:densities
|
|
37
|
-
:class="
|
|
38
|
-
:img-attrs="{ class:
|
|
38
|
+
:quality
|
|
39
|
+
:fit
|
|
40
|
+
:loading
|
|
41
|
+
:fetchpriority
|
|
42
|
+
:decoding
|
|
43
|
+
:provider
|
|
44
|
+
:preset
|
|
45
|
+
:densities
|
|
46
|
+
:class="wrapperClass"
|
|
47
|
+
:img-attrs="{ class: imgClass }"
|
|
39
48
|
v-bind="$attrs"
|
|
40
49
|
/>
|
|
41
50
|
</template>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter } from 'vue'
|
|
1
2
|
import {
|
|
2
3
|
BREAKPOINT_VALUES,
|
|
3
4
|
DEVICE_BREAKPOINT_VALUES,
|
|
@@ -111,32 +112,21 @@ function responsiveSizesToString(sizes: ResponsiveSizes): string {
|
|
|
111
112
|
*
|
|
112
113
|
* @example
|
|
113
114
|
* ```ts
|
|
114
|
-
* const { sizesString, computedFormat
|
|
115
|
+
* const { sizesString, computedFormat } = usePicture(() => sizes, () => format)
|
|
115
116
|
* ```
|
|
116
117
|
*/
|
|
117
|
-
export function usePicture(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
*/
|
|
118
|
+
export function usePicture(
|
|
119
|
+
sizes: MaybeRefOrGetter<PictureProps['sizes']>,
|
|
120
|
+
format?: MaybeRefOrGetter<PictureProps['format']>
|
|
121
|
+
): UsePictureReturn {
|
|
122
122
|
const sizesString = computed(() => {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (typeof props.sizes === 'string') {
|
|
128
|
-
return props.sizes
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return responsiveSizesToString(props.sizes)
|
|
123
|
+
const s = toValue(sizes)
|
|
124
|
+
if (!s) return '100vw'
|
|
125
|
+
if (typeof s === 'string') return s
|
|
126
|
+
return responsiveSizesToString(s)
|
|
132
127
|
})
|
|
133
128
|
|
|
134
|
-
|
|
135
|
-
* Compute format string with fallback
|
|
136
|
-
*/
|
|
137
|
-
const computedFormat = computed(() => {
|
|
138
|
-
return props.format ?? 'webp'
|
|
139
|
-
})
|
|
129
|
+
const computedFormat = computed(() => toValue(format) ?? 'webp')
|
|
140
130
|
|
|
141
131
|
return {
|
|
142
132
|
sizesString,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kmcom-nuxt-layers",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.9",
|
|
5
5
|
"description": "Composable Nuxt 4 layers for building scalable Vue applications",
|
|
6
6
|
"files": [
|
|
7
7
|
"layers/*/nuxt.config.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@nuxt/content": "^3.0.0",
|
|
25
25
|
"@nuxt/eslint": "^1.0.0",
|
|
26
26
|
"@nuxt/image": "^2.0.0",
|
|
27
|
-
"@nuxt/ui": "^4.
|
|
27
|
+
"@nuxt/ui": "^4.5.0",
|
|
28
28
|
"@nuxtjs/device": "^4.0.0",
|
|
29
29
|
"@tresjs/cientos": "^5.0.0",
|
|
30
30
|
"@tresjs/core": "^5.0.0",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"better-sqlite3": "^12.0.0",
|
|
36
36
|
"gsap": "^3.12.0",
|
|
37
37
|
"locomotive-scroll": "^5.0.0",
|
|
38
|
-
"nuxt": "^4.
|
|
38
|
+
"nuxt": "^4.3.1",
|
|
39
39
|
"nuxt-studio": "^1.0.0",
|
|
40
40
|
"pinia": "^3.0.0",
|
|
41
|
-
"tailwindcss": "^4.2.
|
|
41
|
+
"tailwindcss": "^4.2.1",
|
|
42
42
|
"three": "^0.170.0",
|
|
43
43
|
"zod": "^3.20.0"
|
|
44
44
|
},
|
|
@@ -90,11 +90,11 @@
|
|
|
90
90
|
"@commitlint/cli": "^20.4.1",
|
|
91
91
|
"@commitlint/config-conventional": "^20.4.1",
|
|
92
92
|
"@culur/config-stylelint": "^1.6.4",
|
|
93
|
-
"@eslint/json": "^1.0.
|
|
93
|
+
"@eslint/json": "^1.0.1",
|
|
94
94
|
"@eslint/markdown": "^7.5.1",
|
|
95
95
|
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
|
|
96
96
|
"@iconify-json/lucide": "^1.2.89",
|
|
97
|
-
"@nuxt/eslint": "^1.
|
|
97
|
+
"@nuxt/eslint": "^1.15.2",
|
|
98
98
|
"@nuxt/fonts": "^0.13.0",
|
|
99
99
|
"@nuxt/image": "^2.0.0",
|
|
100
100
|
"@nuxt/ui": "latest",
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
"@perplex-digital/stylelint-config": "^17.3.0",
|
|
103
103
|
"@pinia/nuxt": "^0.11.3",
|
|
104
104
|
"@types/node": "^25.3.0",
|
|
105
|
-
"@typescript-eslint/eslint-plugin": "^8.56.
|
|
106
|
-
"@typescript-eslint/parser": "^8.56.
|
|
105
|
+
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
106
|
+
"@typescript-eslint/parser": "^8.56.1",
|
|
107
107
|
"@vue/eslint-config-typescript": "^14.7.0",
|
|
108
108
|
"@vueuse/core": "^14.2.1",
|
|
109
109
|
"@vueuse/nuxt": "^14.2.1",
|
|
@@ -112,16 +112,16 @@
|
|
|
112
112
|
"changesets": "^1.0.2",
|
|
113
113
|
"cypress": "^15.10.0",
|
|
114
114
|
"depcheck": "^1.4.7",
|
|
115
|
-
"eslint": "^10.0.
|
|
116
|
-
"eslint-plugin-compat": "^6.
|
|
115
|
+
"eslint": "^10.0.2",
|
|
116
|
+
"eslint-plugin-compat": "^6.2.0",
|
|
117
117
|
"eslint-plugin-glsl": "0.0.0-wip",
|
|
118
|
-
"eslint-plugin-oxlint": "^1.
|
|
119
|
-
"eslint-plugin-pnpm": "^1.
|
|
118
|
+
"eslint-plugin-oxlint": "^1.50.0",
|
|
119
|
+
"eslint-plugin-pnpm": "^1.6.0",
|
|
120
120
|
"eslint-plugin-prettier": "^5.5.5",
|
|
121
|
-
"eslint-plugin-unicorn": "^
|
|
121
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
122
122
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
123
123
|
"eslint-plugin-vue": "^10.8.0",
|
|
124
|
-
"npm-check-updates": "^19.
|
|
124
|
+
"npm-check-updates": "^19.5.0",
|
|
125
125
|
"nuxt": "latest",
|
|
126
126
|
"oxlint": "^1.43.0",
|
|
127
127
|
"pinia": "^3.0.4",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"stylelint-config-tailwindcss": "^1.0.1",
|
|
141
141
|
"stylelint-no-unsupported-browser-features": "^8.1.1",
|
|
142
142
|
"stylelint-prettier": "^5.0.3",
|
|
143
|
-
"tailwindcss": "^4.2.
|
|
143
|
+
"tailwindcss": "^4.2.1",
|
|
144
144
|
"turbo": "^2.8.10",
|
|
145
145
|
"typescript": "^5.9.3",
|
|
146
146
|
"vite-plugin-checker": "^0.12.0",
|