feat: initial commit - Phase 1 & 2 core features

This commit is contained in:
hiderfong
2026-04-22 17:07:33 +08:00
commit 1773bda06b
25005 changed files with 6252106 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019-PRESENT Anthony Fu<https://github.com/antfu>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+119
View File
@@ -0,0 +1,119 @@
<p align="center">
<a href="https://github.com/vueuse/vueuse#gh-light-mode-only">
<img src="https://raw.githubusercontent.com/vueuse/vueuse/main/packages/public/logo-vertical.png#gh-light-mode-only" alt="VueUse - Collection of essential Vue Composition Utilities" width="300">
</a>
<a href="https://github.com/vueuse/vueuse#gh-dark-mode-only">
<img src="https://raw.githubusercontent.com/vueuse/vueuse/main/packages/public/logo-vertical-dark.png#gh-dark-mode-only" alt="VueUse - Collection of essential Vue Composition Utilities" width="300">
</a>
<br>
Collection of essential Vue Composition Utilities
</p>
<p align="center">
<a href="https://www.npmjs.com/package/@vueuse/core" target="__blank"><img src="https://img.shields.io/npm/v/@vueuse/core?color=a1b858&label=" alt="NPM version"></a>
<a href="https://www.npmjs.com/package/@vueuse/core" target="__blank"><img alt="NPM Downloads" src="https://img.shields.io/npm/dm/@vueuse/core?color=50a36f&label="></a>
<a href="https://vueuse.org" target="__blank"><img src="https://img.shields.io/static/v1?label=&message=docs%20%26%20demos&color=1e8a7a" alt="Docs & Demos"></a>
<img alt="Function Count" src="https://vueuse.org/badge-function-count.svg">
<br>
<a href="https://github.com/vueuse/vueuse" target="__blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/vueuse/vueuse?style=social"></a>
</p>
<p align="center">
<a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'>
</a>
</p>
## 🚀 Features
- 🎪 [**Interactive docs & demos**](https://vueuse.org)
-**Fully tree shakeable**: Only take what you want, [bundle size](https://vueuse.org/export-size)
- 🦾 **Type Strong**: Written in [TypeScript](https://www.typescriptlang.org/), with [TS Docs](https://github.com/microsoft/tsdoc)
- 🔋 **SSR Friendly**
- 🌎 **No bundler required**: Usable via CDN
- 🔩 **Flexible**: Configurable event filters and targets
- 🔌 **Optional [Add-ons](https://vueuse.org/add-ons)**: Router, Firebase, RxJS, etc.
## 🦄 Usage
```ts
import { useLocalStorage, useMouse, usePreferredDark } from '@vueuse/core'
export default {
setup() {
// tracks mouse position
const { x, y } = useMouse()
// if user prefers dark theme
const isDark = usePreferredDark()
// persist state in localStorage
const store = useLocalStorage(
'my-storage',
{
name: 'Apple',
color: 'red',
},
)
return { x, y, isDark, store }
},
}
```
Refer to [functions list](https://vueuse.org/functions) or [documentations](https://vueuse.org/) for more details.
## 📦 Install
> From v12.0, VueUse no longer supports Vue 2. Please use v11.x for Vue 2 support.
```bash
npm i @vueuse/core
```
[Add ons](https://vueuse.org/add-ons.html) | [Nuxt Module](https://vueuse.org/guide/index.html#nuxt)
###### Demos
- [Vite + Vue 3](https://github.com/vueuse/vueuse-vite-starter)
- [Nuxt 3 + Vue 3](https://github.com/antfu/vitesse-nuxt3)
- [Webpack + Vue 3](https://github.com/vueuse/vueuse-vue3-example)
### CDN
```vue
<script src="https://unpkg.com/@vueuse/shared"></script>
<script src="https://unpkg.com/@vueuse/core"></script>
```
It will be exposed to global as `window.VueUse`
## 🪴 Project Activity
![Alt](https://repobeats.axiom.co/api/embed/a406ba7461a6a087dbdb14d4395046c948d44c51.svg 'Repobeats analytics image')
## 🧱 Contribute
See the [**Contributing Guide**](https://vueuse.org/contributing)
## 🌸 Thanks
This project is heavily inspired by the following awesome projects.
- [streamich/react-use](https://github.com/streamich/react-use)
- [u3u/vue-hooks](https://github.com/u3u/vue-hooks)
- [logaretm/vue-use-web](https://github.com/logaretm/vue-use-web)
- [kripod/react-hooks](https://github.com/kripod/react-hooks)
And thanks to [all the contributors on GitHub](https://github.com/vueuse/vueuse/graphs/contributors)!
## 👨‍🚀 Contributors
### Financial Contributors on Open Collective
<a href="https://opencollective.com/vueuse"><img src="https://opencollective.com/vueuse/individuals.svg?width=890"></a>
## 📄 License
[MIT License](https://github.com/vueuse/vueuse/blob/main/LICENSE) © 2019-PRESENT [Anthony Fu](https://github.com/antfu)
+7793
View File
File diff suppressed because it is too large Load Diff
+5943
View File
File diff suppressed because one or more lines are too long
+5943
View File
File diff suppressed because one or more lines are too long
+5943
View File
File diff suppressed because one or more lines are too long
+7793
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+7618
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
module.exports = require('@vueuse/metadata')
+1
View File
@@ -0,0 +1 @@
export * from '@vueuse/metadata'
+1
View File
@@ -0,0 +1 @@
export * from '@vueuse/metadata'
+1
View File
@@ -0,0 +1 @@
export * from '@vueuse/metadata'
+1
View File
@@ -0,0 +1 @@
export * from '@vueuse/metadata'
+45
View File
@@ -0,0 +1,45 @@
{
"name": "@vueuse/core",
"version": "12.0.0",
"description": "Collection of essential Vue Composition Utilities",
"author": "Anthony Fu <https://github.com/antfu>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/vueuse/vueuse#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/vueuse/vueuse.git",
"directory": "packages/core"
},
"bugs": {
"url": "https://github.com/vueuse/vueuse/issues"
},
"keywords": [
"vue",
"vue-use",
"utils"
],
"sideEffects": false,
"exports": {
".": {
"import": "./index.mjs",
"require": "./index.cjs"
},
"./*": "./*",
"./metadata": {
"import": "./metadata.mjs",
"require": "./metadata.cjs"
}
},
"main": "./index.cjs",
"module": "./index.mjs",
"unpkg": "./index.iife.min.js",
"jsdelivr": "./index.iife.min.js",
"types": "./index.d.cts",
"dependencies": {
"@types/web-bluetooth": "^0.0.20",
"@vueuse/metadata": "12.0.0",
"@vueuse/shared": "12.0.0",
"vue": "^3.5.13"
}
}
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019-PRESENT Anthony Fu<https://github.com/antfu>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+2639
View File
File diff suppressed because it is too large Load Diff
+78
View File
@@ -0,0 +1,78 @@
import * as _vueuse_core_metadata_cjs from '@vueuse/core/metadata.cjs';
interface PackageManifest {
name: string;
display: string;
addon?: boolean;
author?: string;
description?: string;
external?: string[];
globals?: Record<string, string>;
manualImport?: boolean;
deprecated?: boolean;
submodules?: boolean;
build?: boolean;
iife?: boolean;
cjs?: boolean;
mjs?: boolean;
dts?: boolean;
target?: string;
utils?: boolean;
copy?: string[];
}
interface VueUseFunction {
name: string;
package: string;
importPath?: string;
lastUpdated?: number;
category?: string;
description?: string;
docs?: string;
deprecated?: boolean;
internal?: boolean;
component?: boolean;
directive?: boolean;
external?: string;
alias?: string[];
related?: string[];
}
interface VueUsePackage extends PackageManifest {
dir: string;
docs?: string;
}
interface PackageIndexes {
packages: Record<string, VueUsePackage>;
categories: string[];
functions: VueUseFunction[];
}
interface CommitInfo {
functions: string[];
version?: string;
hash: string;
date: string;
message: string;
refs?: string;
body?: string;
author_name: string;
author_email: string;
}
interface ContributorInfo {
name: string;
count: number;
hash: string;
}
declare const metadata: PackageIndexes;
declare const functions: PackageIndexes["functions"];
declare const packages: PackageIndexes["packages"];
declare const categories: PackageIndexes["categories"];
declare const functionNames: string[];
declare const categoryNames: string[];
declare const coreCategoryNames: string[];
declare const addonCategoryNames: string[];
declare function getFunction(name: string): _vueuse_core_metadata_cjs.VueUseFunction | undefined;
declare function getCategories(functions: VueUseFunction[]): string[];
declare function uniq<T extends any[]>(a: T): any[];
export { type CommitInfo, type ContributorInfo, type PackageIndexes, type PackageManifest, type VueUseFunction, type VueUsePackage, addonCategoryNames, categories, categoryNames, coreCategoryNames, functionNames, functions, getCategories, getFunction, metadata, packages, uniq };
+78
View File
@@ -0,0 +1,78 @@
import * as _vueuse_core_metadata_cjs from '@vueuse/core/metadata.cjs';
interface PackageManifest {
name: string;
display: string;
addon?: boolean;
author?: string;
description?: string;
external?: string[];
globals?: Record<string, string>;
manualImport?: boolean;
deprecated?: boolean;
submodules?: boolean;
build?: boolean;
iife?: boolean;
cjs?: boolean;
mjs?: boolean;
dts?: boolean;
target?: string;
utils?: boolean;
copy?: string[];
}
interface VueUseFunction {
name: string;
package: string;
importPath?: string;
lastUpdated?: number;
category?: string;
description?: string;
docs?: string;
deprecated?: boolean;
internal?: boolean;
component?: boolean;
directive?: boolean;
external?: string;
alias?: string[];
related?: string[];
}
interface VueUsePackage extends PackageManifest {
dir: string;
docs?: string;
}
interface PackageIndexes {
packages: Record<string, VueUsePackage>;
categories: string[];
functions: VueUseFunction[];
}
interface CommitInfo {
functions: string[];
version?: string;
hash: string;
date: string;
message: string;
refs?: string;
body?: string;
author_name: string;
author_email: string;
}
interface ContributorInfo {
name: string;
count: number;
hash: string;
}
declare const metadata: PackageIndexes;
declare const functions: PackageIndexes["functions"];
declare const packages: PackageIndexes["packages"];
declare const categories: PackageIndexes["categories"];
declare const functionNames: string[];
declare const categoryNames: string[];
declare const coreCategoryNames: string[];
declare const addonCategoryNames: string[];
declare function getFunction(name: string): _vueuse_core_metadata_cjs.VueUseFunction | undefined;
declare function getCategories(functions: VueUseFunction[]): string[];
declare function uniq<T extends any[]>(a: T): any[];
export { type CommitInfo, type ContributorInfo, type PackageIndexes, type PackageManifest, type VueUseFunction, type VueUsePackage, addonCategoryNames, categories, categoryNames, coreCategoryNames, functionNames, functions, getCategories, getFunction, metadata, packages, uniq };
+78
View File
@@ -0,0 +1,78 @@
import * as _vueuse_core_metadata_cjs from '@vueuse/core/metadata.cjs';
interface PackageManifest {
name: string;
display: string;
addon?: boolean;
author?: string;
description?: string;
external?: string[];
globals?: Record<string, string>;
manualImport?: boolean;
deprecated?: boolean;
submodules?: boolean;
build?: boolean;
iife?: boolean;
cjs?: boolean;
mjs?: boolean;
dts?: boolean;
target?: string;
utils?: boolean;
copy?: string[];
}
interface VueUseFunction {
name: string;
package: string;
importPath?: string;
lastUpdated?: number;
category?: string;
description?: string;
docs?: string;
deprecated?: boolean;
internal?: boolean;
component?: boolean;
directive?: boolean;
external?: string;
alias?: string[];
related?: string[];
}
interface VueUsePackage extends PackageManifest {
dir: string;
docs?: string;
}
interface PackageIndexes {
packages: Record<string, VueUsePackage>;
categories: string[];
functions: VueUseFunction[];
}
interface CommitInfo {
functions: string[];
version?: string;
hash: string;
date: string;
message: string;
refs?: string;
body?: string;
author_name: string;
author_email: string;
}
interface ContributorInfo {
name: string;
count: number;
hash: string;
}
declare const metadata: PackageIndexes;
declare const functions: PackageIndexes["functions"];
declare const packages: PackageIndexes["packages"];
declare const categories: PackageIndexes["categories"];
declare const functionNames: string[];
declare const categoryNames: string[];
declare const coreCategoryNames: string[];
declare const addonCategoryNames: string[];
declare function getFunction(name: string): _vueuse_core_metadata_cjs.VueUseFunction | undefined;
declare function getCategories(functions: VueUseFunction[]): string[];
declare function uniq<T extends any[]>(a: T): any[];
export { type CommitInfo, type ContributorInfo, type PackageIndexes, type PackageManifest, type VueUseFunction, type VueUsePackage, addonCategoryNames, categories, categoryNames, coreCategoryNames, functionNames, functions, getCategories, getFunction, metadata, packages, uniq };
+2585
View File
File diff suppressed because it is too large Load Diff
+2627
View File
File diff suppressed because it is too large Load Diff
+39
View File
@@ -0,0 +1,39 @@
{
"name": "@vueuse/metadata",
"type": "module",
"version": "12.0.0",
"description": "Metadata for VueUse functions",
"author": "Anthony Fu <https://github.com/antfu>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/vueuse/vueuse/tree/main/packages/metadata#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/vueuse/vueuse.git",
"directory": "packages/metadata"
},
"bugs": {
"url": "https://github.com/vueuse/vueuse/issues"
},
"keywords": [
"vue",
"vue-use"
],
"sideEffects": false,
"exports": {
".": {
"import": "./index.mjs",
"require": "./index.cjs"
},
"./*": "./*"
},
"main": "./index.cjs",
"module": "./index.mjs",
"types": "./index.d.ts",
"files": [
"index.*"
],
"scripts": {
"update": "esno scripts/update.ts"
}
}
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019-PRESENT Anthony Fu<https://github.com/antfu>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+1686
View File
File diff suppressed because it is too large Load Diff
+1209
View File
File diff suppressed because it is too large Load Diff
+1209
View File
File diff suppressed because it is too large Load Diff
+1209
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+1567
View File
File diff suppressed because it is too large Load Diff
+37
View File
@@ -0,0 +1,37 @@
{
"name": "@vueuse/shared",
"version": "12.0.0",
"author": "Anthony Fu <https://github.com/antfu>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/vueuse/vueuse/tree/main/packages/shared#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/vueuse/vueuse.git",
"directory": "packages/shared"
},
"bugs": {
"url": "https://github.com/vueuse/vueuse/issues"
},
"keywords": [
"vue",
"vue-use",
"utils"
],
"sideEffects": false,
"exports": {
".": {
"import": "./index.mjs",
"require": "./index.cjs"
},
"./*": "./*"
},
"main": "./index.cjs",
"module": "./index.mjs",
"unpkg": "./index.iife.min.js",
"jsdelivr": "./index.iife.min.js",
"types": "./index.d.cts",
"dependencies": {
"vue": "^3.5.13"
}
}