From 9bce51f651aad297ef9eb6df832bfdaf1de05d84 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 22 四月 2026 14:27:54 +0800
Subject: [PATCH] 青岛推送
---
node_modules/vue/dist/vue.global.js | 1131 +++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 677 insertions(+), 454 deletions(-)
diff --git a/node_modules/vue/dist/vue.global.js b/node_modules/vue/dist/vue.global.js
index 65d6acf..ede216c 100644
--- a/node_modules/vue/dist/vue.global.js
+++ b/node_modules/vue/dist/vue.global.js
@@ -1,5 +1,5 @@
/**
-* vue v3.5.25
+* vue v3.5.32
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
@@ -410,6 +410,7 @@
let activeEffectScope;
class EffectScope {
+ // TODO isolatedDeclarations "__v_skip"
constructor(detached = false) {
this.detached = detached;
/**
@@ -429,6 +430,7 @@
*/
this.cleanups = [];
this._isPaused = false;
+ this.__v_skip = true;
this.parent = activeEffectScope;
if (!detached && activeEffectScope) {
this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
@@ -1005,13 +1007,13 @@
}
}
const targetMap = /* @__PURE__ */ new WeakMap();
- const ITERATE_KEY = Symbol(
+ const ITERATE_KEY = /* @__PURE__ */ Symbol(
"Object iterate"
);
- const MAP_KEY_ITERATE_KEY = Symbol(
+ const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
"Map keys iterate"
);
- const ARRAY_ITERATE_KEY = Symbol(
+ const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
"Array iterate"
);
function track(target, type, key) {
@@ -1279,10 +1281,17 @@
}
function reduce(self, method, fn, args) {
const arr = shallowReadArray(self);
+ const needsWrap = arr !== self && !isShallow(self);
let wrappedFn = fn;
+ let wrapInitialAccumulator = false;
if (arr !== self) {
- if (!isShallow(self)) {
+ if (needsWrap) {
+ wrapInitialAccumulator = args.length === 0;
wrappedFn = function(acc, item, index) {
+ if (wrapInitialAccumulator) {
+ wrapInitialAccumulator = false;
+ acc = toWrapped(self, acc);
+ }
return fn.call(this, acc, toWrapped(self, item), index, self);
};
} else if (fn.length > 3) {
@@ -1291,7 +1300,8 @@
};
}
}
- return arr[method](wrappedFn, ...args);
+ const result = arr[method](wrappedFn, ...args);
+ return wrapInitialAccumulator ? toWrapped(self, result) : result;
}
function searchProxy(self, method, args) {
const arr = toRaw(self);
@@ -1494,20 +1504,20 @@
"iterate",
isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
);
- return {
- // iterator protocol
- next() {
- const { value, done } = innerIterator.next();
- return done ? { value, done } : {
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
- done
- };
- },
- // iterable protocol
- [Symbol.iterator]() {
- return this;
+ return extend(
+ // inheriting all iterator properties
+ Object.create(innerIterator),
+ {
+ // iterator protocol
+ next() {
+ const { value, done } = innerIterator.next();
+ return done ? { value, done } : {
+ value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
+ done
+ };
+ }
}
- };
+ );
};
}
function createReadonlyMethod(type) {
@@ -1581,15 +1591,14 @@
clear: createReadonlyMethod("clear")
} : {
add(value) {
- if (!shallow && !isShallow(value) && !isReadonly(value)) {
- value = toRaw(value);
- }
const target = toRaw(this);
const proto = getProto(target);
- const hadKey = proto.has.call(target, value);
+ const rawValue = toRaw(value);
+ const valueToAdd = !shallow && !isShallow(value) && !isReadonly(value) ? rawValue : value;
+ const hadKey = proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue);
if (!hadKey) {
- target.add(value);
- trigger(target, "add", value, value);
+ target.add(valueToAdd);
+ trigger(target, "add", valueToAdd, valueToAdd);
}
return this;
},
@@ -1721,8 +1730,9 @@
function getTargetType(value) {
return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
}
+ // @__NO_SIDE_EFFECTS__
function reactive(target) {
- if (isReadonly(target)) {
+ if (/* @__PURE__ */ isReadonly(target)) {
return target;
}
return createReactiveObject(
@@ -1733,6 +1743,7 @@
reactiveMap
);
}
+ // @__NO_SIDE_EFFECTS__
function shallowReactive(target) {
return createReactiveObject(
target,
@@ -1742,6 +1753,7 @@
shallowReactiveMap
);
}
+ // @__NO_SIDE_EFFECTS__
function readonly(target) {
return createReactiveObject(
target,
@@ -1751,6 +1763,7 @@
readonlyMap
);
}
+ // @__NO_SIDE_EFFECTS__
function shallowReadonly(target) {
return createReactiveObject(
target,
@@ -1789,24 +1802,29 @@
proxyMap.set(target, proxy);
return proxy;
}
+ // @__NO_SIDE_EFFECTS__
function isReactive(value) {
- if (isReadonly(value)) {
- return isReactive(value["__v_raw"]);
+ if (/* @__PURE__ */ isReadonly(value)) {
+ return /* @__PURE__ */ isReactive(value["__v_raw"]);
}
return !!(value && value["__v_isReactive"]);
}
+ // @__NO_SIDE_EFFECTS__
function isReadonly(value) {
return !!(value && value["__v_isReadonly"]);
}
+ // @__NO_SIDE_EFFECTS__
function isShallow(value) {
return !!(value && value["__v_isShallow"]);
}
+ // @__NO_SIDE_EFFECTS__
function isProxy(value) {
return value ? !!value["__v_raw"] : false;
}
+ // @__NO_SIDE_EFFECTS__
function toRaw(observed) {
const raw = observed && observed["__v_raw"];
- return raw ? toRaw(raw) : observed;
+ return raw ? /* @__PURE__ */ toRaw(raw) : observed;
}
function markRaw(value) {
if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
@@ -1814,20 +1832,23 @@
}
return value;
}
- const toReactive = (value) => isObject(value) ? reactive(value) : value;
- const toReadonly = (value) => isObject(value) ? readonly(value) : value;
+ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value) : value;
+ const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
+ // @__NO_SIDE_EFFECTS__
function isRef(r) {
return r ? r["__v_isRef"] === true : false;
}
+ // @__NO_SIDE_EFFECTS__
function ref(value) {
return createRef(value, false);
}
+ // @__NO_SIDE_EFFECTS__
function shallowRef(value) {
return createRef(value, true);
}
function createRef(rawValue, shallow) {
- if (isRef(rawValue)) {
+ if (/* @__PURE__ */ isRef(rawValue)) {
return rawValue;
}
return new RefImpl(rawValue, shallow);
@@ -1883,7 +1904,7 @@
}
}
function unref(ref2) {
- return isRef(ref2) ? ref2.value : ref2;
+ return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
}
function toValue(source) {
return isFunction(source) ? source() : unref(source);
@@ -1892,7 +1913,7 @@
get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
set: (target, key, value, receiver) => {
const oldValue = target[key];
- if (isRef(oldValue) && !isRef(value)) {
+ if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
oldValue.value = value;
return true;
} else {
@@ -1922,6 +1943,7 @@
function customRef(factory) {
return new CustomRefImpl(factory);
}
+ // @__NO_SIDE_EFFECTS__
function toRefs(object) {
if (!isProxy(object)) {
warn$2(`toRefs() expects a reactive object but received a plain one.`);
@@ -1933,16 +1955,16 @@
return ret;
}
class ObjectRefImpl {
- constructor(_object, _key, _defaultValue) {
+ constructor(_object, key, _defaultValue) {
this._object = _object;
- this._key = _key;
this._defaultValue = _defaultValue;
this["__v_isRef"] = true;
this._value = void 0;
+ this._key = isSymbol(key) ? key : String(key);
this._raw = toRaw(_object);
let shallow = true;
let obj = _object;
- if (!isArray(_object) || !isIntegerKey(String(_key))) {
+ if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) {
do {
shallow = !isProxy(obj) || isShallow(obj);
} while (shallow && (obj = obj["__v_raw"]));
@@ -1957,9 +1979,9 @@
return this._value = val === void 0 ? this._defaultValue : val;
}
set value(newVal) {
- if (this._shallow && isRef(this._raw[this._key])) {
+ if (this._shallow && /* @__PURE__ */ isRef(this._raw[this._key])) {
const nestedRef = this._object[this._key];
- if (isRef(nestedRef)) {
+ if (/* @__PURE__ */ isRef(nestedRef)) {
nestedRef.value = newVal;
return;
}
@@ -1981,15 +2003,16 @@
return this._value = this._getter();
}
}
+ // @__NO_SIDE_EFFECTS__
function toRef(source, key, defaultValue) {
- if (isRef(source)) {
+ if (/* @__PURE__ */ isRef(source)) {
return source;
} else if (isFunction(source)) {
return new GetterRefImpl(source);
} else if (isObject(source) && arguments.length > 1) {
return propertyToRef(source, key, defaultValue);
} else {
- return ref(source);
+ return /* @__PURE__ */ ref(source);
}
}
function propertyToRef(source, key, defaultValue) {
@@ -2070,6 +2093,7 @@
}
}
}
+ // @__NO_SIDE_EFFECTS__
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
let getter;
let setter;
@@ -2740,6 +2764,13 @@
}
let isHmrUpdating = false;
+ const setHmrUpdating = (v) => {
+ try {
+ return isHmrUpdating;
+ } finally {
+ isHmrUpdating = v;
+ }
+ };
const hmrDirtyComponents = /* @__PURE__ */ new Map();
{
getGlobalThis().__VUE_HMR_RUNTIME__ = {
@@ -3060,7 +3091,153 @@
}
}
- const TeleportEndKey = Symbol("_vte");
+ function provide(key, value) {
+ {
+ if (!currentInstance || currentInstance.isMounted) {
+ warn$1(`provide() can only be used inside setup().`);
+ }
+ }
+ if (currentInstance) {
+ let provides = currentInstance.provides;
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
+ if (parentProvides === provides) {
+ provides = currentInstance.provides = Object.create(parentProvides);
+ }
+ provides[key] = value;
+ }
+ }
+ function inject(key, defaultValue, treatDefaultAsFactory = false) {
+ const instance = getCurrentInstance();
+ if (instance || currentApp) {
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
+ if (provides && key in provides) {
+ return provides[key];
+ } else if (arguments.length > 1) {
+ return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
+ } else {
+ warn$1(`injection "${String(key)}" not found.`);
+ }
+ } else {
+ warn$1(`inject() can only be used inside setup() or functional components.`);
+ }
+ }
+ function hasInjectionContext() {
+ return !!(getCurrentInstance() || currentApp);
+ }
+
+ const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
+ const useSSRContext = () => {
+ {
+ warn$1(`useSSRContext() is not supported in the global build.`);
+ }
+ };
+
+ function watchEffect(effect, options) {
+ return doWatch(effect, null, options);
+ }
+ function watchPostEffect(effect, options) {
+ return doWatch(
+ effect,
+ null,
+ extend({}, options, { flush: "post" })
+ );
+ }
+ function watchSyncEffect(effect, options) {
+ return doWatch(
+ effect,
+ null,
+ extend({}, options, { flush: "sync" })
+ );
+ }
+ function watch(source, cb, options) {
+ if (!isFunction(cb)) {
+ warn$1(
+ `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
+ );
+ }
+ return doWatch(source, cb, options);
+ }
+ function doWatch(source, cb, options = EMPTY_OBJ) {
+ const { immediate, deep, flush, once } = options;
+ if (!cb) {
+ if (immediate !== void 0) {
+ warn$1(
+ `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
+ );
+ }
+ if (deep !== void 0) {
+ warn$1(
+ `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
+ );
+ }
+ if (once !== void 0) {
+ warn$1(
+ `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
+ );
+ }
+ }
+ const baseWatchOptions = extend({}, options);
+ baseWatchOptions.onWarn = warn$1;
+ const instance = currentInstance;
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
+ let isPre = false;
+ if (flush === "post") {
+ baseWatchOptions.scheduler = (job) => {
+ queuePostRenderEffect(job, instance && instance.suspense);
+ };
+ } else if (flush !== "sync") {
+ isPre = true;
+ baseWatchOptions.scheduler = (job, isFirstRun) => {
+ if (isFirstRun) {
+ job();
+ } else {
+ queueJob(job);
+ }
+ };
+ }
+ baseWatchOptions.augmentJob = (job) => {
+ if (cb) {
+ job.flags |= 4;
+ }
+ if (isPre) {
+ job.flags |= 2;
+ if (instance) {
+ job.id = instance.uid;
+ job.i = instance;
+ }
+ }
+ };
+ const watchHandle = watch$1(source, cb, baseWatchOptions);
+ return watchHandle;
+ }
+ function instanceWatch(source, value, options) {
+ const publicThis = this.proxy;
+ const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
+ let cb;
+ if (isFunction(value)) {
+ cb = value;
+ } else {
+ cb = value.handler;
+ options = value;
+ }
+ const reset = setCurrentInstance(this);
+ const res = doWatch(getter, cb.bind(publicThis), options);
+ reset();
+ return res;
+ }
+ function createPathGetter(ctx, path) {
+ const segments = path.split(".");
+ return () => {
+ let cur = ctx;
+ for (let i = 0; i < segments.length && cur; i++) {
+ cur = cur[segments[i]];
+ }
+ return cur;
+ };
+ }
+
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
+ const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
const isTeleport = (type) => type.__isTeleport;
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
@@ -3101,88 +3278,84 @@
o: { insert, querySelector, createText, createComment }
} = internals;
const disabled = isTeleportDisabled(n2.props);
- let { shapeFlag, children, dynamicChildren } = n2;
+ let { dynamicChildren } = n2;
if (isHmrUpdating) {
optimized = false;
dynamicChildren = null;
}
+ const mount = (vnode, container2, anchor2) => {
+ if (vnode.shapeFlag & 16) {
+ mountChildren(
+ vnode.children,
+ container2,
+ anchor2,
+ parentComponent,
+ parentSuspense,
+ namespace,
+ slotScopeIds,
+ optimized
+ );
+ }
+ };
+ const mountToTarget = (vnode = n2) => {
+ const disabled2 = isTeleportDisabled(vnode.props);
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
+ if (target) {
+ if (namespace !== "svg" && isTargetSVG(target)) {
+ namespace = "svg";
+ } else if (namespace !== "mathml" && isTargetMathML(target)) {
+ namespace = "mathml";
+ }
+ if (parentComponent && parentComponent.isCE) {
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
+ }
+ if (!disabled2) {
+ mount(vnode, target, targetAnchor);
+ updateCssVars(vnode, false);
+ }
+ } else if (!disabled2) {
+ warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
+ }
+ };
+ const queuePendingMount = (vnode) => {
+ const mountJob = () => {
+ if (pendingMounts.get(vnode) !== mountJob) return;
+ pendingMounts.delete(vnode);
+ if (isTeleportDisabled(vnode.props)) {
+ mount(vnode, container, vnode.anchor);
+ updateCssVars(vnode, true);
+ }
+ mountToTarget(vnode);
+ };
+ pendingMounts.set(vnode, mountJob);
+ queuePostRenderEffect(mountJob, parentSuspense);
+ };
if (n1 == null) {
const placeholder = n2.el = createComment("teleport start") ;
const mainAnchor = n2.anchor = createComment("teleport end") ;
insert(placeholder, container, anchor);
insert(mainAnchor, container, anchor);
- const mount = (container2, anchor2) => {
- if (shapeFlag & 16) {
- mountChildren(
- children,
- container2,
- anchor2,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- };
- const mountToTarget = () => {
- const target = n2.target = resolveTarget(n2.props, querySelector);
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
- if (target) {
- if (namespace !== "svg" && isTargetSVG(target)) {
- namespace = "svg";
- } else if (namespace !== "mathml" && isTargetMathML(target)) {
- namespace = "mathml";
- }
- if (parentComponent && parentComponent.isCE) {
- (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
- }
- if (!disabled) {
- mount(target, targetAnchor);
- updateCssVars(n2, false);
- }
- } else if (!disabled) {
- warn$1(
- "Invalid Teleport target on mount:",
- target,
- `(${typeof target})`
- );
- }
- };
- if (disabled) {
- mount(container, mainAnchor);
- updateCssVars(n2, true);
- }
- if (isTeleportDeferred(n2.props)) {
- n2.el.__isMounted = false;
- queuePostRenderEffect(() => {
- mountToTarget();
- delete n2.el.__isMounted;
- }, parentSuspense);
- } else {
- mountToTarget();
- }
- } else {
- if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
- queuePostRenderEffect(() => {
- TeleportImpl.process(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized,
- internals
- );
- }, parentSuspense);
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
+ queuePendingMount(n2);
return;
}
+ if (disabled) {
+ mount(n2, container, mainAnchor);
+ updateCssVars(n2, true);
+ }
+ mountToTarget();
+ } else {
n2.el = n1.el;
- n2.targetStart = n1.targetStart;
const mainAnchor = n2.anchor = n1.anchor;
+ const pendingMount = pendingMounts.get(n1);
+ if (pendingMount) {
+ pendingMount.flags |= 8;
+ pendingMounts.delete(n1);
+ queuePendingMount(n2);
+ return;
+ }
+ n2.targetStart = n1.targetStart;
const target = n2.target = n1.target;
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
const wasDisabled = isTeleportDisabled(n1.props);
@@ -3275,13 +3448,19 @@
target,
props
} = vnode;
+ let shouldRemove = doRemove || !isTeleportDisabled(props);
+ const pendingMount = pendingMounts.get(vnode);
+ if (pendingMount) {
+ pendingMount.flags |= 8;
+ pendingMounts.delete(vnode);
+ shouldRemove = false;
+ }
if (target) {
hostRemove(targetStart);
hostRemove(targetAnchor);
}
doRemove && hostRemove(anchor);
if (shapeFlag & 16) {
- const shouldRemove = doRemove || !isTeleportDisabled(props);
for (let i = 0; i < children.length; i++) {
const child = children[i];
unmount(
@@ -3325,7 +3504,22 @@
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
o: { nextSibling, parentNode, querySelector, insert, createText }
}, hydrateChildren) {
- function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
+ function hydrateAnchor(target2, targetNode) {
+ let targetAnchor = targetNode;
+ while (targetAnchor) {
+ if (targetAnchor && targetAnchor.nodeType === 8) {
+ if (targetAnchor.data === "teleport start anchor") {
+ vnode.targetStart = targetAnchor;
+ } else if (targetAnchor.data === "teleport anchor") {
+ vnode.targetAnchor = targetAnchor;
+ target2._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
+ break;
+ }
+ }
+ targetAnchor = nextSibling(targetAnchor);
+ }
+ }
+ function hydrateDisabledTeleport(node2, vnode2) {
vnode2.anchor = hydrateChildren(
nextSibling(node2),
vnode2,
@@ -3335,8 +3529,6 @@
slotScopeIds,
optimized
);
- vnode2.targetStart = targetStart;
- vnode2.targetAnchor = targetAnchor;
}
const target = vnode.target = resolveTarget(
vnode.props,
@@ -3347,27 +3539,22 @@
const targetNode = target._lpa || target.firstChild;
if (vnode.shapeFlag & 16) {
if (disabled) {
- hydrateDisabledTeleport(
- node,
- vnode,
- targetNode,
- targetNode && nextSibling(targetNode)
- );
+ hydrateDisabledTeleport(node, vnode);
+ hydrateAnchor(target, targetNode);
+ if (!vnode.targetAnchor) {
+ prepareAnchor(
+ target,
+ vnode,
+ createText,
+ insert,
+ // if target is the same as the main view, insert anchors before current node
+ // to avoid hydrating mismatch
+ parentNode(node) === target ? node : null
+ );
+ }
} else {
vnode.anchor = nextSibling(node);
- let targetAnchor = targetNode;
- while (targetAnchor) {
- if (targetAnchor && targetAnchor.nodeType === 8) {
- if (targetAnchor.data === "teleport start anchor") {
- vnode.targetStart = targetAnchor;
- } else if (targetAnchor.data === "teleport anchor") {
- vnode.targetAnchor = targetAnchor;
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
- break;
- }
- }
- targetAnchor = nextSibling(targetAnchor);
- }
+ hydrateAnchor(target, targetNode);
if (!vnode.targetAnchor) {
prepareAnchor(target, vnode, createText, insert);
}
@@ -3385,7 +3572,9 @@
updateCssVars(vnode, disabled);
} else if (disabled) {
if (vnode.shapeFlag & 16) {
- hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
+ hydrateDisabledTeleport(node, vnode);
+ vnode.targetStart = node;
+ vnode.targetAnchor = nextSibling(node);
}
}
return vnode.anchor && nextSibling(vnode.anchor);
@@ -3409,19 +3598,19 @@
ctx.ut();
}
}
- function prepareAnchor(target, vnode, createText, insert) {
+ function prepareAnchor(target, vnode, createText, insert, anchor = null) {
const targetStart = vnode.targetStart = createText("");
const targetAnchor = vnode.targetAnchor = createText("");
targetStart[TeleportEndKey] = targetAnchor;
if (target) {
- insert(targetStart, target);
- insert(targetAnchor, target);
+ insert(targetStart, target, anchor);
+ insert(targetAnchor, target, anchor);
}
return targetAnchor;
}
- const leaveCbKey = Symbol("_leaveCb");
- const enterCbKey$1 = Symbol("_enterCb");
+ const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
+ const enterCbKey$1 = /* @__PURE__ */ Symbol("_enterCb");
function useTransitionState() {
const state = {
isMounted: false,
@@ -3637,6 +3826,7 @@
callHook(hook, [el]);
},
enter(el) {
+ if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
let hook = onEnter;
let afterHook = onAfterEnter;
let cancelHook = onEnterCancelled;
@@ -3650,7 +3840,7 @@
}
}
let called = false;
- const done = el[enterCbKey$1] = (cancelled) => {
+ el[enterCbKey$1] = (cancelled) => {
if (called) return;
called = true;
if (cancelled) {
@@ -3663,6 +3853,7 @@
}
el[enterCbKey$1] = void 0;
};
+ const done = el[enterCbKey$1].bind(null, false);
if (hook) {
callAsyncHook(hook, [el, done]);
} else {
@@ -3682,7 +3873,7 @@
}
callHook(onBeforeLeave, [el]);
let called = false;
- const done = el[leaveCbKey] = (cancelled) => {
+ el[leaveCbKey] = (cancelled) => {
if (called) return;
called = true;
remove();
@@ -3696,6 +3887,7 @@
delete leavingVNodesCache[key2];
}
};
+ const done = el[leaveCbKey].bind(null, false);
leavingVNodesCache[key2] = vnode;
if (onLeave) {
callAsyncHook(onLeave, [el, done]);
@@ -3808,8 +4000,7 @@
const r = shallowRef(null);
if (i) {
const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
- let desc;
- if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
+ if (isTemplateRefKey(refs, key)) {
warn$1(`useTemplateRef('${key}') already exists.`);
} else {
Object.defineProperty(refs, key, {
@@ -3828,6 +4019,10 @@
knownTemplateRefs.add(ret);
}
return ret;
+ }
+ function isTemplateRefKey(refs, key) {
+ let desc;
+ return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable);
}
const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
@@ -3874,10 +4069,19 @@
return false;
}
}
+ if (isTemplateRefKey(refs, key)) {
+ return false;
+ }
return hasOwn(rawSetupState, key);
};
- const canSetRef = (ref2) => {
- return !knownTemplateRefs.has(ref2);
+ const canSetRef = (ref2, key) => {
+ if (knownTemplateRefs.has(ref2)) {
+ return false;
+ }
+ if (key && isTemplateRefKey(refs, key)) {
+ return false;
+ }
+ return true;
};
if (oldRef != null && oldRef !== ref) {
invalidatePendingSetRef(oldRawRef);
@@ -3887,10 +4091,10 @@
setupState[oldRef] = null;
}
} else if (isRef(oldRef)) {
- if (canSetRef(oldRef)) {
+ const oldRawRefAtom = oldRawRef;
+ if (canSetRef(oldRef, oldRawRefAtom.k)) {
oldRef.value = null;
}
- const oldRawRefAtom = oldRawRef;
if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
}
}
@@ -3914,7 +4118,7 @@
}
} else {
const newVal = [refValue];
- if (canSetRef(ref)) {
+ if (canSetRef(ref, rawRef.k)) {
ref.value = newVal;
}
if (rawRef.k) refs[rawRef.k] = newVal;
@@ -3929,7 +4133,7 @@
setupState[ref] = value;
}
} else if (_isRef) {
- if (canSetRef(ref)) {
+ if (canSetRef(ref, rawRef.k)) {
ref.value = value;
}
if (rawRef.k) refs[rawRef.k] = value;
@@ -4269,7 +4473,7 @@
logMismatchError();
}
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
- key[0] === "." || isCustomElement) {
+ key[0] === "." || isCustomElement && !isReservedProp(key)) {
patchProp(el, key, null, props[key], void 0, parentComponent);
}
}
@@ -4952,7 +5156,9 @@
}
function pruneCache(filter) {
cache.forEach((vnode, key) => {
- const name = getComponentName(vnode.type);
+ const name = getComponentName(
+ isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
+ );
if (name && !filter(name)) {
pruneCacheEntry(key);
}
@@ -5179,7 +5385,7 @@
function resolveComponent(name, maybeSelfReference) {
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
}
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
+ const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
function resolveDynamicComponent(component) {
if (isString(component)) {
return resolveAsset(COMPONENTS, component, false) || component;
@@ -5251,12 +5457,16 @@
);
}
} else if (typeof source === "number") {
- if (!Number.isInteger(source)) {
- warn$1(`The v-for range expect an integer value but got ${source}.`);
- }
- ret = new Array(source);
- for (let i = 0; i < source; i++) {
- ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
+ if (!Number.isInteger(source) || source < 0) {
+ warn$1(
+ `The v-for range expects a positive integer value but got ${source}.`
+ );
+ ret = [];
+ } else {
+ ret = new Array(source);
+ for (let i = 0; i < source; i++) {
+ ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
+ }
}
} else if (isObject(source)) {
if (source[Symbol.iterator]) {
@@ -5707,6 +5917,7 @@
}
function withAsyncContext(getAwaitable) {
const ctx = getCurrentInstance();
+ const inSSRSetup = isInSSRComponentSetup;
if (!ctx) {
warn$1(
`withAsyncContext called without active current instance. This is likely a bug.`
@@ -5714,13 +5925,36 @@
}
let awaitable = getAwaitable();
unsetCurrentInstance();
+ if (inSSRSetup) {
+ setInSSRSetupState(false);
+ }
+ const restore = () => {
+ setCurrentInstance(ctx);
+ if (inSSRSetup) {
+ setInSSRSetupState(true);
+ }
+ };
+ const cleanup = () => {
+ if (getCurrentInstance() !== ctx) ctx.scope.off();
+ unsetCurrentInstance();
+ if (inSSRSetup) {
+ setInSSRSetupState(false);
+ }
+ };
if (isPromise(awaitable)) {
awaitable = awaitable.catch((e) => {
- setCurrentInstance(ctx);
+ restore();
+ Promise.resolve().then(() => Promise.resolve().then(cleanup));
throw e;
});
}
- return [awaitable, () => setCurrentInstance(ctx)];
+ return [
+ awaitable,
+ () => {
+ restore();
+ Promise.resolve().then(cleanup);
+ }
+ ];
}
function createDuplicateChecker() {
@@ -6340,151 +6574,6 @@
}
let currentApp = null;
- function provide(key, value) {
- {
- if (!currentInstance || currentInstance.isMounted) {
- warn$1(`provide() can only be used inside setup().`);
- }
- }
- if (currentInstance) {
- let provides = currentInstance.provides;
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
- if (parentProvides === provides) {
- provides = currentInstance.provides = Object.create(parentProvides);
- }
- provides[key] = value;
- }
- }
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
- const instance = getCurrentInstance();
- if (instance || currentApp) {
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
- if (provides && key in provides) {
- return provides[key];
- } else if (arguments.length > 1) {
- return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
- } else {
- warn$1(`injection "${String(key)}" not found.`);
- }
- } else {
- warn$1(`inject() can only be used inside setup() or functional components.`);
- }
- }
- function hasInjectionContext() {
- return !!(getCurrentInstance() || currentApp);
- }
-
- const ssrContextKey = Symbol.for("v-scx");
- const useSSRContext = () => {
- {
- warn$1(`useSSRContext() is not supported in the global build.`);
- }
- };
-
- function watchEffect(effect, options) {
- return doWatch(effect, null, options);
- }
- function watchPostEffect(effect, options) {
- return doWatch(
- effect,
- null,
- extend({}, options, { flush: "post" })
- );
- }
- function watchSyncEffect(effect, options) {
- return doWatch(
- effect,
- null,
- extend({}, options, { flush: "sync" })
- );
- }
- function watch(source, cb, options) {
- if (!isFunction(cb)) {
- warn$1(
- `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
- );
- }
- return doWatch(source, cb, options);
- }
- function doWatch(source, cb, options = EMPTY_OBJ) {
- const { immediate, deep, flush, once } = options;
- if (!cb) {
- if (immediate !== void 0) {
- warn$1(
- `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
- );
- }
- if (deep !== void 0) {
- warn$1(
- `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
- );
- }
- if (once !== void 0) {
- warn$1(
- `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
- );
- }
- }
- const baseWatchOptions = extend({}, options);
- baseWatchOptions.onWarn = warn$1;
- const instance = currentInstance;
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
- let isPre = false;
- if (flush === "post") {
- baseWatchOptions.scheduler = (job) => {
- queuePostRenderEffect(job, instance && instance.suspense);
- };
- } else if (flush !== "sync") {
- isPre = true;
- baseWatchOptions.scheduler = (job, isFirstRun) => {
- if (isFirstRun) {
- job();
- } else {
- queueJob(job);
- }
- };
- }
- baseWatchOptions.augmentJob = (job) => {
- if (cb) {
- job.flags |= 4;
- }
- if (isPre) {
- job.flags |= 2;
- if (instance) {
- job.id = instance.uid;
- job.i = instance;
- }
- }
- };
- const watchHandle = watch$1(source, cb, baseWatchOptions);
- return watchHandle;
- }
- function instanceWatch(source, value, options) {
- const publicThis = this.proxy;
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
- let cb;
- if (isFunction(value)) {
- cb = value;
- } else {
- cb = value.handler;
- options = value;
- }
- const reset = setCurrentInstance(this);
- const res = doWatch(getter, cb.bind(publicThis), options);
- reset();
- return res;
- }
- function createPathGetter(ctx, path) {
- const segments = path.split(".");
- return () => {
- let cur = ctx;
- for (let i = 0; i < segments.length && cur; i++) {
- cur = cur[segments[i]];
- }
- return cur;
- };
- }
-
function useModel(props, name, options = EMPTY_OBJ) {
const i = getCurrentInstance();
if (!i) {
@@ -6927,7 +7016,7 @@
const dynamicProps = nextVNode.dynamicProps;
for (let i = 0; i < dynamicProps.length; i++) {
const key = dynamicProps[i];
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
+ if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emits, key)) {
return true;
}
}
@@ -6958,17 +7047,26 @@
}
for (let i = 0; i < nextKeys.length; i++) {
const key = nextKeys[i];
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
+ if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
return true;
}
}
return false;
}
- function updateHOCHostEl({ vnode, parent }, el) {
+ function hasPropValueChanged(nextProps, prevProps, key) {
+ const nextProp = nextProps[key];
+ const prevProp = prevProps[key];
+ if (key === "style" && isObject(nextProp) && isObject(prevProp)) {
+ return !looseEqual(nextProp, prevProp);
+ }
+ return nextProp !== prevProp;
+ }
+ function updateHOCHostEl({ vnode, parent, suspense }, el) {
while (parent) {
const root = parent.subTree;
if (root.suspense && root.suspense.activeBranch === vnode) {
- root.el = vnode.el;
+ root.suspense.vnode.el = root.el = el;
+ vnode = root;
}
if (root === vnode) {
(vnode = parent.vnode).el = el;
@@ -6976,6 +7074,9 @@
} else {
break;
}
+ }
+ if (suspense && suspense.activeBranch === vnode) {
+ suspense.vnode.el = el;
}
}
@@ -7743,7 +7844,7 @@
optimized
);
} else {
- const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
+ const customElement = n1.el && n1.el._isVueCE ? n1.el : null;
try {
if (customElement) {
customElement._beginPatch();
@@ -7818,10 +7919,17 @@
}
hostInsert(el, container, anchor);
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
+ const isHmr = isHmrUpdating;
queuePostRenderEffect(() => {
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
- needCallTransitionHooks && transition.enter(el);
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
+ let prev;
+ prev = setHmrUpdating(isHmr);
+ try {
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
+ needCallTransitionHooks && transition.enter(el);
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
+ } finally {
+ setHmrUpdating(prev);
+ }
}, parentSuspense);
}
};
@@ -8053,7 +8161,7 @@
} else {
if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
// of renderSlot() with no valid children
- n1.dynamicChildren) {
+ n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
patchBlockChildren(
n1.dynamicChildren,
dynamicChildren,
@@ -8225,9 +8333,11 @@
hydrateSubTree();
}
} else {
- if (root.ce && // @ts-expect-error _def is private
- root.ce._def.shadowRoot !== false) {
- root.ce._injectChildStyle(type);
+ if (root.ce && root.ce._hasShadowRoot()) {
+ root.ce._injectChildStyle(
+ type,
+ instance.parent ? instance.parent.type : void 0
+ );
}
{
startMeasure(instance, `render`);
@@ -8281,9 +8391,9 @@
updateComponentPreRender(instance, next, optimized);
}
nonHydratedAsyncRoot.asyncDep.then(() => {
- if (!instance.isUnmounted) {
- componentUpdateFn();
- }
+ queuePostRenderEffect(() => {
+ if (!instance.isUnmounted) update();
+ }, parentSuspense);
});
return;
}
@@ -8642,8 +8752,8 @@
const nextChild = c2[nextIndex];
const anchorVNode = c2[nextIndex + 1];
const anchor = nextIndex + 1 < l2 ? (
- // #13559, fallback to el placeholder for unresolved async component
- anchorVNode.el || anchorVNode.placeholder
+ // #13559, #14173 fallback to el placeholder for unresolved async component
+ anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
) : parentAnchor;
if (newIndexToOldIndexMap[i] === 0) {
patch(
@@ -8740,7 +8850,8 @@
shapeFlag,
patchFlag,
dirs,
- cacheIndex
+ cacheIndex,
+ memo
} = vnode;
if (patchFlag === -2) {
optimized = false;
@@ -8802,10 +8913,14 @@
remove(vnode);
}
}
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
+ const shouldInvalidateMemo = memo != null && cacheIndex == null;
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
queuePostRenderEffect(() => {
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
+ if (shouldInvalidateMemo) {
+ vnode.el = null;
+ }
}, parentSuspense);
}
};
@@ -8899,9 +9014,11 @@
};
let isFlushing = false;
const render = (vnode, container, namespace) => {
+ let instance;
if (vnode == null) {
if (container._vnode) {
unmount(container._vnode, null, null, true);
+ instance = container._vnode.component;
}
} else {
patch(
@@ -8917,7 +9034,7 @@
container._vnode = vnode;
if (!isFlushing) {
isFlushing = true;
- flushPreFlushCbs();
+ flushPreFlushCbs(instance);
flushPostFlushCbs();
isFlushing = false;
}
@@ -8977,8 +9094,10 @@
if (!shallow && c2.patchFlag !== -2)
traverseStaticChildren(c1, c2);
}
- if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
- c2.patchFlag !== -1) {
+ if (c2.type === Text) {
+ if (c2.patchFlag === -1) {
+ c2 = ch2[i] = cloneIfMounted(c2);
+ }
c2.el = c1.el;
}
if (c2.type === Comment && !c2.el) {
@@ -9045,6 +9164,16 @@
for (let i = 0; i < hooks.length; i++)
hooks[i].flags |= 8;
}
+ }
+ function resolveAsyncComponentPlaceholder(anchorVnode) {
+ if (anchorVnode.placeholder) {
+ return anchorVnode.placeholder;
+ }
+ const instance = anchorVnode.component;
+ if (instance) {
+ return resolveAsyncComponentPlaceholder(instance.subTree);
+ }
+ return null;
}
const isSuspense = (type) => type.__isSuspense;
@@ -9345,6 +9474,7 @@
pendingId: suspenseId++,
timeout: typeof timeout === "number" ? timeout : -1,
activeBranch: null,
+ isFallbackMountPending: false,
pendingBranch: null,
isInFallback: !isHydrating,
isHydrating,
@@ -9394,7 +9524,7 @@
}
};
}
- if (activeBranch) {
+ if (activeBranch && !suspense.isFallbackMountPending) {
if (parentNode(activeBranch.el) === container2) {
anchor = next(activeBranch);
}
@@ -9407,6 +9537,7 @@
move(pendingBranch, container2, anchor, 0);
}
}
+ suspense.isFallbackMountPending = false;
setActiveBranch(suspense, pendingBranch);
suspense.pendingBranch = null;
suspense.isInFallback = false;
@@ -9442,6 +9573,7 @@
triggerEvent(vnode2, "onFallback");
const anchor2 = next(activeBranch);
const mountFallback = () => {
+ suspense.isFallbackMountPending = false;
if (!suspense.isInFallback) {
return;
}
@@ -9461,6 +9593,7 @@
};
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
if (delayEnter) {
+ suspense.isFallbackMountPending = true;
activeBranch.transition.afterLeave = mountFallback;
}
suspense.isInFallback = true;
@@ -9495,6 +9628,7 @@
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
return;
}
+ unsetCurrentInstance();
instance.asyncResolved = true;
const { vnode: vnode2 } = instance;
{
@@ -9648,10 +9782,10 @@
return suspensible != null && suspensible !== false;
}
- const Fragment = Symbol.for("v-fgt");
- const Text = Symbol.for("v-txt");
- const Comment = Symbol.for("v-cmt");
- const Static = Symbol.for("v-stc");
+ const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
+ const Text = /* @__PURE__ */ Symbol.for("v-txt");
+ const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
+ const Static = /* @__PURE__ */ Symbol.for("v-stc");
const blockStack = [];
let currentBlock = null;
function openBlock(disableTracking = false) {
@@ -10011,6 +10145,10 @@
const incoming = toMerge[key];
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
ret[key] = existing ? [].concat(existing, incoming) : incoming;
+ } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
+ // the model listener.
+ !isModelListener(key)) {
+ ret[key] = incoming;
}
} else if (key !== "") {
ret[key] = toMerge[key];
@@ -10681,7 +10819,7 @@
return true;
}
- const version = "3.5.25";
+ const version = "3.5.32";
const warn = warn$1 ;
const ErrorTypeStrings = ErrorTypeStrings$1 ;
const devtools = devtools$1 ;
@@ -10774,7 +10912,7 @@
const TRANSITION$1 = "transition";
const ANIMATION = "animation";
- const vtcKey = Symbol("_vtc");
+ const vtcKey = /* @__PURE__ */ Symbol("_vtc");
const DOMTransitionPropsValidators = {
name: String,
type: String,
@@ -11067,8 +11205,8 @@
}
}
- const vShowOriginalDisplay = Symbol("_vod");
- const vShowHidden = Symbol("_vsh");
+ const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
+ const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
const vShow = {
// used for prop mismatch check during hydration
name: "show",
@@ -11110,7 +11248,7 @@
el[vShowHidden] = !value;
}
- const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
+ const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("CSS_VAR_TEXT" );
function useCssVars(getter) {
const instance = getCurrentInstance();
if (!instance) {
@@ -11360,7 +11498,7 @@
function removeEventListener(el, event, handler, options) {
el.removeEventListener(event, handler, options);
}
- const veiKey = Symbol("_vei");
+ const veiKey = /* @__PURE__ */ Symbol("_vei");
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
const invokers = el[veiKey] || (el[veiKey] = {});
const existingInvoker = invokers[rawName];
@@ -11459,7 +11597,9 @@
}
} else if (
// #11081 force set props for possible async custom element
- el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
+ el._isVueCE && // #12408 check if it's declared prop or it's async custom element
+ (shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private
+ el._def.__asyncLoader && (/[A-Z]/.test(key) || !isString(nextValue)))
) {
patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
} else {
@@ -11507,6 +11647,17 @@
}
return key in el;
}
+ function shouldSetAsPropForVueCE(el, key) {
+ const props = (
+ // @ts-expect-error _def is private
+ el._def.props
+ );
+ if (!props) {
+ return false;
+ }
+ const camelKey = camelize(key);
+ return Array.isArray(props) ? props.some((prop) => camelize(prop) === camelKey) : Object.keys(props).some((prop) => camelize(prop) === camelKey);
+ }
const REMOVAL = {};
// @__NO_SIDE_EFFECTS__
@@ -11551,6 +11702,7 @@
this._dirty = false;
this._numberProps = null;
this._styleChildren = /* @__PURE__ */ new WeakSet();
+ this._styleAnchors = /* @__PURE__ */ new WeakMap();
this._ob = null;
if (this.shadowRoot && _createApp !== createApp) {
this._root = this.shadowRoot;
@@ -11579,7 +11731,8 @@
}
this._connected = true;
let parent = this;
- while (parent = parent && (parent.parentNode || parent.host)) {
+ while (parent = parent && // #12479 should check assignedSlot first to get correct parent
+ (parent.assignedSlot || parent.parentNode || parent.host)) {
if (parent instanceof VueElement) {
this._parent = parent;
break;
@@ -11801,6 +11954,7 @@
this._styles.forEach((s) => this._root.removeChild(s));
this._styles.length = 0;
}
+ this._styleAnchors.delete(this._def);
this._applyStyles(newStyles);
this._instance = null;
this._update();
@@ -11825,7 +11979,7 @@
}
return vnode;
}
- _applyStyles(styles, owner) {
+ _applyStyles(styles, owner, parentComp) {
if (!styles) return;
if (owner) {
if (owner === this._def || this._styleChildren.has(owner)) {
@@ -11834,11 +11988,19 @@
this._styleChildren.add(owner);
}
const nonce = this._nonce;
+ const root = this.shadowRoot;
+ const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
+ let last = null;
for (let i = styles.length - 1; i >= 0; i--) {
const s = document.createElement("style");
if (nonce) s.setAttribute("nonce", nonce);
s.textContent = styles[i];
- this.shadowRoot.prepend(s);
+ root.insertBefore(s, last || insertionAnchor);
+ last = s;
+ if (i === 0) {
+ if (!parentComp) this._styleAnchors.set(this._def, s);
+ if (owner) this._styleAnchors.set(owner, s);
+ }
{
if (owner) {
if (owner.__hmrId) {
@@ -11854,6 +12016,28 @@
}
}
}
+ }
+ _getStyleAnchor(comp) {
+ if (!comp) {
+ return null;
+ }
+ const anchor = this._styleAnchors.get(comp);
+ if (anchor && anchor.parentNode === this.shadowRoot) {
+ return anchor;
+ }
+ if (anchor) {
+ this._styleAnchors.delete(comp);
+ }
+ return null;
+ }
+ _getRootStyleInsertionAnchor(root) {
+ for (let i = 0; i < root.childNodes.length; i++) {
+ const node = root.childNodes[i];
+ if (!(node instanceof HTMLStyleElement)) {
+ return node;
+ }
+ }
+ return null;
}
/**
* Only called when shadowRoot is false
@@ -11917,8 +12101,8 @@
/**
* @internal
*/
- _injectChildStyle(comp) {
- this._applyStyles(comp.styles, comp);
+ _injectChildStyle(comp, parentComp) {
+ this._applyStyles(comp.styles, comp, parentComp);
}
/**
* @internal
@@ -11939,9 +12123,16 @@
/**
* @internal
*/
+ _hasShadowRoot() {
+ return this._def.shadowRoot !== false;
+ }
+ /**
+ * @internal
+ */
_removeChildStyle(comp) {
{
this._styleChildren.delete(comp);
+ this._styleAnchors.delete(comp);
if (this._childStyles && comp.__hmrId) {
const oldStyles = this._childStyles.get(comp.__hmrId);
if (oldStyles) {
@@ -11986,8 +12177,8 @@
const positionMap = /* @__PURE__ */ new WeakMap();
const newPositionMap = /* @__PURE__ */ new WeakMap();
- const moveCbKey = Symbol("_moveCb");
- const enterCbKey = Symbol("_enterCb");
+ const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
+ const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
const decorate = (t) => {
delete t.props.mode;
return t;
@@ -12058,10 +12249,7 @@
instance
)
);
- positionMap.set(child, {
- left: child.el.offsetLeft,
- top: child.el.offsetTop
- });
+ positionMap.set(child, getPosition(child.el));
}
}
}
@@ -12092,10 +12280,7 @@
}
}
function recordPosition(c) {
- newPositionMap.set(c, {
- left: c.el.offsetLeft,
- top: c.el.offsetTop
- });
+ newPositionMap.set(c, getPosition(c.el));
}
function applyTranslation(c) {
const oldPos = positionMap.get(c);
@@ -12103,11 +12288,28 @@
const dx = oldPos.left - newPos.left;
const dy = oldPos.top - newPos.top;
if (dx || dy) {
- const s = c.el.style;
- s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
+ const el = c.el;
+ const s = el.style;
+ const rect = el.getBoundingClientRect();
+ let scaleX = 1;
+ let scaleY = 1;
+ if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
+ if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
+ if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
+ if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
+ if (Math.abs(scaleX - 1) < 0.01) scaleX = 1;
+ if (Math.abs(scaleY - 1) < 0.01) scaleY = 1;
+ s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
s.transitionDuration = "0s";
return c;
}
+ }
+ function getPosition(el) {
+ const rect = el.getBoundingClientRect();
+ return {
+ left: rect.left,
+ top: rect.top
+ };
}
function hasCSSTransform(el, root, moveClass) {
const clone = el.cloneNode();
@@ -12140,7 +12342,7 @@
target.dispatchEvent(new Event("input"));
}
}
- const assignKey = Symbol("_assign");
+ const assignKey = /* @__PURE__ */ Symbol("_assign");
function castValue(value, trim, number) {
if (trim) value = value.trim();
if (number) value = looseToNumber(value);
@@ -12177,7 +12379,8 @@
if (elValue === newValue) {
return;
}
- if (document.activeElement === el && el.type !== "range") {
+ const rootNode = el.getRootNode();
+ if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
if (lazy && value === oldValue) {
return;
}
@@ -12385,6 +12588,7 @@
exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
};
const withModifiers = (fn, modifiers) => {
+ if (!fn) return fn;
const cache = fn._withMods || (fn._withMods = {});
const cacheKey = modifiers.join(".");
return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
@@ -12552,81 +12756,81 @@
}
}
- const FRAGMENT = Symbol(`Fragment` );
- const TELEPORT = Symbol(`Teleport` );
- const SUSPENSE = Symbol(`Suspense` );
- const KEEP_ALIVE = Symbol(`KeepAlive` );
- const BASE_TRANSITION = Symbol(
+ const FRAGMENT = /* @__PURE__ */ Symbol(`Fragment` );
+ const TELEPORT = /* @__PURE__ */ Symbol(`Teleport` );
+ const SUSPENSE = /* @__PURE__ */ Symbol(`Suspense` );
+ const KEEP_ALIVE = /* @__PURE__ */ Symbol(`KeepAlive` );
+ const BASE_TRANSITION = /* @__PURE__ */ Symbol(
`BaseTransition`
);
- const OPEN_BLOCK = Symbol(`openBlock` );
- const CREATE_BLOCK = Symbol(`createBlock` );
- const CREATE_ELEMENT_BLOCK = Symbol(
+ const OPEN_BLOCK = /* @__PURE__ */ Symbol(`openBlock` );
+ const CREATE_BLOCK = /* @__PURE__ */ Symbol(`createBlock` );
+ const CREATE_ELEMENT_BLOCK = /* @__PURE__ */ Symbol(
`createElementBlock`
);
- const CREATE_VNODE = Symbol(`createVNode` );
- const CREATE_ELEMENT_VNODE = Symbol(
+ const CREATE_VNODE = /* @__PURE__ */ Symbol(`createVNode` );
+ const CREATE_ELEMENT_VNODE = /* @__PURE__ */ Symbol(
`createElementVNode`
);
- const CREATE_COMMENT = Symbol(
+ const CREATE_COMMENT = /* @__PURE__ */ Symbol(
`createCommentVNode`
);
- const CREATE_TEXT = Symbol(
+ const CREATE_TEXT = /* @__PURE__ */ Symbol(
`createTextVNode`
);
- const CREATE_STATIC = Symbol(
+ const CREATE_STATIC = /* @__PURE__ */ Symbol(
`createStaticVNode`
);
- const RESOLVE_COMPONENT = Symbol(
+ const RESOLVE_COMPONENT = /* @__PURE__ */ Symbol(
`resolveComponent`
);
- const RESOLVE_DYNAMIC_COMPONENT = Symbol(
+ const RESOLVE_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol(
`resolveDynamicComponent`
);
- const RESOLVE_DIRECTIVE = Symbol(
+ const RESOLVE_DIRECTIVE = /* @__PURE__ */ Symbol(
`resolveDirective`
);
- const RESOLVE_FILTER = Symbol(
+ const RESOLVE_FILTER = /* @__PURE__ */ Symbol(
`resolveFilter`
);
- const WITH_DIRECTIVES = Symbol(
+ const WITH_DIRECTIVES = /* @__PURE__ */ Symbol(
`withDirectives`
);
- const RENDER_LIST = Symbol(`renderList` );
- const RENDER_SLOT = Symbol(`renderSlot` );
- const CREATE_SLOTS = Symbol(`createSlots` );
- const TO_DISPLAY_STRING = Symbol(
+ const RENDER_LIST = /* @__PURE__ */ Symbol(`renderList` );
+ const RENDER_SLOT = /* @__PURE__ */ Symbol(`renderSlot` );
+ const CREATE_SLOTS = /* @__PURE__ */ Symbol(`createSlots` );
+ const TO_DISPLAY_STRING = /* @__PURE__ */ Symbol(
`toDisplayString`
);
- const MERGE_PROPS = Symbol(`mergeProps` );
- const NORMALIZE_CLASS = Symbol(
+ const MERGE_PROPS = /* @__PURE__ */ Symbol(`mergeProps` );
+ const NORMALIZE_CLASS = /* @__PURE__ */ Symbol(
`normalizeClass`
);
- const NORMALIZE_STYLE = Symbol(
+ const NORMALIZE_STYLE = /* @__PURE__ */ Symbol(
`normalizeStyle`
);
- const NORMALIZE_PROPS = Symbol(
+ const NORMALIZE_PROPS = /* @__PURE__ */ Symbol(
`normalizeProps`
);
- const GUARD_REACTIVE_PROPS = Symbol(
+ const GUARD_REACTIVE_PROPS = /* @__PURE__ */ Symbol(
`guardReactiveProps`
);
- const TO_HANDLERS = Symbol(`toHandlers` );
- const CAMELIZE = Symbol(`camelize` );
- const CAPITALIZE = Symbol(`capitalize` );
- const TO_HANDLER_KEY = Symbol(
+ const TO_HANDLERS = /* @__PURE__ */ Symbol(`toHandlers` );
+ const CAMELIZE = /* @__PURE__ */ Symbol(`camelize` );
+ const CAPITALIZE = /* @__PURE__ */ Symbol(`capitalize` );
+ const TO_HANDLER_KEY = /* @__PURE__ */ Symbol(
`toHandlerKey`
);
- const SET_BLOCK_TRACKING = Symbol(
+ const SET_BLOCK_TRACKING = /* @__PURE__ */ Symbol(
`setBlockTracking`
);
- const PUSH_SCOPE_ID = Symbol(`pushScopeId` );
- const POP_SCOPE_ID = Symbol(`popScopeId` );
- const WITH_CTX = Symbol(`withCtx` );
- const UNREF = Symbol(`unref` );
- const IS_REF = Symbol(`isRef` );
- const WITH_MEMO = Symbol(`withMemo` );
- const IS_MEMO_SAME = Symbol(`isMemoSame` );
+ const PUSH_SCOPE_ID = /* @__PURE__ */ Symbol(`pushScopeId` );
+ const POP_SCOPE_ID = /* @__PURE__ */ Symbol(`popScopeId` );
+ const WITH_CTX = /* @__PURE__ */ Symbol(`withCtx` );
+ const UNREF = /* @__PURE__ */ Symbol(`unref` );
+ const IS_REF = /* @__PURE__ */ Symbol(`isRef` );
+ const WITH_MEMO = /* @__PURE__ */ Symbol(`withMemo` );
+ const IS_MEMO_SAME = /* @__PURE__ */ Symbol(`isMemoSame` );
const helperNameMap = {
[FRAGMENT]: `Fragment`,
[TELEPORT]: `Teleport`,
@@ -12921,13 +13125,27 @@
getPos(index) {
let line = 1;
let column = index + 1;
- for (let i = this.newlines.length - 1; i >= 0; i--) {
- const newlineIndex = this.newlines[i];
- if (index > newlineIndex) {
- line = i + 2;
- column = index - newlineIndex;
- break;
+ const length = this.newlines.length;
+ let j = -1;
+ if (length > 100) {
+ let l = -1;
+ let r = length;
+ while (l + 1 < r) {
+ const m = l + r >>> 1;
+ this.newlines[m] < index ? l = m : r = m;
}
+ j = l;
+ } else {
+ for (let i = length - 1; i >= 0; i--) {
+ if (index > this.newlines[i]) {
+ j = i;
+ break;
+ }
+ }
+ }
+ if (j >= 0) {
+ line = j + 2;
+ column = index - this.newlines[j];
}
return {
column,
@@ -13676,7 +13894,7 @@
[32]: `v-for has invalid expression.`,
[33]: `<template v-for> key should be placed on the <template> tag.`,
[34]: `v-bind is missing expression.`,
- [52]: `v-bind with same-name shorthand only allows static argument.`,
+ [53]: `v-bind with same-name shorthand only allows static argument.`,
[35]: `v-on is missing expression.`,
[36]: `Unexpected custom directive on <slot> outlet.`,
[37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
@@ -13688,16 +13906,17 @@
[43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
[44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
- [45]: `Error parsing JavaScript expression: `,
- [46]: `<KeepAlive> expects exactly one child component.`,
- [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
+ [45]: `v-model cannot be used on a const binding because it is not writable.`,
+ [46]: `Error parsing JavaScript expression: `,
+ [47]: `<KeepAlive> expects exactly one child component.`,
+ [52]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
// generic errors
- [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
- [48]: `ES module mode is not supported in this build of compiler.`,
- [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
- [50]: `"scopeId" option is only supported in module mode.`,
+ [48]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
+ [49]: `ES module mode is not supported in this build of compiler.`,
+ [50]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
+ [51]: `"scopeId" option is only supported in module mode.`,
// just to fulfill types
- [53]: ``
+ [54]: ``
};
const isStaticExp = (p) => p.type === 4 && p.isStatic;
@@ -15786,7 +16005,7 @@
}
context.onError(
createCompilerError(
- 45,
+ 46,
node.loc,
void 0,
message
@@ -16152,7 +16371,7 @@
loop.body = createBlockStatement([
createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
createCompoundExpression([
- `if (_cached`,
+ `if (_cached && _cached.el`,
...keyExp ? [` && _cached.key === `, keyExp] : [],
` && ${context.helperString(
IS_MEMO_SAME
@@ -16549,7 +16768,7 @@
patchFlag |= 1024;
if (node.children.length > 1) {
context.onError(
- createCompilerError(46, {
+ createCompilerError(47, {
start: node.children[0].loc.start,
end: node.children[node.children.length - 1].loc.end,
source: ""
@@ -17096,7 +17315,7 @@
if (arg.isStatic) {
let rawName = arg.content;
if (rawName.startsWith("vnode")) {
- context.onError(createCompilerError(51, arg.loc));
+ context.onError(createCompilerError(52, arg.loc));
}
if (rawName.startsWith("vue:")) {
rawName = `vnode-${rawName.slice(4)}`;
@@ -17329,6 +17548,10 @@
context.onError(createCompilerError(44, exp.loc));
return createTransformProps();
}
+ if (bindingType === "literal-const" || bindingType === "setup-const") {
+ context.onError(createCompilerError(45, exp.loc));
+ return createTransformProps();
+ }
if (!expString.trim() || !isMemberExpression(exp) && true) {
context.onError(
createCompilerError(42, exp.loc)
@@ -17408,7 +17631,7 @@
if (arg.type !== 4 || !arg.isStatic) {
context.onError(
createCompilerError(
- 52,
+ 53,
arg.loc
)
);
@@ -17452,17 +17675,17 @@
const isModuleMode = options.mode === "module";
{
if (options.prefixIdentifiers === true) {
- onError(createCompilerError(47));
- } else if (isModuleMode) {
onError(createCompilerError(48));
+ } else if (isModuleMode) {
+ onError(createCompilerError(49));
}
}
const prefixIdentifiers = false;
if (options.cacheHandlers) {
- onError(createCompilerError(49));
+ onError(createCompilerError(50));
}
if (options.scopeId && !isModuleMode) {
- onError(createCompilerError(50));
+ onError(createCompilerError(51));
}
const resolvedOptions = extend({}, options, {
prefixIdentifiers
@@ -17490,26 +17713,26 @@
const noopDirectiveTransform = () => ({ props: [] });
- const V_MODEL_RADIO = Symbol(`vModelRadio` );
- const V_MODEL_CHECKBOX = Symbol(
+ const V_MODEL_RADIO = /* @__PURE__ */ Symbol(`vModelRadio` );
+ const V_MODEL_CHECKBOX = /* @__PURE__ */ Symbol(
`vModelCheckbox`
);
- const V_MODEL_TEXT = Symbol(`vModelText` );
- const V_MODEL_SELECT = Symbol(
+ const V_MODEL_TEXT = /* @__PURE__ */ Symbol(`vModelText` );
+ const V_MODEL_SELECT = /* @__PURE__ */ Symbol(
`vModelSelect`
);
- const V_MODEL_DYNAMIC = Symbol(
+ const V_MODEL_DYNAMIC = /* @__PURE__ */ Symbol(
`vModelDynamic`
);
- const V_ON_WITH_MODIFIERS = Symbol(
+ const V_ON_WITH_MODIFIERS = /* @__PURE__ */ Symbol(
`vOnModifiersGuard`
);
- const V_ON_WITH_KEYS = Symbol(
+ const V_ON_WITH_KEYS = /* @__PURE__ */ Symbol(
`vOnKeysGuard`
);
- const V_SHOW = Symbol(`vShow` );
- const TRANSITION = Symbol(`Transition` );
- const TRANSITION_GROUP = Symbol(
+ const V_SHOW = /* @__PURE__ */ Symbol(`vShow` );
+ const TRANSITION = /* @__PURE__ */ Symbol(`Transition` );
+ const TRANSITION_GROUP = /* @__PURE__ */ Symbol(
`TransitionGroup`
);
registerRuntimeHelpers({
@@ -17620,29 +17843,29 @@
);
}
const DOMErrorMessages = {
- [53]: `v-html is missing expression.`,
- [54]: `v-html will override element children.`,
- [55]: `v-text is missing expression.`,
- [56]: `v-text will override element children.`,
- [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
- [58]: `v-model argument is not supported on plain elements.`,
- [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
- [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
- [61]: `v-show is missing expression.`,
- [62]: `<Transition> expects exactly one child element or component.`,
- [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
+ [54]: `v-html is missing expression.`,
+ [55]: `v-html will override element children.`,
+ [56]: `v-text is missing expression.`,
+ [57]: `v-text will override element children.`,
+ [58]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
+ [59]: `v-model argument is not supported on plain elements.`,
+ [60]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
+ [61]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
+ [62]: `v-show is missing expression.`,
+ [63]: `<Transition> expects exactly one child element or component.`,
+ [64]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
};
const transformVHtml = (dir, node, context) => {
const { exp, loc } = dir;
if (!exp) {
context.onError(
- createDOMCompilerError(53, loc)
+ createDOMCompilerError(54, loc)
);
}
if (node.children.length) {
context.onError(
- createDOMCompilerError(54, loc)
+ createDOMCompilerError(55, loc)
);
node.children.length = 0;
}
@@ -17660,12 +17883,12 @@
const { exp, loc } = dir;
if (!exp) {
context.onError(
- createDOMCompilerError(55, loc)
+ createDOMCompilerError(56, loc)
);
}
if (node.children.length) {
context.onError(
- createDOMCompilerError(56, loc)
+ createDOMCompilerError(57, loc)
);
node.children.length = 0;
}
@@ -17691,7 +17914,7 @@
if (dir.arg) {
context.onError(
createDOMCompilerError(
- 58,
+ 59,
dir.arg.loc
)
);
@@ -17701,7 +17924,7 @@
if (value && isStaticArgOf(value.arg, "value")) {
context.onError(
createDOMCompilerError(
- 60,
+ 61,
value.loc
)
);
@@ -17729,7 +17952,7 @@
isInvalidType = true;
context.onError(
createDOMCompilerError(
- 59,
+ 60,
dir.loc
)
);
@@ -17755,7 +17978,7 @@
} else {
context.onError(
createDOMCompilerError(
- 57,
+ 58,
dir.loc
)
);
@@ -17857,7 +18080,7 @@
const { exp, loc } = dir;
if (!exp) {
context.onError(
- createDOMCompilerError(61, loc)
+ createDOMCompilerError(62, loc)
);
}
return {
@@ -17877,7 +18100,7 @@
if (hasMultipleChildren(node)) {
context.onError(
createDOMCompilerError(
- 62,
+ 63,
{
start: node.children[0].loc.start,
end: node.children[node.children.length - 1].loc.end,
@@ -17916,7 +18139,7 @@
if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
context.onError(
createDOMCompilerError(
- 63,
+ 64,
node.loc
)
);
--
Gitblit v1.9.3