@vitejs/devtools 0.0.0-alpha.6 → 0.0.0-alpha.7

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.
@@ -2279,10 +2279,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
2279
2279
  if (prepend) hooks.unshift(wrappedHook);
2280
2280
  else hooks.push(wrappedHook);
2281
2281
  return wrappedHook;
2282
- } else if (!!(process.env.NODE_ENV !== "production")) {
2283
- const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
2284
- warn$1(`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`);
2285
- }
2282
+ } else if (!!(process.env.NODE_ENV !== "production")) warn$1(`${toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`);
2286
2283
  }
2287
2284
  const createHook = (lifecycle) => (hook, target = currentInstance) => {
2288
2285
  if (!isInSSRComponentSetup || lifecycle === "sp") injectHook(lifecycle, (...args) => hook(...args), target);
@@ -2582,12 +2579,11 @@ function applyOptions(instance) {
2582
2579
  const opt = computedOptions[key];
2583
2580
  const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
2584
2581
  if (!!(process.env.NODE_ENV !== "production") && get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
2585
- const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : !!(process.env.NODE_ENV !== "production") ? () => {
2586
- warn$1(`Write operation failed: computed property "${key}" is readonly.`);
2587
- } : NOOP;
2588
2582
  const c = computed({
2589
2583
  get,
2590
- set
2584
+ set: !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : !!(process.env.NODE_ENV !== "production") ? () => {
2585
+ warn$1(`Write operation failed: computed property "${key}" is readonly.`);
2586
+ } : NOOP
2591
2587
  });
2592
2588
  Object.defineProperty(ctx, key, {
2593
2589
  enumerable: true,
@@ -3436,10 +3432,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3436
3432
  }
3437
3433
  };
3438
3434
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
3439
- for (let i = start; i < children.length; i++) {
3440
- const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
3441
- patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3442
- }
3435
+ for (let i = start; i < children.length; i++) patch(null, children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3443
3436
  };
3444
3437
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
3445
3438
  const el = n2.el = n1.el;
@@ -3493,8 +3486,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3493
3486
  for (let i = 0; i < newChildren.length; i++) {
3494
3487
  const oldVNode = oldChildren[i];
3495
3488
  const newVNode = newChildren[i];
3496
- const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
3497
- patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
3489
+ patch(oldVNode, newVNode, oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
3498
3490
  }
3499
3491
  };
3500
3492
  const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
@@ -4871,10 +4863,7 @@ function setupStatefulComponent(instance, isSSR) {
4871
4863
  });
4872
4864
  else {
4873
4865
  instance.asyncDep = setupResult;
4874
- if (!!(process.env.NODE_ENV !== "production") && !instance.suspense) {
4875
- const name = (_a = Component.name) != null ? _a : "Anonymous";
4876
- warn$1(`Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`);
4877
- }
4866
+ if (!!(process.env.NODE_ENV !== "production") && !instance.suspense) warn$1(`Component <${(_a = Component.name) != null ? _a : "Anonymous"}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`);
4878
4867
  }
4879
4868
  } else handleSetupResult(instance, setupResult, isSSR);
4880
4869
  } else finishComponentSetup(instance, isSSR);
@@ -5413,10 +5402,8 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
5413
5402
  if (nextValue && existingInvoker) existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue;
