Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(useMouse): updated scroll value #4191

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0966297
fix(useMouse): updated scroll value
pkc918 Sep 2, 2024
8efaa2d
chore: rename `pre` to `rev`
pkc918 Sep 2, 2024
187ff69
fix(useMouse): record the value of the previous scroll
pkc918 Sep 22, 2024
af30e67
fix(computedAsync): type signature (#4207)
ferferga Sep 12, 2024
1c6e860
fix(useIntersectionObserver): add `Document` type for root (#4210)
phk422 Sep 12, 2024
9b6b463
feat(useCurrentElement): try to infer type from `$el` (#4202)
KazariEX Sep 12, 2024
11fc816
docs(onKeyStroke): fix arrow down & up cause scroll event (#4199)
ArthurDarkstone Sep 12, 2024
af5b54d
fix(useMouseInElement): allow `el` to be instanceof Element (#4189)
FRSgit Sep 12, 2024
dd98b36
fix(onClickOutside): make `ignore` accept reactive values (#4211)
cernymatej Sep 12, 2024
81d59a4
fix(useDraggable): draggable component not work with container (#4192)
huiliangShen Sep 12, 2024
bed0a18
fix(useFocusWithin): make useFocusWhithin match the behavior of the :…
ben-lau Sep 12, 2024
02e0607
feat(useFileDialog): return `onCancel` handler (#4184)
AndreyYolkin Sep 12, 2024
528fed9
fix(onClickOutside): improve cross-browser compatibility (#4185)
Onion-L Sep 12, 2024
c8b7852
docs: typo in `useShare` docs (#4228)
AkaraChen Sep 16, 2024
383863c
fix(useResizeObserver): update type (#4218)
phk422 Sep 16, 2024
b82041b
fix(useNetwork): return immutable values (#4187)
rudnovd Sep 16, 2024
0c543ce
feat(useDropZone): add multiple prop to control multi-file drop (#4227)
danngossinga Sep 16, 2024
85db06f
fix(useInfiniteScroll): stop watch when unmounted (#4110)
zyyv Sep 16, 2024
6b2e810
fix(useArrayFilter): match type to Array.prototype.filter (#4175)
Jesse205 Sep 16, 2024
67647e8
chore: update deps, lint
antfu Sep 16, 2024
5be352b
chore: release v11.1.0
antfu Sep 16, 2024
5a65a1f
chore: update deps
antfu Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
chore: update deps, lint
  • Loading branch information
antfu authored and pkc918 committed Sep 22, 2024
commit 67647e8133a4f2f6a35f15fd85519a2aa2cd97e8
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import antfu from '@antfu/eslint-config'

const dir = fileURLToPath(new URL('.', import.meta.url))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"version": "11.0.3",
"private": true,
"packageManager": "pnpm@9.8.0",
"packageManager": "pnpm@9.10.0",
"description": "Collection of essential Vue Composition Utilities",
"author": "Anthony Fu<https://github.com/antfu>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/.test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import './polyfillFetch'
export const isBelowNode18 = Number(process.version.slice(1).split('.')[0]) < 18

export * from './mount'
export * from './retry'
export * from './nextTick'
export * from './retry'
2 changes: 1 addition & 1 deletion packages/.test/mockServer.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { delay, http, HttpResponse } from 'msw'
/**
* Network mocking with MSW.
* Import this helper into the specific tests that need to make network requests.
*/
import { setupServer } from 'msw/node'
import { HttpResponse, delay, http } from 'msw'
import { afterAll, afterEach, beforeAll } from 'vitest'

const defaultJsonMessage = { hello: 'world' }
Expand Down
2 changes: 1 addition & 1 deletion packages/.test/setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Vue2, install, isVue2 } from 'vue-demi'
import { beforeAll, beforeEach } from 'vitest'
import { install, isVue2, Vue2 } from 'vue-demi'
import './polyfillFetch'
import './polyfillPointerEvents'
import './polyfillIndexedDb'
Expand Down
6 changes: 3 additions & 3 deletions packages/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { resolve } from 'node:path'
import { defineConfig } from 'vitepress'
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
import { withPwa } from '@vite-pwa/vitepress'
import { addonCategoryNames, categoryNames, coreCategoryNames, metadata } from '../metadata/metadata'
import { defineConfig } from 'vitepress'
import { currentVersion, versions } from '../../meta/versions'
import viteConfig from './vite.config'
import { addonCategoryNames, categoryNames, coreCategoryNames, metadata } from '../metadata/metadata'
import { transformHead } from './transformHead'
import viteConfig from './vite.config'

const Guide = [
{ text: 'Get Started', link: '/guide/' },
Expand Down
2 changes: 1 addition & 1 deletion packages/.vitepress/plugins/changelog.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Plugin } from 'vite'
import type { CommitInfo } from '@vueuse/metadata'
import type { Plugin } from 'vite'

const ID = '/virtual-changelog'

Expand Down
2 changes: 1 addition & 1 deletion packages/.vitepress/plugins/contributors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Plugin } from 'vite'
import type { ContributorInfo } from '@vueuse/metadata'
import type { Plugin } from 'vite'

const ID = '/virtual-contributors'

Expand Down
7 changes: 4 additions & 3 deletions packages/.vitepress/plugins/markdownTransform.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { join, resolve } from 'node:path'
import type { Plugin } from 'vite'
import { join, resolve } from 'node:path'
import fs from 'fs-extra'
import ts from 'typescript'
import { format } from 'prettier'
import ts from 'typescript'
import { packages } from '../../../meta/packages'
import { functionNames, getFunction } from '../../../packages/metadata/metadata'
import { getTypeDefinition, replacer } from '../../../scripts/utils'
Expand Down Expand Up @@ -127,7 +127,8 @@ ${code}
['Docs', `${URL}/index.md`],
])
.filter(i => i)
.map(i => `[${i![0]}](${i![1]})`).join(' • ')
.map(i => `[${i![0]}](${i![1]})`)
.join(' • ')

const sourceSection = `## Source\n\n${links}\n`
const ContributorsSection = `
Expand Down
4 changes: 2 additions & 2 deletions packages/.vitepress/sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// eslint-disable-next-line spaced-comment
/// <reference lib="webworker" />

import { CacheableResponsePlugin } from 'workbox-cacheable-response'
import { ExpirationPlugin } from 'workbox-expiration'
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
import { NavigationRoute, registerRoute } from 'workbox-routing'
import { NetworkFirst, NetworkOnly, StaleWhileRevalidate } from 'workbox-strategies'
import { CacheableResponsePlugin } from 'workbox-cacheable-response'
import { ExpirationPlugin } from 'workbox-expiration'

declare let self: ServiceWorkerGlobalScope

Expand Down
8 changes: 4 additions & 4 deletions packages/.vitepress/theme/components/Changelog.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
// @ts-expect-error virtual
import changelog from '/virtual-changelog'
import { computed } from 'vue'
import type { CommitInfo } from '@vueuse/metadata'
import { renderCommitMessage } from '../utils'
import { functions } from '@vueuse/metadata'
import { computed } from 'vue'
import { renderCommitMessage } from '../utils'
// @ts-expect-error virtual
import changelog from '/virtual-changelog'

const props = defineProps<{ fn: string }>()
const info = computed(() => functions.find(i => i.name === props.fn))
Expand Down
4 changes: 2 additions & 2 deletions packages/.vitepress/theme/components/Contributors.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import type { ContributorInfo } from '@vueuse/metadata'
import { computed } from 'vue'
// @ts-expect-error missing types
import _contributors from '/virtual-contributors'
import { computed } from 'vue'
import type { ContributorInfo } from '@vueuse/metadata'

const props = defineProps<{ fn: string }>()

Expand Down
2 changes: 1 addition & 1 deletion packages/.vitepress/theme/components/FunctionBadge.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { computed } from 'vue'
import type { VueUseFunction } from '@vueuse/metadata'
import { computed } from 'vue'
import { renderMarkdown } from '../utils'

const props = defineProps<{ fn: VueUseFunction }>()
Expand Down
2 changes: 1 addition & 1 deletion packages/.vitepress/theme/components/FunctionInfo.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { useTimeAgo } from '@vueuse/core'
import { computed } from 'vue'
import { functions } from '@vueuse/metadata'
import { computed } from 'vue'
import exportSizes from '../../../export-size.json'

const props = defineProps<{ fn: string }>()
Expand Down
4 changes: 2 additions & 2 deletions packages/.vitepress/theme/components/FunctionsList.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import type { Ref } from 'vue'
import { computed, toRef } from 'vue'
import Fuse from 'fuse.js'
import { useEventListener, useUrlSearchParams } from '@vueuse/core'
import Fuse from 'fuse.js'
import { computed, toRef } from 'vue'
import { categoryNames, functions } from '../../../../packages/metadata/metadata'

const coreCategories = categoryNames.filter(i => !i.startsWith('@'))
Expand Down
2 changes: 1 addition & 1 deletion packages/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DefaultTheme from 'vitepress/theme'
import TwoSlashFloatingVue from '@shikijs/vitepress-twoslash/client'
import DefaultTheme from 'vitepress/theme'
import { handleRedirects } from './redirects'
import '@shikijs/vitepress-twoslash/style.css'

Expand Down
8 changes: 4 additions & 4 deletions packages/.vitepress/transformHead.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { basename, dirname } from 'node:path'
import fs from 'node:fs/promises'
import sharp from 'sharp'
import removeMD from 'remove-markdown'
import type { HeadConfig, TransformContext } from 'vitepress'
import type { VueUseFunction } from '../metadata/types'
import fs from 'node:fs/promises'
import { basename, dirname } from 'node:path'
import removeMD from 'remove-markdown'
import sharp from 'sharp'
import { functions } from '../metadata/metadata'

const ogSVGPromise = fs.readFile('./scripts/og-template.svg', 'utf-8')
Expand Down
10 changes: 5 additions & 5 deletions packages/.vitepress/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { createRequire } from 'node:module'
import { resolve } from 'node:path'
import process from 'node:process'
import { createRequire } from 'node:module'
import { defineConfig } from 'vite'
import Icons from 'unplugin-icons/vite'
import UnoCSS from 'unocss/vite'
import IconsResolver from 'unplugin-icons/resolver'
import Icons from 'unplugin-icons/vite'
import Components from 'unplugin-vue-components/vite'
import UnoCSS from 'unocss/vite'
import { defineConfig } from 'vite'
import Inspect from 'vite-plugin-inspect'
import { getChangeLog, getFunctionContributors } from '../../scripts/changelog'
import { MarkdownTransform } from './plugins/markdownTransform'
import { ChangeLog } from './plugins/changelog'
import { Contributors } from './plugins/contributors'
import { MarkdownTransform } from './plugins/markdownTransform'

const require = createRequire(import.meta.url)
const [changeLog, contributions] = await Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion packages/contributors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@ const coreTeamMembers: CoreTeam[] = [
]
.sort((pre, cur) => contributors.findIndex(name => name === pre.github) - contributors.findIndex(name => name === cur.github))

export { coreTeamMembers, contributorList as contributors }
export { contributorList as contributors, coreTeamMembers }
6 changes: 3 additions & 3 deletions packages/core/computedAsync/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Computed for async functions
## Usage

```js
import { ref } from 'vue'
import { computedAsync } from '@vueuse/core'
import { ref } from 'vue'

const name = ref('jack')

Expand All @@ -28,8 +28,8 @@ const userInfo = computedAsync(
You will need to pass a ref to track if the async function is evaluating.

```js
import { ref } from 'vue'
import { computedAsync } from '@vueuse/core'
import { ref } from 'vue'

const evaluating = ref(false)

Expand Down Expand Up @@ -66,8 +66,8 @@ const downloads = computedAsync(async (onCancel) => {
By default, `computedAsync` will start resolving immediately on creation, specify `lazy: true` to make it start resolving on the first accessing.

```js
import { ref } from 'vue'
import { computedAsync } from '@vueuse/core'
import { ref } from 'vue'

const evaluating = ref(false)

Expand Down
2 changes: 1 addition & 1 deletion packages/core/computedAsync/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Ref } from 'vue-demi'
import { computed, nextTick, ref } from 'vue-demi'
import { promiseTimeout } from '@vueuse/shared'
import { describe, expect, expectTypeOf, it, vi } from 'vitest'
import { computed, nextTick, ref } from 'vue-demi'
import { asyncComputed, computedAsync } from '.'

describe('computed', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/computedAsync/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Fn } from '@vueuse/shared'
import { noop } from '@vueuse/shared'
import type { Ref } from 'vue-demi'
import { noop } from '@vueuse/shared'
import { computed, isRef, ref, shallowRef, watchEffect } from 'vue-demi'

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/core/computedInject/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ref } from 'vue-demi'
import { describe, expect, it } from 'vitest'
import { Key, useInjectedSetup } from '../../.test'
import { ref } from 'vue-demi'
import { computedInject } from '.'
import { Key, useInjectedSetup } from '../../.test'

describe('computedInject', () => {
it('should be defined', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/createReusableTemplate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ When using with [Options API](https://vuejs.org/guide/introduction.html#api-styl

```vue
<script>
import { defineComponent } from 'vue'
import { createReusableTemplate } from '@vueuse/core'
import { defineComponent } from 'vue'

const [DefineTemplate, ReuseTemplate] = createReusableTemplate()

Expand Down
6 changes: 3 additions & 3 deletions packages/core/createReusableTemplate/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest'
import { mount } from '@vue/test-utils'
import type { Slot } from 'vue-demi'
import { Fragment, defineComponent, h, isVue2, renderSlot } from 'vue-demi'
import { mount } from '@vue/test-utils'
import { describe, expect, it } from 'vitest'
import { defineComponent, Fragment, h, isVue2, renderSlot } from 'vue-demi'
import { createReusableTemplate } from '.'

describe.skipIf(isVue2)('createReusableTemplate', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/createReusableTemplate/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DefineComponent, Slot } from 'vue-demi'
import { defineComponent, isVue3, shallowRef, version } from 'vue-demi'
import { camelize, makeDestructurable } from '@vueuse/shared'
import { defineComponent, isVue3, shallowRef, version } from 'vue-demi'

type ObjectLiteralWithPotentialObjectLiterals = Record<string, Record<string, any> | undefined>

Expand Down
2 changes: 1 addition & 1 deletion packages/core/createTemplatePromise/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DefineComponent, Ref, TransitionGroupProps } from 'vue-demi'
import { Fragment, TransitionGroup, defineComponent, h, isVue3, ref, shallowReactive } from 'vue-demi'
import { defineComponent, Fragment, h, isVue3, ref, shallowReactive, TransitionGroup } from 'vue-demi'

export interface TemplatePromiseProps<Return, Args extends any[] = []> {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/createUnrefFn/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ might be more pertinent in some cases where you want to evaluate the function on
## Usage

```ts
import { ref } from 'vue'
import { createUnrefFn } from '@vueuse/core'
import { ref } from 'vue'

const url = ref('https://httpbin.org/post')
const data = ref({ foo: 'bar' })
Expand Down
10 changes: 5 additions & 5 deletions packages/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export * from './onClickOutside'
export * from './onKeyStroke'
export * from './onLongPress'
export * from './onStartTyping'
export * from './ssr-handlers'
export * from './templateRef'
export * from './types'
export * from './unrefElement'
export * from './useActiveElement'
export * from './useAnimate'
Expand Down Expand Up @@ -114,9 +116,9 @@ export * from './useStyleTag'
export * from './useSupported'
export * from './useSwipe'
export * from './useTemplateRefsList'
export * from './useTextareaAutosize'
export * from './useTextDirection'
export * from './useTextSelection'
export * from './useTextareaAutosize'
export * from './useThrottledRefHistory'
export * from './useTimeAgo'
export * from './useTimeoutPoll'
Expand All @@ -125,10 +127,10 @@ export * from './useTitle'
export * from './useTransition'
export * from './useUrlSearchParams'
export * from './useUserMedia'
export * from './useVModel'
export * from './useVModels'
export * from './useVibrate'
export * from './useVirtualList'
export * from './useVModel'
export * from './useVModels'
export * from './useWakeLock'
export * from './useWebNotification'
export * from './useWebSocket'
Expand All @@ -137,6 +139,4 @@ export * from './useWebWorkerFn'
export * from './useWindowFocus'
export * from './useWindowScroll'
export * from './useWindowSize'
export * from './types'
export * from '@vueuse/shared'
export * from './ssr-handlers'
6 changes: 3 additions & 3 deletions packages/core/onClickOutside/component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineComponent, h, ref } from 'vue-demi'
import { onClickOutside } from '@vueuse/core'
import type { RenderableComponent } from '../types'
import type { OnClickOutsideOptions } from '.'
import type { RenderableComponent } from '../types'
import { onClickOutside } from '@vueuse/core'
import { defineComponent, h, ref } from 'vue-demi'

export interface OnClickOutsideProps extends RenderableComponent {
options?: OnClickOutsideOptions
Expand Down
2 changes: 1 addition & 1 deletion packages/core/onClickOutside/demo.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
import type { OnClickOutsideHandler } from '@vueuse/core'
import { onClickOutside } from '@vueuse/core'
import { ref } from 'vue'
import { vOnClickOutside } from './directive'

const modal = ref(false)
Expand Down
4 changes: 2 additions & 2 deletions packages/core/onClickOutside/directive.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineComponent } from 'vue-demi'
import { beforeEach, describe, expect, it } from 'vitest'
import type { VueWrapper } from '@vue/test-utils'
import { mount } from '@vue/test-utils'
import { beforeEach, describe, expect, it } from 'vitest'
import { defineComponent } from 'vue-demi'

import { vOnClickOutside } from './directive'

Expand Down
4 changes: 2 additions & 2 deletions packages/core/onClickOutside/directive.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { directiveHooks } from '@vueuse/shared'
import type { ObjectDirective } from 'vue-demi'
import { onClickOutside } from '.'
import type { OnClickOutsideHandler, OnClickOutsideOptions } from '.'
import { directiveHooks } from '@vueuse/shared'
import { onClickOutside } from '.'

export const vOnClickOutside: ObjectDirective<
HTMLElement,
Expand Down
Loading