first commit

This commit is contained in:
dadmin committed 2026-01-09 23:05:52 -05:00
commit dec0c8e4e4
4203 files changed
+824454

No files matched your search

+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.
+1492
View File
File diff suppressed because it is too large. Load diff
+2209
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
(function(e,t){var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e};t=((e,t,i)=>(i=e==null?{}:n(o(e)),c(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)))(t);function l(e,n){var r;let i=(0,t.shallowRef)();return(0,t.watchEffect)(()=>{i.value=e()},{...n,flush:(r=n==null?void 0:n.flush)==null?`sync`:r}),(0,t.readonly)(i)}let u=l;function d(e,n,r={}){let i,a,o,s=!0,c=()=>{s=!0,o()};(0,t.watch)(e,c,{flush:`sync`,...r});let l=typeof n==`function`?n:n.get,u=typeof n==`function`?void 0:n.set,d=(0,t.customRef)((e,t)=>(a=e,o=t,{get(){return s&&(i=l(i),s=!1),a(),i},set(e){u==null||u(e)}}));return d.trigger=c,d}let f=d;function p(e,n){return(0,t.getCurrentScope)()?((0,t.onScopeDispose)(e,n),!0):!1}function m(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return p(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}function h(e){let n=!1,r,i=(0,t.effectScope)(!0);return((...t)=>(n||(r=i.run(()=>e(...t)),n=!0),r))}let g=new WeakMap,_=(...e)=>{var n;let r=e[0],i=(n=(0,t.getCurrentInstance)())==null?void 0:n.proxy,a=i==null?(0,t.getCurrentScope)():i;if(a==null&&!(0,t.hasInjectionContext)())throw Error(`injectLocal must be called in setup`);return a&&g.has(a)&&r in g.get(a)?g.get(a)[r]:(0,t.inject)(...e)};function v(e,n){var r;let i=(r=(0,t.getCurrentInstance)())==null?void 0:r.proxy,a=i==null?(0,t.getCurrentScope)():i;if(a==null)throw Error(`provideLocal must be called in setup`);g.has(a)||g.set(a,Object.create(null));let o=g.get(a);return o[e]=n,(0,t.provide)(e,n)}function ee(e,t){let n=(t==null?void 0:t.injectionKey)||Symbol(e.name||`InjectionState`),r=t==null?void 0:t.defaultValue;return[(...t)=>{let r=e(...t);return v(n,r),r},()=>_(n,r)]}function te(e,n){return n===!0?(0,t.ref)(e):(0,t.shallowRef)(e)}let y=typeof window<`u`&&typeof document<`u`,ne=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope,re=e=>e!==void 0,ie=e=>e!=null,ae=(e,...t)=>{e||console.warn(...t)},oe=Object.prototype.toString,b=e=>oe.call(e)===`[object Object]`,se=()=>Date.now(),x=()=>+Date.now(),ce=(e,t,n)=>Math.min(n,Math.max(t,e)),S=()=>{},le=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),ue=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),de=fe();function fe(){var e,t,n;return y&&!!(!((e=window)==null||(e=e.navigator)==null)&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)==null||(t=t.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test((n=window)==null?void 0:n.navigator.userAgent))}function C(...e){if(e.length!==1)return(0,t.toRef)(...e);let n=e[0];return typeof n==`function`?(0,t.readonly)((0,t.customRef)(()=>({get:n,set:S}))):(0,t.ref)(n)}function w(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}let T=e=>e();function E(e,n={}){let r,i,a=S,o=e=>{clearTimeout(e),a(),a=S},s;return c=>{let l=(0,t.toValue)(e),u=(0,t.toValue)(n.maxWait);return r&&o(r),l<=0||u!==void 0&&u<=0?(i&&(o(i),i=void 0),Promise.resolve(c())):new Promise((e,t)=>{a=n.rejectOnCancel?t:e,s=c,u&&!i&&(i=setTimeout(()=>{r&&o(r),i=void 0,e(s())},u)),r=setTimeout(()=>{i&&o(i),i=void 0,e(c())},l)})}}function D(...e){let n=0,r,i=!0,a=S,o,s,c,l,u;!(0,t.isRef)(e[0])&&typeof e[0]==`object`?{delay:s,trailing:c=!0,leading:l=!0,rejectOnCancel:u=!1}=e[0]:[s,c=!0,l=!0,u=!1]=e;let d=()=>{r&&(clearTimeout(r),r=void 0,a(),a=S)};return e=>{let f=(0,t.toValue)(s),p=Date.now()-n,m=()=>o=e();return d(),f<=0?(n=Date.now(),m()):(p>f?(n=Date.now(),(l||!i)&&m()):c&&(o=new Promise((e,t)=>{a=u?t:e,r=setTimeout(()=>{n=Date.now(),i=!0,e(m()),d()},Math.max(0,f-p))})),!l&&!r&&(r=setTimeout(()=>i=!0,f)),i=!1,o)}}function O(e=T,n={}){let{initialState:r=`active`}=n,i=C(r===`active`);function a(){i.value=!1}function o(){i.value=!0}return{isActive:(0,t.readonly)(i),pause:a,resume:o,eventFilter:(...t)=>{i.value&&e(...t)}}}function k(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{t?setTimeout(()=>i(n),e):setTimeout(r,e)})}function pe(e){return e}function me(e){let t;function n(){return t||(t=e()),t}return n.reset=async()=>{let e=t;t=void 0,e&&await e},n}function he(e){return e()}function A(e,...t){return t.some(t=>t in e)}function ge(e,t){var n;if(typeof e==`number`)return e+t;let r=((n=e.match(/^-?\d+\.?\d*/))==null?void 0:n[0])||``,i=e.slice(r.length),a=Number.parseFloat(r)+t;return Number.isNaN(a)?e:a+i}function _e(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function ve(e,t,n=!1){return t.reduce((t,r)=>(r in e&&(!n||e[r]!==void 0)&&(t[r]=e[r]),t),{})}function ye(e,t,n=!1){return Object.fromEnLine truncated
+2065
View File
File diff suppressed because it is too large. Load diff
+42
View File
@@ -0,0 +1,42 @@
{
"name": "@vueuse/shared",
"type": "module",
"version": "14.1.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": {
".": "./dist/index.js",
"./*": "./dist/*"
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"unpkg": "./dist/index.iife.min.js",
"jsdelivr": "./dist/index.iife.min.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"peerDependencies": {
"vue": "^3.5.0"
},
"scripts": {
"build": "tsdown",
"test:attw": "attw --pack --config-path ../../.attw.json ."
}
}