@vue/compat 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/README.md +2 -2
- package/dist/vue-compat.d.ts +29 -20
- package/dist/vue.cjs.js +489 -226
- package/dist/vue.cjs.prod.js +415 -178
- package/dist/vue.esm-browser.js +460 -218
- package/dist/vue.esm-browser.prod.js +6 -6
- package/dist/vue.esm-bundler.js +473 -222
- package/dist/vue.global.js +460 -218
- package/dist/vue.global.prod.js +6 -6
- package/dist/vue.runtime.esm-browser.js +460 -218
- package/dist/vue.runtime.esm-browser.prod.js +6 -6
- package/dist/vue.runtime.esm-bundler.js +473 -222
- package/dist/vue.runtime.global.js +460 -218
- package/dist/vue.runtime.global.prod.js +6 -6
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-
|
|
2
|
+
* @vue/compat v3.6.0-rc.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -521,6 +521,13 @@ function warn$2(msg, ...args) {
|
|
|
521
521
|
const notifyBuffer = [];
|
|
522
522
|
let batchDepth = 0;
|
|
523
523
|
let activeSub = void 0;
|
|
524
|
+
let runDepth = 0;
|
|
525
|
+
function incRunDepth() {
|
|
526
|
+
++runDepth;
|
|
527
|
+
}
|
|
528
|
+
function decRunDepth() {
|
|
529
|
+
--runDepth;
|
|
530
|
+
}
|
|
524
531
|
let globalVersion = 0;
|
|
525
532
|
let notifyIndex = 0;
|
|
526
533
|
let notifyBufferLength = 0;
|
|
@@ -594,8 +601,10 @@ function propagate(link) {
|
|
|
594
601
|
const sub = link.sub;
|
|
595
602
|
let flags = sub.flags;
|
|
596
603
|
if (flags & 3) {
|
|
597
|
-
if (!(flags & 60))
|
|
598
|
-
|
|
604
|
+
if (!(flags & 60)) {
|
|
605
|
+
sub.flags = flags | 32;
|
|
606
|
+
if (runDepth) sub.flags |= 8;
|
|
607
|
+
} else if (!(flags & 12)) flags = 0;
|
|
599
608
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
600
609
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
601
610
|
sub.flags = flags | 40;
|
|
@@ -664,13 +673,13 @@ function checkDirty(link, sub) {
|
|
|
664
673
|
let dirty = false;
|
|
665
674
|
if (sub.flags & 16) dirty = true;
|
|
666
675
|
else if ((depFlags & 17) === 17) {
|
|
676
|
+
const subs = dep.subs;
|
|
667
677
|
if (dep.update()) {
|
|
668
|
-
const subs = dep.subs;
|
|
669
678
|
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
670
679
|
dirty = true;
|
|
671
680
|
}
|
|
672
681
|
} else if ((depFlags & 33) === 33) {
|
|
673
|
-
|
|
682
|
+
stack = {
|
|
674
683
|
value: link,
|
|
675
684
|
prev: stack
|
|
676
685
|
};
|
|
@@ -685,15 +694,12 @@ function checkDirty(link, sub) {
|
|
|
685
694
|
}
|
|
686
695
|
while (checkDepth) {
|
|
687
696
|
--checkDepth;
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
if (hasMultipleSubs) {
|
|
691
|
-
link = stack.value;
|
|
692
|
-
stack = stack.prev;
|
|
693
|
-
} else link = firstSub;
|
|
697
|
+
link = stack.value;
|
|
698
|
+
stack = stack.prev;
|
|
694
699
|
if (dirty) {
|
|
700
|
+
const subs = sub.subs;
|
|
695
701
|
if (sub.update()) {
|
|
696
|
-
if (
|
|
702
|
+
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
697
703
|
sub = link.sub;
|
|
698
704
|
continue;
|
|
699
705
|
}
|
|
@@ -705,7 +711,7 @@ function checkDirty(link, sub) {
|
|
|
705
711
|
}
|
|
706
712
|
dirty = false;
|
|
707
713
|
}
|
|
708
|
-
return dirty;
|
|
714
|
+
return dirty && !!sub.flags;
|
|
709
715
|
} while (true);
|
|
710
716
|
}
|
|
711
717
|
function shallowPropagate(link) {
|
|
@@ -1088,7 +1094,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1088
1094
|
}
|
|
1089
1095
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
1090
1096
|
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
1091
|
-
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
1097
|
+
if (target === /* @__PURE__ */ toRaw(receiver) && result) {
|
|
1092
1098
|
if (!hadKey) trigger(target, "add", key, value);
|
|
1093
1099
|
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
1094
1100
|
}
|
|
@@ -1306,9 +1312,6 @@ function targetTypeMap(rawType) {
|
|
|
1306
1312
|
default: return 0;
|
|
1307
1313
|
}
|
|
1308
1314
|
}
|
|
1309
|
-
function getTargetType(value) {
|
|
1310
|
-
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1311
|
-
}
|
|
1312
1315
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1313
1316
|
function reactive(target) {
|
|
1314
1317
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
@@ -1421,10 +1424,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1421
1424
|
return target;
|
|
1422
1425
|
}
|
|
1423
1426
|
if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
|
|
1424
|
-
|
|
1425
|
-
if (targetType === 0) return target;
|
|
1427
|
+
if (target["__v_skip"] || !Object.isExtensible(target)) return target;
|
|
1426
1428
|
const existingProxy = proxyMap.get(target);
|
|
1427
1429
|
if (existingProxy) return existingProxy;
|
|
1430
|
+
const targetType = targetTypeMap(toRawType(target));
|
|
1431
|
+
if (targetType === 0) return target;
|
|
1428
1432
|
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
1429
1433
|
proxyMap.set(target, proxy);
|
|
1430
1434
|
return proxy;
|
|
@@ -1857,9 +1861,11 @@ var ReactiveEffect = class {
|
|
|
1857
1861
|
if (!this.active) return this.fn();
|
|
1858
1862
|
cleanup(this);
|
|
1859
1863
|
const prevSub = startTracking(this);
|
|
1864
|
+
incRunDepth();
|
|
1860
1865
|
try {
|
|
1861
1866
|
return this.fn();
|
|
1862
1867
|
} finally {
|
|
1868
|
+
decRunDepth();
|
|
1863
1869
|
endTracking(this, prevSub);
|
|
1864
1870
|
const flags = this.flags;
|
|
1865
1871
|
if ((flags & 136) === 136) {
|
|
@@ -2240,8 +2246,9 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2240
2246
|
if (once && cb) {
|
|
2241
2247
|
const _cb = cb;
|
|
2242
2248
|
cb = (...args) => {
|
|
2243
|
-
_cb(...args);
|
|
2249
|
+
const res = _cb(...args);
|
|
2244
2250
|
this.stop();
|
|
2251
|
+
return res;
|
|
2245
2252
|
};
|
|
2246
2253
|
}
|
|
2247
2254
|
this.cb = cb;
|
|
@@ -2255,7 +2262,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2255
2262
|
if (!this.cb) return;
|
|
2256
2263
|
const { immediate, deep, call } = this.options;
|
|
2257
2264
|
if (initialRun && !immediate) return;
|
|
2258
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2265
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2259
2266
|
cleanup(this);
|
|
2260
2267
|
const currentWatcher = activeWatcher;
|
|
2261
2268
|
activeWatcher = this;
|
|
@@ -2562,8 +2569,8 @@ function findInsertionIndex(order, queue, start, end) {
|
|
|
2562
2569
|
/**
|
|
2563
2570
|
* @internal for runtime-vapor only
|
|
2564
2571
|
*/
|
|
2565
|
-
function queueJob(job, id, isPre = false) {
|
|
2566
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2572
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
2573
|
+
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)) {
|
|
2567
2574
|
jobsLength++;
|
|
2568
2575
|
queueFlush();
|
|
2569
2576
|
}
|
|
@@ -2672,6 +2679,7 @@ function flushJobs(seen) {
|
|
|
2672
2679
|
}
|
|
2673
2680
|
flushIndex = 0;
|
|
2674
2681
|
jobsLength = 0;
|
|
2682
|
+
jobs.length = 0;
|
|
2675
2683
|
flushPostFlushCbs(seen);
|
|
2676
2684
|
currentFlushPromise = null;
|
|
2677
2685
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -2729,6 +2737,14 @@ function createRecord(id, initialDef) {
|
|
|
2729
2737
|
function normalizeClassComponent(component) {
|
|
2730
2738
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2731
2739
|
}
|
|
2740
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
2741
|
+
let parent = instance.parent;
|
|
2742
|
+
while (parent) {
|
|
2743
|
+
if (dirtyInstances.has(parent)) return true;
|
|
2744
|
+
parent = parent.parent;
|
|
2745
|
+
}
|
|
2746
|
+
return false;
|
|
2747
|
+
}
|
|
2732
2748
|
function rerender(id, newRender) {
|
|
2733
2749
|
const record = map.get(id);
|
|
2734
2750
|
if (!record) return;
|
|
@@ -2760,42 +2776,69 @@ function reload(id, newComp) {
|
|
|
2760
2776
|
const isVapor = record.initialDef.__vapor;
|
|
2761
2777
|
updateComponentDef(record.initialDef, newComp);
|
|
2762
2778
|
const instances = [...record.instances];
|
|
2763
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2779
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2764
2780
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
const
|
|
2768
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2769
|
-
if (!dirtyInstances) {
|
|
2770
|
-
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2771
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2772
|
-
}
|
|
2773
|
-
dirtyInstances.add(instance);
|
|
2774
|
-
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2775
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
2776
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2777
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2778
|
-
if (instance.ceReload) {
|
|
2779
|
-
dirtyInstances.add(instance);
|
|
2780
|
-
instance.ceReload(newComp.styles);
|
|
2781
|
-
dirtyInstances.delete(instance);
|
|
2782
|
-
} else if (instance.parent) queueJob(() => {
|
|
2783
|
-
isHmrUpdating = true;
|
|
2781
|
+
const dirtyInstances = new Set(instances);
|
|
2782
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2783
|
+
for (const instance of instances) {
|
|
2784
2784
|
const parent = instance.parent;
|
|
2785
|
-
if (parent
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2785
|
+
if (parent) {
|
|
2786
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2787
|
+
rerenderedParents.add(parent);
|
|
2788
|
+
parent.hmrRerender();
|
|
2789
|
+
}
|
|
2790
|
+
} else instance.hmrReload(newComp);
|
|
2791
|
+
}
|
|
2792
|
+
} else {
|
|
2793
|
+
const parentUpdates = /* @__PURE__ */ new Map();
|
|
2794
|
+
const dirtyInstanceSet = new Set(instances);
|
|
2795
|
+
for (const instance of instances) {
|
|
2796
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2797
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2798
|
+
if (!dirtyInstances) {
|
|
2799
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2800
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2789
2801
|
}
|
|
2790
|
-
|
|
2791
|
-
|
|
2802
|
+
dirtyInstances.add(instance);
|
|
2803
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2804
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2805
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2806
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2807
|
+
if (instance.ceReload) {
|
|
2808
|
+
dirtyInstances.add(instance);
|
|
2809
|
+
instance.ceReload(newComp.styles);
|
|
2810
|
+
dirtyInstances.delete(instance);
|
|
2811
|
+
} else if (instance.parent) {
|
|
2812
|
+
const parent = instance.parent;
|
|
2813
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2814
|
+
let updates = parentUpdates.get(parent);
|
|
2815
|
+
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2816
|
+
updates.push([instance, dirtyInstances]);
|
|
2817
|
+
}
|
|
2818
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2819
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
2820
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2821
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2822
|
+
}
|
|
2823
|
+
parentUpdates.forEach((updates, parent) => {
|
|
2824
|
+
queueJob(() => {
|
|
2825
|
+
isHmrUpdating = true;
|
|
2826
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2827
|
+
else {
|
|
2828
|
+
const i = parent;
|
|
2829
|
+
if (!(i.effect.flags & 1024)) {
|
|
2830
|
+
i.renderCache = [];
|
|
2831
|
+
i.effect.run();
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
nextTick(() => {
|
|
2835
|
+
isHmrUpdating = false;
|
|
2836
|
+
});
|
|
2837
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
2838
|
+
dirtyInstances.delete(instance);
|
|
2839
|
+
});
|
|
2792
2840
|
});
|
|
2793
|
-
dirtyInstances.delete(instance);
|
|
2794
2841
|
});
|
|
2795
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
2796
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
2797
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2798
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2799
2842
|
}
|
|
2800
2843
|
queuePostFlushCb(() => {
|
|
2801
2844
|
hmrDirtyComponents.clear();
|
|
@@ -3262,10 +3305,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
3262
3305
|
const renderFnWithContext = (...args) => {
|
|
3263
3306
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
3264
3307
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
3308
|
+
const prevStackSize = blockStack.length;
|
|
3265
3309
|
let res;
|
|
3266
3310
|
try {
|
|
3267
3311
|
res = fn(...args);
|
|
3268
3312
|
} finally {
|
|
3313
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
3269
3314
|
setCurrentRenderingInstance(prevInstance);
|
|
3270
3315
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
3271
3316
|
}
|
|
@@ -3467,7 +3512,7 @@ function instanceWatch(source, value, options) {
|
|
|
3467
3512
|
}
|
|
3468
3513
|
const prev = setCurrentInstance(this);
|
|
3469
3514
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3470
|
-
|
|
3515
|
+
restoreCurrentInstance(prev);
|
|
3471
3516
|
return res;
|
|
3472
3517
|
}
|
|
3473
3518
|
function createPathGetter(ctx, path) {
|
|
@@ -3480,6 +3525,7 @@ function createPathGetter(ctx, path) {
|
|
|
3480
3525
|
}
|
|
3481
3526
|
//#endregion
|
|
3482
3527
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
3528
|
+
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
3483
3529
|
const TeleportEndKey = Symbol("_vte");
|
|
3484
3530
|
const isTeleport = (type) => type.__isTeleport;
|
|
3485
3531
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
@@ -3505,58 +3551,70 @@ const TeleportImpl = {
|
|
|
3505
3551
|
name: "Teleport",
|
|
3506
3552
|
__isTeleport: true,
|
|
3507
3553
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
3508
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
3554
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
3509
3555
|
const disabled = isTeleportDisabled(n2.props);
|
|
3510
|
-
let {
|
|
3556
|
+
let { dynamicChildren } = n2;
|
|
3511
3557
|
if (isHmrUpdating) {
|
|
3512
3558
|
optimized = false;
|
|
3513
3559
|
dynamicChildren = null;
|
|
3514
3560
|
}
|
|
3561
|
+
const mount = (vnode, container, anchor) => {
|
|
3562
|
+
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3563
|
+
};
|
|
3564
|
+
const mountToTarget = (vnode = n2) => {
|
|
3565
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3566
|
+
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
3567
|
+
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
|
|
3568
|
+
if (target) {
|
|
3569
|
+
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3570
|
+
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3571
|
+
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3572
|
+
if (!disabled) {
|
|
3573
|
+
mount(vnode, target, targetAnchor);
|
|
3574
|
+
updateCssVars(vnode, false);
|
|
3575
|
+
}
|
|
3576
|
+
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3577
|
+
};
|
|
3578
|
+
const queuePendingMount = (vnode) => {
|
|
3579
|
+
const mountJob = () => {
|
|
3580
|
+
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3581
|
+
pendingMounts.delete(vnode);
|
|
3582
|
+
if (isTeleportDisabled(vnode.props)) {
|
|
3583
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
3584
|
+
updateCssVars(vnode, true);
|
|
3585
|
+
}
|
|
3586
|
+
mountToTarget(vnode);
|
|
3587
|
+
};
|
|
3588
|
+
pendingMounts.set(vnode, mountJob);
|
|
3589
|
+
queuePostRenderEffect(mountJob, void 0, parentSuspense);
|
|
3590
|
+
};
|
|
3515
3591
|
if (n1 == null) {
|
|
3516
3592
|
const placeholder = n2.el = createComment("teleport start");
|
|
3517
3593
|
const mainAnchor = n2.anchor = createComment("teleport end");
|
|
3518
3594
|
insert(placeholder, container, anchor);
|
|
3519
3595
|
insert(mainAnchor, container, anchor);
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
3525
|
-
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
3526
|
-
if (target) {
|
|
3527
|
-
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3528
|
-
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3529
|
-
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3530
|
-
if (!disabled) {
|
|
3531
|
-
mount(target, targetAnchor);
|
|
3532
|
-
updateCssVars(n2, false);
|
|
3533
|
-
}
|
|
3534
|
-
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3535
|
-
};
|
|
3596
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3597
|
+
queuePendingMount(n2);
|
|
3598
|
+
return;
|
|
3599
|
+
}
|
|
3536
3600
|
if (disabled) {
|
|
3537
|
-
mount(container, mainAnchor);
|
|
3601
|
+
mount(n2, container, mainAnchor);
|
|
3538
3602
|
updateCssVars(n2, true);
|
|
3539
3603
|
}
|
|
3540
|
-
|
|
3541
|
-
n2.el.__isMounted = false;
|
|
3542
|
-
queuePostRenderEffect(() => {
|
|
3543
|
-
if (n2.el.__isMounted !== false) return;
|
|
3544
|
-
mountToTarget();
|
|
3545
|
-
delete n2.el.__isMounted;
|
|
3546
|
-
}, void 0, parentSuspense);
|
|
3547
|
-
} else mountToTarget();
|
|
3604
|
+
mountToTarget();
|
|
3548
3605
|
} else {
|
|
3549
3606
|
n2.el = n1.el;
|
|
3550
|
-
n2.targetStart = n1.targetStart;
|
|
3551
3607
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
3552
|
-
const
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
}, void 0, parentSuspense);
|
|
3608
|
+
const pendingMount = pendingMounts.get(n1);
|
|
3609
|
+
if (pendingMount) {
|
|
3610
|
+
pendingMount.flags |= 4;
|
|
3611
|
+
pendingMounts.delete(n1);
|
|
3612
|
+
queuePendingMount(n2);
|
|
3558
3613
|
return;
|
|
3559
3614
|
}
|
|
3615
|
+
n2.targetStart = n1.targetStart;
|
|
3616
|
+
const target = n2.target = n1.target;
|
|
3617
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3560
3618
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
3561
3619
|
const currentContainer = wasDisabled ? container : target;
|
|
3562
3620
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -3570,24 +3628,30 @@ const TeleportImpl = {
|
|
|
3570
3628
|
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
|
|
3571
3629
|
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
|
|
3572
3630
|
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
3573
|
-
const nextTarget =
|
|
3574
|
-
if (nextTarget)
|
|
3575
|
-
|
|
3631
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
3632
|
+
if (nextTarget) {
|
|
3633
|
+
n2.target = nextTarget;
|
|
3634
|
+
moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
3635
|
+
} else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
|
|
3576
3636
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
3577
3637
|
updateCssVars(n2, disabled);
|
|
3578
3638
|
}
|
|
3579
3639
|
},
|
|
3580
3640
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
3581
|
-
const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
|
|
3641
|
+
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
|
|
3642
|
+
const disabled = isTeleportDisabled(props);
|
|
3643
|
+
const shouldRemove = doRemove || !disabled;
|
|
3644
|
+
const pendingMount = pendingMounts.get(vnode);
|
|
3645
|
+
if (pendingMount) {
|
|
3646
|
+
pendingMount.flags |= 4;
|
|
3647
|
+
pendingMounts.delete(vnode);
|
|
3648
|
+
}
|
|
3582
3649
|
if (targetStart) hostRemove(targetStart);
|
|
3583
3650
|
if (targetAnchor) hostRemove(targetAnchor);
|
|
3584
3651
|
doRemove && hostRemove(anchor);
|
|
3585
|
-
if (shapeFlag & 16) {
|
|
3586
|
-
const
|
|
3587
|
-
|
|
3588
|
-
const child = children[i];
|
|
3589
|
-
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3590
|
-
}
|
|
3652
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
3653
|
+
const child = children[i];
|
|
3654
|
+
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3591
3655
|
}
|
|
3592
3656
|
},
|
|
3593
3657
|
move: moveTeleport,
|
|
@@ -3598,7 +3662,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
3598
3662
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
3599
3663
|
const isReorder = moveType === 2;
|
|
3600
3664
|
if (isReorder) insert(el, container, parentAnchor);
|
|
3601
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
3665
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
3602
3666
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
3603
3667
|
}
|
|
3604
3668
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -3723,8 +3787,8 @@ const BaseTransitionImpl = {
|
|
|
3723
3787
|
const state = useTransitionState();
|
|
3724
3788
|
return () => {
|
|
3725
3789
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
3726
|
-
|
|
3727
|
-
|
|
3790
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3791
|
+
if (!child) return;
|
|
3728
3792
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3729
3793
|
const { mode } = rawProps;
|
|
3730
3794
|
checkTransitionMode(mode);
|
|
@@ -3907,12 +3971,11 @@ function getInnerChild$1(vnode) {
|
|
|
3907
3971
|
}
|
|
3908
3972
|
}
|
|
3909
3973
|
function setTransitionHooks(vnode, hooks) {
|
|
3910
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
3911
|
-
else {
|
|
3974
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3912
3975
|
vnode.transition = hooks;
|
|
3913
|
-
setTransitionHooks(vnode.component
|
|
3914
|
-
|
|
3915
|
-
else if (vnode.shapeFlag & 128) {
|
|
3976
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
3977
|
+
else setTransitionHooks(vnode.component.subTree, hooks);
|
|
3978
|
+
} else if (vnode.shapeFlag & 128) {
|
|
3916
3979
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3917
3980
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3918
3981
|
} else vnode.transition = hooks;
|
|
@@ -4177,7 +4240,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4177
4240
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4178
4241
|
break;
|
|
4179
4242
|
case VaporSlot:
|
|
4180
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
|
|
4243
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
4181
4244
|
break;
|
|
4182
4245
|
default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
|
|
4183
4246
|
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -4187,16 +4250,31 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4187
4250
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
4188
4251
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
4189
4252
|
else nextNode = nextSibling(node);
|
|
4190
|
-
if (vnode.type.__vapor)
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
}
|
|
4198
|
-
|
|
4199
|
-
|
|
4253
|
+
if (vnode.type.__vapor) {
|
|
4254
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
|
|
4255
|
+
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
4256
|
+
if (vnode.dirs) {
|
|
4257
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
4258
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
4259
|
+
}
|
|
4260
|
+
}, () => {
|
|
4261
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
4262
|
+
});
|
|
4263
|
+
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
4264
|
+
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
4265
|
+
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
4266
|
+
} else {
|
|
4267
|
+
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
4268
|
+
const component = vnode.component;
|
|
4269
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
|
|
4270
|
+
let subTree;
|
|
4271
|
+
if (isFragmentStart) {
|
|
4272
|
+
subTree = createVNode(Fragment);
|
|
4273
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4274
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
4275
|
+
subTree.el = node;
|
|
4276
|
+
component.subTree = subTree;
|
|
4277
|
+
}
|
|
4200
4278
|
}
|
|
4201
4279
|
} else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
|
|
4202
4280
|
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
@@ -4208,7 +4286,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4208
4286
|
};
|
|
4209
4287
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
4210
4288
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4211
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4289
|
+
const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4212
4290
|
const forcePatch = type === "input" || type === "option";
|
|
4213
4291
|
{
|
|
4214
4292
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
@@ -4226,15 +4304,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4226
4304
|
}
|
|
4227
4305
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
4228
4306
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4229
|
-
|
|
4307
|
+
if (next && !isMismatchAllowed(el, 1)) {
|
|
4308
|
+
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
4309
|
+
logMismatchError();
|
|
4310
|
+
}
|
|
4230
4311
|
while (next) {
|
|
4231
|
-
if (!isMismatchAllowed(el, 1)) {
|
|
4232
|
-
if (!hasWarned) {
|
|
4233
|
-
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
4234
|
-
hasWarned = true;
|
|
4235
|
-
}
|
|
4236
|
-
logMismatchError();
|
|
4237
|
-
}
|
|
4238
4312
|
const cur = next;
|
|
4239
4313
|
next = next.nextSibling;
|
|
4240
4314
|
remove(cur);
|
|
@@ -4253,9 +4327,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4253
4327
|
}
|
|
4254
4328
|
if (props) {
|
|
4255
4329
|
const isCustomElement = el.tagName.includes("-");
|
|
4330
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
4256
4331
|
for (const key in props) {
|
|
4257
4332
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
4258
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)) patchProp(el, key, null, props[key],
|
|
4333
|
+
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);
|
|
4259
4334
|
}
|
|
4260
4335
|
}
|
|
4261
4336
|
let vnodeHooks;
|
|
@@ -4273,7 +4348,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4273
4348
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
4274
4349
|
const children = parentVNode.children;
|
|
4275
4350
|
const l = children.length;
|
|
4276
|
-
let
|
|
4351
|
+
let hasCheckedMismatch = false;
|
|
4277
4352
|
for (let i = 0; i < l; i++) {
|
|
4278
4353
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
4279
4354
|
const isText = vnode.type === Text;
|
|
@@ -4287,12 +4362,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4287
4362
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4288
4363
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
4289
4364
|
else {
|
|
4290
|
-
if (!
|
|
4291
|
-
|
|
4365
|
+
if (!hasCheckedMismatch) {
|
|
4366
|
+
hasCheckedMismatch = true;
|
|
4367
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
4292
4368
|
warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
|
|
4293
|
-
|
|
4369
|
+
logMismatchError();
|
|
4294
4370
|
}
|
|
4295
|
-
logMismatchError();
|
|
4296
4371
|
}
|
|
4297
4372
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
4298
4373
|
}
|
|
@@ -4312,7 +4387,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4312
4387
|
}
|
|
4313
4388
|
};
|
|
4314
4389
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
4315
|
-
if (!
|
|
4390
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
4316
4391
|
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);
|
|
4317
4392
|
logMismatchError();
|
|
4318
4393
|
}
|
|
@@ -4476,7 +4551,9 @@ const MismatchTypeString = {
|
|
|
4476
4551
|
};
|
|
4477
4552
|
function isMismatchAllowed(el, allowedType) {
|
|
4478
4553
|
if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
|
|
4479
|
-
|
|
4554
|
+
return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
|
|
4555
|
+
}
|
|
4556
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
4480
4557
|
if (allowedAttr == null) return false;
|
|
4481
4558
|
else if (allowedAttr === "") return true;
|
|
4482
4559
|
else {
|
|
@@ -4485,6 +4562,16 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
4485
4562
|
return list.includes(MismatchTypeString[allowedType]);
|
|
4486
4563
|
}
|
|
4487
4564
|
}
|
|
4565
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
4566
|
+
return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
4567
|
+
}
|
|
4568
|
+
function isMismatchAllowedByNode(node) {
|
|
4569
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
|
|
4570
|
+
}
|
|
4571
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
4572
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
4573
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
|
|
4574
|
+
}
|
|
4488
4575
|
//#endregion
|
|
4489
4576
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
4490
4577
|
let requestIdleCallback;
|
|
@@ -4603,11 +4690,16 @@ function defineAsyncComponent(source) {
|
|
|
4603
4690
|
onError(err);
|
|
4604
4691
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
4605
4692
|
});
|
|
4606
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
4693
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
4607
4694
|
load().then(() => {
|
|
4695
|
+
if (instance.isUnmounted) return;
|
|
4608
4696
|
loaded.value = true;
|
|
4609
4697
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
4610
4698
|
}).catch((err) => {
|
|
4699
|
+
if (instance.isUnmounted) {
|
|
4700
|
+
setPendingRequest(null);
|
|
4701
|
+
return;
|
|
4702
|
+
}
|
|
4611
4703
|
onError(err);
|
|
4612
4704
|
error.value = err;
|
|
4613
4705
|
});
|
|
@@ -4665,14 +4757,22 @@ function createAsyncComponentContext(source) {
|
|
|
4665
4757
|
setPendingRequest: (request) => pendingRequest = request
|
|
4666
4758
|
};
|
|
4667
4759
|
}
|
|
4668
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
4760
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
4669
4761
|
const loaded = /* @__PURE__ */ ref(false);
|
|
4670
4762
|
const error = /* @__PURE__ */ ref();
|
|
4671
4763
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4672
|
-
|
|
4764
|
+
let timeoutTimer;
|
|
4765
|
+
let delayTimer;
|
|
4766
|
+
if (instance) onUnmounted(() => {
|
|
4767
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4768
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4769
|
+
}, instance);
|
|
4770
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
4771
|
+
if (instance && instance.isUnmounted) return;
|
|
4673
4772
|
delayed.value = false;
|
|
4674
4773
|
}, delay);
|
|
4675
|
-
if (timeout != null) setTimeout(() => {
|
|
4774
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
4775
|
+
if (instance && instance.isUnmounted) return;
|
|
4676
4776
|
if (!loaded.value && !error.value) {
|
|
4677
4777
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
4678
4778
|
onError(err);
|
|
@@ -4690,6 +4790,7 @@ const useAsyncComponentState = (delay, timeout, onError) => {
|
|
|
4690
4790
|
* @internal
|
|
4691
4791
|
*/
|
|
4692
4792
|
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
4793
|
+
const wasConnected = el.isConnected;
|
|
4693
4794
|
let patched = false;
|
|
4694
4795
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4695
4796
|
const performHydrate = () => {
|
|
@@ -4700,6 +4801,7 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
4700
4801
|
}
|
|
4701
4802
|
return;
|
|
4702
4803
|
}
|
|
4804
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
4703
4805
|
hydrate();
|
|
4704
4806
|
};
|
|
4705
4807
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -4941,7 +5043,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4941
5043
|
try {
|
|
4942
5044
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
4943
5045
|
} finally {
|
|
4944
|
-
|
|
5046
|
+
restoreCurrentInstance(prev);
|
|
4945
5047
|
setActiveSub(prevSub);
|
|
4946
5048
|
}
|
|
4947
5049
|
});
|
|
@@ -5280,8 +5382,9 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5280
5382
|
* Compiler runtime helper for rendering `<slot/>`
|
|
5281
5383
|
* @private
|
|
5282
5384
|
*/
|
|
5283
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
5385
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
5284
5386
|
let slot = slots[name];
|
|
5387
|
+
if (fallback) fallback.__vdom = true;
|
|
5285
5388
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
5286
5389
|
if (vaporSlot) {
|
|
5287
5390
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -5289,25 +5392,35 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
5289
5392
|
slot: vaporSlot,
|
|
5290
5393
|
fallback
|
|
5291
5394
|
};
|
|
5395
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
5292
5396
|
return ret;
|
|
5293
5397
|
}
|
|
5294
5398
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
5295
|
-
const
|
|
5296
|
-
|
|
5297
|
-
|
|
5399
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
5400
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
5401
|
+
if (name !== "default") slotProps.name = name;
|
|
5402
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
5298
5403
|
}
|
|
5299
5404
|
if (slot && slot.length > 1) {
|
|
5300
5405
|
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.");
|
|
5301
5406
|
slot = () => [];
|
|
5302
5407
|
}
|
|
5303
5408
|
if (slot && slot._c) slot._d = false;
|
|
5409
|
+
const prevStackSize = blockStack.length;
|
|
5304
5410
|
openBlock();
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5411
|
+
let rendered;
|
|
5412
|
+
try {
|
|
5413
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
5414
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
5415
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
5416
|
+
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
5417
|
+
} catch (err) {
|
|
5418
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
5419
|
+
throw err;
|
|
5420
|
+
} finally {
|
|
5421
|
+
if (slot && slot._c) slot._d = true;
|
|
5422
|
+
}
|
|
5309
5423
|
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
5310
|
-
if (slot && slot._c) slot._d = true;
|
|
5311
5424
|
return rendered;
|
|
5312
5425
|
}
|
|
5313
5426
|
function ensureValidVNode(vnodes) {
|
|
@@ -5320,9 +5433,7 @@ function ensureValidVNode(vnodes) {
|
|
|
5320
5433
|
}
|
|
5321
5434
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
5322
5435
|
let vaporSlot;
|
|
5323
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
5324
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
5325
|
-
}
|
|
5436
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
5326
5437
|
}
|
|
5327
5438
|
//#endregion
|
|
5328
5439
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -5877,26 +5988,39 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
5877
5988
|
function withAsyncContext(getAwaitable) {
|
|
5878
5989
|
const ctx = getCurrentGenericInstance();
|
|
5879
5990
|
const inSSRSetup = isInSSRComponentSetup;
|
|
5991
|
+
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
5880
5992
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
5881
5993
|
let awaitable = getAwaitable();
|
|
5882
5994
|
setCurrentInstance(null, void 0);
|
|
5883
5995
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5884
5996
|
const restore = () => {
|
|
5997
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5885
5998
|
setCurrentInstance(ctx);
|
|
5886
5999
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
6000
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
6001
|
+
return () => {
|
|
6002
|
+
if (reset) reset();
|
|
6003
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
6004
|
+
};
|
|
5887
6005
|
};
|
|
5888
6006
|
const cleanup = () => {
|
|
5889
6007
|
setCurrentInstance(null, void 0);
|
|
5890
6008
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5891
6009
|
};
|
|
5892
6010
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
5893
|
-
restore();
|
|
5894
|
-
Promise.resolve().then(() => Promise.resolve().then(
|
|
6011
|
+
const reset = restore();
|
|
6012
|
+
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
6013
|
+
if (reset) reset();
|
|
6014
|
+
cleanup();
|
|
6015
|
+
}));
|
|
5895
6016
|
throw e;
|
|
5896
6017
|
});
|
|
5897
6018
|
return [awaitable, () => {
|
|
5898
|
-
restore();
|
|
5899
|
-
Promise.resolve().then(
|
|
6019
|
+
const reset = restore();
|
|
6020
|
+
Promise.resolve().then(() => {
|
|
6021
|
+
if (reset) reset();
|
|
6022
|
+
cleanup();
|
|
6023
|
+
});
|
|
5900
6024
|
}];
|
|
5901
6025
|
}
|
|
5902
6026
|
//#endregion
|
|
@@ -6214,7 +6338,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6214
6338
|
if (options.el) return vm.$mount(options.el);
|
|
6215
6339
|
else return vm;
|
|
6216
6340
|
}
|
|
6217
|
-
Vue.version = `2.6.14-compat:3.6.0-
|
|
6341
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.2`;
|
|
6218
6342
|
Vue.config = singletonApp.config;
|
|
6219
6343
|
Vue.use = (plugin, ...options) => {
|
|
6220
6344
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -6469,7 +6593,9 @@ function defineReactive(obj, key, val) {
|
|
|
6469
6593
|
else Object.keys(val).forEach((key) => {
|
|
6470
6594
|
try {
|
|
6471
6595
|
defineReactiveSimple(val, key, val[key]);
|
|
6472
|
-
} catch (e) {
|
|
6596
|
+
} catch (e) {
|
|
6597
|
+
warn$1(`Failed making property "${key}" reactive:`, e);
|
|
6598
|
+
}
|
|
6473
6599
|
});
|
|
6474
6600
|
}
|
|
6475
6601
|
const i = obj.$;
|
|
@@ -6714,12 +6840,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6714
6840
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
6715
6841
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
6716
6842
|
}
|
|
6717
|
-
|
|
6843
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
6844
|
+
if (!hasVModel) {
|
|
6718
6845
|
localValue = value;
|
|
6719
6846
|
trigger();
|
|
6720
6847
|
}
|
|
6721
6848
|
i.emit(`update:${name}`, emittedValue);
|
|
6722
|
-
if (hasChanged(value,
|
|
6849
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
6723
6850
|
prevSetValue = value;
|
|
6724
6851
|
prevEmittedValue = emittedValue;
|
|
6725
6852
|
}
|
|
@@ -6832,7 +6959,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
6832
6959
|
function isEmitListener(options, key) {
|
|
6833
6960
|
if (!options || !isOn(key)) return false;
|
|
6834
6961
|
if (key.startsWith(compatModelEventPrefix)) return true;
|
|
6835
|
-
key = key.slice(2)
|
|
6962
|
+
key = key.slice(2);
|
|
6963
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
6836
6964
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
6837
6965
|
}
|
|
6838
6966
|
//#endregion
|
|
@@ -7203,7 +7331,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
7203
7331
|
const prev = setCurrentInstance(instance);
|
|
7204
7332
|
const props = /* @__PURE__ */ toRaw(instance.props);
|
|
7205
7333
|
value = factory.call(isCompatEnabled$1("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null, props);
|
|
7206
|
-
|
|
7334
|
+
restoreCurrentInstance(prev);
|
|
7207
7335
|
return value;
|
|
7208
7336
|
}
|
|
7209
7337
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -7350,7 +7478,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
7350
7478
|
const receivedType = toRawType(value);
|
|
7351
7479
|
const expectedValue = styleValue(value, expectedType);
|
|
7352
7480
|
const receivedValue = styleValue(value, receivedType);
|
|
7353
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
7481
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
7354
7482
|
message += `, got ${receivedType} `;
|
|
7355
7483
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
7356
7484
|
return message;
|
|
@@ -7359,7 +7487,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
7359
7487
|
* dev only
|
|
7360
7488
|
*/
|
|
7361
7489
|
function styleValue(value, type) {
|
|
7362
|
-
if (
|
|
7490
|
+
if (isSymbol(value)) return value.toString();
|
|
7491
|
+
else if (type === "String") return `"${value}"`;
|
|
7363
7492
|
else if (type === "Number") return `${Number(value)}`;
|
|
7364
7493
|
else return `${value}`;
|
|
7365
7494
|
}
|
|
@@ -7376,8 +7505,11 @@ function isExplicable(type) {
|
|
|
7376
7505
|
/**
|
|
7377
7506
|
* dev only
|
|
7378
7507
|
*/
|
|
7379
|
-
function
|
|
7380
|
-
return args.
|
|
7508
|
+
function isCoercible(...args) {
|
|
7509
|
+
return args.every((elem) => {
|
|
7510
|
+
const value = elem.toLowerCase();
|
|
7511
|
+
return value !== "boolean" && value !== "symbol";
|
|
7512
|
+
});
|
|
7381
7513
|
}
|
|
7382
7514
|
//#endregion
|
|
7383
7515
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -7682,7 +7814,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7682
7814
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
7683
7815
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7684
7816
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
7685
|
-
if (isHmrUpdating) {
|
|
7817
|
+
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
7686
7818
|
patchFlag = 0;
|
|
7687
7819
|
optimized = false;
|
|
7688
7820
|
dynamicChildren = null;
|
|
@@ -7760,21 +7892,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7760
7892
|
};
|
|
7761
7893
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7762
7894
|
n2.slotScopeIds = slotScopeIds;
|
|
7763
|
-
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
7895
|
+
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
7764
7896
|
else {
|
|
7897
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
7765
7898
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
7766
7899
|
if (n2.dirs) {
|
|
7767
7900
|
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
7768
7901
|
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
7769
7902
|
}
|
|
7903
|
+
}, () => {
|
|
7904
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
7770
7905
|
});
|
|
7771
7906
|
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
7907
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
7908
|
+
if (vnodeMountedHook) {
|
|
7909
|
+
const scopedVNode = n2;
|
|
7910
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
7911
|
+
}
|
|
7772
7912
|
}
|
|
7773
7913
|
else {
|
|
7774
|
-
|
|
7914
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
7915
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
7775
7916
|
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7917
|
+
}, () => {
|
|
7918
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
7919
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
7776
7920
|
});
|
|
7777
|
-
|
|
7921
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
7922
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
7923
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
7924
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
7925
|
+
}, void 0, parentSuspense);
|
|
7778
7926
|
}
|
|
7779
7927
|
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
7780
7928
|
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
@@ -8097,7 +8245,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8097
8245
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
8098
8246
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
8099
8247
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
8100
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
8248
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
8101
8249
|
return;
|
|
8102
8250
|
}
|
|
8103
8251
|
if (shapeFlag & 6) {
|
|
@@ -8130,8 +8278,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8130
8278
|
else hostInsert(el, container, anchor);
|
|
8131
8279
|
};
|
|
8132
8280
|
const performLeave = () => {
|
|
8281
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
8133
8282
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
8134
|
-
|
|
8283
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
8284
|
+
else leave(el, () => {
|
|
8135
8285
|
remove();
|
|
8136
8286
|
afterLeave && afterLeave();
|
|
8137
8287
|
});
|
|
@@ -8151,7 +8301,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8151
8301
|
}
|
|
8152
8302
|
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8153
8303
|
if (shapeFlag & 256) {
|
|
8154
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
8304
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
8155
8305
|
else parentComponent.ctx.deactivate(vnode);
|
|
8156
8306
|
return;
|
|
8157
8307
|
}
|
|
@@ -8161,8 +8311,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8161
8311
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8162
8312
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
8163
8313
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
8164
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8165
|
-
if (
|
|
8314
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
8315
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
8316
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
8317
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8318
|
+
}, void 0, parentSuspense);
|
|
8166
8319
|
return;
|
|
8167
8320
|
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
8168
8321
|
else {
|
|
@@ -8175,7 +8328,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8175
8328
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
8176
8329
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
8177
8330
|
if (type === VaporSlot) {
|
|
8178
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8331
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
8179
8332
|
return;
|
|
8180
8333
|
}
|
|
8181
8334
|
if (doRemove) remove(vnode);
|
|
@@ -8224,7 +8377,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8224
8377
|
if (effect) {
|
|
8225
8378
|
effect.stop();
|
|
8226
8379
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8227
|
-
}
|
|
8380
|
+
} else if (doRemove && subTree && instance.vnode.el) remove(subTree);
|
|
8228
8381
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
8229
8382
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
8230
8383
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
@@ -8351,6 +8504,10 @@ function invalidateMount(hooks) {
|
|
|
8351
8504
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
8352
8505
|
}
|
|
8353
8506
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
8507
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
8508
|
+
insert();
|
|
8509
|
+
return;
|
|
8510
|
+
}
|
|
8354
8511
|
if (force || needTransition(parentSuspense, transition)) {
|
|
8355
8512
|
transition.beforeEnter(el);
|
|
8356
8513
|
insert();
|
|
@@ -8553,15 +8710,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8553
8710
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
8554
8711
|
else if (!resume) {
|
|
8555
8712
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
8713
|
+
let hasUpdatedAnchor = false;
|
|
8556
8714
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
8557
8715
|
if (pendingId === suspense.pendingId) {
|
|
8558
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
8716
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
8559
8717
|
queuePostFlushCb(effects);
|
|
8560
8718
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
8561
8719
|
}
|
|
8562
8720
|
};
|
|
8563
8721
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
8564
|
-
if (parentNode(activeBranch.el) === container)
|
|
8722
|
+
if (parentNode(activeBranch.el) === container) {
|
|
8723
|
+
anchor = next(activeBranch);
|
|
8724
|
+
hasUpdatedAnchor = true;
|
|
8725
|
+
}
|
|
8565
8726
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
8566
8727
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
8567
8728
|
}
|
|
@@ -8625,6 +8786,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8625
8786
|
handleError(err, instance, 0);
|
|
8626
8787
|
}).then((asyncSetupResult) => {
|
|
8627
8788
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
8789
|
+
setCurrentInstance(null, void 0);
|
|
8628
8790
|
instance.asyncResolved = true;
|
|
8629
8791
|
onResolve(asyncSetupResult);
|
|
8630
8792
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -8957,12 +9119,30 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
8957
9119
|
el: vnode.el,
|
|
8958
9120
|
anchor: vnode.anchor,
|
|
8959
9121
|
ctx: vnode.ctx,
|
|
8960
|
-
ce: vnode.ce
|
|
9122
|
+
ce: vnode.ce,
|
|
9123
|
+
vi: vnode.vi,
|
|
9124
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
9125
|
+
vb: vnode.vb
|
|
8961
9126
|
};
|
|
8962
9127
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
8963
9128
|
defineLegacyVNodeProperties(cloned);
|
|
8964
9129
|
return cloned;
|
|
8965
9130
|
}
|
|
9131
|
+
function cloneVaporSlotMeta(vnode) {
|
|
9132
|
+
const vaporSlot = vnode.vs;
|
|
9133
|
+
if (!vaporSlot) return vaporSlot;
|
|
9134
|
+
const cloned = {
|
|
9135
|
+
slot: vaporSlot.slot,
|
|
9136
|
+
fallback: vaporSlot.fallback,
|
|
9137
|
+
outletFallback: vaporSlot.outletFallback
|
|
9138
|
+
};
|
|
9139
|
+
if (vnode.el) {
|
|
9140
|
+
cloned.state = vaporSlot.state;
|
|
9141
|
+
cloned.ref = vaporSlot.ref;
|
|
9142
|
+
cloned.scope = vaporSlot.scope;
|
|
9143
|
+
}
|
|
9144
|
+
return cloned;
|
|
9145
|
+
}
|
|
8966
9146
|
/**
|
|
8967
9147
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
8968
9148
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -9025,6 +9205,10 @@ function normalizeChildren(vnode, children) {
|
|
|
9025
9205
|
}
|
|
9026
9206
|
}
|
|
9027
9207
|
else if (isFunction(children)) {
|
|
9208
|
+
if (shapeFlag & 65) {
|
|
9209
|
+
normalizeChildren(vnode, { default: children });
|
|
9210
|
+
return;
|
|
9211
|
+
}
|
|
9028
9212
|
children = {
|
|
9029
9213
|
default: children,
|
|
9030
9214
|
_ctx: currentRenderingInstance
|
|
@@ -9088,6 +9272,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
9088
9272
|
simpleSetCurrentInstance(instance);
|
|
9089
9273
|
}
|
|
9090
9274
|
};
|
|
9275
|
+
/**
|
|
9276
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
9277
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
9278
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
9279
|
+
* @internal
|
|
9280
|
+
*/
|
|
9281
|
+
const restoreCurrentInstance = (prev) => {
|
|
9282
|
+
setCurrentScope(prev[1]);
|
|
9283
|
+
simpleSetCurrentInstance(prev[0]);
|
|
9284
|
+
};
|
|
9091
9285
|
const internalOptions = [
|
|
9092
9286
|
"ce",
|
|
9093
9287
|
"type",
|
|
@@ -9239,7 +9433,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
9239
9433
|
const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
|
|
9240
9434
|
const isAsyncSetup = isPromise(setupResult);
|
|
9241
9435
|
setActiveSub(prevSub);
|
|
9242
|
-
|
|
9436
|
+
restoreCurrentInstance(prev);
|
|
9243
9437
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
9244
9438
|
if (isAsyncSetup) {
|
|
9245
9439
|
const unsetCurrentInstance = () => {
|
|
@@ -9312,7 +9506,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
9312
9506
|
applyOptions(instance);
|
|
9313
9507
|
} finally {
|
|
9314
9508
|
setActiveSub(prevSub);
|
|
9315
|
-
|
|
9509
|
+
restoreCurrentInstance(prevInstance);
|
|
9316
9510
|
}
|
|
9317
9511
|
}
|
|
9318
9512
|
if (!Component.render && instance.render === NOOP && !isSSR) if (!compile$1 && Component.template)
|
|
@@ -9622,7 +9816,7 @@ function isMemoSame(cached, memo) {
|
|
|
9622
9816
|
}
|
|
9623
9817
|
//#endregion
|
|
9624
9818
|
//#region packages/runtime-core/src/index.ts
|
|
9625
|
-
const version = "3.6.0-
|
|
9819
|
+
const version = "3.6.0-rc.2";
|
|
9626
9820
|
const warn = warn$1;
|
|
9627
9821
|
/**
|
|
9628
9822
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -10110,7 +10304,10 @@ function patchStyle(el, prev, next) {
|
|
|
10110
10304
|
}
|
|
10111
10305
|
for (const key in next) {
|
|
10112
10306
|
if (key === "display") hasControlledDisplay = true;
|
|
10113
|
-
|
|
10307
|
+
const value = next[key];
|
|
10308
|
+
if (value != null) {
|
|
10309
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
10310
|
+
} else setStyle(style, key, "");
|
|
10114
10311
|
}
|
|
10115
10312
|
} else if (isCssString) {
|
|
10116
10313
|
if (prev !== next) {
|
|
@@ -10158,6 +10355,14 @@ function autoPrefix(style, rawName) {
|
|
|
10158
10355
|
}
|
|
10159
10356
|
return rawName;
|
|
10160
10357
|
}
|
|
10358
|
+
/**
|
|
10359
|
+
* Browsers update textarea width/height directly during native resize.
|
|
10360
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
10361
|
+
* still follow normal vnode style patching.
|
|
10362
|
+
*/
|
|
10363
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
10364
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
|
|
10365
|
+
}
|
|
10161
10366
|
//#endregion
|
|
10162
10367
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
10163
10368
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
@@ -10241,7 +10446,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
10241
10446
|
const existingInvoker = invokers[rawName];
|
|
10242
10447
|
if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
|
|
10243
10448
|
else {
|
|
10244
|
-
const [name, options] =
|
|
10449
|
+
const [name, options] = parseEventName(rawName);
|
|
10245
10450
|
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
|
|
10246
10451
|
else if (existingInvoker) {
|
|
10247
10452
|
removeEventListener(el, name, existingInvoker, options);
|
|
@@ -10249,16 +10454,15 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
10249
10454
|
}
|
|
10250
10455
|
}
|
|
10251
10456
|
}
|
|
10252
|
-
const optionsModifierRE = /(
|
|
10253
|
-
|
|
10457
|
+
const optionsModifierRE = /(Once|Passive|Capture)$/;
|
|
10458
|
+
const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
|
|
10459
|
+
function parseEventName(name) {
|
|
10254
10460
|
let options;
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
options[m[0].toLowerCase()] = true;
|
|
10261
|
-
}
|
|
10461
|
+
let m;
|
|
10462
|
+
while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
|
|
10463
|
+
if (!options) options = {};
|
|
10464
|
+
name = name.slice(0, name.length - m[1].length);
|
|
10465
|
+
options[m[1].toLowerCase()] = true;
|
|
10262
10466
|
}
|
|
10263
10467
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
10264
10468
|
}
|
|
@@ -10269,7 +10473,21 @@ function createInvoker(initialValue, instance) {
|
|
|
10269
10473
|
const invoker = (e) => {
|
|
10270
10474
|
if (!e._vts) e._vts = Date.now();
|
|
10271
10475
|
else if (e._vts <= invoker.attached) return;
|
|
10272
|
-
|
|
10476
|
+
const value = invoker.value;
|
|
10477
|
+
if (isArray(value)) {
|
|
10478
|
+
const originalStop = e.stopImmediatePropagation;
|
|
10479
|
+
e.stopImmediatePropagation = () => {
|
|
10480
|
+
originalStop.call(e);
|
|
10481
|
+
e._stopped = true;
|
|
10482
|
+
};
|
|
10483
|
+
const handlers = value.slice();
|
|
10484
|
+
const args = [e];
|
|
10485
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
10486
|
+
if (e._stopped) break;
|
|
10487
|
+
const handler = handlers[i];
|
|
10488
|
+
if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
|
|
10489
|
+
}
|
|
10490
|
+
} else callWithAsyncErrorHandling(value, instance, 5, [e]);
|
|
10273
10491
|
};
|
|
10274
10492
|
invoker.value = initialValue;
|
|
10275
10493
|
invoker.attached = getNow();
|
|
@@ -10280,16 +10498,6 @@ function sanitizeEventValue(value, propName) {
|
|
|
10280
10498
|
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}.`);
|
|
10281
10499
|
return NOOP;
|
|
10282
10500
|
}
|
|
10283
|
-
function patchStopImmediatePropagation(e, value) {
|
|
10284
|
-
if (isArray(value)) {
|
|
10285
|
-
const originalStop = e.stopImmediatePropagation;
|
|
10286
|
-
e.stopImmediatePropagation = () => {
|
|
10287
|
-
originalStop.call(e);
|
|
10288
|
-
e._stopped = true;
|
|
10289
|
-
};
|
|
10290
|
-
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
10291
|
-
} else return value;
|
|
10292
|
-
}
|
|
10293
10501
|
//#endregion
|
|
10294
10502
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
10295
10503
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -10617,7 +10825,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10617
10825
|
replacementNodes.push(child);
|
|
10618
10826
|
}
|
|
10619
10827
|
parent.removeChild(o);
|
|
10620
|
-
slotReplacements.set(o,
|
|
10828
|
+
slotReplacements.set(o, {
|
|
10829
|
+
nodes: replacementNodes,
|
|
10830
|
+
usedFallback: !content
|
|
10831
|
+
});
|
|
10621
10832
|
}
|
|
10622
10833
|
this._updateSlotNodes(slotReplacements);
|
|
10623
10834
|
}
|
|
@@ -10807,7 +11018,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
|
|
|
10807
11018
|
prevChildren = [];
|
|
10808
11019
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
10809
11020
|
const child = children[i];
|
|
10810
|
-
if (child.el && child.el instanceof Element) {
|
|
11021
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
10811
11022
|
prevChildren.push(child);
|
|
10812
11023
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
10813
11024
|
positionMap.set(child, getPosition(child.el));
|
|
@@ -11031,7 +11242,8 @@ const vModelSelect = {
|
|
|
11031
11242
|
mounted(el, { value }) {
|
|
11032
11243
|
vModelSetSelected(el, value);
|
|
11033
11244
|
},
|
|
11034
|
-
beforeUpdate(el,
|
|
11245
|
+
beforeUpdate(el, { value }, vnode) {
|
|
11246
|
+
el._modelValue = value;
|
|
11035
11247
|
el[assignKey] = getModelAssigner(vnode);
|
|
11036
11248
|
},
|
|
11037
11249
|
updated(el, { value }) {
|
|
@@ -11042,10 +11254,10 @@ const vModelSelect = {
|
|
|
11042
11254
|
* @internal
|
|
11043
11255
|
*/
|
|
11044
11256
|
const vModelSelectInit = (el, value, number, set) => {
|
|
11045
|
-
|
|
11257
|
+
el._modelValue = value;
|
|
11046
11258
|
addEventListener(el, "change", () => {
|
|
11047
11259
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
11048
|
-
(set || el[assignKey])(el.multiple ?
|
|
11260
|
+
(set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
|
|
11049
11261
|
el._assigning = true;
|
|
11050
11262
|
nextTick(() => {
|
|
11051
11263
|
el._assigning = false;
|
|
@@ -11056,6 +11268,7 @@ const vModelSelectInit = (el, value, number, set) => {
|
|
|
11056
11268
|
* @internal
|
|
11057
11269
|
*/
|
|
11058
11270
|
const vModelSetSelected = (el, value) => {
|
|
11271
|
+
el._modelValue = value;
|
|
11059
11272
|
if (el._assigning) return;
|
|
11060
11273
|
const isMultiple = el.multiple;
|
|
11061
11274
|
const isArrayValue = isArray(value);
|
|
@@ -12721,6 +12934,7 @@ function getUnnormalizedProps(props, callPath = []) {
|
|
|
12721
12934
|
return [props, callPath];
|
|
12722
12935
|
}
|
|
12723
12936
|
function injectProp(node, prop, context) {
|
|
12937
|
+
if (node.type !== 13 && injectSlotKey(node, prop)) return;
|
|
12724
12938
|
let propsWithInjection;
|
|
12725
12939
|
/**
|
|
12726
12940
|
* 1. mergeProps(...)
|
|
@@ -12759,6 +12973,20 @@ function injectProp(node, prop, context) {
|
|
|
12759
12973
|
else if (parentCall) parentCall.arguments[0] = propsWithInjection;
|
|
12760
12974
|
else node.arguments[2] = propsWithInjection;
|
|
12761
12975
|
}
|
|
12976
|
+
function injectSlotKey(node, prop) {
|
|
12977
|
+
var _node$arguments, _node$arguments2, _node$arguments3;
|
|
12978
|
+
if (prop.key.type !== 4 || prop.key.content !== "key") return false;
|
|
12979
|
+
const props = node.arguments[2];
|
|
12980
|
+
if (props && !isString(props)) {
|
|
12981
|
+
const [unnormalizedProps] = getUnnormalizedProps(props);
|
|
12982
|
+
if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) return true;
|
|
12983
|
+
}
|
|
12984
|
+
(_node$arguments = node.arguments)[2] || (_node$arguments[2] = "{}");
|
|
12985
|
+
(_node$arguments2 = node.arguments)[3] || (_node$arguments2[3] = "undefined");
|
|
12986
|
+
(_node$arguments3 = node.arguments)[4] || (_node$arguments3[4] = "undefined");
|
|
12987
|
+
node.arguments[5] = prop.value;
|
|
12988
|
+
return true;
|
|
12989
|
+
}
|
|
12762
12990
|
function hasProp(prop, props) {
|
|
12763
12991
|
let result = false;
|
|
12764
12992
|
if (prop.key.type === 4) {
|
|
@@ -13028,7 +13256,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
13028
13256
|
}
|
|
13029
13257
|
},
|
|
13030
13258
|
oncdata(start, end) {
|
|
13031
|
-
if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
|
|
13259
|
+
if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
|
|
13032
13260
|
else emitError(1, start - 9);
|
|
13033
13261
|
},
|
|
13034
13262
|
onprocessinginstruction(start) {
|
|
@@ -13553,8 +13781,10 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
13553
13781
|
imports: [],
|
|
13554
13782
|
cached: [],
|
|
13555
13783
|
constantCache: /* @__PURE__ */ new WeakMap(),
|
|
13784
|
+
vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
|
|
13556
13785
|
temps: 0,
|
|
13557
13786
|
identifiers: Object.create(null),
|
|
13787
|
+
identifierScopes: Object.create(null),
|
|
13558
13788
|
scopes: {
|
|
13559
13789
|
vFor: 0,
|
|
13560
13790
|
vSlot: 0,
|
|
@@ -13605,8 +13835,12 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
13605
13835
|
context.parent.children.splice(removalIndex, 1);
|
|
13606
13836
|
},
|
|
13607
13837
|
onNodeRemoved: NOOP,
|
|
13608
|
-
addIdentifiers(exp) {},
|
|
13838
|
+
addIdentifiers(exp, type = "local") {},
|
|
13609
13839
|
removeIdentifiers(exp) {},
|
|
13840
|
+
isSlotScopeIdentifier(name) {
|
|
13841
|
+
const scopes = context.identifierScopes[name];
|
|
13842
|
+
return scopes ? scopes[scopes.length - 1] === "slot" : false;
|
|
13843
|
+
},
|
|
13610
13844
|
hoist(exp) {
|
|
13611
13845
|
if (isString(exp)) exp = createSimpleExpression(exp);
|
|
13612
13846
|
context.hoists.push(exp);
|
|
@@ -13960,6 +14194,7 @@ function genNode(node, context) {
|
|
|
13960
14194
|
case 24: break;
|
|
13961
14195
|
case 25: break;
|
|
13962
14196
|
case 26: break;
|
|
14197
|
+
/* v8 ignore start */
|
|
13963
14198
|
case 10: break;
|
|
13964
14199
|
default:
|
|
13965
14200
|
assert(false, `unhandled codegen node type: ${node.type}`);
|
|
@@ -14177,7 +14412,7 @@ const transformExpression = (node, context) => {
|
|
|
14177
14412
|
if (dir.type === 7 && dir.name !== "for") {
|
|
14178
14413
|
const exp = dir.exp;
|
|
14179
14414
|
const arg = dir.arg;
|
|
14180
|
-
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
14415
|
+
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
14181
14416
|
if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
|
|
14182
14417
|
}
|
|
14183
14418
|
}
|
|
@@ -14318,10 +14553,9 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
14318
14553
|
const isTemplate = isTemplateNode(node);
|
|
14319
14554
|
const memo = findDir(node, "memo");
|
|
14320
14555
|
const keyProp = findProp(node, `key`, false, true);
|
|
14321
|
-
|
|
14556
|
+
keyProp && keyProp.type;
|
|
14322
14557
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
14323
|
-
|
|
14324
|
-
const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
14558
|
+
const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
14325
14559
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
14326
14560
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
14327
14561
|
forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
|
|
@@ -15098,7 +15332,7 @@ function rewriteFilter(node, context) {
|
|
|
15098
15332
|
const child = node.children[i];
|
|
15099
15333
|
if (typeof child !== "object") continue;
|
|
15100
15334
|
if (child.type === 4) parseFilter(child, context);
|
|
15101
|
-
else if (child.type === 8) rewriteFilter(
|
|
15335
|
+
else if (child.type === 8) rewriteFilter(child, context);
|
|
15102
15336
|
else if (child.type === 5) rewriteFilter(child.content, context);
|
|
15103
15337
|
}
|
|
15104
15338
|
}
|
|
@@ -15457,6 +15691,14 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
15457
15691
|
const eventOptionModifiers = [];
|
|
15458
15692
|
for (let i = 0; i < modifiers.length; i++) {
|
|
15459
15693
|
const modifier = modifiers[i].content;
|
|
15694
|
+
if (modifier === "delegate") {
|
|
15695
|
+
if (context) {
|
|
15696
|
+
const error = /* @__PURE__ */ new SyntaxError(`.delegate modifier is only supported in Vapor components.`);
|
|
15697
|
+
error.loc = modifiers[i].loc;
|
|
15698
|
+
context.onWarn(error);
|
|
15699
|
+
}
|
|
15700
|
+
continue;
|
|
15701
|
+
}
|
|
15460
15702
|
if (modifier === "native" && context && checkCompatEnabled("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
|
|
15461
15703
|
else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
|
|
15462
15704
|
else {
|
|
@@ -15533,7 +15775,7 @@ function postTransformTransition(node, onError, hasMultipleChildren = defaultHas
|
|
|
15533
15775
|
source: ""
|
|
15534
15776
|
}));
|
|
15535
15777
|
const child = node.children[0];
|
|
15536
|
-
if (child.type === 1) {
|
|
15778
|
+
if (child.type === 1 && !findDir(child, "if")) {
|
|
15537
15779
|
for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
|
|
15538
15780
|
type: 6,
|
|
15539
15781
|
name: "persisted",
|