@vue/runtime-core 3.6.0-beta.10 → 3.6.0-beta.12
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 +48 -18
- package/dist/runtime-core.cjs.prod.js +40 -14
- package/dist/runtime-core.d.ts +5 -1
- package/dist/runtime-core.esm-bundler.js +49 -19
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-core v3.6.0-beta.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -884,7 +884,7 @@ const TeleportImpl = {
|
|
|
884
884
|
name: "Teleport",
|
|
885
885
|
__isTeleport: true,
|
|
886
886
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
887
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
887
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
888
888
|
const disabled = isTeleportDisabled(n2.props);
|
|
889
889
|
let { dynamicChildren } = n2;
|
|
890
890
|
if (isHmrUpdating) {
|
|
@@ -913,7 +913,7 @@ const TeleportImpl = {
|
|
|
913
913
|
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
914
914
|
pendingMounts.delete(vnode);
|
|
915
915
|
if (isTeleportDisabled(vnode.props)) {
|
|
916
|
-
mount(vnode, container, vnode.anchor);
|
|
916
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
917
917
|
updateCssVars(vnode, true);
|
|
918
918
|
}
|
|
919
919
|
mountToTarget(vnode);
|
|
@@ -993,7 +993,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
993
993
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
994
994
|
const isReorder = moveType === 2;
|
|
995
995
|
if (isReorder) insert(el, container, parentAnchor);
|
|
996
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
996
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
997
997
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
998
998
|
}
|
|
999
999
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -1118,8 +1118,8 @@ const BaseTransitionImpl = {
|
|
|
1118
1118
|
const state = useTransitionState();
|
|
1119
1119
|
return () => {
|
|
1120
1120
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
1121
|
-
|
|
1122
|
-
|
|
1121
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
1122
|
+
if (!child) return;
|
|
1123
1123
|
const rawProps = (0, _vue_reactivity.toRaw)(props);
|
|
1124
1124
|
const { mode } = rawProps;
|
|
1125
1125
|
checkTransitionMode(mode);
|
|
@@ -2477,6 +2477,7 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2477
2477
|
*/
|
|
2478
2478
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
2479
2479
|
let slot = slots[name];
|
|
2480
|
+
if (fallback) fallback.__vdom = true;
|
|
2480
2481
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
2481
2482
|
if (vaporSlot) {
|
|
2482
2483
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -2515,9 +2516,7 @@ function ensureValidVNode(vnodes) {
|
|
|
2515
2516
|
}
|
|
2516
2517
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
2517
2518
|
let vaporSlot;
|
|
2518
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
2519
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
2520
|
-
}
|
|
2519
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
2521
2520
|
}
|
|
2522
2521
|
//#endregion
|
|
2523
2522
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -2889,9 +2888,14 @@ function withAsyncContext(getAwaitable) {
|
|
|
2889
2888
|
setCurrentInstance(null, void 0);
|
|
2890
2889
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2891
2890
|
const restore = () => {
|
|
2891
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
2892
2892
|
setCurrentInstance(ctx);
|
|
2893
2893
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
2894
|
-
|
|
2894
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
2895
|
+
return () => {
|
|
2896
|
+
if (reset) reset();
|
|
2897
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
2898
|
+
};
|
|
2895
2899
|
};
|
|
2896
2900
|
const cleanup = () => {
|
|
2897
2901
|
setCurrentInstance(null, void 0);
|
|
@@ -3922,7 +3926,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
3922
3926
|
const receivedType = (0, _vue_shared.toRawType)(value);
|
|
3923
3927
|
const expectedValue = styleValue(value, expectedType);
|
|
3924
3928
|
const receivedValue = styleValue(value, receivedType);
|
|
3925
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
3929
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
3926
3930
|
message += `, got ${receivedType} `;
|
|
3927
3931
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
3928
3932
|
return message;
|
|
@@ -3931,7 +3935,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
3931
3935
|
* dev only
|
|
3932
3936
|
*/
|
|
3933
3937
|
function styleValue(value, type) {
|
|
3934
|
-
if (
|
|
3938
|
+
if ((0, _vue_shared.isSymbol)(value)) return value.toString();
|
|
3939
|
+
else if (type === "String") return `"${value}"`;
|
|
3935
3940
|
else if (type === "Number") return `${Number(value)}`;
|
|
3936
3941
|
else return `${value}`;
|
|
3937
3942
|
}
|
|
@@ -3948,8 +3953,11 @@ function isExplicable(type) {
|
|
|
3948
3953
|
/**
|
|
3949
3954
|
* dev only
|
|
3950
3955
|
*/
|
|
3951
|
-
function
|
|
3952
|
-
return args.
|
|
3956
|
+
function isCoercible(...args) {
|
|
3957
|
+
return args.every((elem) => {
|
|
3958
|
+
const value = elem.toLowerCase();
|
|
3959
|
+
return value !== "boolean" && value !== "symbol";
|
|
3960
|
+
});
|
|
3953
3961
|
}
|
|
3954
3962
|
//#endregion
|
|
3955
3963
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -5132,15 +5140,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5132
5140
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
5133
5141
|
else if (!resume) {
|
|
5134
5142
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
5143
|
+
let hasUpdatedAnchor = false;
|
|
5135
5144
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
5136
5145
|
if (pendingId === suspense.pendingId) {
|
|
5137
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
5146
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
5138
5147
|
queuePostFlushCb(effects);
|
|
5139
5148
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
5140
5149
|
}
|
|
5141
5150
|
};
|
|
5142
5151
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
5143
|
-
if (parentNode(activeBranch.el) === container)
|
|
5152
|
+
if (parentNode(activeBranch.el) === container) {
|
|
5153
|
+
anchor = next(activeBranch);
|
|
5154
|
+
hasUpdatedAnchor = true;
|
|
5155
|
+
}
|
|
5144
5156
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
5145
5157
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
5146
5158
|
}
|
|
@@ -5494,11 +5506,29 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5494
5506
|
el: vnode.el,
|
|
5495
5507
|
anchor: vnode.anchor,
|
|
5496
5508
|
ctx: vnode.ctx,
|
|
5497
|
-
ce: vnode.ce
|
|
5509
|
+
ce: vnode.ce,
|
|
5510
|
+
vi: vnode.vi,
|
|
5511
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
5512
|
+
vb: vnode.vb
|
|
5498
5513
|
};
|
|
5499
5514
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5500
5515
|
return cloned;
|
|
5501
5516
|
}
|
|
5517
|
+
function cloneVaporSlotMeta(vnode) {
|
|
5518
|
+
const vaporSlot = vnode.vs;
|
|
5519
|
+
if (!vaporSlot) return vaporSlot;
|
|
5520
|
+
const cloned = {
|
|
5521
|
+
slot: vaporSlot.slot,
|
|
5522
|
+
fallback: vaporSlot.fallback,
|
|
5523
|
+
outletFallback: vaporSlot.outletFallback
|
|
5524
|
+
};
|
|
5525
|
+
if (vnode.el) {
|
|
5526
|
+
cloned.state = vaporSlot.state;
|
|
5527
|
+
cloned.ref = vaporSlot.ref;
|
|
5528
|
+
cloned.scope = vaporSlot.scope;
|
|
5529
|
+
}
|
|
5530
|
+
return cloned;
|
|
5531
|
+
}
|
|
5502
5532
|
/**
|
|
5503
5533
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
5504
5534
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -6164,7 +6194,7 @@ function isMemoSame(cached, memo) {
|
|
|
6164
6194
|
}
|
|
6165
6195
|
//#endregion
|
|
6166
6196
|
//#region packages/runtime-core/src/index.ts
|
|
6167
|
-
const version = "3.6.0-beta.
|
|
6197
|
+
const version = "3.6.0-beta.12";
|
|
6168
6198
|
const warn = warn$1;
|
|
6169
6199
|
/**
|
|
6170
6200
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-core v3.6.0-beta.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -542,7 +542,7 @@ const TeleportImpl = {
|
|
|
542
542
|
name: "Teleport",
|
|
543
543
|
__isTeleport: true,
|
|
544
544
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
545
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
545
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
546
546
|
const disabled = isTeleportDisabled(n2.props);
|
|
547
547
|
let { dynamicChildren } = n2;
|
|
548
548
|
const mount = (vnode, container, anchor) => {
|
|
@@ -567,7 +567,7 @@ const TeleportImpl = {
|
|
|
567
567
|
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
568
568
|
pendingMounts.delete(vnode);
|
|
569
569
|
if (isTeleportDisabled(vnode.props)) {
|
|
570
|
-
mount(vnode, container, vnode.anchor);
|
|
570
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
571
571
|
updateCssVars(vnode, true);
|
|
572
572
|
}
|
|
573
573
|
mountToTarget(vnode);
|
|
@@ -646,7 +646,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
646
646
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
647
647
|
const isReorder = moveType === 2;
|
|
648
648
|
if (isReorder) insert(el, container, parentAnchor);
|
|
649
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
649
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
650
650
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
651
651
|
}
|
|
652
652
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -771,8 +771,8 @@ const BaseTransitionImpl = {
|
|
|
771
771
|
const state = useTransitionState();
|
|
772
772
|
return () => {
|
|
773
773
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
774
|
-
|
|
775
|
-
|
|
774
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
775
|
+
if (!child) return;
|
|
776
776
|
const rawProps = (0, _vue_reactivity.toRaw)(props);
|
|
777
777
|
const { mode } = rawProps;
|
|
778
778
|
if (state.isLeaving) return emptyPlaceholder(child);
|
|
@@ -1956,6 +1956,7 @@ function createSlots(slots, dynamicSlots) {
|
|
|
1956
1956
|
*/
|
|
1957
1957
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
1958
1958
|
let slot = slots[name];
|
|
1959
|
+
if (fallback) fallback.__vdom = true;
|
|
1959
1960
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
1960
1961
|
if (vaporSlot) {
|
|
1961
1962
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -1990,9 +1991,7 @@ function ensureValidVNode(vnodes) {
|
|
|
1990
1991
|
}
|
|
1991
1992
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
1992
1993
|
let vaporSlot;
|
|
1993
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
1994
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
1995
|
-
}
|
|
1994
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
1996
1995
|
}
|
|
1997
1996
|
//#endregion
|
|
1998
1997
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -2273,9 +2272,14 @@ function withAsyncContext(getAwaitable) {
|
|
|
2273
2272
|
setCurrentInstance(null, void 0);
|
|
2274
2273
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2275
2274
|
const restore = () => {
|
|
2275
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
2276
2276
|
setCurrentInstance(ctx);
|
|
2277
2277
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
2278
|
-
|
|
2278
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
2279
|
+
return () => {
|
|
2280
|
+
if (reset) reset();
|
|
2281
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
2282
|
+
};
|
|
2279
2283
|
};
|
|
2280
2284
|
const cleanup = () => {
|
|
2281
2285
|
setCurrentInstance(null, void 0);
|
|
@@ -4104,15 +4108,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4104
4108
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
4105
4109
|
else if (!resume) {
|
|
4106
4110
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
4111
|
+
let hasUpdatedAnchor = false;
|
|
4107
4112
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
4108
4113
|
if (pendingId === suspense.pendingId) {
|
|
4109
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
4114
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
4110
4115
|
queuePostFlushCb(effects);
|
|
4111
4116
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
4112
4117
|
}
|
|
4113
4118
|
};
|
|
4114
4119
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
4115
|
-
if (parentNode(activeBranch.el) === container)
|
|
4120
|
+
if (parentNode(activeBranch.el) === container) {
|
|
4121
|
+
anchor = next(activeBranch);
|
|
4122
|
+
hasUpdatedAnchor = true;
|
|
4123
|
+
}
|
|
4116
4124
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
4117
4125
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
4118
4126
|
}
|
|
@@ -4440,11 +4448,29 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
4440
4448
|
el: vnode.el,
|
|
4441
4449
|
anchor: vnode.anchor,
|
|
4442
4450
|
ctx: vnode.ctx,
|
|
4443
|
-
ce: vnode.ce
|
|
4451
|
+
ce: vnode.ce,
|
|
4452
|
+
vi: vnode.vi,
|
|
4453
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
4454
|
+
vb: vnode.vb
|
|
4444
4455
|
};
|
|
4445
4456
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
4446
4457
|
return cloned;
|
|
4447
4458
|
}
|
|
4459
|
+
function cloneVaporSlotMeta(vnode) {
|
|
4460
|
+
const vaporSlot = vnode.vs;
|
|
4461
|
+
if (!vaporSlot) return vaporSlot;
|
|
4462
|
+
const cloned = {
|
|
4463
|
+
slot: vaporSlot.slot,
|
|
4464
|
+
fallback: vaporSlot.fallback,
|
|
4465
|
+
outletFallback: vaporSlot.outletFallback
|
|
4466
|
+
};
|
|
4467
|
+
if (vnode.el) {
|
|
4468
|
+
cloned.state = vaporSlot.state;
|
|
4469
|
+
cloned.ref = vaporSlot.ref;
|
|
4470
|
+
cloned.scope = vaporSlot.scope;
|
|
4471
|
+
}
|
|
4472
|
+
return cloned;
|
|
4473
|
+
}
|
|
4448
4474
|
/**
|
|
4449
4475
|
* @private
|
|
4450
4476
|
*/
|
|
@@ -4856,7 +4882,7 @@ function isMemoSame(cached, memo) {
|
|
|
4856
4882
|
}
|
|
4857
4883
|
//#endregion
|
|
4858
4884
|
//#region packages/runtime-core/src/index.ts
|
|
4859
|
-
const version = "3.6.0-beta.
|
|
4885
|
+
const version = "3.6.0-beta.12";
|
|
4860
4886
|
const warn = _vue_shared.NOOP;
|
|
4861
4887
|
/**
|
|
4862
4888
|
* Runtime error messages. Only exposed in dev or esm builds.
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -1764,11 +1764,15 @@ export declare function renderList<T>(source: T, renderItem: <K extends keyof T>
|
|
|
1764
1764
|
export declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean): Record<string, any>;
|
|
1765
1765
|
//#endregion
|
|
1766
1766
|
//#region temp/packages/runtime-core/src/helpers/renderSlot.d.ts
|
|
1767
|
+
type SlotFallback = {
|
|
1768
|
+
(): VNodeArrayChildren;
|
|
1769
|
+
__vdom?: boolean;
|
|
1770
|
+
};
|
|
1767
1771
|
/**
|
|
1768
1772
|
* Compiler runtime helper for rendering `<slot/>`
|
|
1769
1773
|
* @private
|
|
1770
1774
|
*/
|
|
1771
|
-
export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?:
|
|
1775
|
+
export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: SlotFallback, noSlotted?: boolean): VNode;
|
|
1772
1776
|
//#endregion
|
|
1773
1777
|
//#region temp/packages/runtime-core/src/helpers/createSlots.d.ts
|
|
1774
1778
|
type SSRSlot = (...args: any[]) => VNode[] | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-core v3.6.0-beta.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -892,7 +892,7 @@ const TeleportImpl = {
|
|
|
892
892
|
name: "Teleport",
|
|
893
893
|
__isTeleport: true,
|
|
894
894
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
895
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
895
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
896
896
|
const disabled = isTeleportDisabled(n2.props);
|
|
897
897
|
let { dynamicChildren } = n2;
|
|
898
898
|
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
|
|
@@ -921,7 +921,7 @@ const TeleportImpl = {
|
|
|
921
921
|
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
922
922
|
pendingMounts.delete(vnode);
|
|
923
923
|
if (isTeleportDisabled(vnode.props)) {
|
|
924
|
-
mount(vnode, container, vnode.anchor);
|
|
924
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
925
925
|
updateCssVars(vnode, true);
|
|
926
926
|
}
|
|
927
927
|
mountToTarget(vnode);
|
|
@@ -1001,7 +1001,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
1001
1001
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
1002
1002
|
const isReorder = moveType === 2;
|
|
1003
1003
|
if (isReorder) insert(el, container, parentAnchor);
|
|
1004
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
1004
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
1005
1005
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
1006
1006
|
}
|
|
1007
1007
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -1126,8 +1126,8 @@ const BaseTransitionImpl = {
|
|
|
1126
1126
|
const state = useTransitionState();
|
|
1127
1127
|
return () => {
|
|
1128
1128
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
1129
|
-
|
|
1130
|
-
|
|
1129
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
1130
|
+
if (!child) return;
|
|
1131
1131
|
const rawProps = toRaw$1(props);
|
|
1132
1132
|
const { mode } = rawProps;
|
|
1133
1133
|
checkTransitionMode(mode);
|
|
@@ -2514,6 +2514,7 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2514
2514
|
*/
|
|
2515
2515
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
2516
2516
|
let slot = slots[name];
|
|
2517
|
+
if (fallback) fallback.__vdom = true;
|
|
2517
2518
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
2518
2519
|
if (vaporSlot) {
|
|
2519
2520
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -2552,9 +2553,7 @@ function ensureValidVNode(vnodes) {
|
|
|
2552
2553
|
}
|
|
2553
2554
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
2554
2555
|
let vaporSlot;
|
|
2555
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
2556
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
2557
|
-
}
|
|
2556
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
2558
2557
|
}
|
|
2559
2558
|
//#endregion
|
|
2560
2559
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -2926,9 +2925,14 @@ function withAsyncContext(getAwaitable) {
|
|
|
2926
2925
|
setCurrentInstance(null, void 0);
|
|
2927
2926
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2928
2927
|
const restore = () => {
|
|
2928
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
2929
2929
|
setCurrentInstance(ctx);
|
|
2930
2930
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
2931
|
-
|
|
2931
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
2932
|
+
return () => {
|
|
2933
|
+
if (reset) reset();
|
|
2934
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
2935
|
+
};
|
|
2932
2936
|
};
|
|
2933
2937
|
const cleanup = () => {
|
|
2934
2938
|
setCurrentInstance(null, void 0);
|
|
@@ -3970,7 +3974,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
3970
3974
|
const receivedType = toRawType(value);
|
|
3971
3975
|
const expectedValue = styleValue(value, expectedType);
|
|
3972
3976
|
const receivedValue = styleValue(value, receivedType);
|
|
3973
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
3977
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
3974
3978
|
message += `, got ${receivedType} `;
|
|
3975
3979
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
3976
3980
|
return message;
|
|
@@ -3979,7 +3983,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
3979
3983
|
* dev only
|
|
3980
3984
|
*/
|
|
3981
3985
|
function styleValue(value, type) {
|
|
3982
|
-
if (
|
|
3986
|
+
if (isSymbol(value)) return value.toString();
|
|
3987
|
+
else if (type === "String") return `"${value}"`;
|
|
3983
3988
|
else if (type === "Number") return `${Number(value)}`;
|
|
3984
3989
|
else return `${value}`;
|
|
3985
3990
|
}
|
|
@@ -3996,8 +4001,11 @@ function isExplicable(type) {
|
|
|
3996
4001
|
/**
|
|
3997
4002
|
* dev only
|
|
3998
4003
|
*/
|
|
3999
|
-
function
|
|
4000
|
-
return args.
|
|
4004
|
+
function isCoercible(...args) {
|
|
4005
|
+
return args.every((elem) => {
|
|
4006
|
+
const value = elem.toLowerCase();
|
|
4007
|
+
return value !== "boolean" && value !== "symbol";
|
|
4008
|
+
});
|
|
4001
4009
|
}
|
|
4002
4010
|
//#endregion
|
|
4003
4011
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -5221,15 +5229,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5221
5229
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
5222
5230
|
else if (!resume) {
|
|
5223
5231
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
5232
|
+
let hasUpdatedAnchor = false;
|
|
5224
5233
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
5225
5234
|
if (pendingId === suspense.pendingId) {
|
|
5226
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
5235
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
5227
5236
|
queuePostFlushCb(effects);
|
|
5228
5237
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
5229
5238
|
}
|
|
5230
5239
|
};
|
|
5231
5240
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
5232
|
-
if (parentNode(activeBranch.el) === container)
|
|
5241
|
+
if (parentNode(activeBranch.el) === container) {
|
|
5242
|
+
anchor = next(activeBranch);
|
|
5243
|
+
hasUpdatedAnchor = true;
|
|
5244
|
+
}
|
|
5233
5245
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
5234
5246
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
5235
5247
|
}
|
|
@@ -5583,11 +5595,29 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5583
5595
|
el: vnode.el,
|
|
5584
5596
|
anchor: vnode.anchor,
|
|
5585
5597
|
ctx: vnode.ctx,
|
|
5586
|
-
ce: vnode.ce
|
|
5598
|
+
ce: vnode.ce,
|
|
5599
|
+
vi: vnode.vi,
|
|
5600
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
5601
|
+
vb: vnode.vb
|
|
5587
5602
|
};
|
|
5588
5603
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5589
5604
|
return cloned;
|
|
5590
5605
|
}
|
|
5606
|
+
function cloneVaporSlotMeta(vnode) {
|
|
5607
|
+
const vaporSlot = vnode.vs;
|
|
5608
|
+
if (!vaporSlot) return vaporSlot;
|
|
5609
|
+
const cloned = {
|
|
5610
|
+
slot: vaporSlot.slot,
|
|
5611
|
+
fallback: vaporSlot.fallback,
|
|
5612
|
+
outletFallback: vaporSlot.outletFallback
|
|
5613
|
+
};
|
|
5614
|
+
if (vnode.el) {
|
|
5615
|
+
cloned.state = vaporSlot.state;
|
|
5616
|
+
cloned.ref = vaporSlot.ref;
|
|
5617
|
+
cloned.scope = vaporSlot.scope;
|
|
5618
|
+
}
|
|
5619
|
+
return cloned;
|
|
5620
|
+
}
|
|
5591
5621
|
/**
|
|
5592
5622
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
5593
5623
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -6272,7 +6302,7 @@ function isMemoSame(cached, memo) {
|
|
|
6272
6302
|
}
|
|
6273
6303
|
//#endregion
|
|
6274
6304
|
//#region packages/runtime-core/src/index.ts
|
|
6275
|
-
const version = "3.6.0-beta.
|
|
6305
|
+
const version = "3.6.0-beta.12";
|
|
6276
6306
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
6277
6307
|
/**
|
|
6278
6308
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -6307,4 +6337,4 @@ const resolveFilter = null;
|
|
|
6307
6337
|
const compatUtils = null;
|
|
6308
6338
|
const DeprecationTypes = null;
|
|
6309
6339
|
//#endregion
|
|
6310
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureVaporSlotFallback, expose, flushOnAppMount, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
|
6340
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.6.0-beta.
|
|
3
|
+
"version": "3.6.0-beta.12",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@vue/shared": "3.6.0-beta.
|
|
50
|
-
"@vue/reactivity": "3.6.0-beta.
|
|
49
|
+
"@vue/shared": "3.6.0-beta.12",
|
|
50
|
+
"@vue/reactivity": "3.6.0-beta.12"
|
|
51
51
|
}
|
|
52
52
|
}
|