kmcom-nuxt-layers 2.2.5 → 2.2.8
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/docs/FEEDS.md +197 -0
- package/docs/LAYERS-FIXES.md +101 -0
- package/docs/MIGRATION.md +627 -0
- package/docs/feed-layer.md +374 -0
- package/docs/patch-picture-provider-type.md +52 -0
- package/docs/shaderGuide.md +2071 -0
- package/docs/types-architecture.md +234 -0
- package/layers/animations/app/components/Motion/CountUp.vue +1 -1
- package/layers/animations/app/components/Motion/Magnetic.vue +1 -1
- package/layers/animations/app/components/Motion/Marquee.vue +3 -2
- package/layers/animations/app/components/Motion/MarqueeText.vue +3 -2
- package/layers/animations/app/components/Motion/Tilt.vue +1 -1
- package/layers/animations/app/composables/useCountUp.ts +4 -1
- package/layers/animations/app/composables/useMagneticElement.ts +2 -4
- package/layers/animations/app/composables/useMarqueeCopies.ts +4 -4
- package/layers/animations/app/composables/useTiltEffect.ts +1 -1
- package/layers/animations/app/types/animations.ts +8 -0
- package/layers/animations/app/types/index.ts +1 -0
- package/layers/animations/package.json +4 -1
- package/layers/canvas/app/components/ShaderCanvas.vue +4 -4
- package/layers/canvas/app/composables/useRendererCapabilities.ts +19 -15
- package/layers/canvas/app/types/index.ts +1 -0
- package/layers/canvas/package.json +2 -1
- package/layers/canvas/tsconfig.json +2 -1
- package/layers/content/app/components/Blog/Card.vue +5 -5
- package/layers/content/app/components/Gallery/AmbientImage.vue +3 -3
- package/layers/content/app/components/Gallery/Card.vue +3 -3
- package/layers/content/app/components/Gallery/Lightbox.vue +5 -1
- package/layers/content/app/components/NuxtContent/Detail.vue +5 -1
- package/layers/content/app/components/NuxtContent/Surround.vue +5 -3
- package/layers/content/app/components/NuxtContent/Toc.vue +1 -1
- package/layers/content/app/components/Portfolio/Card.vue +5 -5
- package/layers/content/app/components/content/Figure.vue +3 -3
- package/layers/content/app/composables/useBlogPosts.ts +2 -2
- package/layers/content/app/composables/useCollectionItem.ts +1 -3
- package/layers/content/app/composables/useGalleryItems.ts +2 -2
- package/layers/content/app/types/index.ts +1 -0
- package/layers/content/package.json +2 -1
- package/layers/core/app/composables/useCache.ts +0 -1
- package/layers/core/app/composables/useErrorLog.ts +9 -11
- package/layers/core/app/plugins/error-handler.ts +36 -36
- package/layers/core/app/plugins/feature-detection.client.ts +15 -15
- package/layers/core/app/plugins/init.ts +121 -129
- package/layers/core/app/plugins/loading.client.ts +27 -27
- package/layers/core/app/plugins/scroll-guard.client.ts +26 -26
- package/layers/core/app/utils/helpers.ts +14 -12
- package/layers/core/nuxt.config.ts +1 -0
- package/layers/feeds/app/plugins/feed-head.ts +62 -63
- package/layers/feeds/package.json +2 -1
- package/layers/feeds/server/routes/feed/discovery.get.ts +1 -2
- package/layers/feeds/server/utils/content-adapter.ts +3 -2
- package/layers/forms/app/components/Form/Field.vue +4 -4
- package/layers/forms/app/types/index.ts +1 -0
- package/layers/forms/package.json +2 -1
- package/layers/forms/server/api/contact.post.ts +1 -1
- package/layers/layout/app/components/Layout/Grid/Item.vue +33 -19
- package/layers/layout/app/components/Layout/Page/Container.vue +11 -11
- package/layers/layout/app/components/Layout/Page/Header.vue +1 -1
- package/layers/layout/app/components/Layout/Page/index.vue +1 -1
- package/layers/layout/app/components/Layout/Section/Gallery.vue +6 -1
- package/layers/layout/app/components/Layout/Section/Title.vue +1 -1
- package/layers/layout/app/types/index.ts +1 -0
- package/layers/layout/package.json +2 -1
- package/layers/mailer/app/types/index.ts +1 -0
- package/layers/mailer/app/types/mailer.ts +25 -0
- package/layers/mailer/package.json +2 -1
- package/layers/motion/package.json +2 -1
- package/layers/navigation/app/components/Links/Group.vue +1 -0
- package/layers/navigation/app/components/Links/Named.vue +2 -0
- package/layers/navigation/app/types/index.ts +1 -0
- package/layers/navigation/package.json +4 -1
- package/layers/page-transitions/app/plugins/page-transitions.client.ts +9 -9
- package/layers/page-transitions/package.json +4 -1
- package/layers/routing/app/plugins/feature-flags.client.ts +9 -9
- package/layers/routing/app/types/app-config.d.ts +3 -1
- package/layers/routing/app/types/index.ts +1 -0
- package/layers/routing/package.json +2 -1
- package/layers/scripts/app/composables/useGtm.ts +1 -1
- package/layers/scripts/app/types/index.ts +1 -0
- package/layers/scripts/app/types/scripts.ts +14 -0
- package/layers/scripts/package.json +2 -1
- package/layers/scroll/app/components/Motion/ScrollScene.vue +3 -1
- package/layers/scroll/app/composables/useScrollSteps.ts +2 -9
- package/layers/scroll/app/composables/useSectionProgress.ts +2 -1
- package/layers/scroll/app/plugins/locomotive-scroll.client.ts +54 -61
- package/layers/scroll/app/types/index.ts +1 -0
- package/layers/scroll/app/types/scroll.ts +32 -0
- package/layers/scroll/package.json +3 -0
- package/layers/seo/package.json +2 -1
- package/layers/shader/app/components/Material/Fresnel.client.vue +1 -1
- package/layers/shader/app/components/Material/Image.client.vue +1 -1
- package/layers/shader/app/components/Material/Node.client.vue +7 -7
- package/layers/shader/app/components/Material/Noise.client.vue +1 -1
- package/layers/shader/app/components/Node/Color.client.vue +17 -20
- package/layers/shader/app/components/Node/Noise.client.vue +31 -34
- package/layers/shader/app/components/Pipeline/Aurora.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/BilinearGradient.client.vue +8 -11
- package/layers/shader/app/components/Pipeline/BillowNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/BrightnessContrast.client.vue +6 -2
- package/layers/shader/app/components/Pipeline/CellularNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Checkerboard.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Circle.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/Clouds.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ColorBurnBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/ColorDodgeBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/ColourRamp.client.vue +5 -9
- package/layers/shader/app/components/Pipeline/ConicGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/Cross.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/CurlNoise.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/DarkenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/DayNightCycle.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DiagonalGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DiamondGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DifferenceBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/DomainWarpedNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Dots.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/DuoTone.client.vue +5 -9
- package/layers/shader/app/components/Pipeline/ExclusionBlend.client.vue +3 -23
- package/layers/shader/app/components/Pipeline/ExponentialFog.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/FilmBurn.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Flame.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/FocalGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/GodRays.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/GradientNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Grid.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Halation.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/HardLightBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/Haze.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Hexagon.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/LensFlare.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/LightenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/LinearGradient4.client.vue +2 -2
- package/layers/shader/app/components/Pipeline/Marble.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/MonochromeTint.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/MultiplyBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/NoisyGradient.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/NoisyGradientBlend.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/OverlayBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/Polygon.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/RaymarchTunnel.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Rectangle.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/RidgedNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Ring.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ScreenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/SkyAtmosphere.client.vue +6 -9
- package/layers/shader/app/components/Pipeline/SoftLightBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/SplitTone.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Star.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Stripes.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Tint.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Triangle.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ValueNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/VoronoiEdges.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Water.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/WaveBendLayer.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/WaveColourLayer.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/Wood.client.vue +4 -8
- package/layers/shader/app/components/Preset/Aurora.client.vue +15 -21
- package/layers/shader/app/components/Preset/Flow.client.vue +2 -1
- package/layers/shader/app/components/Preset/GradientMesh.client.vue +2 -1
- package/layers/shader/app/components/Preset/Nebula.client.vue +2 -1
- package/layers/shader/app/components/Preset/Ocean.client.vue +2 -1
- package/layers/shader/app/components/Preset/ThemeAurora.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeBubble.client.vue +30 -91
- package/layers/shader/app/components/Preset/ThemeFlow.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeGradient.client.vue +30 -91
- package/layers/shader/app/components/Preset/ThemeLavaLamp.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemePlasma.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeWave.client.vue +30 -90
- package/layers/shader/app/components/Shader/Background.client.vue +4 -4
- package/layers/shader/app/components/Shader/Host.client.vue +31 -33
- package/layers/shader/app/components/Shader/Runtime.client.vue +15 -23
- package/layers/shader/app/composables/useAmbientMaterials.ts +53 -51
- package/layers/shader/app/composables/useShaderMixBlend.ts +26 -0
- package/layers/shader/app/composables/useThemePreset.ts +75 -0
- package/layers/shader/app/plugins/shader.client.ts +21 -21
- package/layers/shader/app/shaders/common/noise.ts +2 -7
- package/layers/shader/app/shaders/types.ts +6 -6
- package/layers/shader/app/types/tsl.ts +7 -25
- package/layers/shader/app/types/uniforms.ts +2 -1
- package/layers/shader/app/utils/tsl/color.ts +7 -1
- package/layers/shader/package.json +2 -1
- package/layers/theme/app/components/ThemePicker/Colors.vue +1 -3
- package/layers/theme/app/plugins/theme.client.ts +54 -51
- package/layers/theme/app/types/app-config.d.ts +4 -2
- package/layers/theme/app/types/index.ts +1 -0
- package/layers/theme/app/types/theme.ts +3 -18
- package/layers/theme/package.json +2 -1
- package/layers/theme/server/plugins/theme-fouc.ts +1 -1
- package/layers/transitions/package.json +4 -1
- package/layers/typography/app/components/Typography/CodeBlock.vue +2 -2
- package/layers/typography/app/components/Typography/Headline.vue +2 -2
- package/layers/typography/app/components/Typography/HeadlineScreen.vue +1 -1
- package/layers/typography/app/components/Typography/QuoteBlock.vue +4 -1
- package/layers/typography/app/components/Typography/TextStroke.vue +2 -0
- package/layers/typography/app/components/Typography/index.vue +36 -27
- package/layers/typography/app/composables/typography.ts +27 -21
- package/layers/typography/app/types/colors.ts +9 -29
- package/layers/typography/app/types/index.ts +2 -0
- package/layers/typography/package.json +4 -1
- package/layers/ui/package.json +2 -1
- package/layers/visual/app/app.config.ts +5 -2
- package/layers/visual/app/components/Accent/Blob.vue +20 -20
- package/layers/visual/app/components/Accent/Scene.vue +2 -2
- package/layers/visual/app/components/Base/Modal.vue +2 -2
- package/layers/visual/app/components/Gradient/Background.vue +2 -2
- package/layers/visual/app/components/Gradient/Text.vue +2 -2
- package/layers/visual/app/components/Media/Picture.vue +3 -1
- package/layers/visual/app/components/Progress/Bar.vue +6 -6
- package/layers/visual/app/components/Tint/Overlay.vue +14 -14
- package/layers/visual/app/composables/accent.ts +10 -8
- package/layers/visual/app/composables/gradient.ts +2 -3
- package/layers/visual/app/composables/tint.ts +7 -7
- package/layers/visual/app/types/index.ts +6 -0
- package/layers/visual/app/types/media.ts +4 -2
- package/layers/visual/app/types/tint.ts +2 -1
- package/layers/visual/package.json +4 -1
- package/package.json +5 -2
|
@@ -4,8 +4,8 @@ export function useBlogPosts(options: BlogQueryOptions = {}) {
|
|
|
4
4
|
const { excludeDrafts = true, tags, limit } = options
|
|
5
5
|
|
|
6
6
|
return useContentData('blog-posts', async () => {
|
|
7
|
-
let posts = (await queryCollection('blog').all()).sort(
|
|
8
|
-
(
|
|
7
|
+
let posts = (await queryCollection('blog').all()).sort((a, b) =>
|
|
8
|
+
(b.date ?? '').localeCompare(a.date ?? '')
|
|
9
9
|
)
|
|
10
10
|
|
|
11
11
|
if (excludeDrafts) {
|
|
@@ -2,8 +2,6 @@ import type { Collections } from '@nuxt/content'
|
|
|
2
2
|
|
|
3
3
|
export function useCollectionItem(collection: keyof Collections, slug: string) {
|
|
4
4
|
return useContentData(`${collection}-${slug}`, () =>
|
|
5
|
-
queryCollection(collection)
|
|
6
|
-
.path(`/${collection}/${slug}`)
|
|
7
|
-
.first()
|
|
5
|
+
queryCollection(collection).path(`/${collection}/${slug}`).first()
|
|
8
6
|
)
|
|
9
7
|
}
|
|
@@ -4,8 +4,8 @@ export function useGalleryItems(options: GalleryQueryOptions = {}) {
|
|
|
4
4
|
const { tags, limit } = options
|
|
5
5
|
|
|
6
6
|
return useContentData('gallery-items', async () => {
|
|
7
|
-
let items = (await queryCollection('gallery').all()).sort(
|
|
8
|
-
(
|
|
7
|
+
let items = (await queryCollection('gallery').all()).sort((a, b) =>
|
|
8
|
+
(b.date ?? '').localeCompare(a.date ?? '')
|
|
9
9
|
)
|
|
10
10
|
|
|
11
11
|
if (tags?.length) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './content'
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"dev:prepare": "nuxt prepare .playground",
|
|
11
11
|
"build": "CONTENT_STANDALONE=true nuxi build",
|
|
12
12
|
"generate": "CONTENT_STANDALONE=true nuxi generate",
|
|
13
|
-
"preview": "nuxt preview .playground"
|
|
13
|
+
"preview": "nuxt preview .playground",
|
|
14
|
+
"lint": "eslint ."
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
17
|
"@nuxt/content": "catalog:"
|
|
@@ -94,9 +94,9 @@ export function useErrorLog() {
|
|
|
94
94
|
const { externalUrl, externalToken } = config.value
|
|
95
95
|
|
|
96
96
|
if (!externalUrl) {
|
|
97
|
-
process.env.NODE_ENV === 'development'
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
if (process.env.NODE_ENV === 'development') {
|
|
98
|
+
console.warn('Error logging enabled but no externalUrl configured')
|
|
99
|
+
}
|
|
100
100
|
return
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -118,10 +118,8 @@ export function useErrorLog() {
|
|
|
118
118
|
})
|
|
119
119
|
} catch (loggingError) {
|
|
120
120
|
// Don't let logging errors crash the app
|
|
121
|
-
if (import.meta.dev) {
|
|
122
|
-
|
|
123
|
-
? console.error('Failed to send error to external service:', loggingError)
|
|
124
|
-
: ''
|
|
121
|
+
if (import.meta.dev && process.env.NODE_ENV === 'development') {
|
|
122
|
+
console.error('Failed to send error to external service:', loggingError)
|
|
125
123
|
}
|
|
126
124
|
}
|
|
127
125
|
}
|
|
@@ -130,8 +128,8 @@ export function useErrorLog() {
|
|
|
130
128
|
* Log a warning (non-critical error)
|
|
131
129
|
*/
|
|
132
130
|
const logWarning = (message: string, context?: ErrorContext) => {
|
|
133
|
-
if (config.value.logToConsole && import.meta.dev) {
|
|
134
|
-
|
|
131
|
+
if (config.value.logToConsole && import.meta.dev && process.env.NODE_ENV === 'development') {
|
|
132
|
+
console.warn('⚠️ Warning:', message, context)
|
|
135
133
|
}
|
|
136
134
|
}
|
|
137
135
|
|
|
@@ -139,8 +137,8 @@ export function useErrorLog() {
|
|
|
139
137
|
* Log info (for debugging)
|
|
140
138
|
*/
|
|
141
139
|
const logInfo = (message: string, data?: unknown) => {
|
|
142
|
-
if (config.value.logToConsole && import.meta.dev) {
|
|
143
|
-
|
|
140
|
+
if (config.value.logToConsole && import.meta.dev && process.env.NODE_ENV === 'development') {
|
|
141
|
+
console.log('ℹ️ Info:', message, data)
|
|
144
142
|
}
|
|
145
143
|
}
|
|
146
144
|
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
export default defineNuxtPlugin({
|
|
2
2
|
name: 'core:error-handler',
|
|
3
3
|
setup(nuxtApp) {
|
|
4
|
-
|
|
4
|
+
const { logError } = useErrorLog()
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
// Global Vue error handler
|
|
7
|
+
nuxtApp.vueApp.config.errorHandler = (error, instance, info) => {
|
|
8
|
+
// Get component name for context
|
|
9
|
+
const componentName =
|
|
10
|
+
instance?.$options?.name || instance?.$options?.__name || 'Unknown Component'
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
// Log error with context
|
|
13
|
+
logError(error, {
|
|
14
|
+
component: componentName,
|
|
15
|
+
info: String(info),
|
|
16
|
+
type: 'vue-error',
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
// Nuxt-specific error hook (catches errors during SSR, routing, etc.)
|
|
21
|
+
nuxtApp.hook('vue:error', (error, instance, info) => {
|
|
22
|
+
// Get component name for context
|
|
23
|
+
const componentName =
|
|
24
|
+
instance?.$options?.name || instance?.$options?.__name || 'Unknown Component'
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
// Log error with context
|
|
27
|
+
logError(error, {
|
|
28
|
+
component: componentName,
|
|
29
|
+
info: String(info),
|
|
30
|
+
type: 'nuxt-error',
|
|
31
|
+
})
|
|
31
32
|
})
|
|
32
|
-
})
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
// Handle app initialization errors
|
|
35
|
+
nuxtApp.hook('app:error', (error) => {
|
|
36
|
+
logError(error, {
|
|
37
|
+
type: 'app-error',
|
|
38
|
+
info: 'Application initialization error',
|
|
39
|
+
})
|
|
39
40
|
})
|
|
40
|
-
})
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
// Handle page errors
|
|
43
|
+
nuxtApp.hook('app:error:cleared', () => {
|
|
44
|
+
if (import.meta.dev) {
|
|
45
|
+
console.log('✅ Error cleared')
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
48
|
},
|
|
49
49
|
})
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
export default defineNuxtPlugin({
|
|
15
15
|
name: 'core:feature-detection',
|
|
16
16
|
setup() {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
// Initialize feature detection
|
|
18
|
+
const features = useFeatures()
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
if (import.meta.dev && process.env.NODE_ENV === 'development') {
|
|
21
|
+
console.log('[Feature Detection] Initialized:', {
|
|
22
|
+
grid: features.grid.value,
|
|
23
|
+
subgrid: features.subgrid.value,
|
|
24
|
+
containerQueries: features.containerQueries.value,
|
|
25
|
+
has: features.has.value,
|
|
26
|
+
webGL: features.webGL.value,
|
|
27
|
+
darkMode: features.darkMode.value,
|
|
28
|
+
reducedMotion: features.reducedMotion.value,
|
|
29
|
+
webp: features.webp.value,
|
|
30
|
+
avif: features.avif.value,
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
33
|
},
|
|
34
34
|
})
|
|
@@ -12,167 +12,159 @@
|
|
|
12
12
|
export default defineNuxtPlugin({
|
|
13
13
|
name: 'core:init',
|
|
14
14
|
setup(nuxtApp) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// ============================================================
|
|
20
|
-
// 1. Log initialization (dev only)
|
|
21
|
-
// ============================================================
|
|
22
|
-
if (isDev) {
|
|
23
|
-
console.log('🚀 [Core Layer] Initializing...')
|
|
24
|
-
|
|
25
|
-
console.log('[Core Layer] Config:', config.coreLayer)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// ============================================================
|
|
29
|
-
// 2. Verify modules and composables are loaded
|
|
30
|
-
// ============================================================
|
|
31
|
-
try {
|
|
32
|
-
// Test @nuxtjs/device module (SSR-safe: returns undefined before device plugin runs)
|
|
33
|
-
const device = useDevice()
|
|
34
|
-
|
|
35
|
-
if (isDev && device) {
|
|
36
|
-
console.log('[Core Layer] Device detection:', {
|
|
37
|
-
mobile: device.isMobile,
|
|
38
|
-
desktop: device.isDesktop,
|
|
39
|
-
tablet: device.isTablet,
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Test @vueuse/nuxt module
|
|
44
|
-
const isOnline = useOnline()
|
|
15
|
+
const config = useAppConfig()
|
|
16
|
+
// const isDev = import.meta.dev
|
|
17
|
+
const isDev = process.env.NODE_ENV === 'development'
|
|
45
18
|
|
|
19
|
+
// 1. Log initialization (dev only)
|
|
46
20
|
if (isDev) {
|
|
47
|
-
console.log('[Core Layer]
|
|
21
|
+
console.log('🚀 [Core Layer] Initializing...')
|
|
22
|
+
|
|
23
|
+
console.log('[Core Layer] Config:', config.coreLayer)
|
|
48
24
|
}
|
|
49
25
|
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
// Test
|
|
53
|
-
const
|
|
26
|
+
// 2. Verify modules and composables are loaded
|
|
27
|
+
try {
|
|
28
|
+
// Test @nuxtjs/device module (SSR-safe: returns undefined before device plugin runs)
|
|
29
|
+
const device = useDevice()
|
|
54
30
|
|
|
55
|
-
if (isDev) {
|
|
56
|
-
console.log('[Core Layer]
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
os: os.value,
|
|
31
|
+
if (isDev && device) {
|
|
32
|
+
console.log('[Core Layer] Device detection:', {
|
|
33
|
+
mobile: device.isMobile,
|
|
34
|
+
desktop: device.isDesktop,
|
|
35
|
+
tablet: device.isTablet,
|
|
61
36
|
})
|
|
62
37
|
}
|
|
63
38
|
|
|
64
|
-
// Test
|
|
65
|
-
const
|
|
39
|
+
// Test @vueuse/nuxt module
|
|
40
|
+
const isOnline = useOnline()
|
|
66
41
|
|
|
67
42
|
if (isDev) {
|
|
68
|
-
console.log('[Core Layer]
|
|
69
|
-
breakpoint: breakpoint.value,
|
|
70
|
-
retina: isRetina.value,
|
|
71
|
-
orientation: orientation.value,
|
|
72
|
-
})
|
|
43
|
+
console.log('[Core Layer] VueUse loaded, online status:', isOnline.value)
|
|
73
44
|
}
|
|
74
45
|
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
46
|
+
// Client-only detection (requires browser APIs)
|
|
47
|
+
if (import.meta.client) {
|
|
48
|
+
// Test browser detection composable
|
|
49
|
+
const { name, version, engine, os } = useBrowser()
|
|
50
|
+
|
|
51
|
+
if (isDev) {
|
|
52
|
+
console.log('[Core Layer] Browser detection:', {
|
|
53
|
+
name: name.value,
|
|
54
|
+
version: version.value,
|
|
55
|
+
engine: engine.value,
|
|
56
|
+
os: os.value,
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Test screen/breakpoint composable
|
|
61
|
+
const { breakpoint, isRetina, orientation } = useScreen()
|
|
62
|
+
|
|
63
|
+
if (isDev) {
|
|
64
|
+
console.log('[Core Layer] Screen detection:', {
|
|
65
|
+
breakpoint: breakpoint.value,
|
|
66
|
+
retina: isRetina.value,
|
|
67
|
+
orientation: orientation.value,
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Test network info composable
|
|
72
|
+
const { connectionQuality, effectiveType, saveData } = useNetworkInfo()
|
|
73
|
+
|
|
74
|
+
if (isDev) {
|
|
75
|
+
console.log('[Core Layer] Network detection:', {
|
|
76
|
+
quality: connectionQuality.value,
|
|
77
|
+
type: effectiveType.value,
|
|
78
|
+
dataSaver: saveData.value,
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Test feature detection composable
|
|
83
|
+
const { grid, subgrid, containerQueries, webGL, darkMode } = useFeatures()
|
|
84
|
+
|
|
85
|
+
if (isDev) {
|
|
86
|
+
console.log('[Core Layer] Feature detection:', {
|
|
87
|
+
grid: grid.value,
|
|
88
|
+
subgrid: subgrid.value,
|
|
89
|
+
containerQueries: containerQueries.value,
|
|
90
|
+
webGL: webGL.value,
|
|
91
|
+
darkMode: darkMode.value,
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Test cache management composable
|
|
96
|
+
const { offlineReady, isOnline: cacheOnline } = useCache()
|
|
97
|
+
|
|
98
|
+
if (isDev) {
|
|
99
|
+
console.log('[Core Layer] Cache status:', {
|
|
100
|
+
online: cacheOnline.value,
|
|
101
|
+
offlineReady: offlineReady.value,
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// PWA composable is only available in production
|
|
106
|
+
// Use usePWAInfo() from core layer for PWA status
|
|
84
107
|
}
|
|
85
108
|
|
|
86
|
-
// Test
|
|
87
|
-
const {
|
|
109
|
+
// Test rendering mode detection (works on both server and client)
|
|
110
|
+
const { mode, isServer, isClient, isHydrated } = useRendering()
|
|
88
111
|
|
|
89
112
|
if (isDev) {
|
|
90
|
-
console.log('[Core Layer]
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
darkMode: darkMode.value,
|
|
113
|
+
console.log('[Core Layer] Rendering mode:', {
|
|
114
|
+
mode: mode.value,
|
|
115
|
+
server: isServer.value,
|
|
116
|
+
client: isClient.value,
|
|
117
|
+
hydrated: isHydrated.value,
|
|
96
118
|
})
|
|
97
119
|
}
|
|
98
120
|
|
|
99
|
-
// Test
|
|
100
|
-
const
|
|
121
|
+
// Test environment access (works on both server and client)
|
|
122
|
+
const env = useEnv() as unknown as Record<string, unknown>
|
|
101
123
|
|
|
102
124
|
if (isDev) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
125
|
+
const publicConfig = env.public as Record<string, unknown> | undefined
|
|
126
|
+
|
|
127
|
+
console.log('[Core Layer] Environment config loaded:', {
|
|
128
|
+
hasPublicConfig: Boolean(publicConfig),
|
|
129
|
+
publicKeys: Object.keys(publicConfig ?? {}),
|
|
106
130
|
})
|
|
107
131
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
// Use usePWAInfo() from core layer for PWA status
|
|
132
|
+
} catch (error) {
|
|
133
|
+
console.error('[Core Layer] Module verification failed:', error)
|
|
111
134
|
}
|
|
112
135
|
|
|
113
|
-
//
|
|
114
|
-
const { mode, isServer, isClient, isHydrated } = useRendering()
|
|
115
|
-
|
|
136
|
+
// 3. App lifecycle hooks (dev logging)
|
|
116
137
|
if (isDev) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
server: isServer.value,
|
|
120
|
-
client: isClient.value,
|
|
121
|
-
hydrated: isHydrated.value,
|
|
138
|
+
nuxtApp.hook('app:created', () => {
|
|
139
|
+
console.log('✅ [Core Layer] App created')
|
|
122
140
|
})
|
|
123
|
-
}
|
|
124
141
|
|
|
125
|
-
|
|
126
|
-
|
|
142
|
+
nuxtApp.hook('app:beforeMount', () => {
|
|
143
|
+
console.log('⏳ [Core Layer] App mounting...')
|
|
144
|
+
})
|
|
127
145
|
|
|
128
|
-
|
|
129
|
-
|
|
146
|
+
nuxtApp.hook('app:mounted', () => {
|
|
147
|
+
console.log('✅ [Core Layer] App mounted')
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
nuxtApp.hook('page:start', () => {
|
|
151
|
+
console.log('📄 [Core Layer] Page navigation started')
|
|
152
|
+
})
|
|
130
153
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
publicKeys: Object.keys(publicConfig ?? {}),
|
|
154
|
+
nuxtApp.hook('page:finish', () => {
|
|
155
|
+
console.log('✅ [Core Layer] Page navigation finished')
|
|
134
156
|
})
|
|
135
157
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
console.log('✅ [Core Layer] App created')
|
|
146
|
-
})
|
|
147
|
-
|
|
148
|
-
nuxtApp.hook('app:beforeMount', () => {
|
|
149
|
-
console.log('⏳ [Core Layer] App mounting...')
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
nuxtApp.hook('app:mounted', () => {
|
|
153
|
-
console.log('✅ [Core Layer] App mounted')
|
|
154
|
-
})
|
|
155
|
-
|
|
156
|
-
nuxtApp.hook('page:start', () => {
|
|
157
|
-
console.log('📄 [Core Layer] Page navigation started')
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
nuxtApp.hook('page:finish', () => {
|
|
161
|
-
console.log('✅ [Core Layer] Page navigation finished')
|
|
162
|
-
})
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// ============================================================
|
|
166
|
-
// 4. Provide global helpers (optional)
|
|
167
|
-
// ============================================================
|
|
168
|
-
// Make core utilities available throughout the app
|
|
169
|
-
return {
|
|
170
|
-
provide: {
|
|
171
|
-
coreLayer: {
|
|
172
|
-
version: '1.0.0',
|
|
173
|
-
initialized: true,
|
|
158
|
+
|
|
159
|
+
// 4. Provide global helpers (optional)
|
|
160
|
+
// Make core utilities available throughout the app
|
|
161
|
+
return {
|
|
162
|
+
provide: {
|
|
163
|
+
coreLayer: {
|
|
164
|
+
version: '1.0.0',
|
|
165
|
+
initialized: true,
|
|
166
|
+
},
|
|
174
167
|
},
|
|
175
|
-
}
|
|
176
|
-
}
|
|
168
|
+
}
|
|
177
169
|
},
|
|
178
170
|
})
|
|
@@ -26,32 +26,32 @@ type CoreLayerConfig = {
|
|
|
26
26
|
export default defineNuxtPlugin({
|
|
27
27
|
name: 'core:loading',
|
|
28
28
|
setup(nuxtApp) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
29
|
+
const config = useAppConfig()
|
|
30
|
+
const coreLayer = config.coreLayer as CoreLayerConfig | undefined
|
|
31
|
+
|
|
32
|
+
// console.log('[Loading Plugin] Config:', coreLayer?.loading)
|
|
33
|
+
|
|
34
|
+
// Check if loading is enabled
|
|
35
|
+
if (coreLayer?.loading?.enabled === false) {
|
|
36
|
+
// console.log('[Loading Plugin] Disabled')
|
|
37
|
+
return // Disabled, skip initialization
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const { startLoading, stopLoading } = useLoading()
|
|
41
|
+
|
|
42
|
+
// console.log('[Loading Plugin] Starting loading...')
|
|
43
|
+
// Start loading immediately on plugin load
|
|
44
|
+
startLoading()
|
|
45
|
+
|
|
46
|
+
// Stop loading when app is fully mounted
|
|
47
|
+
nuxtApp.hook('app:mounted', () => {
|
|
48
|
+
// console.log('[Loading Plugin] App mounted, will stop in 500ms')
|
|
49
|
+
// Add a small delay to ensure LoadingScreen component has mounted
|
|
50
|
+
// and is visible before we stop loading
|
|
51
|
+
setTimeout(() => {
|
|
52
|
+
// console.log('[Loading Plugin] Stopping loading now')
|
|
53
|
+
stopLoading()
|
|
54
|
+
}, 500) // 500ms delay to ensure component is visible
|
|
55
|
+
})
|
|
56
56
|
},
|
|
57
57
|
})
|
|
@@ -23,34 +23,34 @@ type CoreLayerConfig = {
|
|
|
23
23
|
export default defineNuxtPlugin({
|
|
24
24
|
name: 'core:scroll-guard',
|
|
25
25
|
setup() {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const config = useAppConfig()
|
|
27
|
+
const coreLayer = config.coreLayer as CoreLayerConfig | undefined
|
|
28
|
+
|
|
29
|
+
if (coreLayer?.scrollGuard?.enabled === false) {
|
|
30
|
+
if (import.meta.dev) {
|
|
31
|
+
console.log('[Scroll Guard] Disabled via config')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const { enable, clampedCount } = useScrollGuard()
|
|
37
|
+
|
|
38
|
+
enable()
|
|
28
39
|
|
|
29
|
-
if (coreLayer?.scrollGuard?.enabled === false) {
|
|
30
40
|
if (import.meta.dev) {
|
|
31
|
-
console.log('[Scroll Guard]
|
|
41
|
+
console.log('[Scroll Guard] Initialized', {
|
|
42
|
+
strict: coreLayer?.scrollGuard?.strict ?? true,
|
|
43
|
+
debug: coreLayer?.scrollGuard?.debug ?? false,
|
|
44
|
+
excludeSelectors: coreLayer?.scrollGuard?.excludeSelectors ?? [
|
|
45
|
+
'.carousel',
|
|
46
|
+
'.overflow-intent',
|
|
47
|
+
],
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
// Log clamped count after initial scan settles
|
|
51
|
+
requestAnimationFrame(() => {
|
|
52
|
+
console.log(`[Scroll Guard] Clamped ${clampedCount.value} element(s)`)
|
|
53
|
+
})
|
|
32
54
|
}
|
|
33
|
-
return
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const { enable, clampedCount } = useScrollGuard()
|
|
37
|
-
|
|
38
|
-
enable()
|
|
39
|
-
|
|
40
|
-
if (import.meta.dev) {
|
|
41
|
-
console.log('[Scroll Guard] Initialized', {
|
|
42
|
-
strict: coreLayer?.scrollGuard?.strict ?? true,
|
|
43
|
-
debug: coreLayer?.scrollGuard?.debug ?? false,
|
|
44
|
-
excludeSelectors: coreLayer?.scrollGuard?.excludeSelectors ?? [
|
|
45
|
-
'.carousel',
|
|
46
|
-
'.overflow-intent',
|
|
47
|
-
],
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
// Log clamped count after initial scan settles
|
|
51
|
-
requestAnimationFrame(() => {
|
|
52
|
-
console.log(`[Scroll Guard] Clamped ${clampedCount.value} element(s)`)
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
55
|
},
|
|
56
56
|
})
|