@vue/compat 3.6.0-beta.9 → 3.6.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/vue-compat.d.ts +25 -16
- package/dist/vue.cjs.js +459 -212
- package/dist/vue.cjs.prod.js +385 -164
- package/dist/vue.esm-browser.js +430 -204
- package/dist/vue.esm-browser.prod.js +6 -6
- package/dist/vue.esm-bundler.js +440 -208
- package/dist/vue.global.js +430 -204
- package/dist/vue.global.prod.js +6 -6
- package/dist/vue.runtime.esm-browser.js +430 -204
- package/dist/vue.runtime.esm-browser.prod.js +6 -6
- package/dist/vue.runtime.esm-bundler.js +440 -208
- package/dist/vue.runtime.global.js +430 -204
- package/dist/vue.runtime.global.prod.js +6 -6
- package/package.json +3 -3
package/dist/vue.cjs.prod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-
|
|
2
|
+
* @vue/compat v3.6.0-rc.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -432,6 +432,13 @@ function getSequence(arr) {
|
|
|
432
432
|
const notifyBuffer = [];
|
|
433
433
|
let batchDepth = 0;
|
|
434
434
|
let activeSub = void 0;
|
|
435
|
+
let runDepth = 0;
|
|
436
|
+
function incRunDepth() {
|
|
437
|
+
++runDepth;
|
|
438
|
+
}
|
|
439
|
+
function decRunDepth() {
|
|
440
|
+
--runDepth;
|
|
441
|
+
}
|
|
435
442
|
let globalVersion = 0;
|
|
436
443
|
let notifyIndex = 0;
|
|
437
444
|
let notifyBufferLength = 0;
|
|
@@ -505,8 +512,10 @@ function propagate(link) {
|
|
|
505
512
|
const sub = link.sub;
|
|
506
513
|
let flags = sub.flags;
|
|
507
514
|
if (flags & 3) {
|
|
508
|
-
if (!(flags & 60))
|
|
509
|
-
|
|
515
|
+
if (!(flags & 60)) {
|
|
516
|
+
sub.flags = flags | 32;
|
|
517
|
+
if (runDepth) sub.flags |= 8;
|
|
518
|
+
} else if (!(flags & 12)) flags = 0;
|
|
510
519
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
511
520
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
512
521
|
sub.flags = flags | 40;
|
|
@@ -574,13 +583,13 @@ function checkDirty(link, sub) {
|
|
|
574
583
|
let dirty = false;
|
|
575
584
|
if (sub.flags & 16) dirty = true;
|
|
576
585
|
else if ((depFlags & 17) === 17) {
|
|
586
|
+
const subs = dep.subs;
|
|
577
587
|
if (dep.update()) {
|
|
578
|
-
const subs = dep.subs;
|
|
579
588
|
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
580
589
|
dirty = true;
|
|
581
590
|
}
|
|
582
591
|
} else if ((depFlags & 33) === 33) {
|
|
583
|
-
|
|
592
|
+
stack = {
|
|
584
593
|
value: link,
|
|
585
594
|
prev: stack
|
|
586
595
|
};
|
|
@@ -595,15 +604,12 @@ function checkDirty(link, sub) {
|
|
|
595
604
|
}
|
|
596
605
|
while (checkDepth) {
|
|
597
606
|
--checkDepth;
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
if (hasMultipleSubs) {
|
|
601
|
-
link = stack.value;
|
|
602
|
-
stack = stack.prev;
|
|
603
|
-
} else link = firstSub;
|
|
607
|
+
link = stack.value;
|
|
608
|
+
stack = stack.prev;
|
|
604
609
|
if (dirty) {
|
|
610
|
+
const subs = sub.subs;
|
|
605
611
|
if (sub.update()) {
|
|
606
|
-
if (
|
|
612
|
+
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
607
613
|
sub = link.sub;
|
|
608
614
|
continue;
|
|
609
615
|
}
|
|
@@ -615,7 +621,7 @@ function checkDirty(link, sub) {
|
|
|
615
621
|
}
|
|
616
622
|
dirty = false;
|
|
617
623
|
}
|
|
618
|
-
return dirty;
|
|
624
|
+
return dirty && !!sub.flags;
|
|
619
625
|
} while (true);
|
|
620
626
|
}
|
|
621
627
|
function shallowPropagate(link) {
|
|
@@ -982,7 +988,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
982
988
|
}
|
|
983
989
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
984
990
|
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
985
|
-
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
991
|
+
if (target === /* @__PURE__ */ toRaw(receiver) && result) {
|
|
986
992
|
if (!hadKey) trigger(target, "add", key, value);
|
|
987
993
|
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
988
994
|
}
|
|
@@ -1187,9 +1193,6 @@ function targetTypeMap(rawType) {
|
|
|
1187
1193
|
default: return 0;
|
|
1188
1194
|
}
|
|
1189
1195
|
}
|
|
1190
|
-
function getTargetType(value) {
|
|
1191
|
-
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1192
|
-
}
|
|
1193
1196
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1194
1197
|
function reactive(target) {
|
|
1195
1198
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
@@ -1299,10 +1302,11 @@ function shallowReadonly(target) {
|
|
|
1299
1302
|
function createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) {
|
|
1300
1303
|
if (!isObject(target)) return target;
|
|
1301
1304
|
if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
|
|
1302
|
-
|
|
1303
|
-
if (targetType === 0) return target;
|
|
1305
|
+
if (target["__v_skip"] || !Object.isExtensible(target)) return target;
|
|
1304
1306
|
const existingProxy = proxyMap.get(target);
|
|
1305
1307
|
if (existingProxy) return existingProxy;
|
|
1308
|
+
const targetType = targetTypeMap(toRawType(target));
|
|
1309
|
+
if (targetType === 0) return target;
|
|
1306
1310
|
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
1307
1311
|
proxyMap.set(target, proxy);
|
|
1308
1312
|
return proxy;
|
|
@@ -1720,9 +1724,11 @@ var ReactiveEffect = class {
|
|
|
1720
1724
|
if (!this.active) return this.fn();
|
|
1721
1725
|
cleanup(this);
|
|
1722
1726
|
const prevSub = startTracking(this);
|
|
1727
|
+
incRunDepth();
|
|
1723
1728
|
try {
|
|
1724
1729
|
return this.fn();
|
|
1725
1730
|
} finally {
|
|
1731
|
+
decRunDepth();
|
|
1726
1732
|
endTracking(this, prevSub);
|
|
1727
1733
|
const flags = this.flags;
|
|
1728
1734
|
if ((flags & 136) === 136) {
|
|
@@ -2084,8 +2090,9 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2084
2090
|
if (once && cb) {
|
|
2085
2091
|
const _cb = cb;
|
|
2086
2092
|
cb = (...args) => {
|
|
2087
|
-
_cb(...args);
|
|
2093
|
+
const res = _cb(...args);
|
|
2088
2094
|
this.stop();
|
|
2095
|
+
return res;
|
|
2089
2096
|
};
|
|
2090
2097
|
}
|
|
2091
2098
|
this.cb = cb;
|
|
@@ -2097,7 +2104,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2097
2104
|
if (!this.cb) return;
|
|
2098
2105
|
const { immediate, deep, call } = this.options;
|
|
2099
2106
|
if (initialRun && !immediate) return;
|
|
2100
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2107
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2101
2108
|
cleanup(this);
|
|
2102
2109
|
const currentWatcher = activeWatcher;
|
|
2103
2110
|
activeWatcher = this;
|
|
@@ -2297,8 +2304,8 @@ function findInsertionIndex(order, queue, start, end) {
|
|
|
2297
2304
|
/**
|
|
2298
2305
|
* @internal for runtime-vapor only
|
|
2299
2306
|
*/
|
|
2300
|
-
function queueJob(job, id, isPre = false) {
|
|
2301
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2307
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
2308
|
+
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2302
2309
|
jobsLength++;
|
|
2303
2310
|
queueFlush();
|
|
2304
2311
|
}
|
|
@@ -2401,6 +2408,7 @@ function flushJobs(seen) {
|
|
|
2401
2408
|
}
|
|
2402
2409
|
flushIndex = 0;
|
|
2403
2410
|
jobsLength = 0;
|
|
2411
|
+
jobs.length = 0;
|
|
2404
2412
|
flushPostFlushCbs(seen);
|
|
2405
2413
|
currentFlushPromise = null;
|
|
2406
2414
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -2598,10 +2606,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
2598
2606
|
const renderFnWithContext = (...args) => {
|
|
2599
2607
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
2600
2608
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
2609
|
+
const prevStackSize = blockStack.length;
|
|
2601
2610
|
let res;
|
|
2602
2611
|
try {
|
|
2603
2612
|
res = fn(...args);
|
|
2604
2613
|
} finally {
|
|
2614
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2605
2615
|
setCurrentRenderingInstance(prevInstance);
|
|
2606
2616
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
2607
2617
|
}
|
|
@@ -2818,6 +2828,7 @@ function createPathGetter(ctx, path) {
|
|
|
2818
2828
|
}
|
|
2819
2829
|
//#endregion
|
|
2820
2830
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
2831
|
+
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
2821
2832
|
const TeleportEndKey = Symbol("_vte");
|
|
2822
2833
|
const isTeleport = (type) => type.__isTeleport;
|
|
2823
2834
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
@@ -2834,54 +2845,66 @@ const TeleportImpl = {
|
|
|
2834
2845
|
name: "Teleport",
|
|
2835
2846
|
__isTeleport: true,
|
|
2836
2847
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
2837
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
2848
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
2838
2849
|
const disabled = isTeleportDisabled(n2.props);
|
|
2839
|
-
let {
|
|
2850
|
+
let { dynamicChildren } = n2;
|
|
2851
|
+
const mount = (vnode, container, anchor) => {
|
|
2852
|
+
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
2853
|
+
};
|
|
2854
|
+
const mountToTarget = (vnode = n2) => {
|
|
2855
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
2856
|
+
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
2857
|
+
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
|
|
2858
|
+
if (target) {
|
|
2859
|
+
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
2860
|
+
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
2861
|
+
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
2862
|
+
if (!disabled) {
|
|
2863
|
+
mount(vnode, target, targetAnchor);
|
|
2864
|
+
updateCssVars(vnode, false);
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
};
|
|
2868
|
+
const queuePendingMount = (vnode) => {
|
|
2869
|
+
const mountJob = () => {
|
|
2870
|
+
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
2871
|
+
pendingMounts.delete(vnode);
|
|
2872
|
+
if (isTeleportDisabled(vnode.props)) {
|
|
2873
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
2874
|
+
updateCssVars(vnode, true);
|
|
2875
|
+
}
|
|
2876
|
+
mountToTarget(vnode);
|
|
2877
|
+
};
|
|
2878
|
+
pendingMounts.set(vnode, mountJob);
|
|
2879
|
+
queuePostRenderEffect(mountJob, void 0, parentSuspense);
|
|
2880
|
+
};
|
|
2840
2881
|
if (n1 == null) {
|
|
2841
2882
|
const placeholder = n2.el = createText("");
|
|
2842
2883
|
const mainAnchor = n2.anchor = createText("");
|
|
2843
2884
|
insert(placeholder, container, anchor);
|
|
2844
2885
|
insert(mainAnchor, container, anchor);
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
2850
|
-
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
2851
|
-
if (target) {
|
|
2852
|
-
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
2853
|
-
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
2854
|
-
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
2855
|
-
if (!disabled) {
|
|
2856
|
-
mount(target, targetAnchor);
|
|
2857
|
-
updateCssVars(n2, false);
|
|
2858
|
-
}
|
|
2859
|
-
}
|
|
2860
|
-
};
|
|
2886
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
2887
|
+
queuePendingMount(n2);
|
|
2888
|
+
return;
|
|
2889
|
+
}
|
|
2861
2890
|
if (disabled) {
|
|
2862
|
-
mount(container, mainAnchor);
|
|
2891
|
+
mount(n2, container, mainAnchor);
|
|
2863
2892
|
updateCssVars(n2, true);
|
|
2864
2893
|
}
|
|
2865
|
-
|
|
2866
|
-
n2.el.__isMounted = false;
|
|
2867
|
-
queuePostRenderEffect(() => {
|
|
2868
|
-
if (n2.el.__isMounted !== false) return;
|
|
2869
|
-
mountToTarget();
|
|
2870
|
-
delete n2.el.__isMounted;
|
|
2871
|
-
}, void 0, parentSuspense);
|
|
2872
|
-
} else mountToTarget();
|
|
2894
|
+
mountToTarget();
|
|
2873
2895
|
} else {
|
|
2874
2896
|
n2.el = n1.el;
|
|
2875
|
-
n2.targetStart = n1.targetStart;
|
|
2876
2897
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
2877
|
-
const
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
}, void 0, parentSuspense);
|
|
2898
|
+
const pendingMount = pendingMounts.get(n1);
|
|
2899
|
+
if (pendingMount) {
|
|
2900
|
+
pendingMount.flags |= 4;
|
|
2901
|
+
pendingMounts.delete(n1);
|
|
2902
|
+
queuePendingMount(n2);
|
|
2883
2903
|
return;
|
|
2884
2904
|
}
|
|
2905
|
+
n2.targetStart = n1.targetStart;
|
|
2906
|
+
const target = n2.target = n1.target;
|
|
2907
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
2885
2908
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
2886
2909
|
const currentContainer = wasDisabled ? container : target;
|
|
2887
2910
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -2895,23 +2918,30 @@ const TeleportImpl = {
|
|
|
2895
2918
|
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
|
|
2896
2919
|
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
|
|
2897
2920
|
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
2898
|
-
const nextTarget =
|
|
2899
|
-
if (nextTarget)
|
|
2921
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
2922
|
+
if (nextTarget) {
|
|
2923
|
+
n2.target = nextTarget;
|
|
2924
|
+
moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
2925
|
+
}
|
|
2900
2926
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
2901
2927
|
updateCssVars(n2, disabled);
|
|
2902
2928
|
}
|
|
2903
2929
|
},
|
|
2904
2930
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
2905
|
-
const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
|
|
2931
|
+
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
|
|
2932
|
+
const disabled = isTeleportDisabled(props);
|
|
2933
|
+
const shouldRemove = doRemove || !disabled;
|
|
2934
|
+
const pendingMount = pendingMounts.get(vnode);
|
|
2935
|
+
if (pendingMount) {
|
|
2936
|
+
pendingMount.flags |= 4;
|
|
2937
|
+
pendingMounts.delete(vnode);
|
|
2938
|
+
}
|
|
2906
2939
|
if (targetStart) hostRemove(targetStart);
|
|
2907
2940
|
if (targetAnchor) hostRemove(targetAnchor);
|
|
2908
2941
|
doRemove && hostRemove(anchor);
|
|
2909
|
-
if (shapeFlag & 16) {
|
|
2910
|
-
const
|
|
2911
|
-
|
|
2912
|
-
const child = children[i];
|
|
2913
|
-
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
2914
|
-
}
|
|
2942
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
2943
|
+
const child = children[i];
|
|
2944
|
+
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
2915
2945
|
}
|
|
2916
2946
|
},
|
|
2917
2947
|
move: moveTeleport,
|
|
@@ -2922,7 +2952,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
2922
2952
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
2923
2953
|
const isReorder = moveType === 2;
|
|
2924
2954
|
if (isReorder) insert(el, container, parentAnchor);
|
|
2925
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
2955
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
2926
2956
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
2927
2957
|
}
|
|
2928
2958
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -3047,8 +3077,8 @@ const BaseTransitionImpl = {
|
|
|
3047
3077
|
const state = useTransitionState();
|
|
3048
3078
|
return () => {
|
|
3049
3079
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
3050
|
-
|
|
3051
|
-
|
|
3080
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3081
|
+
if (!child) return;
|
|
3052
3082
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3053
3083
|
const { mode } = rawProps;
|
|
3054
3084
|
if (state.isLeaving) return emptyPlaceholder(child);
|
|
@@ -3473,7 +3503,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3473
3503
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3474
3504
|
break;
|
|
3475
3505
|
case VaporSlot:
|
|
3476
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
|
|
3506
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
3477
3507
|
break;
|
|
3478
3508
|
default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
|
|
3479
3509
|
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -3483,16 +3513,31 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3483
3513
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
3484
3514
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
3485
3515
|
else nextNode = nextSibling(node);
|
|
3486
|
-
if (vnode.type.__vapor)
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
}
|
|
3494
|
-
|
|
3495
|
-
|
|
3516
|
+
if (vnode.type.__vapor) {
|
|
3517
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
|
|
3518
|
+
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
3519
|
+
if (vnode.dirs) {
|
|
3520
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
3521
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
3522
|
+
}
|
|
3523
|
+
}, () => {
|
|
3524
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
3525
|
+
});
|
|
3526
|
+
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
3527
|
+
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
3528
|
+
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
3529
|
+
} else {
|
|
3530
|
+
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
3531
|
+
const component = vnode.component;
|
|
3532
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
|
|
3533
|
+
let subTree;
|
|
3534
|
+
if (isFragmentStart) {
|
|
3535
|
+
subTree = createVNode(Fragment);
|
|
3536
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
3537
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
3538
|
+
subTree.el = node;
|
|
3539
|
+
component.subTree = subTree;
|
|
3540
|
+
}
|
|
3496
3541
|
}
|
|
3497
3542
|
} else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
|
|
3498
3543
|
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
@@ -3503,9 +3548,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3503
3548
|
};
|
|
3504
3549
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
3505
3550
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
3506
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
3551
|
+
const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
3507
3552
|
const forcePatch = type === "input" || type === "option";
|
|
3508
|
-
|
|
3553
|
+
const hasDynamicProps = !!dynamicProps;
|
|
3554
|
+
if (forcePatch || hasDynamicProps || patchFlag !== -1) {
|
|
3509
3555
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
3510
3556
|
let needCallTransitionHooks = false;
|
|
3511
3557
|
if (isTemplateNode$1(el)) {
|
|
@@ -3521,8 +3567,8 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3521
3567
|
}
|
|
3522
3568
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
3523
3569
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3570
|
+
if (next && !isMismatchAllowed(el, 1)) logMismatchError();
|
|
3524
3571
|
while (next) {
|
|
3525
|
-
if (!isMismatchAllowed(el, 1)) logMismatchError();
|
|
3526
3572
|
const cur = next;
|
|
3527
3573
|
next = next.nextSibling;
|
|
3528
3574
|
remove(cur);
|
|
@@ -3537,9 +3583,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3537
3583
|
}
|
|
3538
3584
|
}
|
|
3539
3585
|
if (props) {
|
|
3540
|
-
if (forcePatch || !optimized || patchFlag & 48) {
|
|
3586
|
+
if (forcePatch || hasDynamicProps || !optimized || patchFlag & 48) {
|
|
3541
3587
|
const isCustomElement = el.tagName.includes("-");
|
|
3542
|
-
|
|
3588
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
3589
|
+
for (const key in props) if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
3543
3590
|
} else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
|
|
3544
3591
|
else if (patchFlag & 4 && /* @__PURE__ */ isReactive(props.style)) for (const key in props.style) props.style[key];
|
|
3545
3592
|
}
|
|
@@ -3558,6 +3605,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3558
3605
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
3559
3606
|
const children = parentVNode.children;
|
|
3560
3607
|
const l = children.length;
|
|
3608
|
+
let hasCheckedMismatch = false;
|
|
3561
3609
|
for (let i = 0; i < l; i++) {
|
|
3562
3610
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
3563
3611
|
const isText = vnode.type === Text;
|
|
@@ -3571,7 +3619,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3571
3619
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3572
3620
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
3573
3621
|
else {
|
|
3574
|
-
if (!
|
|
3622
|
+
if (!hasCheckedMismatch) {
|
|
3623
|
+
hasCheckedMismatch = true;
|
|
3624
|
+
if (!isMismatchAllowed(container, 1)) logMismatchError();
|
|
3625
|
+
}
|
|
3575
3626
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
3576
3627
|
}
|
|
3577
3628
|
}
|
|
@@ -3590,7 +3641,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3590
3641
|
}
|
|
3591
3642
|
};
|
|
3592
3643
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
3593
|
-
if (!
|
|
3644
|
+
if (!isNodeMismatchAllowed(node, vnode)) logMismatchError();
|
|
3594
3645
|
vnode.el = null;
|
|
3595
3646
|
if (isFragment) {
|
|
3596
3647
|
const end = locateClosingAnchor(node);
|
|
@@ -3646,7 +3697,9 @@ const MismatchTypeString = {
|
|
|
3646
3697
|
};
|
|
3647
3698
|
function isMismatchAllowed(el, allowedType) {
|
|
3648
3699
|
if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
|
|
3649
|
-
|
|
3700
|
+
return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
|
|
3701
|
+
}
|
|
3702
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
3650
3703
|
if (allowedAttr == null) return false;
|
|
3651
3704
|
else if (allowedAttr === "") return true;
|
|
3652
3705
|
else {
|
|
@@ -3655,6 +3708,16 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
3655
3708
|
return list.includes(MismatchTypeString[allowedType]);
|
|
3656
3709
|
}
|
|
3657
3710
|
}
|
|
3711
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
3712
|
+
return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
3713
|
+
}
|
|
3714
|
+
function isMismatchAllowedByNode(node) {
|
|
3715
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
|
|
3716
|
+
}
|
|
3717
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
3718
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
3719
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
|
|
3720
|
+
}
|
|
3658
3721
|
//#endregion
|
|
3659
3722
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
3660
3723
|
let requestIdleCallback;
|
|
@@ -3773,11 +3836,16 @@ function defineAsyncComponent(source) {
|
|
|
3773
3836
|
onError(err);
|
|
3774
3837
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
3775
3838
|
});
|
|
3776
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
3839
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
3777
3840
|
load().then(() => {
|
|
3841
|
+
if (instance.isUnmounted) return;
|
|
3778
3842
|
loaded.value = true;
|
|
3779
3843
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
3780
3844
|
}).catch((err) => {
|
|
3845
|
+
if (instance.isUnmounted) {
|
|
3846
|
+
setPendingRequest(null);
|
|
3847
|
+
return;
|
|
3848
|
+
}
|
|
3781
3849
|
onError(err);
|
|
3782
3850
|
error.value = err;
|
|
3783
3851
|
});
|
|
@@ -3833,14 +3901,22 @@ function createAsyncComponentContext(source) {
|
|
|
3833
3901
|
setPendingRequest: (request) => pendingRequest = request
|
|
3834
3902
|
};
|
|
3835
3903
|
}
|
|
3836
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
3904
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
3837
3905
|
const loaded = /* @__PURE__ */ ref(false);
|
|
3838
3906
|
const error = /* @__PURE__ */ ref();
|
|
3839
3907
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
3840
|
-
|
|
3908
|
+
let timeoutTimer;
|
|
3909
|
+
let delayTimer;
|
|
3910
|
+
if (instance) onUnmounted(() => {
|
|
3911
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
3912
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
3913
|
+
}, instance);
|
|
3914
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
3915
|
+
if (instance && instance.isUnmounted) return;
|
|
3841
3916
|
delayed.value = false;
|
|
3842
3917
|
}, delay);
|
|
3843
|
-
if (timeout != null) setTimeout(() => {
|
|
3918
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
3919
|
+
if (instance && instance.isUnmounted) return;
|
|
3844
3920
|
if (!loaded.value && !error.value) {
|
|
3845
3921
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
3846
3922
|
onError(err);
|
|
@@ -3858,10 +3934,12 @@ const useAsyncComponentState = (delay, timeout, onError) => {
|
|
|
3858
3934
|
* @internal
|
|
3859
3935
|
*/
|
|
3860
3936
|
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
3937
|
+
const wasConnected = el.isConnected;
|
|
3861
3938
|
let patched = false;
|
|
3862
3939
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
3863
3940
|
const performHydrate = () => {
|
|
3864
3941
|
if (patched) return;
|
|
3942
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
3865
3943
|
hydrate();
|
|
3866
3944
|
};
|
|
3867
3945
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -4434,8 +4512,9 @@ function createSlots(slots, dynamicSlots) {
|
|
|
4434
4512
|
* Compiler runtime helper for rendering `<slot/>`
|
|
4435
4513
|
* @private
|
|
4436
4514
|
*/
|
|
4437
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
4515
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
4438
4516
|
let slot = slots[name];
|
|
4517
|
+
if (fallback) fallback.__vdom = true;
|
|
4439
4518
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
4440
4519
|
if (vaporSlot) {
|
|
4441
4520
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -4443,21 +4522,31 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
4443
4522
|
slot: vaporSlot,
|
|
4444
4523
|
fallback
|
|
4445
4524
|
};
|
|
4525
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
4446
4526
|
return ret;
|
|
4447
4527
|
}
|
|
4448
4528
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
4449
|
-
const
|
|
4450
|
-
|
|
4451
|
-
|
|
4529
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
4530
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
4531
|
+
if (name !== "default") slotProps.name = name;
|
|
4532
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
4452
4533
|
}
|
|
4453
4534
|
if (slot && slot._c) slot._d = false;
|
|
4535
|
+
const prevStackSize = blockStack.length;
|
|
4454
4536
|
openBlock();
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4537
|
+
let rendered;
|
|
4538
|
+
try {
|
|
4539
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
4540
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
4541
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
4542
|
+
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
4543
|
+
} catch (err) {
|
|
4544
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
4545
|
+
throw err;
|
|
4546
|
+
} finally {
|
|
4547
|
+
if (slot && slot._c) slot._d = true;
|
|
4548
|
+
}
|
|
4459
4549
|
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
4460
|
-
if (slot && slot._c) slot._d = true;
|
|
4461
4550
|
return rendered;
|
|
4462
4551
|
}
|
|
4463
4552
|
function ensureValidVNode(vnodes) {
|
|
@@ -4470,9 +4559,7 @@ function ensureValidVNode(vnodes) {
|
|
|
4470
4559
|
}
|
|
4471
4560
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
4472
4561
|
let vaporSlot;
|
|
4473
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
4474
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
4475
|
-
}
|
|
4562
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
4476
4563
|
}
|
|
4477
4564
|
//#endregion
|
|
4478
4565
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -4934,25 +5021,38 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
4934
5021
|
function withAsyncContext(getAwaitable) {
|
|
4935
5022
|
const ctx = getCurrentGenericInstance();
|
|
4936
5023
|
const inSSRSetup = isInSSRComponentSetup;
|
|
5024
|
+
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
4937
5025
|
let awaitable = getAwaitable();
|
|
4938
5026
|
setCurrentInstance(null, void 0);
|
|
4939
5027
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
4940
5028
|
const restore = () => {
|
|
5029
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
4941
5030
|
setCurrentInstance(ctx);
|
|
4942
5031
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
5032
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
5033
|
+
return () => {
|
|
5034
|
+
if (reset) reset();
|
|
5035
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
5036
|
+
};
|
|
4943
5037
|
};
|
|
4944
5038
|
const cleanup = () => {
|
|
4945
5039
|
setCurrentInstance(null, void 0);
|
|
4946
5040
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
4947
5041
|
};
|
|
4948
5042
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
4949
|
-
restore();
|
|
4950
|
-
Promise.resolve().then(() => Promise.resolve().then(
|
|
5043
|
+
const reset = restore();
|
|
5044
|
+
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
5045
|
+
if (reset) reset();
|
|
5046
|
+
cleanup();
|
|
5047
|
+
}));
|
|
4951
5048
|
throw e;
|
|
4952
5049
|
});
|
|
4953
5050
|
return [awaitable, () => {
|
|
4954
|
-
restore();
|
|
4955
|
-
Promise.resolve().then(
|
|
5051
|
+
const reset = restore();
|
|
5052
|
+
Promise.resolve().then(() => {
|
|
5053
|
+
if (reset) reset();
|
|
5054
|
+
cleanup();
|
|
5055
|
+
});
|
|
4956
5056
|
}];
|
|
4957
5057
|
}
|
|
4958
5058
|
//#endregion
|
|
@@ -5203,7 +5303,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
5203
5303
|
if (options.el) return vm.$mount(options.el);
|
|
5204
5304
|
else return vm;
|
|
5205
5305
|
}
|
|
5206
|
-
Vue.version = `2.6.14-compat:3.6.0-
|
|
5306
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.1`;
|
|
5207
5307
|
Vue.config = singletonApp.config;
|
|
5208
5308
|
Vue.use = (plugin, ...options) => {
|
|
5209
5309
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -5638,12 +5738,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
5638
5738
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
5639
5739
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
5640
5740
|
}
|
|
5641
|
-
|
|
5741
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
5742
|
+
if (!hasVModel) {
|
|
5642
5743
|
localValue = value;
|
|
5643
5744
|
trigger();
|
|
5644
5745
|
}
|
|
5645
5746
|
i.emit(`update:${name}`, emittedValue);
|
|
5646
|
-
if (hasChanged(value,
|
|
5747
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
5647
5748
|
prevSetValue = value;
|
|
5648
5749
|
prevEmittedValue = emittedValue;
|
|
5649
5750
|
}
|
|
@@ -5740,7 +5841,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
5740
5841
|
function isEmitListener(options, key) {
|
|
5741
5842
|
if (!options || !isOn(key)) return false;
|
|
5742
5843
|
if (key.startsWith(compatModelEventPrefix)) return true;
|
|
5743
|
-
key = key.slice(2)
|
|
5844
|
+
key = key.slice(2);
|
|
5845
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
5744
5846
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
5745
5847
|
}
|
|
5746
5848
|
//#endregion
|
|
@@ -6330,6 +6432,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6330
6432
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
6331
6433
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
6332
6434
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
6435
|
+
if (dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
6436
|
+
patchFlag = 0;
|
|
6437
|
+
optimized = false;
|
|
6438
|
+
dynamicChildren = null;
|
|
6439
|
+
}
|
|
6333
6440
|
if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) hostSetElementText(el, "");
|
|
6334
6441
|
if (dynamicChildren) patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, resolveChildrenNamespace(n2, namespace), slotScopeIds);
|
|
6335
6442
|
else if (!optimized) patchChildren(n1, n2, el, null, parentComponent, parentSuspense, resolveChildrenNamespace(n2, namespace), slotScopeIds, false);
|
|
@@ -6398,19 +6505,35 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6398
6505
|
n2.slotScopeIds = slotScopeIds;
|
|
6399
6506
|
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
6400
6507
|
else {
|
|
6508
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
6401
6509
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
6402
6510
|
if (n2.dirs) {
|
|
6403
6511
|
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
6404
6512
|
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
6405
6513
|
}
|
|
6514
|
+
}, () => {
|
|
6515
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
6406
6516
|
});
|
|
6407
6517
|
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
6518
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
6519
|
+
if (vnodeMountedHook) {
|
|
6520
|
+
const scopedVNode = n2;
|
|
6521
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
6522
|
+
}
|
|
6408
6523
|
}
|
|
6409
6524
|
else {
|
|
6410
|
-
|
|
6525
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
6526
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
6411
6527
|
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
6528
|
+
}, () => {
|
|
6529
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
6530
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
6412
6531
|
});
|
|
6413
|
-
|
|
6532
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
6533
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
6534
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
6535
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
6536
|
+
}, void 0, parentSuspense);
|
|
6414
6537
|
}
|
|
6415
6538
|
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
6416
6539
|
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
@@ -6731,8 +6854,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6731
6854
|
else hostInsert(el, container, anchor);
|
|
6732
6855
|
};
|
|
6733
6856
|
const performLeave = () => {
|
|
6857
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
6734
6858
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
6735
|
-
|
|
6859
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
6860
|
+
else leave(el, () => {
|
|
6736
6861
|
remove();
|
|
6737
6862
|
afterLeave && afterLeave();
|
|
6738
6863
|
});
|
|
@@ -6763,7 +6888,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6763
6888
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
6764
6889
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
6765
6890
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
6766
|
-
if (
|
|
6891
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
6892
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
6893
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
6894
|
+
}, void 0, parentSuspense);
|
|
6767
6895
|
return;
|
|
6768
6896
|
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
6769
6897
|
else {
|
|
@@ -6820,7 +6948,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6820
6948
|
if (effect) {
|
|
6821
6949
|
effect.stop();
|
|
6822
6950
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
6823
|
-
}
|
|
6951
|
+
} else if (doRemove && subTree && instance.vnode.el) remove(subTree);
|
|
6824
6952
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
6825
6953
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
6826
6954
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
@@ -6940,6 +7068,10 @@ function invalidateMount(hooks) {
|
|
|
6940
7068
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
6941
7069
|
}
|
|
6942
7070
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
7071
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
7072
|
+
insert();
|
|
7073
|
+
return;
|
|
7074
|
+
}
|
|
6943
7075
|
if (force || needTransition(parentSuspense, transition)) {
|
|
6944
7076
|
transition.beforeEnter(el);
|
|
6945
7077
|
insert();
|
|
@@ -7129,15 +7261,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7129
7261
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
7130
7262
|
else if (!resume) {
|
|
7131
7263
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
7264
|
+
let hasUpdatedAnchor = false;
|
|
7132
7265
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
7133
7266
|
if (pendingId === suspense.pendingId) {
|
|
7134
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7267
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7135
7268
|
queuePostFlushCb(effects);
|
|
7136
7269
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
7137
7270
|
}
|
|
7138
7271
|
};
|
|
7139
7272
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
7140
|
-
if (parentNode(activeBranch.el) === container)
|
|
7273
|
+
if (parentNode(activeBranch.el) === container) {
|
|
7274
|
+
anchor = next(activeBranch);
|
|
7275
|
+
hasUpdatedAnchor = true;
|
|
7276
|
+
}
|
|
7141
7277
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
7142
7278
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
7143
7279
|
}
|
|
@@ -7201,6 +7337,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7201
7337
|
handleError(err, instance, 0);
|
|
7202
7338
|
}).then((asyncSetupResult) => {
|
|
7203
7339
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
7340
|
+
setCurrentInstance(null, void 0);
|
|
7204
7341
|
instance.asyncResolved = true;
|
|
7205
7342
|
onResolve(asyncSetupResult);
|
|
7206
7343
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -7507,12 +7644,30 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
7507
7644
|
el: vnode.el,
|
|
7508
7645
|
anchor: vnode.anchor,
|
|
7509
7646
|
ctx: vnode.ctx,
|
|
7510
|
-
ce: vnode.ce
|
|
7647
|
+
ce: vnode.ce,
|
|
7648
|
+
vi: vnode.vi,
|
|
7649
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
7650
|
+
vb: vnode.vb
|
|
7511
7651
|
};
|
|
7512
7652
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
7513
7653
|
defineLegacyVNodeProperties(cloned);
|
|
7514
7654
|
return cloned;
|
|
7515
7655
|
}
|
|
7656
|
+
function cloneVaporSlotMeta(vnode) {
|
|
7657
|
+
const vaporSlot = vnode.vs;
|
|
7658
|
+
if (!vaporSlot) return vaporSlot;
|
|
7659
|
+
const cloned = {
|
|
7660
|
+
slot: vaporSlot.slot,
|
|
7661
|
+
fallback: vaporSlot.fallback,
|
|
7662
|
+
outletFallback: vaporSlot.outletFallback
|
|
7663
|
+
};
|
|
7664
|
+
if (vnode.el) {
|
|
7665
|
+
cloned.state = vaporSlot.state;
|
|
7666
|
+
cloned.ref = vaporSlot.ref;
|
|
7667
|
+
cloned.scope = vaporSlot.scope;
|
|
7668
|
+
}
|
|
7669
|
+
return cloned;
|
|
7670
|
+
}
|
|
7516
7671
|
/**
|
|
7517
7672
|
* @private
|
|
7518
7673
|
*/
|
|
@@ -7566,6 +7721,10 @@ function normalizeChildren(vnode, children) {
|
|
|
7566
7721
|
}
|
|
7567
7722
|
}
|
|
7568
7723
|
else if (isFunction(children)) {
|
|
7724
|
+
if (shapeFlag & 65) {
|
|
7725
|
+
normalizeChildren(vnode, { default: children });
|
|
7726
|
+
return;
|
|
7727
|
+
}
|
|
7569
7728
|
children = {
|
|
7570
7729
|
default: children,
|
|
7571
7730
|
_ctx: currentRenderingInstance
|
|
@@ -7927,7 +8086,7 @@ function isMemoSame(cached, memo) {
|
|
|
7927
8086
|
}
|
|
7928
8087
|
//#endregion
|
|
7929
8088
|
//#region packages/runtime-core/src/index.ts
|
|
7930
|
-
const version = "3.6.0-
|
|
8089
|
+
const version = "3.6.0-rc.1";
|
|
7931
8090
|
const warn = NOOP;
|
|
7932
8091
|
/**
|
|
7933
8092
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -8350,7 +8509,10 @@ function patchStyle(el, prev, next) {
|
|
|
8350
8509
|
}
|
|
8351
8510
|
for (const key in next) {
|
|
8352
8511
|
if (key === "display") hasControlledDisplay = true;
|
|
8353
|
-
|
|
8512
|
+
const value = next[key];
|
|
8513
|
+
if (value != null) {
|
|
8514
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
8515
|
+
} else setStyle(style, key, "");
|
|
8354
8516
|
}
|
|
8355
8517
|
} else if (isCssString) {
|
|
8356
8518
|
if (prev !== next) {
|
|
@@ -8396,6 +8558,14 @@ function autoPrefix(style, rawName) {
|
|
|
8396
8558
|
}
|
|
8397
8559
|
return rawName;
|
|
8398
8560
|
}
|
|
8561
|
+
/**
|
|
8562
|
+
* Browsers update textarea width/height directly during native resize.
|
|
8563
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
8564
|
+
* still follow normal vnode style patching.
|
|
8565
|
+
*/
|
|
8566
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
8567
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
|
|
8568
|
+
}
|
|
8399
8569
|
//#endregion
|
|
8400
8570
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
8401
8571
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
@@ -8476,7 +8646,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
8476
8646
|
const existingInvoker = invokers[rawName];
|
|
8477
8647
|
if (nextValue && existingInvoker) existingInvoker.value = nextValue;
|
|
8478
8648
|
else {
|
|
8479
|
-
const [name, options] =
|
|
8649
|
+
const [name, options] = parseEventName(rawName);
|
|
8480
8650
|
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(nextValue, instance), options);
|
|
8481
8651
|
else if (existingInvoker) {
|
|
8482
8652
|
removeEventListener(el, name, existingInvoker, options);
|
|
@@ -8484,16 +8654,15 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
8484
8654
|
}
|
|
8485
8655
|
}
|
|
8486
8656
|
}
|
|
8487
|
-
const optionsModifierRE = /(
|
|
8488
|
-
|
|
8657
|
+
const optionsModifierRE = /(Once|Passive|Capture)$/;
|
|
8658
|
+
const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
|
|
8659
|
+
function parseEventName(name) {
|
|
8489
8660
|
let options;
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
options[m[0].toLowerCase()] = true;
|
|
8496
|
-
}
|
|
8661
|
+
let m;
|
|
8662
|
+
while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
|
|
8663
|
+
if (!options) options = {};
|
|
8664
|
+
name = name.slice(0, name.length - m[1].length);
|
|
8665
|
+
options[m[1].toLowerCase()] = true;
|
|
8497
8666
|
}
|
|
8498
8667
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
8499
8668
|
}
|
|
@@ -8504,22 +8673,26 @@ function createInvoker(initialValue, instance) {
|
|
|
8504
8673
|
const invoker = (e) => {
|
|
8505
8674
|
if (!e._vts) e._vts = Date.now();
|
|
8506
8675
|
else if (e._vts <= invoker.attached) return;
|
|
8507
|
-
|
|
8676
|
+
const value = invoker.value;
|
|
8677
|
+
if (isArray(value)) {
|
|
8678
|
+
const originalStop = e.stopImmediatePropagation;
|
|
8679
|
+
e.stopImmediatePropagation = () => {
|
|
8680
|
+
originalStop.call(e);
|
|
8681
|
+
e._stopped = true;
|
|
8682
|
+
};
|
|
8683
|
+
const handlers = value.slice();
|
|
8684
|
+
const args = [e];
|
|
8685
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
8686
|
+
if (e._stopped) break;
|
|
8687
|
+
const handler = handlers[i];
|
|
8688
|
+
if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
|
|
8689
|
+
}
|
|
8690
|
+
} else callWithAsyncErrorHandling(value, instance, 5, [e]);
|
|
8508
8691
|
};
|
|
8509
8692
|
invoker.value = initialValue;
|
|
8510
8693
|
invoker.attached = getNow();
|
|
8511
8694
|
return invoker;
|
|
8512
8695
|
}
|
|
8513
|
-
function patchStopImmediatePropagation(e, value) {
|
|
8514
|
-
if (isArray(value)) {
|
|
8515
|
-
const originalStop = e.stopImmediatePropagation;
|
|
8516
|
-
e.stopImmediatePropagation = () => {
|
|
8517
|
-
originalStop.call(e);
|
|
8518
|
-
e._stopped = true;
|
|
8519
|
-
};
|
|
8520
|
-
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
8521
|
-
} else return value;
|
|
8522
|
-
}
|
|
8523
8696
|
//#endregion
|
|
8524
8697
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
8525
8698
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -8827,7 +9000,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
8827
9000
|
replacementNodes.push(child);
|
|
8828
9001
|
}
|
|
8829
9002
|
parent.removeChild(o);
|
|
8830
|
-
slotReplacements.set(o,
|
|
9003
|
+
slotReplacements.set(o, {
|
|
9004
|
+
nodes: replacementNodes,
|
|
9005
|
+
usedFallback: !content
|
|
9006
|
+
});
|
|
8831
9007
|
}
|
|
8832
9008
|
this._updateSlotNodes(slotReplacements);
|
|
8833
9009
|
}
|
|
@@ -8994,7 +9170,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
|
|
|
8994
9170
|
prevChildren = [];
|
|
8995
9171
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
8996
9172
|
const child = children[i];
|
|
8997
|
-
if (child.el && child.el instanceof Element) {
|
|
9173
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
8998
9174
|
prevChildren.push(child);
|
|
8999
9175
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
9000
9176
|
positionMap.set(child, getPosition(child.el));
|
|
@@ -9217,7 +9393,8 @@ const vModelSelect = {
|
|
|
9217
9393
|
mounted(el, { value }) {
|
|
9218
9394
|
vModelSetSelected(el, value);
|
|
9219
9395
|
},
|
|
9220
|
-
beforeUpdate(el,
|
|
9396
|
+
beforeUpdate(el, { value }, vnode) {
|
|
9397
|
+
el._modelValue = value;
|
|
9221
9398
|
el[assignKey] = getModelAssigner(vnode);
|
|
9222
9399
|
},
|
|
9223
9400
|
updated(el, { value }) {
|
|
@@ -9228,10 +9405,10 @@ const vModelSelect = {
|
|
|
9228
9405
|
* @internal
|
|
9229
9406
|
*/
|
|
9230
9407
|
const vModelSelectInit = (el, value, number, set) => {
|
|
9231
|
-
|
|
9408
|
+
el._modelValue = value;
|
|
9232
9409
|
addEventListener(el, "change", () => {
|
|
9233
9410
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
9234
|
-
(set || el[assignKey])(el.multiple ?
|
|
9411
|
+
(set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
|
|
9235
9412
|
el._assigning = true;
|
|
9236
9413
|
nextTick(() => {
|
|
9237
9414
|
el._assigning = false;
|
|
@@ -9242,6 +9419,7 @@ const vModelSelectInit = (el, value, number, set) => {
|
|
|
9242
9419
|
* @internal
|
|
9243
9420
|
*/
|
|
9244
9421
|
const vModelSetSelected = (el, value) => {
|
|
9422
|
+
el._modelValue = value;
|
|
9245
9423
|
if (el._assigning) return;
|
|
9246
9424
|
const isMultiple = el.multiple;
|
|
9247
9425
|
const isArrayValue = isArray(value);
|
|
@@ -11531,6 +11709,7 @@ function getUnnormalizedProps(props, callPath = []) {
|
|
|
11531
11709
|
return [props, callPath];
|
|
11532
11710
|
}
|
|
11533
11711
|
function injectProp(node, prop, context) {
|
|
11712
|
+
if (node.type !== 13 && injectSlotKey(node, prop)) return;
|
|
11534
11713
|
let propsWithInjection;
|
|
11535
11714
|
/**
|
|
11536
11715
|
* 1. mergeProps(...)
|
|
@@ -11569,6 +11748,20 @@ function injectProp(node, prop, context) {
|
|
|
11569
11748
|
else if (parentCall) parentCall.arguments[0] = propsWithInjection;
|
|
11570
11749
|
else node.arguments[2] = propsWithInjection;
|
|
11571
11750
|
}
|
|
11751
|
+
function injectSlotKey(node, prop) {
|
|
11752
|
+
var _node$arguments, _node$arguments2, _node$arguments3;
|
|
11753
|
+
if (prop.key.type !== 4 || prop.key.content !== "key") return false;
|
|
11754
|
+
const props = node.arguments[2];
|
|
11755
|
+
if (props && !isString(props)) {
|
|
11756
|
+
const [unnormalizedProps] = getUnnormalizedProps(props);
|
|
11757
|
+
if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) return true;
|
|
11758
|
+
}
|
|
11759
|
+
(_node$arguments = node.arguments)[2] || (_node$arguments[2] = "{}");
|
|
11760
|
+
(_node$arguments2 = node.arguments)[3] || (_node$arguments2[3] = "undefined");
|
|
11761
|
+
(_node$arguments3 = node.arguments)[4] || (_node$arguments3[4] = "undefined");
|
|
11762
|
+
node.arguments[5] = prop.value;
|
|
11763
|
+
return true;
|
|
11764
|
+
}
|
|
11572
11765
|
function hasProp(prop, props) {
|
|
11573
11766
|
let result = false;
|
|
11574
11767
|
if (prop.key.type === 4) {
|
|
@@ -11865,7 +12058,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
11865
12058
|
}
|
|
11866
12059
|
},
|
|
11867
12060
|
oncdata(start, end) {
|
|
11868
|
-
if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
|
|
12061
|
+
if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
|
|
11869
12062
|
else emitError(1, start - 9);
|
|
11870
12063
|
},
|
|
11871
12064
|
onprocessinginstruction(start) {
|
|
@@ -12353,7 +12546,7 @@ function getSelfName(filename) {
|
|
|
12353
12546
|
const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
|
|
12354
12547
|
return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
|
|
12355
12548
|
}
|
|
12356
|
-
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
12549
|
+
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
12357
12550
|
const context = {
|
|
12358
12551
|
filename,
|
|
12359
12552
|
selfName: getSelfName(filename),
|
|
@@ -12375,6 +12568,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
12375
12568
|
bindingMetadata,
|
|
12376
12569
|
inline,
|
|
12377
12570
|
isTS,
|
|
12571
|
+
eventDelegation,
|
|
12378
12572
|
onError,
|
|
12379
12573
|
onWarn,
|
|
12380
12574
|
compatConfig,
|
|
@@ -12386,8 +12580,10 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
12386
12580
|
imports: [],
|
|
12387
12581
|
cached: [],
|
|
12388
12582
|
constantCache: /* @__PURE__ */ new WeakMap(),
|
|
12583
|
+
vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
|
|
12389
12584
|
temps: 0,
|
|
12390
12585
|
identifiers: Object.create(null),
|
|
12586
|
+
identifierScopes: Object.create(null),
|
|
12391
12587
|
scopes: {
|
|
12392
12588
|
vFor: 0,
|
|
12393
12589
|
vSlot: 0,
|
|
@@ -12432,16 +12628,20 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
12432
12628
|
context.parent.children.splice(removalIndex, 1);
|
|
12433
12629
|
},
|
|
12434
12630
|
onNodeRemoved: NOOP,
|
|
12435
|
-
addIdentifiers(exp) {
|
|
12436
|
-
if (isString(exp)) addId(exp);
|
|
12437
|
-
else if (exp.identifiers) exp.identifiers.forEach(addId);
|
|
12438
|
-
else if (exp.type === 4) addId(exp.content);
|
|
12631
|
+
addIdentifiers(exp, type = "local") {
|
|
12632
|
+
if (isString(exp)) addId(exp, type);
|
|
12633
|
+
else if (exp.identifiers) exp.identifiers.forEach((id) => addId(id, type));
|
|
12634
|
+
else if (exp.type === 4) addId(exp.content, type);
|
|
12439
12635
|
},
|
|
12440
12636
|
removeIdentifiers(exp) {
|
|
12441
12637
|
if (isString(exp)) removeId(exp);
|
|
12442
12638
|
else if (exp.identifiers) exp.identifiers.forEach(removeId);
|
|
12443
12639
|
else if (exp.type === 4) removeId(exp.content);
|
|
12444
12640
|
},
|
|
12641
|
+
isSlotScopeIdentifier(name) {
|
|
12642
|
+
const scopes = context.identifierScopes[name];
|
|
12643
|
+
return scopes ? scopes[scopes.length - 1] === "slot" : false;
|
|
12644
|
+
},
|
|
12445
12645
|
hoist(exp) {
|
|
12446
12646
|
if (isString(exp)) exp = createSimpleExpression(exp);
|
|
12447
12647
|
context.hoists.push(exp);
|
|
@@ -12456,13 +12656,16 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
12456
12656
|
}
|
|
12457
12657
|
};
|
|
12458
12658
|
context.filters = /* @__PURE__ */ new Set();
|
|
12459
|
-
function addId(id) {
|
|
12460
|
-
const { identifiers } = context;
|
|
12659
|
+
function addId(id, type) {
|
|
12660
|
+
const { identifiers, identifierScopes } = context;
|
|
12461
12661
|
if (identifiers[id] === void 0) identifiers[id] = 0;
|
|
12462
12662
|
identifiers[id]++;
|
|
12663
|
+
(identifierScopes[id] || (identifierScopes[id] = [])).push(type);
|
|
12463
12664
|
}
|
|
12464
12665
|
function removeId(id) {
|
|
12465
12666
|
context.identifiers[id]--;
|
|
12667
|
+
const scopes = context.identifierScopes[id];
|
|
12668
|
+
if (scopes) scopes.pop();
|
|
12466
12669
|
}
|
|
12467
12670
|
return context;
|
|
12468
12671
|
}
|
|
@@ -12884,6 +13087,7 @@ function genNode(node, context) {
|
|
|
12884
13087
|
case 26:
|
|
12885
13088
|
genReturnStatement(node, context);
|
|
12886
13089
|
break;
|
|
13090
|
+
/* v8 ignore start */
|
|
12887
13091
|
case 10: break;
|
|
12888
13092
|
default:
|
|
12889
13093
|
}
|
|
@@ -13133,7 +13337,7 @@ const transformExpression = (node, context) => {
|
|
|
13133
13337
|
if (dir.type === 7 && dir.name !== "for") {
|
|
13134
13338
|
const exp = dir.exp;
|
|
13135
13339
|
const arg = dir.arg;
|
|
13136
|
-
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
13340
|
+
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
13137
13341
|
if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
|
|
13138
13342
|
}
|
|
13139
13343
|
}
|
|
@@ -13384,11 +13588,11 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
13384
13588
|
const keyProp = findProp(node, `key`, false, true);
|
|
13385
13589
|
const isDirKey = keyProp && keyProp.type === 7;
|
|
13386
13590
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
13387
|
-
|
|
13388
|
-
|
|
13389
|
-
if (isTemplate) {
|
|
13390
|
-
|
|
13391
|
-
if (
|
|
13591
|
+
const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
13592
|
+
if (isTemplate && memo) memo.exp = processExpression(memo.exp, context);
|
|
13593
|
+
if ((isTemplate || memo) && keyProperty && isDirKey) {
|
|
13594
|
+
keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
|
|
13595
|
+
if (memo) context.vForMemoKeyedNodes.add(node);
|
|
13392
13596
|
}
|
|
13393
13597
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
13394
13598
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
@@ -13519,7 +13723,7 @@ const trackSlotScopes = (node, context) => {
|
|
|
13519
13723
|
const vSlot = findDir(node, "slot");
|
|
13520
13724
|
if (vSlot) {
|
|
13521
13725
|
const slotProps = vSlot.exp;
|
|
13522
|
-
if (context.prefixIdentifiers) slotProps && context.addIdentifiers(slotProps);
|
|
13726
|
+
if (context.prefixIdentifiers) slotProps && context.addIdentifiers(slotProps, "slot");
|
|
13523
13727
|
context.scopes.vSlot++;
|
|
13524
13728
|
return () => {
|
|
13525
13729
|
if (context.prefixIdentifiers) slotProps && context.removeIdentifiers(slotProps);
|
|
@@ -13735,6 +13939,15 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
13735
13939
|
if (!ssr) context.helper(builtIn);
|
|
13736
13940
|
return builtIn;
|
|
13737
13941
|
}
|
|
13942
|
+
{
|
|
13943
|
+
const fromScope = resolveSlotScopeReference(tag, context);
|
|
13944
|
+
if (fromScope) return fromScope;
|
|
13945
|
+
const dotIndex = tag.indexOf(".");
|
|
13946
|
+
if (dotIndex > 0) {
|
|
13947
|
+
const ns = resolveSlotScopeReference(tag.slice(0, dotIndex), context);
|
|
13948
|
+
if (ns) return ns + tag.slice(dotIndex);
|
|
13949
|
+
}
|
|
13950
|
+
}
|
|
13738
13951
|
{
|
|
13739
13952
|
const fromSetup = resolveSetupReference(tag, context);
|
|
13740
13953
|
if (fromSetup) return fromSetup;
|
|
@@ -13753,6 +13966,14 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
13753
13966
|
context.components.add(tag);
|
|
13754
13967
|
return toValidAssetId(tag, `component`);
|
|
13755
13968
|
}
|
|
13969
|
+
function resolveSlotScopeReference(name, context) {
|
|
13970
|
+
const camelName = camelize(name);
|
|
13971
|
+
const PascalName = capitalize(camelName);
|
|
13972
|
+
const isInSlotScope = (reference) => context.isSlotScopeIdentifier(reference);
|
|
13973
|
+
if (isInSlotScope(name)) return name;
|
|
13974
|
+
if (isInSlotScope(camelName)) return camelName;
|
|
13975
|
+
if (isInSlotScope(PascalName)) return PascalName;
|
|
13976
|
+
}
|
|
13756
13977
|
function resolveSetupReference(name, context) {
|
|
13757
13978
|
const bindings = context.bindingMetadata;
|
|
13758
13979
|
if (!bindings || bindings.__isScriptSetup === false) return;
|
|
@@ -14270,7 +14491,7 @@ function rewriteFilter(node, context) {
|
|
|
14270
14491
|
const child = node.children[i];
|
|
14271
14492
|
if (typeof child !== "object") continue;
|
|
14272
14493
|
if (child.type === 4) parseFilter(child, context);
|
|
14273
|
-
else if (child.type === 8) rewriteFilter(
|
|
14494
|
+
else if (child.type === 8) rewriteFilter(child, context);
|
|
14274
14495
|
else if (child.type === 5) rewriteFilter(child.content, context);
|
|
14275
14496
|
}
|
|
14276
14497
|
}
|