@vue/compat 3.6.0-beta.8 → 3.6.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/vue-compat.d.ts +32 -18
- package/dist/vue.cjs.js +505 -229
- package/dist/vue.cjs.prod.js +414 -178
- package/dist/vue.esm-browser.js +476 -221
- package/dist/vue.esm-browser.prod.js +6 -6
- package/dist/vue.esm-bundler.js +489 -225
- package/dist/vue.global.js +476 -221
- package/dist/vue.global.prod.js +6 -6
- package/dist/vue.runtime.esm-browser.js +476 -221
- package/dist/vue.runtime.esm-browser.prod.js +6 -6
- package/dist/vue.runtime.esm-bundler.js +489 -225
- package/dist/vue.runtime.global.js +476 -221
- package/dist/vue.runtime.global.prod.js +6 -6
- package/package.json +3 -3
package/dist/vue.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-
|
|
2
|
+
* @vue/compat v3.6.0-rc.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -566,6 +566,13 @@ function warn$2(msg, ...args) {
|
|
|
566
566
|
const notifyBuffer = [];
|
|
567
567
|
let batchDepth = 0;
|
|
568
568
|
let activeSub = void 0;
|
|
569
|
+
let runDepth = 0;
|
|
570
|
+
function incRunDepth() {
|
|
571
|
+
++runDepth;
|
|
572
|
+
}
|
|
573
|
+
function decRunDepth() {
|
|
574
|
+
--runDepth;
|
|
575
|
+
}
|
|
569
576
|
let globalVersion = 0;
|
|
570
577
|
let notifyIndex = 0;
|
|
571
578
|
let notifyBufferLength = 0;
|
|
@@ -639,8 +646,10 @@ function propagate(link) {
|
|
|
639
646
|
const sub = link.sub;
|
|
640
647
|
let flags = sub.flags;
|
|
641
648
|
if (flags & 3) {
|
|
642
|
-
if (!(flags & 60))
|
|
643
|
-
|
|
649
|
+
if (!(flags & 60)) {
|
|
650
|
+
sub.flags = flags | 32;
|
|
651
|
+
if (runDepth) sub.flags |= 8;
|
|
652
|
+
} else if (!(flags & 12)) flags = 0;
|
|
644
653
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
645
654
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
646
655
|
sub.flags = flags | 40;
|
|
@@ -709,13 +718,13 @@ function checkDirty(link, sub) {
|
|
|
709
718
|
let dirty = false;
|
|
710
719
|
if (sub.flags & 16) dirty = true;
|
|
711
720
|
else if ((depFlags & 17) === 17) {
|
|
721
|
+
const subs = dep.subs;
|
|
712
722
|
if (dep.update()) {
|
|
713
|
-
const subs = dep.subs;
|
|
714
723
|
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
715
724
|
dirty = true;
|
|
716
725
|
}
|
|
717
726
|
} else if ((depFlags & 33) === 33) {
|
|
718
|
-
|
|
727
|
+
stack = {
|
|
719
728
|
value: link,
|
|
720
729
|
prev: stack
|
|
721
730
|
};
|
|
@@ -730,15 +739,12 @@ function checkDirty(link, sub) {
|
|
|
730
739
|
}
|
|
731
740
|
while (checkDepth) {
|
|
732
741
|
--checkDepth;
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
if (hasMultipleSubs) {
|
|
736
|
-
link = stack.value;
|
|
737
|
-
stack = stack.prev;
|
|
738
|
-
} else link = firstSub;
|
|
742
|
+
link = stack.value;
|
|
743
|
+
stack = stack.prev;
|
|
739
744
|
if (dirty) {
|
|
745
|
+
const subs = sub.subs;
|
|
740
746
|
if (sub.update()) {
|
|
741
|
-
if (
|
|
747
|
+
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
742
748
|
sub = link.sub;
|
|
743
749
|
continue;
|
|
744
750
|
}
|
|
@@ -750,7 +756,7 @@ function checkDirty(link, sub) {
|
|
|
750
756
|
}
|
|
751
757
|
dirty = false;
|
|
752
758
|
}
|
|
753
|
-
return dirty;
|
|
759
|
+
return dirty && !!sub.flags;
|
|
754
760
|
} while (true);
|
|
755
761
|
}
|
|
756
762
|
function shallowPropagate(link) {
|
|
@@ -1133,7 +1139,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1133
1139
|
}
|
|
1134
1140
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
1135
1141
|
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
1136
|
-
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
1142
|
+
if (target === /* @__PURE__ */ toRaw(receiver) && result) {
|
|
1137
1143
|
if (!hadKey) trigger(target, "add", key, value);
|
|
1138
1144
|
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
1139
1145
|
}
|
|
@@ -1351,9 +1357,6 @@ function targetTypeMap(rawType) {
|
|
|
1351
1357
|
default: return 0;
|
|
1352
1358
|
}
|
|
1353
1359
|
}
|
|
1354
|
-
function getTargetType(value) {
|
|
1355
|
-
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1356
|
-
}
|
|
1357
1360
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1358
1361
|
function reactive(target) {
|
|
1359
1362
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
@@ -1466,10 +1469,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1466
1469
|
return target;
|
|
1467
1470
|
}
|
|
1468
1471
|
if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
|
|
1469
|
-
|
|
1470
|
-
if (targetType === 0) return target;
|
|
1472
|
+
if (target["__v_skip"] || !Object.isExtensible(target)) return target;
|
|
1471
1473
|
const existingProxy = proxyMap.get(target);
|
|
1472
1474
|
if (existingProxy) return existingProxy;
|
|
1475
|
+
const targetType = targetTypeMap(toRawType(target));
|
|
1476
|
+
if (targetType === 0) return target;
|
|
1473
1477
|
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
1474
1478
|
proxyMap.set(target, proxy);
|
|
1475
1479
|
return proxy;
|
|
@@ -1817,16 +1821,16 @@ function toRefs(object) {
|
|
|
1817
1821
|
return ret;
|
|
1818
1822
|
}
|
|
1819
1823
|
var ObjectRefImpl = class {
|
|
1820
|
-
constructor(_object,
|
|
1824
|
+
constructor(_object, key, _defaultValue) {
|
|
1821
1825
|
this._object = _object;
|
|
1822
|
-
this._key = _key;
|
|
1823
1826
|
this._defaultValue = _defaultValue;
|
|
1824
1827
|
this["__v_isRef"] = true;
|
|
1825
1828
|
this._value = void 0;
|
|
1829
|
+
this._key = isSymbol(key) ? key : String(key);
|
|
1826
1830
|
this._raw = /* @__PURE__ */ toRaw(_object);
|
|
1827
1831
|
let shallow = true;
|
|
1828
1832
|
let obj = _object;
|
|
1829
|
-
if (!isArray(_object) || !isIntegerKey(
|
|
1833
|
+
if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) do
|
|
1830
1834
|
shallow = !/* @__PURE__ */ isProxy(obj) || /* @__PURE__ */ isShallow(obj);
|
|
1831
1835
|
while (shallow && (obj = obj["__v_raw"]));
|
|
1832
1836
|
this._shallow = shallow;
|
|
@@ -1902,9 +1906,11 @@ var ReactiveEffect = class {
|
|
|
1902
1906
|
if (!this.active) return this.fn();
|
|
1903
1907
|
cleanup(this);
|
|
1904
1908
|
const prevSub = startTracking(this);
|
|
1909
|
+
incRunDepth();
|
|
1905
1910
|
try {
|
|
1906
1911
|
return this.fn();
|
|
1907
1912
|
} finally {
|
|
1913
|
+
decRunDepth();
|
|
1908
1914
|
endTracking(this, prevSub);
|
|
1909
1915
|
const flags = this.flags;
|
|
1910
1916
|
if ((flags & 136) === 136) {
|
|
@@ -2285,8 +2291,9 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2285
2291
|
if (once && cb) {
|
|
2286
2292
|
const _cb = cb;
|
|
2287
2293
|
cb = (...args) => {
|
|
2288
|
-
_cb(...args);
|
|
2294
|
+
const res = _cb(...args);
|
|
2289
2295
|
this.stop();
|
|
2296
|
+
return res;
|
|
2290
2297
|
};
|
|
2291
2298
|
}
|
|
2292
2299
|
this.cb = cb;
|
|
@@ -2300,7 +2307,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2300
2307
|
if (!this.cb) return;
|
|
2301
2308
|
const { immediate, deep, call } = this.options;
|
|
2302
2309
|
if (initialRun && !immediate) return;
|
|
2303
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2310
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2304
2311
|
cleanup(this);
|
|
2305
2312
|
const currentWatcher = activeWatcher;
|
|
2306
2313
|
activeWatcher = this;
|
|
@@ -2607,8 +2614,8 @@ function findInsertionIndex(order, queue, start, end) {
|
|
|
2607
2614
|
/**
|
|
2608
2615
|
* @internal for runtime-vapor only
|
|
2609
2616
|
*/
|
|
2610
|
-
function queueJob(job, id, isPre = false) {
|
|
2611
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2617
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
2618
|
+
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)) {
|
|
2612
2619
|
jobsLength++;
|
|
2613
2620
|
queueFlush();
|
|
2614
2621
|
}
|
|
@@ -2717,6 +2724,7 @@ function flushJobs(seen) {
|
|
|
2717
2724
|
}
|
|
2718
2725
|
flushIndex = 0;
|
|
2719
2726
|
jobsLength = 0;
|
|
2727
|
+
jobs.length = 0;
|
|
2720
2728
|
flushPostFlushCbs(seen);
|
|
2721
2729
|
currentFlushPromise = null;
|
|
2722
2730
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -2736,6 +2744,13 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
2736
2744
|
//#endregion
|
|
2737
2745
|
//#region packages/runtime-core/src/hmr.ts
|
|
2738
2746
|
let isHmrUpdating = false;
|
|
2747
|
+
const setHmrUpdating = (v) => {
|
|
2748
|
+
try {
|
|
2749
|
+
return isHmrUpdating;
|
|
2750
|
+
} finally {
|
|
2751
|
+
isHmrUpdating = v;
|
|
2752
|
+
}
|
|
2753
|
+
};
|
|
2739
2754
|
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
2740
2755
|
const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
|
|
2741
2756
|
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
@@ -2767,6 +2782,14 @@ function createRecord(id, initialDef) {
|
|
|
2767
2782
|
function normalizeClassComponent(component) {
|
|
2768
2783
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2769
2784
|
}
|
|
2785
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
2786
|
+
let parent = instance.parent;
|
|
2787
|
+
while (parent) {
|
|
2788
|
+
if (dirtyInstances.has(parent)) return true;
|
|
2789
|
+
parent = parent.parent;
|
|
2790
|
+
}
|
|
2791
|
+
return false;
|
|
2792
|
+
}
|
|
2770
2793
|
function rerender(id, newRender) {
|
|
2771
2794
|
const record = map.get(id);
|
|
2772
2795
|
if (!record) return;
|
|
@@ -2798,42 +2821,69 @@ function reload(id, newComp) {
|
|
|
2798
2821
|
const isVapor = record.initialDef.__vapor;
|
|
2799
2822
|
updateComponentDef(record.initialDef, newComp);
|
|
2800
2823
|
const instances = [...record.instances];
|
|
2801
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2824
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2802
2825
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
const
|
|
2806
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2807
|
-
if (!dirtyInstances) {
|
|
2808
|
-
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2809
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2810
|
-
}
|
|
2811
|
-
dirtyInstances.add(instance);
|
|
2812
|
-
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2813
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
2814
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2815
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2816
|
-
if (instance.ceReload) {
|
|
2817
|
-
dirtyInstances.add(instance);
|
|
2818
|
-
instance.ceReload(newComp.styles);
|
|
2819
|
-
dirtyInstances.delete(instance);
|
|
2820
|
-
} else if (instance.parent) queueJob(() => {
|
|
2821
|
-
isHmrUpdating = true;
|
|
2826
|
+
const dirtyInstances = new Set(instances);
|
|
2827
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2828
|
+
for (const instance of instances) {
|
|
2822
2829
|
const parent = instance.parent;
|
|
2823
|
-
if (parent
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2830
|
+
if (parent) {
|
|
2831
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2832
|
+
rerenderedParents.add(parent);
|
|
2833
|
+
parent.hmrRerender();
|
|
2834
|
+
}
|
|
2835
|
+
} else instance.hmrReload(newComp);
|
|
2836
|
+
}
|
|
2837
|
+
} else {
|
|
2838
|
+
const parentUpdates = /* @__PURE__ */ new Map();
|
|
2839
|
+
const dirtyInstanceSet = new Set(instances);
|
|
2840
|
+
for (const instance of instances) {
|
|
2841
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2842
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2843
|
+
if (!dirtyInstances) {
|
|
2844
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2845
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2827
2846
|
}
|
|
2828
|
-
|
|
2829
|
-
|
|
2847
|
+
dirtyInstances.add(instance);
|
|
2848
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2849
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2850
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2851
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2852
|
+
if (instance.ceReload) {
|
|
2853
|
+
dirtyInstances.add(instance);
|
|
2854
|
+
instance.ceReload(newComp.styles);
|
|
2855
|
+
dirtyInstances.delete(instance);
|
|
2856
|
+
} else if (instance.parent) {
|
|
2857
|
+
const parent = instance.parent;
|
|
2858
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2859
|
+
let updates = parentUpdates.get(parent);
|
|
2860
|
+
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2861
|
+
updates.push([instance, dirtyInstances]);
|
|
2862
|
+
}
|
|
2863
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2864
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
2865
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2866
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2867
|
+
}
|
|
2868
|
+
parentUpdates.forEach((updates, parent) => {
|
|
2869
|
+
queueJob(() => {
|
|
2870
|
+
isHmrUpdating = true;
|
|
2871
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2872
|
+
else {
|
|
2873
|
+
const i = parent;
|
|
2874
|
+
if (!(i.effect.flags & 1024)) {
|
|
2875
|
+
i.renderCache = [];
|
|
2876
|
+
i.effect.run();
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2879
|
+
nextTick(() => {
|
|
2880
|
+
isHmrUpdating = false;
|
|
2881
|
+
});
|
|
2882
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
2883
|
+
dirtyInstances.delete(instance);
|
|
2884
|
+
});
|
|
2830
2885
|
});
|
|
2831
|
-
dirtyInstances.delete(instance);
|
|
2832
2886
|
});
|
|
2833
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
2834
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
2835
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2836
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2837
2887
|
}
|
|
2838
2888
|
queuePostFlushCb(() => {
|
|
2839
2889
|
hmrDirtyComponents.clear();
|
|
@@ -3300,10 +3350,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
3300
3350
|
const renderFnWithContext = (...args) => {
|
|
3301
3351
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
3302
3352
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
3353
|
+
const prevStackSize = blockStack.length;
|
|
3303
3354
|
let res;
|
|
3304
3355
|
try {
|
|
3305
3356
|
res = fn(...args);
|
|
3306
3357
|
} finally {
|
|
3358
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
3307
3359
|
setCurrentRenderingInstance(prevInstance);
|
|
3308
3360
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
3309
3361
|
}
|
|
@@ -3536,6 +3588,7 @@ function createPathGetter(ctx, path) {
|
|
|
3536
3588
|
}
|
|
3537
3589
|
//#endregion
|
|
3538
3590
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
3591
|
+
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
3539
3592
|
const TeleportEndKey = Symbol("_vte");
|
|
3540
3593
|
const isTeleport = (type) => type.__isTeleport;
|
|
3541
3594
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
@@ -3561,55 +3614,68 @@ const TeleportImpl = {
|
|
|
3561
3614
|
name: "Teleport",
|
|
3562
3615
|
__isTeleport: true,
|
|
3563
3616
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
3564
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
3617
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
3565
3618
|
const disabled = isTeleportDisabled(n2.props);
|
|
3566
|
-
let {
|
|
3619
|
+
let { dynamicChildren } = n2;
|
|
3567
3620
|
if (isHmrUpdating) {
|
|
3568
3621
|
optimized = false;
|
|
3569
3622
|
dynamicChildren = null;
|
|
3570
3623
|
}
|
|
3624
|
+
const mount = (vnode, container, anchor) => {
|
|
3625
|
+
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3626
|
+
};
|
|
3627
|
+
const mountToTarget = (vnode = n2) => {
|
|
3628
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3629
|
+
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
3630
|
+
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
|
|
3631
|
+
if (target) {
|
|
3632
|
+
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3633
|
+
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3634
|
+
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3635
|
+
if (!disabled) {
|
|
3636
|
+
mount(vnode, target, targetAnchor);
|
|
3637
|
+
updateCssVars(vnode, false);
|
|
3638
|
+
}
|
|
3639
|
+
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3640
|
+
};
|
|
3641
|
+
const queuePendingMount = (vnode) => {
|
|
3642
|
+
const mountJob = () => {
|
|
3643
|
+
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3644
|
+
pendingMounts.delete(vnode);
|
|
3645
|
+
if (isTeleportDisabled(vnode.props)) {
|
|
3646
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
3647
|
+
updateCssVars(vnode, true);
|
|
3648
|
+
}
|
|
3649
|
+
mountToTarget(vnode);
|
|
3650
|
+
};
|
|
3651
|
+
pendingMounts.set(vnode, mountJob);
|
|
3652
|
+
queuePostRenderEffect(mountJob, void 0, parentSuspense);
|
|
3653
|
+
};
|
|
3571
3654
|
if (n1 == null) {
|
|
3572
3655
|
const placeholder = n2.el = createComment("teleport start");
|
|
3573
3656
|
const mainAnchor = n2.anchor = createComment("teleport end");
|
|
3574
3657
|
insert(placeholder, container, anchor);
|
|
3575
3658
|
insert(mainAnchor, container, anchor);
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
3581
|
-
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
3582
|
-
if (target) {
|
|
3583
|
-
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3584
|
-
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3585
|
-
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3586
|
-
if (!disabled) {
|
|
3587
|
-
mount(target, targetAnchor);
|
|
3588
|
-
updateCssVars(n2, false);
|
|
3589
|
-
}
|
|
3590
|
-
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3591
|
-
};
|
|
3659
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3660
|
+
queuePendingMount(n2);
|
|
3661
|
+
return;
|
|
3662
|
+
}
|
|
3592
3663
|
if (disabled) {
|
|
3593
|
-
mount(container, mainAnchor);
|
|
3664
|
+
mount(n2, container, mainAnchor);
|
|
3594
3665
|
updateCssVars(n2, true);
|
|
3595
3666
|
}
|
|
3596
|
-
|
|
3597
|
-
n2.el.__isMounted = false;
|
|
3598
|
-
queuePostRenderEffect(() => {
|
|
3599
|
-
mountToTarget();
|
|
3600
|
-
delete n2.el.__isMounted;
|
|
3601
|
-
}, void 0, parentSuspense);
|
|
3602
|
-
} else mountToTarget();
|
|
3667
|
+
mountToTarget();
|
|
3603
3668
|
} else {
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3669
|
+
n2.el = n1.el;
|
|
3670
|
+
const mainAnchor = n2.anchor = n1.anchor;
|
|
3671
|
+
const pendingMount = pendingMounts.get(n1);
|
|
3672
|
+
if (pendingMount) {
|
|
3673
|
+
pendingMount.flags |= 4;
|
|
3674
|
+
pendingMounts.delete(n1);
|
|
3675
|
+
queuePendingMount(n2);
|
|
3608
3676
|
return;
|
|
3609
3677
|
}
|
|
3610
|
-
n2.el = n1.el;
|
|
3611
3678
|
n2.targetStart = n1.targetStart;
|
|
3612
|
-
const mainAnchor = n2.anchor = n1.anchor;
|
|
3613
3679
|
const target = n2.target = n1.target;
|
|
3614
3680
|
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3615
3681
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
@@ -3625,26 +3691,30 @@ const TeleportImpl = {
|
|
|
3625
3691
|
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
|
|
3626
3692
|
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
|
|
3627
3693
|
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
3628
|
-
const nextTarget =
|
|
3629
|
-
if (nextTarget)
|
|
3630
|
-
|
|
3694
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
3695
|
+
if (nextTarget) {
|
|
3696
|
+
n2.target = nextTarget;
|
|
3697
|
+
moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
3698
|
+
} else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
|
|
3631
3699
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
3632
3700
|
updateCssVars(n2, disabled);
|
|
3633
3701
|
}
|
|
3634
3702
|
},
|
|
3635
3703
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
3636
3704
|
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3705
|
+
const disabled = isTeleportDisabled(props);
|
|
3706
|
+
const shouldRemove = doRemove || !disabled;
|
|
3707
|
+
const pendingMount = pendingMounts.get(vnode);
|
|
3708
|
+
if (pendingMount) {
|
|
3709
|
+
pendingMount.flags |= 4;
|
|
3710
|
+
pendingMounts.delete(vnode);
|
|
3711
|
+
}
|
|
3712
|
+
if (targetStart) hostRemove(targetStart);
|
|
3713
|
+
if (targetAnchor) hostRemove(targetAnchor);
|
|
3641
3714
|
doRemove && hostRemove(anchor);
|
|
3642
|
-
if (shapeFlag & 16) {
|
|
3643
|
-
const
|
|
3644
|
-
|
|
3645
|
-
const child = children[i];
|
|
3646
|
-
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3647
|
-
}
|
|
3715
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
3716
|
+
const child = children[i];
|
|
3717
|
+
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3648
3718
|
}
|
|
3649
3719
|
},
|
|
3650
3720
|
move: moveTeleport,
|
|
@@ -3655,7 +3725,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
3655
3725
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
3656
3726
|
const isReorder = moveType === 2;
|
|
3657
3727
|
if (isReorder) insert(el, container, parentAnchor);
|
|
3658
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
3728
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
3659
3729
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
3660
3730
|
}
|
|
3661
3731
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -3780,8 +3850,8 @@ const BaseTransitionImpl = {
|
|
|
3780
3850
|
const state = useTransitionState();
|
|
3781
3851
|
return () => {
|
|
3782
3852
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
3783
|
-
|
|
3784
|
-
|
|
3853
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3854
|
+
if (!child) return;
|
|
3785
3855
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3786
3856
|
const { mode } = rawProps;
|
|
3787
3857
|
checkTransitionMode(mode);
|
|
@@ -3897,7 +3967,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3897
3967
|
callHook(hook, [el]);
|
|
3898
3968
|
},
|
|
3899
3969
|
enter(el) {
|
|
3900
|
-
if (isLeaving()) return;
|
|
3970
|
+
if (!isHmrUpdating && isLeaving()) return;
|
|
3901
3971
|
let hook = onEnter;
|
|
3902
3972
|
let afterHook = onAfterEnter;
|
|
3903
3973
|
let cancelHook = onEnterCancelled;
|
|
@@ -4234,7 +4304,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4234
4304
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4235
4305
|
break;
|
|
4236
4306
|
case VaporSlot:
|
|
4237
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
|
|
4307
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
4238
4308
|
break;
|
|
4239
4309
|
default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
|
|
4240
4310
|
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -4244,16 +4314,31 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4244
4314
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
4245
4315
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
4246
4316
|
else nextNode = nextSibling(node);
|
|
4247
|
-
if (vnode.type.__vapor)
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
}
|
|
4255
|
-
|
|
4256
|
-
|
|
4317
|
+
if (vnode.type.__vapor) {
|
|
4318
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
|
|
4319
|
+
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
4320
|
+
if (vnode.dirs) {
|
|
4321
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
4322
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
4323
|
+
}
|
|
4324
|
+
}, () => {
|
|
4325
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
4326
|
+
});
|
|
4327
|
+
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
4328
|
+
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
4329
|
+
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
4330
|
+
} else {
|
|
4331
|
+
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
4332
|
+
const component = vnode.component;
|
|
4333
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
|
|
4334
|
+
let subTree;
|
|
4335
|
+
if (isFragmentStart) {
|
|
4336
|
+
subTree = createVNode(Fragment);
|
|
4337
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4338
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
4339
|
+
subTree.el = node;
|
|
4340
|
+
component.subTree = subTree;
|
|
4341
|
+
}
|
|
4257
4342
|
}
|
|
4258
4343
|
} else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
|
|
4259
4344
|
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
@@ -4265,7 +4350,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4265
4350
|
};
|
|
4266
4351
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
4267
4352
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4268
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4353
|
+
const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4269
4354
|
const forcePatch = type === "input" || type === "option";
|
|
4270
4355
|
{
|
|
4271
4356
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
@@ -4283,15 +4368,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4283
4368
|
}
|
|
4284
4369
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
4285
4370
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4286
|
-
|
|
4371
|
+
if (next && !isMismatchAllowed(el, 1)) {
|
|
4372
|
+
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
4373
|
+
logMismatchError();
|
|
4374
|
+
}
|
|
4287
4375
|
while (next) {
|
|
4288
|
-
if (!isMismatchAllowed(el, 1)) {
|
|
4289
|
-
if (!hasWarned) {
|
|
4290
|
-
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
4291
|
-
hasWarned = true;
|
|
4292
|
-
}
|
|
4293
|
-
logMismatchError();
|
|
4294
|
-
}
|
|
4295
4376
|
const cur = next;
|
|
4296
4377
|
next = next.nextSibling;
|
|
4297
4378
|
remove(cur);
|
|
@@ -4310,9 +4391,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4310
4391
|
}
|
|
4311
4392
|
if (props) {
|
|
4312
4393
|
const isCustomElement = el.tagName.includes("-");
|
|
4394
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
4313
4395
|
for (const key in props) {
|
|
4314
4396
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
4315
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)) patchProp(el, key, null, props[key],
|
|
4397
|
+
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);
|
|
4316
4398
|
}
|
|
4317
4399
|
}
|
|
4318
4400
|
let vnodeHooks;
|
|
@@ -4330,7 +4412,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4330
4412
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
4331
4413
|
const children = parentVNode.children;
|
|
4332
4414
|
const l = children.length;
|
|
4333
|
-
let
|
|
4415
|
+
let hasCheckedMismatch = false;
|
|
4334
4416
|
for (let i = 0; i < l; i++) {
|
|
4335
4417
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
4336
4418
|
const isText = vnode.type === Text;
|
|
@@ -4344,12 +4426,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4344
4426
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4345
4427
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
4346
4428
|
else {
|
|
4347
|
-
if (!
|
|
4348
|
-
|
|
4429
|
+
if (!hasCheckedMismatch) {
|
|
4430
|
+
hasCheckedMismatch = true;
|
|
4431
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
4349
4432
|
warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
|
|
4350
|
-
|
|
4433
|
+
logMismatchError();
|
|
4351
4434
|
}
|
|
4352
|
-
logMismatchError();
|
|
4353
4435
|
}
|
|
4354
4436
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
4355
4437
|
}
|
|
@@ -4369,7 +4451,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4369
4451
|
}
|
|
4370
4452
|
};
|
|
4371
4453
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
4372
|
-
if (!
|
|
4454
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
4373
4455
|
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);
|
|
4374
4456
|
logMismatchError();
|
|
4375
4457
|
}
|
|
@@ -4533,7 +4615,9 @@ const MismatchTypeString = {
|
|
|
4533
4615
|
};
|
|
4534
4616
|
function isMismatchAllowed(el, allowedType) {
|
|
4535
4617
|
if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
|
|
4536
|
-
|
|
4618
|
+
return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
|
|
4619
|
+
}
|
|
4620
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
4537
4621
|
if (allowedAttr == null) return false;
|
|
4538
4622
|
else if (allowedAttr === "") return true;
|
|
4539
4623
|
else {
|
|
@@ -4542,6 +4626,16 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
4542
4626
|
return list.includes(MismatchTypeString[allowedType]);
|
|
4543
4627
|
}
|
|
4544
4628
|
}
|
|
4629
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
4630
|
+
return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
4631
|
+
}
|
|
4632
|
+
function isMismatchAllowedByNode(node) {
|
|
4633
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
|
|
4634
|
+
}
|
|
4635
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
4636
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
4637
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
|
|
4638
|
+
}
|
|
4545
4639
|
//#endregion
|
|
4546
4640
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
4547
4641
|
let requestIdleCallback;
|
|
@@ -4660,11 +4754,16 @@ function defineAsyncComponent(source) {
|
|
|
4660
4754
|
onError(err);
|
|
4661
4755
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
4662
4756
|
});
|
|
4663
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
4757
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
4664
4758
|
load().then(() => {
|
|
4759
|
+
if (instance.isUnmounted) return;
|
|
4665
4760
|
loaded.value = true;
|
|
4666
4761
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
4667
4762
|
}).catch((err) => {
|
|
4763
|
+
if (instance.isUnmounted) {
|
|
4764
|
+
setPendingRequest(null);
|
|
4765
|
+
return;
|
|
4766
|
+
}
|
|
4668
4767
|
onError(err);
|
|
4669
4768
|
error.value = err;
|
|
4670
4769
|
});
|
|
@@ -4722,14 +4821,22 @@ function createAsyncComponentContext(source) {
|
|
|
4722
4821
|
setPendingRequest: (request) => pendingRequest = request
|
|
4723
4822
|
};
|
|
4724
4823
|
}
|
|
4725
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
4824
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
4726
4825
|
const loaded = /* @__PURE__ */ ref(false);
|
|
4727
4826
|
const error = /* @__PURE__ */ ref();
|
|
4728
4827
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4729
|
-
|
|
4828
|
+
let timeoutTimer;
|
|
4829
|
+
let delayTimer;
|
|
4830
|
+
if (instance) onUnmounted(() => {
|
|
4831
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4832
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4833
|
+
}, instance);
|
|
4834
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
4835
|
+
if (instance && instance.isUnmounted) return;
|
|
4730
4836
|
delayed.value = false;
|
|
4731
4837
|
}, delay);
|
|
4732
|
-
if (timeout != null) setTimeout(() => {
|
|
4838
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
4839
|
+
if (instance && instance.isUnmounted) return;
|
|
4733
4840
|
if (!loaded.value && !error.value) {
|
|
4734
4841
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
4735
4842
|
onError(err);
|
|
@@ -4747,6 +4854,7 @@ const useAsyncComponentState = (delay, timeout, onError) => {
|
|
|
4747
4854
|
* @internal
|
|
4748
4855
|
*/
|
|
4749
4856
|
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
4857
|
+
const wasConnected = el.isConnected;
|
|
4750
4858
|
let patched = false;
|
|
4751
4859
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4752
4860
|
const performHydrate = () => {
|
|
@@ -4757,6 +4865,7 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
4757
4865
|
}
|
|
4758
4866
|
return;
|
|
4759
4867
|
}
|
|
4868
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
4760
4869
|
hydrate();
|
|
4761
4870
|
};
|
|
4762
4871
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -5341,8 +5450,9 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5341
5450
|
* Compiler runtime helper for rendering `<slot/>`
|
|
5342
5451
|
* @private
|
|
5343
5452
|
*/
|
|
5344
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
5453
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
5345
5454
|
let slot = slots[name];
|
|
5455
|
+
if (fallback) fallback.__vdom = true;
|
|
5346
5456
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
5347
5457
|
if (vaporSlot) {
|
|
5348
5458
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -5350,25 +5460,35 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
5350
5460
|
slot: vaporSlot,
|
|
5351
5461
|
fallback
|
|
5352
5462
|
};
|
|
5463
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
5353
5464
|
return ret;
|
|
5354
5465
|
}
|
|
5355
5466
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
5356
|
-
const
|
|
5357
|
-
|
|
5358
|
-
|
|
5467
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
5468
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
5469
|
+
if (name !== "default") slotProps.name = name;
|
|
5470
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
5359
5471
|
}
|
|
5360
5472
|
if (slot && slot.length > 1) {
|
|
5361
5473
|
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.");
|
|
5362
5474
|
slot = () => [];
|
|
5363
5475
|
}
|
|
5364
5476
|
if (slot && slot._c) slot._d = false;
|
|
5477
|
+
const prevStackSize = blockStack.length;
|
|
5365
5478
|
openBlock();
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5479
|
+
let rendered;
|
|
5480
|
+
try {
|
|
5481
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
5482
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
5483
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
5484
|
+
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
5485
|
+
} catch (err) {
|
|
5486
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
5487
|
+
throw err;
|
|
5488
|
+
} finally {
|
|
5489
|
+
if (slot && slot._c) slot._d = true;
|
|
5490
|
+
}
|
|
5370
5491
|
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
5371
|
-
if (slot && slot._c) slot._d = true;
|
|
5372
5492
|
return rendered;
|
|
5373
5493
|
}
|
|
5374
5494
|
function ensureValidVNode(vnodes) {
|
|
@@ -5381,9 +5501,7 @@ function ensureValidVNode(vnodes) {
|
|
|
5381
5501
|
}
|
|
5382
5502
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
5383
5503
|
let vaporSlot;
|
|
5384
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
5385
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
5386
|
-
}
|
|
5504
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
5387
5505
|
}
|
|
5388
5506
|
//#endregion
|
|
5389
5507
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -5938,26 +6056,39 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
5938
6056
|
function withAsyncContext(getAwaitable) {
|
|
5939
6057
|
const ctx = getCurrentGenericInstance();
|
|
5940
6058
|
const inSSRSetup = isInSSRComponentSetup;
|
|
6059
|
+
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
5941
6060
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
5942
6061
|
let awaitable = getAwaitable();
|
|
5943
6062
|
setCurrentInstance(null, void 0);
|
|
5944
6063
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5945
6064
|
const restore = () => {
|
|
6065
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5946
6066
|
setCurrentInstance(ctx);
|
|
5947
6067
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
6068
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
6069
|
+
return () => {
|
|
6070
|
+
if (reset) reset();
|
|
6071
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
6072
|
+
};
|
|
5948
6073
|
};
|
|
5949
6074
|
const cleanup = () => {
|
|
5950
6075
|
setCurrentInstance(null, void 0);
|
|
5951
6076
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5952
6077
|
};
|
|
5953
6078
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
5954
|
-
restore();
|
|
5955
|
-
Promise.resolve().then(() => Promise.resolve().then(
|
|
6079
|
+
const reset = restore();
|
|
6080
|
+
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
6081
|
+
if (reset) reset();
|
|
6082
|
+
cleanup();
|
|
6083
|
+
}));
|
|
5956
6084
|
throw e;
|
|
5957
6085
|
});
|
|
5958
6086
|
return [awaitable, () => {
|
|
5959
|
-
restore();
|
|
5960
|
-
Promise.resolve().then(
|
|
6087
|
+
const reset = restore();
|
|
6088
|
+
Promise.resolve().then(() => {
|
|
6089
|
+
if (reset) reset();
|
|
6090
|
+
cleanup();
|
|
6091
|
+
});
|
|
5961
6092
|
}];
|
|
5962
6093
|
}
|
|
5963
6094
|
//#endregion
|
|
@@ -6276,7 +6407,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6276
6407
|
if (options.el) return vm.$mount(options.el);
|
|
6277
6408
|
else return vm;
|
|
6278
6409
|
}
|
|
6279
|
-
Vue.version = `2.6.14-compat:3.6.0-
|
|
6410
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.1`;
|
|
6280
6411
|
Vue.config = singletonApp.config;
|
|
6281
6412
|
Vue.use = (plugin, ...options) => {
|
|
6282
6413
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -6531,7 +6662,9 @@ function defineReactive(obj, key, val) {
|
|
|
6531
6662
|
else Object.keys(val).forEach((key) => {
|
|
6532
6663
|
try {
|
|
6533
6664
|
defineReactiveSimple(val, key, val[key]);
|
|
6534
|
-
} catch (e) {
|
|
6665
|
+
} catch (e) {
|
|
6666
|
+
warn$1(`Failed making property "${key}" reactive:`, e);
|
|
6667
|
+
}
|
|
6535
6668
|
});
|
|
6536
6669
|
}
|
|
6537
6670
|
const i = obj.$;
|
|
@@ -6776,12 +6909,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6776
6909
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
6777
6910
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
6778
6911
|
}
|
|
6779
|
-
|
|
6912
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
6913
|
+
if (!hasVModel) {
|
|
6780
6914
|
localValue = value;
|
|
6781
6915
|
trigger();
|
|
6782
6916
|
}
|
|
6783
6917
|
i.emit(`update:${name}`, emittedValue);
|
|
6784
|
-
if (hasChanged(value,
|
|
6918
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
6785
6919
|
prevSetValue = value;
|
|
6786
6920
|
prevEmittedValue = emittedValue;
|
|
6787
6921
|
}
|
|
@@ -6894,7 +7028,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
6894
7028
|
function isEmitListener(options, key) {
|
|
6895
7029
|
if (!options || !isOn(key)) return false;
|
|
6896
7030
|
if (key.startsWith(compatModelEventPrefix)) return true;
|
|
6897
|
-
key = key.slice(2)
|
|
7031
|
+
key = key.slice(2);
|
|
7032
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
6898
7033
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
6899
7034
|
}
|
|
6900
7035
|
//#endregion
|
|
@@ -7088,15 +7223,19 @@ function hasPropValueChanged(nextProps, prevProps, key) {
|
|
|
7088
7223
|
if (key === "style" && isObject(nextProp) && isObject(prevProp)) return !looseEqual(nextProp, prevProp);
|
|
7089
7224
|
return nextProp !== prevProp;
|
|
7090
7225
|
}
|
|
7091
|
-
function updateHOCHostEl({ vnode, parent }, el) {
|
|
7226
|
+
function updateHOCHostEl({ vnode, parent, suspense }, el) {
|
|
7092
7227
|
while (parent && !parent.vapor) {
|
|
7093
7228
|
const root = parent.subTree;
|
|
7094
|
-
if (root.suspense && root.suspense.activeBranch === vnode)
|
|
7229
|
+
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
7230
|
+
root.suspense.vnode.el = root.el = el;
|
|
7231
|
+
vnode = root;
|
|
7232
|
+
}
|
|
7095
7233
|
if (root === vnode) {
|
|
7096
7234
|
(vnode = parent.vnode).el = el;
|
|
7097
7235
|
parent = parent.parent;
|
|
7098
7236
|
} else break;
|
|
7099
7237
|
}
|
|
7238
|
+
if (suspense && suspense.activeBranch === vnode) suspense.vnode.el = el;
|
|
7100
7239
|
}
|
|
7101
7240
|
//#endregion
|
|
7102
7241
|
//#region packages/runtime-core/src/compat/props.ts
|
|
@@ -7408,7 +7547,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
7408
7547
|
const receivedType = toRawType(value);
|
|
7409
7548
|
const expectedValue = styleValue(value, expectedType);
|
|
7410
7549
|
const receivedValue = styleValue(value, receivedType);
|
|
7411
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
7550
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
7412
7551
|
message += `, got ${receivedType} `;
|
|
7413
7552
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
7414
7553
|
return message;
|
|
@@ -7417,7 +7556,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
7417
7556
|
* dev only
|
|
7418
7557
|
*/
|
|
7419
7558
|
function styleValue(value, type) {
|
|
7420
|
-
if (
|
|
7559
|
+
if (isSymbol(value)) return value.toString();
|
|
7560
|
+
else if (type === "String") return `"${value}"`;
|
|
7421
7561
|
else if (type === "Number") return `${Number(value)}`;
|
|
7422
7562
|
else return `${value}`;
|
|
7423
7563
|
}
|
|
@@ -7434,8 +7574,11 @@ function isExplicable(type) {
|
|
|
7434
7574
|
/**
|
|
7435
7575
|
* dev only
|
|
7436
7576
|
*/
|
|
7437
|
-
function
|
|
7438
|
-
return args.
|
|
7577
|
+
function isCoercible(...args) {
|
|
7578
|
+
return args.every((elem) => {
|
|
7579
|
+
const value = elem.toLowerCase();
|
|
7580
|
+
return value !== "boolean" && value !== "symbol";
|
|
7581
|
+
});
|
|
7439
7582
|
}
|
|
7440
7583
|
//#endregion
|
|
7441
7584
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -7705,10 +7848,19 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7705
7848
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
7706
7849
|
if (transition) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
|
|
7707
7850
|
else hostInsert(el, container, anchor);
|
|
7708
|
-
if ((vnodeHook = props && props.onVnodeMounted) || dirs)
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7851
|
+
if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
|
|
7852
|
+
const isHmr = isHmrUpdating;
|
|
7853
|
+
queuePostRenderEffect(() => {
|
|
7854
|
+
let prev;
|
|
7855
|
+
prev = setHmrUpdating(isHmr);
|
|
7856
|
+
try {
|
|
7857
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
7858
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
7859
|
+
} finally {
|
|
7860
|
+
setHmrUpdating(prev);
|
|
7861
|
+
}
|
|
7862
|
+
}, void 0, parentSuspense);
|
|
7863
|
+
}
|
|
7712
7864
|
};
|
|
7713
7865
|
const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
|
|
7714
7866
|
if (scopeId) hostSetScopeId(el, scopeId);
|
|
@@ -7731,7 +7883,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7731
7883
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
7732
7884
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7733
7885
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
7734
|
-
if (isHmrUpdating) {
|
|
7886
|
+
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
7735
7887
|
patchFlag = 0;
|
|
7736
7888
|
optimized = false;
|
|
7737
7889
|
dynamicChildren = null;
|
|
@@ -7811,19 +7963,35 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7811
7963
|
n2.slotScopeIds = slotScopeIds;
|
|
7812
7964
|
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
7813
7965
|
else {
|
|
7966
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
7814
7967
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
7815
7968
|
if (n2.dirs) {
|
|
7816
7969
|
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
7817
7970
|
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
7818
7971
|
}
|
|
7972
|
+
}, () => {
|
|
7973
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
7819
7974
|
});
|
|
7820
7975
|
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
7976
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
7977
|
+
if (vnodeMountedHook) {
|
|
7978
|
+
const scopedVNode = n2;
|
|
7979
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
7980
|
+
}
|
|
7821
7981
|
}
|
|
7822
7982
|
else {
|
|
7823
|
-
|
|
7983
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
7984
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
7824
7985
|
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7986
|
+
}, () => {
|
|
7987
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
7988
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
7825
7989
|
});
|
|
7826
|
-
|
|
7990
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
7991
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
7992
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
7993
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
7994
|
+
}, void 0, parentSuspense);
|
|
7827
7995
|
}
|
|
7828
7996
|
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
7829
7997
|
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
@@ -8179,8 +8347,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8179
8347
|
else hostInsert(el, container, anchor);
|
|
8180
8348
|
};
|
|
8181
8349
|
const performLeave = () => {
|
|
8350
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
8182
8351
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
8183
|
-
|
|
8352
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
8353
|
+
else leave(el, () => {
|
|
8184
8354
|
remove();
|
|
8185
8355
|
afterLeave && afterLeave();
|
|
8186
8356
|
});
|
|
@@ -8191,7 +8361,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8191
8361
|
else hostInsert(el, container, anchor);
|
|
8192
8362
|
};
|
|
8193
8363
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
8194
|
-
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex } = vnode;
|
|
8364
|
+
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
8195
8365
|
if (patchFlag === -2) optimized = false;
|
|
8196
8366
|
if (ref != null) {
|
|
8197
8367
|
const prevSub = setActiveSub();
|
|
@@ -8211,7 +8381,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8211
8381
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
8212
8382
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
8213
8383
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8214
|
-
if (
|
|
8384
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
8385
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
8386
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8387
|
+
}, void 0, parentSuspense);
|
|
8215
8388
|
return;
|
|
8216
8389
|
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
8217
8390
|
else {
|
|
@@ -8229,9 +8402,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8229
8402
|
}
|
|
8230
8403
|
if (doRemove) remove(vnode);
|
|
8231
8404
|
}
|
|
8232
|
-
|
|
8405
|
+
const shouldInvalidateMemo = memo != null && cacheIndex == null;
|
|
8406
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) queuePostRenderEffect(() => {
|
|
8233
8407
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8234
8408
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
8409
|
+
if (shouldInvalidateMemo) vnode.el = null;
|
|
8235
8410
|
}, void 0, parentSuspense);
|
|
8236
8411
|
};
|
|
8237
8412
|
const remove = (vnode) => {
|
|
@@ -8271,7 +8446,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8271
8446
|
if (effect) {
|
|
8272
8447
|
effect.stop();
|
|
8273
8448
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8274
|
-
}
|
|
8449
|
+
} else if (doRemove && subTree && instance.vnode.el) remove(subTree);
|
|
8275
8450
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
8276
8451
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
8277
8452
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
@@ -8398,6 +8573,10 @@ function invalidateMount(hooks) {
|
|
|
8398
8573
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
8399
8574
|
}
|
|
8400
8575
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
8576
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
8577
|
+
insert();
|
|
8578
|
+
return;
|
|
8579
|
+
}
|
|
8401
8580
|
if (force || needTransition(parentSuspense, transition)) {
|
|
8402
8581
|
transition.beforeEnter(el);
|
|
8403
8582
|
insert();
|
|
@@ -8586,6 +8765,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8586
8765
|
pendingId: suspenseId++,
|
|
8587
8766
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
8588
8767
|
activeBranch: null,
|
|
8768
|
+
isFallbackMountPending: false,
|
|
8589
8769
|
pendingBranch: null,
|
|
8590
8770
|
isInFallback: !isHydrating,
|
|
8591
8771
|
isHydrating,
|
|
@@ -8599,20 +8779,25 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8599
8779
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
8600
8780
|
else if (!resume) {
|
|
8601
8781
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
8782
|
+
let hasUpdatedAnchor = false;
|
|
8602
8783
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
8603
8784
|
if (pendingId === suspense.pendingId) {
|
|
8604
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
8785
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
8605
8786
|
queuePostFlushCb(effects);
|
|
8606
8787
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
8607
8788
|
}
|
|
8608
8789
|
};
|
|
8609
|
-
if (activeBranch) {
|
|
8610
|
-
if (parentNode(activeBranch.el) === container)
|
|
8790
|
+
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
8791
|
+
if (parentNode(activeBranch.el) === container) {
|
|
8792
|
+
anchor = next(activeBranch);
|
|
8793
|
+
hasUpdatedAnchor = true;
|
|
8794
|
+
}
|
|
8611
8795
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
8612
8796
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
8613
8797
|
}
|
|
8614
8798
|
if (!delayEnter) move(pendingBranch, container, anchor, 0, parentComponent);
|
|
8615
8799
|
}
|
|
8800
|
+
suspense.isFallbackMountPending = false;
|
|
8616
8801
|
setActiveBranch(suspense, pendingBranch);
|
|
8617
8802
|
suspense.pendingBranch = null;
|
|
8618
8803
|
suspense.isInFallback = false;
|
|
@@ -8642,12 +8827,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8642
8827
|
triggerEvent(vnode, "onFallback");
|
|
8643
8828
|
const anchor = next(activeBranch);
|
|
8644
8829
|
const mountFallback = () => {
|
|
8830
|
+
suspense.isFallbackMountPending = false;
|
|
8645
8831
|
if (!suspense.isInFallback) return;
|
|
8646
8832
|
patch(null, fallbackVNode, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
8647
8833
|
setActiveBranch(suspense, fallbackVNode);
|
|
8648
8834
|
};
|
|
8649
8835
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
8650
|
-
if (delayEnter)
|
|
8836
|
+
if (delayEnter) {
|
|
8837
|
+
suspense.isFallbackMountPending = true;
|
|
8838
|
+
activeBranch.transition.afterLeave = mountFallback;
|
|
8839
|
+
}
|
|
8651
8840
|
suspense.isInFallback = true;
|
|
8652
8841
|
unmount(activeBranch, parentComponent, null, true);
|
|
8653
8842
|
if (!delayEnter) mountFallback();
|
|
@@ -8666,6 +8855,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8666
8855
|
handleError(err, instance, 0);
|
|
8667
8856
|
}).then((asyncSetupResult) => {
|
|
8668
8857
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
8858
|
+
setCurrentInstance(null, void 0);
|
|
8669
8859
|
instance.asyncResolved = true;
|
|
8670
8860
|
onResolve(asyncSetupResult);
|
|
8671
8861
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -8998,12 +9188,30 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
8998
9188
|
el: vnode.el,
|
|
8999
9189
|
anchor: vnode.anchor,
|
|
9000
9190
|
ctx: vnode.ctx,
|
|
9001
|
-
ce: vnode.ce
|
|
9191
|
+
ce: vnode.ce,
|
|
9192
|
+
vi: vnode.vi,
|
|
9193
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
9194
|
+
vb: vnode.vb
|
|
9002
9195
|
};
|
|
9003
9196
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
9004
9197
|
defineLegacyVNodeProperties(cloned);
|
|
9005
9198
|
return cloned;
|
|
9006
9199
|
}
|
|
9200
|
+
function cloneVaporSlotMeta(vnode) {
|
|
9201
|
+
const vaporSlot = vnode.vs;
|
|
9202
|
+
if (!vaporSlot) return vaporSlot;
|
|
9203
|
+
const cloned = {
|
|
9204
|
+
slot: vaporSlot.slot,
|
|
9205
|
+
fallback: vaporSlot.fallback,
|
|
9206
|
+
outletFallback: vaporSlot.outletFallback
|
|
9207
|
+
};
|
|
9208
|
+
if (vnode.el) {
|
|
9209
|
+
cloned.state = vaporSlot.state;
|
|
9210
|
+
cloned.ref = vaporSlot.ref;
|
|
9211
|
+
cloned.scope = vaporSlot.scope;
|
|
9212
|
+
}
|
|
9213
|
+
return cloned;
|
|
9214
|
+
}
|
|
9007
9215
|
/**
|
|
9008
9216
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
9009
9217
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -9066,6 +9274,10 @@ function normalizeChildren(vnode, children) {
|
|
|
9066
9274
|
}
|
|
9067
9275
|
}
|
|
9068
9276
|
else if (isFunction(children)) {
|
|
9277
|
+
if (shapeFlag & 65) {
|
|
9278
|
+
normalizeChildren(vnode, { default: children });
|
|
9279
|
+
return;
|
|
9280
|
+
}
|
|
9069
9281
|
children = {
|
|
9070
9282
|
default: children,
|
|
9071
9283
|
_ctx: currentRenderingInstance
|
|
@@ -9092,6 +9304,7 @@ function mergeProps(...args) {
|
|
|
9092
9304
|
const existing = ret[key];
|
|
9093
9305
|
const incoming = toMerge[key];
|
|
9094
9306
|
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
9307
|
+
else if (incoming == null && existing == null && !isModelListener(key)) ret[key] = incoming;
|
|
9095
9308
|
} else if (key !== "") ret[key] = toMerge[key];
|
|
9096
9309
|
}
|
|
9097
9310
|
return ret;
|
|
@@ -9672,7 +9885,7 @@ function isMemoSame(cached, memo) {
|
|
|
9672
9885
|
}
|
|
9673
9886
|
//#endregion
|
|
9674
9887
|
//#region packages/runtime-core/src/index.ts
|
|
9675
|
-
const version = "3.6.0-
|
|
9888
|
+
const version = "3.6.0-rc.1";
|
|
9676
9889
|
const warn = warn$1;
|
|
9677
9890
|
/**
|
|
9678
9891
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -10100,7 +10313,10 @@ function patchStyle(el, prev, next) {
|
|
|
10100
10313
|
}
|
|
10101
10314
|
for (const key in next) {
|
|
10102
10315
|
if (key === "display") hasControlledDisplay = true;
|
|
10103
|
-
|
|
10316
|
+
const value = next[key];
|
|
10317
|
+
if (value != null) {
|
|
10318
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
10319
|
+
} else setStyle(style, key, "");
|
|
10104
10320
|
}
|
|
10105
10321
|
} else if (isCssString) {
|
|
10106
10322
|
if (prev !== next) {
|
|
@@ -10148,6 +10364,14 @@ function autoPrefix(style, rawName) {
|
|
|
10148
10364
|
}
|
|
10149
10365
|
return rawName;
|
|
10150
10366
|
}
|
|
10367
|
+
/**
|
|
10368
|
+
* Browsers update textarea width/height directly during native resize.
|
|
10369
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
10370
|
+
* still follow normal vnode style patching.
|
|
10371
|
+
*/
|
|
10372
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
10373
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
|
|
10374
|
+
}
|
|
10151
10375
|
//#endregion
|
|
10152
10376
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
10153
10377
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
@@ -10231,7 +10455,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
10231
10455
|
const existingInvoker = invokers[rawName];
|
|
10232
10456
|
if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
|
|
10233
10457
|
else {
|
|
10234
|
-
const [name, options] =
|
|
10458
|
+
const [name, options] = parseEventName(rawName);
|
|
10235
10459
|
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
|
|
10236
10460
|
else if (existingInvoker) {
|
|
10237
10461
|
removeEventListener(el, name, existingInvoker, options);
|
|
@@ -10239,16 +10463,15 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
10239
10463
|
}
|
|
10240
10464
|
}
|
|
10241
10465
|
}
|
|
10242
|
-
const optionsModifierRE = /(
|
|
10243
|
-
|
|
10466
|
+
const optionsModifierRE = /(Once|Passive|Capture)$/;
|
|
10467
|
+
const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
|
|
10468
|
+
function parseEventName(name) {
|
|
10244
10469
|
let options;
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
options[m[0].toLowerCase()] = true;
|
|
10251
|
-
}
|
|
10470
|
+
let m;
|
|
10471
|
+
while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
|
|
10472
|
+
if (!options) options = {};
|
|
10473
|
+
name = name.slice(0, name.length - m[1].length);
|
|
10474
|
+
options[m[1].toLowerCase()] = true;
|
|
10252
10475
|
}
|
|
10253
10476
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
10254
10477
|
}
|
|
@@ -10259,7 +10482,21 @@ function createInvoker(initialValue, instance) {
|
|
|
10259
10482
|
const invoker = (e) => {
|
|
10260
10483
|
if (!e._vts) e._vts = Date.now();
|
|
10261
10484
|
else if (e._vts <= invoker.attached) return;
|
|
10262
|
-
|
|
10485
|
+
const value = invoker.value;
|
|
10486
|
+
if (isArray(value)) {
|
|
10487
|
+
const originalStop = e.stopImmediatePropagation;
|
|
10488
|
+
e.stopImmediatePropagation = () => {
|
|
10489
|
+
originalStop.call(e);
|
|
10490
|
+
e._stopped = true;
|
|
10491
|
+
};
|
|
10492
|
+
const handlers = value.slice();
|
|
10493
|
+
const args = [e];
|
|
10494
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
10495
|
+
if (e._stopped) break;
|
|
10496
|
+
const handler = handlers[i];
|
|
10497
|
+
if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
|
|
10498
|
+
}
|
|
10499
|
+
} else callWithAsyncErrorHandling(value, instance, 5, [e]);
|
|
10263
10500
|
};
|
|
10264
10501
|
invoker.value = initialValue;
|
|
10265
10502
|
invoker.attached = getNow();
|
|
@@ -10270,16 +10507,6 @@ function sanitizeEventValue(value, propName) {
|
|
|
10270
10507
|
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}.`);
|
|
10271
10508
|
return NOOP;
|
|
10272
10509
|
}
|
|
10273
|
-
function patchStopImmediatePropagation(e, value) {
|
|
10274
|
-
if (isArray(value)) {
|
|
10275
|
-
const originalStop = e.stopImmediatePropagation;
|
|
10276
|
-
e.stopImmediatePropagation = () => {
|
|
10277
|
-
originalStop.call(e);
|
|
10278
|
-
e._stopped = true;
|
|
10279
|
-
};
|
|
10280
|
-
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
10281
|
-
} else return value;
|
|
10282
|
-
}
|
|
10283
10510
|
//#endregion
|
|
10284
10511
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
10285
10512
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -10607,7 +10834,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10607
10834
|
replacementNodes.push(child);
|
|
10608
10835
|
}
|
|
10609
10836
|
parent.removeChild(o);
|
|
10610
|
-
slotReplacements.set(o,
|
|
10837
|
+
slotReplacements.set(o, {
|
|
10838
|
+
nodes: replacementNodes,
|
|
10839
|
+
usedFallback: !content
|
|
10840
|
+
});
|
|
10611
10841
|
}
|
|
10612
10842
|
this._updateSlotNodes(slotReplacements);
|
|
10613
10843
|
}
|
|
@@ -10797,7 +11027,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
|
|
|
10797
11027
|
prevChildren = [];
|
|
10798
11028
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
10799
11029
|
const child = children[i];
|
|
10800
|
-
if (child.el && child.el instanceof Element) {
|
|
11030
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
10801
11031
|
prevChildren.push(child);
|
|
10802
11032
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
10803
11033
|
positionMap.set(child, getPosition(child.el));
|
|
@@ -10938,7 +11168,8 @@ const vModelTextUpdate = (el, oldValue, value, trim, number, lazy) => {
|
|
|
10938
11168
|
const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
|
|
10939
11169
|
const newValue = value == null ? "" : value;
|
|
10940
11170
|
if (elValue === newValue) return;
|
|
10941
|
-
|
|
11171
|
+
const rootNode = el.getRootNode();
|
|
11172
|
+
if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
|
|
10942
11173
|
if (lazy && value === oldValue) return;
|
|
10943
11174
|
if (trim && el.value.trim() === newValue) return;
|
|
10944
11175
|
}
|
|
@@ -11020,7 +11251,8 @@ const vModelSelect = {
|
|
|
11020
11251
|
mounted(el, { value }) {
|
|
11021
11252
|
vModelSetSelected(el, value);
|
|
11022
11253
|
},
|
|
11023
|
-
beforeUpdate(el,
|
|
11254
|
+
beforeUpdate(el, { value }, vnode) {
|
|
11255
|
+
el._modelValue = value;
|
|
11024
11256
|
el[assignKey] = getModelAssigner(vnode);
|
|
11025
11257
|
},
|
|
11026
11258
|
updated(el, { value }) {
|
|
@@ -11031,10 +11263,10 @@ const vModelSelect = {
|
|
|
11031
11263
|
* @internal
|
|
11032
11264
|
*/
|
|
11033
11265
|
const vModelSelectInit = (el, value, number, set) => {
|
|
11034
|
-
|
|
11266
|
+
el._modelValue = value;
|
|
11035
11267
|
addEventListener(el, "change", () => {
|
|
11036
11268
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
11037
|
-
(set || el[assignKey])(el.multiple ?
|
|
11269
|
+
(set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
|
|
11038
11270
|
el._assigning = true;
|
|
11039
11271
|
nextTick(() => {
|
|
11040
11272
|
el._assigning = false;
|
|
@@ -11045,6 +11277,7 @@ const vModelSelectInit = (el, value, number, set) => {
|
|
|
11045
11277
|
* @internal
|
|
11046
11278
|
*/
|
|
11047
11279
|
const vModelSetSelected = (el, value) => {
|
|
11280
|
+
el._modelValue = value;
|
|
11048
11281
|
if (el._assigning) return;
|
|
11049
11282
|
const isMultiple = el.multiple;
|
|
11050
11283
|
const isArrayValue = isArray(value);
|
|
@@ -13434,6 +13667,7 @@ function getUnnormalizedProps(props, callPath = []) {
|
|
|
13434
13667
|
return [props, callPath];
|
|
13435
13668
|
}
|
|
13436
13669
|
function injectProp(node, prop, context) {
|
|
13670
|
+
if (node.type !== 13 && injectSlotKey(node, prop)) return;
|
|
13437
13671
|
let propsWithInjection;
|
|
13438
13672
|
/**
|
|
13439
13673
|
* 1. mergeProps(...)
|
|
@@ -13472,6 +13706,20 @@ function injectProp(node, prop, context) {
|
|
|
13472
13706
|
else if (parentCall) parentCall.arguments[0] = propsWithInjection;
|
|
13473
13707
|
else node.arguments[2] = propsWithInjection;
|
|
13474
13708
|
}
|
|
13709
|
+
function injectSlotKey(node, prop) {
|
|
13710
|
+
var _node$arguments, _node$arguments2, _node$arguments3;
|
|
13711
|
+
if (prop.key.type !== 4 || prop.key.content !== "key") return false;
|
|
13712
|
+
const props = node.arguments[2];
|
|
13713
|
+
if (props && !isString(props)) {
|
|
13714
|
+
const [unnormalizedProps] = getUnnormalizedProps(props);
|
|
13715
|
+
if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) return true;
|
|
13716
|
+
}
|
|
13717
|
+
(_node$arguments = node.arguments)[2] || (_node$arguments[2] = "{}");
|
|
13718
|
+
(_node$arguments2 = node.arguments)[3] || (_node$arguments2[3] = "undefined");
|
|
13719
|
+
(_node$arguments3 = node.arguments)[4] || (_node$arguments3[4] = "undefined");
|
|
13720
|
+
node.arguments[5] = prop.value;
|
|
13721
|
+
return true;
|
|
13722
|
+
}
|
|
13475
13723
|
function hasProp(prop, props) {
|
|
13476
13724
|
let result = false;
|
|
13477
13725
|
if (prop.key.type === 4) {
|
|
@@ -13768,7 +14016,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
13768
14016
|
}
|
|
13769
14017
|
},
|
|
13770
14018
|
oncdata(start, end) {
|
|
13771
|
-
if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
|
|
14019
|
+
if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
|
|
13772
14020
|
else emitError(1, start - 9);
|
|
13773
14021
|
},
|
|
13774
14022
|
onprocessinginstruction(start) {
|
|
@@ -14273,7 +14521,7 @@ function getSelfName(filename) {
|
|
|
14273
14521
|
const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
|
|
14274
14522
|
return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
|
|
14275
14523
|
}
|
|
14276
|
-
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
14524
|
+
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
14277
14525
|
const context = {
|
|
14278
14526
|
filename,
|
|
14279
14527
|
selfName: getSelfName(filename),
|
|
@@ -14295,6 +14543,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
14295
14543
|
bindingMetadata,
|
|
14296
14544
|
inline,
|
|
14297
14545
|
isTS,
|
|
14546
|
+
eventDelegation,
|
|
14298
14547
|
onError,
|
|
14299
14548
|
onWarn,
|
|
14300
14549
|
compatConfig,
|
|
@@ -14306,8 +14555,10 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
14306
14555
|
imports: [],
|
|
14307
14556
|
cached: [],
|
|
14308
14557
|
constantCache: /* @__PURE__ */ new WeakMap(),
|
|
14558
|
+
vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
|
|
14309
14559
|
temps: 0,
|
|
14310
14560
|
identifiers: Object.create(null),
|
|
14561
|
+
identifierScopes: Object.create(null),
|
|
14311
14562
|
scopes: {
|
|
14312
14563
|
vFor: 0,
|
|
14313
14564
|
vSlot: 0,
|
|
@@ -14358,16 +14609,20 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
14358
14609
|
context.parent.children.splice(removalIndex, 1);
|
|
14359
14610
|
},
|
|
14360
14611
|
onNodeRemoved: NOOP,
|
|
14361
|
-
addIdentifiers(exp) {
|
|
14362
|
-
if (isString(exp)) addId(exp);
|
|
14363
|
-
else if (exp.identifiers) exp.identifiers.forEach(addId);
|
|
14364
|
-
else if (exp.type === 4) addId(exp.content);
|
|
14612
|
+
addIdentifiers(exp, type = "local") {
|
|
14613
|
+
if (isString(exp)) addId(exp, type);
|
|
14614
|
+
else if (exp.identifiers) exp.identifiers.forEach((id) => addId(id, type));
|
|
14615
|
+
else if (exp.type === 4) addId(exp.content, type);
|
|
14365
14616
|
},
|
|
14366
14617
|
removeIdentifiers(exp) {
|
|
14367
14618
|
if (isString(exp)) removeId(exp);
|
|
14368
14619
|
else if (exp.identifiers) exp.identifiers.forEach(removeId);
|
|
14369
14620
|
else if (exp.type === 4) removeId(exp.content);
|
|
14370
14621
|
},
|
|
14622
|
+
isSlotScopeIdentifier(name) {
|
|
14623
|
+
const scopes = context.identifierScopes[name];
|
|
14624
|
+
return scopes ? scopes[scopes.length - 1] === "slot" : false;
|
|
14625
|
+
},
|
|
14371
14626
|
hoist(exp) {
|
|
14372
14627
|
if (isString(exp)) exp = createSimpleExpression(exp);
|
|
14373
14628
|
context.hoists.push(exp);
|
|
@@ -14382,13 +14637,16 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
14382
14637
|
}
|
|
14383
14638
|
};
|
|
14384
14639
|
context.filters = /* @__PURE__ */ new Set();
|
|
14385
|
-
function addId(id) {
|
|
14386
|
-
const { identifiers } = context;
|
|
14640
|
+
function addId(id, type) {
|
|
14641
|
+
const { identifiers, identifierScopes } = context;
|
|
14387
14642
|
if (identifiers[id] === void 0) identifiers[id] = 0;
|
|
14388
14643
|
identifiers[id]++;
|
|
14644
|
+
(identifierScopes[id] || (identifierScopes[id] = [])).push(type);
|
|
14389
14645
|
}
|
|
14390
14646
|
function removeId(id) {
|
|
14391
14647
|
context.identifiers[id]--;
|
|
14648
|
+
const scopes = context.identifierScopes[id];
|
|
14649
|
+
if (scopes) scopes.pop();
|
|
14392
14650
|
}
|
|
14393
14651
|
return context;
|
|
14394
14652
|
}
|
|
@@ -14815,6 +15073,7 @@ function genNode(node, context) {
|
|
|
14815
15073
|
case 26:
|
|
14816
15074
|
genReturnStatement(node, context);
|
|
14817
15075
|
break;
|
|
15076
|
+
/* v8 ignore start */
|
|
14818
15077
|
case 10: break;
|
|
14819
15078
|
default:
|
|
14820
15079
|
assert(false, `unhandled codegen node type: ${node.type}`);
|
|
@@ -15067,7 +15326,7 @@ const transformExpression = (node, context) => {
|
|
|
15067
15326
|
if (dir.type === 7 && dir.name !== "for") {
|
|
15068
15327
|
const exp = dir.exp;
|
|
15069
15328
|
const arg = dir.arg;
|
|
15070
|
-
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");
|
|
15329
|
+
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");
|
|
15071
15330
|
if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
|
|
15072
15331
|
}
|
|
15073
15332
|
}
|
|
@@ -15325,11 +15584,11 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
15325
15584
|
const keyProp = findProp(node, `key`, false, true);
|
|
15326
15585
|
const isDirKey = keyProp && keyProp.type === 7;
|
|
15327
15586
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
15328
|
-
|
|
15329
|
-
|
|
15330
|
-
if (isTemplate) {
|
|
15331
|
-
|
|
15332
|
-
if (
|
|
15587
|
+
const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
15588
|
+
if (isTemplate && memo) memo.exp = processExpression(memo.exp, context);
|
|
15589
|
+
if ((isTemplate || memo) && keyProperty && isDirKey) {
|
|
15590
|
+
keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
|
|
15591
|
+
if (memo) context.vForMemoKeyedNodes.add(node);
|
|
15333
15592
|
}
|
|
15334
15593
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
15335
15594
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
@@ -15374,7 +15633,7 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
15374
15633
|
`)`
|
|
15375
15634
|
]),
|
|
15376
15635
|
createCompoundExpression([
|
|
15377
|
-
`if (_cached`,
|
|
15636
|
+
`if (_cached && _cached.el`,
|
|
15378
15637
|
...keyExp ? [` && _cached.key === `, keyExp] : [],
|
|
15379
15638
|
` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
|
|
15380
15639
|
]),
|
|
@@ -15460,7 +15719,7 @@ const trackSlotScopes = (node, context) => {
|
|
|
15460
15719
|
const vSlot = findDir(node, "slot");
|
|
15461
15720
|
if (vSlot) {
|
|
15462
15721
|
const slotProps = vSlot.exp;
|
|
15463
|
-
if (context.prefixIdentifiers) slotProps && context.addIdentifiers(slotProps);
|
|
15722
|
+
if (context.prefixIdentifiers) slotProps && context.addIdentifiers(slotProps, "slot");
|
|
15464
15723
|
context.scopes.vSlot++;
|
|
15465
15724
|
return () => {
|
|
15466
15725
|
if (context.prefixIdentifiers) slotProps && context.removeIdentifiers(slotProps);
|
|
@@ -15681,6 +15940,15 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
15681
15940
|
if (!ssr) context.helper(builtIn);
|
|
15682
15941
|
return builtIn;
|
|
15683
15942
|
}
|
|
15943
|
+
{
|
|
15944
|
+
const fromScope = resolveSlotScopeReference(tag, context);
|
|
15945
|
+
if (fromScope) return fromScope;
|
|
15946
|
+
const dotIndex = tag.indexOf(".");
|
|
15947
|
+
if (dotIndex > 0) {
|
|
15948
|
+
const ns = resolveSlotScopeReference(tag.slice(0, dotIndex), context);
|
|
15949
|
+
if (ns) return ns + tag.slice(dotIndex);
|
|
15950
|
+
}
|
|
15951
|
+
}
|
|
15684
15952
|
{
|
|
15685
15953
|
const fromSetup = resolveSetupReference(tag, context);
|
|
15686
15954
|
if (fromSetup) return fromSetup;
|
|
@@ -15699,6 +15967,14 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
15699
15967
|
context.components.add(tag);
|
|
15700
15968
|
return toValidAssetId(tag, `component`);
|
|
15701
15969
|
}
|
|
15970
|
+
function resolveSlotScopeReference(name, context) {
|
|
15971
|
+
const camelName = camelize(name);
|
|
15972
|
+
const PascalName = capitalize(camelName);
|
|
15973
|
+
const isInSlotScope = (reference) => context.isSlotScopeIdentifier(reference);
|
|
15974
|
+
if (isInSlotScope(name)) return name;
|
|
15975
|
+
if (isInSlotScope(camelName)) return camelName;
|
|
15976
|
+
if (isInSlotScope(PascalName)) return PascalName;
|
|
15977
|
+
}
|
|
15702
15978
|
function resolveSetupReference(name, context) {
|
|
15703
15979
|
const bindings = context.bindingMetadata;
|
|
15704
15980
|
if (!bindings || bindings.__isScriptSetup === false) return;
|
|
@@ -16224,7 +16500,7 @@ function rewriteFilter(node, context) {
|
|
|
16224
16500
|
const child = node.children[i];
|
|
16225
16501
|
if (typeof child !== "object") continue;
|
|
16226
16502
|
if (child.type === 4) parseFilter(child, context);
|
|
16227
|
-
else if (child.type === 8) rewriteFilter(
|
|
16503
|
+
else if (child.type === 8) rewriteFilter(child, context);
|
|
16228
16504
|
else if (child.type === 5) rewriteFilter(child.content, context);
|
|
16229
16505
|
}
|
|
16230
16506
|
}
|
|
@@ -16648,7 +16924,7 @@ function postTransformTransition(node, onError, hasMultipleChildren = defaultHas
|
|
|
16648
16924
|
source: ""
|
|
16649
16925
|
}));
|
|
16650
16926
|
const child = node.children[0];
|
|
16651
|
-
if (child.type === 1) {
|
|
16927
|
+
if (child.type === 1 && !findDir(child, "if")) {
|
|
16652
16928
|
for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
|
|
16653
16929
|
type: 6,
|
|
16654
16930
|
name: "persisted",
|