@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
package/dist/vue.esm-bundler.js
CHANGED
|
@@ -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
|
**/
|
|
@@ -526,6 +526,13 @@ function warn$2(msg, ...args) {
|
|
|
526
526
|
const notifyBuffer = [];
|
|
527
527
|
let batchDepth = 0;
|
|
528
528
|
let activeSub = void 0;
|
|
529
|
+
let runDepth = 0;
|
|
530
|
+
function incRunDepth() {
|
|
531
|
+
++runDepth;
|
|
532
|
+
}
|
|
533
|
+
function decRunDepth() {
|
|
534
|
+
--runDepth;
|
|
535
|
+
}
|
|
529
536
|
let globalVersion = 0;
|
|
530
537
|
let notifyIndex = 0;
|
|
531
538
|
let notifyBufferLength = 0;
|
|
@@ -599,8 +606,10 @@ function propagate(link) {
|
|
|
599
606
|
const sub = link.sub;
|
|
600
607
|
let flags = sub.flags;
|
|
601
608
|
if (flags & 3) {
|
|
602
|
-
if (!(flags & 60))
|
|
603
|
-
|
|
609
|
+
if (!(flags & 60)) {
|
|
610
|
+
sub.flags = flags | 32;
|
|
611
|
+
if (runDepth) sub.flags |= 8;
|
|
612
|
+
} else if (!(flags & 12)) flags = 0;
|
|
604
613
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
605
614
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
606
615
|
sub.flags = flags | 40;
|
|
@@ -669,13 +678,13 @@ function checkDirty(link, sub) {
|
|
|
669
678
|
let dirty = false;
|
|
670
679
|
if (sub.flags & 16) dirty = true;
|
|
671
680
|
else if ((depFlags & 17) === 17) {
|
|
681
|
+
const subs = dep.subs;
|
|
672
682
|
if (dep.update()) {
|
|
673
|
-
const subs = dep.subs;
|
|
674
683
|
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
675
684
|
dirty = true;
|
|
676
685
|
}
|
|
677
686
|
} else if ((depFlags & 33) === 33) {
|
|
678
|
-
|
|
687
|
+
stack = {
|
|
679
688
|
value: link,
|
|
680
689
|
prev: stack
|
|
681
690
|
};
|
|
@@ -690,15 +699,12 @@ function checkDirty(link, sub) {
|
|
|
690
699
|
}
|
|
691
700
|
while (checkDepth) {
|
|
692
701
|
--checkDepth;
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
if (hasMultipleSubs) {
|
|
696
|
-
link = stack.value;
|
|
697
|
-
stack = stack.prev;
|
|
698
|
-
} else link = firstSub;
|
|
702
|
+
link = stack.value;
|
|
703
|
+
stack = stack.prev;
|
|
699
704
|
if (dirty) {
|
|
705
|
+
const subs = sub.subs;
|
|
700
706
|
if (sub.update()) {
|
|
701
|
-
if (
|
|
707
|
+
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
702
708
|
sub = link.sub;
|
|
703
709
|
continue;
|
|
704
710
|
}
|
|
@@ -710,7 +716,7 @@ function checkDirty(link, sub) {
|
|
|
710
716
|
}
|
|
711
717
|
dirty = false;
|
|
712
718
|
}
|
|
713
|
-
return dirty;
|
|
719
|
+
return dirty && !!sub.flags;
|
|
714
720
|
} while (true);
|
|
715
721
|
}
|
|
716
722
|
function shallowPropagate(link) {
|
|
@@ -1093,7 +1099,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1093
1099
|
}
|
|
1094
1100
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
1095
1101
|
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
1096
|
-
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
1102
|
+
if (target === /* @__PURE__ */ toRaw(receiver) && result) {
|
|
1097
1103
|
if (!hadKey) trigger(target, "add", key, value);
|
|
1098
1104
|
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
1099
1105
|
}
|
|
@@ -1311,9 +1317,6 @@ function targetTypeMap(rawType) {
|
|
|
1311
1317
|
default: return 0;
|
|
1312
1318
|
}
|
|
1313
1319
|
}
|
|
1314
|
-
function getTargetType(value) {
|
|
1315
|
-
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1316
|
-
}
|
|
1317
1320
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1318
1321
|
function reactive(target) {
|
|
1319
1322
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
@@ -1426,10 +1429,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1426
1429
|
return target;
|
|
1427
1430
|
}
|
|
1428
1431
|
if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
|
|
1429
|
-
|
|
1430
|
-
if (targetType === 0) return target;
|
|
1432
|
+
if (target["__v_skip"] || !Object.isExtensible(target)) return target;
|
|
1431
1433
|
const existingProxy = proxyMap.get(target);
|
|
1432
1434
|
if (existingProxy) return existingProxy;
|
|
1435
|
+
const targetType = targetTypeMap(toRawType(target));
|
|
1436
|
+
if (targetType === 0) return target;
|
|
1433
1437
|
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
1434
1438
|
proxyMap.set(target, proxy);
|
|
1435
1439
|
return proxy;
|
|
@@ -1862,9 +1866,11 @@ var ReactiveEffect = class {
|
|
|
1862
1866
|
if (!this.active) return this.fn();
|
|
1863
1867
|
cleanup(this);
|
|
1864
1868
|
const prevSub = startTracking(this);
|
|
1869
|
+
incRunDepth();
|
|
1865
1870
|
try {
|
|
1866
1871
|
return this.fn();
|
|
1867
1872
|
} finally {
|
|
1873
|
+
decRunDepth();
|
|
1868
1874
|
endTracking(this, prevSub);
|
|
1869
1875
|
const flags = this.flags;
|
|
1870
1876
|
if ((flags & 136) === 136) {
|
|
@@ -2245,8 +2251,9 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2245
2251
|
if (once && cb) {
|
|
2246
2252
|
const _cb = cb;
|
|
2247
2253
|
cb = (...args) => {
|
|
2248
|
-
_cb(...args);
|
|
2254
|
+
const res = _cb(...args);
|
|
2249
2255
|
this.stop();
|
|
2256
|
+
return res;
|
|
2250
2257
|
};
|
|
2251
2258
|
}
|
|
2252
2259
|
this.cb = cb;
|
|
@@ -2262,7 +2269,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2262
2269
|
if (!this.cb) return;
|
|
2263
2270
|
const { immediate, deep, call } = this.options;
|
|
2264
2271
|
if (initialRun && !immediate) return;
|
|
2265
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2272
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2266
2273
|
cleanup(this);
|
|
2267
2274
|
const currentWatcher = activeWatcher;
|
|
2268
2275
|
activeWatcher = this;
|
|
@@ -2579,8 +2586,8 @@ function findInsertionIndex(order, queue, start, end) {
|
|
|
2579
2586
|
/**
|
|
2580
2587
|
* @internal for runtime-vapor only
|
|
2581
2588
|
*/
|
|
2582
|
-
function queueJob(job, id, isPre = false) {
|
|
2583
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2589
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
2590
|
+
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)) {
|
|
2584
2591
|
jobsLength++;
|
|
2585
2592
|
queueFlush();
|
|
2586
2593
|
}
|
|
@@ -2689,6 +2696,7 @@ function flushJobs(seen) {
|
|
|
2689
2696
|
}
|
|
2690
2697
|
flushIndex = 0;
|
|
2691
2698
|
jobsLength = 0;
|
|
2699
|
+
jobs.length = 0;
|
|
2692
2700
|
flushPostFlushCbs(seen);
|
|
2693
2701
|
currentFlushPromise = null;
|
|
2694
2702
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -2746,6 +2754,14 @@ function createRecord(id, initialDef) {
|
|
|
2746
2754
|
function normalizeClassComponent(component) {
|
|
2747
2755
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2748
2756
|
}
|
|
2757
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
2758
|
+
let parent = instance.parent;
|
|
2759
|
+
while (parent) {
|
|
2760
|
+
if (dirtyInstances.has(parent)) return true;
|
|
2761
|
+
parent = parent.parent;
|
|
2762
|
+
}
|
|
2763
|
+
return false;
|
|
2764
|
+
}
|
|
2749
2765
|
function rerender(id, newRender) {
|
|
2750
2766
|
const record = map.get(id);
|
|
2751
2767
|
if (!record) return;
|
|
@@ -2777,42 +2793,69 @@ function reload(id, newComp) {
|
|
|
2777
2793
|
const isVapor = record.initialDef.__vapor;
|
|
2778
2794
|
updateComponentDef(record.initialDef, newComp);
|
|
2779
2795
|
const instances = [...record.instances];
|
|
2780
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2796
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2781
2797
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
const
|
|
2785
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2786
|
-
if (!dirtyInstances) {
|
|
2787
|
-
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2788
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2789
|
-
}
|
|
2790
|
-
dirtyInstances.add(instance);
|
|
2791
|
-
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2792
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
2793
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2794
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2795
|
-
if (instance.ceReload) {
|
|
2796
|
-
dirtyInstances.add(instance);
|
|
2797
|
-
instance.ceReload(newComp.styles);
|
|
2798
|
-
dirtyInstances.delete(instance);
|
|
2799
|
-
} else if (instance.parent) queueJob(() => {
|
|
2800
|
-
isHmrUpdating = true;
|
|
2798
|
+
const dirtyInstances = new Set(instances);
|
|
2799
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2800
|
+
for (const instance of instances) {
|
|
2801
2801
|
const parent = instance.parent;
|
|
2802
|
-
if (parent
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2802
|
+
if (parent) {
|
|
2803
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2804
|
+
rerenderedParents.add(parent);
|
|
2805
|
+
parent.hmrRerender();
|
|
2806
|
+
}
|
|
2807
|
+
} else instance.hmrReload(newComp);
|
|
2808
|
+
}
|
|
2809
|
+
} else {
|
|
2810
|
+
const parentUpdates = /* @__PURE__ */ new Map();
|
|
2811
|
+
const dirtyInstanceSet = new Set(instances);
|
|
2812
|
+
for (const instance of instances) {
|
|
2813
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2814
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2815
|
+
if (!dirtyInstances) {
|
|
2816
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2817
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2806
2818
|
}
|
|
2807
|
-
|
|
2808
|
-
|
|
2819
|
+
dirtyInstances.add(instance);
|
|
2820
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2821
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2822
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2823
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2824
|
+
if (instance.ceReload) {
|
|
2825
|
+
dirtyInstances.add(instance);
|
|
2826
|
+
instance.ceReload(newComp.styles);
|
|
2827
|
+
dirtyInstances.delete(instance);
|
|
2828
|
+
} else if (instance.parent) {
|
|
2829
|
+
const parent = instance.parent;
|
|
2830
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2831
|
+
let updates = parentUpdates.get(parent);
|
|
2832
|
+
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2833
|
+
updates.push([instance, dirtyInstances]);
|
|
2834
|
+
}
|
|
2835
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2836
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
2837
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2838
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2839
|
+
}
|
|
2840
|
+
parentUpdates.forEach((updates, parent) => {
|
|
2841
|
+
queueJob(() => {
|
|
2842
|
+
isHmrUpdating = true;
|
|
2843
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2844
|
+
else {
|
|
2845
|
+
const i = parent;
|
|
2846
|
+
if (!(i.effect.flags & 1024)) {
|
|
2847
|
+
i.renderCache = [];
|
|
2848
|
+
i.effect.run();
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
nextTick(() => {
|
|
2852
|
+
isHmrUpdating = false;
|
|
2853
|
+
});
|
|
2854
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
2855
|
+
dirtyInstances.delete(instance);
|
|
2856
|
+
});
|
|
2809
2857
|
});
|
|
2810
|
-
dirtyInstances.delete(instance);
|
|
2811
2858
|
});
|
|
2812
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
2813
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
2814
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2815
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2816
2859
|
}
|
|
2817
2860
|
queuePostFlushCb(() => {
|
|
2818
2861
|
hmrDirtyComponents.clear();
|
|
@@ -3280,10 +3323,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
3280
3323
|
const renderFnWithContext = (...args) => {
|
|
3281
3324
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
3282
3325
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
3326
|
+
const prevStackSize = blockStack.length;
|
|
3283
3327
|
let res;
|
|
3284
3328
|
try {
|
|
3285
3329
|
res = fn(...args);
|
|
3286
3330
|
} finally {
|
|
3331
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
3287
3332
|
setCurrentRenderingInstance(prevInstance);
|
|
3288
3333
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
3289
3334
|
}
|
|
@@ -3505,7 +3550,7 @@ function instanceWatch(source, value, options) {
|
|
|
3505
3550
|
}
|
|
3506
3551
|
const prev = setCurrentInstance(this);
|
|
3507
3552
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3508
|
-
|
|
3553
|
+
restoreCurrentInstance(prev);
|
|
3509
3554
|
return res;
|
|
3510
3555
|
}
|
|
3511
3556
|
function createPathGetter(ctx, path) {
|
|
@@ -3518,6 +3563,7 @@ function createPathGetter(ctx, path) {
|
|
|
3518
3563
|
}
|
|
3519
3564
|
//#endregion
|
|
3520
3565
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
3566
|
+
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
3521
3567
|
const TeleportEndKey = Symbol("_vte");
|
|
3522
3568
|
const isTeleport = (type) => type.__isTeleport;
|
|
3523
3569
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
@@ -3543,58 +3589,70 @@ const TeleportImpl = {
|
|
|
3543
3589
|
name: "Teleport",
|
|
3544
3590
|
__isTeleport: true,
|
|
3545
3591
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
3546
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
3592
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
3547
3593
|
const disabled = isTeleportDisabled(n2.props);
|
|
3548
|
-
let {
|
|
3594
|
+
let { dynamicChildren } = n2;
|
|
3549
3595
|
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
|
|
3550
3596
|
optimized = false;
|
|
3551
3597
|
dynamicChildren = null;
|
|
3552
3598
|
}
|
|
3599
|
+
const mount = (vnode, container, anchor) => {
|
|
3600
|
+
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3601
|
+
};
|
|
3602
|
+
const mountToTarget = (vnode = n2) => {
|
|
3603
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3604
|
+
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
3605
|
+
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
|
|
3606
|
+
if (target) {
|
|
3607
|
+
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3608
|
+
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3609
|
+
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3610
|
+
if (!disabled) {
|
|
3611
|
+
mount(vnode, target, targetAnchor);
|
|
3612
|
+
updateCssVars(vnode, false);
|
|
3613
|
+
}
|
|
3614
|
+
} else if (!!(process.env.NODE_ENV !== "production") && !disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3615
|
+
};
|
|
3616
|
+
const queuePendingMount = (vnode) => {
|
|
3617
|
+
const mountJob = () => {
|
|
3618
|
+
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3619
|
+
pendingMounts.delete(vnode);
|
|
3620
|
+
if (isTeleportDisabled(vnode.props)) {
|
|
3621
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
3622
|
+
updateCssVars(vnode, true);
|
|
3623
|
+
}
|
|
3624
|
+
mountToTarget(vnode);
|
|
3625
|
+
};
|
|
3626
|
+
pendingMounts.set(vnode, mountJob);
|
|
3627
|
+
queuePostRenderEffect(mountJob, void 0, parentSuspense);
|
|
3628
|
+
};
|
|
3553
3629
|
if (n1 == null) {
|
|
3554
3630
|
const placeholder = n2.el = !!(process.env.NODE_ENV !== "production") ? createComment("teleport start") : createText("");
|
|
3555
3631
|
const mainAnchor = n2.anchor = !!(process.env.NODE_ENV !== "production") ? createComment("teleport end") : createText("");
|
|
3556
3632
|
insert(placeholder, container, anchor);
|
|
3557
3633
|
insert(mainAnchor, container, anchor);
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
3563
|
-
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
3564
|
-
if (target) {
|
|
3565
|
-
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3566
|
-
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3567
|
-
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3568
|
-
if (!disabled) {
|
|
3569
|
-
mount(target, targetAnchor);
|
|
3570
|
-
updateCssVars(n2, false);
|
|
3571
|
-
}
|
|
3572
|
-
} else if (!!(process.env.NODE_ENV !== "production") && !disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3573
|
-
};
|
|
3634
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3635
|
+
queuePendingMount(n2);
|
|
3636
|
+
return;
|
|
3637
|
+
}
|
|
3574
3638
|
if (disabled) {
|
|
3575
|
-
mount(container, mainAnchor);
|
|
3639
|
+
mount(n2, container, mainAnchor);
|
|
3576
3640
|
updateCssVars(n2, true);
|
|
3577
3641
|
}
|
|
3578
|
-
|
|
3579
|
-
n2.el.__isMounted = false;
|
|
3580
|
-
queuePostRenderEffect(() => {
|
|
3581
|
-
if (n2.el.__isMounted !== false) return;
|
|
3582
|
-
mountToTarget();
|
|
3583
|
-
delete n2.el.__isMounted;
|
|
3584
|
-
}, void 0, parentSuspense);
|
|
3585
|
-
} else mountToTarget();
|
|
3642
|
+
mountToTarget();
|
|
3586
3643
|
} else {
|
|
3587
3644
|
n2.el = n1.el;
|
|
3588
|
-
n2.targetStart = n1.targetStart;
|
|
3589
3645
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
3590
|
-
const
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
}, void 0, parentSuspense);
|
|
3646
|
+
const pendingMount = pendingMounts.get(n1);
|
|
3647
|
+
if (pendingMount) {
|
|
3648
|
+
pendingMount.flags |= 4;
|
|
3649
|
+
pendingMounts.delete(n1);
|
|
3650
|
+
queuePendingMount(n2);
|
|
3596
3651
|
return;
|
|
3597
3652
|
}
|
|
3653
|
+
n2.targetStart = n1.targetStart;
|
|
3654
|
+
const target = n2.target = n1.target;
|
|
3655
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3598
3656
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
3599
3657
|
const currentContainer = wasDisabled ? container : target;
|
|
3600
3658
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -3608,24 +3666,30 @@ const TeleportImpl = {
|
|
|
3608
3666
|
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
|
|
3609
3667
|
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
|
|
3610
3668
|
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
3611
|
-
const nextTarget =
|
|
3612
|
-
if (nextTarget)
|
|
3613
|
-
|
|
3669
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
3670
|
+
if (nextTarget) {
|
|
3671
|
+
n2.target = nextTarget;
|
|
3672
|
+
moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
3673
|
+
} else if (!!(process.env.NODE_ENV !== "production")) warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
|
|
3614
3674
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
3615
3675
|
updateCssVars(n2, disabled);
|
|
3616
3676
|
}
|
|
3617
3677
|
},
|
|
3618
3678
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
3619
|
-
const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
|
|
3679
|
+
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
|
|
3680
|
+
const disabled = isTeleportDisabled(props);
|
|
3681
|
+
const shouldRemove = doRemove || !disabled;
|
|
3682
|
+
const pendingMount = pendingMounts.get(vnode);
|
|
3683
|
+
if (pendingMount) {
|
|
3684
|
+
pendingMount.flags |= 4;
|
|
3685
|
+
pendingMounts.delete(vnode);
|
|
3686
|
+
}
|
|
3620
3687
|
if (targetStart) hostRemove(targetStart);
|
|
3621
3688
|
if (targetAnchor) hostRemove(targetAnchor);
|
|
3622
3689
|
doRemove && hostRemove(anchor);
|
|
3623
|
-
if (shapeFlag & 16) {
|
|
3624
|
-
const
|
|
3625
|
-
|
|
3626
|
-
const child = children[i];
|
|
3627
|
-
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3628
|
-
}
|
|
3690
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
3691
|
+
const child = children[i];
|
|
3692
|
+
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3629
3693
|
}
|
|
3630
3694
|
},
|
|
3631
3695
|
move: moveTeleport,
|
|
@@ -3636,7 +3700,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
3636
3700
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
3637
3701
|
const isReorder = moveType === 2;
|
|
3638
3702
|
if (isReorder) insert(el, container, parentAnchor);
|
|
3639
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
3703
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
3640
3704
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
3641
3705
|
}
|
|
3642
3706
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -3761,8 +3825,8 @@ const BaseTransitionImpl = {
|
|
|
3761
3825
|
const state = useTransitionState();
|
|
3762
3826
|
return () => {
|
|
3763
3827
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
3764
|
-
|
|
3765
|
-
|
|
3828
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3829
|
+
if (!child) return;
|
|
3766
3830
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3767
3831
|
const { mode } = rawProps;
|
|
3768
3832
|
checkTransitionMode(mode);
|
|
@@ -3946,12 +4010,11 @@ function getInnerChild$1(vnode) {
|
|
|
3946
4010
|
}
|
|
3947
4011
|
}
|
|
3948
4012
|
function setTransitionHooks(vnode, hooks) {
|
|
3949
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
3950
|
-
else {
|
|
4013
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3951
4014
|
vnode.transition = hooks;
|
|
3952
|
-
setTransitionHooks(vnode.component
|
|
3953
|
-
|
|
3954
|
-
else if (vnode.shapeFlag & 128) {
|
|
4015
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
4016
|
+
else setTransitionHooks(vnode.component.subTree, hooks);
|
|
4017
|
+
} else if (vnode.shapeFlag & 128) {
|
|
3955
4018
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3956
4019
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3957
4020
|
} else vnode.transition = hooks;
|
|
@@ -4229,7 +4292,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4229
4292
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4230
4293
|
break;
|
|
4231
4294
|
case VaporSlot:
|
|
4232
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
|
|
4295
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
4233
4296
|
break;
|
|
4234
4297
|
default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
4235
4298
|
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -4239,16 +4302,31 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4239
4302
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
4240
4303
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
4241
4304
|
else nextNode = nextSibling(node);
|
|
4242
|
-
if (vnode.type.__vapor)
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
}
|
|
4250
|
-
|
|
4251
|
-
|
|
4305
|
+
if (vnode.type.__vapor) {
|
|
4306
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
|
|
4307
|
+
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
4308
|
+
if (vnode.dirs) {
|
|
4309
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
4310
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
4311
|
+
}
|
|
4312
|
+
}, () => {
|
|
4313
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
4314
|
+
});
|
|
4315
|
+
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
4316
|
+
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
4317
|
+
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
4318
|
+
} else {
|
|
4319
|
+
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
4320
|
+
const component = vnode.component;
|
|
4321
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
|
|
4322
|
+
let subTree;
|
|
4323
|
+
if (isFragmentStart) {
|
|
4324
|
+
subTree = createVNode(Fragment);
|
|
4325
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4326
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
4327
|
+
subTree.el = node;
|
|
4328
|
+
component.subTree = subTree;
|
|
4329
|
+
}
|
|
4252
4330
|
}
|
|
4253
4331
|
} else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
|
|
4254
4332
|
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
@@ -4260,9 +4338,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4260
4338
|
};
|
|
4261
4339
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
4262
4340
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4263
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4341
|
+
const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4264
4342
|
const forcePatch = type === "input" || type === "option";
|
|
4265
|
-
|
|
4343
|
+
const hasDynamicProps = !!dynamicProps;
|
|
4344
|
+
if (!!(process.env.NODE_ENV !== "production") || forcePatch || hasDynamicProps || patchFlag !== -1) {
|
|
4266
4345
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
4267
4346
|
let needCallTransitionHooks = false;
|
|
4268
4347
|
if (isTemplateNode(el)) {
|
|
@@ -4278,15 +4357,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4278
4357
|
}
|
|
4279
4358
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
4280
4359
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4281
|
-
|
|
4360
|
+
if (next && !isMismatchAllowed(el, 1)) {
|
|
4361
|
+
(process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
4362
|
+
logMismatchError();
|
|
4363
|
+
}
|
|
4282
4364
|
while (next) {
|
|
4283
|
-
if (!isMismatchAllowed(el, 1)) {
|
|
4284
|
-
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
|
|
4285
|
-
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
4286
|
-
hasWarned = true;
|
|
4287
|
-
}
|
|
4288
|
-
logMismatchError();
|
|
4289
|
-
}
|
|
4290
4365
|
const cur = next;
|
|
4291
4366
|
next = next.nextSibling;
|
|
4292
4367
|
remove(cur);
|
|
@@ -4304,11 +4379,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4304
4379
|
}
|
|
4305
4380
|
}
|
|
4306
4381
|
if (props) {
|
|
4307
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & 48) {
|
|
4382
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || hasDynamicProps || !optimized || patchFlag & 48) {
|
|
4308
4383
|
const isCustomElement = el.tagName.includes("-");
|
|
4384
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
4309
4385
|
for (const key in props) {
|
|
4310
4386
|
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
4311
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)) patchProp(el, key, null, props[key],
|
|
4387
|
+
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);
|
|
4312
4388
|
}
|
|
4313
4389
|
} else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
|
|
4314
4390
|
else if (patchFlag & 4 && /* @__PURE__ */ isReactive(props.style)) for (const key in props.style) props.style[key];
|
|
@@ -4328,7 +4404,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4328
4404
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
4329
4405
|
const children = parentVNode.children;
|
|
4330
4406
|
const l = children.length;
|
|
4331
|
-
let
|
|
4407
|
+
let hasCheckedMismatch = false;
|
|
4332
4408
|
for (let i = 0; i < l; i++) {
|
|
4333
4409
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
4334
4410
|
const isText = vnode.type === Text;
|
|
@@ -4342,12 +4418,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4342
4418
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4343
4419
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
4344
4420
|
else {
|
|
4345
|
-
if (!
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4421
|
+
if (!hasCheckedMismatch) {
|
|
4422
|
+
hasCheckedMismatch = true;
|
|
4423
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
4424
|
+
(process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
|
|
4425
|
+
logMismatchError();
|
|
4349
4426
|
}
|
|
4350
|
-
logMismatchError();
|
|
4351
4427
|
}
|
|
4352
4428
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
4353
4429
|
}
|
|
@@ -4367,7 +4443,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4367
4443
|
}
|
|
4368
4444
|
};
|
|
4369
4445
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
4370
|
-
if (!
|
|
4446
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
4371
4447
|
(process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && 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);
|
|
4372
4448
|
logMismatchError();
|
|
4373
4449
|
}
|
|
@@ -4543,7 +4619,9 @@ const MismatchTypeString = {
|
|
|
4543
4619
|
};
|
|
4544
4620
|
function isMismatchAllowed(el, allowedType) {
|
|
4545
4621
|
if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
|
|
4546
|
-
|
|
4622
|
+
return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
|
|
4623
|
+
}
|
|
4624
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
4547
4625
|
if (allowedAttr == null) return false;
|
|
4548
4626
|
else if (allowedAttr === "") return true;
|
|
4549
4627
|
else {
|
|
@@ -4552,6 +4630,16 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
4552
4630
|
return list.includes(MismatchTypeString[allowedType]);
|
|
4553
4631
|
}
|
|
4554
4632
|
}
|
|
4633
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
4634
|
+
return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
4635
|
+
}
|
|
4636
|
+
function isMismatchAllowedByNode(node) {
|
|
4637
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
|
|
4638
|
+
}
|
|
4639
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
4640
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
4641
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
|
|
4642
|
+
}
|
|
4555
4643
|
//#endregion
|
|
4556
4644
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
4557
4645
|
let requestIdleCallback;
|
|
@@ -4670,11 +4758,16 @@ function defineAsyncComponent(source) {
|
|
|
4670
4758
|
onError(err);
|
|
4671
4759
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
4672
4760
|
});
|
|
4673
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
4761
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
4674
4762
|
load().then(() => {
|
|
4763
|
+
if (instance.isUnmounted) return;
|
|
4675
4764
|
loaded.value = true;
|
|
4676
4765
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
4677
4766
|
}).catch((err) => {
|
|
4767
|
+
if (instance.isUnmounted) {
|
|
4768
|
+
setPendingRequest(null);
|
|
4769
|
+
return;
|
|
4770
|
+
}
|
|
4678
4771
|
onError(err);
|
|
4679
4772
|
error.value = err;
|
|
4680
4773
|
});
|
|
@@ -4732,14 +4825,22 @@ function createAsyncComponentContext(source) {
|
|
|
4732
4825
|
setPendingRequest: (request) => pendingRequest = request
|
|
4733
4826
|
};
|
|
4734
4827
|
}
|
|
4735
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
4828
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
4736
4829
|
const loaded = /* @__PURE__ */ ref(false);
|
|
4737
4830
|
const error = /* @__PURE__ */ ref();
|
|
4738
4831
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4739
|
-
|
|
4832
|
+
let timeoutTimer;
|
|
4833
|
+
let delayTimer;
|
|
4834
|
+
if (instance) onUnmounted(() => {
|
|
4835
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4836
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4837
|
+
}, instance);
|
|
4838
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
4839
|
+
if (instance && instance.isUnmounted) return;
|
|
4740
4840
|
delayed.value = false;
|
|
4741
4841
|
}, delay);
|
|
4742
|
-
if (timeout != null) setTimeout(() => {
|
|
4842
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
4843
|
+
if (instance && instance.isUnmounted) return;
|
|
4743
4844
|
if (!loaded.value && !error.value) {
|
|
4744
4845
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
4745
4846
|
onError(err);
|
|
@@ -4757,6 +4858,7 @@ const useAsyncComponentState = (delay, timeout, onError) => {
|
|
|
4757
4858
|
* @internal
|
|
4758
4859
|
*/
|
|
4759
4860
|
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
4861
|
+
const wasConnected = el.isConnected;
|
|
4760
4862
|
let patched = false;
|
|
4761
4863
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4762
4864
|
const performHydrate = () => {
|
|
@@ -4767,6 +4869,7 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
4767
4869
|
}
|
|
4768
4870
|
return;
|
|
4769
4871
|
}
|
|
4872
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
4770
4873
|
hydrate();
|
|
4771
4874
|
};
|
|
4772
4875
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -5012,7 +5115,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
5012
5115
|
try {
|
|
5013
5116
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
5014
5117
|
} finally {
|
|
5015
|
-
|
|
5118
|
+
restoreCurrentInstance(prev);
|
|
5016
5119
|
setActiveSub(prevSub);
|
|
5017
5120
|
}
|
|
5018
5121
|
});
|
|
@@ -5351,8 +5454,9 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5351
5454
|
* Compiler runtime helper for rendering `<slot/>`
|
|
5352
5455
|
* @private
|
|
5353
5456
|
*/
|
|
5354
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
5457
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
5355
5458
|
let slot = slots[name];
|
|
5459
|
+
if (fallback) fallback.__vdom = true;
|
|
5356
5460
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
5357
5461
|
if (vaporSlot) {
|
|
5358
5462
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -5360,25 +5464,35 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
5360
5464
|
slot: vaporSlot,
|
|
5361
5465
|
fallback
|
|
5362
5466
|
};
|
|
5467
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
5363
5468
|
return ret;
|
|
5364
5469
|
}
|
|
5365
5470
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
5366
|
-
const
|
|
5367
|
-
|
|
5368
|
-
|
|
5471
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
5472
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
5473
|
+
if (name !== "default") slotProps.name = name;
|
|
5474
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
5369
5475
|
}
|
|
5370
5476
|
if (!!(process.env.NODE_ENV !== "production") && slot && slot.length > 1) {
|
|
5371
5477
|
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.");
|
|
5372
5478
|
slot = () => [];
|
|
5373
5479
|
}
|
|
5374
5480
|
if (slot && slot._c) slot._d = false;
|
|
5481
|
+
const prevStackSize = blockStack.length;
|
|
5375
5482
|
openBlock();
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5483
|
+
let rendered;
|
|
5484
|
+
try {
|
|
5485
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
5486
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
5487
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
5488
|
+
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
5489
|
+
} catch (err) {
|
|
5490
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
5491
|
+
throw err;
|
|
5492
|
+
} finally {
|
|
5493
|
+
if (slot && slot._c) slot._d = true;
|
|
5494
|
+
}
|
|
5380
5495
|
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
5381
|
-
if (slot && slot._c) slot._d = true;
|
|
5382
5496
|
return rendered;
|
|
5383
5497
|
}
|
|
5384
5498
|
function ensureValidVNode(vnodes) {
|
|
@@ -5391,9 +5505,7 @@ function ensureValidVNode(vnodes) {
|
|
|
5391
5505
|
}
|
|
5392
5506
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
5393
5507
|
let vaporSlot;
|
|
5394
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
5395
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
5396
|
-
}
|
|
5508
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
5397
5509
|
}
|
|
5398
5510
|
//#endregion
|
|
5399
5511
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -5948,26 +6060,39 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
5948
6060
|
function withAsyncContext(getAwaitable) {
|
|
5949
6061
|
const ctx = getCurrentGenericInstance();
|
|
5950
6062
|
const inSSRSetup = isInSSRComponentSetup;
|
|
6063
|
+
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
5951
6064
|
if (!!(process.env.NODE_ENV !== "production") && !ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
5952
6065
|
let awaitable = getAwaitable();
|
|
5953
6066
|
setCurrentInstance(null, void 0);
|
|
5954
6067
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5955
6068
|
const restore = () => {
|
|
6069
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5956
6070
|
setCurrentInstance(ctx);
|
|
5957
6071
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
6072
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
6073
|
+
return () => {
|
|
6074
|
+
if (reset) reset();
|
|
6075
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
6076
|
+
};
|
|
5958
6077
|
};
|
|
5959
6078
|
const cleanup = () => {
|
|
5960
6079
|
setCurrentInstance(null, void 0);
|
|
5961
6080
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5962
6081
|
};
|
|
5963
6082
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
5964
|
-
restore();
|
|
5965
|
-
Promise.resolve().then(() => Promise.resolve().then(
|
|
6083
|
+
const reset = restore();
|
|
6084
|
+
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
6085
|
+
if (reset) reset();
|
|
6086
|
+
cleanup();
|
|
6087
|
+
}));
|
|
5966
6088
|
throw e;
|
|
5967
6089
|
});
|
|
5968
6090
|
return [awaitable, () => {
|
|
5969
|
-
restore();
|
|
5970
|
-
Promise.resolve().then(
|
|
6091
|
+
const reset = restore();
|
|
6092
|
+
Promise.resolve().then(() => {
|
|
6093
|
+
if (reset) reset();
|
|
6094
|
+
cleanup();
|
|
6095
|
+
});
|
|
5971
6096
|
}];
|
|
5972
6097
|
}
|
|
5973
6098
|
//#endregion
|
|
@@ -6287,7 +6412,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6287
6412
|
if (options.el) return vm.$mount(options.el);
|
|
6288
6413
|
else return vm;
|
|
6289
6414
|
}
|
|
6290
|
-
Vue.version = `2.6.14-compat:3.6.0-
|
|
6415
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.2`;
|
|
6291
6416
|
Vue.config = singletonApp.config;
|
|
6292
6417
|
Vue.use = (plugin, ...options) => {
|
|
6293
6418
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -6542,7 +6667,9 @@ function defineReactive(obj, key, val) {
|
|
|
6542
6667
|
else Object.keys(val).forEach((key) => {
|
|
6543
6668
|
try {
|
|
6544
6669
|
defineReactiveSimple(val, key, val[key]);
|
|
6545
|
-
} catch (e) {
|
|
6670
|
+
} catch (e) {
|
|
6671
|
+
if (!!(process.env.NODE_ENV !== "production")) warn$1(`Failed making property "${key}" reactive:`, e);
|
|
6672
|
+
}
|
|
6546
6673
|
});
|
|
6547
6674
|
}
|
|
6548
6675
|
const i = obj.$;
|
|
@@ -6793,12 +6920,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6793
6920
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
6794
6921
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
6795
6922
|
}
|
|
6796
|
-
|
|
6923
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
6924
|
+
if (!hasVModel) {
|
|
6797
6925
|
localValue = value;
|
|
6798
6926
|
trigger();
|
|
6799
6927
|
}
|
|
6800
6928
|
i.emit(`update:${name}`, emittedValue);
|
|
6801
|
-
if (hasChanged(value,
|
|
6929
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
6802
6930
|
prevSetValue = value;
|
|
6803
6931
|
prevEmittedValue = emittedValue;
|
|
6804
6932
|
}
|
|
@@ -6911,7 +7039,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
6911
7039
|
function isEmitListener(options, key) {
|
|
6912
7040
|
if (!options || !isOn(key)) return false;
|
|
6913
7041
|
if (key.startsWith(compatModelEventPrefix)) return true;
|
|
6914
|
-
key = key.slice(2)
|
|
7042
|
+
key = key.slice(2);
|
|
7043
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
6915
7044
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
6916
7045
|
}
|
|
6917
7046
|
//#endregion
|
|
@@ -7286,7 +7415,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
7286
7415
|
const prev = setCurrentInstance(instance);
|
|
7287
7416
|
const props = /* @__PURE__ */ toRaw(instance.props);
|
|
7288
7417
|
value = factory.call(isCompatEnabled$1("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null, props);
|
|
7289
|
-
|
|
7418
|
+
restoreCurrentInstance(prev);
|
|
7290
7419
|
return value;
|
|
7291
7420
|
}
|
|
7292
7421
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -7433,7 +7562,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
7433
7562
|
const receivedType = toRawType(value);
|
|
7434
7563
|
const expectedValue = styleValue(value, expectedType);
|
|
7435
7564
|
const receivedValue = styleValue(value, receivedType);
|
|
7436
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
7565
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
7437
7566
|
message += `, got ${receivedType} `;
|
|
7438
7567
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
7439
7568
|
return message;
|
|
@@ -7442,7 +7571,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
7442
7571
|
* dev only
|
|
7443
7572
|
*/
|
|
7444
7573
|
function styleValue(value, type) {
|
|
7445
|
-
if (
|
|
7574
|
+
if (isSymbol(value)) return value.toString();
|
|
7575
|
+
else if (type === "String") return `"${value}"`;
|
|
7446
7576
|
else if (type === "Number") return `${Number(value)}`;
|
|
7447
7577
|
else return `${value}`;
|
|
7448
7578
|
}
|
|
@@ -7459,8 +7589,11 @@ function isExplicable(type) {
|
|
|
7459
7589
|
/**
|
|
7460
7590
|
* dev only
|
|
7461
7591
|
*/
|
|
7462
|
-
function
|
|
7463
|
-
return args.
|
|
7592
|
+
function isCoercible(...args) {
|
|
7593
|
+
return args.every((elem) => {
|
|
7594
|
+
const value = elem.toLowerCase();
|
|
7595
|
+
return value !== "boolean" && value !== "symbol";
|
|
7596
|
+
});
|
|
7464
7597
|
}
|
|
7465
7598
|
//#endregion
|
|
7466
7599
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -7797,7 +7930,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7797
7930
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
7798
7931
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7799
7932
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
7800
|
-
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
|
|
7933
|
+
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
7801
7934
|
patchFlag = 0;
|
|
7802
7935
|
optimized = false;
|
|
7803
7936
|
dynamicChildren = null;
|
|
@@ -7876,21 +8009,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7876
8009
|
};
|
|
7877
8010
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7878
8011
|
n2.slotScopeIds = slotScopeIds;
|
|
7879
|
-
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
8012
|
+
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
7880
8013
|
else {
|
|
8014
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
7881
8015
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
7882
8016
|
if (n2.dirs) {
|
|
7883
8017
|
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
7884
8018
|
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
7885
8019
|
}
|
|
8020
|
+
}, () => {
|
|
8021
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
7886
8022
|
});
|
|
7887
8023
|
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
8024
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
8025
|
+
if (vnodeMountedHook) {
|
|
8026
|
+
const scopedVNode = n2;
|
|
8027
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
8028
|
+
}
|
|
7888
8029
|
}
|
|
7889
8030
|
else {
|
|
7890
|
-
|
|
8031
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
8032
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
7891
8033
|
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
8034
|
+
}, () => {
|
|
8035
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
8036
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
7892
8037
|
});
|
|
7893
|
-
|
|
8038
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
8039
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
8040
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
8041
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
8042
|
+
}, void 0, parentSuspense);
|
|
7894
8043
|
}
|
|
7895
8044
|
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
7896
8045
|
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
@@ -8219,7 +8368,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8219
8368
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
8220
8369
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
8221
8370
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
8222
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
8371
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
8223
8372
|
return;
|
|
8224
8373
|
}
|
|
8225
8374
|
if (shapeFlag & 6) {
|
|
@@ -8252,8 +8401,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8252
8401
|
else hostInsert(el, container, anchor);
|
|
8253
8402
|
};
|
|
8254
8403
|
const performLeave = () => {
|
|
8404
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
8255
8405
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
8256
|
-
|
|
8406
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
8407
|
+
else leave(el, () => {
|
|
8257
8408
|
remove();
|
|
8258
8409
|
afterLeave && afterLeave();
|
|
8259
8410
|
});
|
|
@@ -8273,7 +8424,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8273
8424
|
}
|
|
8274
8425
|
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8275
8426
|
if (shapeFlag & 256) {
|
|
8276
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
8427
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
8277
8428
|
else parentComponent.ctx.deactivate(vnode);
|
|
8278
8429
|
return;
|
|
8279
8430
|
}
|
|
@@ -8283,8 +8434,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8283
8434
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8284
8435
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
8285
8436
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
8286
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8287
|
-
if (
|
|
8437
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
8438
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
8439
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
8440
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8441
|
+
}, void 0, parentSuspense);
|
|
8288
8442
|
return;
|
|
8289
8443
|
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
8290
8444
|
else {
|
|
@@ -8297,7 +8451,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8297
8451
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
8298
8452
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
8299
8453
|
if (type === VaporSlot) {
|
|
8300
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8454
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
8301
8455
|
return;
|
|
8302
8456
|
}
|
|
8303
8457
|
if (doRemove) remove(vnode);
|
|
@@ -8346,7 +8500,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8346
8500
|
if (effect) {
|
|
8347
8501
|
effect.stop();
|
|
8348
8502
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8349
|
-
}
|
|
8503
|
+
} else if (doRemove && subTree && instance.vnode.el) remove(subTree);
|
|
8350
8504
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
8351
8505
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
8352
8506
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
@@ -8473,6 +8627,10 @@ function invalidateMount(hooks) {
|
|
|
8473
8627
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
8474
8628
|
}
|
|
8475
8629
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
8630
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
8631
|
+
insert();
|
|
8632
|
+
return;
|
|
8633
|
+
}
|
|
8476
8634
|
if (force || needTransition(parentSuspense, transition)) {
|
|
8477
8635
|
transition.beforeEnter(el);
|
|
8478
8636
|
insert();
|
|
@@ -8677,15 +8835,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8677
8835
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
8678
8836
|
else if (!resume) {
|
|
8679
8837
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
8838
|
+
let hasUpdatedAnchor = false;
|
|
8680
8839
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
8681
8840
|
if (pendingId === suspense.pendingId) {
|
|
8682
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
8841
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
8683
8842
|
queuePostFlushCb(effects);
|
|
8684
8843
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
8685
8844
|
}
|
|
8686
8845
|
};
|
|
8687
8846
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
8688
|
-
if (parentNode(activeBranch.el) === container)
|
|
8847
|
+
if (parentNode(activeBranch.el) === container) {
|
|
8848
|
+
anchor = next(activeBranch);
|
|
8849
|
+
hasUpdatedAnchor = true;
|
|
8850
|
+
}
|
|
8689
8851
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
8690
8852
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
8691
8853
|
}
|
|
@@ -8749,6 +8911,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8749
8911
|
handleError(err, instance, 0);
|
|
8750
8912
|
}).then((asyncSetupResult) => {
|
|
8751
8913
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
8914
|
+
setCurrentInstance(null, void 0);
|
|
8752
8915
|
instance.asyncResolved = true;
|
|
8753
8916
|
onResolve(asyncSetupResult);
|
|
8754
8917
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -9081,12 +9244,30 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
9081
9244
|
el: vnode.el,
|
|
9082
9245
|
anchor: vnode.anchor,
|
|
9083
9246
|
ctx: vnode.ctx,
|
|
9084
|
-
ce: vnode.ce
|
|
9247
|
+
ce: vnode.ce,
|
|
9248
|
+
vi: vnode.vi,
|
|
9249
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
9250
|
+
vb: vnode.vb
|
|
9085
9251
|
};
|
|
9086
9252
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
9087
9253
|
defineLegacyVNodeProperties(cloned);
|
|
9088
9254
|
return cloned;
|
|
9089
9255
|
}
|
|
9256
|
+
function cloneVaporSlotMeta(vnode) {
|
|
9257
|
+
const vaporSlot = vnode.vs;
|
|
9258
|
+
if (!vaporSlot) return vaporSlot;
|
|
9259
|
+
const cloned = {
|
|
9260
|
+
slot: vaporSlot.slot,
|
|
9261
|
+
fallback: vaporSlot.fallback,
|
|
9262
|
+
outletFallback: vaporSlot.outletFallback
|
|
9263
|
+
};
|
|
9264
|
+
if (vnode.el) {
|
|
9265
|
+
cloned.state = vaporSlot.state;
|
|
9266
|
+
cloned.ref = vaporSlot.ref;
|
|
9267
|
+
cloned.scope = vaporSlot.scope;
|
|
9268
|
+
}
|
|
9269
|
+
return cloned;
|
|
9270
|
+
}
|
|
9090
9271
|
/**
|
|
9091
9272
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
9092
9273
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -9149,6 +9330,10 @@ function normalizeChildren(vnode, children) {
|
|
|
9149
9330
|
}
|
|
9150
9331
|
}
|
|
9151
9332
|
else if (isFunction(children)) {
|
|
9333
|
+
if (shapeFlag & 65) {
|
|
9334
|
+
normalizeChildren(vnode, { default: children });
|
|
9335
|
+
return;
|
|
9336
|
+
}
|
|
9152
9337
|
children = {
|
|
9153
9338
|
default: children,
|
|
9154
9339
|
_ctx: currentRenderingInstance
|
|
@@ -9221,6 +9406,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
9221
9406
|
simpleSetCurrentInstance(instance);
|
|
9222
9407
|
}
|
|
9223
9408
|
};
|
|
9409
|
+
/**
|
|
9410
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
9411
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
9412
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
9413
|
+
* @internal
|
|
9414
|
+
*/
|
|
9415
|
+
const restoreCurrentInstance = (prev) => {
|
|
9416
|
+
setCurrentScope(prev[1]);
|
|
9417
|
+
simpleSetCurrentInstance(prev[0]);
|
|
9418
|
+
};
|
|
9224
9419
|
const internalOptions = [
|
|
9225
9420
|
"ce",
|
|
9226
9421
|
"type",
|
|
@@ -9381,7 +9576,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
9381
9576
|
const setupResult = callWithErrorHandling(setup, instance, 0, [!!(process.env.NODE_ENV !== "production") ? /* @__PURE__ */ shallowReadonly(instance.props) : instance.props, setupContext]);
|
|
9382
9577
|
const isAsyncSetup = isPromise(setupResult);
|
|
9383
9578
|
setActiveSub(prevSub);
|
|
9384
|
-
|
|
9579
|
+
restoreCurrentInstance(prev);
|
|
9385
9580
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
9386
9581
|
if (isAsyncSetup) {
|
|
9387
9582
|
const unsetCurrentInstance = () => {
|
|
@@ -9455,7 +9650,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
9455
9650
|
applyOptions(instance);
|
|
9456
9651
|
} finally {
|
|
9457
9652
|
setActiveSub(prevSub);
|
|
9458
|
-
|
|
9653
|
+
restoreCurrentInstance(prevInstance);
|
|
9459
9654
|
}
|
|
9460
9655
|
}
|
|
9461
9656
|
if (!!(process.env.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR) if (!compile$1 && Component.template)
|
|
@@ -9775,7 +9970,7 @@ function isMemoSame(cached, memo) {
|
|
|
9775
9970
|
}
|
|
9776
9971
|
//#endregion
|
|
9777
9972
|
//#region packages/runtime-core/src/index.ts
|
|
9778
|
-
const version = "3.6.0-
|
|
9973
|
+
const version = "3.6.0-rc.2";
|
|
9779
9974
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
9780
9975
|
/**
|
|
9781
9976
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -10280,7 +10475,10 @@ function patchStyle(el, prev, next) {
|
|
|
10280
10475
|
}
|
|
10281
10476
|
for (const key in next) {
|
|
10282
10477
|
if (key === "display") hasControlledDisplay = true;
|
|
10283
|
-
|
|
10478
|
+
const value = next[key];
|
|
10479
|
+
if (value != null) {
|
|
10480
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
10481
|
+
} else setStyle(style, key, "");
|
|
10284
10482
|
}
|
|
10285
10483
|
} else if (isCssString) {
|
|
10286
10484
|
if (prev !== next) {
|
|
@@ -10330,6 +10528,14 @@ function autoPrefix(style, rawName) {
|
|
|
10330
10528
|
}
|
|
10331
10529
|
return rawName;
|
|
10332
10530
|
}
|
|
10531
|
+
/**
|
|
10532
|
+
* Browsers update textarea width/height directly during native resize.
|
|
10533
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
10534
|
+
* still follow normal vnode style patching.
|
|
10535
|
+
*/
|
|
10536
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
10537
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
|
|
10538
|
+
}
|
|
10333
10539
|
//#endregion
|
|
10334
10540
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
10335
10541
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
@@ -10413,7 +10619,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
10413
10619
|
const existingInvoker = invokers[rawName];
|
|
10414
10620
|
if (nextValue && existingInvoker) existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue;
|
|
10415
10621
|
else {
|
|
10416
|
-
const [name, options] =
|
|
10622
|
+
const [name, options] = parseEventName(rawName);
|
|
10417
10623
|
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(!!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue, instance), options);
|
|
10418
10624
|
else if (existingInvoker) {
|
|
10419
10625
|
removeEventListener(el, name, existingInvoker, options);
|
|
@@ -10421,16 +10627,15 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
10421
10627
|
}
|
|
10422
10628
|
}
|
|
10423
10629
|
}
|
|
10424
|
-
const optionsModifierRE = /(
|
|
10425
|
-
|
|
10630
|
+
const optionsModifierRE = /(Once|Passive|Capture)$/;
|
|
10631
|
+
const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
|
|
10632
|
+
function parseEventName(name) {
|
|
10426
10633
|
let options;
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
options[m[0].toLowerCase()] = true;
|
|
10433
|
-
}
|
|
10634
|
+
let m;
|
|
10635
|
+
while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
|
|
10636
|
+
if (!options) options = {};
|
|
10637
|
+
name = name.slice(0, name.length - m[1].length);
|
|
10638
|
+
options[m[1].toLowerCase()] = true;
|
|
10434
10639
|
}
|
|
10435
10640
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
10436
10641
|
}
|
|
@@ -10441,7 +10646,21 @@ function createInvoker(initialValue, instance) {
|
|
|
10441
10646
|
const invoker = (e) => {
|
|
10442
10647
|
if (!e._vts) e._vts = Date.now();
|
|
10443
10648
|
else if (e._vts <= invoker.attached) return;
|
|
10444
|
-
|
|
10649
|
+
const value = invoker.value;
|
|
10650
|
+
if (isArray(value)) {
|
|
10651
|
+
const originalStop = e.stopImmediatePropagation;
|
|
10652
|
+
e.stopImmediatePropagation = () => {
|
|
10653
|
+
originalStop.call(e);
|
|
10654
|
+
e._stopped = true;
|
|
10655
|
+
};
|
|
10656
|
+
const handlers = value.slice();
|
|
10657
|
+
const args = [e];
|
|
10658
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
10659
|
+
if (e._stopped) break;
|
|
10660
|
+
const handler = handlers[i];
|
|
10661
|
+
if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
|
|
10662
|
+
}
|
|
10663
|
+
} else callWithAsyncErrorHandling(value, instance, 5, [e]);
|
|
10445
10664
|
};
|
|
10446
10665
|
invoker.value = initialValue;
|
|
10447
10666
|
invoker.attached = getNow();
|
|
@@ -10452,16 +10671,6 @@ function sanitizeEventValue(value, propName) {
|
|
|
10452
10671
|
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}.`);
|
|
10453
10672
|
return NOOP;
|
|
10454
10673
|
}
|
|
10455
|
-
function patchStopImmediatePropagation(e, value) {
|
|
10456
|
-
if (isArray(value)) {
|
|
10457
|
-
const originalStop = e.stopImmediatePropagation;
|
|
10458
|
-
e.stopImmediatePropagation = () => {
|
|
10459
|
-
originalStop.call(e);
|
|
10460
|
-
e._stopped = true;
|
|
10461
|
-
};
|
|
10462
|
-
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
10463
|
-
} else return value;
|
|
10464
|
-
}
|
|
10465
10674
|
//#endregion
|
|
10466
10675
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
10467
10676
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -10789,7 +10998,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10789
10998
|
replacementNodes.push(child);
|
|
10790
10999
|
}
|
|
10791
11000
|
parent.removeChild(o);
|
|
10792
|
-
slotReplacements.set(o,
|
|
11001
|
+
slotReplacements.set(o, {
|
|
11002
|
+
nodes: replacementNodes,
|
|
11003
|
+
usedFallback: !content
|
|
11004
|
+
});
|
|
10793
11005
|
}
|
|
10794
11006
|
this._updateSlotNodes(slotReplacements);
|
|
10795
11007
|
}
|
|
@@ -10981,7 +11193,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
|
|
|
10981
11193
|
prevChildren = [];
|
|
10982
11194
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
10983
11195
|
const child = children[i];
|
|
10984
|
-
if (child.el && child.el instanceof Element) {
|
|
11196
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
10985
11197
|
prevChildren.push(child);
|
|
10986
11198
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
10987
11199
|
positionMap.set(child, getPosition(child.el));
|
|
@@ -11205,7 +11417,8 @@ const vModelSelect = {
|
|
|
11205
11417
|
mounted(el, { value }) {
|
|
11206
11418
|
vModelSetSelected(el, value);
|
|
11207
11419
|
},
|
|
11208
|
-
beforeUpdate(el,
|
|
11420
|
+
beforeUpdate(el, { value }, vnode) {
|
|
11421
|
+
el._modelValue = value;
|
|
11209
11422
|
el[assignKey] = getModelAssigner(vnode);
|
|
11210
11423
|
},
|
|
11211
11424
|
updated(el, { value }) {
|
|
@@ -11216,10 +11429,10 @@ const vModelSelect = {
|
|
|
11216
11429
|
* @internal
|
|
11217
11430
|
*/
|
|
11218
11431
|
const vModelSelectInit = (el, value, number, set) => {
|
|
11219
|
-
|
|
11432
|
+
el._modelValue = value;
|
|
11220
11433
|
addEventListener(el, "change", () => {
|
|
11221
11434
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
11222
|
-
(set || el[assignKey])(el.multiple ?
|
|
11435
|
+
(set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
|
|
11223
11436
|
el._assigning = true;
|
|
11224
11437
|
nextTick(() => {
|
|
11225
11438
|
el._assigning = false;
|
|
@@ -11230,6 +11443,7 @@ const vModelSelectInit = (el, value, number, set) => {
|
|
|
11230
11443
|
* @internal
|
|
11231
11444
|
*/
|
|
11232
11445
|
const vModelSetSelected = (el, value) => {
|
|
11446
|
+
el._modelValue = value;
|
|
11233
11447
|
if (el._assigning) return;
|
|
11234
11448
|
const isMultiple = el.multiple;
|
|
11235
11449
|
const isArrayValue = isArray(value);
|
|
@@ -11412,6 +11626,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11412
11626
|
TransitionGroup: () => TransitionGroup,
|
|
11413
11627
|
TransitionPropsValidators: () => TransitionPropsValidators,
|
|
11414
11628
|
TriggerOpTypes: () => TriggerOpTypes,
|
|
11629
|
+
VaporSlot: () => VaporSlot,
|
|
11415
11630
|
VueElement: () => VueElement,
|
|
11416
11631
|
VueElementBase: () => VueElementBase,
|
|
11417
11632
|
activate: () => activate,
|
|
@@ -11467,6 +11682,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11467
11682
|
endMeasure: () => endMeasure,
|
|
11468
11683
|
ensureHydrationRenderer: () => ensureHydrationRenderer,
|
|
11469
11684
|
ensureRenderer: () => ensureRenderer,
|
|
11685
|
+
ensureValidVNode: () => ensureValidVNode,
|
|
11470
11686
|
ensureVaporSlotFallback: () => ensureVaporSlotFallback,
|
|
11471
11687
|
expose: () => expose,
|
|
11472
11688
|
flushOnAppMount: () => flushOnAppMount,
|
|
@@ -11499,6 +11715,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11499
11715
|
isAsyncWrapper: () => isAsyncWrapper,
|
|
11500
11716
|
isEmitListener: () => isEmitListener,
|
|
11501
11717
|
isHydrating: () => isHydrating,
|
|
11718
|
+
isHydratingEnabled: () => isHydratingEnabled,
|
|
11502
11719
|
isKeepAlive: () => isKeepAlive,
|
|
11503
11720
|
isMapEqual: () => isMapEqual,
|
|
11504
11721
|
isMemoSame: () => isMemoSame,
|
|
@@ -11518,6 +11735,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11518
11735
|
isValidHtmlOrSvgAttribute: () => isValidHtmlOrSvgAttribute,
|
|
11519
11736
|
knownTemplateRefs: () => knownTemplateRefs,
|
|
11520
11737
|
leaveCbKey: () => leaveCbKey,
|
|
11738
|
+
logMismatchError: () => logMismatchError,
|
|
11521
11739
|
markAsyncBoundary: () => markAsyncBoundary,
|
|
11522
11740
|
markRaw: () => markRaw,
|
|
11523
11741
|
matches: () => matches,
|
|
@@ -11532,6 +11750,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11532
11750
|
normalizeProps: () => normalizeProps,
|
|
11533
11751
|
normalizeRef: () => normalizeRef,
|
|
11534
11752
|
normalizeStyle: () => normalizeStyle,
|
|
11753
|
+
normalizeVNode: () => normalizeVNode,
|
|
11535
11754
|
onActivated: () => onActivated,
|
|
11536
11755
|
onBeforeMount: () => onBeforeMount,
|
|
11537
11756
|
onBeforeUnmount: () => onBeforeUnmount,
|
|
@@ -11547,6 +11766,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11547
11766
|
onUpdated: () => onUpdated,
|
|
11548
11767
|
onWatcherCleanup: () => onWatcherCleanup,
|
|
11549
11768
|
openBlock: () => openBlock,
|
|
11769
|
+
parseEventName: () => parseEventName,
|
|
11550
11770
|
patchProp: () => patchProp,
|
|
11551
11771
|
patchStyle: () => patchStyle,
|
|
11552
11772
|
performAsyncHydrate: () => performAsyncHydrate,
|
|
@@ -11560,6 +11780,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11560
11780
|
pushWarningContext: () => pushWarningContext,
|
|
11561
11781
|
queueJob: () => queueJob,
|
|
11562
11782
|
queuePostFlushCb: () => queuePostFlushCb,
|
|
11783
|
+
queuePostRenderEffect: () => queuePostRenderEffect,
|
|
11563
11784
|
reactive: () => reactive,
|
|
11564
11785
|
readonly: () => readonly,
|
|
11565
11786
|
ref: () => ref,
|
|
@@ -11577,6 +11798,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11577
11798
|
resolveTeleportTarget: () => resolveTarget,
|
|
11578
11799
|
resolveTransitionHooks: () => resolveTransitionHooks,
|
|
11579
11800
|
resolveTransitionProps: () => resolveTransitionProps,
|
|
11801
|
+
restoreCurrentInstance: () => restoreCurrentInstance,
|
|
11580
11802
|
setBlockTracking: () => setBlockTracking,
|
|
11581
11803
|
setCurrentInstance: () => setCurrentInstance,
|
|
11582
11804
|
setCurrentRenderingInstance: () => setCurrentRenderingInstance,
|
|
@@ -13017,6 +13239,7 @@ function getUnnormalizedProps(props, callPath = []) {
|
|
|
13017
13239
|
return [props, callPath];
|
|
13018
13240
|
}
|
|
13019
13241
|
function injectProp(node, prop, context) {
|
|
13242
|
+
if (node.type !== 13 && injectSlotKey(node, prop)) return;
|
|
13020
13243
|
let propsWithInjection;
|
|
13021
13244
|
/**
|
|
13022
13245
|
* 1. mergeProps(...)
|
|
@@ -13055,6 +13278,20 @@ function injectProp(node, prop, context) {
|
|
|
13055
13278
|
else if (parentCall) parentCall.arguments[0] = propsWithInjection;
|
|
13056
13279
|
else node.arguments[2] = propsWithInjection;
|
|
13057
13280
|
}
|
|
13281
|
+
function injectSlotKey(node, prop) {
|
|
13282
|
+
var _node$arguments, _node$arguments2, _node$arguments3;
|
|
13283
|
+
if (prop.key.type !== 4 || prop.key.content !== "key") return false;
|
|
13284
|
+
const props = node.arguments[2];
|
|
13285
|
+
if (props && !isString(props)) {
|
|
13286
|
+
const [unnormalizedProps] = getUnnormalizedProps(props);
|
|
13287
|
+
if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) return true;
|
|
13288
|
+
}
|
|
13289
|
+
(_node$arguments = node.arguments)[2] || (_node$arguments[2] = "{}");
|
|
13290
|
+
(_node$arguments2 = node.arguments)[3] || (_node$arguments2[3] = "undefined");
|
|
13291
|
+
(_node$arguments3 = node.arguments)[4] || (_node$arguments3[4] = "undefined");
|
|
13292
|
+
node.arguments[5] = prop.value;
|
|
13293
|
+
return true;
|
|
13294
|
+
}
|
|
13058
13295
|
function hasProp(prop, props) {
|
|
13059
13296
|
let result = false;
|
|
13060
13297
|
if (prop.key.type === 4) {
|
|
@@ -13324,7 +13561,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
13324
13561
|
}
|
|
13325
13562
|
},
|
|
13326
13563
|
oncdata(start, end) {
|
|
13327
|
-
if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
|
|
13564
|
+
if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
|
|
13328
13565
|
else emitError(1, start - 9);
|
|
13329
13566
|
},
|
|
13330
13567
|
onprocessinginstruction(start) {
|
|
@@ -13853,8 +14090,10 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
13853
14090
|
imports: [],
|
|
13854
14091
|
cached: [],
|
|
13855
14092
|
constantCache: /* @__PURE__ */ new WeakMap(),
|
|
14093
|
+
vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
|
|
13856
14094
|
temps: 0,
|
|
13857
14095
|
identifiers: Object.create(null),
|
|
14096
|
+
identifierScopes: Object.create(null),
|
|
13858
14097
|
scopes: {
|
|
13859
14098
|
vFor: 0,
|
|
13860
14099
|
vSlot: 0,
|
|
@@ -13908,8 +14147,12 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
13908
14147
|
context.parent.children.splice(removalIndex, 1);
|
|
13909
14148
|
},
|
|
13910
14149
|
onNodeRemoved: NOOP,
|
|
13911
|
-
addIdentifiers(exp) {},
|
|
14150
|
+
addIdentifiers(exp, type = "local") {},
|
|
13912
14151
|
removeIdentifiers(exp) {},
|
|
14152
|
+
isSlotScopeIdentifier(name) {
|
|
14153
|
+
const scopes = context.identifierScopes[name];
|
|
14154
|
+
return scopes ? scopes[scopes.length - 1] === "slot" : false;
|
|
14155
|
+
},
|
|
13913
14156
|
hoist(exp) {
|
|
13914
14157
|
if (isString(exp)) exp = createSimpleExpression(exp);
|
|
13915
14158
|
context.hoists.push(exp);
|
|
@@ -14263,6 +14506,7 @@ function genNode(node, context) {
|
|
|
14263
14506
|
case 24: break;
|
|
14264
14507
|
case 25: break;
|
|
14265
14508
|
case 26: break;
|
|
14509
|
+
/* v8 ignore start */
|
|
14266
14510
|
case 10: break;
|
|
14267
14511
|
default: if (!!(process.env.NODE_ENV !== "production")) {
|
|
14268
14512
|
assert(false, `unhandled codegen node type: ${node.type}`);
|
|
@@ -14482,7 +14726,7 @@ const transformExpression = (node, context) => {
|
|
|
14482
14726
|
if (dir.type === 7 && dir.name !== "for") {
|
|
14483
14727
|
const exp = dir.exp;
|
|
14484
14728
|
const arg = dir.arg;
|
|
14485
|
-
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");
|
|
14729
|
+
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");
|
|
14486
14730
|
if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
|
|
14487
14731
|
}
|
|
14488
14732
|
}
|
|
@@ -14623,10 +14867,9 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
14623
14867
|
const isTemplate = isTemplateNode$1(node);
|
|
14624
14868
|
const memo = findDir(node, "memo");
|
|
14625
14869
|
const keyProp = findProp(node, `key`, false, true);
|
|
14626
|
-
|
|
14870
|
+
keyProp && keyProp.type;
|
|
14627
14871
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
14628
|
-
|
|
14629
|
-
const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
14872
|
+
const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
14630
14873
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
14631
14874
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
14632
14875
|
forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
|
|
@@ -15407,7 +15650,7 @@ function rewriteFilter(node, context) {
|
|
|
15407
15650
|
const child = node.children[i];
|
|
15408
15651
|
if (typeof child !== "object") continue;
|
|
15409
15652
|
if (child.type === 4) parseFilter(child, context);
|
|
15410
|
-
else if (child.type === 8) rewriteFilter(
|
|
15653
|
+
else if (child.type === 8) rewriteFilter(child, context);
|
|
15411
15654
|
else if (child.type === 5) rewriteFilter(child.content, context);
|
|
15412
15655
|
}
|
|
15413
15656
|
}
|
|
@@ -15766,6 +16009,14 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
15766
16009
|
const eventOptionModifiers = [];
|
|
15767
16010
|
for (let i = 0; i < modifiers.length; i++) {
|
|
15768
16011
|
const modifier = modifiers[i].content;
|
|
16012
|
+
if (modifier === "delegate") {
|
|
16013
|
+
if (context) {
|
|
16014
|
+
const error = /* @__PURE__ */ new SyntaxError(`.delegate modifier is only supported in Vapor components.`);
|
|
16015
|
+
error.loc = modifiers[i].loc;
|
|
16016
|
+
context.onWarn(error);
|
|
16017
|
+
}
|
|
16018
|
+
continue;
|
|
16019
|
+
}
|
|
15769
16020
|
if (modifier === "native" && context && checkCompatEnabled("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
|
|
15770
16021
|
else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
|
|
15771
16022
|
else {
|
|
@@ -15842,7 +16093,7 @@ function postTransformTransition(node, onError, hasMultipleChildren = defaultHas
|
|
|
15842
16093
|
source: ""
|
|
15843
16094
|
}));
|
|
15844
16095
|
const child = node.children[0];
|
|
15845
|
-
if (child.type === 1) {
|
|
16096
|
+
if (child.type === 1 && !findDir(child, "if")) {
|
|
15846
16097
|
for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
|
|
15847
16098
|
type: 6,
|
|
15848
16099
|
name: "persisted",
|
|
@@ -16128,4 +16379,4 @@ Vue.compile = compileToFunction;
|
|
|
16128
16379
|
var esm_index_default = Vue;
|
|
16129
16380
|
const configureCompat = Vue.configureCompat;
|
|
16130
16381
|
//#endregion
|
|
16131
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VueElement, VueElementBase, activate, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, configureCompat, createApp, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, esm_index_default as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, render, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, resolveTransitionProps, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, xlinkNS };
|
|
16382
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporSlot, VueElement, VueElementBase, activate, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, configureCompat, createApp, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, esm_index_default as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, parseEventName, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, render, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, resolveTransitionProps, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, xlinkNS };
|