@vue/runtime-dom 3.6.0-alpha.2 → 3.6.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-dom.cjs.js +133 -74
- package/dist/runtime-dom.cjs.prod.js +133 -71
- package/dist/runtime-dom.d.ts +655 -641
- package/dist/runtime-dom.esm-browser.js +824 -527
- package/dist/runtime-dom.esm-browser.prod.js +4 -3
- package/dist/runtime-dom.esm-bundler.js +136 -77
- package/dist/runtime-dom.global.js +824 -527
- package/dist/runtime-dom.global.prod.js +4 -3
- package/package.json +4 -4
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-alpha.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-alpha.3
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
var VueRuntimeDOM = (function (exports) {
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
10
9
|
// @__NO_SIDE_EFFECTS__
|
|
11
10
|
function makeMap(str) {
|
|
12
11
|
const map = /* @__PURE__ */ Object.create(null);
|
|
@@ -62,10 +61,10 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
62
61
|
);
|
|
63
62
|
const cacheStringFunction = (fn) => {
|
|
64
63
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
65
|
-
return (str) => {
|
|
64
|
+
return ((str) => {
|
|
66
65
|
const hit = cache[str];
|
|
67
66
|
return hit || (cache[str] = fn(str));
|
|
68
|
-
};
|
|
67
|
+
});
|
|
69
68
|
};
|
|
70
69
|
const camelizeRE = /-(\w)/g;
|
|
71
70
|
const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
@@ -238,6 +237,9 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
238
237
|
if ((key === "width" || key === "height") && (tagName === "IMG" || tagName === "VIDEO" || tagName === "CANVAS" || tagName === "SOURCE")) {
|
|
239
238
|
return true;
|
|
240
239
|
}
|
|
240
|
+
if (key === "sandbox" && tagName === "IFRAME") {
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
241
243
|
return false;
|
|
242
244
|
}
|
|
243
245
|
|
|
@@ -427,6 +429,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
427
429
|
const notifyBuffer = [];
|
|
428
430
|
let batchDepth = 0;
|
|
429
431
|
let activeSub = void 0;
|
|
432
|
+
let globalVersion = 0;
|
|
430
433
|
let notifyIndex = 0;
|
|
431
434
|
let notifyBufferLength = 0;
|
|
432
435
|
function setActiveSub(sub) {
|
|
@@ -449,17 +452,18 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
449
452
|
if (prevDep !== void 0 && prevDep.dep === dep) {
|
|
450
453
|
return;
|
|
451
454
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
sub.depsTail = nextDep;
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
455
|
+
const nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
|
|
456
|
+
if (nextDep !== void 0 && nextDep.dep === dep) {
|
|
457
|
+
nextDep.version = globalVersion;
|
|
458
|
+
sub.depsTail = nextDep;
|
|
459
|
+
return;
|
|
460
460
|
}
|
|
461
461
|
const prevSub = dep.subsTail;
|
|
462
|
+
if (prevSub !== void 0 && prevSub.version === globalVersion && prevSub.sub === sub) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
462
465
|
const newLink = sub.depsTail = dep.subsTail = {
|
|
466
|
+
version: globalVersion,
|
|
463
467
|
dep,
|
|
464
468
|
sub,
|
|
465
469
|
prevDep,
|
|
@@ -565,6 +569,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
565
569
|
} while (true);
|
|
566
570
|
}
|
|
567
571
|
function startTracking(sub) {
|
|
572
|
+
++globalVersion;
|
|
568
573
|
sub.depsTail = void 0;
|
|
569
574
|
sub.flags = sub.flags & -57 | 4 /* RecursedCheck */;
|
|
570
575
|
return setActiveSub(sub);
|
|
@@ -665,18 +670,12 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
665
670
|
} while (link2 !== void 0);
|
|
666
671
|
}
|
|
667
672
|
function isValidLink(checkLink, sub) {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
}
|
|
675
|
-
if (link2 === depsTail) {
|
|
676
|
-
break;
|
|
677
|
-
}
|
|
678
|
-
link2 = link2.nextDep;
|
|
679
|
-
} while (link2 !== void 0);
|
|
673
|
+
let link2 = sub.depsTail;
|
|
674
|
+
while (link2 !== void 0) {
|
|
675
|
+
if (link2 === checkLink) {
|
|
676
|
+
return true;
|
|
677
|
+
}
|
|
678
|
+
link2 = link2.prevDep;
|
|
680
679
|
}
|
|
681
680
|
return false;
|
|
682
681
|
}
|
|
@@ -916,7 +915,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
916
915
|
join(separator) {
|
|
917
916
|
return reactiveReadArray(this).join(separator);
|
|
918
917
|
},
|
|
919
|
-
// keys() iterator only reads `length`, no
|
|
918
|
+
// keys() iterator only reads `length`, no optimization required
|
|
920
919
|
lastIndexOf(...args) {
|
|
921
920
|
return searchProxy(this, "lastIndexOf", args);
|
|
922
921
|
},
|
|
@@ -968,7 +967,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
968
967
|
iter._next = iter.next;
|
|
969
968
|
iter.next = () => {
|
|
970
969
|
const result = iter._next();
|
|
971
|
-
if (result.
|
|
970
|
+
if (!result.done) {
|
|
972
971
|
result.value = wrapValue(result.value);
|
|
973
972
|
}
|
|
974
973
|
return result;
|
|
@@ -1099,7 +1098,8 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
1099
1098
|
return res;
|
|
1100
1099
|
}
|
|
1101
1100
|
if (isRef(res)) {
|
|
1102
|
-
|
|
1101
|
+
const value = targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
1102
|
+
return isReadonly2 && isObject(value) ? readonly(value) : value;
|
|
1103
1103
|
}
|
|
1104
1104
|
if (isObject(res)) {
|
|
1105
1105
|
return isReadonly2 ? readonly(res) : reactive(res);
|
|
@@ -1121,7 +1121,13 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
1123
1123
|
if (isOldValueReadonly) {
|
|
1124
|
-
|
|
1124
|
+
{
|
|
1125
|
+
warn$2(
|
|
1126
|
+
`Set operation on key "${String(key)}" failed: target is readonly.`,
|
|
1127
|
+
target[key]
|
|
1128
|
+
);
|
|
1129
|
+
}
|
|
1130
|
+
return true;
|
|
1125
1131
|
} else {
|
|
1126
1132
|
oldValue.value = value;
|
|
1127
1133
|
return true;
|
|
@@ -1266,7 +1272,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
1266
1272
|
get size() {
|
|
1267
1273
|
const target = this["__v_raw"];
|
|
1268
1274
|
!readonly && track(toRaw(target), "iterate", ITERATE_KEY);
|
|
1269
|
-
return
|
|
1275
|
+
return target.size;
|
|
1270
1276
|
},
|
|
1271
1277
|
has(key) {
|
|
1272
1278
|
const target = this["__v_raw"];
|
|
@@ -2269,11 +2275,11 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
2269
2275
|
if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
|
|
2270
2276
|
return value;
|
|
2271
2277
|
}
|
|
2272
|
-
seen = seen || /* @__PURE__ */ new
|
|
2273
|
-
if (seen.
|
|
2278
|
+
seen = seen || /* @__PURE__ */ new Map();
|
|
2279
|
+
if ((seen.get(value) || 0) >= depth) {
|
|
2274
2280
|
return value;
|
|
2275
2281
|
}
|
|
2276
|
-
seen.
|
|
2282
|
+
seen.set(value, depth);
|
|
2277
2283
|
depth--;
|
|
2278
2284
|
if (isRef(value)) {
|
|
2279
2285
|
traverse(value.value, depth, seen);
|
|
@@ -2819,8 +2825,10 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
2819
2825
|
instance.hmrRerender();
|
|
2820
2826
|
} else {
|
|
2821
2827
|
const i = instance;
|
|
2822
|
-
i.
|
|
2823
|
-
|
|
2828
|
+
if (!(i.effect.flags & 1024)) {
|
|
2829
|
+
i.renderCache = [];
|
|
2830
|
+
i.effect.run();
|
|
2831
|
+
}
|
|
2824
2832
|
}
|
|
2825
2833
|
nextTick(() => {
|
|
2826
2834
|
isHmrUpdating = false;
|
|
@@ -2862,7 +2870,10 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
2862
2870
|
if (parent.vapor) {
|
|
2863
2871
|
parent.hmrRerender();
|
|
2864
2872
|
} else {
|
|
2865
|
-
parent.effect.
|
|
2873
|
+
if (!(parent.effect.flags & 1024)) {
|
|
2874
|
+
parent.renderCache = [];
|
|
2875
|
+
parent.effect.run();
|
|
2876
|
+
}
|
|
2866
2877
|
}
|
|
2867
2878
|
nextTick(() => {
|
|
2868
2879
|
isHmrUpdating = false;
|
|
@@ -2972,7 +2983,6 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
2972
2983
|
_devtoolsComponentRemoved(component);
|
|
2973
2984
|
}
|
|
2974
2985
|
};
|
|
2975
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
2976
2986
|
// @__NO_SIDE_EFFECTS__
|
|
2977
2987
|
function createDevtoolsComponentHook(hook) {
|
|
2978
2988
|
return (component) => {
|
|
@@ -3158,9 +3168,6 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3158
3168
|
insert(mainAnchor, container, anchor);
|
|
3159
3169
|
const mount = (container2, anchor2) => {
|
|
3160
3170
|
if (shapeFlag & 16) {
|
|
3161
|
-
if (parentComponent && parentComponent.isCE) {
|
|
3162
|
-
parentComponent.ce._teleportTarget = container2;
|
|
3163
|
-
}
|
|
3164
3171
|
mountChildren(
|
|
3165
3172
|
children,
|
|
3166
3173
|
container2,
|
|
@@ -3182,6 +3189,9 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3182
3189
|
} else if (namespace !== "mathml" && isTargetMathML(target)) {
|
|
3183
3190
|
namespace = "mathml";
|
|
3184
3191
|
}
|
|
3192
|
+
if (parentComponent && parentComponent.isCE) {
|
|
3193
|
+
(parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3194
|
+
}
|
|
3185
3195
|
if (!disabled) {
|
|
3186
3196
|
mount(target, targetAnchor);
|
|
3187
3197
|
updateCssVars(n2, false);
|
|
@@ -3382,26 +3392,34 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3382
3392
|
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
|
|
3383
3393
|
o: { nextSibling, parentNode, querySelector, insert, createText }
|
|
3384
3394
|
}, hydrateChildren) {
|
|
3395
|
+
function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
|
|
3396
|
+
vnode2.anchor = hydrateChildren(
|
|
3397
|
+
nextSibling(node2),
|
|
3398
|
+
vnode2,
|
|
3399
|
+
parentNode(node2),
|
|
3400
|
+
parentComponent,
|
|
3401
|
+
parentSuspense,
|
|
3402
|
+
slotScopeIds,
|
|
3403
|
+
optimized
|
|
3404
|
+
);
|
|
3405
|
+
vnode2.targetStart = targetStart;
|
|
3406
|
+
vnode2.targetAnchor = targetAnchor;
|
|
3407
|
+
}
|
|
3385
3408
|
const target = vnode.target = resolveTarget(
|
|
3386
3409
|
vnode.props,
|
|
3387
3410
|
querySelector
|
|
3388
3411
|
);
|
|
3412
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3389
3413
|
if (target) {
|
|
3390
|
-
const disabled = isTeleportDisabled(vnode.props);
|
|
3391
3414
|
const targetNode = target._lpa || target.firstChild;
|
|
3392
3415
|
if (vnode.shapeFlag & 16) {
|
|
3393
3416
|
if (disabled) {
|
|
3394
|
-
|
|
3395
|
-
|
|
3417
|
+
hydrateDisabledTeleport(
|
|
3418
|
+
node,
|
|
3396
3419
|
vnode,
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
parentSuspense,
|
|
3400
|
-
slotScopeIds,
|
|
3401
|
-
optimized
|
|
3420
|
+
targetNode,
|
|
3421
|
+
targetNode && nextSibling(targetNode)
|
|
3402
3422
|
);
|
|
3403
|
-
vnode.targetStart = targetNode;
|
|
3404
|
-
vnode.targetAnchor = targetNode && nextSibling(targetNode);
|
|
3405
3423
|
} else {
|
|
3406
3424
|
vnode.anchor = nextSibling(node);
|
|
3407
3425
|
let targetAnchor = targetNode;
|
|
@@ -3432,6 +3450,10 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3432
3450
|
}
|
|
3433
3451
|
}
|
|
3434
3452
|
updateCssVars(vnode, disabled);
|
|
3453
|
+
} else if (disabled) {
|
|
3454
|
+
if (vnode.shapeFlag & 16) {
|
|
3455
|
+
hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
|
|
3456
|
+
}
|
|
3435
3457
|
}
|
|
3436
3458
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
3437
3459
|
}
|
|
@@ -3472,7 +3494,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3472
3494
|
isMounted: false,
|
|
3473
3495
|
isLeaving: false,
|
|
3474
3496
|
isUnmounting: false,
|
|
3475
|
-
|
|
3497
|
+
leavingNodes: /* @__PURE__ */ new Map()
|
|
3476
3498
|
};
|
|
3477
3499
|
onMounted(() => {
|
|
3478
3500
|
state.isMounted = true;
|
|
@@ -3504,7 +3526,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3504
3526
|
onAppearCancelled: TransitionHookValidator
|
|
3505
3527
|
};
|
|
3506
3528
|
const recursiveGetSubtree = (instance) => {
|
|
3507
|
-
const subTree = instance.subTree;
|
|
3529
|
+
const subTree = instance.type.__vapor ? instance.block : instance.subTree;
|
|
3508
3530
|
return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
|
|
3509
3531
|
};
|
|
3510
3532
|
const BaseTransitionImpl = {
|
|
@@ -3521,9 +3543,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3521
3543
|
const child = findNonCommentChild(children);
|
|
3522
3544
|
const rawProps = toRaw(props);
|
|
3523
3545
|
const { mode } = rawProps;
|
|
3524
|
-
|
|
3525
|
-
warn$1(`invalid <transition> mode: ${mode}`);
|
|
3526
|
-
}
|
|
3546
|
+
checkTransitionMode(mode);
|
|
3527
3547
|
if (state.isLeaving) {
|
|
3528
3548
|
return emptyPlaceholder(child);
|
|
3529
3549
|
}
|
|
@@ -3543,7 +3563,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3543
3563
|
setTransitionHooks(innerChild, enterHooks);
|
|
3544
3564
|
}
|
|
3545
3565
|
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
3546
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(
|
|
3566
|
+
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
3547
3567
|
let leavingHooks = resolveTransitionHooks(
|
|
3548
3568
|
oldInnerChild,
|
|
3549
3569
|
rawProps,
|
|
@@ -3612,15 +3632,53 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3612
3632
|
}
|
|
3613
3633
|
const BaseTransition = BaseTransitionImpl;
|
|
3614
3634
|
function getLeavingNodesForType(state, vnode) {
|
|
3615
|
-
const {
|
|
3616
|
-
let leavingVNodesCache =
|
|
3635
|
+
const { leavingNodes } = state;
|
|
3636
|
+
let leavingVNodesCache = leavingNodes.get(vnode.type);
|
|
3617
3637
|
if (!leavingVNodesCache) {
|
|
3618
3638
|
leavingVNodesCache = /* @__PURE__ */ Object.create(null);
|
|
3619
|
-
|
|
3639
|
+
leavingNodes.set(vnode.type, leavingVNodesCache);
|
|
3620
3640
|
}
|
|
3621
3641
|
return leavingVNodesCache;
|
|
3622
3642
|
}
|
|
3623
3643
|
function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
3644
|
+
const key = String(vnode.key);
|
|
3645
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3646
|
+
const context = {
|
|
3647
|
+
setLeavingNodeCache: () => {
|
|
3648
|
+
leavingVNodesCache[key] = vnode;
|
|
3649
|
+
},
|
|
3650
|
+
unsetLeavingNodeCache: () => {
|
|
3651
|
+
if (leavingVNodesCache[key] === vnode) {
|
|
3652
|
+
delete leavingVNodesCache[key];
|
|
3653
|
+
}
|
|
3654
|
+
},
|
|
3655
|
+
earlyRemove: () => {
|
|
3656
|
+
const leavingVNode = leavingVNodesCache[key];
|
|
3657
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
|
|
3658
|
+
leavingVNode.el[leaveCbKey]();
|
|
3659
|
+
}
|
|
3660
|
+
},
|
|
3661
|
+
cloneHooks: (vnode2) => {
|
|
3662
|
+
const hooks = resolveTransitionHooks(
|
|
3663
|
+
vnode2,
|
|
3664
|
+
props,
|
|
3665
|
+
state,
|
|
3666
|
+
instance,
|
|
3667
|
+
postClone
|
|
3668
|
+
);
|
|
3669
|
+
if (postClone) postClone(hooks);
|
|
3670
|
+
return hooks;
|
|
3671
|
+
}
|
|
3672
|
+
};
|
|
3673
|
+
return baseResolveTransitionHooks(context, props, state, instance);
|
|
3674
|
+
}
|
|
3675
|
+
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
3676
|
+
const {
|
|
3677
|
+
setLeavingNodeCache,
|
|
3678
|
+
unsetLeavingNodeCache,
|
|
3679
|
+
earlyRemove,
|
|
3680
|
+
cloneHooks
|
|
3681
|
+
} = context;
|
|
3624
3682
|
const {
|
|
3625
3683
|
appear,
|
|
3626
3684
|
mode,
|
|
@@ -3638,8 +3696,6 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3638
3696
|
onAfterAppear,
|
|
3639
3697
|
onAppearCancelled
|
|
3640
3698
|
} = props;
|
|
3641
|
-
const key = String(vnode.key);
|
|
3642
|
-
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3643
3699
|
const callHook = (hook, args) => {
|
|
3644
3700
|
hook && callWithAsyncErrorHandling(
|
|
3645
3701
|
hook,
|
|
@@ -3675,10 +3731,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3675
3731
|
/* cancelled */
|
|
3676
3732
|
);
|
|
3677
3733
|
}
|
|
3678
|
-
|
|
3679
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
|
|
3680
|
-
leavingVNode.el[leaveCbKey]();
|
|
3681
|
-
}
|
|
3734
|
+
earlyRemove();
|
|
3682
3735
|
callHook(hook, [el]);
|
|
3683
3736
|
},
|
|
3684
3737
|
enter(el) {
|
|
@@ -3715,7 +3768,6 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3715
3768
|
}
|
|
3716
3769
|
},
|
|
3717
3770
|
leave(el, remove) {
|
|
3718
|
-
const key2 = String(vnode.key);
|
|
3719
3771
|
if (el[enterCbKey$1]) {
|
|
3720
3772
|
el[enterCbKey$1](
|
|
3721
3773
|
true
|
|
@@ -3737,27 +3789,17 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3737
3789
|
callHook(onAfterLeave, [el]);
|
|
3738
3790
|
}
|
|
3739
3791
|
el[leaveCbKey] = void 0;
|
|
3740
|
-
|
|
3741
|
-
delete leavingVNodesCache[key2];
|
|
3742
|
-
}
|
|
3792
|
+
unsetLeavingNodeCache(el);
|
|
3743
3793
|
};
|
|
3744
|
-
|
|
3794
|
+
setLeavingNodeCache(el);
|
|
3745
3795
|
if (onLeave) {
|
|
3746
3796
|
callAsyncHook(onLeave, [el, done]);
|
|
3747
3797
|
} else {
|
|
3748
3798
|
done();
|
|
3749
3799
|
}
|
|
3750
3800
|
},
|
|
3751
|
-
clone(
|
|
3752
|
-
|
|
3753
|
-
vnode2,
|
|
3754
|
-
props,
|
|
3755
|
-
state,
|
|
3756
|
-
instance,
|
|
3757
|
-
postClone
|
|
3758
|
-
);
|
|
3759
|
-
if (postClone) postClone(hooks2);
|
|
3760
|
-
return hooks2;
|
|
3801
|
+
clone(node) {
|
|
3802
|
+
return cloneHooks(node);
|
|
3761
3803
|
}
|
|
3762
3804
|
};
|
|
3763
3805
|
return hooks;
|
|
@@ -3791,8 +3833,15 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3791
3833
|
}
|
|
3792
3834
|
function setTransitionHooks(vnode, hooks) {
|
|
3793
3835
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3794
|
-
vnode.
|
|
3795
|
-
|
|
3836
|
+
if (vnode.type.__vapor) {
|
|
3837
|
+
getVaporInterface(vnode.component, vnode).setTransitionHooks(
|
|
3838
|
+
vnode.component,
|
|
3839
|
+
hooks
|
|
3840
|
+
);
|
|
3841
|
+
} else {
|
|
3842
|
+
vnode.transition = hooks;
|
|
3843
|
+
setTransitionHooks(vnode.component.subTree, hooks);
|
|
3844
|
+
}
|
|
3796
3845
|
} else if (vnode.shapeFlag & 128) {
|
|
3797
3846
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3798
3847
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
@@ -3822,8 +3871,12 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3822
3871
|
}
|
|
3823
3872
|
return ret;
|
|
3824
3873
|
}
|
|
3874
|
+
function checkTransitionMode(mode) {
|
|
3875
|
+
if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
|
|
3876
|
+
warn$1(`invalid <transition> mode: ${mode}`);
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3825
3879
|
|
|
3826
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
3827
3880
|
// @__NO_SIDE_EFFECTS__
|
|
3828
3881
|
function defineComponent(options, extraOptions) {
|
|
3829
3882
|
return isFunction(options) ? (
|
|
@@ -3876,6 +3929,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3876
3929
|
return ret;
|
|
3877
3930
|
}
|
|
3878
3931
|
|
|
3932
|
+
const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
|
|
3879
3933
|
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
3880
3934
|
if (isArray(rawRef)) {
|
|
3881
3935
|
rawRef.forEach(
|
|
@@ -3907,28 +3961,23 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3907
3961
|
const oldRef = oldRawRef && oldRawRef.r;
|
|
3908
3962
|
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
3909
3963
|
const setupState = owner.setupState;
|
|
3910
|
-
const
|
|
3911
|
-
const
|
|
3912
|
-
|
|
3913
|
-
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
3914
|
-
warn$1(
|
|
3915
|
-
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
3916
|
-
);
|
|
3917
|
-
}
|
|
3918
|
-
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
3919
|
-
return false;
|
|
3920
|
-
}
|
|
3921
|
-
}
|
|
3922
|
-
return hasOwn(rawSetupState, key);
|
|
3964
|
+
const canSetSetupRef = createCanSetSetupRefChecker(setupState);
|
|
3965
|
+
const canSetRef = (ref2) => {
|
|
3966
|
+
return !knownTemplateRefs.has(ref2);
|
|
3923
3967
|
};
|
|
3924
3968
|
if (oldRef != null && oldRef !== ref) {
|
|
3969
|
+
invalidatePendingSetRef(oldRawRef);
|
|
3925
3970
|
if (isString(oldRef)) {
|
|
3926
3971
|
refs[oldRef] = null;
|
|
3927
3972
|
if (canSetSetupRef(oldRef)) {
|
|
3928
3973
|
setupState[oldRef] = null;
|
|
3929
3974
|
}
|
|
3930
3975
|
} else if (isRef(oldRef)) {
|
|
3931
|
-
oldRef
|
|
3976
|
+
if (canSetRef(oldRef)) {
|
|
3977
|
+
oldRef.value = null;
|
|
3978
|
+
}
|
|
3979
|
+
const oldRawRefAtom = oldRawRef;
|
|
3980
|
+
if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
|
|
3932
3981
|
}
|
|
3933
3982
|
}
|
|
3934
3983
|
if (isFunction(ref)) {
|
|
@@ -3939,7 +3988,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3939
3988
|
if (_isString || _isRef) {
|
|
3940
3989
|
const doSet = () => {
|
|
3941
3990
|
if (rawRef.f) {
|
|
3942
|
-
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
|
|
3991
|
+
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
3943
3992
|
if (isUnmount) {
|
|
3944
3993
|
isArray(existing) && remove(existing, refValue);
|
|
3945
3994
|
} else {
|
|
@@ -3950,8 +3999,11 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3950
3999
|
setupState[ref] = refs[ref];
|
|
3951
4000
|
}
|
|
3952
4001
|
} else {
|
|
3953
|
-
|
|
3954
|
-
if (
|
|
4002
|
+
const newVal = [refValue];
|
|
4003
|
+
if (canSetRef(ref)) {
|
|
4004
|
+
ref.value = newVal;
|
|
4005
|
+
}
|
|
4006
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
3955
4007
|
}
|
|
3956
4008
|
} else if (!existing.includes(refValue)) {
|
|
3957
4009
|
existing.push(refValue);
|
|
@@ -3963,15 +4015,23 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3963
4015
|
setupState[ref] = value;
|
|
3964
4016
|
}
|
|
3965
4017
|
} else if (_isRef) {
|
|
3966
|
-
ref
|
|
4018
|
+
if (canSetRef(ref)) {
|
|
4019
|
+
ref.value = value;
|
|
4020
|
+
}
|
|
3967
4021
|
if (rawRef.k) refs[rawRef.k] = value;
|
|
3968
4022
|
} else {
|
|
3969
4023
|
warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
3970
4024
|
}
|
|
3971
4025
|
};
|
|
3972
4026
|
if (value) {
|
|
3973
|
-
|
|
4027
|
+
const job = () => {
|
|
4028
|
+
doSet();
|
|
4029
|
+
pendingSetRefMap.delete(rawRef);
|
|
4030
|
+
};
|
|
4031
|
+
pendingSetRefMap.set(rawRef, job);
|
|
4032
|
+
queuePostRenderEffect(job, -1, parentSuspense);
|
|
3974
4033
|
} else {
|
|
4034
|
+
invalidatePendingSetRef(rawRef);
|
|
3975
4035
|
doSet();
|
|
3976
4036
|
}
|
|
3977
4037
|
} else {
|
|
@@ -3979,6 +4039,29 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
3979
4039
|
}
|
|
3980
4040
|
}
|
|
3981
4041
|
}
|
|
4042
|
+
function createCanSetSetupRefChecker(setupState) {
|
|
4043
|
+
const rawSetupState = toRaw(setupState);
|
|
4044
|
+
return setupState === void 0 || setupState === EMPTY_OBJ ? NO : (key) => {
|
|
4045
|
+
{
|
|
4046
|
+
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
4047
|
+
warn$1(
|
|
4048
|
+
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
4049
|
+
);
|
|
4050
|
+
}
|
|
4051
|
+
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
4052
|
+
return false;
|
|
4053
|
+
}
|
|
4054
|
+
}
|
|
4055
|
+
return hasOwn(rawSetupState, key);
|
|
4056
|
+
};
|
|
4057
|
+
}
|
|
4058
|
+
function invalidatePendingSetRef(rawRef) {
|
|
4059
|
+
const pendingSetRef = pendingSetRefMap.get(rawRef);
|
|
4060
|
+
if (pendingSetRef) {
|
|
4061
|
+
pendingSetRef.flags |= 4;
|
|
4062
|
+
pendingSetRefMap.delete(rawRef);
|
|
4063
|
+
}
|
|
4064
|
+
}
|
|
3982
4065
|
|
|
3983
4066
|
let hasLoggedMismatchError = false;
|
|
3984
4067
|
const logMismatchError = () => {
|
|
@@ -4123,6 +4206,12 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
4123
4206
|
);
|
|
4124
4207
|
}
|
|
4125
4208
|
break;
|
|
4209
|
+
case VaporSlot:
|
|
4210
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(
|
|
4211
|
+
vnode,
|
|
4212
|
+
node
|
|
4213
|
+
);
|
|
4214
|
+
break;
|
|
4126
4215
|
default:
|
|
4127
4216
|
if (shapeFlag & 1) {
|
|
4128
4217
|
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
|
|
@@ -4138,9 +4227,6 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
4138
4227
|
);
|
|
4139
4228
|
}
|
|
4140
4229
|
} else if (shapeFlag & 6) {
|
|
4141
|
-
if (vnode.type.__vapor) {
|
|
4142
|
-
throw new Error("Vapor component hydration is not supported yet.");
|
|
4143
|
-
}
|
|
4144
4230
|
vnode.slotScopeIds = slotScopeIds;
|
|
4145
4231
|
const container = parentNode(node);
|
|
4146
4232
|
if (isFragmentStart) {
|
|
@@ -4150,15 +4236,25 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
4150
4236
|
} else {
|
|
4151
4237
|
nextNode = nextSibling(node);
|
|
4152
4238
|
}
|
|
4153
|
-
|
|
4154
|
-
vnode
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4239
|
+
if (vnode.type.__vapor) {
|
|
4240
|
+
getVaporInterface(parentComponent, vnode).hydrate(
|
|
4241
|
+
vnode,
|
|
4242
|
+
node,
|
|
4243
|
+
container,
|
|
4244
|
+
null,
|
|
4245
|
+
parentComponent
|
|
4246
|
+
);
|
|
4247
|
+
} else {
|
|
4248
|
+
mountComponent(
|
|
4249
|
+
vnode,
|
|
4250
|
+
container,
|
|
4251
|
+
null,
|
|
4252
|
+
parentComponent,
|
|
4253
|
+
parentSuspense,
|
|
4254
|
+
getContainerType(container),
|
|
4255
|
+
optimized
|
|
4256
|
+
);
|
|
4257
|
+
}
|
|
4162
4258
|
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
|
|
4163
4259
|
let subTree;
|
|
4164
4260
|
if (isFragmentStart) {
|
|
@@ -4243,7 +4339,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
4243
4339
|
);
|
|
4244
4340
|
let hasWarned = false;
|
|
4245
4341
|
while (next) {
|
|
4246
|
-
if (!isMismatchAllowed(el, 1
|
|
4342
|
+
if (!isMismatchAllowed(el, 1)) {
|
|
4247
4343
|
if (!hasWarned) {
|
|
4248
4344
|
warn$1(
|
|
4249
4345
|
`Hydration children mismatch on`,
|
|
@@ -4264,14 +4360,16 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4264
4360
|
if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
|
|
4265
4361
|
clientText = clientText.slice(1);
|
|
4266
4362
|
}
|
|
4267
|
-
|
|
4268
|
-
|
|
4363
|
+
const { textContent } = el;
|
|
4364
|
+
if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
|
|
4365
|
+
textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
|
|
4366
|
+
if (!isMismatchAllowed(el, 0)) {
|
|
4269
4367
|
warn$1(
|
|
4270
4368
|
`Hydration text content mismatch on`,
|
|
4271
4369
|
el,
|
|
4272
4370
|
`
|
|
4273
|
-
- rendered on server: ${
|
|
4274
|
-
- expected on client: ${
|
|
4371
|
+
- rendered on server: ${textContent}
|
|
4372
|
+
- expected on client: ${clientText}`
|
|
4275
4373
|
);
|
|
4276
4374
|
logMismatchError();
|
|
4277
4375
|
}
|
|
@@ -4347,7 +4445,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4347
4445
|
} else if (isText && !vnode.children) {
|
|
4348
4446
|
insert(vnode.el = createText(""), container);
|
|
4349
4447
|
} else {
|
|
4350
|
-
if (!isMismatchAllowed(container, 1
|
|
4448
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
4351
4449
|
if (!hasWarned) {
|
|
4352
4450
|
warn$1(
|
|
4353
4451
|
`Hydration children mismatch on`,
|
|
@@ -4397,7 +4495,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4397
4495
|
}
|
|
4398
4496
|
};
|
|
4399
4497
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
4400
|
-
if (!isMismatchAllowed(node.parentElement, 1
|
|
4498
|
+
if (!isMismatchAllowed(node.parentElement, 1)) {
|
|
4401
4499
|
warn$1(
|
|
4402
4500
|
`Hydration node mismatch:
|
|
4403
4501
|
- rendered on server:`,
|
|
@@ -4470,11 +4568,11 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4470
4568
|
parent = parent.parent;
|
|
4471
4569
|
}
|
|
4472
4570
|
};
|
|
4473
|
-
const isTemplateNode = (node) => {
|
|
4474
|
-
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
4475
|
-
};
|
|
4476
4571
|
return [hydrate, hydrateNode];
|
|
4477
4572
|
}
|
|
4573
|
+
const isTemplateNode = (node) => {
|
|
4574
|
+
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
4575
|
+
};
|
|
4478
4576
|
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
4479
4577
|
let mismatchType;
|
|
4480
4578
|
let mismatchKey;
|
|
@@ -4489,7 +4587,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4489
4587
|
}
|
|
4490
4588
|
expected = normalizeClass(clientValue);
|
|
4491
4589
|
if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
|
|
4492
|
-
mismatchType = 2
|
|
4590
|
+
mismatchType = 2;
|
|
4493
4591
|
mismatchKey = `class`;
|
|
4494
4592
|
}
|
|
4495
4593
|
} else if (key === "style") {
|
|
@@ -4508,31 +4606,43 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4508
4606
|
resolveCssVars(instance, vnode, expectedMap);
|
|
4509
4607
|
}
|
|
4510
4608
|
if (!isMapEqual(actualMap, expectedMap)) {
|
|
4511
|
-
mismatchType = 3
|
|
4609
|
+
mismatchType = 3;
|
|
4512
4610
|
mismatchKey = "style";
|
|
4513
4611
|
}
|
|
4514
|
-
} else if (
|
|
4515
|
-
|
|
4516
|
-
actual = el.hasAttribute(key);
|
|
4517
|
-
expected = includeBooleanAttr(clientValue);
|
|
4518
|
-
} else if (clientValue == null) {
|
|
4519
|
-
actual = el.hasAttribute(key);
|
|
4520
|
-
expected = false;
|
|
4521
|
-
} else {
|
|
4522
|
-
if (el.hasAttribute(key)) {
|
|
4523
|
-
actual = el.getAttribute(key);
|
|
4524
|
-
} else if (key === "value" && el.tagName === "TEXTAREA") {
|
|
4525
|
-
actual = el.value;
|
|
4526
|
-
} else {
|
|
4527
|
-
actual = false;
|
|
4528
|
-
}
|
|
4529
|
-
expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
|
|
4530
|
-
}
|
|
4612
|
+
} else if (isValidHtmlOrSvgAttribute(el, key)) {
|
|
4613
|
+
({ actual, expected } = getAttributeMismatch(el, key, clientValue));
|
|
4531
4614
|
if (actual !== expected) {
|
|
4532
|
-
mismatchType = 4
|
|
4615
|
+
mismatchType = 4;
|
|
4533
4616
|
mismatchKey = key;
|
|
4534
4617
|
}
|
|
4535
4618
|
}
|
|
4619
|
+
return warnPropMismatch(el, mismatchKey, mismatchType, actual, expected);
|
|
4620
|
+
}
|
|
4621
|
+
function getAttributeMismatch(el, key, clientValue) {
|
|
4622
|
+
let actual;
|
|
4623
|
+
let expected;
|
|
4624
|
+
if (isBooleanAttr(key)) {
|
|
4625
|
+
actual = el.hasAttribute(key);
|
|
4626
|
+
expected = includeBooleanAttr(clientValue);
|
|
4627
|
+
} else if (clientValue == null) {
|
|
4628
|
+
actual = el.hasAttribute(key);
|
|
4629
|
+
expected = false;
|
|
4630
|
+
} else {
|
|
4631
|
+
if (el.hasAttribute(key)) {
|
|
4632
|
+
actual = el.getAttribute(key);
|
|
4633
|
+
} else if (key === "value" && el.tagName === "TEXTAREA") {
|
|
4634
|
+
actual = el.value;
|
|
4635
|
+
} else {
|
|
4636
|
+
actual = false;
|
|
4637
|
+
}
|
|
4638
|
+
expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
|
|
4639
|
+
}
|
|
4640
|
+
return { actual, expected };
|
|
4641
|
+
}
|
|
4642
|
+
function isValidHtmlOrSvgAttribute(el, key) {
|
|
4643
|
+
return el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key));
|
|
4644
|
+
}
|
|
4645
|
+
function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
|
|
4536
4646
|
if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
|
|
4537
4647
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
4538
4648
|
const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
|
|
@@ -4604,14 +4714,14 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4604
4714
|
}
|
|
4605
4715
|
const allowMismatchAttr = "data-allow-mismatch";
|
|
4606
4716
|
const MismatchTypeString = {
|
|
4607
|
-
[0
|
|
4608
|
-
[1
|
|
4609
|
-
[2
|
|
4610
|
-
[3
|
|
4611
|
-
[4
|
|
4717
|
+
[0]: "text",
|
|
4718
|
+
[1]: "children",
|
|
4719
|
+
[2]: "class",
|
|
4720
|
+
[3]: "style",
|
|
4721
|
+
[4]: "attribute"
|
|
4612
4722
|
};
|
|
4613
4723
|
function isMismatchAllowed(el, allowedType) {
|
|
4614
|
-
if (allowedType === 0
|
|
4724
|
+
if (allowedType === 0 || allowedType === 1) {
|
|
4615
4725
|
while (el && !el.hasAttribute(allowMismatchAttr)) {
|
|
4616
4726
|
el = el.parentElement;
|
|
4617
4727
|
}
|
|
@@ -4623,7 +4733,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4623
4733
|
return true;
|
|
4624
4734
|
} else {
|
|
4625
4735
|
const list = allowedAttr.split(",");
|
|
4626
|
-
if (allowedType === 0
|
|
4736
|
+
if (allowedType === 0 && list.includes("children")) {
|
|
4627
4737
|
return true;
|
|
4628
4738
|
}
|
|
4629
4739
|
return list.includes(MismatchTypeString[allowedType]);
|
|
@@ -4680,7 +4790,9 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4680
4790
|
hasHydrated = true;
|
|
4681
4791
|
teardown();
|
|
4682
4792
|
hydrate();
|
|
4683
|
-
|
|
4793
|
+
if (!(`$evt${e.type}` in e.target)) {
|
|
4794
|
+
e.target.dispatchEvent(new e.constructor(e.type, e));
|
|
4795
|
+
}
|
|
4684
4796
|
}
|
|
4685
4797
|
};
|
|
4686
4798
|
const teardown = () => {
|
|
@@ -4722,104 +4834,46 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4722
4834
|
}
|
|
4723
4835
|
|
|
4724
4836
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
4725
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
4726
4837
|
// @__NO_SIDE_EFFECTS__
|
|
4727
4838
|
function defineAsyncComponent(source) {
|
|
4728
|
-
if (isFunction(source)) {
|
|
4729
|
-
source = { loader: source };
|
|
4730
|
-
}
|
|
4731
4839
|
const {
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
let retries = 0;
|
|
4745
|
-
const retry = () => {
|
|
4746
|
-
retries++;
|
|
4747
|
-
pendingRequest = null;
|
|
4748
|
-
return load();
|
|
4749
|
-
};
|
|
4750
|
-
const load = () => {
|
|
4751
|
-
let thisRequest;
|
|
4752
|
-
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
4753
|
-
err = err instanceof Error ? err : new Error(String(err));
|
|
4754
|
-
if (userOnError) {
|
|
4755
|
-
return new Promise((resolve, reject) => {
|
|
4756
|
-
const userRetry = () => resolve(retry());
|
|
4757
|
-
const userFail = () => reject(err);
|
|
4758
|
-
userOnError(err, userRetry, userFail, retries + 1);
|
|
4759
|
-
});
|
|
4760
|
-
} else {
|
|
4761
|
-
throw err;
|
|
4762
|
-
}
|
|
4763
|
-
}).then((comp) => {
|
|
4764
|
-
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
4765
|
-
return pendingRequest;
|
|
4766
|
-
}
|
|
4767
|
-
if (!comp) {
|
|
4768
|
-
warn$1(
|
|
4769
|
-
`Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
|
|
4770
|
-
);
|
|
4771
|
-
}
|
|
4772
|
-
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
4773
|
-
comp = comp.default;
|
|
4774
|
-
}
|
|
4775
|
-
if (comp && !isObject(comp) && !isFunction(comp)) {
|
|
4776
|
-
throw new Error(`Invalid async component load result: ${comp}`);
|
|
4777
|
-
}
|
|
4778
|
-
resolvedComp = comp;
|
|
4779
|
-
return comp;
|
|
4780
|
-
}));
|
|
4781
|
-
};
|
|
4840
|
+
load,
|
|
4841
|
+
getResolvedComp,
|
|
4842
|
+
setPendingRequest,
|
|
4843
|
+
source: {
|
|
4844
|
+
loadingComponent,
|
|
4845
|
+
errorComponent,
|
|
4846
|
+
delay,
|
|
4847
|
+
hydrate: hydrateStrategy,
|
|
4848
|
+
timeout,
|
|
4849
|
+
suspensible = true
|
|
4850
|
+
}
|
|
4851
|
+
} = createAsyncComponentContext(source);
|
|
4782
4852
|
return defineComponent({
|
|
4783
4853
|
name: "AsyncComponentWrapper",
|
|
4784
4854
|
__asyncLoader: load,
|
|
4785
4855
|
__asyncHydrate(el, instance, hydrate) {
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
}
|
|
4795
|
-
hydrate();
|
|
4796
|
-
};
|
|
4797
|
-
const teardown = hydrateStrategy(
|
|
4798
|
-
performHydrate,
|
|
4799
|
-
(cb) => forEachElement(el, cb)
|
|
4800
|
-
);
|
|
4801
|
-
if (teardown) {
|
|
4802
|
-
(instance.bum || (instance.bum = [])).push(teardown);
|
|
4803
|
-
}
|
|
4804
|
-
(instance.u || (instance.u = [])).push(() => patched = true);
|
|
4805
|
-
} : hydrate;
|
|
4806
|
-
if (resolvedComp) {
|
|
4807
|
-
doHydrate();
|
|
4808
|
-
} else {
|
|
4809
|
-
load().then(() => !instance.isUnmounted && doHydrate());
|
|
4810
|
-
}
|
|
4856
|
+
performAsyncHydrate(
|
|
4857
|
+
el,
|
|
4858
|
+
instance,
|
|
4859
|
+
hydrate,
|
|
4860
|
+
getResolvedComp,
|
|
4861
|
+
load,
|
|
4862
|
+
hydrateStrategy
|
|
4863
|
+
);
|
|
4811
4864
|
},
|
|
4812
4865
|
get __asyncResolved() {
|
|
4813
|
-
return
|
|
4866
|
+
return getResolvedComp();
|
|
4814
4867
|
},
|
|
4815
4868
|
setup() {
|
|
4816
4869
|
const instance = currentInstance;
|
|
4817
4870
|
markAsyncBoundary(instance);
|
|
4871
|
+
let resolvedComp = getResolvedComp();
|
|
4818
4872
|
if (resolvedComp) {
|
|
4819
4873
|
return () => createInnerComp(resolvedComp, instance);
|
|
4820
4874
|
}
|
|
4821
4875
|
const onError = (err) => {
|
|
4822
|
-
|
|
4876
|
+
setPendingRequest(null);
|
|
4823
4877
|
handleError(
|
|
4824
4878
|
err,
|
|
4825
4879
|
instance,
|
|
@@ -4837,25 +4891,11 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4837
4891
|
}) : null;
|
|
4838
4892
|
});
|
|
4839
4893
|
}
|
|
4840
|
-
const loaded =
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
delayed.value = false;
|
|
4846
|
-
}, delay);
|
|
4847
|
-
}
|
|
4848
|
-
if (timeout != null) {
|
|
4849
|
-
setTimeout(() => {
|
|
4850
|
-
if (!loaded.value && !error.value) {
|
|
4851
|
-
const err = new Error(
|
|
4852
|
-
`Async component timed out after ${timeout}ms.`
|
|
4853
|
-
);
|
|
4854
|
-
onError(err);
|
|
4855
|
-
error.value = err;
|
|
4856
|
-
}
|
|
4857
|
-
}, timeout);
|
|
4858
|
-
}
|
|
4894
|
+
const { loaded, error, delayed } = useAsyncComponentState(
|
|
4895
|
+
delay,
|
|
4896
|
+
timeout,
|
|
4897
|
+
onError
|
|
4898
|
+
);
|
|
4859
4899
|
load().then(() => {
|
|
4860
4900
|
loaded.value = true;
|
|
4861
4901
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
|
|
@@ -4866,6 +4906,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4866
4906
|
error.value = err;
|
|
4867
4907
|
});
|
|
4868
4908
|
return () => {
|
|
4909
|
+
resolvedComp = getResolvedComp();
|
|
4869
4910
|
if (loaded.value && resolvedComp) {
|
|
4870
4911
|
return createInnerComp(resolvedComp, instance);
|
|
4871
4912
|
} else if (error.value && errorComponent) {
|
|
@@ -4873,19 +4914,124 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4873
4914
|
error: error.value
|
|
4874
4915
|
});
|
|
4875
4916
|
} else if (loadingComponent && !delayed.value) {
|
|
4876
|
-
return
|
|
4917
|
+
return createInnerComp(
|
|
4918
|
+
loadingComponent,
|
|
4919
|
+
instance
|
|
4920
|
+
);
|
|
4877
4921
|
}
|
|
4878
4922
|
};
|
|
4879
4923
|
}
|
|
4880
|
-
});
|
|
4881
|
-
}
|
|
4882
|
-
function createInnerComp(comp, parent) {
|
|
4883
|
-
const { ref: ref2, props, children, ce } = parent.vnode;
|
|
4884
|
-
const vnode = createVNode(comp, props, children);
|
|
4885
|
-
vnode.ref = ref2;
|
|
4886
|
-
vnode.ce = ce;
|
|
4887
|
-
delete parent.vnode.ce;
|
|
4888
|
-
return vnode;
|
|
4924
|
+
});
|
|
4925
|
+
}
|
|
4926
|
+
function createInnerComp(comp, parent) {
|
|
4927
|
+
const { ref: ref2, props, children, ce } = parent.vnode;
|
|
4928
|
+
const vnode = createVNode(comp, props, children);
|
|
4929
|
+
vnode.ref = ref2;
|
|
4930
|
+
vnode.ce = ce;
|
|
4931
|
+
delete parent.vnode.ce;
|
|
4932
|
+
return vnode;
|
|
4933
|
+
}
|
|
4934
|
+
function createAsyncComponentContext(source) {
|
|
4935
|
+
if (isFunction(source)) {
|
|
4936
|
+
source = { loader: source };
|
|
4937
|
+
}
|
|
4938
|
+
const { loader, onError: userOnError } = source;
|
|
4939
|
+
let pendingRequest = null;
|
|
4940
|
+
let resolvedComp;
|
|
4941
|
+
let retries = 0;
|
|
4942
|
+
const retry = () => {
|
|
4943
|
+
retries++;
|
|
4944
|
+
pendingRequest = null;
|
|
4945
|
+
return load();
|
|
4946
|
+
};
|
|
4947
|
+
const load = () => {
|
|
4948
|
+
let thisRequest;
|
|
4949
|
+
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
4950
|
+
err = err instanceof Error ? err : new Error(String(err));
|
|
4951
|
+
if (userOnError) {
|
|
4952
|
+
return new Promise((resolve, reject) => {
|
|
4953
|
+
const userRetry = () => resolve(retry());
|
|
4954
|
+
const userFail = () => reject(err);
|
|
4955
|
+
userOnError(err, userRetry, userFail, retries + 1);
|
|
4956
|
+
});
|
|
4957
|
+
} else {
|
|
4958
|
+
throw err;
|
|
4959
|
+
}
|
|
4960
|
+
}).then((comp) => {
|
|
4961
|
+
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
4962
|
+
return pendingRequest;
|
|
4963
|
+
}
|
|
4964
|
+
if (!comp) {
|
|
4965
|
+
warn$1(
|
|
4966
|
+
`Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
|
|
4967
|
+
);
|
|
4968
|
+
}
|
|
4969
|
+
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
4970
|
+
comp = comp.default;
|
|
4971
|
+
}
|
|
4972
|
+
if (comp && !isObject(comp) && !isFunction(comp)) {
|
|
4973
|
+
throw new Error(`Invalid async component load result: ${comp}`);
|
|
4974
|
+
}
|
|
4975
|
+
resolvedComp = comp;
|
|
4976
|
+
return comp;
|
|
4977
|
+
}));
|
|
4978
|
+
};
|
|
4979
|
+
return {
|
|
4980
|
+
load,
|
|
4981
|
+
source,
|
|
4982
|
+
getResolvedComp: () => resolvedComp,
|
|
4983
|
+
setPendingRequest: (request) => pendingRequest = request
|
|
4984
|
+
};
|
|
4985
|
+
}
|
|
4986
|
+
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
4987
|
+
const loaded = ref(false);
|
|
4988
|
+
const error = ref();
|
|
4989
|
+
const delayed = ref(!!delay);
|
|
4990
|
+
if (delay) {
|
|
4991
|
+
setTimeout(() => {
|
|
4992
|
+
delayed.value = false;
|
|
4993
|
+
}, delay);
|
|
4994
|
+
}
|
|
4995
|
+
if (timeout != null) {
|
|
4996
|
+
setTimeout(() => {
|
|
4997
|
+
if (!loaded.value && !error.value) {
|
|
4998
|
+
const err = new Error(`Async component timed out after ${timeout}ms.`);
|
|
4999
|
+
onError(err);
|
|
5000
|
+
error.value = err;
|
|
5001
|
+
}
|
|
5002
|
+
}, timeout);
|
|
5003
|
+
}
|
|
5004
|
+
return { loaded, error, delayed };
|
|
5005
|
+
};
|
|
5006
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
5007
|
+
let patched = false;
|
|
5008
|
+
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
5009
|
+
const performHydrate = () => {
|
|
5010
|
+
if (patched) {
|
|
5011
|
+
{
|
|
5012
|
+
const resolvedComp = getResolvedComp();
|
|
5013
|
+
warn$1(
|
|
5014
|
+
`Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
|
|
5015
|
+
);
|
|
5016
|
+
}
|
|
5017
|
+
return;
|
|
5018
|
+
}
|
|
5019
|
+
hydrate();
|
|
5020
|
+
};
|
|
5021
|
+
const doHydrate = hydrateStrategy ? () => {
|
|
5022
|
+
const teardown = hydrateStrategy(
|
|
5023
|
+
performHydrate,
|
|
5024
|
+
(cb) => forEachElement(el, cb)
|
|
5025
|
+
);
|
|
5026
|
+
if (teardown) {
|
|
5027
|
+
(instance.bum || (instance.bum = [])).push(teardown);
|
|
5028
|
+
}
|
|
5029
|
+
} : performHydrate;
|
|
5030
|
+
if (getResolvedComp()) {
|
|
5031
|
+
doHydrate();
|
|
5032
|
+
} else {
|
|
5033
|
+
load().then(() => !instance.isUnmounted && doHydrate());
|
|
5034
|
+
}
|
|
4889
5035
|
}
|
|
4890
5036
|
|
|
4891
5037
|
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
@@ -4910,86 +5056,37 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4910
5056
|
keepAliveInstance.__v_cache = cache;
|
|
4911
5057
|
}
|
|
4912
5058
|
const parentSuspense = keepAliveInstance.suspense;
|
|
5059
|
+
const { renderer } = sharedContext;
|
|
4913
5060
|
const {
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
um: _unmount,
|
|
4918
|
-
o: { createElement }
|
|
4919
|
-
}
|
|
4920
|
-
} = sharedContext;
|
|
5061
|
+
um: _unmount,
|
|
5062
|
+
o: { createElement }
|
|
5063
|
+
} = renderer;
|
|
4921
5064
|
const storageContainer = createElement("div");
|
|
5065
|
+
sharedContext.getStorageContainer = () => storageContainer;
|
|
5066
|
+
sharedContext.getCachedComponent = (vnode) => {
|
|
5067
|
+
const key = vnode.key == null ? vnode.type : vnode.key;
|
|
5068
|
+
return cache.get(key);
|
|
5069
|
+
};
|
|
4922
5070
|
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
4923
|
-
|
|
4924
|
-
move(
|
|
5071
|
+
activate(
|
|
4925
5072
|
vnode,
|
|
4926
5073
|
container,
|
|
4927
5074
|
anchor,
|
|
4928
|
-
|
|
5075
|
+
renderer,
|
|
4929
5076
|
keepAliveInstance,
|
|
4930
|
-
parentSuspense
|
|
4931
|
-
);
|
|
4932
|
-
patch(
|
|
4933
|
-
instance.vnode,
|
|
4934
|
-
vnode,
|
|
4935
|
-
container,
|
|
4936
|
-
anchor,
|
|
4937
|
-
instance,
|
|
4938
5077
|
parentSuspense,
|
|
4939
5078
|
namespace,
|
|
4940
|
-
vnode.slotScopeIds,
|
|
4941
5079
|
optimized
|
|
4942
5080
|
);
|
|
4943
|
-
queuePostRenderEffect(
|
|
4944
|
-
() => {
|
|
4945
|
-
instance.isDeactivated = false;
|
|
4946
|
-
if (instance.a) {
|
|
4947
|
-
invokeArrayFns(instance.a);
|
|
4948
|
-
}
|
|
4949
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
4950
|
-
if (vnodeHook) {
|
|
4951
|
-
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
4952
|
-
}
|
|
4953
|
-
},
|
|
4954
|
-
void 0,
|
|
4955
|
-
parentSuspense
|
|
4956
|
-
);
|
|
4957
|
-
{
|
|
4958
|
-
devtoolsComponentAdded(instance);
|
|
4959
|
-
}
|
|
4960
5081
|
};
|
|
4961
5082
|
sharedContext.deactivate = (vnode) => {
|
|
4962
|
-
|
|
4963
|
-
invalidateMount(instance.m);
|
|
4964
|
-
invalidateMount(instance.a);
|
|
4965
|
-
move(
|
|
5083
|
+
deactivate(
|
|
4966
5084
|
vnode,
|
|
4967
5085
|
storageContainer,
|
|
4968
|
-
|
|
4969
|
-
1,
|
|
5086
|
+
renderer,
|
|
4970
5087
|
keepAliveInstance,
|
|
4971
5088
|
parentSuspense
|
|
4972
5089
|
);
|
|
4973
|
-
queuePostRenderEffect(
|
|
4974
|
-
() => {
|
|
4975
|
-
if (instance.da) {
|
|
4976
|
-
invokeArrayFns(instance.da);
|
|
4977
|
-
}
|
|
4978
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
4979
|
-
if (vnodeHook) {
|
|
4980
|
-
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
4981
|
-
}
|
|
4982
|
-
instance.isDeactivated = true;
|
|
4983
|
-
},
|
|
4984
|
-
void 0,
|
|
4985
|
-
parentSuspense
|
|
4986
|
-
);
|
|
4987
|
-
{
|
|
4988
|
-
devtoolsComponentAdded(instance);
|
|
4989
|
-
}
|
|
4990
|
-
{
|
|
4991
|
-
instance.__keepAliveStorageContainer = storageContainer;
|
|
4992
|
-
}
|
|
4993
5090
|
};
|
|
4994
5091
|
function unmount(vnode) {
|
|
4995
5092
|
resetShapeFlag(vnode);
|
|
@@ -5136,7 +5233,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
5136
5233
|
function onDeactivated(hook, target) {
|
|
5137
5234
|
registerKeepAliveHook(hook, "da", target);
|
|
5138
5235
|
}
|
|
5139
|
-
function registerKeepAliveHook(hook, type, target =
|
|
5236
|
+
function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance()) {
|
|
5140
5237
|
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
5141
5238
|
let current = target;
|
|
5142
5239
|
while (current) {
|
|
@@ -5150,8 +5247,9 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
5150
5247
|
injectHook(type, wrappedHook, target);
|
|
5151
5248
|
if (target) {
|
|
5152
5249
|
let current = target.parent;
|
|
5153
|
-
while (current && current.parent
|
|
5154
|
-
|
|
5250
|
+
while (current && current.parent) {
|
|
5251
|
+
let parent = current.parent;
|
|
5252
|
+
if (isKeepAlive(parent.vapor ? parent : parent.vnode)) {
|
|
5155
5253
|
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
5156
5254
|
}
|
|
5157
5255
|
current = current.parent;
|
|
@@ -5177,6 +5275,71 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
5177
5275
|
function getInnerChild(vnode) {
|
|
5178
5276
|
return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
|
|
5179
5277
|
}
|
|
5278
|
+
function activate(vnode, container, anchor, { p: patch, m: move }, parentComponent, parentSuspense, namespace, optimized) {
|
|
5279
|
+
const instance = vnode.component;
|
|
5280
|
+
move(
|
|
5281
|
+
vnode,
|
|
5282
|
+
container,
|
|
5283
|
+
anchor,
|
|
5284
|
+
0,
|
|
5285
|
+
parentComponent,
|
|
5286
|
+
parentSuspense
|
|
5287
|
+
);
|
|
5288
|
+
patch(
|
|
5289
|
+
instance.vnode,
|
|
5290
|
+
vnode,
|
|
5291
|
+
container,
|
|
5292
|
+
anchor,
|
|
5293
|
+
instance,
|
|
5294
|
+
parentSuspense,
|
|
5295
|
+
namespace,
|
|
5296
|
+
vnode.slotScopeIds,
|
|
5297
|
+
optimized
|
|
5298
|
+
);
|
|
5299
|
+
queuePostRenderEffect(
|
|
5300
|
+
() => {
|
|
5301
|
+
instance.isDeactivated = false;
|
|
5302
|
+
if (instance.a) {
|
|
5303
|
+
invokeArrayFns(instance.a);
|
|
5304
|
+
}
|
|
5305
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
5306
|
+
if (vnodeHook) {
|
|
5307
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
5308
|
+
}
|
|
5309
|
+
},
|
|
5310
|
+
void 0,
|
|
5311
|
+
parentSuspense
|
|
5312
|
+
);
|
|
5313
|
+
{
|
|
5314
|
+
devtoolsComponentAdded(instance);
|
|
5315
|
+
}
|
|
5316
|
+
}
|
|
5317
|
+
function deactivate(vnode, container, { m: move }, parentComponent, parentSuspense) {
|
|
5318
|
+
const instance = vnode.component;
|
|
5319
|
+
invalidateMount(instance.m);
|
|
5320
|
+
invalidateMount(instance.a);
|
|
5321
|
+
move(vnode, container, null, 1, parentComponent, parentSuspense);
|
|
5322
|
+
queuePostRenderEffect(
|
|
5323
|
+
() => {
|
|
5324
|
+
if (instance.da) {
|
|
5325
|
+
invokeArrayFns(instance.da);
|
|
5326
|
+
}
|
|
5327
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
5328
|
+
if (vnodeHook) {
|
|
5329
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
5330
|
+
}
|
|
5331
|
+
instance.isDeactivated = true;
|
|
5332
|
+
},
|
|
5333
|
+
void 0,
|
|
5334
|
+
parentSuspense
|
|
5335
|
+
);
|
|
5336
|
+
{
|
|
5337
|
+
devtoolsComponentAdded(instance);
|
|
5338
|
+
}
|
|
5339
|
+
{
|
|
5340
|
+
instance.__keepAliveStorageContainer = container;
|
|
5341
|
+
}
|
|
5342
|
+
}
|
|
5180
5343
|
|
|
5181
5344
|
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
5182
5345
|
if (target) {
|
|
@@ -5365,12 +5528,13 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
5365
5528
|
return ret;
|
|
5366
5529
|
}
|
|
5367
5530
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
5531
|
+
const hasProps = Object.keys(props).length > 0;
|
|
5368
5532
|
if (name !== "default") props.name = name;
|
|
5369
5533
|
return openBlock(), createBlock(
|
|
5370
5534
|
Fragment,
|
|
5371
5535
|
null,
|
|
5372
5536
|
[createVNode("slot", props, fallback && fallback())],
|
|
5373
|
-
64
|
|
5537
|
+
hasProps ? -2 : 64
|
|
5374
5538
|
);
|
|
5375
5539
|
}
|
|
5376
5540
|
if (slot && slot.length > 1) {
|
|
@@ -5384,6 +5548,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
5384
5548
|
}
|
|
5385
5549
|
openBlock();
|
|
5386
5550
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
5551
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
5387
5552
|
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
5388
5553
|
// key attached in the `createSlots` helper, respect that
|
|
5389
5554
|
validSlotContent && validSlotContent.key;
|
|
@@ -5413,6 +5578,14 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
5413
5578
|
return true;
|
|
5414
5579
|
}) ? vnodes : null;
|
|
5415
5580
|
}
|
|
5581
|
+
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
5582
|
+
let vaporSlot;
|
|
5583
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
|
|
5584
|
+
if (!vaporSlot.fallback && fallback) {
|
|
5585
|
+
vaporSlot.fallback = fallback;
|
|
5586
|
+
}
|
|
5587
|
+
}
|
|
5588
|
+
}
|
|
5416
5589
|
|
|
5417
5590
|
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
5418
5591
|
const ret = {};
|
|
@@ -5575,10 +5748,10 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
5575
5748
|
return true;
|
|
5576
5749
|
},
|
|
5577
5750
|
has({
|
|
5578
|
-
_: { data, setupState, accessCache, ctx, appContext, propsOptions }
|
|
5751
|
+
_: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
|
|
5579
5752
|
}, key) {
|
|
5580
|
-
let normalizedProps;
|
|
5581
|
-
return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
|
|
5753
|
+
let normalizedProps, cssModules;
|
|
5754
|
+
return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
|
|
5582
5755
|
},
|
|
5583
5756
|
defineProperty(target, key, descriptor) {
|
|
5584
5757
|
if (descriptor.get != null) {
|
|
@@ -5716,15 +5889,15 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
5716
5889
|
return null;
|
|
5717
5890
|
}
|
|
5718
5891
|
function useSlots() {
|
|
5719
|
-
return getContext().slots;
|
|
5892
|
+
return getContext("useSlots").slots;
|
|
5720
5893
|
}
|
|
5721
5894
|
function useAttrs() {
|
|
5722
|
-
return getContext().attrs;
|
|
5895
|
+
return getContext("useAttrs").attrs;
|
|
5723
5896
|
}
|
|
5724
|
-
function getContext() {
|
|
5897
|
+
function getContext(calledFunctionName) {
|
|
5725
5898
|
const i = getCurrentGenericInstance();
|
|
5726
5899
|
if (!i) {
|
|
5727
|
-
warn$1(
|
|
5900
|
+
warn$1(`${calledFunctionName}() called without active instance.`);
|
|
5728
5901
|
}
|
|
5729
5902
|
if (i.vapor) {
|
|
5730
5903
|
return i;
|
|
@@ -5980,7 +6153,8 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
5980
6153
|
expose.forEach((key) => {
|
|
5981
6154
|
Object.defineProperty(exposed, key, {
|
|
5982
6155
|
get: () => publicThis[key],
|
|
5983
|
-
set: (val) => publicThis[key] = val
|
|
6156
|
+
set: (val) => publicThis[key] = val,
|
|
6157
|
+
enumerable: true
|
|
5984
6158
|
});
|
|
5985
6159
|
});
|
|
5986
6160
|
} else if (!instance.exposed) {
|
|
@@ -6850,7 +7024,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
6850
7024
|
return args.some((elem) => elem.toLowerCase() === "boolean");
|
|
6851
7025
|
}
|
|
6852
7026
|
|
|
6853
|
-
const isInternalKey = (key) => key
|
|
7027
|
+
const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
|
|
6854
7028
|
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
6855
7029
|
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
6856
7030
|
if (rawSlot._n) {
|
|
@@ -6904,8 +7078,6 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
6904
7078
|
const initSlots = (instance, children, optimized) => {
|
|
6905
7079
|
const slots = instance.slots = createInternalObject();
|
|
6906
7080
|
if (instance.vnode.shapeFlag & 32) {
|
|
6907
|
-
const cacheIndexes = children.__;
|
|
6908
|
-
if (cacheIndexes) def(slots, "__", cacheIndexes, true);
|
|
6909
7081
|
const type = children._;
|
|
6910
7082
|
if (type) {
|
|
6911
7083
|
assignSlots(slots, children, optimized);
|
|
@@ -6969,12 +7141,10 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
6969
7141
|
if (instance.appContext.config.performance && isSupported()) {
|
|
6970
7142
|
const startTag = `vue-${type}-${instance.uid}`;
|
|
6971
7143
|
const endTag = startTag + `:end`;
|
|
7144
|
+
const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
|
|
6972
7145
|
perf.mark(endTag);
|
|
6973
|
-
perf.measure(
|
|
6974
|
-
|
|
6975
|
-
startTag,
|
|
6976
|
-
endTag
|
|
6977
|
-
);
|
|
7146
|
+
perf.measure(measureName, startTag, endTag);
|
|
7147
|
+
perf.clearMeasures(measureName);
|
|
6978
7148
|
perf.clearMarks(startTag);
|
|
6979
7149
|
perf.clearMarks(endTag);
|
|
6980
7150
|
}
|
|
@@ -7213,15 +7383,25 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7213
7383
|
optimized
|
|
7214
7384
|
);
|
|
7215
7385
|
} else {
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7386
|
+
const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
|
|
7387
|
+
try {
|
|
7388
|
+
if (customElement) {
|
|
7389
|
+
customElement._beginPatch();
|
|
7390
|
+
}
|
|
7391
|
+
patchElement(
|
|
7392
|
+
n1,
|
|
7393
|
+
n2,
|
|
7394
|
+
parentComponent,
|
|
7395
|
+
parentSuspense,
|
|
7396
|
+
namespace,
|
|
7397
|
+
slotScopeIds,
|
|
7398
|
+
optimized
|
|
7399
|
+
);
|
|
7400
|
+
} finally {
|
|
7401
|
+
if (customElement) {
|
|
7402
|
+
customElement._endPatch();
|
|
7403
|
+
}
|
|
7404
|
+
}
|
|
7225
7405
|
}
|
|
7226
7406
|
};
|
|
7227
7407
|
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
@@ -7272,16 +7452,20 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7272
7452
|
if (dirs) {
|
|
7273
7453
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
7274
7454
|
}
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7455
|
+
if (transition) {
|
|
7456
|
+
performTransitionEnter(
|
|
7457
|
+
el,
|
|
7458
|
+
transition,
|
|
7459
|
+
() => hostInsert(el, container, anchor),
|
|
7460
|
+
parentSuspense
|
|
7461
|
+
);
|
|
7462
|
+
} else {
|
|
7463
|
+
hostInsert(el, container, anchor);
|
|
7278
7464
|
}
|
|
7279
|
-
|
|
7280
|
-
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
7465
|
+
if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
|
|
7281
7466
|
queuePostRenderEffect(
|
|
7282
7467
|
() => {
|
|
7283
7468
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
7284
|
-
needCallTransitionHooks && transition.enter(el);
|
|
7285
7469
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
7286
7470
|
},
|
|
7287
7471
|
void 0,
|
|
@@ -7298,21 +7482,9 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7298
7482
|
hostSetScopeId(el, slotScopeIds[i]);
|
|
7299
7483
|
}
|
|
7300
7484
|
}
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
subTree = filterSingleRoot(subTree.children) || subTree;
|
|
7305
|
-
}
|
|
7306
|
-
if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
|
|
7307
|
-
const parentVNode = parentComponent.vnode;
|
|
7308
|
-
setScopeId(
|
|
7309
|
-
el,
|
|
7310
|
-
parentVNode,
|
|
7311
|
-
parentVNode.scopeId,
|
|
7312
|
-
parentVNode.slotScopeIds,
|
|
7313
|
-
parentComponent.parent
|
|
7314
|
-
);
|
|
7315
|
-
}
|
|
7485
|
+
const inheritedScopeIds = getInheritedScopeIds(vnode, parentComponent);
|
|
7486
|
+
for (let i = 0; i < inheritedScopeIds.length; i++) {
|
|
7487
|
+
hostSetScopeId(el, inheritedScopeIds[i]);
|
|
7316
7488
|
}
|
|
7317
7489
|
};
|
|
7318
7490
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
@@ -7553,12 +7725,21 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7553
7725
|
n2.slotScopeIds = slotScopeIds;
|
|
7554
7726
|
if (n2.type.__vapor) {
|
|
7555
7727
|
if (n1 == null) {
|
|
7556
|
-
|
|
7557
|
-
n2
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7728
|
+
if (n2.shapeFlag & 512) {
|
|
7729
|
+
getVaporInterface(parentComponent, n2).activate(
|
|
7730
|
+
n2,
|
|
7731
|
+
container,
|
|
7732
|
+
anchor,
|
|
7733
|
+
parentComponent
|
|
7734
|
+
);
|
|
7735
|
+
} else {
|
|
7736
|
+
getVaporInterface(parentComponent, n2).mount(
|
|
7737
|
+
n2,
|
|
7738
|
+
container,
|
|
7739
|
+
anchor,
|
|
7740
|
+
parentComponent
|
|
7741
|
+
);
|
|
7742
|
+
}
|
|
7562
7743
|
} else {
|
|
7563
7744
|
getVaporInterface(parentComponent, n2).update(
|
|
7564
7745
|
n1,
|
|
@@ -7621,6 +7802,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7621
7802
|
if (!initialVNode.el) {
|
|
7622
7803
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
7623
7804
|
processCommentNode(null, placeholder, container, anchor);
|
|
7805
|
+
initialVNode.placeholder = placeholder.el;
|
|
7624
7806
|
}
|
|
7625
7807
|
} else {
|
|
7626
7808
|
setupRenderEffect(
|
|
@@ -8161,7 +8343,11 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8161
8343
|
for (i = toBePatched - 1; i >= 0; i--) {
|
|
8162
8344
|
const nextIndex = s2 + i;
|
|
8163
8345
|
const nextChild = c2[nextIndex];
|
|
8164
|
-
const
|
|
8346
|
+
const anchorVNode = c2[nextIndex + 1];
|
|
8347
|
+
const anchor = nextIndex + 1 < l2 ? (
|
|
8348
|
+
// #13559, fallback to el placeholder for unresolved async component
|
|
8349
|
+
anchorVNode.el || anchorVNode.placeholder
|
|
8350
|
+
) : parentAnchor;
|
|
8165
8351
|
if (newIndexToOldIndexMap[i] === 0) {
|
|
8166
8352
|
patch(
|
|
8167
8353
|
null,
|
|
@@ -8241,12 +8427,12 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8241
8427
|
const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
|
|
8242
8428
|
if (needTransition2) {
|
|
8243
8429
|
if (moveType === 0) {
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
() =>
|
|
8248
|
-
|
|
8249
|
-
|
|
8430
|
+
performTransitionEnter(
|
|
8431
|
+
el,
|
|
8432
|
+
transition,
|
|
8433
|
+
() => hostInsert(el, container, anchor),
|
|
8434
|
+
parentSuspense,
|
|
8435
|
+
true
|
|
8250
8436
|
);
|
|
8251
8437
|
} else {
|
|
8252
8438
|
const { leave, delayLeave, afterLeave } = transition;
|
|
@@ -8258,6 +8444,12 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8258
8444
|
}
|
|
8259
8445
|
};
|
|
8260
8446
|
const performLeave = () => {
|
|
8447
|
+
if (el._isLeaving) {
|
|
8448
|
+
el[leaveCbKey](
|
|
8449
|
+
true
|
|
8450
|
+
/* cancelled */
|
|
8451
|
+
);
|
|
8452
|
+
}
|
|
8261
8453
|
leave(el, () => {
|
|
8262
8454
|
remove2();
|
|
8263
8455
|
afterLeave && afterLeave();
|
|
@@ -8297,7 +8489,14 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8297
8489
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
8298
8490
|
}
|
|
8299
8491
|
if (shapeFlag & 256) {
|
|
8300
|
-
|
|
8492
|
+
if (vnode.type.__vapor) {
|
|
8493
|
+
getVaporInterface(parentComponent, vnode).deactivate(
|
|
8494
|
+
vnode,
|
|
8495
|
+
parentComponent.ctx.getStorageContainer()
|
|
8496
|
+
);
|
|
8497
|
+
} else {
|
|
8498
|
+
parentComponent.ctx.deactivate(vnode);
|
|
8499
|
+
}
|
|
8301
8500
|
return;
|
|
8302
8501
|
}
|
|
8303
8502
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
@@ -8385,22 +8584,15 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8385
8584
|
removeStaticNode(vnode);
|
|
8386
8585
|
return;
|
|
8387
8586
|
}
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
transition
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
const { leave, delayLeave } = transition;
|
|
8396
|
-
const performLeave = () => leave(el, performRemove);
|
|
8397
|
-
if (delayLeave) {
|
|
8398
|
-
delayLeave(vnode.el, performRemove, performLeave);
|
|
8399
|
-
} else {
|
|
8400
|
-
performLeave();
|
|
8401
|
-
}
|
|
8587
|
+
if (transition) {
|
|
8588
|
+
performTransitionLeave(
|
|
8589
|
+
el,
|
|
8590
|
+
transition,
|
|
8591
|
+
() => hostRemove(el),
|
|
8592
|
+
!!(vnode.shapeFlag & 1)
|
|
8593
|
+
);
|
|
8402
8594
|
} else {
|
|
8403
|
-
|
|
8595
|
+
hostRemove(el);
|
|
8404
8596
|
}
|
|
8405
8597
|
};
|
|
8406
8598
|
const removeFragment = (cur, end) => {
|
|
@@ -8416,27 +8608,12 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8416
8608
|
if (instance.type.__hmrId) {
|
|
8417
8609
|
unregisterHMR(instance);
|
|
8418
8610
|
}
|
|
8419
|
-
const {
|
|
8420
|
-
bum,
|
|
8421
|
-
scope,
|
|
8422
|
-
effect,
|
|
8423
|
-
subTree,
|
|
8424
|
-
um,
|
|
8425
|
-
m,
|
|
8426
|
-
a,
|
|
8427
|
-
parent,
|
|
8428
|
-
slots: { __: slotCacheKeys }
|
|
8429
|
-
} = instance;
|
|
8611
|
+
const { bum, scope, effect, subTree, um, m, a } = instance;
|
|
8430
8612
|
invalidateMount(m);
|
|
8431
8613
|
invalidateMount(a);
|
|
8432
8614
|
if (bum) {
|
|
8433
8615
|
invokeArrayFns(bum);
|
|
8434
8616
|
}
|
|
8435
|
-
if (parent && isArray(slotCacheKeys)) {
|
|
8436
|
-
slotCacheKeys.forEach((v) => {
|
|
8437
|
-
parent.renderCache[v] = void 0;
|
|
8438
|
-
});
|
|
8439
|
-
}
|
|
8440
8617
|
scope.stop();
|
|
8441
8618
|
if (effect) {
|
|
8442
8619
|
effect.stop();
|
|
@@ -8450,12 +8627,6 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8450
8627
|
void 0,
|
|
8451
8628
|
parentSuspense
|
|
8452
8629
|
);
|
|
8453
|
-
if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
|
|
8454
|
-
parentSuspense.deps--;
|
|
8455
|
-
if (parentSuspense.deps === 0) {
|
|
8456
|
-
parentSuspense.resolve();
|
|
8457
|
-
}
|
|
8458
|
-
}
|
|
8459
8630
|
{
|
|
8460
8631
|
devtoolsComponentRemoved(instance);
|
|
8461
8632
|
}
|
|
@@ -8468,7 +8639,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8468
8639
|
const getNextHostNode = (vnode) => {
|
|
8469
8640
|
if (vnode.shapeFlag & 6) {
|
|
8470
8641
|
if (vnode.type.__vapor) {
|
|
8471
|
-
return hostNextSibling(vnode.
|
|
8642
|
+
return hostNextSibling(vnode.anchor);
|
|
8472
8643
|
}
|
|
8473
8644
|
return getNextHostNode(vnode.component.subTree);
|
|
8474
8645
|
}
|
|
@@ -8546,6 +8717,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8546
8717
|
return {
|
|
8547
8718
|
render,
|
|
8548
8719
|
hydrate,
|
|
8720
|
+
hydrateNode,
|
|
8549
8721
|
internals,
|
|
8550
8722
|
createApp: createAppAPI(
|
|
8551
8723
|
mountApp,
|
|
@@ -8585,7 +8757,8 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8585
8757
|
if (!shallow && c2.patchFlag !== -2)
|
|
8586
8758
|
traverseStaticChildren(c1, c2);
|
|
8587
8759
|
}
|
|
8588
|
-
if (c2.type === Text
|
|
8760
|
+
if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
|
|
8761
|
+
c2.patchFlag !== -1) {
|
|
8589
8762
|
c2.el = c1.el;
|
|
8590
8763
|
}
|
|
8591
8764
|
if (c2.type === Comment && !c2.el) {
|
|
@@ -8598,7 +8771,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8598
8771
|
}
|
|
8599
8772
|
}
|
|
8600
8773
|
function locateNonHydratedAsyncRoot(instance) {
|
|
8601
|
-
const subComponent = instance.
|
|
8774
|
+
const subComponent = instance.subTree && instance.subTree.component;
|
|
8602
8775
|
if (subComponent) {
|
|
8603
8776
|
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
8604
8777
|
return subComponent;
|
|
@@ -8613,6 +8786,34 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8613
8786
|
hooks[i].flags |= 4;
|
|
8614
8787
|
}
|
|
8615
8788
|
}
|
|
8789
|
+
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
8790
|
+
if (force || needTransition(parentSuspense, transition)) {
|
|
8791
|
+
transition.beforeEnter(el);
|
|
8792
|
+
insert();
|
|
8793
|
+
queuePostRenderEffect(() => transition.enter(el), void 0, parentSuspense);
|
|
8794
|
+
} else {
|
|
8795
|
+
insert();
|
|
8796
|
+
}
|
|
8797
|
+
}
|
|
8798
|
+
function performTransitionLeave(el, transition, remove, isElement = true) {
|
|
8799
|
+
const performRemove = () => {
|
|
8800
|
+
remove();
|
|
8801
|
+
if (transition && !transition.persisted && transition.afterLeave) {
|
|
8802
|
+
transition.afterLeave();
|
|
8803
|
+
}
|
|
8804
|
+
};
|
|
8805
|
+
if (isElement && transition && !transition.persisted) {
|
|
8806
|
+
const { leave, delayLeave } = transition;
|
|
8807
|
+
const performLeave = () => leave(el, performRemove);
|
|
8808
|
+
if (delayLeave) {
|
|
8809
|
+
delayLeave(el, performRemove, performLeave);
|
|
8810
|
+
} else {
|
|
8811
|
+
performLeave();
|
|
8812
|
+
}
|
|
8813
|
+
} else {
|
|
8814
|
+
performRemove();
|
|
8815
|
+
}
|
|
8816
|
+
}
|
|
8616
8817
|
function getVaporInterface(instance, vnode) {
|
|
8617
8818
|
const ctx = instance ? instance.appContext : vnode.appContext;
|
|
8618
8819
|
const res = ctx && ctx.vapor;
|
|
@@ -8627,6 +8828,32 @@ app.use(vaporInteropPlugin)
|
|
|
8627
8828
|
}
|
|
8628
8829
|
return res;
|
|
8629
8830
|
}
|
|
8831
|
+
function getInheritedScopeIds(vnode, parentComponent) {
|
|
8832
|
+
const inheritedScopeIds = [];
|
|
8833
|
+
let currentParent = parentComponent;
|
|
8834
|
+
let currentVNode = vnode;
|
|
8835
|
+
while (currentParent) {
|
|
8836
|
+
let subTree = currentParent.subTree;
|
|
8837
|
+
if (!subTree) break;
|
|
8838
|
+
if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
|
|
8839
|
+
subTree = filterSingleRoot(subTree.children) || subTree;
|
|
8840
|
+
}
|
|
8841
|
+
if (currentVNode === subTree || isSuspense(subTree.type) && (subTree.ssContent === currentVNode || subTree.ssFallback === currentVNode)) {
|
|
8842
|
+
const parentVNode = currentParent.vnode;
|
|
8843
|
+
if (parentVNode.scopeId) {
|
|
8844
|
+
inheritedScopeIds.push(parentVNode.scopeId);
|
|
8845
|
+
}
|
|
8846
|
+
if (parentVNode.slotScopeIds) {
|
|
8847
|
+
inheritedScopeIds.push(...parentVNode.slotScopeIds);
|
|
8848
|
+
}
|
|
8849
|
+
currentVNode = parentVNode;
|
|
8850
|
+
currentParent = currentParent.parent;
|
|
8851
|
+
} else {
|
|
8852
|
+
break;
|
|
8853
|
+
}
|
|
8854
|
+
}
|
|
8855
|
+
return inheritedScopeIds;
|
|
8856
|
+
}
|
|
8630
8857
|
|
|
8631
8858
|
const ssrContextKey = Symbol.for("v-scx");
|
|
8632
8859
|
const useSSRContext = () => {
|
|
@@ -8938,8 +9165,9 @@ app.use(vaporInteropPlugin)
|
|
|
8938
9165
|
function defaultPropGetter(props, key) {
|
|
8939
9166
|
return props[key];
|
|
8940
9167
|
}
|
|
9168
|
+
const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
|
|
8941
9169
|
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
8942
|
-
const cache = appContext.emitsCache;
|
|
9170
|
+
const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
|
|
8943
9171
|
const cached = cache.get(comp);
|
|
8944
9172
|
if (cached !== void 0) {
|
|
8945
9173
|
return cached;
|
|
@@ -9387,7 +9615,7 @@ app.use(vaporInteropPlugin)
|
|
|
9387
9615
|
const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
|
|
9388
9616
|
if (pendingBranch) {
|
|
9389
9617
|
suspense.pendingBranch = newBranch;
|
|
9390
|
-
if (isSameVNodeType(
|
|
9618
|
+
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
9391
9619
|
patch(
|
|
9392
9620
|
pendingBranch,
|
|
9393
9621
|
newBranch,
|
|
@@ -9458,7 +9686,7 @@ app.use(vaporInteropPlugin)
|
|
|
9458
9686
|
);
|
|
9459
9687
|
setActiveBranch(suspense, newFallback);
|
|
9460
9688
|
}
|
|
9461
|
-
} else if (activeBranch && isSameVNodeType(
|
|
9689
|
+
} else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
|
9462
9690
|
patch(
|
|
9463
9691
|
activeBranch,
|
|
9464
9692
|
newBranch,
|
|
@@ -9489,7 +9717,7 @@ app.use(vaporInteropPlugin)
|
|
|
9489
9717
|
}
|
|
9490
9718
|
}
|
|
9491
9719
|
} else {
|
|
9492
|
-
if (activeBranch && isSameVNodeType(
|
|
9720
|
+
if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
|
9493
9721
|
patch(
|
|
9494
9722
|
activeBranch,
|
|
9495
9723
|
newBranch,
|
|
@@ -9602,7 +9830,8 @@ app.use(vaporInteropPlugin)
|
|
|
9602
9830
|
pendingId,
|
|
9603
9831
|
effects,
|
|
9604
9832
|
parentComponent: parentComponent2,
|
|
9605
|
-
container: container2
|
|
9833
|
+
container: container2,
|
|
9834
|
+
isInFallback
|
|
9606
9835
|
} = suspense;
|
|
9607
9836
|
let delayEnter = false;
|
|
9608
9837
|
if (suspense.isHydrating) {
|
|
@@ -9620,6 +9849,9 @@ app.use(vaporInteropPlugin)
|
|
|
9620
9849
|
parentComponent2
|
|
9621
9850
|
);
|
|
9622
9851
|
queuePostFlushCb(effects);
|
|
9852
|
+
if (isInFallback && vnode2.ssFallback) {
|
|
9853
|
+
vnode2.ssFallback.el = null;
|
|
9854
|
+
}
|
|
9623
9855
|
}
|
|
9624
9856
|
};
|
|
9625
9857
|
}
|
|
@@ -9628,6 +9860,9 @@ app.use(vaporInteropPlugin)
|
|
|
9628
9860
|
anchor = next(activeBranch);
|
|
9629
9861
|
}
|
|
9630
9862
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
9863
|
+
if (!delayEnter && isInFallback && vnode2.ssFallback) {
|
|
9864
|
+
vnode2.ssFallback.el = null;
|
|
9865
|
+
}
|
|
9631
9866
|
}
|
|
9632
9867
|
if (!delayEnter) {
|
|
9633
9868
|
move(
|
|
@@ -9752,6 +9987,7 @@ app.use(vaporInteropPlugin)
|
|
|
9752
9987
|
optimized2
|
|
9753
9988
|
);
|
|
9754
9989
|
if (placeholder) {
|
|
9990
|
+
vnode2.placeholder = null;
|
|
9755
9991
|
remove(placeholder);
|
|
9756
9992
|
}
|
|
9757
9993
|
updateHOCHostEl(instance, vnode2.el);
|
|
@@ -9957,15 +10193,11 @@ app.use(vaporInteropPlugin)
|
|
|
9957
10193
|
);
|
|
9958
10194
|
};
|
|
9959
10195
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
9960
|
-
const normalizeRef = ({
|
|
9961
|
-
ref,
|
|
9962
|
-
ref_key,
|
|
9963
|
-
ref_for
|
|
9964
|
-
}) => {
|
|
10196
|
+
const normalizeRef = ({ ref, ref_key, ref_for }, i = currentRenderingInstance) => {
|
|
9965
10197
|
if (typeof ref === "number") {
|
|
9966
10198
|
ref = "" + ref;
|
|
9967
10199
|
}
|
|
9968
|
-
return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i
|
|
10200
|
+
return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i, r: ref, k: ref_key, f: !!ref_for } : ref : null;
|
|
9969
10201
|
};
|
|
9970
10202
|
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
9971
10203
|
const vnode = {
|
|
@@ -10131,6 +10363,7 @@ Component that was made reactive: `,
|
|
|
10131
10363
|
suspense: vnode.suspense,
|
|
10132
10364
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
10133
10365
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
10366
|
+
placeholder: vnode.placeholder,
|
|
10134
10367
|
el: vnode.el,
|
|
10135
10368
|
anchor: vnode.anchor,
|
|
10136
10369
|
ctx: vnode.ctx,
|
|
@@ -10643,7 +10876,7 @@ Component that was made reactive: `,
|
|
|
10643
10876
|
return instance.proxy;
|
|
10644
10877
|
}
|
|
10645
10878
|
}
|
|
10646
|
-
const classifyRE = /(?:^|[-_])
|
|
10879
|
+
const classifyRE = /(?:^|[-_])\w/g;
|
|
10647
10880
|
const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
|
|
10648
10881
|
function getComponentName(Component, includeInferred = true) {
|
|
10649
10882
|
return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
|
|
@@ -10679,23 +10912,28 @@ Component that was made reactive: `,
|
|
|
10679
10912
|
};
|
|
10680
10913
|
|
|
10681
10914
|
function h(type, propsOrChildren, children) {
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10915
|
+
try {
|
|
10916
|
+
setBlockTracking(-1);
|
|
10917
|
+
const l = arguments.length;
|
|
10918
|
+
if (l === 2) {
|
|
10919
|
+
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
10920
|
+
if (isVNode(propsOrChildren)) {
|
|
10921
|
+
return createVNode(type, null, [propsOrChildren]);
|
|
10922
|
+
}
|
|
10923
|
+
return createVNode(type, propsOrChildren);
|
|
10924
|
+
} else {
|
|
10925
|
+
return createVNode(type, null, propsOrChildren);
|
|
10687
10926
|
}
|
|
10688
|
-
return createVNode(type, propsOrChildren);
|
|
10689
10927
|
} else {
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
children = [children];
|
|
10928
|
+
if (l > 3) {
|
|
10929
|
+
children = Array.prototype.slice.call(arguments, 2);
|
|
10930
|
+
} else if (l === 3 && isVNode(children)) {
|
|
10931
|
+
children = [children];
|
|
10932
|
+
}
|
|
10933
|
+
return createVNode(type, propsOrChildren, children);
|
|
10697
10934
|
}
|
|
10698
|
-
|
|
10935
|
+
} finally {
|
|
10936
|
+
setBlockTracking(1);
|
|
10699
10937
|
}
|
|
10700
10938
|
}
|
|
10701
10939
|
|
|
@@ -10905,7 +11143,7 @@ Component that was made reactive: `,
|
|
|
10905
11143
|
return true;
|
|
10906
11144
|
}
|
|
10907
11145
|
|
|
10908
|
-
const version = "3.6.0-alpha.
|
|
11146
|
+
const version = "3.6.0-alpha.3";
|
|
10909
11147
|
const warn = warn$1 ;
|
|
10910
11148
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
10911
11149
|
const devtools = devtools$1 ;
|
|
@@ -11122,11 +11360,11 @@ Component that was made reactive: `,
|
|
|
11122
11360
|
const resolve = () => finishLeave(el, done);
|
|
11123
11361
|
addTransitionClass(el, leaveFromClass);
|
|
11124
11362
|
if (!el._enterCancelled) {
|
|
11125
|
-
forceReflow();
|
|
11363
|
+
forceReflow(el);
|
|
11126
11364
|
addTransitionClass(el, leaveActiveClass);
|
|
11127
11365
|
} else {
|
|
11128
11366
|
addTransitionClass(el, leaveActiveClass);
|
|
11129
|
-
forceReflow();
|
|
11367
|
+
forceReflow(el);
|
|
11130
11368
|
}
|
|
11131
11369
|
nextFrame(() => {
|
|
11132
11370
|
if (!el._isLeaving) {
|
|
@@ -11252,7 +11490,7 @@ Component that was made reactive: `,
|
|
|
11252
11490
|
type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
|
|
11253
11491
|
propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
|
|
11254
11492
|
}
|
|
11255
|
-
const hasTransform = type === TRANSITION && /\b(transform|all)(
|
|
11493
|
+
const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
|
|
11256
11494
|
getStyleProperties(`${TRANSITION}Property`).toString()
|
|
11257
11495
|
);
|
|
11258
11496
|
return {
|
|
@@ -11272,8 +11510,9 @@ Component that was made reactive: `,
|
|
|
11272
11510
|
if (s === "auto") return 0;
|
|
11273
11511
|
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
|
|
11274
11512
|
}
|
|
11275
|
-
function forceReflow() {
|
|
11276
|
-
|
|
11513
|
+
function forceReflow(el) {
|
|
11514
|
+
const targetDocument = el ? el.ownerDocument : document;
|
|
11515
|
+
return targetDocument.body.offsetHeight;
|
|
11277
11516
|
}
|
|
11278
11517
|
|
|
11279
11518
|
function patchClass(el, value, isSVG) {
|
|
@@ -11293,6 +11532,8 @@ Component that was made reactive: `,
|
|
|
11293
11532
|
const vShowOriginalDisplay = Symbol("_vod");
|
|
11294
11533
|
const vShowHidden = Symbol("_vsh");
|
|
11295
11534
|
const vShow = {
|
|
11535
|
+
// used for prop mismatch check during hydration
|
|
11536
|
+
name: "show",
|
|
11296
11537
|
beforeMount(el, { value }, { transition }) {
|
|
11297
11538
|
el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
|
|
11298
11539
|
if (transition && value) {
|
|
@@ -11326,9 +11567,6 @@ Component that was made reactive: `,
|
|
|
11326
11567
|
setDisplay(el, value);
|
|
11327
11568
|
}
|
|
11328
11569
|
};
|
|
11329
|
-
{
|
|
11330
|
-
vShow.name = "show";
|
|
11331
|
-
}
|
|
11332
11570
|
function setDisplay(el, value) {
|
|
11333
11571
|
el.style.display = value ? el[vShowOriginalDisplay] : "none";
|
|
11334
11572
|
el[vShowHidden] = !value;
|
|
@@ -11407,7 +11645,7 @@ Component that was made reactive: `,
|
|
|
11407
11645
|
}
|
|
11408
11646
|
}
|
|
11409
11647
|
|
|
11410
|
-
const displayRE = /(
|
|
11648
|
+
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
11411
11649
|
function patchStyle(el, prev, next) {
|
|
11412
11650
|
const style = el.style;
|
|
11413
11651
|
const isCssString = isString(next);
|
|
@@ -11712,11 +11950,10 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11712
11950
|
}
|
|
11713
11951
|
|
|
11714
11952
|
const REMOVAL = {};
|
|
11715
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
11716
11953
|
// @__NO_SIDE_EFFECTS__
|
|
11717
11954
|
function defineCustomElement(options, extraOptions, _createApp) {
|
|
11718
|
-
|
|
11719
|
-
if (isPlainObject(Comp)) extend(Comp, extraOptions);
|
|
11955
|
+
let Comp = defineComponent(options, extraOptions);
|
|
11956
|
+
if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
|
|
11720
11957
|
class VueCustomElement extends VueElement {
|
|
11721
11958
|
constructor(initialProps) {
|
|
11722
11959
|
super(Comp, initialProps, _createApp);
|
|
@@ -11725,10 +11962,9 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11725
11962
|
VueCustomElement.def = Comp;
|
|
11726
11963
|
return VueCustomElement;
|
|
11727
11964
|
}
|
|
11728
|
-
|
|
11729
|
-
const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
11965
|
+
const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
11730
11966
|
return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
|
|
11731
|
-
};
|
|
11967
|
+
});
|
|
11732
11968
|
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
11733
11969
|
};
|
|
11734
11970
|
class VueElement extends BaseClass {
|
|
@@ -11752,6 +11988,8 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11752
11988
|
this._nonce = this._def.nonce;
|
|
11753
11989
|
this._connected = false;
|
|
11754
11990
|
this._resolved = false;
|
|
11991
|
+
this._patching = false;
|
|
11992
|
+
this._dirty = false;
|
|
11755
11993
|
this._numberProps = null;
|
|
11756
11994
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
11757
11995
|
this._ob = null;
|
|
@@ -11764,7 +12002,11 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11764
12002
|
);
|
|
11765
12003
|
}
|
|
11766
12004
|
if (_def.shadowRoot !== false) {
|
|
11767
|
-
this.attachShadow(
|
|
12005
|
+
this.attachShadow(
|
|
12006
|
+
extend({}, _def.shadowRootOptions, {
|
|
12007
|
+
mode: "open"
|
|
12008
|
+
})
|
|
12009
|
+
);
|
|
11768
12010
|
this._root = this.shadowRoot;
|
|
11769
12011
|
} else {
|
|
11770
12012
|
this._root = this;
|
|
@@ -11824,9 +12066,18 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11824
12066
|
this._app && this._app.unmount();
|
|
11825
12067
|
if (this._instance) this._instance.ce = void 0;
|
|
11826
12068
|
this._app = this._instance = null;
|
|
12069
|
+
if (this._teleportTargets) {
|
|
12070
|
+
this._teleportTargets.clear();
|
|
12071
|
+
this._teleportTargets = void 0;
|
|
12072
|
+
}
|
|
11827
12073
|
}
|
|
11828
12074
|
});
|
|
11829
12075
|
}
|
|
12076
|
+
_processMutations(mutations) {
|
|
12077
|
+
for (const m of mutations) {
|
|
12078
|
+
this._setAttr(m.attributeName);
|
|
12079
|
+
}
|
|
12080
|
+
}
|
|
11830
12081
|
/**
|
|
11831
12082
|
* resolve inner component definition (handle possible async component)
|
|
11832
12083
|
*/
|
|
@@ -11837,11 +12088,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11837
12088
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
11838
12089
|
this._setAttr(this.attributes[i].name);
|
|
11839
12090
|
}
|
|
11840
|
-
this._ob = new MutationObserver((
|
|
11841
|
-
for (const m of mutations) {
|
|
11842
|
-
this._setAttr(m.attributeName);
|
|
11843
|
-
}
|
|
11844
|
-
});
|
|
12091
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
11845
12092
|
this._ob.observe(this, { attributes: true });
|
|
11846
12093
|
const resolve = (def, isAsync = false) => {
|
|
11847
12094
|
this._resolved = true;
|
|
@@ -11918,7 +12165,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11918
12165
|
return this._getProp(key);
|
|
11919
12166
|
},
|
|
11920
12167
|
set(val) {
|
|
11921
|
-
this._setProp(key, val, true,
|
|
12168
|
+
this._setProp(key, val, true, !this._patching);
|
|
11922
12169
|
}
|
|
11923
12170
|
});
|
|
11924
12171
|
}
|
|
@@ -11944,6 +12191,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11944
12191
|
*/
|
|
11945
12192
|
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
11946
12193
|
if (val !== this._props[key]) {
|
|
12194
|
+
this._dirty = true;
|
|
11947
12195
|
if (val === REMOVAL) {
|
|
11948
12196
|
delete this._props[key];
|
|
11949
12197
|
} else {
|
|
@@ -11957,7 +12205,10 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11957
12205
|
}
|
|
11958
12206
|
if (shouldReflect) {
|
|
11959
12207
|
const ob = this._ob;
|
|
11960
|
-
|
|
12208
|
+
if (ob) {
|
|
12209
|
+
this._processMutations(ob.takeRecords());
|
|
12210
|
+
ob.disconnect();
|
|
12211
|
+
}
|
|
11961
12212
|
if (val === true) {
|
|
11962
12213
|
this.setAttribute(hyphenate(key), "");
|
|
11963
12214
|
} else if (typeof val === "string" || typeof val === "number") {
|
|
@@ -12061,7 +12312,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12061
12312
|
* Only called when shadowRoot is false
|
|
12062
12313
|
*/
|
|
12063
12314
|
_renderSlots() {
|
|
12064
|
-
const outlets =
|
|
12315
|
+
const outlets = this._getSlots();
|
|
12065
12316
|
const scopeId = this._instance.type.__scopeId;
|
|
12066
12317
|
for (let i = 0; i < outlets.length; i++) {
|
|
12067
12318
|
const o = outlets[i];
|
|
@@ -12087,12 +12338,45 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12087
12338
|
parent.removeChild(o);
|
|
12088
12339
|
}
|
|
12089
12340
|
}
|
|
12341
|
+
/**
|
|
12342
|
+
* @internal
|
|
12343
|
+
*/
|
|
12344
|
+
_getSlots() {
|
|
12345
|
+
const roots = [this];
|
|
12346
|
+
if (this._teleportTargets) {
|
|
12347
|
+
roots.push(...this._teleportTargets);
|
|
12348
|
+
}
|
|
12349
|
+
const slots = /* @__PURE__ */ new Set();
|
|
12350
|
+
for (const root of roots) {
|
|
12351
|
+
const found = root.querySelectorAll("slot");
|
|
12352
|
+
for (let i = 0; i < found.length; i++) {
|
|
12353
|
+
slots.add(found[i]);
|
|
12354
|
+
}
|
|
12355
|
+
}
|
|
12356
|
+
return Array.from(slots);
|
|
12357
|
+
}
|
|
12090
12358
|
/**
|
|
12091
12359
|
* @internal
|
|
12092
12360
|
*/
|
|
12093
12361
|
_injectChildStyle(comp) {
|
|
12094
12362
|
this._applyStyles(comp.styles, comp);
|
|
12095
12363
|
}
|
|
12364
|
+
/**
|
|
12365
|
+
* @internal
|
|
12366
|
+
*/
|
|
12367
|
+
_beginPatch() {
|
|
12368
|
+
this._patching = true;
|
|
12369
|
+
this._dirty = false;
|
|
12370
|
+
}
|
|
12371
|
+
/**
|
|
12372
|
+
* @internal
|
|
12373
|
+
*/
|
|
12374
|
+
_endPatch() {
|
|
12375
|
+
this._patching = false;
|
|
12376
|
+
if (this._dirty && this._instance) {
|
|
12377
|
+
this._update();
|
|
12378
|
+
}
|
|
12379
|
+
}
|
|
12096
12380
|
/**
|
|
12097
12381
|
* @internal
|
|
12098
12382
|
*/
|
|
@@ -12173,26 +12457,13 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12173
12457
|
prevChildren = [];
|
|
12174
12458
|
return;
|
|
12175
12459
|
}
|
|
12176
|
-
prevChildren.forEach(callPendingCbs);
|
|
12460
|
+
prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
|
|
12177
12461
|
prevChildren.forEach(recordPosition);
|
|
12178
12462
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
12179
|
-
forceReflow();
|
|
12463
|
+
forceReflow(instance.vnode.el);
|
|
12180
12464
|
movedChildren.forEach((c) => {
|
|
12181
12465
|
const el = c.el;
|
|
12182
|
-
|
|
12183
|
-
addTransitionClass(el, moveClass);
|
|
12184
|
-
style.transform = style.webkitTransform = style.transitionDuration = "";
|
|
12185
|
-
const cb = el[moveCbKey] = (e) => {
|
|
12186
|
-
if (e && e.target !== el) {
|
|
12187
|
-
return;
|
|
12188
|
-
}
|
|
12189
|
-
if (!e || /transform$/.test(e.propertyName)) {
|
|
12190
|
-
el.removeEventListener("transitionend", cb);
|
|
12191
|
-
el[moveCbKey] = null;
|
|
12192
|
-
removeTransitionClass(el, moveClass);
|
|
12193
|
-
}
|
|
12194
|
-
};
|
|
12195
|
-
el.addEventListener("transitionend", cb);
|
|
12466
|
+
handleMovedChildren(el, moveClass);
|
|
12196
12467
|
});
|
|
12197
12468
|
prevChildren = [];
|
|
12198
12469
|
});
|
|
@@ -12215,10 +12486,10 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12215
12486
|
instance
|
|
12216
12487
|
)
|
|
12217
12488
|
);
|
|
12218
|
-
positionMap.set(
|
|
12219
|
-
child,
|
|
12220
|
-
child.el.
|
|
12221
|
-
);
|
|
12489
|
+
positionMap.set(child, {
|
|
12490
|
+
left: child.el.offsetLeft,
|
|
12491
|
+
top: child.el.offsetTop
|
|
12492
|
+
});
|
|
12222
12493
|
}
|
|
12223
12494
|
}
|
|
12224
12495
|
}
|
|
@@ -12239,8 +12510,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12239
12510
|
}
|
|
12240
12511
|
});
|
|
12241
12512
|
const TransitionGroup = TransitionGroupImpl;
|
|
12242
|
-
function callPendingCbs(
|
|
12243
|
-
const el = c.el;
|
|
12513
|
+
function callPendingCbs(el) {
|
|
12244
12514
|
if (el[moveCbKey]) {
|
|
12245
12515
|
el[moveCbKey]();
|
|
12246
12516
|
}
|
|
@@ -12249,19 +12519,30 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12249
12519
|
}
|
|
12250
12520
|
}
|
|
12251
12521
|
function recordPosition(c) {
|
|
12252
|
-
newPositionMap.set(c,
|
|
12522
|
+
newPositionMap.set(c, {
|
|
12523
|
+
left: c.el.offsetLeft,
|
|
12524
|
+
top: c.el.offsetTop
|
|
12525
|
+
});
|
|
12253
12526
|
}
|
|
12254
12527
|
function applyTranslation(c) {
|
|
12255
|
-
|
|
12256
|
-
|
|
12528
|
+
if (baseApplyTranslation(
|
|
12529
|
+
positionMap.get(c),
|
|
12530
|
+
newPositionMap.get(c),
|
|
12531
|
+
c.el
|
|
12532
|
+
)) {
|
|
12533
|
+
return c;
|
|
12534
|
+
}
|
|
12535
|
+
}
|
|
12536
|
+
function baseApplyTranslation(oldPos, newPos, el) {
|
|
12257
12537
|
const dx = oldPos.left - newPos.left;
|
|
12258
12538
|
const dy = oldPos.top - newPos.top;
|
|
12259
12539
|
if (dx || dy) {
|
|
12260
|
-
const s =
|
|
12540
|
+
const s = el.style;
|
|
12261
12541
|
s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
|
|
12262
12542
|
s.transitionDuration = "0s";
|
|
12263
|
-
return
|
|
12543
|
+
return true;
|
|
12264
12544
|
}
|
|
12545
|
+
return false;
|
|
12265
12546
|
}
|
|
12266
12547
|
function hasCSSTransform(el, root, moveClass) {
|
|
12267
12548
|
const clone = el.cloneNode();
|
|
@@ -12279,6 +12560,22 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12279
12560
|
container.removeChild(clone);
|
|
12280
12561
|
return hasTransform;
|
|
12281
12562
|
}
|
|
12563
|
+
const handleMovedChildren = (el, moveClass) => {
|
|
12564
|
+
const style = el.style;
|
|
12565
|
+
addTransitionClass(el, moveClass);
|
|
12566
|
+
style.transform = style.webkitTransform = style.transitionDuration = "";
|
|
12567
|
+
const cb = el[moveCbKey] = (e) => {
|
|
12568
|
+
if (e && e.target !== el) {
|
|
12569
|
+
return;
|
|
12570
|
+
}
|
|
12571
|
+
if (!e || e.propertyName.endsWith("transform")) {
|
|
12572
|
+
el.removeEventListener("transitionend", cb);
|
|
12573
|
+
el[moveCbKey] = null;
|
|
12574
|
+
removeTransitionClass(el, moveClass);
|
|
12575
|
+
}
|
|
12576
|
+
};
|
|
12577
|
+
el.addEventListener("transitionend", cb);
|
|
12578
|
+
};
|
|
12282
12579
|
|
|
12283
12580
|
const getModelAssigner = (vnode) => {
|
|
12284
12581
|
const fn = vnode.props["onUpdate:modelValue"] || false;
|
|
@@ -12314,21 +12611,21 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12314
12611
|
vModelTextUpdate(el, oldValue, value, trim, number, lazy);
|
|
12315
12612
|
}
|
|
12316
12613
|
};
|
|
12614
|
+
function castValue(value, trim, number) {
|
|
12615
|
+
if (trim) value = value.trim();
|
|
12616
|
+
if (number) value = looseToNumber(value);
|
|
12617
|
+
return value;
|
|
12618
|
+
}
|
|
12317
12619
|
const vModelTextInit = (el, trim, number, lazy, set) => {
|
|
12318
12620
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
12319
12621
|
if (e.target.composing) return;
|
|
12320
|
-
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
}
|
|
12324
|
-
if (number || el.type === "number") {
|
|
12325
|
-
domValue = looseToNumber(domValue);
|
|
12326
|
-
}
|
|
12327
|
-
(0, el[assignKey])(domValue);
|
|
12622
|
+
(0, el[assignKey])(
|
|
12623
|
+
castValue(el.value, trim, number || el.type === "number")
|
|
12624
|
+
);
|
|
12328
12625
|
});
|
|
12329
|
-
if (trim) {
|
|
12626
|
+
if (trim || number) {
|
|
12330
12627
|
addEventListener(el, "change", () => {
|
|
12331
|
-
el.value = el.value.
|
|
12628
|
+
el.value = castValue(el.value, trim, number || el.type === "number");
|
|
12332
12629
|
});
|
|
12333
12630
|
}
|
|
12334
12631
|
if (!lazy) {
|
|
@@ -12577,13 +12874,13 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12577
12874
|
const withModifiers = (fn, modifiers) => {
|
|
12578
12875
|
const cache = fn._withMods || (fn._withMods = {});
|
|
12579
12876
|
const cacheKey = modifiers.join(".");
|
|
12580
|
-
return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
|
|
12877
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
|
|
12581
12878
|
for (let i = 0; i < modifiers.length; i++) {
|
|
12582
12879
|
const guard = modifierGuards[modifiers[i]];
|
|
12583
12880
|
if (guard && guard(event, modifiers)) return;
|
|
12584
12881
|
}
|
|
12585
12882
|
return fn(event, ...args);
|
|
12586
|
-
});
|
|
12883
|
+
}));
|
|
12587
12884
|
};
|
|
12588
12885
|
const keyNames = {
|
|
12589
12886
|
esc: "escape",
|
|
@@ -12597,7 +12894,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12597
12894
|
const withKeys = (fn, modifiers) => {
|
|
12598
12895
|
const cache = fn._withKeys || (fn._withKeys = {});
|
|
12599
12896
|
const cacheKey = modifiers.join(".");
|
|
12600
|
-
return cache[cacheKey] || (cache[cacheKey] = (event) => {
|
|
12897
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event) => {
|
|
12601
12898
|
if (!("key" in event)) {
|
|
12602
12899
|
return;
|
|
12603
12900
|
}
|
|
@@ -12607,7 +12904,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12607
12904
|
)) {
|
|
12608
12905
|
return fn(event);
|
|
12609
12906
|
}
|
|
12610
|
-
});
|
|
12907
|
+
}));
|
|
12611
12908
|
};
|
|
12612
12909
|
|
|
12613
12910
|
const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
|
|
@@ -12621,13 +12918,13 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12621
12918
|
enabledHydration = true;
|
|
12622
12919
|
return renderer;
|
|
12623
12920
|
}
|
|
12624
|
-
const render = (...args) => {
|
|
12921
|
+
const render = ((...args) => {
|
|
12625
12922
|
ensureRenderer().render(...args);
|
|
12626
|
-
};
|
|
12627
|
-
const hydrate = (...args) => {
|
|
12923
|
+
});
|
|
12924
|
+
const hydrate = ((...args) => {
|
|
12628
12925
|
ensureHydrationRenderer().hydrate(...args);
|
|
12629
|
-
};
|
|
12630
|
-
const createApp = (...args) => {
|
|
12926
|
+
});
|
|
12927
|
+
const createApp = ((...args) => {
|
|
12631
12928
|
const app = ensureRenderer().createApp(...args);
|
|
12632
12929
|
{
|
|
12633
12930
|
injectNativeTagCheck(app);
|
|
@@ -12652,8 +12949,8 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12652
12949
|
return proxy;
|
|
12653
12950
|
};
|
|
12654
12951
|
return app;
|
|
12655
|
-
};
|
|
12656
|
-
const createSSRApp = (...args) => {
|
|
12952
|
+
});
|
|
12953
|
+
const createSSRApp = ((...args) => {
|
|
12657
12954
|
const app = ensureHydrationRenderer().createApp(...args);
|
|
12658
12955
|
{
|
|
12659
12956
|
injectNativeTagCheck(app);
|
|
@@ -12667,7 +12964,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12667
12964
|
}
|
|
12668
12965
|
};
|
|
12669
12966
|
return app;
|
|
12670
|
-
};
|
|
12967
|
+
});
|
|
12671
12968
|
function resolveRootNamespace(container) {
|
|
12672
12969
|
if (container instanceof SVGElement) {
|
|
12673
12970
|
return "svg";
|