kmcom-nuxt-layers 5.0.3 → 5.0.5
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/content/app/components/Gallery/Lightbox.vue +1 -1
- package/layers/core/app/composables/useBrowser.ts +2 -2
- package/layers/core/app/utils/browserInfo.ts +7 -7
- package/layers/design-system/visual/app/types/index.ts +0 -2
- package/layers/motion/scroll/app/components/Motion/ScrollScene.vue +2 -1
- package/layers/motion/scroll/app/components/Motion/ScrollStep.vue +2 -1
- package/layers/motion/scroll/app/composables/useScrollSteps.ts +0 -2
- package/layers/motion/scroll/app/composables/useSmoothScroll.ts +2 -6
- package/layers/motion/scroll/app/types/scroll.ts +5 -5
- package/layers/motion/scroll/app/utils/scroll.ts +2 -8
- package/layers/structure/navigation/app/components/Links/Named.vue +2 -4
- package/package.json +1 -1
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<UModal
|
|
48
48
|
v-model:open="open"
|
|
49
49
|
fullscreen
|
|
50
|
-
:ui="{ content: '
|
|
50
|
+
:ui="{ content: 'flex items-center justify-center bg-black/95' }"
|
|
51
51
|
>
|
|
52
52
|
<template #content>
|
|
53
53
|
<div class="relative flex h-full w-full items-center justify-center p-4">
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getBrowserVersionParts,
|
|
3
3
|
isBrowserAtLeast,
|
|
4
4
|
parseBrowserInfo,
|
|
5
|
-
type
|
|
5
|
+
type ParsedBrowserInfo,
|
|
6
6
|
} from '#layers/core/app/utils/browserInfo'
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
* @returns Browser information and helper flags
|
|
17
17
|
*/
|
|
18
18
|
export function useBrowser() {
|
|
19
|
-
const info = ref<
|
|
19
|
+
const info = ref<ParsedBrowserInfo>(parseBrowserInfo())
|
|
20
20
|
|
|
21
21
|
// Helper flags
|
|
22
22
|
const isChrome = computed(() => info.value.name === 'chrome')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type ParsedBrowserInfo = {
|
|
2
2
|
name: string
|
|
3
3
|
version: string
|
|
4
4
|
engine: string
|
|
@@ -7,14 +7,14 @@ export type BrowserInfo = {
|
|
|
7
7
|
|
|
8
8
|
type BrowserRule = {
|
|
9
9
|
match: (ua: string) => boolean
|
|
10
|
-
name:
|
|
11
|
-
engine:
|
|
10
|
+
name: ParsedBrowserInfo['name']
|
|
11
|
+
engine: ParsedBrowserInfo['engine']
|
|
12
12
|
version: (ua: string) => string
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
type OsRule = {
|
|
16
16
|
match: (ua: string) => boolean
|
|
17
|
-
os:
|
|
17
|
+
os: ParsedBrowserInfo['os']
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const OS_RULES: OsRule[] = [
|
|
@@ -58,11 +58,11 @@ const BROWSER_RULES: BrowserRule[] = [
|
|
|
58
58
|
},
|
|
59
59
|
]
|
|
60
60
|
|
|
61
|
-
function detectOs(ua: string):
|
|
61
|
+
function detectOs(ua: string): ParsedBrowserInfo['os'] {
|
|
62
62
|
return OS_RULES.find((rule) => rule.match(ua))?.os ?? 'unknown'
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
function detectBrowser(ua: string): Pick<
|
|
65
|
+
function detectBrowser(ua: string): Pick<ParsedBrowserInfo, 'name' | 'version' | 'engine'> {
|
|
66
66
|
const rule = BROWSER_RULES.find((candidate) => candidate.match(ua))
|
|
67
67
|
if (!rule) return { name: 'unknown', version: '0', engine: 'unknown' }
|
|
68
68
|
return {
|
|
@@ -72,7 +72,7 @@ function detectBrowser(ua: string): Pick<BrowserInfo, 'name' | 'version' | 'engi
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
export function parseBrowserInfo(userAgent?: string | null):
|
|
75
|
+
export function parseBrowserInfo(userAgent?: string | null): ParsedBrowserInfo {
|
|
76
76
|
if (!import.meta.client) {
|
|
77
77
|
return {
|
|
78
78
|
name: 'unknown',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { ScrollTrigger as GSAPScrollTrigger } from 'gsap/ScrollTrigger'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import type { ScrollSceneContext } from '../../types/scroll'
|
|
5
|
+
import { SCROLL_SCENE_KEY } from '../../composables/useScrollSteps'
|
|
5
6
|
|
|
6
7
|
const {
|
|
7
8
|
name,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { ScrollSceneContext } from '../../types/scroll'
|
|
3
|
+
import { SCROLL_SCENE_KEY } from '../../composables/useScrollSteps'
|
|
3
4
|
|
|
4
5
|
const { index } = defineProps<{
|
|
5
6
|
/**
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import type { Ref } from 'vue'
|
|
2
2
|
import type LocomotiveScroll from 'locomotive-scroll'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
runNativeScroll,
|
|
7
|
-
type ScrollTarget,
|
|
8
|
-
type ScrollToOptions,
|
|
9
|
-
} from '../utils/scroll'
|
|
4
|
+
import { runLocomotiveScroll, runNativeScroll, type ScrollTarget } from '../utils/scroll'
|
|
5
|
+
import type { ScrollToOptions } from '../types/scroll'
|
|
10
6
|
|
|
11
7
|
/**
|
|
12
8
|
* Unified scroll composable using Locomotive Scroll v5 smooth scrolling
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ComputedRef, Ref } from 'vue'
|
|
2
2
|
|
|
3
3
|
export type ScrollToOptions = {
|
|
4
|
-
offset?: number
|
|
5
|
-
duration?: number
|
|
6
|
-
immediate?: boolean
|
|
7
|
-
lock?: boolean
|
|
8
|
-
onComplete?: () => void
|
|
4
|
+
offset?: number | undefined
|
|
5
|
+
duration?: number | undefined
|
|
6
|
+
immediate?: boolean | undefined
|
|
7
|
+
lock?: boolean | undefined
|
|
8
|
+
onComplete?: (() => void) | undefined
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export type SectionProgressOptions = {
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import type LocomotiveScroll from 'locomotive-scroll'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import type { ScrollToOptions } from '../types/scroll'
|
|
4
4
|
|
|
5
|
-
export type
|
|
6
|
-
offset?: number | undefined
|
|
7
|
-
duration?: number | undefined
|
|
8
|
-
immediate?: boolean | undefined
|
|
9
|
-
lock?: boolean | undefined
|
|
10
|
-
onComplete?: (() => void) | undefined
|
|
11
|
-
}
|
|
5
|
+
export type ScrollTarget = string | number | HTMLElement
|
|
12
6
|
|
|
13
7
|
function resolveScrollOffset(options?: ScrollToOptions) {
|
|
14
8
|
return options?.offset ?? 0
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import type { LinkProps } from '@nuxt/ui'
|
|
2
3
|
import type { UiColors } from '#layers/typography/types/colors'
|
|
3
4
|
|
|
4
5
|
defineOptions({ inheritAttrs: false })
|
|
@@ -19,10 +20,7 @@
|
|
|
19
20
|
const colorClass = useColor(color, 'text')
|
|
20
21
|
// `name` is a plain string here, not one of the app's typed route names
|
|
21
22
|
const to = computed(
|
|
22
|
-
() =>
|
|
23
|
-
({ name, params: params ?? {}, query: query ?? {} }) as unknown as NonNullable<
|
|
24
|
-
Parameters<typeof navigateTo>[0]
|
|
25
|
-
>
|
|
23
|
+
() => ({ name, params: params ?? {}, query: query ?? {} }) as unknown as LinkProps['to']
|
|
26
24
|
)
|
|
27
25
|
</script>
|
|
28
26
|
|
package/package.json
CHANGED