@vue/runtime-dom 3.6.0-beta.9 → 3.6.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-dom.cjs.js +47 -28
- package/dist/runtime-dom.cjs.prod.js +47 -28
- package/dist/runtime-dom.d.ts +8 -2
- package/dist/runtime-dom.esm-browser.js +419 -208
- package/dist/runtime-dom.esm-browser.prod.js +3 -3
- package/dist/runtime-dom.esm-bundler.js +48 -29
- package/dist/runtime-dom.global.js +419 -208
- package/dist/runtime-dom.global.prod.js +3 -3
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-
|
|
2
|
+
* @vue/runtime-dom v3.6.0-rc.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -433,6 +433,13 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
433
433
|
const notifyBuffer = [];
|
|
434
434
|
let batchDepth = 0;
|
|
435
435
|
let activeSub = void 0;
|
|
436
|
+
let runDepth = 0;
|
|
437
|
+
function incRunDepth() {
|
|
438
|
+
++runDepth;
|
|
439
|
+
}
|
|
440
|
+
function decRunDepth() {
|
|
441
|
+
--runDepth;
|
|
442
|
+
}
|
|
436
443
|
let globalVersion = 0;
|
|
437
444
|
let notifyIndex = 0;
|
|
438
445
|
let notifyBufferLength = 0;
|
|
@@ -506,8 +513,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
506
513
|
const sub = link.sub;
|
|
507
514
|
let flags = sub.flags;
|
|
508
515
|
if (flags & 3) {
|
|
509
|
-
if (!(flags & 60))
|
|
510
|
-
|
|
516
|
+
if (!(flags & 60)) {
|
|
517
|
+
sub.flags = flags | 32;
|
|
518
|
+
if (runDepth) sub.flags |= 8;
|
|
519
|
+
} else if (!(flags & 12)) flags = 0;
|
|
511
520
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
512
521
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
513
522
|
sub.flags = flags | 40;
|
|
@@ -576,13 +585,13 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
576
585
|
let dirty = false;
|
|
577
586
|
if (sub.flags & 16) dirty = true;
|
|
578
587
|
else if ((depFlags & 17) === 17) {
|
|
588
|
+
const subs = dep.subs;
|
|
579
589
|
if (dep.update()) {
|
|
580
|
-
const subs = dep.subs;
|
|
581
590
|
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
582
591
|
dirty = true;
|
|
583
592
|
}
|
|
584
593
|
} else if ((depFlags & 33) === 33) {
|
|
585
|
-
|
|
594
|
+
stack = {
|
|
586
595
|
value: link,
|
|
587
596
|
prev: stack
|
|
588
597
|
};
|
|
@@ -597,15 +606,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
597
606
|
}
|
|
598
607
|
while (checkDepth) {
|
|
599
608
|
--checkDepth;
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
if (hasMultipleSubs) {
|
|
603
|
-
link = stack.value;
|
|
604
|
-
stack = stack.prev;
|
|
605
|
-
} else link = firstSub;
|
|
609
|
+
link = stack.value;
|
|
610
|
+
stack = stack.prev;
|
|
606
611
|
if (dirty) {
|
|
612
|
+
const subs = sub.subs;
|
|
607
613
|
if (sub.update()) {
|
|
608
|
-
if (
|
|
614
|
+
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
609
615
|
sub = link.sub;
|
|
610
616
|
continue;
|
|
611
617
|
}
|
|
@@ -617,7 +623,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
617
623
|
}
|
|
618
624
|
dirty = false;
|
|
619
625
|
}
|
|
620
|
-
return dirty;
|
|
626
|
+
return dirty && !!sub.flags;
|
|
621
627
|
} while (true);
|
|
622
628
|
}
|
|
623
629
|
function shallowPropagate(link) {
|
|
@@ -1000,7 +1006,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1000
1006
|
}
|
|
1001
1007
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
1002
1008
|
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
1003
|
-
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
1009
|
+
if (target === /* @__PURE__ */ toRaw(receiver) && result) {
|
|
1004
1010
|
if (!hadKey) trigger(target, "add", key, value);
|
|
1005
1011
|
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
1006
1012
|
}
|
|
@@ -1218,9 +1224,6 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1218
1224
|
default: return 0;
|
|
1219
1225
|
}
|
|
1220
1226
|
}
|
|
1221
|
-
function getTargetType(value) {
|
|
1222
|
-
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1223
|
-
}
|
|
1224
1227
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1225
1228
|
function reactive(target) {
|
|
1226
1229
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
@@ -1333,10 +1336,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1333
1336
|
return target;
|
|
1334
1337
|
}
|
|
1335
1338
|
if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
|
|
1336
|
-
|
|
1337
|
-
if (targetType === 0) return target;
|
|
1339
|
+
if (target["__v_skip"] || !Object.isExtensible(target)) return target;
|
|
1338
1340
|
const existingProxy = proxyMap.get(target);
|
|
1339
1341
|
if (existingProxy) return existingProxy;
|
|
1342
|
+
const targetType = targetTypeMap(toRawType(target));
|
|
1343
|
+
if (targetType === 0) return target;
|
|
1340
1344
|
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
1341
1345
|
proxyMap.set(target, proxy);
|
|
1342
1346
|
return proxy;
|
|
@@ -1769,9 +1773,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1769
1773
|
if (!this.active) return this.fn();
|
|
1770
1774
|
cleanup(this);
|
|
1771
1775
|
const prevSub = startTracking(this);
|
|
1776
|
+
incRunDepth();
|
|
1772
1777
|
try {
|
|
1773
1778
|
return this.fn();
|
|
1774
1779
|
} finally {
|
|
1780
|
+
decRunDepth();
|
|
1775
1781
|
endTracking(this, prevSub);
|
|
1776
1782
|
const flags = this.flags;
|
|
1777
1783
|
if ((flags & 136) === 136) {
|
|
@@ -2152,8 +2158,9 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2152
2158
|
if (once && cb) {
|
|
2153
2159
|
const _cb = cb;
|
|
2154
2160
|
cb = (...args) => {
|
|
2155
|
-
_cb(...args);
|
|
2161
|
+
const res = _cb(...args);
|
|
2156
2162
|
this.stop();
|
|
2163
|
+
return res;
|
|
2157
2164
|
};
|
|
2158
2165
|
}
|
|
2159
2166
|
this.cb = cb;
|
|
@@ -2167,7 +2174,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2167
2174
|
if (!this.cb) return;
|
|
2168
2175
|
const { immediate, deep, call } = this.options;
|
|
2169
2176
|
if (initialRun && !immediate) return;
|
|
2170
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2177
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2171
2178
|
cleanup(this);
|
|
2172
2179
|
const currentWatcher = activeWatcher;
|
|
2173
2180
|
activeWatcher = this;
|
|
@@ -2474,8 +2481,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2474
2481
|
/**
|
|
2475
2482
|
* @internal for runtime-vapor only
|
|
2476
2483
|
*/
|
|
2477
|
-
function queueJob(job, id, isPre = false) {
|
|
2478
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2484
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
2485
|
+
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)) {
|
|
2479
2486
|
jobsLength++;
|
|
2480
2487
|
queueFlush();
|
|
2481
2488
|
}
|
|
@@ -2584,6 +2591,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2584
2591
|
}
|
|
2585
2592
|
flushIndex = 0;
|
|
2586
2593
|
jobsLength = 0;
|
|
2594
|
+
jobs.length = 0;
|
|
2587
2595
|
flushPostFlushCbs(seen);
|
|
2588
2596
|
currentFlushPromise = null;
|
|
2589
2597
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -2641,6 +2649,14 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2641
2649
|
function normalizeClassComponent(component) {
|
|
2642
2650
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2643
2651
|
}
|
|
2652
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
2653
|
+
let parent = instance.parent;
|
|
2654
|
+
while (parent) {
|
|
2655
|
+
if (dirtyInstances.has(parent)) return true;
|
|
2656
|
+
parent = parent.parent;
|
|
2657
|
+
}
|
|
2658
|
+
return false;
|
|
2659
|
+
}
|
|
2644
2660
|
function rerender(id, newRender) {
|
|
2645
2661
|
const record = map.get(id);
|
|
2646
2662
|
if (!record) return;
|
|
@@ -2672,42 +2688,69 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2672
2688
|
const isVapor = record.initialDef.__vapor;
|
|
2673
2689
|
updateComponentDef(record.initialDef, newComp);
|
|
2674
2690
|
const instances = [...record.instances];
|
|
2675
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2691
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2676
2692
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
const
|
|
2680
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2681
|
-
if (!dirtyInstances) {
|
|
2682
|
-
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2683
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2684
|
-
}
|
|
2685
|
-
dirtyInstances.add(instance);
|
|
2686
|
-
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2687
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
2688
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2689
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2690
|
-
if (instance.ceReload) {
|
|
2691
|
-
dirtyInstances.add(instance);
|
|
2692
|
-
instance.ceReload(newComp.styles);
|
|
2693
|
-
dirtyInstances.delete(instance);
|
|
2694
|
-
} else if (instance.parent) queueJob(() => {
|
|
2695
|
-
isHmrUpdating = true;
|
|
2693
|
+
const dirtyInstances = new Set(instances);
|
|
2694
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2695
|
+
for (const instance of instances) {
|
|
2696
2696
|
const parent = instance.parent;
|
|
2697
|
-
if (parent
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2697
|
+
if (parent) {
|
|
2698
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2699
|
+
rerenderedParents.add(parent);
|
|
2700
|
+
parent.hmrRerender();
|
|
2701
|
+
}
|
|
2702
|
+
} else instance.hmrReload(newComp);
|
|
2703
|
+
}
|
|
2704
|
+
} else {
|
|
2705
|
+
const parentUpdates = /* @__PURE__ */ new Map();
|
|
2706
|
+
const dirtyInstanceSet = new Set(instances);
|
|
2707
|
+
for (const instance of instances) {
|
|
2708
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2709
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2710
|
+
if (!dirtyInstances) {
|
|
2711
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2712
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2701
2713
|
}
|
|
2702
|
-
|
|
2703
|
-
|
|
2714
|
+
dirtyInstances.add(instance);
|
|
2715
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2716
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2717
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2718
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2719
|
+
if (instance.ceReload) {
|
|
2720
|
+
dirtyInstances.add(instance);
|
|
2721
|
+
instance.ceReload(newComp.styles);
|
|
2722
|
+
dirtyInstances.delete(instance);
|
|
2723
|
+
} else if (instance.parent) {
|
|
2724
|
+
const parent = instance.parent;
|
|
2725
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2726
|
+
let updates = parentUpdates.get(parent);
|
|
2727
|
+
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2728
|
+
updates.push([instance, dirtyInstances]);
|
|
2729
|
+
}
|
|
2730
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2731
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
2732
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2733
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2734
|
+
}
|
|
2735
|
+
parentUpdates.forEach((updates, parent) => {
|
|
2736
|
+
queueJob(() => {
|
|
2737
|
+
isHmrUpdating = true;
|
|
2738
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2739
|
+
else {
|
|
2740
|
+
const i = parent;
|
|
2741
|
+
if (!(i.effect.flags & 1024)) {
|
|
2742
|
+
i.renderCache = [];
|
|
2743
|
+
i.effect.run();
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
nextTick(() => {
|
|
2747
|
+
isHmrUpdating = false;
|
|
2748
|
+
});
|
|
2749
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
2750
|
+
dirtyInstances.delete(instance);
|
|
2751
|
+
});
|
|
2704
2752
|
});
|
|
2705
|
-
dirtyInstances.delete(instance);
|
|
2706
2753
|
});
|
|
2707
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
2708
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
2709
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2710
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2711
2754
|
}
|
|
2712
2755
|
queuePostFlushCb(() => {
|
|
2713
2756
|
hmrDirtyComponents.clear();
|
|
@@ -2850,10 +2893,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2850
2893
|
const renderFnWithContext = (...args) => {
|
|
2851
2894
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
2852
2895
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
2896
|
+
const prevStackSize = blockStack.length;
|
|
2853
2897
|
let res;
|
|
2854
2898
|
try {
|
|
2855
2899
|
res = fn(...args);
|
|
2856
2900
|
} finally {
|
|
2901
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2857
2902
|
setCurrentRenderingInstance(prevInstance);
|
|
2858
2903
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
2859
2904
|
}
|
|
@@ -3024,7 +3069,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3024
3069
|
}
|
|
3025
3070
|
const prev = setCurrentInstance(this);
|
|
3026
3071
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3027
|
-
|
|
3072
|
+
restoreCurrentInstance(prev);
|
|
3028
3073
|
return res;
|
|
3029
3074
|
}
|
|
3030
3075
|
function createPathGetter(ctx, path) {
|
|
@@ -3037,6 +3082,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3037
3082
|
}
|
|
3038
3083
|
//#endregion
|
|
3039
3084
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
3085
|
+
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
3040
3086
|
const TeleportEndKey = Symbol("_vte");
|
|
3041
3087
|
const isTeleport = (type) => type.__isTeleport;
|
|
3042
3088
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
@@ -3062,58 +3108,70 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3062
3108
|
name: "Teleport",
|
|
3063
3109
|
__isTeleport: true,
|
|
3064
3110
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
3065
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
3111
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
3066
3112
|
const disabled = isTeleportDisabled(n2.props);
|
|
3067
|
-
let {
|
|
3113
|
+
let { dynamicChildren } = n2;
|
|
3068
3114
|
if (isHmrUpdating) {
|
|
3069
3115
|
optimized = false;
|
|
3070
3116
|
dynamicChildren = null;
|
|
3071
3117
|
}
|
|
3118
|
+
const mount = (vnode, container, anchor) => {
|
|
3119
|
+
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3120
|
+
};
|
|
3121
|
+
const mountToTarget = (vnode = n2) => {
|
|
3122
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3123
|
+
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
3124
|
+
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
|
|
3125
|
+
if (target) {
|
|
3126
|
+
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3127
|
+
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3128
|
+
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3129
|
+
if (!disabled) {
|
|
3130
|
+
mount(vnode, target, targetAnchor);
|
|
3131
|
+
updateCssVars(vnode, false);
|
|
3132
|
+
}
|
|
3133
|
+
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3134
|
+
};
|
|
3135
|
+
const queuePendingMount = (vnode) => {
|
|
3136
|
+
const mountJob = () => {
|
|
3137
|
+
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3138
|
+
pendingMounts.delete(vnode);
|
|
3139
|
+
if (isTeleportDisabled(vnode.props)) {
|
|
3140
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
3141
|
+
updateCssVars(vnode, true);
|
|
3142
|
+
}
|
|
3143
|
+
mountToTarget(vnode);
|
|
3144
|
+
};
|
|
3145
|
+
pendingMounts.set(vnode, mountJob);
|
|
3146
|
+
queuePostRenderEffect(mountJob, void 0, parentSuspense);
|
|
3147
|
+
};
|
|
3072
3148
|
if (n1 == null) {
|
|
3073
3149
|
const placeholder = n2.el = createComment("teleport start");
|
|
3074
3150
|
const mainAnchor = n2.anchor = createComment("teleport end");
|
|
3075
3151
|
insert(placeholder, container, anchor);
|
|
3076
3152
|
insert(mainAnchor, container, anchor);
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
3082
|
-
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
3083
|
-
if (target) {
|
|
3084
|
-
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3085
|
-
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3086
|
-
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3087
|
-
if (!disabled) {
|
|
3088
|
-
mount(target, targetAnchor);
|
|
3089
|
-
updateCssVars(n2, false);
|
|
3090
|
-
}
|
|
3091
|
-
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3092
|
-
};
|
|
3153
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3154
|
+
queuePendingMount(n2);
|
|
3155
|
+
return;
|
|
3156
|
+
}
|
|
3093
3157
|
if (disabled) {
|
|
3094
|
-
mount(container, mainAnchor);
|
|
3158
|
+
mount(n2, container, mainAnchor);
|
|
3095
3159
|
updateCssVars(n2, true);
|
|
3096
3160
|
}
|
|
3097
|
-
|
|
3098
|
-
n2.el.__isMounted = false;
|
|
3099
|
-
queuePostRenderEffect(() => {
|
|
3100
|
-
if (n2.el.__isMounted !== false) return;
|
|
3101
|
-
mountToTarget();
|
|
3102
|
-
delete n2.el.__isMounted;
|
|
3103
|
-
}, void 0, parentSuspense);
|
|
3104
|
-
} else mountToTarget();
|
|
3161
|
+
mountToTarget();
|
|
3105
3162
|
} else {
|
|
3106
3163
|
n2.el = n1.el;
|
|
3107
|
-
n2.targetStart = n1.targetStart;
|
|
3108
3164
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
3109
|
-
const
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
}, void 0, parentSuspense);
|
|
3165
|
+
const pendingMount = pendingMounts.get(n1);
|
|
3166
|
+
if (pendingMount) {
|
|
3167
|
+
pendingMount.flags |= 4;
|
|
3168
|
+
pendingMounts.delete(n1);
|
|
3169
|
+
queuePendingMount(n2);
|
|
3115
3170
|
return;
|
|
3116
3171
|
}
|
|
3172
|
+
n2.targetStart = n1.targetStart;
|
|
3173
|
+
const target = n2.target = n1.target;
|
|
3174
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3117
3175
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
3118
3176
|
const currentContainer = wasDisabled ? container : target;
|
|
3119
3177
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -3127,24 +3185,30 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3127
3185
|
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
|
|
3128
3186
|
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
|
|
3129
3187
|
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
3130
|
-
const nextTarget =
|
|
3131
|
-
if (nextTarget)
|
|
3132
|
-
|
|
3188
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
3189
|
+
if (nextTarget) {
|
|
3190
|
+
n2.target = nextTarget;
|
|
3191
|
+
moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
3192
|
+
} else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
|
|
3133
3193
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
3134
3194
|
updateCssVars(n2, disabled);
|
|
3135
3195
|
}
|
|
3136
3196
|
},
|
|
3137
3197
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
3138
|
-
const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
|
|
3198
|
+
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
|
|
3199
|
+
const disabled = isTeleportDisabled(props);
|
|
3200
|
+
const shouldRemove = doRemove || !disabled;
|
|
3201
|
+
const pendingMount = pendingMounts.get(vnode);
|
|
3202
|
+
if (pendingMount) {
|
|
3203
|
+
pendingMount.flags |= 4;
|
|
3204
|
+
pendingMounts.delete(vnode);
|
|
3205
|
+
}
|
|
3139
3206
|
if (targetStart) hostRemove(targetStart);
|
|
3140
3207
|
if (targetAnchor) hostRemove(targetAnchor);
|
|
3141
3208
|
doRemove && hostRemove(anchor);
|
|
3142
|
-
if (shapeFlag & 16) {
|
|
3143
|
-
const
|
|
3144
|
-
|
|
3145
|
-
const child = children[i];
|
|
3146
|
-
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3147
|
-
}
|
|
3209
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
3210
|
+
const child = children[i];
|
|
3211
|
+
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3148
3212
|
}
|
|
3149
3213
|
},
|
|
3150
3214
|
move: moveTeleport,
|
|
@@ -3155,7 +3219,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3155
3219
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
3156
3220
|
const isReorder = moveType === 2;
|
|
3157
3221
|
if (isReorder) insert(el, container, parentAnchor);
|
|
3158
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
3222
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
3159
3223
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
3160
3224
|
}
|
|
3161
3225
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -3280,8 +3344,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3280
3344
|
const state = useTransitionState();
|
|
3281
3345
|
return () => {
|
|
3282
3346
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
3283
|
-
|
|
3284
|
-
|
|
3347
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3348
|
+
if (!child) return;
|
|
3285
3349
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3286
3350
|
const { mode } = rawProps;
|
|
3287
3351
|
checkTransitionMode(mode);
|
|
@@ -3463,12 +3527,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3463
3527
|
}
|
|
3464
3528
|
}
|
|
3465
3529
|
function setTransitionHooks(vnode, hooks) {
|
|
3466
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
3467
|
-
else {
|
|
3530
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3468
3531
|
vnode.transition = hooks;
|
|
3469
|
-
setTransitionHooks(vnode.component
|
|
3470
|
-
|
|
3471
|
-
else if (vnode.shapeFlag & 128) {
|
|
3532
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
3533
|
+
else setTransitionHooks(vnode.component.subTree, hooks);
|
|
3534
|
+
} else if (vnode.shapeFlag & 128) {
|
|
3472
3535
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3473
3536
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3474
3537
|
} else vnode.transition = hooks;
|
|
@@ -3733,7 +3796,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3733
3796
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3734
3797
|
break;
|
|
3735
3798
|
case VaporSlot:
|
|
3736
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
|
|
3799
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
3737
3800
|
break;
|
|
3738
3801
|
default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
3739
3802
|
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -3743,16 +3806,31 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3743
3806
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
3744
3807
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
3745
3808
|
else nextNode = nextSibling(node);
|
|
3746
|
-
if (vnode.type.__vapor)
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
}
|
|
3754
|
-
|
|
3755
|
-
|
|
3809
|
+
if (vnode.type.__vapor) {
|
|
3810
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
|
|
3811
|
+
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
3812
|
+
if (vnode.dirs) {
|
|
3813
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
3814
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
3815
|
+
}
|
|
3816
|
+
}, () => {
|
|
3817
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
3818
|
+
});
|
|
3819
|
+
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
3820
|
+
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
3821
|
+
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
3822
|
+
} else {
|
|
3823
|
+
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
3824
|
+
const component = vnode.component;
|
|
3825
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
|
|
3826
|
+
let subTree;
|
|
3827
|
+
if (isFragmentStart) {
|
|
3828
|
+
subTree = createVNode(Fragment);
|
|
3829
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
3830
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
3831
|
+
subTree.el = node;
|
|
3832
|
+
component.subTree = subTree;
|
|
3833
|
+
}
|
|
3756
3834
|
}
|
|
3757
3835
|
} else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
|
|
3758
3836
|
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
@@ -3764,7 +3842,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3764
3842
|
};
|
|
3765
3843
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
3766
3844
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
3767
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
3845
|
+
const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
3768
3846
|
const forcePatch = type === "input" || type === "option";
|
|
3769
3847
|
{
|
|
3770
3848
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
@@ -3782,15 +3860,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3782
3860
|
}
|
|
3783
3861
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
3784
3862
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3785
|
-
|
|
3863
|
+
if (next && !isMismatchAllowed(el, 1)) {
|
|
3864
|
+
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
3865
|
+
logMismatchError();
|
|
3866
|
+
}
|
|
3786
3867
|
while (next) {
|
|
3787
|
-
if (!isMismatchAllowed(el, 1)) {
|
|
3788
|
-
if (!hasWarned) {
|
|
3789
|
-
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
3790
|
-
hasWarned = true;
|
|
3791
|
-
}
|
|
3792
|
-
logMismatchError();
|
|
3793
|
-
}
|
|
3794
3868
|
const cur = next;
|
|
3795
3869
|
next = next.nextSibling;
|
|
3796
3870
|
remove(cur);
|
|
@@ -3809,9 +3883,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3809
3883
|
}
|
|
3810
3884
|
if (props) {
|
|
3811
3885
|
const isCustomElement = el.tagName.includes("-");
|
|
3886
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
3812
3887
|
for (const key in props) {
|
|
3813
3888
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
3814
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)) patchProp(el, key, null, props[key],
|
|
3889
|
+
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);
|
|
3815
3890
|
}
|
|
3816
3891
|
}
|
|
3817
3892
|
let vnodeHooks;
|
|
@@ -3829,7 +3904,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3829
3904
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
3830
3905
|
const children = parentVNode.children;
|
|
3831
3906
|
const l = children.length;
|
|
3832
|
-
let
|
|
3907
|
+
let hasCheckedMismatch = false;
|
|
3833
3908
|
for (let i = 0; i < l; i++) {
|
|
3834
3909
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
3835
3910
|
const isText = vnode.type === Text;
|
|
@@ -3843,12 +3918,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3843
3918
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3844
3919
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
3845
3920
|
else {
|
|
3846
|
-
if (!
|
|
3847
|
-
|
|
3921
|
+
if (!hasCheckedMismatch) {
|
|
3922
|
+
hasCheckedMismatch = true;
|
|
3923
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
3848
3924
|
warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
|
|
3849
|
-
|
|
3925
|
+
logMismatchError();
|
|
3850
3926
|
}
|
|
3851
|
-
logMismatchError();
|
|
3852
3927
|
}
|
|
3853
3928
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
3854
3929
|
}
|
|
@@ -3868,7 +3943,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3868
3943
|
}
|
|
3869
3944
|
};
|
|
3870
3945
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
3871
|
-
if (!
|
|
3946
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
3872
3947
|
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
3873
3948
|
logMismatchError();
|
|
3874
3949
|
}
|
|
@@ -4032,7 +4107,9 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4032
4107
|
};
|
|
4033
4108
|
function isMismatchAllowed(el, allowedType) {
|
|
4034
4109
|
if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
|
|
4035
|
-
|
|
4110
|
+
return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
|
|
4111
|
+
}
|
|
4112
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
4036
4113
|
if (allowedAttr == null) return false;
|
|
4037
4114
|
else if (allowedAttr === "") return true;
|
|
4038
4115
|
else {
|
|
@@ -4041,6 +4118,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4041
4118
|
return list.includes(MismatchTypeString[allowedType]);
|
|
4042
4119
|
}
|
|
4043
4120
|
}
|
|
4121
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
4122
|
+
return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
4123
|
+
}
|
|
4124
|
+
function isMismatchAllowedByNode(node) {
|
|
4125
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
|
|
4126
|
+
}
|
|
4127
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
4128
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
4129
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
|
|
4130
|
+
}
|
|
4044
4131
|
//#endregion
|
|
4045
4132
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
4046
4133
|
let requestIdleCallback;
|
|
@@ -4159,11 +4246,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4159
4246
|
onError(err);
|
|
4160
4247
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
4161
4248
|
});
|
|
4162
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
4249
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
4163
4250
|
load().then(() => {
|
|
4251
|
+
if (instance.isUnmounted) return;
|
|
4164
4252
|
loaded.value = true;
|
|
4165
4253
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
4166
4254
|
}).catch((err) => {
|
|
4255
|
+
if (instance.isUnmounted) {
|
|
4256
|
+
setPendingRequest(null);
|
|
4257
|
+
return;
|
|
4258
|
+
}
|
|
4167
4259
|
onError(err);
|
|
4168
4260
|
error.value = err;
|
|
4169
4261
|
});
|
|
@@ -4221,14 +4313,22 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4221
4313
|
setPendingRequest: (request) => pendingRequest = request
|
|
4222
4314
|
};
|
|
4223
4315
|
}
|
|
4224
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
4316
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
4225
4317
|
const loaded = /* @__PURE__ */ ref(false);
|
|
4226
4318
|
const error = /* @__PURE__ */ ref();
|
|
4227
4319
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4228
|
-
|
|
4320
|
+
let timeoutTimer;
|
|
4321
|
+
let delayTimer;
|
|
4322
|
+
if (instance) onUnmounted(() => {
|
|
4323
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4324
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4325
|
+
}, instance);
|
|
4326
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
4327
|
+
if (instance && instance.isUnmounted) return;
|
|
4229
4328
|
delayed.value = false;
|
|
4230
4329
|
}, delay);
|
|
4231
|
-
if (timeout != null) setTimeout(() => {
|
|
4330
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
4331
|
+
if (instance && instance.isUnmounted) return;
|
|
4232
4332
|
if (!loaded.value && !error.value) {
|
|
4233
4333
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
4234
4334
|
onError(err);
|
|
@@ -4246,6 +4346,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4246
4346
|
* @internal
|
|
4247
4347
|
*/
|
|
4248
4348
|
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
4349
|
+
const wasConnected = el.isConnected;
|
|
4249
4350
|
let patched = false;
|
|
4250
4351
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4251
4352
|
const performHydrate = () => {
|
|
@@ -4256,6 +4357,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4256
4357
|
}
|
|
4257
4358
|
return;
|
|
4258
4359
|
}
|
|
4360
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
4259
4361
|
hydrate();
|
|
4260
4362
|
};
|
|
4261
4363
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -4492,7 +4594,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4492
4594
|
try {
|
|
4493
4595
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
4494
4596
|
} finally {
|
|
4495
|
-
|
|
4597
|
+
restoreCurrentInstance(prev);
|
|
4496
4598
|
setActiveSub(prevSub);
|
|
4497
4599
|
}
|
|
4498
4600
|
});
|
|
@@ -4621,8 +4723,9 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4621
4723
|
* Compiler runtime helper for rendering `<slot/>`
|
|
4622
4724
|
* @private
|
|
4623
4725
|
*/
|
|
4624
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
4726
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
4625
4727
|
let slot = slots[name];
|
|
4728
|
+
if (fallback) fallback.__vdom = true;
|
|
4626
4729
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
4627
4730
|
if (vaporSlot) {
|
|
4628
4731
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -4630,25 +4733,35 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4630
4733
|
slot: vaporSlot,
|
|
4631
4734
|
fallback
|
|
4632
4735
|
};
|
|
4736
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
4633
4737
|
return ret;
|
|
4634
4738
|
}
|
|
4635
4739
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
4636
|
-
const
|
|
4637
|
-
|
|
4638
|
-
|
|
4740
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
4741
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
4742
|
+
if (name !== "default") slotProps.name = name;
|
|
4743
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
4639
4744
|
}
|
|
4640
4745
|
if (slot && slot.length > 1) {
|
|
4641
4746
|
warn$1("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.");
|
|
4642
4747
|
slot = () => [];
|
|
4643
4748
|
}
|
|
4644
4749
|
if (slot && slot._c) slot._d = false;
|
|
4750
|
+
const prevStackSize = blockStack.length;
|
|
4645
4751
|
openBlock();
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4752
|
+
let rendered;
|
|
4753
|
+
try {
|
|
4754
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
4755
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
4756
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
4757
|
+
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
4758
|
+
} catch (err) {
|
|
4759
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
4760
|
+
throw err;
|
|
4761
|
+
} finally {
|
|
4762
|
+
if (slot && slot._c) slot._d = true;
|
|
4763
|
+
}
|
|
4650
4764
|
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
4651
|
-
if (slot && slot._c) slot._d = true;
|
|
4652
4765
|
return rendered;
|
|
4653
4766
|
}
|
|
4654
4767
|
function ensureValidVNode(vnodes) {
|
|
@@ -4661,9 +4774,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4661
4774
|
}
|
|
4662
4775
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
4663
4776
|
let vaporSlot;
|
|
4664
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
4665
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
4666
|
-
}
|
|
4777
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
4667
4778
|
}
|
|
4668
4779
|
//#endregion
|
|
4669
4780
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -5029,26 +5140,39 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
5029
5140
|
function withAsyncContext(getAwaitable) {
|
|
5030
5141
|
const ctx = getCurrentGenericInstance();
|
|
5031
5142
|
const inSSRSetup = isInSSRComponentSetup;
|
|
5143
|
+
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
5032
5144
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
5033
5145
|
let awaitable = getAwaitable();
|
|
5034
5146
|
setCurrentInstance(null, void 0);
|
|
5035
5147
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5036
5148
|
const restore = () => {
|
|
5149
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5037
5150
|
setCurrentInstance(ctx);
|
|
5038
5151
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
5152
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
5153
|
+
return () => {
|
|
5154
|
+
if (reset) reset();
|
|
5155
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
5156
|
+
};
|
|
5039
5157
|
};
|
|
5040
5158
|
const cleanup = () => {
|
|
5041
5159
|
setCurrentInstance(null, void 0);
|
|
5042
5160
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5043
5161
|
};
|
|
5044
5162
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
5045
|
-
restore();
|
|
5046
|
-
Promise.resolve().then(() => Promise.resolve().then(
|
|
5163
|
+
const reset = restore();
|
|
5164
|
+
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
5165
|
+
if (reset) reset();
|
|
5166
|
+
cleanup();
|
|
5167
|
+
}));
|
|
5047
5168
|
throw e;
|
|
5048
5169
|
});
|
|
5049
5170
|
return [awaitable, () => {
|
|
5050
|
-
restore();
|
|
5051
|
-
Promise.resolve().then(
|
|
5171
|
+
const reset = restore();
|
|
5172
|
+
Promise.resolve().then(() => {
|
|
5173
|
+
if (reset) reset();
|
|
5174
|
+
cleanup();
|
|
5175
|
+
});
|
|
5052
5176
|
}];
|
|
5053
5177
|
}
|
|
5054
5178
|
//#endregion
|
|
@@ -5472,12 +5596,13 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
5472
5596
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
5473
5597
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
5474
5598
|
}
|
|
5475
|
-
|
|
5599
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
5600
|
+
if (!hasVModel) {
|
|
5476
5601
|
localValue = value;
|
|
5477
5602
|
trigger();
|
|
5478
5603
|
}
|
|
5479
5604
|
i.emit(`update:${name}`, emittedValue);
|
|
5480
|
-
if (hasChanged(value,
|
|
5605
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
5481
5606
|
prevSetValue = value;
|
|
5482
5607
|
prevEmittedValue = emittedValue;
|
|
5483
5608
|
}
|
|
@@ -5584,7 +5709,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
5584
5709
|
*/
|
|
5585
5710
|
function isEmitListener(options, key) {
|
|
5586
5711
|
if (!options || !isOn(key)) return false;
|
|
5587
|
-
key = key.slice(2)
|
|
5712
|
+
key = key.slice(2);
|
|
5713
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
5588
5714
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
5589
5715
|
}
|
|
5590
5716
|
//#endregion
|
|
@@ -5913,7 +6039,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
5913
6039
|
const prev = setCurrentInstance(instance);
|
|
5914
6040
|
const props = /* @__PURE__ */ toRaw(instance.props);
|
|
5915
6041
|
value = factory.call(null, props);
|
|
5916
|
-
|
|
6042
|
+
restoreCurrentInstance(prev);
|
|
5917
6043
|
return value;
|
|
5918
6044
|
}
|
|
5919
6045
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -6059,7 +6185,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6059
6185
|
const receivedType = toRawType(value);
|
|
6060
6186
|
const expectedValue = styleValue(value, expectedType);
|
|
6061
6187
|
const receivedValue = styleValue(value, receivedType);
|
|
6062
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
6188
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
6063
6189
|
message += `, got ${receivedType} `;
|
|
6064
6190
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
6065
6191
|
return message;
|
|
@@ -6068,7 +6194,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6068
6194
|
* dev only
|
|
6069
6195
|
*/
|
|
6070
6196
|
function styleValue(value, type) {
|
|
6071
|
-
if (
|
|
6197
|
+
if (isSymbol(value)) return value.toString();
|
|
6198
|
+
else if (type === "String") return `"${value}"`;
|
|
6072
6199
|
else if (type === "Number") return `${Number(value)}`;
|
|
6073
6200
|
else return `${value}`;
|
|
6074
6201
|
}
|
|
@@ -6085,8 +6212,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6085
6212
|
/**
|
|
6086
6213
|
* dev only
|
|
6087
6214
|
*/
|
|
6088
|
-
function
|
|
6089
|
-
return args.
|
|
6215
|
+
function isCoercible(...args) {
|
|
6216
|
+
return args.every((elem) => {
|
|
6217
|
+
const value = elem.toLowerCase();
|
|
6218
|
+
return value !== "boolean" && value !== "symbol";
|
|
6219
|
+
});
|
|
6090
6220
|
}
|
|
6091
6221
|
//#endregion
|
|
6092
6222
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -6391,7 +6521,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6391
6521
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
6392
6522
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
6393
6523
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
6394
|
-
if (isHmrUpdating) {
|
|
6524
|
+
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
6395
6525
|
patchFlag = 0;
|
|
6396
6526
|
optimized = false;
|
|
6397
6527
|
dynamicChildren = null;
|
|
@@ -6469,21 +6599,37 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6469
6599
|
};
|
|
6470
6600
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6471
6601
|
n2.slotScopeIds = slotScopeIds;
|
|
6472
|
-
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
6602
|
+
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
6473
6603
|
else {
|
|
6604
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
6474
6605
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
6475
6606
|
if (n2.dirs) {
|
|
6476
6607
|
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
6477
6608
|
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
6478
6609
|
}
|
|
6610
|
+
}, () => {
|
|
6611
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
6479
6612
|
});
|
|
6480
6613
|
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
6614
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
6615
|
+
if (vnodeMountedHook) {
|
|
6616
|
+
const scopedVNode = n2;
|
|
6617
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
6618
|
+
}
|
|
6481
6619
|
}
|
|
6482
6620
|
else {
|
|
6483
|
-
|
|
6621
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
6622
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
6484
6623
|
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
6624
|
+
}, () => {
|
|
6625
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
6626
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
6485
6627
|
});
|
|
6486
|
-
|
|
6628
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
6629
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
6630
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
6631
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
6632
|
+
}, void 0, parentSuspense);
|
|
6487
6633
|
}
|
|
6488
6634
|
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
6489
6635
|
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
@@ -6796,7 +6942,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6796
6942
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
6797
6943
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
6798
6944
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
6799
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
6945
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
6800
6946
|
return;
|
|
6801
6947
|
}
|
|
6802
6948
|
if (shapeFlag & 6) {
|
|
@@ -6829,8 +6975,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6829
6975
|
else hostInsert(el, container, anchor);
|
|
6830
6976
|
};
|
|
6831
6977
|
const performLeave = () => {
|
|
6978
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
6832
6979
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
6833
|
-
|
|
6980
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
6981
|
+
else leave(el, () => {
|
|
6834
6982
|
remove();
|
|
6835
6983
|
afterLeave && afterLeave();
|
|
6836
6984
|
});
|
|
@@ -6850,7 +6998,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6850
6998
|
}
|
|
6851
6999
|
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
6852
7000
|
if (shapeFlag & 256) {
|
|
6853
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
7001
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
6854
7002
|
else parentComponent.ctx.deactivate(vnode);
|
|
6855
7003
|
return;
|
|
6856
7004
|
}
|
|
@@ -6860,8 +7008,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6860
7008
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
6861
7009
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
6862
7010
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
6863
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
6864
|
-
if (
|
|
7011
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
7012
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
7013
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
7014
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
7015
|
+
}, void 0, parentSuspense);
|
|
6865
7016
|
return;
|
|
6866
7017
|
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
6867
7018
|
else {
|
|
@@ -6874,7 +7025,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6874
7025
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
6875
7026
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
6876
7027
|
if (type === VaporSlot) {
|
|
6877
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
7028
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
6878
7029
|
return;
|
|
6879
7030
|
}
|
|
6880
7031
|
if (doRemove) remove(vnode);
|
|
@@ -6922,7 +7073,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6922
7073
|
if (effect) {
|
|
6923
7074
|
effect.stop();
|
|
6924
7075
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
6925
|
-
}
|
|
7076
|
+
} else if (doRemove && subTree && instance.vnode.el) remove(subTree);
|
|
6926
7077
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
6927
7078
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
6928
7079
|
devtoolsComponentRemoved(instance);
|
|
@@ -7048,6 +7199,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7048
7199
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
7049
7200
|
}
|
|
7050
7201
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
7202
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
7203
|
+
insert();
|
|
7204
|
+
return;
|
|
7205
|
+
}
|
|
7051
7206
|
if (force || needTransition(parentSuspense, transition)) {
|
|
7052
7207
|
transition.beforeEnter(el);
|
|
7053
7208
|
insert();
|
|
@@ -7250,15 +7405,19 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7250
7405
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
7251
7406
|
else if (!resume) {
|
|
7252
7407
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
7408
|
+
let hasUpdatedAnchor = false;
|
|
7253
7409
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
7254
7410
|
if (pendingId === suspense.pendingId) {
|
|
7255
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7411
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7256
7412
|
queuePostFlushCb(effects);
|
|
7257
7413
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
7258
7414
|
}
|
|
7259
7415
|
};
|
|
7260
7416
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
7261
|
-
if (parentNode(activeBranch.el) === container)
|
|
7417
|
+
if (parentNode(activeBranch.el) === container) {
|
|
7418
|
+
anchor = next(activeBranch);
|
|
7419
|
+
hasUpdatedAnchor = true;
|
|
7420
|
+
}
|
|
7262
7421
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
7263
7422
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
7264
7423
|
}
|
|
@@ -7322,6 +7481,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7322
7481
|
handleError(err, instance, 0);
|
|
7323
7482
|
}).then((asyncSetupResult) => {
|
|
7324
7483
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
7484
|
+
setCurrentInstance(null, void 0);
|
|
7325
7485
|
instance.asyncResolved = true;
|
|
7326
7486
|
onResolve(asyncSetupResult);
|
|
7327
7487
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -7611,11 +7771,29 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7611
7771
|
el: vnode.el,
|
|
7612
7772
|
anchor: vnode.anchor,
|
|
7613
7773
|
ctx: vnode.ctx,
|
|
7614
|
-
ce: vnode.ce
|
|
7774
|
+
ce: vnode.ce,
|
|
7775
|
+
vi: vnode.vi,
|
|
7776
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
7777
|
+
vb: vnode.vb
|
|
7615
7778
|
};
|
|
7616
7779
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
7617
7780
|
return cloned;
|
|
7618
7781
|
}
|
|
7782
|
+
function cloneVaporSlotMeta(vnode) {
|
|
7783
|
+
const vaporSlot = vnode.vs;
|
|
7784
|
+
if (!vaporSlot) return vaporSlot;
|
|
7785
|
+
const cloned = {
|
|
7786
|
+
slot: vaporSlot.slot,
|
|
7787
|
+
fallback: vaporSlot.fallback,
|
|
7788
|
+
outletFallback: vaporSlot.outletFallback
|
|
7789
|
+
};
|
|
7790
|
+
if (vnode.el) {
|
|
7791
|
+
cloned.state = vaporSlot.state;
|
|
7792
|
+
cloned.ref = vaporSlot.ref;
|
|
7793
|
+
cloned.scope = vaporSlot.scope;
|
|
7794
|
+
}
|
|
7795
|
+
return cloned;
|
|
7796
|
+
}
|
|
7619
7797
|
/**
|
|
7620
7798
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
7621
7799
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -7678,6 +7856,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7678
7856
|
}
|
|
7679
7857
|
}
|
|
7680
7858
|
else if (isFunction(children)) {
|
|
7859
|
+
if (shapeFlag & 65) {
|
|
7860
|
+
normalizeChildren(vnode, { default: children });
|
|
7861
|
+
return;
|
|
7862
|
+
}
|
|
7681
7863
|
children = {
|
|
7682
7864
|
default: children,
|
|
7683
7865
|
_ctx: currentRenderingInstance
|
|
@@ -7741,6 +7923,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7741
7923
|
simpleSetCurrentInstance(instance);
|
|
7742
7924
|
}
|
|
7743
7925
|
};
|
|
7926
|
+
/**
|
|
7927
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
7928
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
7929
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
7930
|
+
* @internal
|
|
7931
|
+
*/
|
|
7932
|
+
const restoreCurrentInstance = (prev) => {
|
|
7933
|
+
setCurrentScope(prev[1]);
|
|
7934
|
+
simpleSetCurrentInstance(prev[0]);
|
|
7935
|
+
};
|
|
7744
7936
|
const internalOptions = [
|
|
7745
7937
|
"ce",
|
|
7746
7938
|
"type",
|
|
@@ -7892,7 +8084,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7892
8084
|
const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
|
|
7893
8085
|
const isAsyncSetup = isPromise(setupResult);
|
|
7894
8086
|
setActiveSub(prevSub);
|
|
7895
|
-
|
|
8087
|
+
restoreCurrentInstance(prev);
|
|
7896
8088
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
7897
8089
|
if (isAsyncSetup) {
|
|
7898
8090
|
const unsetCurrentInstance = () => {
|
|
@@ -7961,7 +8153,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7961
8153
|
applyOptions(instance);
|
|
7962
8154
|
} finally {
|
|
7963
8155
|
setActiveSub(prevSub);
|
|
7964
|
-
|
|
8156
|
+
restoreCurrentInstance(prevInstance);
|
|
7965
8157
|
}
|
|
7966
8158
|
}
|
|
7967
8159
|
if (!Component.render && instance.render === NOOP && !isSSR) if (!compile && Component.template)
|
|
@@ -8271,7 +8463,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8271
8463
|
}
|
|
8272
8464
|
//#endregion
|
|
8273
8465
|
//#region packages/runtime-core/src/index.ts
|
|
8274
|
-
const version = "3.6.0-
|
|
8466
|
+
const version = "3.6.0-rc.2";
|
|
8275
8467
|
const warn = warn$1;
|
|
8276
8468
|
/**
|
|
8277
8469
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -8734,7 +8926,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8734
8926
|
}
|
|
8735
8927
|
for (const key in next) {
|
|
8736
8928
|
if (key === "display") hasControlledDisplay = true;
|
|
8737
|
-
|
|
8929
|
+
const value = next[key];
|
|
8930
|
+
if (value != null) {
|
|
8931
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
8932
|
+
} else setStyle(style, key, "");
|
|
8738
8933
|
}
|
|
8739
8934
|
} else if (isCssString) {
|
|
8740
8935
|
if (prev !== next) {
|
|
@@ -8782,6 +8977,14 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8782
8977
|
}
|
|
8783
8978
|
return rawName;
|
|
8784
8979
|
}
|
|
8980
|
+
/**
|
|
8981
|
+
* Browsers update textarea width/height directly during native resize.
|
|
8982
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
8983
|
+
* still follow normal vnode style patching.
|
|
8984
|
+
*/
|
|
8985
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
8986
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
|
|
8987
|
+
}
|
|
8785
8988
|
//#endregion
|
|
8786
8989
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
8787
8990
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
@@ -8840,7 +9043,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8840
9043
|
const existingInvoker = invokers[rawName];
|
|
8841
9044
|
if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
|
|
8842
9045
|
else {
|
|
8843
|
-
const [name, options] =
|
|
9046
|
+
const [name, options] = parseEventName(rawName);
|
|
8844
9047
|
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
|
|
8845
9048
|
else if (existingInvoker) {
|
|
8846
9049
|
removeEventListener(el, name, existingInvoker, options);
|
|
@@ -8848,16 +9051,15 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8848
9051
|
}
|
|
8849
9052
|
}
|
|
8850
9053
|
}
|
|
8851
|
-
const optionsModifierRE = /(
|
|
8852
|
-
|
|
9054
|
+
const optionsModifierRE = /(Once|Passive|Capture)$/;
|
|
9055
|
+
const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
|
|
9056
|
+
function parseEventName(name) {
|
|
8853
9057
|
let options;
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
options[m[0].toLowerCase()] = true;
|
|
8860
|
-
}
|
|
9058
|
+
let m;
|
|
9059
|
+
while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
|
|
9060
|
+
if (!options) options = {};
|
|
9061
|
+
name = name.slice(0, name.length - m[1].length);
|
|
9062
|
+
options[m[1].toLowerCase()] = true;
|
|
8861
9063
|
}
|
|
8862
9064
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
8863
9065
|
}
|
|
@@ -8868,7 +9070,21 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8868
9070
|
const invoker = (e) => {
|
|
8869
9071
|
if (!e._vts) e._vts = Date.now();
|
|
8870
9072
|
else if (e._vts <= invoker.attached) return;
|
|
8871
|
-
|
|
9073
|
+
const value = invoker.value;
|
|
9074
|
+
if (isArray(value)) {
|
|
9075
|
+
const originalStop = e.stopImmediatePropagation;
|
|
9076
|
+
e.stopImmediatePropagation = () => {
|
|
9077
|
+
originalStop.call(e);
|
|
9078
|
+
e._stopped = true;
|
|
9079
|
+
};
|
|
9080
|
+
const handlers = value.slice();
|
|
9081
|
+
const args = [e];
|
|
9082
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
9083
|
+
if (e._stopped) break;
|
|
9084
|
+
const handler = handlers[i];
|
|
9085
|
+
if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
|
|
9086
|
+
}
|
|
9087
|
+
} else callWithAsyncErrorHandling(value, instance, 5, [e]);
|
|
8872
9088
|
};
|
|
8873
9089
|
invoker.value = initialValue;
|
|
8874
9090
|
invoker.attached = getNow();
|
|
@@ -8879,16 +9095,6 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8879
9095
|
warn(`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?\nExpected function or array of functions, received type ${typeof value}.`);
|
|
8880
9096
|
return NOOP;
|
|
8881
9097
|
}
|
|
8882
|
-
function patchStopImmediatePropagation(e, value) {
|
|
8883
|
-
if (isArray(value)) {
|
|
8884
|
-
const originalStop = e.stopImmediatePropagation;
|
|
8885
|
-
e.stopImmediatePropagation = () => {
|
|
8886
|
-
originalStop.call(e);
|
|
8887
|
-
e._stopped = true;
|
|
8888
|
-
};
|
|
8889
|
-
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
8890
|
-
} else return value;
|
|
8891
|
-
}
|
|
8892
9098
|
//#endregion
|
|
8893
9099
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
8894
9100
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -9216,7 +9422,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9216
9422
|
replacementNodes.push(child);
|
|
9217
9423
|
}
|
|
9218
9424
|
parent.removeChild(o);
|
|
9219
|
-
slotReplacements.set(o,
|
|
9425
|
+
slotReplacements.set(o, {
|
|
9426
|
+
nodes: replacementNodes,
|
|
9427
|
+
usedFallback: !content
|
|
9428
|
+
});
|
|
9220
9429
|
}
|
|
9221
9430
|
this._updateSlotNodes(slotReplacements);
|
|
9222
9431
|
}
|
|
@@ -9388,7 +9597,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9388
9597
|
prevChildren = [];
|
|
9389
9598
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
9390
9599
|
const child = children[i];
|
|
9391
|
-
if (child.el && child.el instanceof Element) {
|
|
9600
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
9392
9601
|
prevChildren.push(child);
|
|
9393
9602
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
9394
9603
|
positionMap.set(child, getPosition(child.el));
|
|
@@ -9612,7 +9821,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9612
9821
|
mounted(el, { value }) {
|
|
9613
9822
|
vModelSetSelected(el, value);
|
|
9614
9823
|
},
|
|
9615
|
-
beforeUpdate(el,
|
|
9824
|
+
beforeUpdate(el, { value }, vnode) {
|
|
9825
|
+
el._modelValue = value;
|
|
9616
9826
|
el[assignKey] = getModelAssigner(vnode);
|
|
9617
9827
|
},
|
|
9618
9828
|
updated(el, { value }) {
|
|
@@ -9623,10 +9833,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9623
9833
|
* @internal
|
|
9624
9834
|
*/
|
|
9625
9835
|
const vModelSelectInit = (el, value, number, set) => {
|
|
9626
|
-
|
|
9836
|
+
el._modelValue = value;
|
|
9627
9837
|
addEventListener(el, "change", () => {
|
|
9628
9838
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
9629
|
-
(set || el[assignKey])(el.multiple ?
|
|
9839
|
+
(set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
|
|
9630
9840
|
el._assigning = true;
|
|
9631
9841
|
nextTick(() => {
|
|
9632
9842
|
el._assigning = false;
|
|
@@ -9637,6 +9847,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9637
9847
|
* @internal
|
|
9638
9848
|
*/
|
|
9639
9849
|
const vModelSetSelected = (el, value) => {
|
|
9850
|
+
el._modelValue = value;
|
|
9640
9851
|
if (el._assigning) return;
|
|
9641
9852
|
const isMultiple = el.multiple;
|
|
9642
9853
|
const isArrayValue = isArray(value);
|