Skip to content

Commit

Permalink
Notivue - Move isMouse util to /Notivue
Browse files Browse the repository at this point in the history
  • Loading branch information
smastrom committed Apr 15, 2024
1 parent 6b29277 commit 49f57a1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/notivue/Notivue/composables/useMouseEvents.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { computed } from 'vue'

import { isMouse } from '@/core/utils'
import { isMouse } from '@/Notivue/utils'
import { useStore } from '@/core/useStore'

export function useMouseEvents() {
Expand Down
2 changes: 1 addition & 1 deletion packages/notivue/Notivue/composables/useTouchEvents.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { computed, onBeforeUnmount } from 'vue'

import { useStore } from '@/core/useStore'
import { isMouse } from '@/core/utils'
import { isMouse } from '@/Notivue/utils'

/**
* The logic follows this pattern:
Expand Down
2 changes: 2 additions & 0 deletions packages/notivue/Notivue/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { NotivueItem } from 'notivue'

export const isMouse = (e: PointerEvent) => e.pointerType === 'mouse'

export function getAriaLabel(item: NotivueItem) {
return `${item.title ? `${item.title}: ` : ''}${item.message}`
}
2 changes: 1 addition & 1 deletion packages/notivue/NotivueSwipe/NotivueSwipe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from 'vue'
import { useStore } from '@/core/useStore'
import { isMouse } from '@/core/utils'
import { isMouse } from '@/Notivue/utils'
import { NotificationTypeKeys as NType } from '@/core/constants'
import { DEFAULT_PROPS, DEBOUNCE, RETURN_DUR } from './constants'
Expand Down
2 changes: 0 additions & 2 deletions packages/notivue/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import type {

export const isSSR = typeof window === 'undefined'

export const isMouse = (e: PointerEvent) => e.pointerType === 'mouse'

export function mergeDeep<T extends Obj>(target: T, source: Record<string, any>): T {
const merged: T = { ...target }

Expand Down

0 comments on commit 49f57a1

Please sign in to comment.