@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
|
**/
|
|
@@ -431,6 +431,13 @@ function warn$2(msg, ...args) {
|
|
|
431
431
|
const notifyBuffer = [];
|
|
432
432
|
let batchDepth = 0;
|
|
433
433
|
let activeSub = void 0;
|
|
434
|
+
let runDepth = 0;
|
|
435
|
+
function incRunDepth() {
|
|
436
|
+
++runDepth;
|
|
437
|
+
}
|
|
438
|
+
function decRunDepth() {
|
|
439
|
+
--runDepth;
|
|
440
|
+
}
|
|
434
441
|
let globalVersion = 0;
|
|
435
442
|
let notifyIndex = 0;
|
|
436
443
|
let notifyBufferLength = 0;
|
|
@@ -504,8 +511,10 @@ function propagate(link) {
|
|
|
504
511
|
const sub = link.sub;
|
|
505
512
|
let flags = sub.flags;
|
|
506
513
|
if (flags & 3) {
|
|
507
|
-
if (!(flags & 60))
|
|
508
|
-
|
|
514
|
+
if (!(flags & 60)) {
|
|
515
|
+
sub.flags = flags | 32;
|
|
516
|
+
if (runDepth) sub.flags |= 8;
|
|
517
|
+
} else if (!(flags & 12)) flags = 0;
|
|
509
518
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
510
519
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
511
520
|
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) {
|
|
@@ -998,7 +1004,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
998
1004
|
}
|
|
999
1005
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
1000
1006
|
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
1001
|
-
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
1007
|
+
if (target === /* @__PURE__ */ toRaw(receiver) && result) {
|
|
1002
1008
|
if (!hadKey) trigger(target, "add", key, value);
|
|
1003
1009
|
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
1004
1010
|
}
|
|
@@ -1216,9 +1222,6 @@ function targetTypeMap(rawType) {
|
|
|
1216
1222
|
default: return 0;
|
|
1217
1223
|
}
|
|
1218
1224
|
}
|
|
1219
|
-
function getTargetType(value) {
|
|
1220
|
-
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1221
|
-
}
|
|
1222
1225
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1223
1226
|
function reactive(target) {
|
|
1224
1227
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
@@ -1331,10 +1334,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1331
1334
|
return target;
|
|
1332
1335
|
}
|
|
1333
1336
|
if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
|
|
1334
|
-
|
|
1335
|
-
if (targetType === 0) return target;
|
|
1337
|
+
if (target["__v_skip"] || !Object.isExtensible(target)) return target;
|
|
1336
1338
|
const existingProxy = proxyMap.get(target);
|
|
1337
1339
|
if (existingProxy) return existingProxy;
|
|
1340
|
+
const targetType = targetTypeMap(toRawType(target));
|
|
1341
|
+
if (targetType === 0) return target;
|
|
1338
1342
|
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
1339
1343
|
proxyMap.set(target, proxy);
|
|
1340
1344
|
return proxy;
|
|
@@ -1767,9 +1771,11 @@ var ReactiveEffect = class {
|
|
|
1767
1771
|
if (!this.active) return this.fn();
|
|
1768
1772
|
cleanup(this);
|
|
1769
1773
|
const prevSub = startTracking(this);
|
|
1774
|
+
incRunDepth();
|
|
1770
1775
|
try {
|
|
1771
1776
|
return this.fn();
|
|
1772
1777
|
} finally {
|
|
1778
|
+
decRunDepth();
|
|
1773
1779
|
endTracking(this, prevSub);
|
|
1774
1780
|
const flags = this.flags;
|
|
1775
1781
|
if ((flags & 136) === 136) {
|
|
@@ -2150,8 +2156,9 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2150
2156
|
if (once && cb) {
|
|
2151
2157
|
const _cb = cb;
|
|
2152
2158
|
cb = (...args) => {
|
|
2153
|
-
_cb(...args);
|
|
2159
|
+
const res = _cb(...args);
|
|
2154
2160
|
this.stop();
|
|
2161
|
+
return res;
|
|
2155
2162
|
};
|
|
2156
2163
|
}
|
|
2157
2164
|
this.cb = cb;
|
|
@@ -2165,7 +2172,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2165
2172
|
if (!this.cb) return;
|
|
2166
2173
|
const { immediate, deep, call } = this.options;
|
|
2167
2174
|
if (initialRun && !immediate) return;
|
|
2168
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2175
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2169
2176
|
cleanup(this);
|
|
2170
2177
|
const currentWatcher = activeWatcher;
|
|
2171
2178
|
activeWatcher = this;
|
|
@@ -2472,8 +2479,8 @@ function findInsertionIndex(order, queue, start, end) {
|
|
|
2472
2479
|
/**
|
|
2473
2480
|
* @internal for runtime-vapor only
|
|
2474
2481
|
*/
|
|
2475
|
-
function queueJob(job, id, isPre = false) {
|
|
2476
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2482
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
2483
|
+
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)) {
|
|
2477
2484
|
jobsLength++;
|
|
2478
2485
|
queueFlush();
|
|
2479
2486
|
}
|
|
@@ -2582,6 +2589,7 @@ function flushJobs(seen) {
|
|
|
2582
2589
|
}
|
|
2583
2590
|
flushIndex = 0;
|
|
2584
2591
|
jobsLength = 0;
|
|
2592
|
+
jobs.length = 0;
|
|
2585
2593
|
flushPostFlushCbs(seen);
|
|
2586
2594
|
currentFlushPromise = null;
|
|
2587
2595
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -2639,6 +2647,14 @@ function createRecord(id, initialDef) {
|
|
|
2639
2647
|
function normalizeClassComponent(component) {
|
|
2640
2648
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2641
2649
|
}
|
|
2650
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
2651
|
+
let parent = instance.parent;
|
|
2652
|
+
while (parent) {
|
|
2653
|
+
if (dirtyInstances.has(parent)) return true;
|
|
2654
|
+
parent = parent.parent;
|
|
2655
|
+
}
|
|
2656
|
+
return false;
|
|
2657
|
+
}
|
|
2642
2658
|
function rerender(id, newRender) {
|
|
2643
2659
|
const record = map.get(id);
|
|
2644
2660
|
if (!record) return;
|
|
@@ -2670,42 +2686,69 @@ function reload(id, newComp) {
|
|
|
2670
2686
|
const isVapor = record.initialDef.__vapor;
|
|
2671
2687
|
updateComponentDef(record.initialDef, newComp);
|
|
2672
2688
|
const instances = [...record.instances];
|
|
2673
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2689
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2674
2690
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
const
|
|
2678
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2679
|
-
if (!dirtyInstances) {
|
|
2680
|
-
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2681
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2682
|
-
}
|
|
2683
|
-
dirtyInstances.add(instance);
|
|
2684
|
-
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2685
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
2686
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2687
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2688
|
-
if (instance.ceReload) {
|
|
2689
|
-
dirtyInstances.add(instance);
|
|
2690
|
-
instance.ceReload(newComp.styles);
|
|
2691
|
-
dirtyInstances.delete(instance);
|
|
2692
|
-
} else if (instance.parent) queueJob(() => {
|
|
2693
|
-
isHmrUpdating = true;
|
|
2691
|
+
const dirtyInstances = new Set(instances);
|
|
2692
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2693
|
+
for (const instance of instances) {
|
|
2694
2694
|
const parent = instance.parent;
|
|
2695
|
-
if (parent
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2695
|
+
if (parent) {
|
|
2696
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2697
|
+
rerenderedParents.add(parent);
|
|
2698
|
+
parent.hmrRerender();
|
|
2699
|
+
}
|
|
2700
|
+
} else instance.hmrReload(newComp);
|
|
2701
|
+
}
|
|
2702
|
+
} else {
|
|
2703
|
+
const parentUpdates = /* @__PURE__ */ new Map();
|
|
2704
|
+
const dirtyInstanceSet = new Set(instances);
|
|
2705
|
+
for (const instance of instances) {
|
|
2706
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2707
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2708
|
+
if (!dirtyInstances) {
|
|
2709
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2710
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2699
2711
|
}
|
|
2700
|
-
|
|
2701
|
-
|
|
2712
|
+
dirtyInstances.add(instance);
|
|
2713
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2714
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2715
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2716
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2717
|
+
if (instance.ceReload) {
|
|
2718
|
+
dirtyInstances.add(instance);
|
|
2719
|
+
instance.ceReload(newComp.styles);
|
|
2720
|
+
dirtyInstances.delete(instance);
|
|
2721
|
+
} else if (instance.parent) {
|
|
2722
|
+
const parent = instance.parent;
|
|
2723
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2724
|
+
let updates = parentUpdates.get(parent);
|
|
2725
|
+
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2726
|
+
updates.push([instance, dirtyInstances]);
|
|
2727
|
+
}
|
|
2728
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2729
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
2730
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2731
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2732
|
+
}
|
|
2733
|
+
parentUpdates.forEach((updates, parent) => {
|
|
2734
|
+
queueJob(() => {
|
|
2735
|
+
isHmrUpdating = true;
|
|
2736
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2737
|
+
else {
|
|
2738
|
+
const i = parent;
|
|
2739
|
+
if (!(i.effect.flags & 1024)) {
|
|
2740
|
+
i.renderCache = [];
|
|
2741
|
+
i.effect.run();
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
nextTick(() => {
|
|
2745
|
+
isHmrUpdating = false;
|
|
2746
|
+
});
|
|
2747
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
2748
|
+
dirtyInstances.delete(instance);
|
|
2749
|
+
});
|
|
2702
2750
|
});
|
|
2703
|
-
dirtyInstances.delete(instance);
|
|
2704
2751
|
});
|
|
2705
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
2706
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
2707
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2708
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2709
2752
|
}
|
|
2710
2753
|
queuePostFlushCb(() => {
|
|
2711
2754
|
hmrDirtyComponents.clear();
|
|
@@ -2848,10 +2891,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
2848
2891
|
const renderFnWithContext = (...args) => {
|
|
2849
2892
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
2850
2893
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
2894
|
+
const prevStackSize = blockStack.length;
|
|
2851
2895
|
let res;
|
|
2852
2896
|
try {
|
|
2853
2897
|
res = fn(...args);
|
|
2854
2898
|
} finally {
|
|
2899
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2855
2900
|
setCurrentRenderingInstance(prevInstance);
|
|
2856
2901
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
2857
2902
|
}
|
|
@@ -3026,7 +3071,7 @@ function instanceWatch(source, value, options) {
|
|
|
3026
3071
|
}
|
|
3027
3072
|
const prev = setCurrentInstance(this);
|
|
3028
3073
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3029
|
-
|
|
3074
|
+
restoreCurrentInstance(prev);
|
|
3030
3075
|
return res;
|
|
3031
3076
|
}
|
|
3032
3077
|
function createPathGetter(ctx, path) {
|
|
@@ -3039,6 +3084,7 @@ function createPathGetter(ctx, path) {
|
|
|
3039
3084
|
}
|
|
3040
3085
|
//#endregion
|
|
3041
3086
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
3087
|
+
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
3042
3088
|
const TeleportEndKey = Symbol("_vte");
|
|
3043
3089
|
const isTeleport = (type) => type.__isTeleport;
|
|
3044
3090
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
@@ -3064,58 +3110,70 @@ const TeleportImpl = {
|
|
|
3064
3110
|
name: "Teleport",
|
|
3065
3111
|
__isTeleport: true,
|
|
3066
3112
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
3067
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
3113
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
3068
3114
|
const disabled = isTeleportDisabled(n2.props);
|
|
3069
|
-
let {
|
|
3115
|
+
let { dynamicChildren } = n2;
|
|
3070
3116
|
if (isHmrUpdating) {
|
|
3071
3117
|
optimized = false;
|
|
3072
3118
|
dynamicChildren = null;
|
|
3073
3119
|
}
|
|
3120
|
+
const mount = (vnode, container, anchor) => {
|
|
3121
|
+
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3122
|
+
};
|
|
3123
|
+
const mountToTarget = (vnode = n2) => {
|
|
3124
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3125
|
+
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
3126
|
+
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
|
|
3127
|
+
if (target) {
|
|
3128
|
+
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3129
|
+
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3130
|
+
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3131
|
+
if (!disabled) {
|
|
3132
|
+
mount(vnode, target, targetAnchor);
|
|
3133
|
+
updateCssVars(vnode, false);
|
|
3134
|
+
}
|
|
3135
|
+
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3136
|
+
};
|
|
3137
|
+
const queuePendingMount = (vnode) => {
|
|
3138
|
+
const mountJob = () => {
|
|
3139
|
+
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3140
|
+
pendingMounts.delete(vnode);
|
|
3141
|
+
if (isTeleportDisabled(vnode.props)) {
|
|
3142
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
3143
|
+
updateCssVars(vnode, true);
|
|
3144
|
+
}
|
|
3145
|
+
mountToTarget(vnode);
|
|
3146
|
+
};
|
|
3147
|
+
pendingMounts.set(vnode, mountJob);
|
|
3148
|
+
queuePostRenderEffect(mountJob, void 0, parentSuspense);
|
|
3149
|
+
};
|
|
3074
3150
|
if (n1 == null) {
|
|
3075
3151
|
const placeholder = n2.el = createComment("teleport start");
|
|
3076
3152
|
const mainAnchor = n2.anchor = createComment("teleport end");
|
|
3077
3153
|
insert(placeholder, container, anchor);
|
|
3078
3154
|
insert(mainAnchor, container, anchor);
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
3084
|
-
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
3085
|
-
if (target) {
|
|
3086
|
-
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3087
|
-
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3088
|
-
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3089
|
-
if (!disabled) {
|
|
3090
|
-
mount(target, targetAnchor);
|
|
3091
|
-
updateCssVars(n2, false);
|
|
3092
|
-
}
|
|
3093
|
-
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3094
|
-
};
|
|
3155
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3156
|
+
queuePendingMount(n2);
|
|
3157
|
+
return;
|
|
3158
|
+
}
|
|
3095
3159
|
if (disabled) {
|
|
3096
|
-
mount(container, mainAnchor);
|
|
3160
|
+
mount(n2, container, mainAnchor);
|
|
3097
3161
|
updateCssVars(n2, true);
|
|
3098
3162
|
}
|
|
3099
|
-
|
|
3100
|
-
n2.el.__isMounted = false;
|
|
3101
|
-
queuePostRenderEffect(() => {
|
|
3102
|
-
if (n2.el.__isMounted !== false) return;
|
|
3103
|
-
mountToTarget();
|
|
3104
|
-
delete n2.el.__isMounted;
|
|
3105
|
-
}, void 0, parentSuspense);
|
|
3106
|
-
} else mountToTarget();
|
|
3163
|
+
mountToTarget();
|
|
3107
3164
|
} else {
|
|
3108
3165
|
n2.el = n1.el;
|
|
3109
|
-
n2.targetStart = n1.targetStart;
|
|
3110
3166
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
3111
|
-
const
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
}, void 0, parentSuspense);
|
|
3167
|
+
const pendingMount = pendingMounts.get(n1);
|
|
3168
|
+
if (pendingMount) {
|
|
3169
|
+
pendingMount.flags |= 4;
|
|
3170
|
+
pendingMounts.delete(n1);
|
|
3171
|
+
queuePendingMount(n2);
|
|
3117
3172
|
return;
|
|
3118
3173
|
}
|
|
3174
|
+
n2.targetStart = n1.targetStart;
|
|
3175
|
+
const target = n2.target = n1.target;
|
|
3176
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3119
3177
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
3120
3178
|
const currentContainer = wasDisabled ? container : target;
|
|
3121
3179
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -3129,24 +3187,30 @@ const TeleportImpl = {
|
|
|
3129
3187
|
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
|
|
3130
3188
|
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
|
|
3131
3189
|
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
3132
|
-
const nextTarget =
|
|
3133
|
-
if (nextTarget)
|
|
3134
|
-
|
|
3190
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
3191
|
+
if (nextTarget) {
|
|
3192
|
+
n2.target = nextTarget;
|
|
3193
|
+
moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
3194
|
+
} else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
|
|
3135
3195
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
3136
3196
|
updateCssVars(n2, disabled);
|
|
3137
3197
|
}
|
|
3138
3198
|
},
|
|
3139
3199
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
3140
|
-
const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
|
|
3200
|
+
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
|
|
3201
|
+
const disabled = isTeleportDisabled(props);
|
|
3202
|
+
const shouldRemove = doRemove || !disabled;
|
|
3203
|
+
const pendingMount = pendingMounts.get(vnode);
|
|
3204
|
+
if (pendingMount) {
|
|
3205
|
+
pendingMount.flags |= 4;
|
|
3206
|
+
pendingMounts.delete(vnode);
|
|
3207
|
+
}
|
|
3141
3208
|
if (targetStart) hostRemove(targetStart);
|
|
3142
3209
|
if (targetAnchor) hostRemove(targetAnchor);
|
|
3143
3210
|
doRemove && hostRemove(anchor);
|
|
3144
|
-
if (shapeFlag & 16) {
|
|
3145
|
-
const
|
|
3146
|
-
|
|
3147
|
-
const child = children[i];
|
|
3148
|
-
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3149
|
-
}
|
|
3211
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
3212
|
+
const child = children[i];
|
|
3213
|
+
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3150
3214
|
}
|
|
3151
3215
|
},
|
|
3152
3216
|
move: moveTeleport,
|
|
@@ -3157,7 +3221,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
3157
3221
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
3158
3222
|
const isReorder = moveType === 2;
|
|
3159
3223
|
if (isReorder) insert(el, container, parentAnchor);
|
|
3160
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
3224
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
3161
3225
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
3162
3226
|
}
|
|
3163
3227
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -3282,8 +3346,8 @@ const BaseTransitionImpl = {
|
|
|
3282
3346
|
const state = useTransitionState();
|
|
3283
3347
|
return () => {
|
|
3284
3348
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
3285
|
-
|
|
3286
|
-
|
|
3349
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3350
|
+
if (!child) return;
|
|
3287
3351
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3288
3352
|
const { mode } = rawProps;
|
|
3289
3353
|
checkTransitionMode(mode);
|
|
@@ -3465,12 +3529,11 @@ function getInnerChild$1(vnode) {
|
|
|
3465
3529
|
}
|
|
3466
3530
|
}
|
|
3467
3531
|
function setTransitionHooks(vnode, hooks) {
|
|
3468
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
3469
|
-
else {
|
|
3532
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3470
3533
|
vnode.transition = hooks;
|
|
3471
|
-
setTransitionHooks(vnode.component
|
|
3472
|
-
|
|
3473
|
-
else if (vnode.shapeFlag & 128) {
|
|
3534
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
3535
|
+
else setTransitionHooks(vnode.component.subTree, hooks);
|
|
3536
|
+
} else if (vnode.shapeFlag & 128) {
|
|
3474
3537
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3475
3538
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3476
3539
|
} else vnode.transition = hooks;
|
|
@@ -3735,7 +3798,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3735
3798
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3736
3799
|
break;
|
|
3737
3800
|
case VaporSlot:
|
|
3738
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
|
|
3801
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
3739
3802
|
break;
|
|
3740
3803
|
default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
3741
3804
|
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -3745,16 +3808,31 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3745
3808
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
3746
3809
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
3747
3810
|
else nextNode = nextSibling(node);
|
|
3748
|
-
if (vnode.type.__vapor)
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
}
|
|
3756
|
-
|
|
3757
|
-
|
|
3811
|
+
if (vnode.type.__vapor) {
|
|
3812
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
|
|
3813
|
+
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
3814
|
+
if (vnode.dirs) {
|
|
3815
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
3816
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
3817
|
+
}
|
|
3818
|
+
}, () => {
|
|
3819
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
3820
|
+
});
|
|
3821
|
+
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
3822
|
+
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
3823
|
+
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
3824
|
+
} else {
|
|
3825
|
+
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
3826
|
+
const component = vnode.component;
|
|
3827
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
|
|
3828
|
+
let subTree;
|
|
3829
|
+
if (isFragmentStart) {
|
|
3830
|
+
subTree = createVNode(Fragment);
|
|
3831
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
3832
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
3833
|
+
subTree.el = node;
|
|
3834
|
+
component.subTree = subTree;
|
|
3835
|
+
}
|
|
3758
3836
|
}
|
|
3759
3837
|
} else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
|
|
3760
3838
|
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
@@ -3766,7 +3844,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3766
3844
|
};
|
|
3767
3845
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
3768
3846
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
3769
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
3847
|
+
const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
3770
3848
|
const forcePatch = type === "input" || type === "option";
|
|
3771
3849
|
{
|
|
3772
3850
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
@@ -3784,15 +3862,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3784
3862
|
}
|
|
3785
3863
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
3786
3864
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3787
|
-
|
|
3865
|
+
if (next && !isMismatchAllowed(el, 1)) {
|
|
3866
|
+
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
3867
|
+
logMismatchError();
|
|
3868
|
+
}
|
|
3788
3869
|
while (next) {
|
|
3789
|
-
if (!isMismatchAllowed(el, 1)) {
|
|
3790
|
-
if (!hasWarned) {
|
|
3791
|
-
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
3792
|
-
hasWarned = true;
|
|
3793
|
-
}
|
|
3794
|
-
logMismatchError();
|
|
3795
|
-
}
|
|
3796
3870
|
const cur = next;
|
|
3797
3871
|
next = next.nextSibling;
|
|
3798
3872
|
remove(cur);
|
|
@@ -3811,9 +3885,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3811
3885
|
}
|
|
3812
3886
|
if (props) {
|
|
3813
3887
|
const isCustomElement = el.tagName.includes("-");
|
|
3888
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
3814
3889
|
for (const key in props) {
|
|
3815
3890
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
3816
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)) patchProp(el, key, null, props[key],
|
|
3891
|
+
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);
|
|
3817
3892
|
}
|
|
3818
3893
|
}
|
|
3819
3894
|
let vnodeHooks;
|
|
@@ -3831,7 +3906,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3831
3906
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
3832
3907
|
const children = parentVNode.children;
|
|
3833
3908
|
const l = children.length;
|
|
3834
|
-
let
|
|
3909
|
+
let hasCheckedMismatch = false;
|
|
3835
3910
|
for (let i = 0; i < l; i++) {
|
|
3836
3911
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
3837
3912
|
const isText = vnode.type === Text;
|
|
@@ -3845,12 +3920,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3845
3920
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3846
3921
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
3847
3922
|
else {
|
|
3848
|
-
if (!
|
|
3849
|
-
|
|
3923
|
+
if (!hasCheckedMismatch) {
|
|
3924
|
+
hasCheckedMismatch = true;
|
|
3925
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
3850
3926
|
warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
|
|
3851
|
-
|
|
3927
|
+
logMismatchError();
|
|
3852
3928
|
}
|
|
3853
|
-
logMismatchError();
|
|
3854
3929
|
}
|
|
3855
3930
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
3856
3931
|
}
|
|
@@ -3870,7 +3945,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3870
3945
|
}
|
|
3871
3946
|
};
|
|
3872
3947
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
3873
|
-
if (!
|
|
3948
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
3874
3949
|
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);
|
|
3875
3950
|
logMismatchError();
|
|
3876
3951
|
}
|
|
@@ -4034,7 +4109,9 @@ const MismatchTypeString = {
|
|
|
4034
4109
|
};
|
|
4035
4110
|
function isMismatchAllowed(el, allowedType) {
|
|
4036
4111
|
if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
|
|
4037
|
-
|
|
4112
|
+
return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
|
|
4113
|
+
}
|
|
4114
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
4038
4115
|
if (allowedAttr == null) return false;
|
|
4039
4116
|
else if (allowedAttr === "") return true;
|
|
4040
4117
|
else {
|
|
@@ -4043,6 +4120,16 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
4043
4120
|
return list.includes(MismatchTypeString[allowedType]);
|
|
4044
4121
|
}
|
|
4045
4122
|
}
|
|
4123
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
4124
|
+
return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
4125
|
+
}
|
|
4126
|
+
function isMismatchAllowedByNode(node) {
|
|
4127
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
|
|
4128
|
+
}
|
|
4129
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
4130
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
4131
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
|
|
4132
|
+
}
|
|
4046
4133
|
//#endregion
|
|
4047
4134
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
4048
4135
|
let requestIdleCallback;
|
|
@@ -4161,11 +4248,16 @@ function defineAsyncComponent(source) {
|
|
|
4161
4248
|
onError(err);
|
|
4162
4249
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
4163
4250
|
});
|
|
4164
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
4251
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
4165
4252
|
load().then(() => {
|
|
4253
|
+
if (instance.isUnmounted) return;
|
|
4166
4254
|
loaded.value = true;
|
|
4167
4255
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
4168
4256
|
}).catch((err) => {
|
|
4257
|
+
if (instance.isUnmounted) {
|
|
4258
|
+
setPendingRequest(null);
|
|
4259
|
+
return;
|
|
4260
|
+
}
|
|
4169
4261
|
onError(err);
|
|
4170
4262
|
error.value = err;
|
|
4171
4263
|
});
|
|
@@ -4223,14 +4315,22 @@ function createAsyncComponentContext(source) {
|
|
|
4223
4315
|
setPendingRequest: (request) => pendingRequest = request
|
|
4224
4316
|
};
|
|
4225
4317
|
}
|
|
4226
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
4318
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
4227
4319
|
const loaded = /* @__PURE__ */ ref(false);
|
|
4228
4320
|
const error = /* @__PURE__ */ ref();
|
|
4229
4321
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4230
|
-
|
|
4322
|
+
let timeoutTimer;
|
|
4323
|
+
let delayTimer;
|
|
4324
|
+
if (instance) onUnmounted(() => {
|
|
4325
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4326
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4327
|
+
}, instance);
|
|
4328
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
4329
|
+
if (instance && instance.isUnmounted) return;
|
|
4231
4330
|
delayed.value = false;
|
|
4232
4331
|
}, delay);
|
|
4233
|
-
if (timeout != null) setTimeout(() => {
|
|
4332
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
4333
|
+
if (instance && instance.isUnmounted) return;
|
|
4234
4334
|
if (!loaded.value && !error.value) {
|
|
4235
4335
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
4236
4336
|
onError(err);
|
|
@@ -4248,6 +4348,7 @@ const useAsyncComponentState = (delay, timeout, onError) => {
|
|
|
4248
4348
|
* @internal
|
|
4249
4349
|
*/
|
|
4250
4350
|
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
4351
|
+
const wasConnected = el.isConnected;
|
|
4251
4352
|
let patched = false;
|
|
4252
4353
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4253
4354
|
const performHydrate = () => {
|
|
@@ -4258,6 +4359,7 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
4258
4359
|
}
|
|
4259
4360
|
return;
|
|
4260
4361
|
}
|
|
4362
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
4261
4363
|
hydrate();
|
|
4262
4364
|
};
|
|
4263
4365
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -4494,7 +4596,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4494
4596
|
try {
|
|
4495
4597
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
4496
4598
|
} finally {
|
|
4497
|
-
|
|
4599
|
+
restoreCurrentInstance(prev);
|
|
4498
4600
|
setActiveSub(prevSub);
|
|
4499
4601
|
}
|
|
4500
4602
|
});
|
|
@@ -4623,8 +4725,9 @@ function createSlots(slots, dynamicSlots) {
|
|
|
4623
4725
|
* Compiler runtime helper for rendering `<slot/>`
|
|
4624
4726
|
* @private
|
|
4625
4727
|
*/
|
|
4626
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
4728
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
4627
4729
|
let slot = slots[name];
|
|
4730
|
+
if (fallback) fallback.__vdom = true;
|
|
4628
4731
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
4629
4732
|
if (vaporSlot) {
|
|
4630
4733
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -4632,25 +4735,35 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
4632
4735
|
slot: vaporSlot,
|
|
4633
4736
|
fallback
|
|
4634
4737
|
};
|
|
4738
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
4635
4739
|
return ret;
|
|
4636
4740
|
}
|
|
4637
4741
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
4638
|
-
const
|
|
4639
|
-
|
|
4640
|
-
|
|
4742
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
4743
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
4744
|
+
if (name !== "default") slotProps.name = name;
|
|
4745
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
4641
4746
|
}
|
|
4642
4747
|
if (slot && slot.length > 1) {
|
|
4643
4748
|
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.");
|
|
4644
4749
|
slot = () => [];
|
|
4645
4750
|
}
|
|
4646
4751
|
if (slot && slot._c) slot._d = false;
|
|
4752
|
+
const prevStackSize = blockStack.length;
|
|
4647
4753
|
openBlock();
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4754
|
+
let rendered;
|
|
4755
|
+
try {
|
|
4756
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
4757
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
4758
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
4759
|
+
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
4760
|
+
} catch (err) {
|
|
4761
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
4762
|
+
throw err;
|
|
4763
|
+
} finally {
|
|
4764
|
+
if (slot && slot._c) slot._d = true;
|
|
4765
|
+
}
|
|
4652
4766
|
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
4653
|
-
if (slot && slot._c) slot._d = true;
|
|
4654
4767
|
return rendered;
|
|
4655
4768
|
}
|
|
4656
4769
|
function ensureValidVNode(vnodes) {
|
|
@@ -4663,9 +4776,7 @@ function ensureValidVNode(vnodes) {
|
|
|
4663
4776
|
}
|
|
4664
4777
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
4665
4778
|
let vaporSlot;
|
|
4666
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
4667
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
4668
|
-
}
|
|
4779
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
4669
4780
|
}
|
|
4670
4781
|
//#endregion
|
|
4671
4782
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -5031,26 +5142,39 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
5031
5142
|
function withAsyncContext(getAwaitable) {
|
|
5032
5143
|
const ctx = getCurrentGenericInstance();
|
|
5033
5144
|
const inSSRSetup = isInSSRComponentSetup;
|
|
5145
|
+
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
5034
5146
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
5035
5147
|
let awaitable = getAwaitable();
|
|
5036
5148
|
setCurrentInstance(null, void 0);
|
|
5037
5149
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5038
5150
|
const restore = () => {
|
|
5151
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5039
5152
|
setCurrentInstance(ctx);
|
|
5040
5153
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
5154
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
5155
|
+
return () => {
|
|
5156
|
+
if (reset) reset();
|
|
5157
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
5158
|
+
};
|
|
5041
5159
|
};
|
|
5042
5160
|
const cleanup = () => {
|
|
5043
5161
|
setCurrentInstance(null, void 0);
|
|
5044
5162
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5045
5163
|
};
|
|
5046
5164
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
5047
|
-
restore();
|
|
5048
|
-
Promise.resolve().then(() => Promise.resolve().then(
|
|
5165
|
+
const reset = restore();
|
|
5166
|
+
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
5167
|
+
if (reset) reset();
|
|
5168
|
+
cleanup();
|
|
5169
|
+
}));
|
|
5049
5170
|
throw e;
|
|
5050
5171
|
});
|
|
5051
5172
|
return [awaitable, () => {
|
|
5052
|
-
restore();
|
|
5053
|
-
Promise.resolve().then(
|
|
5173
|
+
const reset = restore();
|
|
5174
|
+
Promise.resolve().then(() => {
|
|
5175
|
+
if (reset) reset();
|
|
5176
|
+
cleanup();
|
|
5177
|
+
});
|
|
5054
5178
|
}];
|
|
5055
5179
|
}
|
|
5056
5180
|
//#endregion
|
|
@@ -5474,12 +5598,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
5474
5598
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
5475
5599
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
5476
5600
|
}
|
|
5477
|
-
|
|
5601
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
5602
|
+
if (!hasVModel) {
|
|
5478
5603
|
localValue = value;
|
|
5479
5604
|
trigger();
|
|
5480
5605
|
}
|
|
5481
5606
|
i.emit(`update:${name}`, emittedValue);
|
|
5482
|
-
if (hasChanged(value,
|
|
5607
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
5483
5608
|
prevSetValue = value;
|
|
5484
5609
|
prevEmittedValue = emittedValue;
|
|
5485
5610
|
}
|
|
@@ -5586,7 +5711,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
5586
5711
|
*/
|
|
5587
5712
|
function isEmitListener(options, key) {
|
|
5588
5713
|
if (!options || !isOn(key)) return false;
|
|
5589
|
-
key = key.slice(2)
|
|
5714
|
+
key = key.slice(2);
|
|
5715
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
5590
5716
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
5591
5717
|
}
|
|
5592
5718
|
//#endregion
|
|
@@ -5915,7 +6041,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
5915
6041
|
const prev = setCurrentInstance(instance);
|
|
5916
6042
|
const props = /* @__PURE__ */ toRaw(instance.props);
|
|
5917
6043
|
value = factory.call(null, props);
|
|
5918
|
-
|
|
6044
|
+
restoreCurrentInstance(prev);
|
|
5919
6045
|
return value;
|
|
5920
6046
|
}
|
|
5921
6047
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -6061,7 +6187,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
6061
6187
|
const receivedType = toRawType(value);
|
|
6062
6188
|
const expectedValue = styleValue(value, expectedType);
|
|
6063
6189
|
const receivedValue = styleValue(value, receivedType);
|
|
6064
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
6190
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
6065
6191
|
message += `, got ${receivedType} `;
|
|
6066
6192
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
6067
6193
|
return message;
|
|
@@ -6070,7 +6196,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
6070
6196
|
* dev only
|
|
6071
6197
|
*/
|
|
6072
6198
|
function styleValue(value, type) {
|
|
6073
|
-
if (
|
|
6199
|
+
if (isSymbol(value)) return value.toString();
|
|
6200
|
+
else if (type === "String") return `"${value}"`;
|
|
6074
6201
|
else if (type === "Number") return `${Number(value)}`;
|
|
6075
6202
|
else return `${value}`;
|
|
6076
6203
|
}
|
|
@@ -6087,8 +6214,11 @@ function isExplicable(type) {
|
|
|
6087
6214
|
/**
|
|
6088
6215
|
* dev only
|
|
6089
6216
|
*/
|
|
6090
|
-
function
|
|
6091
|
-
return args.
|
|
6217
|
+
function isCoercible(...args) {
|
|
6218
|
+
return args.every((elem) => {
|
|
6219
|
+
const value = elem.toLowerCase();
|
|
6220
|
+
return value !== "boolean" && value !== "symbol";
|
|
6221
|
+
});
|
|
6092
6222
|
}
|
|
6093
6223
|
//#endregion
|
|
6094
6224
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -6393,7 +6523,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6393
6523
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
6394
6524
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
6395
6525
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
6396
|
-
if (isHmrUpdating) {
|
|
6526
|
+
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
6397
6527
|
patchFlag = 0;
|
|
6398
6528
|
optimized = false;
|
|
6399
6529
|
dynamicChildren = null;
|
|
@@ -6471,21 +6601,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6471
6601
|
};
|
|
6472
6602
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6473
6603
|
n2.slotScopeIds = slotScopeIds;
|
|
6474
|
-
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
6604
|
+
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
6475
6605
|
else {
|
|
6606
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
6476
6607
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
6477
6608
|
if (n2.dirs) {
|
|
6478
6609
|
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
6479
6610
|
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
6480
6611
|
}
|
|
6612
|
+
}, () => {
|
|
6613
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
6481
6614
|
});
|
|
6482
6615
|
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
6616
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
6617
|
+
if (vnodeMountedHook) {
|
|
6618
|
+
const scopedVNode = n2;
|
|
6619
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
6620
|
+
}
|
|
6483
6621
|
}
|
|
6484
6622
|
else {
|
|
6485
|
-
|
|
6623
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
6624
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
6486
6625
|
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
6626
|
+
}, () => {
|
|
6627
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
6628
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
6487
6629
|
});
|
|
6488
|
-
|
|
6630
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
6631
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
6632
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
6633
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
6634
|
+
}, void 0, parentSuspense);
|
|
6489
6635
|
}
|
|
6490
6636
|
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
6491
6637
|
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
@@ -6798,7 +6944,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6798
6944
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
6799
6945
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
6800
6946
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
6801
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
6947
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
6802
6948
|
return;
|
|
6803
6949
|
}
|
|
6804
6950
|
if (shapeFlag & 6) {
|
|
@@ -6831,8 +6977,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6831
6977
|
else hostInsert(el, container, anchor);
|
|
6832
6978
|
};
|
|
6833
6979
|
const performLeave = () => {
|
|
6980
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
6834
6981
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
6835
|
-
|
|
6982
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
6983
|
+
else leave(el, () => {
|
|
6836
6984
|
remove();
|
|
6837
6985
|
afterLeave && afterLeave();
|
|
6838
6986
|
});
|
|
@@ -6852,7 +7000,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6852
7000
|
}
|
|
6853
7001
|
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
6854
7002
|
if (shapeFlag & 256) {
|
|
6855
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
7003
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
6856
7004
|
else parentComponent.ctx.deactivate(vnode);
|
|
6857
7005
|
return;
|
|
6858
7006
|
}
|
|
@@ -6862,8 +7010,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6862
7010
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
6863
7011
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
6864
7012
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
6865
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
6866
|
-
if (
|
|
7013
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
7014
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
7015
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
7016
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
7017
|
+
}, void 0, parentSuspense);
|
|
6867
7018
|
return;
|
|
6868
7019
|
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
6869
7020
|
else {
|
|
@@ -6876,7 +7027,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6876
7027
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
6877
7028
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
6878
7029
|
if (type === VaporSlot) {
|
|
6879
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
7030
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
6880
7031
|
return;
|
|
6881
7032
|
}
|
|
6882
7033
|
if (doRemove) remove(vnode);
|
|
@@ -6924,7 +7075,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6924
7075
|
if (effect) {
|
|
6925
7076
|
effect.stop();
|
|
6926
7077
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
6927
|
-
}
|
|
7078
|
+
} else if (doRemove && subTree && instance.vnode.el) remove(subTree);
|
|
6928
7079
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
6929
7080
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
6930
7081
|
devtoolsComponentRemoved(instance);
|
|
@@ -7050,6 +7201,10 @@ function invalidateMount(hooks) {
|
|
|
7050
7201
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
7051
7202
|
}
|
|
7052
7203
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
7204
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
7205
|
+
insert();
|
|
7206
|
+
return;
|
|
7207
|
+
}
|
|
7053
7208
|
if (force || needTransition(parentSuspense, transition)) {
|
|
7054
7209
|
transition.beforeEnter(el);
|
|
7055
7210
|
insert();
|
|
@@ -7252,15 +7407,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7252
7407
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
7253
7408
|
else if (!resume) {
|
|
7254
7409
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
7410
|
+
let hasUpdatedAnchor = false;
|
|
7255
7411
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
7256
7412
|
if (pendingId === suspense.pendingId) {
|
|
7257
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7413
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7258
7414
|
queuePostFlushCb(effects);
|
|
7259
7415
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
7260
7416
|
}
|
|
7261
7417
|
};
|
|
7262
7418
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
7263
|
-
if (parentNode(activeBranch.el) === container)
|
|
7419
|
+
if (parentNode(activeBranch.el) === container) {
|
|
7420
|
+
anchor = next(activeBranch);
|
|
7421
|
+
hasUpdatedAnchor = true;
|
|
7422
|
+
}
|
|
7264
7423
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
7265
7424
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
7266
7425
|
}
|
|
@@ -7324,6 +7483,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7324
7483
|
handleError(err, instance, 0);
|
|
7325
7484
|
}).then((asyncSetupResult) => {
|
|
7326
7485
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
7486
|
+
setCurrentInstance(null, void 0);
|
|
7327
7487
|
instance.asyncResolved = true;
|
|
7328
7488
|
onResolve(asyncSetupResult);
|
|
7329
7489
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -7613,11 +7773,29 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
7613
7773
|
el: vnode.el,
|
|
7614
7774
|
anchor: vnode.anchor,
|
|
7615
7775
|
ctx: vnode.ctx,
|
|
7616
|
-
ce: vnode.ce
|
|
7776
|
+
ce: vnode.ce,
|
|
7777
|
+
vi: vnode.vi,
|
|
7778
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
7779
|
+
vb: vnode.vb
|
|
7617
7780
|
};
|
|
7618
7781
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
7619
7782
|
return cloned;
|
|
7620
7783
|
}
|
|
7784
|
+
function cloneVaporSlotMeta(vnode) {
|
|
7785
|
+
const vaporSlot = vnode.vs;
|
|
7786
|
+
if (!vaporSlot) return vaporSlot;
|
|
7787
|
+
const cloned = {
|
|
7788
|
+
slot: vaporSlot.slot,
|
|
7789
|
+
fallback: vaporSlot.fallback,
|
|
7790
|
+
outletFallback: vaporSlot.outletFallback
|
|
7791
|
+
};
|
|
7792
|
+
if (vnode.el) {
|
|
7793
|
+
cloned.state = vaporSlot.state;
|
|
7794
|
+
cloned.ref = vaporSlot.ref;
|
|
7795
|
+
cloned.scope = vaporSlot.scope;
|
|
7796
|
+
}
|
|
7797
|
+
return cloned;
|
|
7798
|
+
}
|
|
7621
7799
|
/**
|
|
7622
7800
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
7623
7801
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -7680,6 +7858,10 @@ function normalizeChildren(vnode, children) {
|
|
|
7680
7858
|
}
|
|
7681
7859
|
}
|
|
7682
7860
|
else if (isFunction(children)) {
|
|
7861
|
+
if (shapeFlag & 65) {
|
|
7862
|
+
normalizeChildren(vnode, { default: children });
|
|
7863
|
+
return;
|
|
7864
|
+
}
|
|
7683
7865
|
children = {
|
|
7684
7866
|
default: children,
|
|
7685
7867
|
_ctx: currentRenderingInstance
|
|
@@ -7743,6 +7925,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
7743
7925
|
simpleSetCurrentInstance(instance);
|
|
7744
7926
|
}
|
|
7745
7927
|
};
|
|
7928
|
+
/**
|
|
7929
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
7930
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
7931
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
7932
|
+
* @internal
|
|
7933
|
+
*/
|
|
7934
|
+
const restoreCurrentInstance = (prev) => {
|
|
7935
|
+
setCurrentScope(prev[1]);
|
|
7936
|
+
simpleSetCurrentInstance(prev[0]);
|
|
7937
|
+
};
|
|
7746
7938
|
const internalOptions = [
|
|
7747
7939
|
"ce",
|
|
7748
7940
|
"type",
|
|
@@ -7894,7 +8086,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7894
8086
|
const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
|
|
7895
8087
|
const isAsyncSetup = isPromise(setupResult);
|
|
7896
8088
|
setActiveSub(prevSub);
|
|
7897
|
-
|
|
8089
|
+
restoreCurrentInstance(prev);
|
|
7898
8090
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
7899
8091
|
if (isAsyncSetup) {
|
|
7900
8092
|
const unsetCurrentInstance = () => {
|
|
@@ -7963,7 +8155,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
7963
8155
|
applyOptions(instance);
|
|
7964
8156
|
} finally {
|
|
7965
8157
|
setActiveSub(prevSub);
|
|
7966
|
-
|
|
8158
|
+
restoreCurrentInstance(prevInstance);
|
|
7967
8159
|
}
|
|
7968
8160
|
}
|
|
7969
8161
|
if (!Component.render && instance.render === NOOP && !isSSR) if (!compile && Component.template)
|
|
@@ -8273,7 +8465,7 @@ function isMemoSame(cached, memo) {
|
|
|
8273
8465
|
}
|
|
8274
8466
|
//#endregion
|
|
8275
8467
|
//#region packages/runtime-core/src/index.ts
|
|
8276
|
-
const version = "3.6.0-
|
|
8468
|
+
const version = "3.6.0-rc.2";
|
|
8277
8469
|
const warn = warn$1;
|
|
8278
8470
|
/**
|
|
8279
8471
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -8736,7 +8928,10 @@ function patchStyle(el, prev, next) {
|
|
|
8736
8928
|
}
|
|
8737
8929
|
for (const key in next) {
|
|
8738
8930
|
if (key === "display") hasControlledDisplay = true;
|
|
8739
|
-
|
|
8931
|
+
const value = next[key];
|
|
8932
|
+
if (value != null) {
|
|
8933
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
8934
|
+
} else setStyle(style, key, "");
|
|
8740
8935
|
}
|
|
8741
8936
|
} else if (isCssString) {
|
|
8742
8937
|
if (prev !== next) {
|
|
@@ -8784,6 +8979,14 @@ function autoPrefix(style, rawName) {
|
|
|
8784
8979
|
}
|
|
8785
8980
|
return rawName;
|
|
8786
8981
|
}
|
|
8982
|
+
/**
|
|
8983
|
+
* Browsers update textarea width/height directly during native resize.
|
|
8984
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
8985
|
+
* still follow normal vnode style patching.
|
|
8986
|
+
*/
|
|
8987
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
8988
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
|
|
8989
|
+
}
|
|
8787
8990
|
//#endregion
|
|
8788
8991
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
8789
8992
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
@@ -8842,7 +9045,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
8842
9045
|
const existingInvoker = invokers[rawName];
|
|
8843
9046
|
if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
|
|
8844
9047
|
else {
|
|
8845
|
-
const [name, options] =
|
|
9048
|
+
const [name, options] = parseEventName(rawName);
|
|
8846
9049
|
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
|
|
8847
9050
|
else if (existingInvoker) {
|
|
8848
9051
|
removeEventListener(el, name, existingInvoker, options);
|
|
@@ -8850,16 +9053,15 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
8850
9053
|
}
|
|
8851
9054
|
}
|
|
8852
9055
|
}
|
|
8853
|
-
const optionsModifierRE = /(
|
|
8854
|
-
|
|
9056
|
+
const optionsModifierRE = /(Once|Passive|Capture)$/;
|
|
9057
|
+
const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
|
|
9058
|
+
function parseEventName(name) {
|
|
8855
9059
|
let options;
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
options[m[0].toLowerCase()] = true;
|
|
8862
|
-
}
|
|
9060
|
+
let m;
|
|
9061
|
+
while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
|
|
9062
|
+
if (!options) options = {};
|
|
9063
|
+
name = name.slice(0, name.length - m[1].length);
|
|
9064
|
+
options[m[1].toLowerCase()] = true;
|
|
8863
9065
|
}
|
|
8864
9066
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
8865
9067
|
}
|
|
@@ -8870,7 +9072,21 @@ function createInvoker(initialValue, instance) {
|
|
|
8870
9072
|
const invoker = (e) => {
|
|
8871
9073
|
if (!e._vts) e._vts = Date.now();
|
|
8872
9074
|
else if (e._vts <= invoker.attached) return;
|
|
8873
|
-
|
|
9075
|
+
const value = invoker.value;
|
|
9076
|
+
if (isArray(value)) {
|
|
9077
|
+
const originalStop = e.stopImmediatePropagation;
|
|
9078
|
+
e.stopImmediatePropagation = () => {
|
|
9079
|
+
originalStop.call(e);
|
|
9080
|
+
e._stopped = true;
|
|
9081
|
+
};
|
|
9082
|
+
const handlers = value.slice();
|
|
9083
|
+
const args = [e];
|
|
9084
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
9085
|
+
if (e._stopped) break;
|
|
9086
|
+
const handler = handlers[i];
|
|
9087
|
+
if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
|
|
9088
|
+
}
|
|
9089
|
+
} else callWithAsyncErrorHandling(value, instance, 5, [e]);
|
|
8874
9090
|
};
|
|
8875
9091
|
invoker.value = initialValue;
|
|
8876
9092
|
invoker.attached = getNow();
|
|
@@ -8881,16 +9097,6 @@ function sanitizeEventValue(value, propName) {
|
|
|
8881
9097
|
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}.`);
|
|
8882
9098
|
return NOOP;
|
|
8883
9099
|
}
|
|
8884
|
-
function patchStopImmediatePropagation(e, value) {
|
|
8885
|
-
if (isArray(value)) {
|
|
8886
|
-
const originalStop = e.stopImmediatePropagation;
|
|
8887
|
-
e.stopImmediatePropagation = () => {
|
|
8888
|
-
originalStop.call(e);
|
|
8889
|
-
e._stopped = true;
|
|
8890
|
-
};
|
|
8891
|
-
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
8892
|
-
} else return value;
|
|
8893
|
-
}
|
|
8894
9100
|
//#endregion
|
|
8895
9101
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
8896
9102
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -9218,7 +9424,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
9218
9424
|
replacementNodes.push(child);
|
|
9219
9425
|
}
|
|
9220
9426
|
parent.removeChild(o);
|
|
9221
|
-
slotReplacements.set(o,
|
|
9427
|
+
slotReplacements.set(o, {
|
|
9428
|
+
nodes: replacementNodes,
|
|
9429
|
+
usedFallback: !content
|
|
9430
|
+
});
|
|
9222
9431
|
}
|
|
9223
9432
|
this._updateSlotNodes(slotReplacements);
|
|
9224
9433
|
}
|
|
@@ -9406,7 +9615,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
|
|
|
9406
9615
|
prevChildren = [];
|
|
9407
9616
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
9408
9617
|
const child = children[i];
|
|
9409
|
-
if (child.el && child.el instanceof Element) {
|
|
9618
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
9410
9619
|
prevChildren.push(child);
|
|
9411
9620
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
9412
9621
|
positionMap.set(child, getPosition(child.el));
|
|
@@ -9630,7 +9839,8 @@ const vModelSelect = {
|
|
|
9630
9839
|
mounted(el, { value }) {
|
|
9631
9840
|
vModelSetSelected(el, value);
|
|
9632
9841
|
},
|
|
9633
|
-
beforeUpdate(el,
|
|
9842
|
+
beforeUpdate(el, { value }, vnode) {
|
|
9843
|
+
el._modelValue = value;
|
|
9634
9844
|
el[assignKey] = getModelAssigner(vnode);
|
|
9635
9845
|
},
|
|
9636
9846
|
updated(el, { value }) {
|
|
@@ -9641,10 +9851,10 @@ const vModelSelect = {
|
|
|
9641
9851
|
* @internal
|
|
9642
9852
|
*/
|
|
9643
9853
|
const vModelSelectInit = (el, value, number, set) => {
|
|
9644
|
-
|
|
9854
|
+
el._modelValue = value;
|
|
9645
9855
|
addEventListener(el, "change", () => {
|
|
9646
9856
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
9647
|
-
(set || el[assignKey])(el.multiple ?
|
|
9857
|
+
(set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
|
|
9648
9858
|
el._assigning = true;
|
|
9649
9859
|
nextTick(() => {
|
|
9650
9860
|
el._assigning = false;
|
|
@@ -9655,6 +9865,7 @@ const vModelSelectInit = (el, value, number, set) => {
|
|
|
9655
9865
|
* @internal
|
|
9656
9866
|
*/
|
|
9657
9867
|
const vModelSetSelected = (el, value) => {
|
|
9868
|
+
el._modelValue = value;
|
|
9658
9869
|
if (el._assigning) return;
|
|
9659
9870
|
const isMultiple = el.multiple;
|
|
9660
9871
|
const isArrayValue = isArray(value);
|