@vue/runtime-core 3.3.5 → 3.3.7
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-core.cjs.js +83 -36
- package/dist/runtime-core.cjs.prod.js +83 -36
- package/dist/runtime-core.d.ts +67 -65
- package/dist/runtime-core.esm-bundler.js +83 -36
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -242,8 +242,13 @@ function findInsertionIndex(id) {
|
|
|
242
242
|
let end = queue.length;
|
|
243
243
|
while (start < end) {
|
|
244
244
|
const middle = start + end >>> 1;
|
|
245
|
-
const
|
|
246
|
-
middleJobId
|
|
245
|
+
const middleJob = queue[middle];
|
|
246
|
+
const middleJobId = getId(middleJob);
|
|
247
|
+
if (middleJobId < id || middleJobId === id && middleJob.pre) {
|
|
248
|
+
start = middle + 1;
|
|
249
|
+
} else {
|
|
250
|
+
end = middle;
|
|
251
|
+
}
|
|
247
252
|
}
|
|
248
253
|
return start;
|
|
249
254
|
}
|
|
@@ -1358,14 +1363,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
1358
1363
|
parentComponent: parentComponent2,
|
|
1359
1364
|
container: container2
|
|
1360
1365
|
} = suspense;
|
|
1366
|
+
let delayEnter = false;
|
|
1361
1367
|
if (suspense.isHydrating) {
|
|
1362
1368
|
suspense.isHydrating = false;
|
|
1363
1369
|
} else if (!resume) {
|
|
1364
|
-
|
|
1370
|
+
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
1365
1371
|
if (delayEnter) {
|
|
1366
1372
|
activeBranch.transition.afterLeave = () => {
|
|
1367
1373
|
if (pendingId === suspense.pendingId) {
|
|
1368
1374
|
move(pendingBranch, container2, anchor2, 0);
|
|
1375
|
+
queuePostFlushCb(effects);
|
|
1369
1376
|
}
|
|
1370
1377
|
};
|
|
1371
1378
|
}
|
|
@@ -1391,7 +1398,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
1391
1398
|
}
|
|
1392
1399
|
parent = parent.parent;
|
|
1393
1400
|
}
|
|
1394
|
-
if (!hasUnresolvedAncestor) {
|
|
1401
|
+
if (!hasUnresolvedAncestor && !delayEnter) {
|
|
1395
1402
|
queuePostFlushCb(effects);
|
|
1396
1403
|
}
|
|
1397
1404
|
suspense.effects = [];
|
|
@@ -3720,7 +3727,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3720
3727
|
}
|
|
3721
3728
|
});
|
|
3722
3729
|
}
|
|
3723
|
-
const installedPlugins = /* @__PURE__ */ new
|
|
3730
|
+
const installedPlugins = /* @__PURE__ */ new WeakSet();
|
|
3724
3731
|
let isMounted = false;
|
|
3725
3732
|
const app = context.app = {
|
|
3726
3733
|
_uid: uid$1++,
|
|
@@ -4384,7 +4391,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4384
4391
|
}
|
|
4385
4392
|
if (needDeletionCheck) {
|
|
4386
4393
|
for (const key in slots) {
|
|
4387
|
-
if (!isInternalKey(key) &&
|
|
4394
|
+
if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
|
|
4388
4395
|
delete slots[key];
|
|
4389
4396
|
}
|
|
4390
4397
|
}
|
|
@@ -4560,7 +4567,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4560
4567
|
break;
|
|
4561
4568
|
case Comment:
|
|
4562
4569
|
if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
4563
|
-
|
|
4570
|
+
if (node.tagName.toLowerCase() === "template") {
|
|
4571
|
+
const content = vnode.el.content.firstChild;
|
|
4572
|
+
replaceNode(content, node, parentComponent);
|
|
4573
|
+
vnode.el = node = content;
|
|
4574
|
+
nextNode = nextSibling(node);
|
|
4575
|
+
} else {
|
|
4576
|
+
nextNode = onMismatch();
|
|
4577
|
+
}
|
|
4564
4578
|
} else {
|
|
4565
4579
|
nextNode = nextSibling(node);
|
|
4566
4580
|
}
|
|
@@ -4602,7 +4616,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4602
4616
|
break;
|
|
4603
4617
|
default:
|
|
4604
4618
|
if (shapeFlag & 1) {
|
|
4605
|
-
if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
|
|
4619
|
+
if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
|
|
4606
4620
|
nextNode = onMismatch();
|
|
4607
4621
|
} else {
|
|
4608
4622
|
nextNode = hydrateElement(
|
|
@@ -4617,6 +4631,13 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4617
4631
|
} else if (shapeFlag & 6) {
|
|
4618
4632
|
vnode.slotScopeIds = slotScopeIds;
|
|
4619
4633
|
const container = parentNode(node);
|
|
4634
|
+
if (isFragmentStart) {
|
|
4635
|
+
nextNode = locateClosingAnchor(node);
|
|
4636
|
+
} else if (isComment(node) && node.data === "teleport start") {
|
|
4637
|
+
nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
4638
|
+
} else {
|
|
4639
|
+
nextNode = nextSibling(node);
|
|
4640
|
+
}
|
|
4620
4641
|
mountComponent(
|
|
4621
4642
|
vnode,
|
|
4622
4643
|
container,
|
|
@@ -4626,10 +4647,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4626
4647
|
isSVGContainer(container),
|
|
4627
4648
|
optimized
|
|
4628
4649
|
);
|
|
4629
|
-
nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
|
|
4630
|
-
if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
|
|
4631
|
-
nextNode = nextSibling(nextNode);
|
|
4632
|
-
}
|
|
4633
4650
|
if (isAsyncWrapper(vnode)) {
|
|
4634
4651
|
let subTree;
|
|
4635
4652
|
if (isFragmentStart) {
|
|
@@ -4679,7 +4696,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4679
4696
|
};
|
|
4680
4697
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
4681
4698
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4682
|
-
const { type, props, patchFlag, shapeFlag, dirs } = vnode;
|
|
4699
|
+
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4683
4700
|
const forcePatchValue = type === "input" && dirs || type === "option";
|
|
4684
4701
|
{
|
|
4685
4702
|
if (dirs) {
|
|
@@ -4716,12 +4733,23 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4716
4733
|
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
4717
4734
|
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
4718
4735
|
}
|
|
4736
|
+
let needCallTransitionHooks = false;
|
|
4737
|
+
if (isTemplateNode(el)) {
|
|
4738
|
+
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
4739
|
+
const content = el.content.firstChild;
|
|
4740
|
+
if (needCallTransitionHooks) {
|
|
4741
|
+
transition.beforeEnter(content);
|
|
4742
|
+
}
|
|
4743
|
+
replaceNode(content, el, parentComponent);
|
|
4744
|
+
vnode.el = el = content;
|
|
4745
|
+
}
|
|
4719
4746
|
if (dirs) {
|
|
4720
4747
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
4721
4748
|
}
|
|
4722
|
-
if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
|
|
4749
|
+
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
4723
4750
|
queueEffectWithSuspense(() => {
|
|
4724
4751
|
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
4752
|
+
needCallTransitionHooks && transition.enter(el);
|
|
4725
4753
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
4726
4754
|
}, parentSuspense);
|
|
4727
4755
|
}
|
|
@@ -4839,7 +4867,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4839
4867
|
);
|
|
4840
4868
|
vnode.el = null;
|
|
4841
4869
|
if (isFragment) {
|
|
4842
|
-
const end =
|
|
4870
|
+
const end = locateClosingAnchor(node);
|
|
4843
4871
|
while (true) {
|
|
4844
4872
|
const next2 = nextSibling(node);
|
|
4845
4873
|
if (next2 && next2 !== end) {
|
|
@@ -4864,14 +4892,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4864
4892
|
);
|
|
4865
4893
|
return next;
|
|
4866
4894
|
};
|
|
4867
|
-
const
|
|
4895
|
+
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
4868
4896
|
let match = 0;
|
|
4869
4897
|
while (node) {
|
|
4870
4898
|
node = nextSibling(node);
|
|
4871
4899
|
if (node && isComment(node)) {
|
|
4872
|
-
if (node.data ===
|
|
4900
|
+
if (node.data === open)
|
|
4873
4901
|
match++;
|
|
4874
|
-
if (node.data ===
|
|
4902
|
+
if (node.data === close) {
|
|
4875
4903
|
if (match === 0) {
|
|
4876
4904
|
return nextSibling(node);
|
|
4877
4905
|
} else {
|
|
@@ -4882,6 +4910,23 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4882
4910
|
}
|
|
4883
4911
|
return node;
|
|
4884
4912
|
};
|
|
4913
|
+
const replaceNode = (newNode, oldNode, parentComponent) => {
|
|
4914
|
+
const parentNode2 = oldNode.parentNode;
|
|
4915
|
+
if (parentNode2) {
|
|
4916
|
+
parentNode2.replaceChild(newNode, oldNode);
|
|
4917
|
+
}
|
|
4918
|
+
let parent = parentComponent;
|
|
4919
|
+
while (parent) {
|
|
4920
|
+
if (parent.vnode.el === oldNode) {
|
|
4921
|
+
parent.vnode.el = newNode;
|
|
4922
|
+
parent.subTree.el = newNode;
|
|
4923
|
+
}
|
|
4924
|
+
parent = parent.parent;
|
|
4925
|
+
}
|
|
4926
|
+
};
|
|
4927
|
+
const isTemplateNode = (node) => {
|
|
4928
|
+
return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
|
|
4929
|
+
};
|
|
4885
4930
|
return [hydrate, hydrateNode];
|
|
4886
4931
|
}
|
|
4887
4932
|
|
|
@@ -5209,7 +5254,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5209
5254
|
if (dirs) {
|
|
5210
5255
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
5211
5256
|
}
|
|
5212
|
-
const needCallTransitionHooks = (
|
|
5257
|
+
const needCallTransitionHooks = needTransition(parentSuspense, transition);
|
|
5213
5258
|
if (needCallTransitionHooks) {
|
|
5214
5259
|
transition.beforeEnter(el);
|
|
5215
5260
|
}
|
|
@@ -6101,8 +6146,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6101
6146
|
moveStaticNode(vnode, container, anchor);
|
|
6102
6147
|
return;
|
|
6103
6148
|
}
|
|
6104
|
-
const
|
|
6105
|
-
if (
|
|
6149
|
+
const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
|
|
6150
|
+
if (needTransition2) {
|
|
6106
6151
|
if (moveType === 0) {
|
|
6107
6152
|
transition.beforeEnter(el);
|
|
6108
6153
|
hostInsert(el, container, anchor);
|
|
@@ -6322,6 +6367,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6322
6367
|
function toggleRecurse({ effect, update }, allowed) {
|
|
6323
6368
|
effect.allowRecurse = update.allowRecurse = allowed;
|
|
6324
6369
|
}
|
|
6370
|
+
function needTransition(parentSuspense, transition) {
|
|
6371
|
+
return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
|
|
6372
|
+
}
|
|
6325
6373
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
6326
6374
|
const ch1 = n1.children;
|
|
6327
6375
|
const ch2 = n2.children;
|
|
@@ -6547,19 +6595,18 @@ const TeleportImpl = {
|
|
|
6547
6595
|
if (target) {
|
|
6548
6596
|
hostRemove(targetAnchor);
|
|
6549
6597
|
}
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
}
|
|
6598
|
+
doRemove && hostRemove(anchor);
|
|
6599
|
+
if (shapeFlag & 16) {
|
|
6600
|
+
const shouldRemove = doRemove || !isTeleportDisabled(props);
|
|
6601
|
+
for (let i = 0; i < children.length; i++) {
|
|
6602
|
+
const child = children[i];
|
|
6603
|
+
unmount(
|
|
6604
|
+
child,
|
|
6605
|
+
parentComponent,
|
|
6606
|
+
parentSuspense,
|
|
6607
|
+
shouldRemove,
|
|
6608
|
+
!!child.dynamicChildren
|
|
6609
|
+
);
|
|
6563
6610
|
}
|
|
6564
6611
|
}
|
|
6565
6612
|
},
|
|
@@ -6643,7 +6690,7 @@ function updateCssVars(vnode) {
|
|
|
6643
6690
|
const ctx = vnode.ctx;
|
|
6644
6691
|
if (ctx && ctx.ut) {
|
|
6645
6692
|
let node = vnode.children[0].el;
|
|
6646
|
-
while (node !== vnode.targetAnchor) {
|
|
6693
|
+
while (node && node !== vnode.targetAnchor) {
|
|
6647
6694
|
if (node.nodeType === 1)
|
|
6648
6695
|
node.setAttribute("data-v-owner", ctx.uid);
|
|
6649
6696
|
node = node.nextSibling;
|
|
@@ -7674,7 +7721,7 @@ function isMemoSame(cached, memo) {
|
|
|
7674
7721
|
return true;
|
|
7675
7722
|
}
|
|
7676
7723
|
|
|
7677
|
-
const version = "3.3.
|
|
7724
|
+
const version = "3.3.7";
|
|
7678
7725
|
const _ssrUtils = {
|
|
7679
7726
|
createComponentInstance,
|
|
7680
7727
|
setupComponent,
|
|
@@ -91,8 +91,13 @@ function findInsertionIndex(id) {
|
|
|
91
91
|
let end = queue.length;
|
|
92
92
|
while (start < end) {
|
|
93
93
|
const middle = start + end >>> 1;
|
|
94
|
-
const
|
|
95
|
-
middleJobId
|
|
94
|
+
const middleJob = queue[middle];
|
|
95
|
+
const middleJobId = getId(middleJob);
|
|
96
|
+
if (middleJobId < id || middleJobId === id && middleJob.pre) {
|
|
97
|
+
start = middle + 1;
|
|
98
|
+
} else {
|
|
99
|
+
end = middle;
|
|
100
|
+
}
|
|
96
101
|
}
|
|
97
102
|
return start;
|
|
98
103
|
}
|
|
@@ -854,14 +859,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
854
859
|
parentComponent: parentComponent2,
|
|
855
860
|
container: container2
|
|
856
861
|
} = suspense;
|
|
862
|
+
let delayEnter = false;
|
|
857
863
|
if (suspense.isHydrating) {
|
|
858
864
|
suspense.isHydrating = false;
|
|
859
865
|
} else if (!resume) {
|
|
860
|
-
|
|
866
|
+
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
861
867
|
if (delayEnter) {
|
|
862
868
|
activeBranch.transition.afterLeave = () => {
|
|
863
869
|
if (pendingId === suspense.pendingId) {
|
|
864
870
|
move(pendingBranch, container2, anchor2, 0);
|
|
871
|
+
queuePostFlushCb(effects);
|
|
865
872
|
}
|
|
866
873
|
};
|
|
867
874
|
}
|
|
@@ -887,7 +894,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
887
894
|
}
|
|
888
895
|
parent = parent.parent;
|
|
889
896
|
}
|
|
890
|
-
if (!hasUnresolvedAncestor) {
|
|
897
|
+
if (!hasUnresolvedAncestor && !delayEnter) {
|
|
891
898
|
queuePostFlushCb(effects);
|
|
892
899
|
}
|
|
893
900
|
suspense.effects = [];
|
|
@@ -2875,7 +2882,7 @@ function createAppAPI(render, hydrate) {
|
|
|
2875
2882
|
rootProps = null;
|
|
2876
2883
|
}
|
|
2877
2884
|
const context = createAppContext();
|
|
2878
|
-
const installedPlugins = /* @__PURE__ */ new
|
|
2885
|
+
const installedPlugins = /* @__PURE__ */ new WeakSet();
|
|
2879
2886
|
let isMounted = false;
|
|
2880
2887
|
const app = context.app = {
|
|
2881
2888
|
_uid: uid$1++,
|
|
@@ -3336,7 +3343,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
3336
3343
|
}
|
|
3337
3344
|
if (needDeletionCheck) {
|
|
3338
3345
|
for (const key in slots) {
|
|
3339
|
-
if (!isInternalKey(key) &&
|
|
3346
|
+
if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
|
|
3340
3347
|
delete slots[key];
|
|
3341
3348
|
}
|
|
3342
3349
|
}
|
|
@@ -3492,7 +3499,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3492
3499
|
break;
|
|
3493
3500
|
case Comment:
|
|
3494
3501
|
if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
3495
|
-
|
|
3502
|
+
if (node.tagName.toLowerCase() === "template") {
|
|
3503
|
+
const content = vnode.el.content.firstChild;
|
|
3504
|
+
replaceNode(content, node, parentComponent);
|
|
3505
|
+
vnode.el = node = content;
|
|
3506
|
+
nextNode = nextSibling(node);
|
|
3507
|
+
} else {
|
|
3508
|
+
nextNode = onMismatch();
|
|
3509
|
+
}
|
|
3496
3510
|
} else {
|
|
3497
3511
|
nextNode = nextSibling(node);
|
|
3498
3512
|
}
|
|
@@ -3534,7 +3548,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3534
3548
|
break;
|
|
3535
3549
|
default:
|
|
3536
3550
|
if (shapeFlag & 1) {
|
|
3537
|
-
if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
|
|
3551
|
+
if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
|
|
3538
3552
|
nextNode = onMismatch();
|
|
3539
3553
|
} else {
|
|
3540
3554
|
nextNode = hydrateElement(
|
|
@@ -3549,6 +3563,13 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3549
3563
|
} else if (shapeFlag & 6) {
|
|
3550
3564
|
vnode.slotScopeIds = slotScopeIds;
|
|
3551
3565
|
const container = parentNode(node);
|
|
3566
|
+
if (isFragmentStart) {
|
|
3567
|
+
nextNode = locateClosingAnchor(node);
|
|
3568
|
+
} else if (isComment(node) && node.data === "teleport start") {
|
|
3569
|
+
nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
3570
|
+
} else {
|
|
3571
|
+
nextNode = nextSibling(node);
|
|
3572
|
+
}
|
|
3552
3573
|
mountComponent(
|
|
3553
3574
|
vnode,
|
|
3554
3575
|
container,
|
|
@@ -3558,10 +3579,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3558
3579
|
isSVGContainer(container),
|
|
3559
3580
|
optimized
|
|
3560
3581
|
);
|
|
3561
|
-
nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
|
|
3562
|
-
if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
|
|
3563
|
-
nextNode = nextSibling(nextNode);
|
|
3564
|
-
}
|
|
3565
3582
|
if (isAsyncWrapper(vnode)) {
|
|
3566
3583
|
let subTree;
|
|
3567
3584
|
if (isFragmentStart) {
|
|
@@ -3609,7 +3626,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3609
3626
|
};
|
|
3610
3627
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
3611
3628
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
3612
|
-
const { type, props, patchFlag, shapeFlag, dirs } = vnode;
|
|
3629
|
+
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
3613
3630
|
const forcePatchValue = type === "input" && dirs || type === "option";
|
|
3614
3631
|
if (forcePatchValue || patchFlag !== -1) {
|
|
3615
3632
|
if (dirs) {
|
|
@@ -3646,12 +3663,23 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3646
3663
|
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
3647
3664
|
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
3648
3665
|
}
|
|
3666
|
+
let needCallTransitionHooks = false;
|
|
3667
|
+
if (isTemplateNode(el)) {
|
|
3668
|
+
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
3669
|
+
const content = el.content.firstChild;
|
|
3670
|
+
if (needCallTransitionHooks) {
|
|
3671
|
+
transition.beforeEnter(content);
|
|
3672
|
+
}
|
|
3673
|
+
replaceNode(content, el, parentComponent);
|
|
3674
|
+
vnode.el = el = content;
|
|
3675
|
+
}
|
|
3649
3676
|
if (dirs) {
|
|
3650
3677
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
3651
3678
|
}
|
|
3652
|
-
if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
|
|
3679
|
+
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
3653
3680
|
queueEffectWithSuspense(() => {
|
|
3654
3681
|
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
3682
|
+
needCallTransitionHooks && transition.enter(el);
|
|
3655
3683
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
3656
3684
|
}, parentSuspense);
|
|
3657
3685
|
}
|
|
@@ -3741,7 +3769,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3741
3769
|
hasMismatch = true;
|
|
3742
3770
|
vnode.el = null;
|
|
3743
3771
|
if (isFragment) {
|
|
3744
|
-
const end =
|
|
3772
|
+
const end = locateClosingAnchor(node);
|
|
3745
3773
|
while (true) {
|
|
3746
3774
|
const next2 = nextSibling(node);
|
|
3747
3775
|
if (next2 && next2 !== end) {
|
|
@@ -3766,14 +3794,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3766
3794
|
);
|
|
3767
3795
|
return next;
|
|
3768
3796
|
};
|
|
3769
|
-
const
|
|
3797
|
+
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
3770
3798
|
let match = 0;
|
|
3771
3799
|
while (node) {
|
|
3772
3800
|
node = nextSibling(node);
|
|
3773
3801
|
if (node && isComment(node)) {
|
|
3774
|
-
if (node.data ===
|
|
3802
|
+
if (node.data === open)
|
|
3775
3803
|
match++;
|
|
3776
|
-
if (node.data ===
|
|
3804
|
+
if (node.data === close) {
|
|
3777
3805
|
if (match === 0) {
|
|
3778
3806
|
return nextSibling(node);
|
|
3779
3807
|
} else {
|
|
@@ -3784,6 +3812,23 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3784
3812
|
}
|
|
3785
3813
|
return node;
|
|
3786
3814
|
};
|
|
3815
|
+
const replaceNode = (newNode, oldNode, parentComponent) => {
|
|
3816
|
+
const parentNode2 = oldNode.parentNode;
|
|
3817
|
+
if (parentNode2) {
|
|
3818
|
+
parentNode2.replaceChild(newNode, oldNode);
|
|
3819
|
+
}
|
|
3820
|
+
let parent = parentComponent;
|
|
3821
|
+
while (parent) {
|
|
3822
|
+
if (parent.vnode.el === oldNode) {
|
|
3823
|
+
parent.vnode.el = newNode;
|
|
3824
|
+
parent.subTree.el = newNode;
|
|
3825
|
+
}
|
|
3826
|
+
parent = parent.parent;
|
|
3827
|
+
}
|
|
3828
|
+
};
|
|
3829
|
+
const isTemplateNode = (node) => {
|
|
3830
|
+
return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
|
|
3831
|
+
};
|
|
3787
3832
|
return [hydrate, hydrateNode];
|
|
3788
3833
|
}
|
|
3789
3834
|
|
|
@@ -4039,7 +4084,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4039
4084
|
if (dirs) {
|
|
4040
4085
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
4041
4086
|
}
|
|
4042
|
-
const needCallTransitionHooks = (
|
|
4087
|
+
const needCallTransitionHooks = needTransition(parentSuspense, transition);
|
|
4043
4088
|
if (needCallTransitionHooks) {
|
|
4044
4089
|
transition.beforeEnter(el);
|
|
4045
4090
|
}
|
|
@@ -4840,8 +4885,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4840
4885
|
moveStaticNode(vnode, container, anchor);
|
|
4841
4886
|
return;
|
|
4842
4887
|
}
|
|
4843
|
-
const
|
|
4844
|
-
if (
|
|
4888
|
+
const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
|
|
4889
|
+
if (needTransition2) {
|
|
4845
4890
|
if (moveType === 0) {
|
|
4846
4891
|
transition.beforeEnter(el);
|
|
4847
4892
|
hostInsert(el, container, anchor);
|
|
@@ -5047,6 +5092,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5047
5092
|
function toggleRecurse({ effect, update }, allowed) {
|
|
5048
5093
|
effect.allowRecurse = update.allowRecurse = allowed;
|
|
5049
5094
|
}
|
|
5095
|
+
function needTransition(parentSuspense, transition) {
|
|
5096
|
+
return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
|
|
5097
|
+
}
|
|
5050
5098
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
5051
5099
|
const ch1 = n1.children;
|
|
5052
5100
|
const ch2 = n2.children;
|
|
@@ -5246,19 +5294,18 @@ const TeleportImpl = {
|
|
|
5246
5294
|
if (target) {
|
|
5247
5295
|
hostRemove(targetAnchor);
|
|
5248
5296
|
}
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
}
|
|
5297
|
+
doRemove && hostRemove(anchor);
|
|
5298
|
+
if (shapeFlag & 16) {
|
|
5299
|
+
const shouldRemove = doRemove || !isTeleportDisabled(props);
|
|
5300
|
+
for (let i = 0; i < children.length; i++) {
|
|
5301
|
+
const child = children[i];
|
|
5302
|
+
unmount(
|
|
5303
|
+
child,
|
|
5304
|
+
parentComponent,
|
|
5305
|
+
parentSuspense,
|
|
5306
|
+
shouldRemove,
|
|
5307
|
+
!!child.dynamicChildren
|
|
5308
|
+
);
|
|
5262
5309
|
}
|
|
5263
5310
|
}
|
|
5264
5311
|
},
|
|
@@ -5342,7 +5389,7 @@ function updateCssVars(vnode) {
|
|
|
5342
5389
|
const ctx = vnode.ctx;
|
|
5343
5390
|
if (ctx && ctx.ut) {
|
|
5344
5391
|
let node = vnode.children[0].el;
|
|
5345
|
-
while (node !== vnode.targetAnchor) {
|
|
5392
|
+
while (node && node !== vnode.targetAnchor) {
|
|
5346
5393
|
if (node.nodeType === 1)
|
|
5347
5394
|
node.setAttribute("data-v-owner", ctx.uid);
|
|
5348
5395
|
node = node.nextSibling;
|
|
@@ -6023,7 +6070,7 @@ function isMemoSame(cached, memo) {
|
|
|
6023
6070
|
return true;
|
|
6024
6071
|
}
|
|
6025
6072
|
|
|
6026
|
-
const version = "3.3.
|
|
6073
|
+
const version = "3.3.7";
|
|
6027
6074
|
const _ssrUtils = {
|
|
6028
6075
|
createComponentInstance,
|
|
6029
6076
|
setupComponent,
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ D = {}, // return from data()
|
|
|
114
114
|
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}> = {
|
|
115
115
|
$: ComponentInternalInstance;
|
|
116
116
|
$data: D;
|
|
117
|
-
$props:
|
|
117
|
+
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
|
|
118
118
|
$attrs: Data;
|
|
119
119
|
$refs: Data;
|
|
120
120
|
$slots: UnwrapSlotsType<S>;
|
|
@@ -207,6 +207,69 @@ export type RootHydrateFunction = (vnode: VNode<Node, Element>, container: (Elem
|
|
|
207
207
|
_vnode?: VNode;
|
|
208
208
|
}) => void;
|
|
209
209
|
|
|
210
|
+
type Hook<T = () => void> = T | T[];
|
|
211
|
+
export interface BaseTransitionProps<HostElement = RendererElement> {
|
|
212
|
+
mode?: 'in-out' | 'out-in' | 'default';
|
|
213
|
+
appear?: boolean;
|
|
214
|
+
persisted?: boolean;
|
|
215
|
+
onBeforeEnter?: Hook<(el: HostElement) => void>;
|
|
216
|
+
onEnter?: Hook<(el: HostElement, done: () => void) => void>;
|
|
217
|
+
onAfterEnter?: Hook<(el: HostElement) => void>;
|
|
218
|
+
onEnterCancelled?: Hook<(el: HostElement) => void>;
|
|
219
|
+
onBeforeLeave?: Hook<(el: HostElement) => void>;
|
|
220
|
+
onLeave?: Hook<(el: HostElement, done: () => void) => void>;
|
|
221
|
+
onAfterLeave?: Hook<(el: HostElement) => void>;
|
|
222
|
+
onLeaveCancelled?: Hook<(el: HostElement) => void>;
|
|
223
|
+
onBeforeAppear?: Hook<(el: HostElement) => void>;
|
|
224
|
+
onAppear?: Hook<(el: HostElement, done: () => void) => void>;
|
|
225
|
+
onAfterAppear?: Hook<(el: HostElement) => void>;
|
|
226
|
+
onAppearCancelled?: Hook<(el: HostElement) => void>;
|
|
227
|
+
}
|
|
228
|
+
export interface TransitionHooks<HostElement = RendererElement> {
|
|
229
|
+
mode: BaseTransitionProps['mode'];
|
|
230
|
+
persisted: boolean;
|
|
231
|
+
beforeEnter(el: HostElement): void;
|
|
232
|
+
enter(el: HostElement): void;
|
|
233
|
+
leave(el: HostElement, remove: () => void): void;
|
|
234
|
+
clone(vnode: VNode): TransitionHooks<HostElement>;
|
|
235
|
+
afterLeave?(): void;
|
|
236
|
+
delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void;
|
|
237
|
+
delayedLeave?(): void;
|
|
238
|
+
}
|
|
239
|
+
export interface TransitionState {
|
|
240
|
+
isMounted: boolean;
|
|
241
|
+
isLeaving: boolean;
|
|
242
|
+
isUnmounting: boolean;
|
|
243
|
+
leavingVNodes: Map<any, Record<string, VNode>>;
|
|
244
|
+
}
|
|
245
|
+
export declare function useTransitionState(): TransitionState;
|
|
246
|
+
export declare const BaseTransitionPropsValidators: {
|
|
247
|
+
mode: StringConstructor;
|
|
248
|
+
appear: BooleanConstructor;
|
|
249
|
+
persisted: BooleanConstructor;
|
|
250
|
+
onBeforeEnter: (ArrayConstructor | FunctionConstructor)[];
|
|
251
|
+
onEnter: (ArrayConstructor | FunctionConstructor)[];
|
|
252
|
+
onAfterEnter: (ArrayConstructor | FunctionConstructor)[];
|
|
253
|
+
onEnterCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
254
|
+
onBeforeLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
255
|
+
onLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
256
|
+
onAfterLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
257
|
+
onLeaveCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
258
|
+
onBeforeAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
259
|
+
onAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
260
|
+
onAfterAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
261
|
+
onAppearCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
262
|
+
};
|
|
263
|
+
export declare const BaseTransition: new () => {
|
|
264
|
+
$props: BaseTransitionProps<any>;
|
|
265
|
+
$slots: {
|
|
266
|
+
default(): VNode[];
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
|
|
270
|
+
export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
|
|
271
|
+
export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
|
|
272
|
+
|
|
210
273
|
export interface Renderer<HostElement = RendererElement> {
|
|
211
274
|
render: RootRenderFunction<HostElement>;
|
|
212
275
|
createApp: CreateAppFunction<HostElement>;
|
|
@@ -745,69 +808,6 @@ export type Plugin<Options = any[]> = (PluginInstallFunction<Options> & {
|
|
|
745
808
|
};
|
|
746
809
|
export type CreateAppFunction<HostElement> = (rootComponent: Component, rootProps?: Data | null) => App<HostElement>;
|
|
747
810
|
|
|
748
|
-
type Hook<T = () => void> = T | T[];
|
|
749
|
-
export interface BaseTransitionProps<HostElement = RendererElement> {
|
|
750
|
-
mode?: 'in-out' | 'out-in' | 'default';
|
|
751
|
-
appear?: boolean;
|
|
752
|
-
persisted?: boolean;
|
|
753
|
-
onBeforeEnter?: Hook<(el: HostElement) => void>;
|
|
754
|
-
onEnter?: Hook<(el: HostElement, done: () => void) => void>;
|
|
755
|
-
onAfterEnter?: Hook<(el: HostElement) => void>;
|
|
756
|
-
onEnterCancelled?: Hook<(el: HostElement) => void>;
|
|
757
|
-
onBeforeLeave?: Hook<(el: HostElement) => void>;
|
|
758
|
-
onLeave?: Hook<(el: HostElement, done: () => void) => void>;
|
|
759
|
-
onAfterLeave?: Hook<(el: HostElement) => void>;
|
|
760
|
-
onLeaveCancelled?: Hook<(el: HostElement) => void>;
|
|
761
|
-
onBeforeAppear?: Hook<(el: HostElement) => void>;
|
|
762
|
-
onAppear?: Hook<(el: HostElement, done: () => void) => void>;
|
|
763
|
-
onAfterAppear?: Hook<(el: HostElement) => void>;
|
|
764
|
-
onAppearCancelled?: Hook<(el: HostElement) => void>;
|
|
765
|
-
}
|
|
766
|
-
export interface TransitionHooks<HostElement = RendererElement> {
|
|
767
|
-
mode: BaseTransitionProps['mode'];
|
|
768
|
-
persisted: boolean;
|
|
769
|
-
beforeEnter(el: HostElement): void;
|
|
770
|
-
enter(el: HostElement): void;
|
|
771
|
-
leave(el: HostElement, remove: () => void): void;
|
|
772
|
-
clone(vnode: VNode): TransitionHooks<HostElement>;
|
|
773
|
-
afterLeave?(): void;
|
|
774
|
-
delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void;
|
|
775
|
-
delayedLeave?(): void;
|
|
776
|
-
}
|
|
777
|
-
export interface TransitionState {
|
|
778
|
-
isMounted: boolean;
|
|
779
|
-
isLeaving: boolean;
|
|
780
|
-
isUnmounting: boolean;
|
|
781
|
-
leavingVNodes: Map<any, Record<string, VNode>>;
|
|
782
|
-
}
|
|
783
|
-
export declare function useTransitionState(): TransitionState;
|
|
784
|
-
export declare const BaseTransitionPropsValidators: {
|
|
785
|
-
mode: StringConstructor;
|
|
786
|
-
appear: BooleanConstructor;
|
|
787
|
-
persisted: BooleanConstructor;
|
|
788
|
-
onBeforeEnter: (ArrayConstructor | FunctionConstructor)[];
|
|
789
|
-
onEnter: (ArrayConstructor | FunctionConstructor)[];
|
|
790
|
-
onAfterEnter: (ArrayConstructor | FunctionConstructor)[];
|
|
791
|
-
onEnterCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
792
|
-
onBeforeLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
793
|
-
onLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
794
|
-
onAfterLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
795
|
-
onLeaveCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
796
|
-
onBeforeAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
797
|
-
onAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
798
|
-
onAfterAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
799
|
-
onAppearCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
800
|
-
};
|
|
801
|
-
export declare const BaseTransition: new () => {
|
|
802
|
-
$props: BaseTransitionProps<any>;
|
|
803
|
-
$slots: {
|
|
804
|
-
default(): VNode[];
|
|
805
|
-
};
|
|
806
|
-
};
|
|
807
|
-
export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
|
|
808
|
-
export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
|
|
809
|
-
export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
|
|
810
|
-
|
|
811
811
|
type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
|
|
812
812
|
export interface TeleportProps {
|
|
813
813
|
to: string | RendererElement | null | undefined;
|
|
@@ -816,7 +816,7 @@ export interface TeleportProps {
|
|
|
816
816
|
declare const TeleportImpl: {
|
|
817
817
|
__isTeleport: boolean;
|
|
818
818
|
process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, internals: RendererInternals): void;
|
|
819
|
-
remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, optimized: boolean, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove:
|
|
819
|
+
remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, optimized: boolean, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean): void;
|
|
820
820
|
move: typeof moveTeleport;
|
|
821
821
|
hydrate: typeof hydrateTeleport;
|
|
822
822
|
};
|
|
@@ -1383,6 +1383,8 @@ export declare function h(type: Constructor, children?: RawChildren): VNode;
|
|
|
1383
1383
|
export declare function h<P>(type: Constructor<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1384
1384
|
export declare function h(type: DefineComponent, children?: RawChildren): VNode;
|
|
1385
1385
|
export declare function h<P>(type: DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1386
|
+
export declare function h(type: string | Component, children?: RawChildren): VNode;
|
|
1387
|
+
export declare function h<P>(type: string | Component<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1386
1388
|
|
|
1387
1389
|
export declare const ssrContextKey: unique symbol;
|
|
1388
1390
|
export declare const useSSRContext: <T = Record<string, any>>() => T | undefined;
|
|
@@ -246,8 +246,13 @@ function findInsertionIndex(id) {
|
|
|
246
246
|
let end = queue.length;
|
|
247
247
|
while (start < end) {
|
|
248
248
|
const middle = start + end >>> 1;
|
|
249
|
-
const
|
|
250
|
-
middleJobId
|
|
249
|
+
const middleJob = queue[middle];
|
|
250
|
+
const middleJobId = getId(middleJob);
|
|
251
|
+
if (middleJobId < id || middleJobId === id && middleJob.pre) {
|
|
252
|
+
start = middle + 1;
|
|
253
|
+
} else {
|
|
254
|
+
end = middle;
|
|
255
|
+
}
|
|
251
256
|
}
|
|
252
257
|
return start;
|
|
253
258
|
}
|
|
@@ -1362,14 +1367,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
1362
1367
|
parentComponent: parentComponent2,
|
|
1363
1368
|
container: container2
|
|
1364
1369
|
} = suspense;
|
|
1370
|
+
let delayEnter = false;
|
|
1365
1371
|
if (suspense.isHydrating) {
|
|
1366
1372
|
suspense.isHydrating = false;
|
|
1367
1373
|
} else if (!resume) {
|
|
1368
|
-
|
|
1374
|
+
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
1369
1375
|
if (delayEnter) {
|
|
1370
1376
|
activeBranch.transition.afterLeave = () => {
|
|
1371
1377
|
if (pendingId === suspense.pendingId) {
|
|
1372
1378
|
move(pendingBranch, container2, anchor2, 0);
|
|
1379
|
+
queuePostFlushCb(effects);
|
|
1373
1380
|
}
|
|
1374
1381
|
};
|
|
1375
1382
|
}
|
|
@@ -1395,7 +1402,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
1395
1402
|
}
|
|
1396
1403
|
parent = parent.parent;
|
|
1397
1404
|
}
|
|
1398
|
-
if (!hasUnresolvedAncestor) {
|
|
1405
|
+
if (!hasUnresolvedAncestor && !delayEnter) {
|
|
1399
1406
|
queuePostFlushCb(effects);
|
|
1400
1407
|
}
|
|
1401
1408
|
suspense.effects = [];
|
|
@@ -3728,7 +3735,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3728
3735
|
}
|
|
3729
3736
|
});
|
|
3730
3737
|
}
|
|
3731
|
-
const installedPlugins = /* @__PURE__ */ new
|
|
3738
|
+
const installedPlugins = /* @__PURE__ */ new WeakSet();
|
|
3732
3739
|
let isMounted = false;
|
|
3733
3740
|
const app = context.app = {
|
|
3734
3741
|
_uid: uid$1++,
|
|
@@ -4394,7 +4401,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4394
4401
|
}
|
|
4395
4402
|
if (needDeletionCheck) {
|
|
4396
4403
|
for (const key in slots) {
|
|
4397
|
-
if (!isInternalKey(key) &&
|
|
4404
|
+
if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
|
|
4398
4405
|
delete slots[key];
|
|
4399
4406
|
}
|
|
4400
4407
|
}
|
|
@@ -4570,7 +4577,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4570
4577
|
break;
|
|
4571
4578
|
case Comment:
|
|
4572
4579
|
if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
4573
|
-
|
|
4580
|
+
if (node.tagName.toLowerCase() === "template") {
|
|
4581
|
+
const content = vnode.el.content.firstChild;
|
|
4582
|
+
replaceNode(content, node, parentComponent);
|
|
4583
|
+
vnode.el = node = content;
|
|
4584
|
+
nextNode = nextSibling(node);
|
|
4585
|
+
} else {
|
|
4586
|
+
nextNode = onMismatch();
|
|
4587
|
+
}
|
|
4574
4588
|
} else {
|
|
4575
4589
|
nextNode = nextSibling(node);
|
|
4576
4590
|
}
|
|
@@ -4612,7 +4626,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4612
4626
|
break;
|
|
4613
4627
|
default:
|
|
4614
4628
|
if (shapeFlag & 1) {
|
|
4615
|
-
if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
|
|
4629
|
+
if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
|
|
4616
4630
|
nextNode = onMismatch();
|
|
4617
4631
|
} else {
|
|
4618
4632
|
nextNode = hydrateElement(
|
|
@@ -4627,6 +4641,13 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4627
4641
|
} else if (shapeFlag & 6) {
|
|
4628
4642
|
vnode.slotScopeIds = slotScopeIds;
|
|
4629
4643
|
const container = parentNode(node);
|
|
4644
|
+
if (isFragmentStart) {
|
|
4645
|
+
nextNode = locateClosingAnchor(node);
|
|
4646
|
+
} else if (isComment(node) && node.data === "teleport start") {
|
|
4647
|
+
nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
4648
|
+
} else {
|
|
4649
|
+
nextNode = nextSibling(node);
|
|
4650
|
+
}
|
|
4630
4651
|
mountComponent(
|
|
4631
4652
|
vnode,
|
|
4632
4653
|
container,
|
|
@@ -4636,10 +4657,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4636
4657
|
isSVGContainer(container),
|
|
4637
4658
|
optimized
|
|
4638
4659
|
);
|
|
4639
|
-
nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
|
|
4640
|
-
if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
|
|
4641
|
-
nextNode = nextSibling(nextNode);
|
|
4642
|
-
}
|
|
4643
4660
|
if (isAsyncWrapper(vnode)) {
|
|
4644
4661
|
let subTree;
|
|
4645
4662
|
if (isFragmentStart) {
|
|
@@ -4689,7 +4706,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4689
4706
|
};
|
|
4690
4707
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
4691
4708
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4692
|
-
const { type, props, patchFlag, shapeFlag, dirs } = vnode;
|
|
4709
|
+
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4693
4710
|
const forcePatchValue = type === "input" && dirs || type === "option";
|
|
4694
4711
|
if (!!(process.env.NODE_ENV !== "production") || forcePatchValue || patchFlag !== -1) {
|
|
4695
4712
|
if (dirs) {
|
|
@@ -4726,12 +4743,23 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4726
4743
|
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
4727
4744
|
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
4728
4745
|
}
|
|
4746
|
+
let needCallTransitionHooks = false;
|
|
4747
|
+
if (isTemplateNode(el)) {
|
|
4748
|
+
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
4749
|
+
const content = el.content.firstChild;
|
|
4750
|
+
if (needCallTransitionHooks) {
|
|
4751
|
+
transition.beforeEnter(content);
|
|
4752
|
+
}
|
|
4753
|
+
replaceNode(content, el, parentComponent);
|
|
4754
|
+
vnode.el = el = content;
|
|
4755
|
+
}
|
|
4729
4756
|
if (dirs) {
|
|
4730
4757
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
4731
4758
|
}
|
|
4732
|
-
if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
|
|
4759
|
+
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
4733
4760
|
queueEffectWithSuspense(() => {
|
|
4734
4761
|
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
4762
|
+
needCallTransitionHooks && transition.enter(el);
|
|
4735
4763
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
4736
4764
|
}, parentSuspense);
|
|
4737
4765
|
}
|
|
@@ -4849,7 +4877,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4849
4877
|
);
|
|
4850
4878
|
vnode.el = null;
|
|
4851
4879
|
if (isFragment) {
|
|
4852
|
-
const end =
|
|
4880
|
+
const end = locateClosingAnchor(node);
|
|
4853
4881
|
while (true) {
|
|
4854
4882
|
const next2 = nextSibling(node);
|
|
4855
4883
|
if (next2 && next2 !== end) {
|
|
@@ -4874,14 +4902,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4874
4902
|
);
|
|
4875
4903
|
return next;
|
|
4876
4904
|
};
|
|
4877
|
-
const
|
|
4905
|
+
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
4878
4906
|
let match = 0;
|
|
4879
4907
|
while (node) {
|
|
4880
4908
|
node = nextSibling(node);
|
|
4881
4909
|
if (node && isComment(node)) {
|
|
4882
|
-
if (node.data ===
|
|
4910
|
+
if (node.data === open)
|
|
4883
4911
|
match++;
|
|
4884
|
-
if (node.data ===
|
|
4912
|
+
if (node.data === close) {
|
|
4885
4913
|
if (match === 0) {
|
|
4886
4914
|
return nextSibling(node);
|
|
4887
4915
|
} else {
|
|
@@ -4892,6 +4920,23 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4892
4920
|
}
|
|
4893
4921
|
return node;
|
|
4894
4922
|
};
|
|
4923
|
+
const replaceNode = (newNode, oldNode, parentComponent) => {
|
|
4924
|
+
const parentNode2 = oldNode.parentNode;
|
|
4925
|
+
if (parentNode2) {
|
|
4926
|
+
parentNode2.replaceChild(newNode, oldNode);
|
|
4927
|
+
}
|
|
4928
|
+
let parent = parentComponent;
|
|
4929
|
+
while (parent) {
|
|
4930
|
+
if (parent.vnode.el === oldNode) {
|
|
4931
|
+
parent.vnode.el = newNode;
|
|
4932
|
+
parent.subTree.el = newNode;
|
|
4933
|
+
}
|
|
4934
|
+
parent = parent.parent;
|
|
4935
|
+
}
|
|
4936
|
+
};
|
|
4937
|
+
const isTemplateNode = (node) => {
|
|
4938
|
+
return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
|
|
4939
|
+
};
|
|
4895
4940
|
return [hydrate, hydrateNode];
|
|
4896
4941
|
}
|
|
4897
4942
|
|
|
@@ -5242,7 +5287,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5242
5287
|
if (dirs) {
|
|
5243
5288
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
5244
5289
|
}
|
|
5245
|
-
const needCallTransitionHooks = (
|
|
5290
|
+
const needCallTransitionHooks = needTransition(parentSuspense, transition);
|
|
5246
5291
|
if (needCallTransitionHooks) {
|
|
5247
5292
|
transition.beforeEnter(el);
|
|
5248
5293
|
}
|
|
@@ -6145,8 +6190,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6145
6190
|
moveStaticNode(vnode, container, anchor);
|
|
6146
6191
|
return;
|
|
6147
6192
|
}
|
|
6148
|
-
const
|
|
6149
|
-
if (
|
|
6193
|
+
const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
|
|
6194
|
+
if (needTransition2) {
|
|
6150
6195
|
if (moveType === 0) {
|
|
6151
6196
|
transition.beforeEnter(el);
|
|
6152
6197
|
hostInsert(el, container, anchor);
|
|
@@ -6366,6 +6411,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6366
6411
|
function toggleRecurse({ effect, update }, allowed) {
|
|
6367
6412
|
effect.allowRecurse = update.allowRecurse = allowed;
|
|
6368
6413
|
}
|
|
6414
|
+
function needTransition(parentSuspense, transition) {
|
|
6415
|
+
return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
|
|
6416
|
+
}
|
|
6369
6417
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
6370
6418
|
const ch1 = n1.children;
|
|
6371
6419
|
const ch2 = n2.children;
|
|
@@ -6591,19 +6639,18 @@ const TeleportImpl = {
|
|
|
6591
6639
|
if (target) {
|
|
6592
6640
|
hostRemove(targetAnchor);
|
|
6593
6641
|
}
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
}
|
|
6642
|
+
doRemove && hostRemove(anchor);
|
|
6643
|
+
if (shapeFlag & 16) {
|
|
6644
|
+
const shouldRemove = doRemove || !isTeleportDisabled(props);
|
|
6645
|
+
for (let i = 0; i < children.length; i++) {
|
|
6646
|
+
const child = children[i];
|
|
6647
|
+
unmount(
|
|
6648
|
+
child,
|
|
6649
|
+
parentComponent,
|
|
6650
|
+
parentSuspense,
|
|
6651
|
+
shouldRemove,
|
|
6652
|
+
!!child.dynamicChildren
|
|
6653
|
+
);
|
|
6607
6654
|
}
|
|
6608
6655
|
}
|
|
6609
6656
|
},
|
|
@@ -6687,7 +6734,7 @@ function updateCssVars(vnode) {
|
|
|
6687
6734
|
const ctx = vnode.ctx;
|
|
6688
6735
|
if (ctx && ctx.ut) {
|
|
6689
6736
|
let node = vnode.children[0].el;
|
|
6690
|
-
while (node !== vnode.targetAnchor) {
|
|
6737
|
+
while (node && node !== vnode.targetAnchor) {
|
|
6691
6738
|
if (node.nodeType === 1)
|
|
6692
6739
|
node.setAttribute("data-v-owner", ctx.uid);
|
|
6693
6740
|
node = node.nextSibling;
|
|
@@ -7734,7 +7781,7 @@ function isMemoSame(cached, memo) {
|
|
|
7734
7781
|
return true;
|
|
7735
7782
|
}
|
|
7736
7783
|
|
|
7737
|
-
const version = "3.3.
|
|
7784
|
+
const version = "3.3.7";
|
|
7738
7785
|
const _ssrUtils = {
|
|
7739
7786
|
createComponentInstance,
|
|
7740
7787
|
setupComponent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.7",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vue/shared": "3.3.
|
|
36
|
-
"@vue/reactivity": "3.3.
|
|
35
|
+
"@vue/shared": "3.3.7",
|
|
36
|
+
"@vue/reactivity": "3.3.7"
|
|
37
37
|
}
|
|
38
38
|
}
|