5414
5403
  else {
5415
5404
  const [name, options] = parseName(rawName);
5416
- if (nextValue) {
5417
- const invoker = invokers[rawName] = createInvoker(!!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue, instance);
5418
- addEventListener(el, name, invoker, options);
5419
- } else if (existingInvoker) {
5405
+ if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(!!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue, instance), options);
5406
+ else if (existingInvoker) {
5420
5407
  removeEventListener(el, name, existingInvoker, options);
5421
5408
  invokers[rawName] = void 0;
5422
5409
  }
@@ -5930,21 +5917,38 @@ function initDev() {
5930
5917
  if (!!(process.env.NODE_ENV !== "production")) initDev();
5931
5918
 
5932
5919
  //#endregion
5933
- //#region ../../node_modules/.pnpm/@vueuse+shared@13.9.0_vue@3.5.22_typescript@5.9.3_/node_modules/@vueuse/shared/index.mjs
5934
- function tryOnScopeDispose(fn) {
5920
+ //#region ../../node_modules/.pnpm/@vueuse+shared@14.0.0_vue@3.5.22_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js
5921
+ /**
5922
+ * Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
5923
+ *
5924
+ * @param fn
5925
+ */
5926
+ function tryOnScopeDispose(fn, failSilently) {
5935
5927
  if (getCurrentScope()) {
5936
- onScopeDispose(fn);
5928
+ onScopeDispose(fn, failSilently);
5937
5929
  return true;
5938
5930
  }
5939
5931
  return false;
5940
5932
  }
5941
5933
  const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
5942
- const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {
5943
- var _a;
5934
+ /**
5935
+ * On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.
5936
+ *
5937
+ * @example
5938
+ * ```ts
5939
+ * injectLocal('MyInjectionKey', 1)
5940
+ * const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1
5941
+ * ```
5942
+ *
5943
+ * @__NO_SIDE_EFFECTS__
5944
+ */
5945
+ const injectLocal = (...args) => {
5946
+ var _getCurrentInstance;
5944
5947
  const key = args[0];
5945
- const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
5946
- if (instance == null && !hasInjectionContext()) throw new Error("injectLocal must be called in setup");
5947
- if (instance && localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance)) return localProvidedStateMap.get(instance)[key];
5948
+ const instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;
5949
+ const owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();
5950
+ if (owner == null && !hasInjectionContext()) throw new Error("injectLocal must be called in setup");
5951
+ if (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];
5948
5952
  return inject(...args);
5949
5953
  };
5950
5954
  const isClient = typeof window !== "undefined" && typeof document !== "undefined";
@@ -5961,6 +5965,9 @@ function toRef(...args) {
5961
5965
  set: noop
5962
5966
  }))) : ref(r);
5963
5967
  }
