kmcom-nuxt-layers 5.0.4 → 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.
@@ -2,7 +2,7 @@ import {
2
2
  getBrowserVersionParts,
3
3
  isBrowserAtLeast,
4
4
  parseBrowserInfo,
5
- type BrowserInfo,
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<BrowserInfo>(parseBrowserInfo())
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 BrowserInfo = {
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: BrowserInfo['name']
11
- engine: BrowserInfo['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: BrowserInfo['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): BrowserInfo['os'] {
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<BrowserInfo, 'name' | 'version' | 'engine'> {
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): BrowserInfo {
75
+ export function parseBrowserInfo(userAgent?: string | null): ParsedBrowserInfo {
76
76
  if (!import.meta.client) {
77
77
  return {
78
78
  name: 'unknown',
@@ -2,5 +2,3 @@ export type * from './accent'
2
2
  export type * from './breakpoints'
3
3
  export type * from './gradient'
4
4
  export type * from './media'
5
- export type { TintLevel, TintColorSlot, TintConfig } from './tint'
6
- export { TINT_LEVEL_OPACITY } from './tint'
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import type { ScrollTrigger as GSAPScrollTrigger } from 'gsap/ScrollTrigger'
3
3
 
4
- import { SCROLL_SCENE_KEY, type ScrollSceneContext } from '../../composables/useScrollSteps'
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 { SCROLL_SCENE_KEY, type ScrollSceneContext } from '../../composables/useScrollSteps'
2
+ import type { ScrollSceneContext } from '../../types/scroll'
3
+ import { SCROLL_SCENE_KEY } from '../../composables/useScrollSteps'
3
4
 
4
5
  const { index } = defineProps<{
5
6
  /**
@@ -2,8 +2,6 @@ import type { ScrollSceneContext } from '../types/scroll'
2
2
 
3
3
  export const SCROLL_SCENE_KEY = Symbol('motionScrollScene')
4
4
 
5
- export type { ScrollSceneContext }
6
-
7
5
  /**
8
6
  * Step/waypoint state tracking — must be used inside a MotionScrollScene.
9
7
  *
@@ -1,12 +1,8 @@
1
1
  import type { Ref } from 'vue'
2
2
  import type LocomotiveScroll from 'locomotive-scroll'
3
3
 
4
- import {
5
- runLocomotiveScroll,
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
- export type ScrollTarget = string | number | HTMLElement
3
+ import type { ScrollToOptions } from '../types/scroll'
4
4
 
5
- export type ScrollToOptions = {
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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kmcom-nuxt-layers",
3
3
  "private": false,
4
- "version": "5.0.4",
4
+ "version": "5.0.5",
5
5
  "description": "Composable Nuxt 4 layers for building scalable Vue applications",
6
6
  "exports": {
7
7
  "./layers/core": "./layers/core/nuxt.config.ts",