@poveste/vendors 0.14.0 → 0.15.0
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.
- package/dist/client/b-floating-vue.js +1 -1
- package/dist/client/b-iconify.js +1429 -1416
- package/dist/client/b-pinia.js +1359 -1936
- package/dist/client/b-vue-router.js +787 -502
- package/dist/client/b-vue-use.js +497 -367
- package/dist/client/b-vue.js +1 -1
- package/dist/client/devtools-api.js +6568 -0
- package/dist/client/index.js +178 -162
- package/dist/client/node_modules/@iconify/vue/dist/iconify.d.ts +17 -72
- package/dist/client/node_modules/@iconify/vue/dist/offline.d.ts +7 -12
- package/dist/client/node_modules/@iconify/vue/offline/package.json +2 -2
- package/dist/client/node_modules/@iconify/vue/package.json +13 -16
- package/dist/client/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +88 -0
- package/dist/client/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts +32 -0
- package/dist/client/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +12 -0
- package/dist/client/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts +43 -0
- package/dist/client/node_modules/@jridgewell/gen-mapping/package.json +67 -0
- package/dist/client/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts +89 -0
- package/dist/client/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts +33 -0
- package/dist/client/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts +13 -0
- package/dist/client/node_modules/@jridgewell/gen-mapping/types/types.d.mts +44 -0
- package/dist/client/node_modules/@jridgewell/remapping/package.json +71 -0
- package/dist/client/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts +15 -0
- package/dist/client/node_modules/@jridgewell/remapping/types/remapping.d.mts +21 -0
- package/dist/client/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts +46 -0
- package/dist/client/node_modules/@jridgewell/remapping/types/source-map.d.mts +19 -0
- package/dist/client/node_modules/@jridgewell/remapping/types/types.d.mts +16 -0
- package/dist/client/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts +4 -0
- package/dist/client/node_modules/@jridgewell/resolve-uri/package.json +69 -0
- package/dist/client/node_modules/@jridgewell/trace-mapping/package.json +67 -0
- package/dist/client/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts +33 -0
- package/dist/client/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts +4 -0
- package/dist/client/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts +9 -0
- package/dist/client/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts +4 -0
- package/dist/client/node_modules/@jridgewell/trace-mapping/types/sort.d.mts +4 -0
- package/dist/client/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts +17 -0
- package/dist/client/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts +5 -0
- package/dist/client/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts +80 -0
- package/dist/client/node_modules/@jridgewell/trace-mapping/types/types.d.mts +107 -0
- package/dist/client/node_modules/@vue/devtools-api/dist/index-node.d.ts +11 -0
- package/dist/client/node_modules/@vue/devtools-api/dist/index.d.ts +2 -0
- package/dist/client/node_modules/@vue/devtools-api/package.json +25 -24
- package/dist/client/node_modules/@vue/devtools-kit/dist/index.d.ts +1170 -0
- package/dist/client/node_modules/@vue/devtools-kit/global.d.ts +20 -0
- package/dist/client/node_modules/@vue/devtools-kit/package.json +44 -0
- package/dist/client/node_modules/@vue/devtools-kit/types.d.ts +2 -0
- package/dist/client/node_modules/@vue/devtools-shared/dist/index.d.ts +40 -0
- package/dist/client/node_modules/@vue/devtools-shared/package.json +33 -0
- package/dist/client/node_modules/@vue-macros/common/dist/index.d.ts +124 -0
- package/dist/client/node_modules/@vue-macros/common/package.json +63 -0
- package/dist/client/node_modules/@vueuse/core/dist/index.d.ts +223 -111
- package/dist/client/node_modules/@vueuse/core/package.json +10 -3
- package/dist/client/node_modules/@vueuse/metadata/package.json +4 -1
- package/dist/client/node_modules/@vueuse/shared/dist/index.d.ts +2 -2
- package/dist/client/node_modules/@vueuse/shared/package.json +4 -1
- package/dist/client/node_modules/acorn/dist/acorn.d.mts +897 -0
- package/dist/client/node_modules/acorn/dist/acorn.d.ts +897 -0
- package/dist/client/node_modules/acorn/package.json +50 -0
- package/dist/client/node_modules/ast-kit/dist/index.d.ts +380 -0
- package/dist/client/node_modules/ast-kit/package.json +63 -0
- package/dist/client/node_modules/ast-walker-scope/dist/index.d.mts +51 -0
- package/dist/client/node_modules/ast-walker-scope/package.json +60 -0
- package/dist/client/node_modules/birpc/dist/index.d.mts +215 -0
- package/dist/client/node_modules/birpc/dist/index.d.ts +215 -0
- package/dist/client/node_modules/birpc/package.json +57 -0
- package/dist/client/node_modules/chokidar/handler.d.ts +90 -0
- package/dist/client/node_modules/chokidar/index.d.ts +217 -0
- package/dist/client/node_modules/chokidar/package.json +63 -0
- package/dist/client/node_modules/confbox/dist/_chunks/_format.d.mts +25 -0
- package/dist/client/node_modules/confbox/dist/index.d.mts +34 -0
- package/dist/client/node_modules/confbox/dist/ini.d.mts +62 -0
- package/dist/client/node_modules/confbox/dist/json5.d.mts +59 -0
- package/dist/client/node_modules/confbox/dist/jsonc.d.mts +41 -0
- package/dist/client/node_modules/confbox/dist/toml.d.mts +23 -0
- package/dist/client/node_modules/confbox/dist/yaml.d.mts +96 -0
- package/dist/client/node_modules/confbox/package.json +67 -0
- package/dist/client/node_modules/exsolve/dist/index.d.mts +66 -0
- package/dist/client/node_modules/exsolve/package.json +42 -0
- package/dist/client/node_modules/fdir/dist/index.d.mts +155 -0
- package/dist/client/node_modules/fdir/package.json +103 -0
- package/dist/client/node_modules/hookable/dist/index.d.ts +103 -0
- package/dist/client/node_modules/hookable/package.json +49 -0
- package/dist/client/node_modules/local-pkg/dist/index.d.mts +42 -0
- package/dist/client/node_modules/local-pkg/dist/index.d.ts +42 -0
- package/dist/client/node_modules/local-pkg/package.json +65 -0
- package/dist/client/node_modules/magic-string-ast/dist/index.d.ts +67 -0
- package/dist/client/node_modules/magic-string-ast/package.json +64 -0
- package/dist/client/node_modules/mlly/dist/index.d.mts +564 -0
- package/dist/client/node_modules/mlly/dist/index.d.ts +564 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/index.d.mts +32 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/index.d.ts +32 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/json5.d.mts +58 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/json5.d.ts +58 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/jsonc.d.mts +41 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/jsonc.d.ts +41 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9745c98f.d.mts +24 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9745c98f.d.ts +24 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/toml.d.mts +22 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/toml.d.ts +22 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/yaml.d.mts +95 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/dist/yaml.d.ts +95 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/json5.d.ts +2 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/jsonc.d.ts +2 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/package.json +86 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/toml.d.ts +2 -0
- package/dist/client/node_modules/mlly/node_modules/confbox/yaml.d.ts +2 -0
- package/dist/client/node_modules/mlly/node_modules/pkg-types/dist/index.d.mts +411 -0
- package/dist/client/node_modules/mlly/node_modules/pkg-types/dist/index.d.ts +411 -0
- package/dist/client/node_modules/mlly/node_modules/pkg-types/package.json +47 -0
- package/dist/client/node_modules/mlly/package.json +55 -0
- package/dist/client/node_modules/muggle-string/out/base.d.ts +6 -0
- package/dist/client/node_modules/muggle-string/out/basic.d.ts +6 -0
- package/dist/client/node_modules/muggle-string/out/binarySearch.d.ts +1 -0
- package/dist/client/node_modules/muggle-string/out/common.d.ts +9 -0
- package/dist/client/node_modules/muggle-string/out/getLength.d.ts +2 -0
- package/dist/client/node_modules/muggle-string/out/index.d.ts +10 -0
- package/dist/client/node_modules/muggle-string/out/map.d.ts +3 -0
- package/dist/client/node_modules/muggle-string/out/overwriteSource.d.ts +3 -0
- package/dist/client/node_modules/muggle-string/out/replace.d.ts +3 -0
- package/dist/client/node_modules/muggle-string/out/segment.d.ts +6 -0
- package/dist/client/node_modules/muggle-string/out/sourceBased.d.ts +3 -0
- package/dist/client/node_modules/muggle-string/out/toString.d.ts +2 -0
- package/dist/client/node_modules/muggle-string/out/track.d.ts +6 -0
- package/dist/client/node_modules/muggle-string/out/types.d.ts +16 -0
- package/dist/client/node_modules/muggle-string/package.json +22 -0
- package/dist/client/node_modules/nostics/dist/diagnostic-wduO7saY.d.mts +295 -0
- package/dist/client/node_modules/nostics/dist/formatters/ansi.d.mts +15 -0
- package/dist/client/node_modules/nostics/dist/formatters/json.d.mts +7 -0
- package/dist/client/node_modules/nostics/dist/index.d.mts +51 -0
- package/dist/client/node_modules/nostics/dist/reporters/dev.d.mts +13 -0
- package/dist/client/node_modules/nostics/dist/reporters/fetch.d.mts +11 -0
- package/dist/client/node_modules/nostics/dist/reporters/node.d.mts +43 -0
- package/dist/client/node_modules/nostics/package.json +125 -0
- package/dist/client/node_modules/pathe/dist/index.d.mts +47 -0
- package/dist/client/node_modules/pathe/dist/index.d.ts +47 -0
- package/dist/client/node_modules/pathe/dist/utils.d.mts +32 -0
- package/dist/client/node_modules/pathe/dist/utils.d.ts +32 -0
- package/dist/client/node_modules/pathe/package.json +61 -0
- package/dist/client/node_modules/pathe/utils.d.ts +1 -0
- package/dist/client/node_modules/perfect-debounce/dist/index.d.mts +49 -0
- package/dist/client/node_modules/perfect-debounce/package.json +41 -0
- package/dist/client/node_modules/picomatch/package.json +83 -0
- package/dist/client/node_modules/pinia/dist/pinia.d.ts +937 -1056
- package/dist/client/node_modules/pinia/package.json +53 -67
- package/dist/client/node_modules/pkg-types/dist/index.d.mts +695 -0
- package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/_chunks/_format.d.mts +22 -0
- package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/_chunks/libs/js-yaml.d.mts +33 -0
- package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/index.d.mts +7 -0
- package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/ini.d.mts +59 -0
- package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/json.d.mts +25 -0
- package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/json5.d.mts +55 -0
- package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/jsonc.d.mts +29 -0
- package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/toml.d.mts +20 -0
- package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/yaml.d.mts +101 -0
- package/dist/client/node_modules/pkg-types/node_modules/confbox/package.json +68 -0
- package/dist/client/node_modules/pkg-types/package.json +47 -0
- package/dist/client/node_modules/quansync/dist/index.d.mts +22 -0
- package/dist/client/node_modules/quansync/dist/index.d.ts +22 -0
- package/dist/client/node_modules/quansync/dist/macro.d.mts +18 -0
- package/dist/client/node_modules/quansync/dist/macro.d.ts +18 -0
- package/dist/client/node_modules/quansync/dist/types.d.mts +27 -0
- package/dist/client/node_modules/quansync/dist/types.d.ts +27 -0
- package/dist/client/node_modules/quansync/package.json +95 -0
- package/dist/client/node_modules/readdirp/index.d.ts +117 -0
- package/dist/client/node_modules/readdirp/package.json +62 -0
- package/dist/client/node_modules/scule/dist/index.d.mts +57 -0
- package/dist/client/node_modules/scule/dist/index.d.ts +57 -0
- package/dist/client/node_modules/scule/package.json +43 -0
- package/dist/client/node_modules/tinyglobby/dist/index.d.mts +148 -0
- package/dist/client/node_modules/tinyglobby/package.json +70 -0
- package/dist/client/node_modules/ufo/dist/index.d.mts +714 -0
- package/dist/client/node_modules/ufo/dist/index.d.ts +714 -0
- package/dist/client/node_modules/ufo/package.json +48 -0
- package/dist/client/node_modules/unplugin/dist/index.d.mts +241 -0
- package/dist/client/node_modules/unplugin/dist/rspack/loaders/load.d.mts +4 -0
- package/dist/client/node_modules/unplugin/dist/rspack/loaders/transform.d.mts +4 -0
- package/dist/client/node_modules/unplugin/dist/webpack/loaders/load.d.mts +4 -0
- package/dist/client/node_modules/unplugin/dist/webpack/loaders/transform.d.mts +4 -0
- package/dist/client/node_modules/unplugin/package.json +146 -0
- package/dist/client/node_modules/unplugin-utils/dist/index.d.ts +31 -0
- package/dist/client/node_modules/unplugin-utils/package.json +61 -0
- package/dist/client/node_modules/vue-router/dist/experimental/index.d.ts +7 -0
- package/dist/client/node_modules/vue-router/dist/experimental/pinia-colada.d.ts +151 -0
- package/dist/client/node_modules/vue-router/dist/{router-CWoNjPRp.d.mts → index-D7ja2BKs.d.ts} +2480 -1160
- package/dist/client/node_modules/vue-router/dist/options-CwYZKRl4.d.mts +2923 -0
- package/dist/client/node_modules/vue-router/dist/unplugin/esbuild.d.mts +10 -0
- package/dist/client/node_modules/vue-router/dist/unplugin/index.d.mts +62 -0
- package/dist/client/node_modules/vue-router/dist/unplugin/options.d.mts +7 -0
- package/dist/client/node_modules/vue-router/dist/unplugin/rolldown.d.mts +10 -0
- package/dist/client/node_modules/vue-router/dist/unplugin/rollup.d.mts +10 -0
- package/dist/client/node_modules/vue-router/dist/unplugin/types.d.mts +7 -0
- package/dist/client/node_modules/vue-router/dist/unplugin/vite.d.mts +10 -0
- package/dist/client/node_modules/vue-router/dist/unplugin/webpack.d.mts +10 -0
- package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +7 -0
- package/dist/client/node_modules/vue-router/package.json +153 -95
- package/dist/client/node_modules/vue-router/vue-router-auto-resolver.d.mts +22 -17
- package/dist/client/node_modules/vue-router/vue-router-auto-routes.d.mts +53 -0
- package/dist/client/node_modules/vue-router/vue-router-auto.d.ts +2 -1
- package/dist/client/node_modules/webpack-virtual-modules/lib/index.d.ts +15 -0
- package/dist/client/node_modules/webpack-virtual-modules/lib/virtual-stats.d.ts +11 -0
- package/dist/client/node_modules/webpack-virtual-modules/package.json +82 -0
- package/dist/client/vue.runtime.esm-bundler.js +1 -176
- package/package.json +8 -7
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/api.d.ts +0 -108
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/app.d.ts +0 -1
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/component.d.ts +0 -78
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/context.d.ts +0 -5
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts +0 -180
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/index.d.ts +0 -6
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/util.d.ts +0 -4
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/const.d.ts +0 -2
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/env.d.ts +0 -15
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/index.d.ts +0 -18
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/plugin.d.ts +0 -47
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/proxy.d.ts +0 -20
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/time.d.ts +0 -2
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/index.d.ts +0 -22
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2/index.d.ts +0 -33
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2.7/index.d.ts +0 -38
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v3/index.d.ts +0 -22
- package/dist/client/node_modules/pinia/node_modules/vue-demi/package.json +0 -47
- package/dist/client/node_modules/vue-router/dist/experimental/index.d.mts +0 -38
- package/dist/client/node_modules/vue-router/dist/vue-router.d.mts +0 -361
- package/dist/client/node_modules/vue-router/vue-router-auto-routes.d.ts +0 -4
package/dist/client/b-vue-use.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shallowRef, watchEffect, readonly, watch, customRef, effectScope, getCurrentScope, onScopeDispose, getCurrentInstance, hasInjectionContext, inject, provide, ref, toRef as toRef$1, toValue, shallowReadonly, isRef, unref, computed, reactive, toRefs as toRefs$1, onBeforeMount, nextTick, onBeforeUnmount, onMounted, onUnmounted, isReactive, defineComponent, shallowReactive, h, Fragment, TransitionGroup, toRaw, onUpdated, markRaw, isReadonly, onBeforeUpdate } from './vue.runtime.esm-bundler.js';
|
|
2
2
|
|
|
3
3
|
//#region computedEager/index.ts
|
|
4
4
|
/**
|
|
@@ -193,9 +193,9 @@ const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
|
|
|
193
193
|
* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1
|
|
194
194
|
* ```
|
|
195
195
|
*
|
|
196
|
-
* @
|
|
196
|
+
* @NO_SIDE_EFFECTS
|
|
197
197
|
*/
|
|
198
|
-
const injectLocal = (...args) => {
|
|
198
|
+
const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {
|
|
199
199
|
var _getCurrentInstance;
|
|
200
200
|
const key = args[0];
|
|
201
201
|
const instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;
|
|
@@ -227,6 +227,7 @@ function provideLocal(key, value) {
|
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
229
|
//#region createInjectionState/index.ts
|
|
230
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
230
231
|
function createInjectionState(composable, options) {
|
|
231
232
|
const key = (options === null || options === void 0 ? void 0 : options.injectionKey) || Symbol(composable.name || "InjectionState");
|
|
232
233
|
const defaultValue = options === null || options === void 0 ? void 0 : options.defaultValue;
|
|
@@ -235,7 +236,7 @@ function createInjectionState(composable, options) {
|
|
|
235
236
|
provideLocal(key, state);
|
|
236
237
|
return state;
|
|
237
238
|
};
|
|
238
|
-
const useInjectedState = () => injectLocal(key, defaultValue);
|
|
239
|
+
const useInjectedState = () => /* @__PURE__ */ injectLocal(key, defaultValue);
|
|
239
240
|
return [useProvidingState, useInjectedState];
|
|
240
241
|
}
|
|
241
242
|
//#endregion
|
|
@@ -676,11 +677,7 @@ function reactify(fn, options) {
|
|
|
676
677
|
const createReactiveFn = reactify;
|
|
677
678
|
//#endregion
|
|
678
679
|
//#region reactifyObject/index.ts
|
|
679
|
-
|
|
680
|
-
* Apply `reactify` to an object
|
|
681
|
-
*
|
|
682
|
-
* @__NO_SIDE_EFFECTS__
|
|
683
|
-
*/
|
|
680
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
684
681
|
function reactifyObject(obj, optionsOrKeys = {}) {
|
|
685
682
|
let keys = [];
|
|
686
683
|
let options;
|
|
@@ -706,7 +703,7 @@ function reactifyObject(obj, optionsOrKeys = {}) {
|
|
|
706
703
|
*/
|
|
707
704
|
function toReactive(objectRef) {
|
|
708
705
|
if (!isRef(objectRef)) return reactive(objectRef);
|
|
709
|
-
|
|
706
|
+
const proxy = new Proxy({}, {
|
|
710
707
|
get(_, p, receiver) {
|
|
711
708
|
return unref(Reflect.get(objectRef.value, p, receiver));
|
|
712
709
|
},
|
|
@@ -730,7 +727,8 @@ function toReactive(objectRef) {
|
|
|
730
727
|
configurable: true
|
|
731
728
|
};
|
|
732
729
|
}
|
|
733
|
-
})
|
|
730
|
+
});
|
|
731
|
+
return reactive(proxy);
|
|
734
732
|
}
|
|
735
733
|
//#endregion
|
|
736
734
|
//#region reactiveComputed/index.ts
|
|
@@ -894,7 +892,7 @@ function refManualReset(defaultValue) {
|
|
|
894
892
|
* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
|
|
895
893
|
* (default value: 200)
|
|
896
894
|
*
|
|
897
|
-
* @param [trailing] if true, call fn again after the time is up (default value:
|
|
895
|
+
* @param [trailing] if true, call fn again after the time is up (default value: true)
|
|
898
896
|
*
|
|
899
897
|
* @param [leading] if true, call fn on the leading edge of the ms timeout (default value: true)
|
|
900
898
|
*
|
|
@@ -904,7 +902,7 @@ function refManualReset(defaultValue) {
|
|
|
904
902
|
*
|
|
905
903
|
* @__NO_SIDE_EFFECTS__
|
|
906
904
|
*/
|
|
907
|
-
function useThrottleFn(fn, ms = 200, trailing =
|
|
905
|
+
function useThrottleFn(fn, ms = 200, trailing = true, leading = true, rejectOnCancel = false) {
|
|
908
906
|
return createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);
|
|
909
907
|
}
|
|
910
908
|
//#endregion
|
|
@@ -1111,19 +1109,20 @@ function toRefs(objectRef, options = {}) {
|
|
|
1111
1109
|
},
|
|
1112
1110
|
set(v) {
|
|
1113
1111
|
var _toValue;
|
|
1114
|
-
if ((_toValue = toValue(options.replaceRef)) !== null && _toValue !== void 0 ? _toValue : true)
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1112
|
+
if ((_toValue = toValue(options.replaceRef)) !== null && _toValue !== void 0 ? _toValue : true) {
|
|
1113
|
+
if (Array.isArray(objectRef.value)) {
|
|
1114
|
+
const copy = [...objectRef.value];
|
|
1115
|
+
copy[key] = v;
|
|
1116
|
+
objectRef.value = copy;
|
|
1117
|
+
} else {
|
|
1118
|
+
const newObject = {
|
|
1119
|
+
...objectRef.value,
|
|
1120
|
+
[key]: v
|
|
1121
|
+
};
|
|
1122
|
+
Object.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));
|
|
1123
|
+
objectRef.value = newObject;
|
|
1124
|
+
}
|
|
1125
|
+
} else objectRef.value[key] = v;
|
|
1127
1126
|
}
|
|
1128
1127
|
}));
|
|
1129
1128
|
return result;
|
|
@@ -1323,17 +1322,7 @@ function useArrayEvery(list, fn) {
|
|
|
1323
1322
|
}
|
|
1324
1323
|
//#endregion
|
|
1325
1324
|
//#region useArrayFilter/index.ts
|
|
1326
|
-
|
|
1327
|
-
* Reactive `Array.filter`
|
|
1328
|
-
*
|
|
1329
|
-
* @see https://vueuse.org/useArrayFilter
|
|
1330
|
-
* @param list - the array was called upon.
|
|
1331
|
-
* @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.
|
|
1332
|
-
*
|
|
1333
|
-
* @returns a shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned.
|
|
1334
|
-
*
|
|
1335
|
-
* @__NO_SIDE_EFFECTS__
|
|
1336
|
-
*/
|
|
1325
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1337
1326
|
function useArrayFilter(list, fn) {
|
|
1338
1327
|
return computed(() => toValue(list).map((i) => toValue(i)).filter(fn));
|
|
1339
1328
|
}
|
|
@@ -1394,15 +1383,7 @@ function useArrayFindLast(list, fn) {
|
|
|
1394
1383
|
function isArrayIncludesOptions(obj) {
|
|
1395
1384
|
return isObject(obj) && containsProp(obj, "formIndex", "comparator");
|
|
1396
1385
|
}
|
|
1397
|
-
|
|
1398
|
-
* Reactive `Array.includes`
|
|
1399
|
-
*
|
|
1400
|
-
* @see https://vueuse.org/useArrayIncludes
|
|
1401
|
-
*
|
|
1402
|
-
* @returns true if the `value` is found in the array. Otherwise, false.
|
|
1403
|
-
*
|
|
1404
|
-
* @__NO_SIDE_EFFECTS__
|
|
1405
|
-
*/
|
|
1386
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1406
1387
|
function useArrayIncludes(...args) {
|
|
1407
1388
|
var _comparator;
|
|
1408
1389
|
const list = args[0];
|
|
@@ -1455,18 +1436,7 @@ function useArrayMap(list, fn) {
|
|
|
1455
1436
|
}
|
|
1456
1437
|
//#endregion
|
|
1457
1438
|
//#region useArrayReduce/index.ts
|
|
1458
|
-
|
|
1459
|
-
* Reactive `Array.reduce`
|
|
1460
|
-
*
|
|
1461
|
-
* @see https://vueuse.org/useArrayReduce
|
|
1462
|
-
* @param list - the array was called upon.
|
|
1463
|
-
* @param reducer - a "reducer" function.
|
|
1464
|
-
* @param args
|
|
1465
|
-
*
|
|
1466
|
-
* @returns the value that results from running the "reducer" callback function to completion over the entire array.
|
|
1467
|
-
*
|
|
1468
|
-
* @__NO_SIDE_EFFECTS__
|
|
1469
|
-
*/
|
|
1439
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1470
1440
|
function useArrayReduce(list, reducer, ...args) {
|
|
1471
1441
|
const reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);
|
|
1472
1442
|
return computed(() => {
|
|
@@ -2400,10 +2370,12 @@ function useMutationObserver(target, callback, options = {}) {
|
|
|
2400
2370
|
observer = void 0;
|
|
2401
2371
|
}
|
|
2402
2372
|
};
|
|
2403
|
-
const
|
|
2404
|
-
const
|
|
2373
|
+
const targets = computed(() => {
|
|
2374
|
+
const value = toValue(target);
|
|
2375
|
+
const items = toArray(value).map(unrefElement).filter(notNullish);
|
|
2405
2376
|
return new Set(items);
|
|
2406
|
-
})
|
|
2377
|
+
});
|
|
2378
|
+
const stopWatch = watch(targets, (newTargets) => {
|
|
2407
2379
|
cleanup();
|
|
2408
2380
|
if (isSupported.value && newTargets.size) {
|
|
2409
2381
|
observer = new MutationObserver(callback);
|
|
@@ -2480,15 +2452,16 @@ function onKeyStroke(...args) {
|
|
|
2480
2452
|
key = args[0];
|
|
2481
2453
|
handler = args[1];
|
|
2482
2454
|
options = args[2];
|
|
2483
|
-
} else if (args.length === 2)
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2455
|
+
} else if (args.length === 2) {
|
|
2456
|
+
if (typeof args[1] === "object") {
|
|
2457
|
+
key = true;
|
|
2458
|
+
handler = args[0];
|
|
2459
|
+
options = args[1];
|
|
2460
|
+
} else {
|
|
2461
|
+
key = args[0];
|
|
2462
|
+
handler = args[1];
|
|
2463
|
+
}
|
|
2487
2464
|
} else {
|
|
2488
|
-
key = args[0];
|
|
2489
|
-
handler = args[1];
|
|
2490
|
-
}
|
|
2491
|
-
else {
|
|
2492
2465
|
key = true;
|
|
2493
2466
|
handler = args[0];
|
|
2494
2467
|
}
|
|
@@ -2617,7 +2590,11 @@ function onLongPress(target, handler, options) {
|
|
|
2617
2590
|
const cleanup = [
|
|
2618
2591
|
useEventListener(elementRef, "pointerdown", onDown, listenerOptions),
|
|
2619
2592
|
useEventListener(elementRef, "pointermove", onMove, listenerOptions),
|
|
2620
|
-
useEventListener(elementRef, [
|
|
2593
|
+
useEventListener(elementRef, [
|
|
2594
|
+
"pointerup",
|
|
2595
|
+
"pointerleave",
|
|
2596
|
+
"pointercancel"
|
|
2597
|
+
], onRelease, listenerOptions)
|
|
2621
2598
|
];
|
|
2622
2599
|
const stop = () => cleanup.forEach((fn) => fn());
|
|
2623
2600
|
return stop;
|
|
@@ -2655,37 +2632,6 @@ function onStartTyping(callback, options = {}) {
|
|
|
2655
2632
|
if (document) useEventListener(document, "keydown", keydown, { passive: true });
|
|
2656
2633
|
}
|
|
2657
2634
|
//#endregion
|
|
2658
|
-
//#region templateRef/index.ts
|
|
2659
|
-
/**
|
|
2660
|
-
* @deprecated Use Vue's built-in `useTemplateRef` instead.
|
|
2661
|
-
*
|
|
2662
|
-
* Shorthand for binding ref to template element.
|
|
2663
|
-
*
|
|
2664
|
-
* @see https://vueuse.org/templateRef
|
|
2665
|
-
* @param key
|
|
2666
|
-
* @param initialValue
|
|
2667
|
-
*
|
|
2668
|
-
* @__NO_SIDE_EFFECTS__
|
|
2669
|
-
*/
|
|
2670
|
-
function templateRef(key, initialValue = null) {
|
|
2671
|
-
const instance = getCurrentInstance();
|
|
2672
|
-
let _trigger = () => {};
|
|
2673
|
-
const element = customRef((track, trigger) => {
|
|
2674
|
-
_trigger = trigger;
|
|
2675
|
-
return {
|
|
2676
|
-
get() {
|
|
2677
|
-
var _instance$proxy$$refs, _instance$proxy;
|
|
2678
|
-
track();
|
|
2679
|
-
return (_instance$proxy$$refs = instance === null || instance === void 0 || (_instance$proxy = instance.proxy) === null || _instance$proxy === void 0 ? void 0 : _instance$proxy.$refs[key]) !== null && _instance$proxy$$refs !== void 0 ? _instance$proxy$$refs : initialValue;
|
|
2680
|
-
},
|
|
2681
|
-
set() {}
|
|
2682
|
-
};
|
|
2683
|
-
});
|
|
2684
|
-
tryOnMounted(_trigger);
|
|
2685
|
-
onUpdated(_trigger);
|
|
2686
|
-
return element;
|
|
2687
|
-
}
|
|
2688
|
-
//#endregion
|
|
2689
2635
|
//#region useActiveElement/index.ts
|
|
2690
2636
|
/**
|
|
2691
2637
|
* Reactive `document.activeElement`
|
|
@@ -3000,10 +2946,11 @@ function useAsyncQueue(tasks, options) {
|
|
|
3000
2946
|
pending: "pending",
|
|
3001
2947
|
rejected: "rejected"
|
|
3002
2948
|
};
|
|
3003
|
-
const
|
|
2949
|
+
const initialResult = Array.from(Array.from({ length: tasks.length }), () => ({
|
|
3004
2950
|
state: promiseState.pending,
|
|
3005
2951
|
data: null
|
|
3006
|
-
}))
|
|
2952
|
+
}));
|
|
2953
|
+
const result = reactive(initialResult);
|
|
3007
2954
|
const activeIndex = shallowRef(-1);
|
|
3008
2955
|
if (!tasks || tasks.length === 0) {
|
|
3009
2956
|
onFinished();
|
|
@@ -3282,23 +3229,23 @@ function useBluetooth(options) {
|
|
|
3282
3229
|
}
|
|
3283
3230
|
async function connectToBluetoothGATTServer() {
|
|
3284
3231
|
error.value = null;
|
|
3285
|
-
if (device.value && device.value.gatt) {
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
} catch (err) {
|
|
3291
|
-
error.value = err;
|
|
3292
|
-
}
|
|
3232
|
+
if (device.value && device.value.gatt) try {
|
|
3233
|
+
server.value = await device.value.gatt.connect();
|
|
3234
|
+
isConnected.value = server.value.connected;
|
|
3235
|
+
} catch (err) {
|
|
3236
|
+
error.value = err;
|
|
3293
3237
|
}
|
|
3294
3238
|
}
|
|
3295
3239
|
tryOnMounted(() => {
|
|
3296
|
-
|
|
3297
|
-
|
|
3240
|
+
useEventListener(device, "gattserverdisconnected", reset, {
|
|
3241
|
+
passive: true,
|
|
3242
|
+
once: true
|
|
3243
|
+
});
|
|
3244
|
+
connectToBluetoothGATTServer();
|
|
3298
3245
|
});
|
|
3299
3246
|
tryOnScopeDispose(() => {
|
|
3300
|
-
var _device$value$
|
|
3301
|
-
if (device.value) (_device$value$
|
|
3247
|
+
var _device$value$gatt;
|
|
3248
|
+
if (device.value) (_device$value$gatt = device.value.gatt) === null || _device$value$gatt === void 0 || _device$value$gatt.disconnect();
|
|
3302
3249
|
});
|
|
3303
3250
|
return {
|
|
3304
3251
|
isSupported,
|
|
@@ -3688,13 +3635,7 @@ function useCached(refValue, comparator = (newSourceValue, cachedValue) => newSo
|
|
|
3688
3635
|
}
|
|
3689
3636
|
//#endregion
|
|
3690
3637
|
//#region usePermission/index.ts
|
|
3691
|
-
|
|
3692
|
-
* Reactive Permissions API.
|
|
3693
|
-
*
|
|
3694
|
-
* @see https://vueuse.org/usePermission
|
|
3695
|
-
*
|
|
3696
|
-
* @__NO_SIDE_EFFECTS__
|
|
3697
|
-
*/
|
|
3638
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3698
3639
|
function usePermission(permissionDesc, options = {}) {
|
|
3699
3640
|
const { controls = false, navigator = defaultNavigator } = options;
|
|
3700
3641
|
const isSupported = /* @__PURE__ */ useSupported(() => navigator && "permissions" in navigator);
|
|
@@ -3727,11 +3668,12 @@ function usePermission(permissionDesc, options = {}) {
|
|
|
3727
3668
|
}
|
|
3728
3669
|
//#endregion
|
|
3729
3670
|
//#region useClipboard/index.ts
|
|
3671
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3730
3672
|
function useClipboard(options = {}) {
|
|
3731
3673
|
const { navigator = defaultNavigator, read = false, source, copiedDuring = 1500, legacy = false } = options;
|
|
3732
3674
|
const isClipboardApiSupported = /* @__PURE__ */ useSupported(() => navigator && "clipboard" in navigator);
|
|
3733
|
-
const permissionRead = usePermission("clipboard-read");
|
|
3734
|
-
const permissionWrite = usePermission("clipboard-write");
|
|
3675
|
+
const permissionRead = /* @__PURE__ */ usePermission("clipboard-read");
|
|
3676
|
+
const permissionWrite = /* @__PURE__ */ usePermission("clipboard-write");
|
|
3735
3677
|
const isSupported = computed(() => isClipboardApiSupported.value || legacy);
|
|
3736
3678
|
const text = shallowRef("");
|
|
3737
3679
|
const copied = shallowRef(false);
|
|
@@ -3759,15 +3701,17 @@ function useClipboard(options = {}) {
|
|
|
3759
3701
|
} catch (_unused2) {
|
|
3760
3702
|
useLegacy = true;
|
|
3761
3703
|
}
|
|
3762
|
-
if (useLegacy)
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3704
|
+
if (useLegacy) {
|
|
3705
|
+
if (typeof resolvedValue === "string") {
|
|
3706
|
+
text.value = resolvedValue;
|
|
3707
|
+
legacyCopy(resolvedValue);
|
|
3708
|
+
} else {
|
|
3709
|
+
const currentId = ++lastLegacyId;
|
|
3710
|
+
const resolvedText = await resolvedValue();
|
|
3711
|
+
if (resolvedText != null && currentId === lastLegacyId) {
|
|
3712
|
+
text.value = resolvedText;
|
|
3713
|
+
legacyCopy(resolvedText);
|
|
3714
|
+
}
|
|
3771
3715
|
}
|
|
3772
3716
|
}
|
|
3773
3717
|
copied.value = true;
|
|
@@ -3812,6 +3756,7 @@ function useClipboard(options = {}) {
|
|
|
3812
3756
|
}
|
|
3813
3757
|
//#endregion
|
|
3814
3758
|
//#region useClipboardItems/index.ts
|
|
3759
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3815
3760
|
function useClipboardItems(options = {}) {
|
|
3816
3761
|
const { navigator = defaultNavigator, read = false, source, copiedDuring = 1500 } = options;
|
|
3817
3762
|
const isSupported = /* @__PURE__ */ useSupported(() => navigator && "clipboard" in navigator);
|
|
@@ -3989,8 +3934,10 @@ function useStorage(key, defaults, storage, options = {}) {
|
|
|
3989
3934
|
*
|
|
3990
3935
|
* TODO: Consider implementing a BroadcastChannel-based solution that fixes this.
|
|
3991
3936
|
*/
|
|
3992
|
-
if (window && listenToStorageChanges)
|
|
3993
|
-
|
|
3937
|
+
if (window && listenToStorageChanges) {
|
|
3938
|
+
if (storage instanceof Storage) useEventListener(window, "storage", onStorageEvent, { passive: true });
|
|
3939
|
+
else useEventListener(window, customStorageEventName, onStorageCustomEvent);
|
|
3940
|
+
}
|
|
3994
3941
|
if (initOnMounted) tryOnMounted(() => {
|
|
3995
3942
|
firstMounted = true;
|
|
3996
3943
|
update();
|
|
@@ -4195,13 +4142,6 @@ function useConfirmDialog(revealed = shallowRef(false)) {
|
|
|
4195
4142
|
}
|
|
4196
4143
|
//#endregion
|
|
4197
4144
|
//#region useCountdown/index.ts
|
|
4198
|
-
function getDefaultScheduler$8(options) {
|
|
4199
|
-
if ("interval" in options || "immediate" in options) {
|
|
4200
|
-
const { interval = 1e3, immediate = false } = options;
|
|
4201
|
-
return (cb) => useIntervalFn(cb, interval, { immediate });
|
|
4202
|
-
}
|
|
4203
|
-
return (cb) => useIntervalFn(cb, 1e3, { immediate: false });
|
|
4204
|
-
}
|
|
4205
4145
|
/**
|
|
4206
4146
|
* Reactive countdown timer in seconds.
|
|
4207
4147
|
*
|
|
@@ -4212,7 +4152,7 @@ function getDefaultScheduler$8(options) {
|
|
|
4212
4152
|
*/
|
|
4213
4153
|
function useCountdown(initialCountdown, options = {}) {
|
|
4214
4154
|
const remaining = shallowRef(toValue(initialCountdown));
|
|
4215
|
-
const { scheduler =
|
|
4155
|
+
const { scheduler = (cb) => useIntervalFn(cb, 1e3, { immediate: false }), onTick, onComplete } = options;
|
|
4216
4156
|
const controls = scheduler(() => {
|
|
4217
4157
|
const value = remaining.value - 1;
|
|
4218
4158
|
remaining.value = value < 0 ? 0 : value;
|
|
@@ -4298,8 +4238,10 @@ function useCssVar(prop, target, options = {}) {
|
|
|
4298
4238
|
}, { immediate: true });
|
|
4299
4239
|
watch([variable, elRef], ([val, el]) => {
|
|
4300
4240
|
const raw_prop = toValue(prop);
|
|
4301
|
-
if ((el === null || el === void 0 ? void 0 : el.style) && raw_prop)
|
|
4302
|
-
|
|
4241
|
+
if ((el === null || el === void 0 ? void 0 : el.style) && raw_prop) {
|
|
4242
|
+
if (val == null) el.style.removeProperty(raw_prop);
|
|
4243
|
+
else el.style.setProperty(raw_prop, val);
|
|
4244
|
+
}
|
|
4303
4245
|
}, { immediate: true });
|
|
4304
4246
|
return variable;
|
|
4305
4247
|
}
|
|
@@ -4622,8 +4564,10 @@ function useDeviceMotion(options = {}) {
|
|
|
4622
4564
|
}
|
|
4623
4565
|
}
|
|
4624
4566
|
};
|
|
4625
|
-
if (isSupported.value)
|
|
4626
|
-
|
|
4567
|
+
if (isSupported.value) {
|
|
4568
|
+
if (requestPermissions && requirePermissions.value) ensurePermissions().then(() => init());
|
|
4569
|
+
else init();
|
|
4570
|
+
}
|
|
4627
4571
|
return {
|
|
4628
4572
|
acceleration,
|
|
4629
4573
|
accelerationIncludingGravity,
|
|
@@ -4719,7 +4663,7 @@ function useDevicesList(options = {}) {
|
|
|
4719
4663
|
const deviceName = constraints.video ? "camera" : "microphone";
|
|
4720
4664
|
if (!isSupported.value) return false;
|
|
4721
4665
|
if (permissionGranted.value) return true;
|
|
4722
|
-
const { state, query } = usePermission(deviceName, { controls: true });
|
|
4666
|
+
const { state, query } = /* @__PURE__ */ usePermission(deviceName, { controls: true });
|
|
4723
4667
|
await query();
|
|
4724
4668
|
if (state.value !== "granted") {
|
|
4725
4669
|
let granted = true;
|
|
@@ -5090,7 +5034,6 @@ function useDropZone(target, options = {}) {
|
|
|
5090
5034
|
files.value = currentFiles;
|
|
5091
5035
|
(_options$onDrop = _options.onDrop) === null || _options$onDrop === void 0 || _options$onDrop.call(_options, currentFiles, event);
|
|
5092
5036
|
}
|
|
5093
|
-
break;
|
|
5094
5037
|
}
|
|
5095
5038
|
};
|
|
5096
5039
|
useEventListener(target, "dragenter", (event) => handleDragEvent(event, "enter"));
|
|
@@ -5123,14 +5066,15 @@ function useResizeObserver(target, callback, options = {}) {
|
|
|
5123
5066
|
observer = void 0;
|
|
5124
5067
|
}
|
|
5125
5068
|
};
|
|
5126
|
-
const
|
|
5069
|
+
const targets = computed(() => {
|
|
5127
5070
|
const _targets = toValue(target);
|
|
5128
5071
|
return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
|
|
5129
|
-
})
|
|
5072
|
+
});
|
|
5073
|
+
const stopWatch = watch(targets, (els) => {
|
|
5130
5074
|
cleanup();
|
|
5131
5075
|
if (isSupported.value && window) {
|
|
5132
5076
|
observer = new ResizeObserver(callback);
|
|
5133
|
-
for (const _el of els) if (_el) observer.observe(_el, observerOptions);
|
|
5077
|
+
for (const _el of els) if (_el instanceof Element) observer.observe(_el, observerOptions);
|
|
5134
5078
|
}
|
|
5135
5079
|
}, {
|
|
5136
5080
|
immediate: true,
|
|
@@ -5218,13 +5162,6 @@ function useElementBounding(target, options = {}) {
|
|
|
5218
5162
|
}
|
|
5219
5163
|
//#endregion
|
|
5220
5164
|
//#region useElementByPoint/index.ts
|
|
5221
|
-
function getDefaultScheduler$7(options) {
|
|
5222
|
-
if ("interval" in options || "immediate" in options) {
|
|
5223
|
-
const { interval = "requestAnimationFrame", immediate = true } = options;
|
|
5224
|
-
return interval === "requestAnimationFrame" ? (cb) => useRafFn(cb, { immediate }) : (cb) => useIntervalFn(cb, interval, { immediate });
|
|
5225
|
-
}
|
|
5226
|
-
return useRafFn;
|
|
5227
|
-
}
|
|
5228
5165
|
/**
|
|
5229
5166
|
* Reactive element by point.
|
|
5230
5167
|
*
|
|
@@ -5232,7 +5169,7 @@ function getDefaultScheduler$7(options) {
|
|
|
5232
5169
|
* @param options - UseElementByPointOptions
|
|
5233
5170
|
*/
|
|
5234
5171
|
function useElementByPoint(options) {
|
|
5235
|
-
const { x, y, document = defaultDocument, multiple, scheduler =
|
|
5172
|
+
const { x, y, document = defaultDocument, multiple, scheduler = useRafFn } = options;
|
|
5236
5173
|
const isSupported = /* @__PURE__ */ useSupported(() => {
|
|
5237
5174
|
if (toValue(multiple)) return document && "elementsFromPoint" in document;
|
|
5238
5175
|
return document && "elementFromPoint" in document;
|
|
@@ -5363,19 +5300,20 @@ function useElementSize(target, initialSize = {
|
|
|
5363
5300
|
}, options);
|
|
5364
5301
|
tryOnMounted(() => {
|
|
5365
5302
|
const ele = unrefElement(target);
|
|
5366
|
-
if (ele && "offsetWidth" in ele)
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5303
|
+
if (ele && "offsetWidth" in ele) {
|
|
5304
|
+
if (box === "content-box" && window) {
|
|
5305
|
+
const cs = window.getComputedStyle(ele);
|
|
5306
|
+
const padX = Number.parseFloat(cs.paddingLeft) + Number.parseFloat(cs.paddingRight);
|
|
5307
|
+
const padY = Number.parseFloat(cs.paddingTop) + Number.parseFloat(cs.paddingBottom);
|
|
5308
|
+
const bdX = Number.parseFloat(cs.borderLeftWidth) + Number.parseFloat(cs.borderRightWidth);
|
|
5309
|
+
const bdY = Number.parseFloat(cs.borderTopWidth) + Number.parseFloat(cs.borderBottomWidth);
|
|
5310
|
+
width.value = ele.offsetWidth - padX - bdX;
|
|
5311
|
+
height.value = ele.offsetHeight - padY - bdY;
|
|
5312
|
+
} else {
|
|
5313
|
+
width.value = ele.offsetWidth;
|
|
5314
|
+
height.value = ele.offsetHeight;
|
|
5315
|
+
}
|
|
5316
|
+
} else if (ele) {
|
|
5379
5317
|
width.value = initialSize.width;
|
|
5380
5318
|
height.value = initialSize.height;
|
|
5381
5319
|
}
|
|
@@ -5408,7 +5346,8 @@ function useIntersectionObserver(target, callback, options = {}) {
|
|
|
5408
5346
|
const { root, rootMargin, threshold = 0, window = defaultWindow, immediate = true } = options;
|
|
5409
5347
|
const isSupported = /* @__PURE__ */ useSupported(() => window && "IntersectionObserver" in window);
|
|
5410
5348
|
const targets = computed(() => {
|
|
5411
|
-
|
|
5349
|
+
const _target = toValue(target);
|
|
5350
|
+
return toArray(_target).map(unrefElement).filter(notNullish);
|
|
5412
5351
|
});
|
|
5413
5352
|
let cleanup = noop;
|
|
5414
5353
|
const isActive = shallowRef(immediate);
|
|
@@ -5530,6 +5469,7 @@ function resolveNestedOptions$1(options) {
|
|
|
5530
5469
|
if (options === true) return {};
|
|
5531
5470
|
return options;
|
|
5532
5471
|
}
|
|
5472
|
+
const DEFAULT_EVENT = "message";
|
|
5533
5473
|
/**
|
|
5534
5474
|
* Reactive wrapper for EventSource.
|
|
5535
5475
|
*
|
|
@@ -5579,16 +5519,11 @@ function useEventSource(url, events = [], options = {}) {
|
|
|
5579
5519
|
else onFailed === null || onFailed === void 0 || onFailed();
|
|
5580
5520
|
}
|
|
5581
5521
|
};
|
|
5582
|
-
|
|
5583
|
-
var _serializer$read;
|
|
5584
|
-
event.value = null;
|
|
5585
|
-
data.value = (_serializer$read = serializer.read(e.data)) !== null && _serializer$read !== void 0 ? _serializer$read : null;
|
|
5586
|
-
lastEventId.value = e.lastEventId;
|
|
5587
|
-
};
|
|
5522
|
+
events = events.length > 0 ? events : [DEFAULT_EVENT];
|
|
5588
5523
|
for (const event_name of events) useEventListener(es, event_name, (e) => {
|
|
5589
|
-
var _serializer$
|
|
5524
|
+
var _serializer$read, _e$lastEventId;
|
|
5590
5525
|
event.value = event_name;
|
|
5591
|
-
data.value = (_serializer$
|
|
5526
|
+
data.value = (_serializer$read = serializer.read(e.data)) !== null && _serializer$read !== void 0 ? _serializer$read : null;
|
|
5592
5527
|
lastEventId.value = (_e$lastEventId = e.lastEventId) !== null && _e$lastEventId !== void 0 ? _e$lastEventId : null;
|
|
5593
5528
|
}, { passive: true });
|
|
5594
5529
|
};
|
|
@@ -5718,21 +5653,23 @@ function createFetch(config = {}) {
|
|
|
5718
5653
|
});
|
|
5719
5654
|
let options = _options;
|
|
5720
5655
|
let fetchOptions = _fetchOptions;
|
|
5721
|
-
if (args.length > 0)
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5656
|
+
if (args.length > 0) {
|
|
5657
|
+
if (isFetchOptions(args[0])) options = {
|
|
5658
|
+
...options,
|
|
5659
|
+
...args[0],
|
|
5660
|
+
beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),
|
|
5661
|
+
afterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),
|
|
5662
|
+
onFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)
|
|
5663
|
+
};
|
|
5664
|
+
else fetchOptions = {
|
|
5665
|
+
...fetchOptions,
|
|
5666
|
+
...args[0],
|
|
5667
|
+
headers: {
|
|
5668
|
+
...headersToObject(fetchOptions.headers) || {},
|
|
5669
|
+
...headersToObject(args[0].headers) || {}
|
|
5670
|
+
}
|
|
5671
|
+
};
|
|
5672
|
+
}
|
|
5736
5673
|
if (args.length > 1 && isFetchOptions(args[1])) options = {
|
|
5737
5674
|
...options,
|
|
5738
5675
|
...args[1],
|
|
@@ -5759,11 +5696,13 @@ function useFetch(url, ...args) {
|
|
|
5759
5696
|
type: "text",
|
|
5760
5697
|
payload: void 0
|
|
5761
5698
|
};
|
|
5762
|
-
if (args.length > 0)
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5699
|
+
if (args.length > 0) {
|
|
5700
|
+
if (isFetchOptions(args[0])) options = {
|
|
5701
|
+
...options,
|
|
5702
|
+
...args[0]
|
|
5703
|
+
};
|
|
5704
|
+
else fetchOptions = args[0];
|
|
5705
|
+
}
|
|
5767
5706
|
if (args.length > 1) {
|
|
5768
5707
|
if (isFetchOptions(args[1])) options = {
|
|
5769
5708
|
...options,
|
|
@@ -5849,11 +5788,13 @@ function useFetch(url, ...args) {
|
|
|
5849
5788
|
...headersToObject((_context$options = context.options) === null || _context$options === void 0 ? void 0 : _context$options.headers)
|
|
5850
5789
|
}
|
|
5851
5790
|
}).then(async (fetchResponse) => {
|
|
5852
|
-
|
|
5853
|
-
|
|
5791
|
+
if (currentExecuteCounter === executeCounter) {
|
|
5792
|
+
response.value = fetchResponse;
|
|
5793
|
+
statusCode.value = fetchResponse.status;
|
|
5794
|
+
}
|
|
5854
5795
|
responseData = await fetchResponse.clone()[config.type]();
|
|
5855
5796
|
if (!fetchResponse.ok) {
|
|
5856
|
-
data.value = initialData || null;
|
|
5797
|
+
if (currentExecuteCounter === executeCounter) data.value = initialData || null;
|
|
5857
5798
|
throw new Error(fetchResponse.statusText);
|
|
5858
5799
|
}
|
|
5859
5800
|
if (options.afterFetch) ({data: responseData} = await options.afterFetch({
|
|
@@ -5862,7 +5803,7 @@ function useFetch(url, ...args) {
|
|
|
5862
5803
|
context,
|
|
5863
5804
|
execute
|
|
5864
5805
|
}));
|
|
5865
|
-
data.value = responseData;
|
|
5806
|
+
if (currentExecuteCounter === executeCounter) data.value = responseData;
|
|
5866
5807
|
responseEvent.trigger(fetchResponse);
|
|
5867
5808
|
return fetchResponse;
|
|
5868
5809
|
}).catch(async (fetchError) => {
|
|
@@ -6286,19 +6227,23 @@ function useFullscreen(target, options = {}) {
|
|
|
6286
6227
|
return false;
|
|
6287
6228
|
};
|
|
6288
6229
|
const isElementFullScreen = () => {
|
|
6289
|
-
if (fullscreenEnabled.value)
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6230
|
+
if (fullscreenEnabled.value) {
|
|
6231
|
+
if (document && document[fullscreenEnabled.value] != null) return document[fullscreenEnabled.value];
|
|
6232
|
+
else {
|
|
6233
|
+
const target = targetRef.value;
|
|
6234
|
+
if ((target === null || target === void 0 ? void 0 : target[fullscreenEnabled.value]) != null) return Boolean(target[fullscreenEnabled.value]);
|
|
6235
|
+
}
|
|
6293
6236
|
}
|
|
6294
6237
|
return false;
|
|
6295
6238
|
};
|
|
6296
6239
|
async function exit() {
|
|
6297
6240
|
if (!isSupported.value || !isFullscreen.value) return;
|
|
6298
|
-
if (exitMethod.value)
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6241
|
+
if (exitMethod.value) {
|
|
6242
|
+
if ((document === null || document === void 0 ? void 0 : document[exitMethod.value]) != null) await document[exitMethod.value]();
|
|
6243
|
+
else {
|
|
6244
|
+
const target = targetRef.value;
|
|
6245
|
+
if ((target === null || target === void 0 ? void 0 : target[exitMethod.value]) != null) await target[exitMethod.value]();
|
|
6246
|
+
}
|
|
6302
6247
|
}
|
|
6303
6248
|
isFullscreen.value = false;
|
|
6304
6249
|
}
|
|
@@ -6812,14 +6757,15 @@ function useInfiniteScroll(element, onLoadMore, options = {}) {
|
|
|
6812
6757
|
nextTick(() => checkAndLoad());
|
|
6813
6758
|
});
|
|
6814
6759
|
}
|
|
6815
|
-
|
|
6760
|
+
const stop = watch(() => [
|
|
6816
6761
|
state.arrivedState[direction],
|
|
6817
6762
|
isElementVisible.value,
|
|
6818
6763
|
canLoad.value
|
|
6819
6764
|
], checkAndLoad, {
|
|
6820
6765
|
immediate: true,
|
|
6821
6766
|
flush: "post"
|
|
6822
|
-
})
|
|
6767
|
+
});
|
|
6768
|
+
tryOnUnmounted(stop);
|
|
6823
6769
|
return {
|
|
6824
6770
|
isLoading,
|
|
6825
6771
|
reset() {
|
|
@@ -6847,6 +6793,106 @@ function useKeyModifier(modifier, options = {}) {
|
|
|
6847
6793
|
return state;
|
|
6848
6794
|
}
|
|
6849
6795
|
//#endregion
|
|
6796
|
+
//#region useLiveAnnouncer/index.ts
|
|
6797
|
+
let announcerMap;
|
|
6798
|
+
function getAnnouncerMap() {
|
|
6799
|
+
var _announcerMap;
|
|
6800
|
+
return (_announcerMap = announcerMap) !== null && _announcerMap !== void 0 ? _announcerMap : announcerMap = /* @__PURE__ */ new Map();
|
|
6801
|
+
}
|
|
6802
|
+
function cleanup(idPrefix, document) {
|
|
6803
|
+
const map = getAnnouncerMap();
|
|
6804
|
+
const count = map.get(idPrefix) || 0;
|
|
6805
|
+
if (count <= 1) {
|
|
6806
|
+
const container = document.getElementById(`${idPrefix}-container`);
|
|
6807
|
+
if (container) container.remove();
|
|
6808
|
+
map.delete(idPrefix);
|
|
6809
|
+
} else map.set(idPrefix, count - 1);
|
|
6810
|
+
}
|
|
6811
|
+
function useLiveAnnouncer(options = {}) {
|
|
6812
|
+
const { idPrefix = "vueuse-live-announcer", window = defaultWindow } = options;
|
|
6813
|
+
const document = window === null || window === void 0 ? void 0 : window.document;
|
|
6814
|
+
const timers = /* @__PURE__ */ new Map();
|
|
6815
|
+
if (window && document) {
|
|
6816
|
+
const map = getAnnouncerMap();
|
|
6817
|
+
const count = map.get(idPrefix) || 0;
|
|
6818
|
+
map.set(idPrefix, count + 1);
|
|
6819
|
+
tryOnScopeDispose(() => {
|
|
6820
|
+
timers.forEach((timer) => window.clearTimeout(timer));
|
|
6821
|
+
timers.clear();
|
|
6822
|
+
cleanup(idPrefix, document);
|
|
6823
|
+
});
|
|
6824
|
+
}
|
|
6825
|
+
function ensureAnnouncer() {
|
|
6826
|
+
if (!document) return;
|
|
6827
|
+
let container = document.getElementById(`${idPrefix}-container`);
|
|
6828
|
+
if (!container) {
|
|
6829
|
+
container = document.createElement("div");
|
|
6830
|
+
container.id = `${idPrefix}-container`;
|
|
6831
|
+
container.style.position = "absolute";
|
|
6832
|
+
container.style.width = "1px";
|
|
6833
|
+
container.style.height = "1px";
|
|
6834
|
+
container.style.padding = "0";
|
|
6835
|
+
container.style.margin = "-1px";
|
|
6836
|
+
container.style.overflow = "hidden";
|
|
6837
|
+
container.style.clip = "rect(0, 0, 0, 0)";
|
|
6838
|
+
container.style.whiteSpace = "nowrap";
|
|
6839
|
+
container.style.border = "0";
|
|
6840
|
+
container.style.wordWrap = "normal";
|
|
6841
|
+
container.style.clipPath = "inset(50%)";
|
|
6842
|
+
document.body.appendChild(container);
|
|
6843
|
+
}
|
|
6844
|
+
if (!document.getElementById(`${idPrefix}-polite`)) {
|
|
6845
|
+
const polite = document.createElement("div");
|
|
6846
|
+
polite.id = `${idPrefix}-polite`;
|
|
6847
|
+
polite.setAttribute("role", "status");
|
|
6848
|
+
polite.setAttribute("aria-live", "polite");
|
|
6849
|
+
polite.setAttribute("aria-atomic", "true");
|
|
6850
|
+
container.appendChild(polite);
|
|
6851
|
+
}
|
|
6852
|
+
if (!document.getElementById(`${idPrefix}-assertive`)) {
|
|
6853
|
+
const assertive = document.createElement("div");
|
|
6854
|
+
assertive.id = `${idPrefix}-assertive`;
|
|
6855
|
+
assertive.setAttribute("role", "alert");
|
|
6856
|
+
assertive.setAttribute("aria-live", "assertive");
|
|
6857
|
+
assertive.setAttribute("aria-atomic", "true");
|
|
6858
|
+
container.appendChild(assertive);
|
|
6859
|
+
}
|
|
6860
|
+
}
|
|
6861
|
+
ensureAnnouncer();
|
|
6862
|
+
function announce(message, mode = "polite", timeout) {
|
|
6863
|
+
if (!window || !document) return;
|
|
6864
|
+
ensureAnnouncer();
|
|
6865
|
+
const element = document.getElementById(`${idPrefix}-${mode}`);
|
|
6866
|
+
if (element) {
|
|
6867
|
+
const pending = timers.get(mode);
|
|
6868
|
+
if (pending != null) {
|
|
6869
|
+
window.clearTimeout(pending);
|
|
6870
|
+
timers.delete(mode);
|
|
6871
|
+
}
|
|
6872
|
+
element.textContent = "";
|
|
6873
|
+
nextTick(() => element.textContent = message);
|
|
6874
|
+
if (timeout && timeout > 0) {
|
|
6875
|
+
const timer = window.setTimeout(() => {
|
|
6876
|
+
timers.delete(mode);
|
|
6877
|
+
element.textContent = "";
|
|
6878
|
+
}, timeout);
|
|
6879
|
+
timers.set(mode, timer);
|
|
6880
|
+
}
|
|
6881
|
+
}
|
|
6882
|
+
}
|
|
6883
|
+
function polite(message, timeout) {
|
|
6884
|
+
announce(message, "polite", timeout);
|
|
6885
|
+
}
|
|
6886
|
+
function assertive(message, timeout) {
|
|
6887
|
+
announce(message, "assertive", timeout);
|
|
6888
|
+
}
|
|
6889
|
+
return {
|
|
6890
|
+
announce,
|
|
6891
|
+
polite,
|
|
6892
|
+
assertive
|
|
6893
|
+
};
|
|
6894
|
+
}
|
|
6895
|
+
//#endregion
|
|
6850
6896
|
//#region useLocalStorage/index.ts
|
|
6851
6897
|
/**
|
|
6852
6898
|
* Reactive LocalStorage.
|
|
@@ -6897,8 +6943,10 @@ function useMagicKeys(options = {}) {
|
|
|
6897
6943
|
]);
|
|
6898
6944
|
const usedKeys = /* @__PURE__ */ new Set();
|
|
6899
6945
|
function setRefs(key, value) {
|
|
6900
|
-
if (key in refs)
|
|
6901
|
-
|
|
6946
|
+
if (key in refs) {
|
|
6947
|
+
if (useReactive) refs[key] = value;
|
|
6948
|
+
else refs[key].value = value;
|
|
6949
|
+
}
|
|
6902
6950
|
}
|
|
6903
6951
|
function reset() {
|
|
6904
6952
|
current.clear();
|
|
@@ -6931,8 +6979,10 @@ function useMagicKeys(options = {}) {
|
|
|
6931
6979
|
const key = (_e$key = e.key) === null || _e$key === void 0 ? void 0 : _e$key.toLowerCase();
|
|
6932
6980
|
const values = [(_e$code = e.code) === null || _e$code === void 0 ? void 0 : _e$code.toLowerCase(), key].filter(Boolean);
|
|
6933
6981
|
if (!key) return;
|
|
6934
|
-
if (key)
|
|
6935
|
-
|
|
6982
|
+
if (key) {
|
|
6983
|
+
if (value) current.add(key);
|
|
6984
|
+
else current.delete(key);
|
|
6985
|
+
}
|
|
6936
6986
|
for (const key of values) {
|
|
6937
6987
|
usedKeys.add(key);
|
|
6938
6988
|
setRefs(key, value);
|
|
@@ -6961,10 +7011,12 @@ function useMagicKeys(options = {}) {
|
|
|
6961
7011
|
if (typeof prop !== "string") return Reflect.get(target, prop, rec);
|
|
6962
7012
|
prop = prop.toLowerCase();
|
|
6963
7013
|
if (prop in aliasMap) prop = aliasMap[prop];
|
|
6964
|
-
if (!(prop in refs))
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
7014
|
+
if (!(prop in refs)) {
|
|
7015
|
+
if (/[+_-]/.test(prop)) {
|
|
7016
|
+
const keys = prop.split(/[+_-]/g).map((i) => i.trim());
|
|
7017
|
+
refs[prop] = computed(() => keys.map((key) => toValue(proxy[key])).every(Boolean));
|
|
7018
|
+
} else refs[prop] = shallowRef(false);
|
|
7019
|
+
}
|
|
6968
7020
|
const r = Reflect.get(target, prop, rec);
|
|
6969
7021
|
return useReactive ? toValue(r) : r;
|
|
6970
7022
|
} });
|
|
@@ -7066,8 +7118,10 @@ function useMediaControls(target, options = {}) {
|
|
|
7066
7118
|
const togglePictureInPicture = () => {
|
|
7067
7119
|
return new Promise((resolve, reject) => {
|
|
7068
7120
|
usingElRef(target, async (el) => {
|
|
7069
|
-
if (supportsPictureInPicture)
|
|
7070
|
-
|
|
7121
|
+
if (supportsPictureInPicture) {
|
|
7122
|
+
if (!isPictureInPicture.value) el.requestPictureInPicture().then(resolve).catch(reject);
|
|
7123
|
+
else document.exitPictureInPicture().then(resolve).catch(reject);
|
|
7124
|
+
}
|
|
7071
7125
|
});
|
|
7072
7126
|
});
|
|
7073
7127
|
};
|
|
@@ -7284,16 +7338,6 @@ function useMemoize(resolver, options) {
|
|
|
7284
7338
|
}
|
|
7285
7339
|
//#endregion
|
|
7286
7340
|
//#region useMemory/index.ts
|
|
7287
|
-
function getDefaultScheduler$6(options) {
|
|
7288
|
-
if ("interval" in options || "immediate" in options || "immediateCallback" in options) {
|
|
7289
|
-
const { interval = 1e3, immediate, immediateCallback } = options;
|
|
7290
|
-
return (cb) => useIntervalFn(cb, interval, {
|
|
7291
|
-
immediate,
|
|
7292
|
-
immediateCallback
|
|
7293
|
-
});
|
|
7294
|
-
}
|
|
7295
|
-
return useIntervalFn;
|
|
7296
|
-
}
|
|
7297
7341
|
/**
|
|
7298
7342
|
* Reactive Memory Info.
|
|
7299
7343
|
*
|
|
@@ -7306,7 +7350,7 @@ function useMemory(options = {}) {
|
|
|
7306
7350
|
const memory = shallowRef();
|
|
7307
7351
|
const isSupported = /* @__PURE__ */ useSupported(() => typeof performance !== "undefined" && "memory" in performance);
|
|
7308
7352
|
if (isSupported.value) {
|
|
7309
|
-
const { scheduler =
|
|
7353
|
+
const { scheduler = useIntervalFn } = options;
|
|
7310
7354
|
scheduler(() => {
|
|
7311
7355
|
memory.value = performance.memory;
|
|
7312
7356
|
});
|
|
@@ -7613,23 +7657,9 @@ function useNetwork(options = {}) {
|
|
|
7613
7657
|
}
|
|
7614
7658
|
//#endregion
|
|
7615
7659
|
//#region useNow/index.ts
|
|
7616
|
-
|
|
7617
|
-
if ("interval" in options || "immediate" in options) {
|
|
7618
|
-
const { interval = "requestAnimationFrame", immediate = true } = options;
|
|
7619
|
-
return interval === "requestAnimationFrame" ? (fn) => useRafFn(fn, { immediate }) : (fn) => useIntervalFn(fn, interval, options);
|
|
7620
|
-
}
|
|
7621
|
-
return useRafFn;
|
|
7622
|
-
}
|
|
7623
|
-
/**
|
|
7624
|
-
* Reactive current Date instance.
|
|
7625
|
-
*
|
|
7626
|
-
* @see https://vueuse.org/useNow
|
|
7627
|
-
* @param options
|
|
7628
|
-
*
|
|
7629
|
-
* @__NO_SIDE_EFFECTS__
|
|
7630
|
-
*/
|
|
7660
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
7631
7661
|
function useNow(options = {}) {
|
|
7632
|
-
const { controls: exposeControls = false, scheduler =
|
|
7662
|
+
const { controls: exposeControls = false, scheduler = useRafFn } = options;
|
|
7633
7663
|
const now = shallowRef(/* @__PURE__ */ new Date());
|
|
7634
7664
|
const update = () => now.value = /* @__PURE__ */ new Date();
|
|
7635
7665
|
const controls = scheduler(update);
|
|
@@ -7662,16 +7692,7 @@ function useObjectUrl(object) {
|
|
|
7662
7692
|
}
|
|
7663
7693
|
//#endregion
|
|
7664
7694
|
//#region ../math/useClamp/index.ts
|
|
7665
|
-
|
|
7666
|
-
* Reactively clamp a value between two other values.
|
|
7667
|
-
*
|
|
7668
|
-
* @see https://vueuse.org/useClamp
|
|
7669
|
-
* @param value number
|
|
7670
|
-
* @param min
|
|
7671
|
-
* @param max
|
|
7672
|
-
*
|
|
7673
|
-
* @__NO_SIDE_EFFECTS__
|
|
7674
|
-
*/
|
|
7695
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
7675
7696
|
function useClamp(value, min, max) {
|
|
7676
7697
|
if (typeof value === "function" || isReadonly(value)) return computed(() => clamp(toValue(value), toValue(min), toValue(max)));
|
|
7677
7698
|
const _value = ref(value);
|
|
@@ -7688,9 +7709,9 @@ function useClamp(value, min, max) {
|
|
|
7688
7709
|
//#region useOffsetPagination/index.ts
|
|
7689
7710
|
function useOffsetPagination(options) {
|
|
7690
7711
|
const { total = Number.POSITIVE_INFINITY, pageSize = 10, page = 1, onPageChange = noop, onPageSizeChange = noop, onPageCountChange = noop } = options;
|
|
7691
|
-
const currentPageSize = useClamp(pageSize, 1, Number.POSITIVE_INFINITY);
|
|
7712
|
+
const currentPageSize = /* @__PURE__ */ useClamp(pageSize, 1, Number.POSITIVE_INFINITY);
|
|
7692
7713
|
const pageCount = computed(() => Math.max(1, Math.ceil(toValue(total) / toValue(currentPageSize))));
|
|
7693
|
-
const currentPage = useClamp(page, 1, pageCount);
|
|
7714
|
+
const currentPage = /* @__PURE__ */ useClamp(page, 1, pageCount);
|
|
7694
7715
|
const isFirstPage = computed(() => currentPage.value === 1);
|
|
7695
7716
|
const isLastPage = computed(() => currentPage.value === pageCount.value);
|
|
7696
7717
|
if (isRef(page)) syncRef(page, currentPage, { direction: isReadonly(page) ? "ltr" : "both" });
|
|
@@ -7949,7 +7970,7 @@ function usePointer(options = {}) {
|
|
|
7949
7970
|
"pointermove",
|
|
7950
7971
|
"pointerup"
|
|
7951
7972
|
], handler, listenerOptions);
|
|
7952
|
-
useEventListener(target, "pointerleave", () => isInside.value = false, listenerOptions);
|
|
7973
|
+
useEventListener(target, ["pointerleave", "pointercancel"], () => isInside.value = false, listenerOptions);
|
|
7953
7974
|
}
|
|
7954
7975
|
return {
|
|
7955
7976
|
...toRefs(state),
|
|
@@ -8461,15 +8482,16 @@ function useSorted(...args) {
|
|
|
8461
8482
|
const [source] = args;
|
|
8462
8483
|
let compareFn = defaultCompare;
|
|
8463
8484
|
let options = {};
|
|
8464
|
-
if (args.length === 2)
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8485
|
+
if (args.length === 2) {
|
|
8486
|
+
if (typeof args[1] === "object") {
|
|
8487
|
+
var _options$compareFn;
|
|
8488
|
+
options = args[1];
|
|
8489
|
+
compareFn = (_options$compareFn = options.compareFn) !== null && _options$compareFn !== void 0 ? _options$compareFn : defaultCompare;
|
|
8490
|
+
} else {
|
|
8491
|
+
var _args$;
|
|
8492
|
+
compareFn = (_args$ = args[1]) !== null && _args$ !== void 0 ? _args$ : defaultCompare;
|
|
8493
|
+
}
|
|
8494
|
+
} else if (args.length > 2) {
|
|
8473
8495
|
var _args$2, _args$3;
|
|
8474
8496
|
compareFn = (_args$2 = args[1]) !== null && _args$2 !== void 0 ? _args$2 : defaultCompare;
|
|
8475
8497
|
options = (_args$3 = args[2]) !== null && _args$3 !== void 0 ? _args$3 : {};
|
|
@@ -8947,6 +8969,60 @@ function useTemplateRefsList() {
|
|
|
8947
8969
|
return refs;
|
|
8948
8970
|
}
|
|
8949
8971
|
//#endregion
|
|
8972
|
+
//#region useTemporalNow/index.ts
|
|
8973
|
+
function resolveTemporal(custom) {
|
|
8974
|
+
if (custom) return custom;
|
|
8975
|
+
return typeof Temporal === "undefined" ? void 0 : Temporal;
|
|
8976
|
+
}
|
|
8977
|
+
function assertTemporal(impl) {
|
|
8978
|
+
if (!impl) throw new Error("[VueUse] No `Temporal` implementation found. See https://vueuse.org/useTemporalNow for details.");
|
|
8979
|
+
return impl;
|
|
8980
|
+
}
|
|
8981
|
+
/**
|
|
8982
|
+
* Reactive Temporal API with timezone and calendar support.
|
|
8983
|
+
*
|
|
8984
|
+
* @see https://vueuse.org/useTemporalNow
|
|
8985
|
+
* @param options - Configuration options
|
|
8986
|
+
*/
|
|
8987
|
+
function useTemporalNow(options = {}) {
|
|
8988
|
+
const { timezone: initialTimezone = "UTC", calendar: initialCalendar = "gregory", scheduler = useRafFn, temporal: customTemporal } = options;
|
|
8989
|
+
const TemporalImpl = assertTemporal(resolveTemporal(customTemporal));
|
|
8990
|
+
const timezone = shallowRef(initialTimezone);
|
|
8991
|
+
const calendar = shallowRef(initialCalendar);
|
|
8992
|
+
const now = shallowRef(TemporalImpl.Now.zonedDateTimeISO(timezone.value).withCalendar(calendar.value));
|
|
8993
|
+
function updateNow() {
|
|
8994
|
+
now.value = TemporalImpl.Now.zonedDateTimeISO(timezone.value).withCalendar(calendar.value);
|
|
8995
|
+
}
|
|
8996
|
+
const { isActive, pause, resume } = scheduler(updateNow);
|
|
8997
|
+
watch([timezone, calendar], updateNow);
|
|
8998
|
+
const toTimezone = (tz) => now.value.withTimeZone(tz);
|
|
8999
|
+
const toCalendar = (cal) => now.value.withCalendar(cal);
|
|
9000
|
+
const toPlainDate = () => now.value.toPlainDate();
|
|
9001
|
+
const toPlainTime = () => now.value.toPlainTime();
|
|
9002
|
+
const toPlainDateTime = () => now.value.toPlainDateTime();
|
|
9003
|
+
const format = (formatOptions) => now.value.toLocaleString(void 0, formatOptions);
|
|
9004
|
+
const add = (duration) => now.value.add(duration);
|
|
9005
|
+
const subtract = (duration) => now.value.subtract(duration);
|
|
9006
|
+
const compare = (other) => TemporalImpl.ZonedDateTime.compare(now.value, other);
|
|
9007
|
+
return {
|
|
9008
|
+
now,
|
|
9009
|
+
timezone,
|
|
9010
|
+
calendar,
|
|
9011
|
+
toTimezone,
|
|
9012
|
+
toCalendar,
|
|
9013
|
+
toPlainDate,
|
|
9014
|
+
toPlainTime,
|
|
9015
|
+
toPlainDateTime,
|
|
9016
|
+
format,
|
|
9017
|
+
add,
|
|
9018
|
+
subtract,
|
|
9019
|
+
compare,
|
|
9020
|
+
isActive,
|
|
9021
|
+
pause,
|
|
9022
|
+
resume
|
|
9023
|
+
};
|
|
9024
|
+
}
|
|
9025
|
+
//#endregion
|
|
8950
9026
|
//#region useTextDirection/index.ts
|
|
8951
9027
|
/**
|
|
8952
9028
|
* Reactive dir of the element's text.
|
|
@@ -9140,23 +9216,10 @@ const DEFAULT_MESSAGES = {
|
|
|
9140
9216
|
function DEFAULT_FORMATTER(date) {
|
|
9141
9217
|
return date.toISOString().slice(0, 10);
|
|
9142
9218
|
}
|
|
9143
|
-
|
|
9144
|
-
if ("updateInterval" in options) {
|
|
9145
|
-
const { updateInterval = 3e4 } = options;
|
|
9146
|
-
return (cb) => useIntervalFn(cb, updateInterval);
|
|
9147
|
-
}
|
|
9148
|
-
return (cb) => useIntervalFn(cb, 3e4);
|
|
9149
|
-
}
|
|
9150
|
-
/**
|
|
9151
|
-
* Reactive time ago formatter.
|
|
9152
|
-
*
|
|
9153
|
-
* @see https://vueuse.org/useTimeAgo
|
|
9154
|
-
*
|
|
9155
|
-
* @__NO_SIDE_EFFECTS__
|
|
9156
|
-
*/
|
|
9219
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
9157
9220
|
function useTimeAgo(time, options = {}) {
|
|
9158
|
-
const { controls: exposeControls = false, scheduler =
|
|
9159
|
-
const { now, ...controls } = useNow({
|
|
9221
|
+
const { controls: exposeControls = false, scheduler = (cb) => useIntervalFn(cb, 3e4) } = options;
|
|
9222
|
+
const { now, ...controls } = /* @__PURE__ */ useNow({
|
|
9160
9223
|
scheduler,
|
|
9161
9224
|
controls: true
|
|
9162
9225
|
});
|
|
@@ -9231,16 +9294,9 @@ const UNITS = [
|
|
|
9231
9294
|
ms: 1e3
|
|
9232
9295
|
}
|
|
9233
9296
|
];
|
|
9234
|
-
function getDefaultScheduler$3(options) {
|
|
9235
|
-
if ("updateInterval" in options) {
|
|
9236
|
-
const { updateInterval = 3e4 } = options;
|
|
9237
|
-
return (cb) => useIntervalFn(cb, updateInterval);
|
|
9238
|
-
}
|
|
9239
|
-
return (cb) => useIntervalFn(cb, 3e4);
|
|
9240
|
-
}
|
|
9241
9297
|
function useTimeAgoIntl(time, options = {}) {
|
|
9242
|
-
const { controls: exposeControls = false, scheduler =
|
|
9243
|
-
const { now, ...controls } = useNow({
|
|
9298
|
+
const { controls: exposeControls = false, scheduler = (cb) => useIntervalFn(cb, 3e4) } = options;
|
|
9299
|
+
const { now, ...controls } = /* @__PURE__ */ useNow({
|
|
9244
9300
|
scheduler,
|
|
9245
9301
|
controls: true
|
|
9246
9302
|
});
|
|
@@ -9326,15 +9382,8 @@ function useTimeoutPoll(fn, interval, options = {}) {
|
|
|
9326
9382
|
}
|
|
9327
9383
|
//#endregion
|
|
9328
9384
|
//#region useTimestamp/index.ts
|
|
9329
|
-
function getDefaultScheduler$2(options) {
|
|
9330
|
-
if ("interval" in options || "immediate" in options) {
|
|
9331
|
-
const { interval = "requestAnimationFrame", immediate = true } = options;
|
|
9332
|
-
return interval === "requestAnimationFrame" ? (cb) => useRafFn(cb, { immediate }) : (cb) => useIntervalFn(cb, interval, { immediate });
|
|
9333
|
-
}
|
|
9334
|
-
return useRafFn;
|
|
9335
|
-
}
|
|
9336
9385
|
function useTimestamp(options = {}) {
|
|
9337
|
-
const { controls: exposeControls = false, offset = 0, scheduler =
|
|
9386
|
+
const { controls: exposeControls = false, offset = 0, scheduler = useRafFn, callback } = options;
|
|
9338
9387
|
const ts = shallowRef(timestamp() + offset);
|
|
9339
9388
|
const update = () => ts.value = timestamp() + offset;
|
|
9340
9389
|
const controls = scheduler(callback ? () => {
|
|
@@ -9751,9 +9800,7 @@ function useUserMedia(options = {}) {
|
|
|
9751
9800
|
case "video":
|
|
9752
9801
|
if (constraints.value) return constraints.value.video || false;
|
|
9753
9802
|
break;
|
|
9754
|
-
case "audio":
|
|
9755
|
-
if (constraints.value) return constraints.value.audio || false;
|
|
9756
|
-
break;
|
|
9803
|
+
case "audio": if (constraints.value) return constraints.value.audio || false;
|
|
9757
9804
|
}
|
|
9758
9805
|
}
|
|
9759
9806
|
async function _start() {
|
|
@@ -9808,17 +9855,7 @@ function useUserMedia(options = {}) {
|
|
|
9808
9855
|
}
|
|
9809
9856
|
//#endregion
|
|
9810
9857
|
//#region useVModel/index.ts
|
|
9811
|
-
|
|
9812
|
-
* Shorthand for v-model binding, props + emit -> ref
|
|
9813
|
-
*
|
|
9814
|
-
* @see https://vueuse.org/useVModel
|
|
9815
|
-
* @param props
|
|
9816
|
-
* @param key (default 'modelValue')
|
|
9817
|
-
* @param emit
|
|
9818
|
-
* @param options
|
|
9819
|
-
*
|
|
9820
|
-
* @__NO_SIDE_EFFECTS__
|
|
9821
|
-
*/
|
|
9858
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
9822
9859
|
function useVModel(props, key, emit, options = {}) {
|
|
9823
9860
|
var _vm$$emit, _vm$proxy;
|
|
9824
9861
|
const { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options;
|
|
@@ -9835,7 +9872,8 @@ function useVModel(props, key, emit, options = {}) {
|
|
|
9835
9872
|
} else _emit(event, value);
|
|
9836
9873
|
};
|
|
9837
9874
|
if (passive) {
|
|
9838
|
-
const
|
|
9875
|
+
const initialValue = getValue();
|
|
9876
|
+
const proxy = ref(initialValue);
|
|
9839
9877
|
let isUpdating = false;
|
|
9840
9878
|
watch(() => props[key], (v) => {
|
|
9841
9879
|
if (!isUpdating) {
|
|
@@ -9859,31 +9897,14 @@ function useVModel(props, key, emit, options = {}) {
|
|
|
9859
9897
|
}
|
|
9860
9898
|
//#endregion
|
|
9861
9899
|
//#region useVModels/index.ts
|
|
9862
|
-
|
|
9863
|
-
* Shorthand for props v-model binding. Think like `toRefs(props)` but changes will also emit out.
|
|
9864
|
-
*
|
|
9865
|
-
* @see https://vueuse.org/useVModels
|
|
9866
|
-
* @param props
|
|
9867
|
-
* @param emit
|
|
9868
|
-
* @param options
|
|
9869
|
-
*
|
|
9870
|
-
* @__NO_SIDE_EFFECTS__
|
|
9871
|
-
*/
|
|
9900
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
9872
9901
|
function useVModels(props, emit, options = {}) {
|
|
9873
9902
|
const ret = {};
|
|
9874
|
-
for (const key in props) ret[key] = useVModel(props, key, emit, options);
|
|
9903
|
+
for (const key in props) ret[key] = /* @__PURE__ */ useVModel(props, key, emit, options);
|
|
9875
9904
|
return ret;
|
|
9876
9905
|
}
|
|
9877
9906
|
//#endregion
|
|
9878
9907
|
//#region useVibrate/index.ts
|
|
9879
|
-
function getDefaultScheduler$1(options = {}) {
|
|
9880
|
-
const { interval = 0 } = options;
|
|
9881
|
-
if (interval === 0) return;
|
|
9882
|
-
return (fn) => useIntervalFn(fn, interval, {
|
|
9883
|
-
immediate: false,
|
|
9884
|
-
immediateCallback: false
|
|
9885
|
-
});
|
|
9886
|
-
}
|
|
9887
9908
|
/**
|
|
9888
9909
|
* Reactive vibrate
|
|
9889
9910
|
*
|
|
@@ -9894,7 +9915,7 @@ function getDefaultScheduler$1(options = {}) {
|
|
|
9894
9915
|
* @__NO_SIDE_EFFECTS__
|
|
9895
9916
|
*/
|
|
9896
9917
|
function useVibrate(options) {
|
|
9897
|
-
const { pattern = [], scheduler
|
|
9918
|
+
const { pattern = [], scheduler, navigator = defaultNavigator } = options || {};
|
|
9898
9919
|
const isSupported = /* @__PURE__ */ useSupported(() => typeof navigator !== "undefined" && "vibrate" in navigator);
|
|
9899
9920
|
const patternRef = toRef(pattern);
|
|
9900
9921
|
const vibrate = (pattern = patternRef.value) => {
|
|
@@ -10169,6 +10190,117 @@ function useWakeLock(options = {}) {
|
|
|
10169
10190
|
};
|
|
10170
10191
|
}
|
|
10171
10192
|
//#endregion
|
|
10193
|
+
//#region useWebMCP/index.ts
|
|
10194
|
+
function safeStringify(value) {
|
|
10195
|
+
try {
|
|
10196
|
+
return JSON.stringify(value);
|
|
10197
|
+
} catch (_unused) {
|
|
10198
|
+
return String(value);
|
|
10199
|
+
}
|
|
10200
|
+
}
|
|
10201
|
+
function toToolResponse(value) {
|
|
10202
|
+
if (value && typeof value === "object" && Array.isArray(value.content)) return value;
|
|
10203
|
+
if (value === void 0 || value === null) return { content: [] };
|
|
10204
|
+
if (typeof value === "string") return { content: [{
|
|
10205
|
+
type: "text",
|
|
10206
|
+
text: value
|
|
10207
|
+
}] };
|
|
10208
|
+
return { content: [{
|
|
10209
|
+
type: "text",
|
|
10210
|
+
text: safeStringify(value)
|
|
10211
|
+
}] };
|
|
10212
|
+
}
|
|
10213
|
+
function toErrorResponse(error) {
|
|
10214
|
+
return {
|
|
10215
|
+
content: [{
|
|
10216
|
+
type: "text",
|
|
10217
|
+
text: error instanceof Error ? error.message : typeof error === "string" ? error : safeStringify(error)
|
|
10218
|
+
}],
|
|
10219
|
+
isError: true
|
|
10220
|
+
};
|
|
10221
|
+
}
|
|
10222
|
+
/**
|
|
10223
|
+
* Register a [WebMCP](https://github.com/webmachinelearning/webmcp) tool and
|
|
10224
|
+
* tie its lifecycle to the current scope.
|
|
10225
|
+
*
|
|
10226
|
+
* The tool is registered when the composable runs (and whenever a discoverable
|
|
10227
|
+
* part — `name`, `description`, `inputSchema`, `annotations` or `enabled` —
|
|
10228
|
+
* changes) and unregistered automatically on scope dispose, so the tools an
|
|
10229
|
+
* agent sees stay in lockstep with what is on screen. Call it multiple times to
|
|
10230
|
+
* register multiple tools.
|
|
10231
|
+
*
|
|
10232
|
+
* The API is experimental (`document.modelContext`), so this feature-detects
|
|
10233
|
+
* and degrades to a no-op wherever it is absent.
|
|
10234
|
+
*
|
|
10235
|
+
* @see https://vueuse.org/useWebMCP
|
|
10236
|
+
* @see https://github.com/webmachinelearning/webmcp
|
|
10237
|
+
*/
|
|
10238
|
+
function useWebMCP(options) {
|
|
10239
|
+
const { document = defaultDocument, enabled = true } = options;
|
|
10240
|
+
const doc = document;
|
|
10241
|
+
const isSupported = /* @__PURE__ */ useSupported(() => {
|
|
10242
|
+
var _doc$modelContext;
|
|
10243
|
+
return typeof (doc === null || doc === void 0 || (_doc$modelContext = doc.modelContext) === null || _doc$modelContext === void 0 ? void 0 : _doc$modelContext.registerTool) === "function";
|
|
10244
|
+
});
|
|
10245
|
+
const isRegistered = shallowRef(false);
|
|
10246
|
+
const error = shallowRef(null);
|
|
10247
|
+
let controller;
|
|
10248
|
+
function cleanup() {
|
|
10249
|
+
controller === null || controller === void 0 || controller.abort();
|
|
10250
|
+
controller = void 0;
|
|
10251
|
+
isRegistered.value = false;
|
|
10252
|
+
}
|
|
10253
|
+
function register() {
|
|
10254
|
+
cleanup();
|
|
10255
|
+
error.value = null;
|
|
10256
|
+
if (!isSupported.value || !toValue(enabled)) return;
|
|
10257
|
+
controller = new AbortController();
|
|
10258
|
+
try {
|
|
10259
|
+
doc.modelContext.registerTool({
|
|
10260
|
+
name: toValue(options.name),
|
|
10261
|
+
description: toValue(options.description),
|
|
10262
|
+
inputSchema: toValue(options.inputSchema),
|
|
10263
|
+
annotations: toValue(options.annotations),
|
|
10264
|
+
async execute(args) {
|
|
10265
|
+
try {
|
|
10266
|
+
const result = await options.execute(args);
|
|
10267
|
+
const shaped = options.formatOutput ? options.formatOutput(result, args) : result;
|
|
10268
|
+
if (shaped instanceof Error) throw shaped;
|
|
10269
|
+
return toToolResponse(shaped);
|
|
10270
|
+
} catch (err) {
|
|
10271
|
+
try {
|
|
10272
|
+
var _options$onError;
|
|
10273
|
+
(_options$onError = options.onError) === null || _options$onError === void 0 || _options$onError.call(options, err);
|
|
10274
|
+
} catch (_unused2) {}
|
|
10275
|
+
return toErrorResponse(err);
|
|
10276
|
+
}
|
|
10277
|
+
}
|
|
10278
|
+
}, { signal: controller.signal });
|
|
10279
|
+
isRegistered.value = true;
|
|
10280
|
+
} catch (err) {
|
|
10281
|
+
error.value = err instanceof Error ? err : new Error(safeStringify(err));
|
|
10282
|
+
isRegistered.value = false;
|
|
10283
|
+
}
|
|
10284
|
+
}
|
|
10285
|
+
watch([
|
|
10286
|
+
isSupported,
|
|
10287
|
+
() => toValue(options.name),
|
|
10288
|
+
() => toValue(options.description),
|
|
10289
|
+
() => toValue(options.inputSchema) ? safeStringify(toValue(options.inputSchema)) : "",
|
|
10290
|
+
() => toValue(options.annotations) ? safeStringify(toValue(options.annotations)) : "",
|
|
10291
|
+
() => toValue(enabled)
|
|
10292
|
+
], register, {
|
|
10293
|
+
immediate: true,
|
|
10294
|
+
flush: "post"
|
|
10295
|
+
});
|
|
10296
|
+
tryOnScopeDispose(cleanup);
|
|
10297
|
+
return {
|
|
10298
|
+
isSupported,
|
|
10299
|
+
isRegistered,
|
|
10300
|
+
error
|
|
10301
|
+
};
|
|
10302
|
+
}
|
|
10303
|
+
//#endregion
|
|
10172
10304
|
//#region useWebNotification/index.ts
|
|
10173
10305
|
/**
|
|
10174
10306
|
* Reactive useWebNotification
|
|
@@ -10248,13 +10380,6 @@ function resolveNestedOptions(options) {
|
|
|
10248
10380
|
if (options === true) return {};
|
|
10249
10381
|
return options;
|
|
10250
10382
|
}
|
|
10251
|
-
function getDefaultScheduler(options) {
|
|
10252
|
-
if ("interval" in options) {
|
|
10253
|
-
const { interval = 1e3 } = options;
|
|
10254
|
-
return (cb) => useIntervalFn(cb, interval, { immediate: false });
|
|
10255
|
-
}
|
|
10256
|
-
return (cb) => useIntervalFn(cb, 1e3, { immediate: false });
|
|
10257
|
-
}
|
|
10258
10383
|
/**
|
|
10259
10384
|
* Reactive WebSocket client.
|
|
10260
10385
|
*
|
|
@@ -10340,6 +10465,7 @@ function useWebSocket(url, options = {}) {
|
|
|
10340
10465
|
onError === null || onError === void 0 || onError(ws, e);
|
|
10341
10466
|
};
|
|
10342
10467
|
ws.onmessage = (e) => {
|
|
10468
|
+
if (wsRef.value !== ws) return;
|
|
10343
10469
|
if (options.heartbeat) {
|
|
10344
10470
|
resetHeartbeat();
|
|
10345
10471
|
const { message = DEFAULT_PING_MESSAGE, responseMessage = message } = resolveNestedOptions(options.heartbeat);
|
|
@@ -10350,7 +10476,7 @@ function useWebSocket(url, options = {}) {
|
|
|
10350
10476
|
};
|
|
10351
10477
|
};
|
|
10352
10478
|
if (options.heartbeat) {
|
|
10353
|
-
const { message = DEFAULT_PING_MESSAGE, scheduler =
|
|
10479
|
+
const { message = DEFAULT_PING_MESSAGE, scheduler = (cb) => useIntervalFn(cb, 1e3, { immediate: false }), pongTimeout = 1e3 } = resolveNestedOptions(options.heartbeat);
|
|
10354
10480
|
const { pause, resume } = scheduler(() => {
|
|
10355
10481
|
send(toValue(message), false);
|
|
10356
10482
|
if (pongTimeoutWait != null) return;
|
|
@@ -10531,7 +10657,6 @@ function useWebWorkerFn(fn, options = {}) {
|
|
|
10531
10657
|
default:
|
|
10532
10658
|
reject(result);
|
|
10533
10659
|
workerTerminate("ERROR");
|
|
10534
|
-
break;
|
|
10535
10660
|
}
|
|
10536
10661
|
};
|
|
10537
10662
|
newWorker.onerror = (e) => {
|
|
@@ -10614,19 +10739,21 @@ function useWindowSize(options = {}) {
|
|
|
10614
10739
|
const width = shallowRef(initialWidth);
|
|
10615
10740
|
const height = shallowRef(initialHeight);
|
|
10616
10741
|
const update = () => {
|
|
10617
|
-
if (window)
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10742
|
+
if (window) {
|
|
10743
|
+
if (type === "outer") {
|
|
10744
|
+
width.value = window.outerWidth;
|
|
10745
|
+
height.value = window.outerHeight;
|
|
10746
|
+
} else if (type === "visual" && window.visualViewport) {
|
|
10747
|
+
const { width: visualViewportWidth, height: visualViewportHeight, scale } = window.visualViewport;
|
|
10748
|
+
width.value = Math.round(visualViewportWidth * scale);
|
|
10749
|
+
height.value = Math.round(visualViewportHeight * scale);
|
|
10750
|
+
} else if (includeScrollbar) {
|
|
10751
|
+
width.value = window.innerWidth;
|
|
10752
|
+
height.value = window.innerHeight;
|
|
10753
|
+
} else {
|
|
10754
|
+
width.value = window.document.documentElement.clientWidth;
|
|
10755
|
+
height.value = window.document.documentElement.clientHeight;
|
|
10756
|
+
}
|
|
10630
10757
|
}
|
|
10631
10758
|
};
|
|
10632
10759
|
update();
|
|
@@ -10634,11 +10761,14 @@ function useWindowSize(options = {}) {
|
|
|
10634
10761
|
const listenerOptions = { passive: true };
|
|
10635
10762
|
useEventListener("resize", update, listenerOptions);
|
|
10636
10763
|
if (window && type === "visual" && window.visualViewport) useEventListener(window.visualViewport, "resize", update, listenerOptions);
|
|
10637
|
-
if (listenOrientation)
|
|
10764
|
+
if (listenOrientation) {
|
|
10765
|
+
const matches = useMediaQuery("(orientation: portrait)");
|
|
10766
|
+
watch(matches, () => update());
|
|
10767
|
+
}
|
|
10638
10768
|
return {
|
|
10639
10769
|
width,
|
|
10640
10770
|
height
|
|
10641
10771
|
};
|
|
10642
10772
|
}
|
|
10643
10773
|
|
|
10644
|
-
export { DefaultMagicKeysAliasMap, StorageSerializers, TransitionPresets, assert, asyncComputed, autoResetRef, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsElement, breakpointsMasterCss, breakpointsPrimeFlex, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, breakpointsVuetifyV2, breakpointsVuetifyV3, bypassFilter, camelize, clamp, cloneFnJSON, computedAsync, computedEager, computedInject, computedWithControl, containsProp, controlledComputed, controlledRef, createDisposableDirective, createEventHook, createFetch, createFilterWrapper, createGlobalState, createInjectionState, createReactiveFn, createRef, createReusableTemplate, createSharedComposable, createSingletonPromise, createTemplatePromise, createUnrefFn, customStorageEventName, debounceFilter, debouncedRef, debouncedWatch, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, eagerComputed, executeTransition, extendRef, formatDate, formatTimeAgo, formatTimeAgoIntl, formatTimeAgoIntlParts, get, getLifeCycleTarget, getSSRHandler, hasOwn, hyphenate, identity, ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isFocusedElementEditable, isIOS, isObject, isTypedCharValid, isWorker, makeDestructurable, mapGamepadToXbox360Controller, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, onClickOutside, onElementRemoval, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, pausableFilter, pausableWatch, promiseTimeout, provideLocal, provideSSRWidth, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refManualReset, refThrottled, refWithControl, set, setSSRHandler, syncRef, syncRefs,
|
|
10774
|
+
export { DefaultMagicKeysAliasMap, StorageSerializers, TransitionPresets, assert, asyncComputed, autoResetRef, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsElement, breakpointsMasterCss, breakpointsPrimeFlex, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, breakpointsVuetifyV2, breakpointsVuetifyV3, bypassFilter, camelize, clamp, cloneFnJSON, computedAsync, computedEager, computedInject, computedWithControl, containsProp, controlledComputed, controlledRef, createDisposableDirective, createEventHook, createFetch, createFilterWrapper, createGlobalState, createInjectionState, createReactiveFn, createRef, createReusableTemplate, createSharedComposable, createSingletonPromise, createTemplatePromise, createUnrefFn, customStorageEventName, debounceFilter, debouncedRef, debouncedWatch, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, eagerComputed, executeTransition, extendRef, formatDate, formatTimeAgo, formatTimeAgoIntl, formatTimeAgoIntlParts, get, getLifeCycleTarget, getSSRHandler, hasOwn, hyphenate, identity, ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isFocusedElementEditable, isIOS, isObject, isTypedCharValid, isWorker, makeDestructurable, mapGamepadToXbox360Controller, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, onClickOutside, onElementRemoval, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, pausableFilter, pausableWatch, promiseTimeout, provideLocal, provideSSRWidth, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refManualReset, refThrottled, refWithControl, set, setSSRHandler, syncRef, syncRefs, throttleFilter, throttledRef, throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, transition, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, unrefElement, until, useActiveElement, useAnimate, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useClipboardItems, useCloned, useColorMode, useConfirmDialog, useCountdown, useCounter, useCssSupports, useCssVar, useCurrentElement, useCycleList, useDark, useDateFormat, useDebounce, useDebounceFn, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementOverflow, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useInterval, useIntervalFn, useKeyModifier, useLastChanged, useLiveAnnouncer, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, useParentElement, usePerformanceObserver, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePreferredReducedTransparency, usePrevious, useRafFn, useRefHistory, useResizeObserver, useSSRWidth, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTemporalNow, useTextDirection, useTextSelection, useTextareaAutosize, useThrottle, useThrottleFn, useThrottledRefHistory, useTimeAgo, useTimeAgoIntl, useTimeout, useTimeoutFn, useTimeoutPoll, useTimestamp, useTitle, useToNumber, useToString, useToggle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebMCP, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };
|