5968
+ /**
5969
+ * @internal
5970
+ */
5964
5971
  function createFilterWrapper(filter, fn) {
5965
5972
  function wrapper(...args) {
5966
5973
  return new Promise((resolve, reject) => {
@@ -5973,20 +5980,23 @@ function createFilterWrapper(filter, fn) {
5973
5980
  }
5974
5981
  return wrapper;
5975
5982
  }
5976
- const bypassFilter = (invoke) => {
5977
- return invoke();
5983
+ const bypassFilter = (invoke$1) => {
5984
+ return invoke$1();
5978
5985
  };
5986
+ /**
5987
+ * Create an EventFilter that debounce the events
5988
+ */
5979
5989
  function debounceFilter(ms, options = {}) {
5980
5990
  let timer;
5981
5991
  let maxTimer;
5982
5992
  let lastRejector = noop;
5983
- const _clearTimeout = (timer2) => {
5984
- clearTimeout(timer2);
5993
+ const _clearTimeout = (timer$1) => {
5994
+ clearTimeout(timer$1);
5985
5995
  lastRejector();
5986
5996
  lastRejector = noop;
5987
5997
  };
5988
5998
  let lastInvoker;
5989
- const filter = (invoke) => {
5999
+ const filter = (invoke$1) => {
5990
6000
  const duration = toValue(ms);
5991
6001
  const maxDuration = toValue(options.maxWait);
5992
6002
  if (timer) _clearTimeout(timer);
@@ -5995,11 +6005,11 @@ function debounceFilter(ms, options = {}) {
5995
6005
  _clearTimeout(maxTimer);
5996
6006
  maxTimer = void 0;
5997
6007
  }
5998
- return Promise.resolve(invoke());
6008
+ return Promise.resolve(invoke$1());
5999
6009
  }
6000
6010
  return new Promise((resolve, reject) => {
6001
6011
  lastRejector = options.rejectOnCancel ? reject : resolve;
6002
- lastInvoker = invoke;
6012
+ lastInvoker = invoke$1;
6003
6013
  if (maxDuration && !maxTimer) maxTimer = setTimeout(() => {
6004
6014
  if (timer) _clearTimeout(timer);
6005
6015
  maxTimer = void 0;
@@ -6008,12 +6018,18 @@ function debounceFilter(ms, options = {}) {
6008
6018
  timer = setTimeout(() => {
6009
6019
  if (maxTimer) _clearTimeout(maxTimer);
6010
6020
  maxTimer = void 0;
6011
- resolve(invoke());
6021
+ resolve(invoke$1());
6012
6022
  }, duration);
6013
6023
  });
6014
6024
  };
6015
6025
  return filter;
6016
6026
  }
6027
+ /**
6028
+ * EventFilter that gives extra controls to pause and resume the filter
6029
+ *
6030
+ * @param extendFilter Extra filter to apply when the PausableFilter is active, default to none
6031
+ * @param options Options to configure the filter
6032
+ */
6017
6033
  function pausableFilter(extendFilter = bypassFilter, options = {}) {
6018
6034
  const { initialState = "active" } = options;
6019
6035
  const isActive = toRef(initialState === "active");
@@ -6033,6 +6049,9 @@ function pausableFilter(extendFilter = bypassFilter, options = {}) {
6033
6049
  eventFilter
6034
6050
  };
6035
6051
  }
6052
+ /**
6053
+ * Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client
6054
+ */
6036
6055
  function pxValue(px) {
6037
6056
  return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
6038
6057
  }
@@ -6040,10 +6059,10 @@ function toArray(value) {
6040
6059
  return Array.isArray(value) ? value : [value];
6041
6060
  }
6042
6061
  function cacheStringFunction(fn) {
6043
- const cache = /* @__PURE__ */ Object.create(null);
6044
- return (str) => {
6062
+ const cache = Object.create(null);
6063
+ return ((str) => {
6045
6064
  return cache[str] || (cache[str] = fn(str));
6046
- };
6065
+ });
6047
6066
  }
6048
6067
  const hyphenateRE = /\B([A-Z])/g;
6049
6068
  const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
@@ -6054,7 +6073,18 @@ const camelize = cacheStringFunction((str) => {
6054
6073
  function getLifeCycleTarget(target) {
6055
6074
  return target || getCurrentInstance();
6056
6075
  }
6057
- /* @__NO_SIDE_EFFECTS__ */
6076
+ /**
6077
+ * Debounce execution of a function.
6078
+ *
6079
+ * @see https://vueuse.org/useDebounceFn
6080
+ * @param fn A function to be executed after delay milliseconds debounced.
6081
+ * @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
6082
+ * @param options Options
6083
+ *
6084
+ * @return A new, debounce, function.
6085
+ *
6086
+ * @__NO_SIDE_EFFECTS__
6087
+ */
6058
6088
  function useDebounceFn(fn, ms = 200, options = {}) {
6059
6089
  return createFilterWrapper(debounceFilter(ms, options), fn);
6060
6090
  }
@@ -6075,6 +6105,15 @@ function watchPausable(source, cb, options = {}) {
6075
6105
  isActive
6076
6106
  };
6077
6107
  }
6108
+ /** @deprecated use `watchPausable` instead */
6109
+ const pausableWatch = watchPausable;
6110
+ /**
6111
+ * Extended `toRefs` that also accepts refs of an object.
6112
+ *
6113
+ * @see https://vueuse.org/toRefs
6114
+ * @param objectRef A ref or normal object or array.
6115
+ * @param options Options
6116
+ */
6078
6117
  function toRefs(objectRef, options = {}) {
6079
6118
  if (!isRef(objectRef)) return toRefs$1(objectRef);
6080
6119
  const result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};
@@ -6083,8 +6122,8 @@ function toRefs(objectRef, options = {}) {
6083
6122
  return objectRef.value[key];
6084
6123
  },
6085
6124
  set(v) {
6086
- var _a;
6087
- if ((_a = toValue(options.replaceRef)) != null ? _a : true) if (Array.isArray(objectRef.value)) {
6125
+ var _toValue;
6126
+ if ((_toValue = toValue(options.replaceRef)) !== null && _toValue !== void 0 ? _toValue : true) if (Array.isArray(objectRef.value)) {
6088
6127
  const copy = [...objectRef.value];
6089
6128
  copy[key] = v;
6090
6129
  objectRef.value = copy;
@@ -6101,11 +6140,23 @@ function toRefs(objectRef, options = {}) {
6101
6140
  }));
6102
6141
  return result;
6103
6142
  }
6143
+ /**
6144
+ * Call onMounted() if it's inside a component lifecycle, if not, just call the function
6145
+ *
6146
+ * @param fn
6147
+ * @param sync if set to false, it will run in the nextTick() of Vue
6148
+ * @param target
6149
+ */
6104
6150
  function tryOnMounted(fn, sync = true, target) {
6105
6151
  if (getLifeCycleTarget(target)) onMounted(fn, target);
6106
6152
  else if (sync) fn();
6107
6153
  else nextTick(fn);
6108
6154
  }
6155
+ /**
6156
+ * Shorthand for watching value with {immediate: true}
6157
+ *
6158
+ * @see https://vueuse.org/watchImmediate
6159
+ */
6109
6160
  function watchImmediate(source, cb, options) {
6110
6161
  return watch(source, cb, {
6111
6162
  ...options,
@@ -6114,15 +6165,20 @@ function watchImmediate(source, cb, options) {
6114
6165
  }
6115
6166
 
6116
6167
  //#endregion
6117
- //#region ../../node_modules/.pnpm/@vueuse+core@13.9.0_vue@3.5.22_typescript@5.9.3_/node_modules/@vueuse/core/index.mjs
6168
+ //#region ../../node_modules/.pnpm/@vueuse+core@14.0.0_vue@3.5.22_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js
6118
6169
  const defaultWindow = isClient ? window : void 0;
6119
6170
  const defaultDocument = isClient ? window.document : void 0;
6120
6171
  const defaultNavigator = isClient ? window.navigator : void 0;
6121
6172
  const defaultLocation = isClient ? window.location : void 0;
6173
+ /**
6174
+ * Get the dom element of a ref of element or Vue component instance
6175
+ *
6176
+ * @param elRef
6177
+ */
6122
6178
  function unrefElement(elRef) {
6123
- var _a;
6179
+ var _$el;
6124
6180
  const plain = toValue(elRef);
6125
- return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
6181
+ return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;
6126
6182
  }
6127
6183
  function useEventListener(...args) {
6128
6184
  const cleanups = [];
@@ -6139,16 +6195,16 @@ function useEventListener(...args) {
6139
6195
  return test.every((e) => typeof e !== "string") ? test : void 0;
6140
6196
  });
6141
6197
  const stopWatch = watchImmediate(() => {
6142
- var _a, _b;
6198
+ var _firstParamTargets$va, _firstParamTargets$va2;
6143
6199
  return [
6144
- (_b = (_a = firstParamTargets.value) == null ? void 0 : _a.map((e) => unrefElement(e))) != null ? _b : [defaultWindow].filter((e) => e != null),
6200
+ (_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),
6145
6201
  toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
6146
6202
  toArray(unref(firstParamTargets.value ? args[2] : args[1])),
6147
6203
  toValue(firstParamTargets.value ? args[3] : args[2])
6148
6204
  ];
6149
6205
  }, ([raw_targets, raw_events, raw_listeners, raw_options]) => {
6150
6206
  cleanup();
6151
- if (!(raw_targets == null ? void 0 : raw_targets.length) || !(raw_events == null ? void 0 : raw_events.length) || !(raw_listeners == null ? void 0 : raw_listeners.length)) return;
6207
+ if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;
6152
6208
  const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
6153
6209
  cleanups.push(...raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone)))));
6154
6210
  }, { flush: "post" });
@@ -6159,7 +6215,13 @@ function useEventListener(...args) {
6159
6215
  tryOnScopeDispose(cleanup);
6160
6216
  return stop$1;
6161
6217
  }
6162
- /* @__NO_SIDE_EFFECTS__ */
6218
+ /**
6219
+ * Mounted state in ref.
6220
+ *
6221
+ * @see https://vueuse.org/useMounted
6222
+ *
6223
+ * @__NO_SIDE_EFFECTS__
6224
+ */
6163
6225
  function useMounted() {
6164
6226
  const isMounted = shallowRef(false);
6165
6227
  const instance = getCurrentInstance();
@@ -6170,12 +6232,21 @@ function useMounted() {
6170
6232
  }
6171
6233
  /* @__NO_SIDE_EFFECTS__ */
6172
6234
  function useSupported(callback) {
6173
- const isMounted = /* @__PURE__ */ useMounted();
6235
+ const isMounted = useMounted();
6174
6236
  return computed(() => {
6175
6237
  isMounted.value;
6176
6238
  return Boolean(callback());
6177
6239
  });
6178
6240
  }
6241
+ /**
6242
+ * Watch for changes being made to the DOM tree.
6243
+ *
6244
+ * @see https://vueuse.org/useMutationObserver
6245
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver MutationObserver MDN
6246
+ * @param target
6247
+ * @param callback
6248
+ * @param options
6249
+ */
6179
6250
  function useMutationObserver(target, callback, options = {}) {
6180
6251
  const { window: window$1 = defaultWindow,...mutationOptions } = options;
6181
6252
  let observer;
@@ -6186,12 +6257,10 @@ function useMutationObserver(target, callback, options = {}) {
6186
6257
  observer = void 0;
6187
6258
  }
6188
6259
  };
6189
- const targets = computed(() => {
6190
- const value = toValue(target);
6191
- const items = toArray(value).map(unrefElement).filter(notNullish);
6260
+ const stopWatch = watch(computed(() => {
6261
+ const items = toArray(toValue(target)).map(unrefElement).filter(notNullish);
6192
6262
  return new Set(items);
6193
- });
6194
- const stopWatch = watch(targets, (newTargets) => {
6263
+ }), (newTargets) => {
6195
6264
  cleanup();
6196
6265
  if (isSupported$1.value && newTargets.size) {
6197
6266
  observer = new MutationObserver(callback);
@@ -6202,7 +6271,7 @@ function useMutationObserver(target, callback, options = {}) {
6202
6271
  flush: "post"
6203
6272
  });
6204
6273
  const takeRecords = () => {
6205
- return observer == null ? void 0 : observer.takeRecords();
6274
+ return observer === null || observer === void 0 ? void 0 : observer.takeRecords();
6206
6275
  };
6207
6276
  const stop$1 = () => {
6208
6277
  stopWatch();
@@ -6221,6 +6290,13 @@ function useSSRWidth() {
6221
6290
  const ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;
6222
6291
  return typeof ssrWidth === "number" ? ssrWidth : void 0;
6223
6292
  }
6293
+ /**
6294
+ * Reactive Media Query.
6295
+ *
6296
+ * @see https://vueuse.org/useMediaQuery
6297
+ * @param query
6298
+ * @param options
6299
+ */
6224
6300
  function useMediaQuery(query, options = {}) {
6225
6301
  const { window: window$1 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
6226
6302
  const isSupported$1 = /* @__PURE__ */ useSupported(() => window$1 && "matchMedia" in window$1 && typeof window$1.matchMedia === "function");
@@ -6299,26 +6375,28 @@ const StorageSerializers = {
6299
6375
  }
6300
6376
  };
6301
6377
  const customStorageEventName = "vueuse-storage";
6302
- function useStorage(key, defaults, storage, options = {}) {
6303
- var _a;
6378
+ /**
6379
+ * Reactive LocalStorage/SessionStorage.
6380
+ *
6381
+ * @see https://vueuse.org/useStorage
6382
+ */
6383
+ function useStorage(key, defaults$1, storage, options = {}) {
6384
+ var _options$serializer;
6304
6385
  const { flush = "pre", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window: window$1 = defaultWindow, eventFilter, onError = (e) => {
6305
6386
  console.error(e);
6306
6387
  }, initOnMounted } = options;
6307
- const data = (shallow ? shallowRef : ref)(typeof defaults === "function" ? defaults() : defaults);
6388
+ const data = (shallow ? shallowRef : ref)(typeof defaults$1 === "function" ? defaults$1() : defaults$1);
6308
6389
  const keyComputed = computed(() => toValue(key));
6309
6390
  if (!storage) try {
6310
- storage = getSSRHandler("getDefaultStorage", () => {
6311
- var _a2;
6312
- return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;
6313
- })();
6391
+ storage = getSSRHandler("getDefaultStorage", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();
6314
6392
  } catch (e) {
6315
6393
  onError(e);
6316
6394
  }
6317
6395
  if (!storage) return data;
6318
- const rawInit = toValue(defaults);
6396
+ const rawInit = toValue(defaults$1);
6319
6397
  const type = guessSerializerType(rawInit);
6320
- const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];
6321
- const { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, (newValue) => write(newValue), {
6398
+ const serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];
6399
+ const { pause: pauseWatch, resume: resumeWatch } = pausableWatch(data, (newValue) => write(newValue), {
6322
6400
  flush,
6323
6401
  deep,
6324
6402
  eventFilter
@@ -6333,6 +6411,12 @@ function useStorage(key, defaults, storage, options = {}) {
6333
6411
  if (initOnMounted && !firstMounted) return;
6334
6412
  updateFromCustomEvent(ev);
6335
6413
  };
6414
+ /**
6415
+ * The custom event is needed for same-document syncing when using custom
6416
+ * storage backends, but it doesn't work across different documents.
6417
+ *
6418
+ * TODO: Consider implementing a BroadcastChannel-based solution that fixes this.
6419
+ */
6336
6420
  if (window$1 && listenToStorageChanges) if (storage instanceof Storage) useEventListener(window$1, "storage", onStorageEvent, { passive: true });
6337
6421
  else useEventListener(window$1, customStorageEventName, onStorageCustomEvent);
6338
6422
  if (initOnMounted) tryOnMounted(() => {
@@ -6394,7 +6478,7 @@ function useStorage(key, defaults, storage, options = {}) {
6394
6478
  pauseWatch();
6395
6479
  try {
6396
6480
  const serializedData = serializer.write(data.value);
6397
- if (event === void 0 || (event == null ? void 0 : event.newValue) !== serializedData) data.value = read(event);
6481
+ if (event === void 0 || (event === null || event === void 0 ? void 0 : event.newValue) !== serializedData) data.value = read(event);
6398
6482
  } catch (e) {
6399
6483
  onError(e);
6400
6484
  } finally {
@@ -6407,18 +6491,28 @@ function useStorage(key, defaults, storage, options = {}) {
6407
6491
  }
6408
6492
  return data;
6409
6493
  }
6494
+ /**
6495
+ * Manipulate CSS variables.
6496
+ *
6497
+ * @see https://vueuse.org/useCssVar
6498
+ * @param prop
6499
+ * @param target
6500
+ * @param options
6501
+ */
6410
6502
  function useCssVar(prop, target, options = {}) {
6411
6503
  const { window: window$1 = defaultWindow, initialValue, observe = false } = options;
6412
6504
  const variable = shallowRef(initialValue);
6413
6505
  const elRef = computed(() => {
6414
- var _a;
6415
- return unrefElement(target) || ((_a = window$1 == null ? void 0 : window$1.document) == null ? void 0 : _a.documentElement);
6506
+ var _window$document;
6507
+ return unrefElement(target) || (window$1 === null || window$1 === void 0 || (_window$document = window$1.document) === null || _window$document === void 0 ? void 0 : _window$document.documentElement);
6416
6508
  });
6417
6509
  function updateCssVar() {
6418
- var _a;
6419
6510
  const key = toValue(prop);
6420
6511
  const el = toValue(elRef);
6421
- if (el && window$1 && key) variable.value = ((_a = window$1.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a.trim()) || variable.value || initialValue;
6512
+ if (el && window$1 && key) {
6513
+ var _window$getComputedSt;
6514
+ variable.value = ((_window$getComputedSt = window$1.getComputedStyle(el).getPropertyValue(key)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.trim()) || variable.value || initialValue;
6515
+ }
6422
6516
  }
6423
6517
  if (observe) useMutationObserver(elRef, updateCssVar, {
6424
6518
  attributeFilter: ["style", "class"],
@@ -6430,11 +6524,19 @@ function useCssVar(prop, target, options = {}) {
6430
6524
  }, { immediate: true });
6431
6525
  watch([variable, elRef], ([val, el]) => {
6432
6526
  const raw_prop = toValue(prop);
6433
- if ((el == null ? void 0 : el.style) && raw_prop) if (val == null) el.style.removeProperty(raw_prop);
6527
+ if ((el === null || el === void 0 ? void 0 : el.style) && raw_prop) if (val == null) el.style.removeProperty(raw_prop);
6434
6528
  else el.style.setProperty(raw_prop, val);
6435
6529
  }, { immediate: true });
6436
6530
  return variable;
6437
6531
  }
6532
+ /**
6533
+ * Reports changes to the dimensions of an Element's content or the border-box
6534
+ *
6535
+ * @see https://vueuse.org/useResizeObserver
6536
+ * @param target
6537
+ * @param callback
6538
+ * @param options
6539
+ */
6438
6540
  function useResizeObserver(target, callback, options = {}) {
6439
6541
  const { window: window$1 = defaultWindow,...observerOptions } = options;
6440
6542
  let observer;
@@ -6445,11 +6547,10 @@ function useResizeObserver(target, callback, options = {}) {
6445
6547
  observer = void 0;
6446
6548
  }
6447
6549
  };
6448
- const targets = computed(() => {
6550
+ const stopWatch = watch(computed(() => {
6449
6551
  const _targets = toValue(target);
6450
6552
  return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
6451
- });
6452
- const stopWatch = watch(targets, (els) => {
6553
+ }), (els) => {
6453
6554
  cleanup();
6454
6555
  if (isSupported$1.value && window$1) {
6455
6556
  observer = new ResizeObserver(callback);
@@ -6469,6 +6570,12 @@ function useResizeObserver(target, callback, options = {}) {
6469
6570
  stop: stop$1
6470
6571
  };
6471
6572
  }
6573
+ /**
6574
+ * Reactive bounding box of an HTML element.
6575
+ *
6576
+ * @see https://vueuse.org/useElementBounding
6577
+ * @param target
6578
+ */
6472
6579
  function useElementBounding(target, options = {}) {
6473
6580
  const { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = "sync" } = options;
6474
6581
  const height = shallowRef(0);
@@ -6531,14 +6638,27 @@ function useElementBounding(target, options = {}) {
6531
6638
  update
6532
6639
  };
6533
6640
  }
6641
+ /**
6642
+ * Reactive LocalStorage.
6643
+ *
6644
+ * @see https://vueuse.org/useLocalStorage
6645
+ * @param key
6646
+ * @param initialValue
6647
+ * @param options
6648
+ */
6534
6649
  function useLocalStorage(key, initialValue, options = {}) {
6535
6650
  const { window: window$1 = defaultWindow } = options;
6536
- return useStorage(key, initialValue, window$1 == null ? void 0 : window$1.localStorage, options);
6651
+ return useStorage(key, initialValue, window$1 === null || window$1 === void 0 ? void 0 : window$1.localStorage, options);
6537
6652
  }
6538
6653
  const topVarName = "--vueuse-safe-area-top";
6539
6654
  const rightVarName = "--vueuse-safe-area-right";
6540
6655
  const bottomVarName = "--vueuse-safe-area-bottom";
6541
6656
  const leftVarName = "--vueuse-safe-area-left";
6657
+ /**
6658
+ * Reactive `env(safe-area-inset-*)`
6659
+ *
6660
+ * @see https://vueuse.org/useScreenSafeArea
6661
+ */
6542
6662
  function useScreenSafeArea() {
6543
6663
  const top = shallowRef("");
6544
6664
  const right = shallowRef("");
@@ -6610,7 +6730,14 @@ const DEFAULT_UNITS = [
6610
6730
  name: "year"
6611
6731
  }
6612
6732
  ];
6613
- /* @__NO_SIDE_EFFECTS__ */
6733
+ /**
6734
+ * Reactive window size.
6735
+ *
6736
+ * @see https://vueuse.org/useWindowSize
6737
+ * @param options
6738
+ *
6739
+ * @__NO_SIDE_EFFECTS__
6740
+ */
6614
6741
  function useWindowSize(options = {}) {
6615
6742
  const { window: window$1 = defaultWindow, initialWidth = Number.POSITIVE_INFINITY, initialHeight = Number.POSITIVE_INFINITY, listenOrientation = true, includeScrollbar = true, type = "inner" } = options;
6616
6743
  const width = shallowRef(initialWidth);
@@ -6636,10 +6763,7 @@ function useWindowSize(options = {}) {
6636
6763
  const listenerOptions = { passive: true };
6637
6764
  useEventListener("resize", update, listenerOptions);
6638
6765
  if (window$1 && type === "visual" && window$1.visualViewport) useEventListener(window$1.visualViewport, "resize", update, listenerOptions);
6639
- if (listenOrientation) {
6640
- const matches = useMediaQuery("(orientation: portrait)");
6641
- watch(matches, () => update());
6642
- }
6766
+ if (listenOrientation) watch(useMediaQuery("(orientation: portrait)"), () => update());
6643
6767
  return {
6644
6768
  width,
6645
6769
  height
@@ -6647,4 +6771,4 @@ function useWindowSize(options = {}) {
6647
6771
  }
6648
6772
 
6649
6773
  //#endregion
6650
- export { Fragment, computed, createBaseVNode, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, defineCustomElement, markRaw, mergeModels, nextTick, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, reactive, ref, renderList, renderSlot, toDisplayString, toRefs, toRefs$1, unref, useElementBounding, useEventListener, useLocalStorage, useModel, useScreenSafeArea, useTemplateRef, useWindowSize, vShow, watch, watchEffect, withCtx, withDirectives, withModifiers };
6774
+ export { withDirectives as A, renderList as C, watch as D, useTemplateRef as E, unref as F, normalizeClass as I, normalizeStyle as L, reactive as M, ref as N, watchEffect as O, toRefs$1 as P, toDisplayString as R, openBlock as S, useModel as T, defineComponent as _, useWindowSize as a, onMounted as b, vShow as c, computed as d, createBaseVNode as f, createVNode as g, createElementBlock as h, useScreenSafeArea as i, markRaw as j, withCtx as k, withModifiers as l, createCommentVNode as m, useEventListener as n, toRefs as o, createBlock as p, useLocalStorage as r, defineCustomElement as s, useElementBounding as t, Fragment as u, mergeModels as v, renderSlot as w, onUnmounted as x, nextTick as y };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { DevToolsNodeContext } from "@vitejs/devtools-kit";
2
- import "@vitejs/devtools-vite";
1
+ import * as _vitejs_devtools_kit0 from "@vitejs/devtools-kit";
2
+ import { DevToolsNodeContext, RpcDefinitionsToFunctions } from "@vitejs/devtools-kit";
3
3
  import { Plugin, ResolvedConfig, ViteDevServer } from "vite";
4
4
  import * as h30 from "h3";
5
5
  import * as birpc0 from "birpc";
@@ -7,6 +7,17 @@ import * as birpc0 from "birpc";
7
7
  //#region src/node/context.d.ts
8
8
  declare function createDevToolsContext(viteConfig: ResolvedConfig, viteServer?: ViteDevServer): Promise<DevToolsNodeContext>;
9
9
  //#endregion
10
+ //#region src/node/rpc/index.d.ts
11
+ declare const builtinRpcFunctions: readonly [_vitejs_devtools_kit0.RpcFunctionDefinition<"vite:core:list-rpc-functions", "action", [], Promise<{
12
+ [k: string]: {
13
+ type: any;
14
+ };
15
+ }>>, _vitejs_devtools_kit0.RpcFunctionDefinition<"vite:core:list-dock-entries", "query", [], _vitejs_devtools_kit0.DevToolsDockEntry[]>, _vitejs_devtools_kit0.RpcFunctionDefinition<"vite:core:open-in-editor", "action", [path: string], Promise<void>>, _vitejs_devtools_kit0.RpcFunctionDefinition<"vite:core:open-in-finder", "action", [path: string], Promise<void>>];
16
+ type ServerFunctions = RpcDefinitionsToFunctions<typeof builtinRpcFunctions>;
17
+ declare module '@vitejs/devtools-kit' {
18
+ interface DevToolsRpcServerFunctions extends ServerFunctions {}
19
+ }
20
+ //#endregion
10
21
  //#region src/node/plugins/index.d.ts
11
22
  interface DevToolsOptions {
12
23
  /**
@@ -16,7 +27,7 @@ interface DevToolsOptions {
16
27
  */
17
28
  builtinDevTools?: boolean;
18
29
  }
19
- declare function DevTools(options?: DevToolsOptions): Plugin[];
30
+ declare function DevTools(options?: DevToolsOptions): Promise<Plugin[]>;
20
31
  //#endregion
21
32
  //#region src/node/ws.d.ts
22
33
  interface CreateWsServerOptions {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DevTools, createDevToolsContext, createDevToolsMiddleware } from "./plugins--vOHltJp.js";
2
- import "./dirs-B7dOX6eI.js";
1
+ import { n as createDevToolsMiddleware, t as DevTools, u as createDevToolsContext } from "./plugins-BdxoM625.js";
2
+ import "./dirs-DcSK9l9L.js";
3
3
 
4
4
  export { DevTools, createDevToolsContext, createDevToolsMiddleware };